@webiny/api-file-manager 0.0.0-mt-3 → 0.0.0-unstable.085ff6572f
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/FileManagerContextSetup.d.ts +13 -0
- package/FileManagerContextSetup.js +113 -0
- package/FileManagerContextSetup.js.map +1 -0
- package/cmsFileStorage/CmsFilesStorage.d.ts +27 -0
- package/cmsFileStorage/CmsFilesStorage.js +173 -0
- package/cmsFileStorage/CmsFilesStorage.js.map +1 -0
- package/cmsFileStorage/ListFilesWhereProcessor.d.ts +7 -0
- package/cmsFileStorage/ListFilesWhereProcessor.js +35 -0
- package/cmsFileStorage/ListFilesWhereProcessor.js.map +1 -0
- package/cmsFileStorage/ListTagsWhereProcessor.d.ts +7 -0
- package/cmsFileStorage/ListTagsWhereProcessor.js +35 -0
- package/cmsFileStorage/ListTagsWhereProcessor.js.map +1 -0
- package/cmsFileStorage/createFileManagerPlugins.d.ts +5 -0
- package/cmsFileStorage/createFileManagerPlugins.js +34 -0
- package/cmsFileStorage/createFileManagerPlugins.js.map +1 -0
- package/cmsFileStorage/createModelField.d.ts +5 -0
- package/cmsFileStorage/createModelField.js +37 -0
- package/cmsFileStorage/createModelField.js.map +1 -0
- package/cmsFileStorage/file.model.d.ts +4 -0
- package/cmsFileStorage/file.model.js +118 -0
- package/cmsFileStorage/file.model.js.map +1 -0
- package/cmsFileStorage/isInstallationPending.d.ts +4 -0
- package/cmsFileStorage/isInstallationPending.js +21 -0
- package/cmsFileStorage/isInstallationPending.js.map +1 -0
- package/contants.d.ts +1 -0
- package/contants.js +8 -0
- package/contants.js.map +1 -0
- package/createFileManager/files.crud.d.ts +3 -0
- package/createFileManager/files.crud.js +300 -0
- package/createFileManager/files.crud.js.map +1 -0
- package/createFileManager/filevalidation.disabled.d.ts +0 -0
- package/createFileManager/filevalidation.disabled.js +55 -0
- package/createFileManager/filevalidation.disabled.js.map +1 -0
- package/createFileManager/index.d.ts +15 -0
- package/createFileManager/index.js +20 -0
- package/createFileManager/index.js.map +1 -0
- package/createFileManager/permissions/FilesPermissions.d.ts +4 -0
- package/createFileManager/permissions/FilesPermissions.js +9 -0
- package/createFileManager/permissions/FilesPermissions.js.map +1 -0
- package/createFileManager/settings.crud.d.ts +3 -0
- package/createFileManager/settings.crud.js +91 -0
- package/createFileManager/settings.crud.js.map +1 -0
- package/createFileManager/system.crud.d.ts +3 -0
- package/createFileManager/system.crud.js +86 -0
- package/createFileManager/system.crud.js.map +1 -0
- package/graphql/baseSchema.d.ts +3 -0
- package/graphql/baseSchema.js +117 -0
- package/graphql/baseSchema.js.map +1 -0
- package/graphql/createFilesTypeDefs.d.ts +7 -0
- package/graphql/createFilesTypeDefs.js +162 -0
- package/graphql/createFilesTypeDefs.js.map +1 -0
- package/graphql/filesSchema.d.ts +4 -0
- package/graphql/filesSchema.js +83 -0
- package/graphql/filesSchema.js.map +1 -0
- package/graphql/index.d.ts +3 -0
- package/graphql/index.js +33 -0
- package/graphql/index.js.map +1 -0
- package/graphql/utils.d.ts +11 -0
- package/graphql/utils.js +22 -0
- package/graphql/utils.js.map +1 -0
- package/handlers/download/byAlias.d.ts +6 -0
- package/handlers/download/byAlias.js +89 -0
- package/handlers/download/byAlias.js.map +1 -0
- package/handlers/download/byExactKey.d.ts +2 -0
- package/handlers/download/byExactKey.js +57 -0
- package/handlers/download/byExactKey.js.map +1 -0
- package/handlers/download/extractFileInformation.d.ts +9 -0
- package/handlers/download/extractFileInformation.js +20 -0
- package/handlers/download/extractFileInformation.js.map +1 -0
- package/handlers/download/getS3Object.d.ts +10 -0
- package/handlers/download/getS3Object.js +60 -0
- package/handlers/download/getS3Object.js.map +1 -0
- package/handlers/download/index.d.ts +2 -3
- package/handlers/download/index.js +20 -118
- package/handlers/download/index.js.map +1 -0
- package/handlers/manage/index.d.ts +5 -3
- package/handlers/manage/index.js +43 -58
- package/handlers/manage/index.js.map +1 -0
- package/handlers/transform/index.d.ts +2 -3
- package/handlers/transform/index.js +71 -78
- package/handlers/transform/index.js.map +1 -0
- package/handlers/transform/legacyUtils.d.ts +17 -0
- package/handlers/transform/legacyUtils.js +42 -0
- package/handlers/transform/legacyUtils.js.map +1 -0
- package/handlers/transform/loaders/imageLoader.d.ts +26 -9
- package/handlers/transform/loaders/imageLoader.js +13 -25
- package/handlers/transform/loaders/imageLoader.js.map +1 -0
- package/handlers/transform/loaders/index.d.ts +4 -9
- package/handlers/transform/loaders/index.js +1 -4
- package/handlers/transform/loaders/index.js.map +1 -0
- package/handlers/transform/loaders/sanitizeImageTransformations.d.ts +7 -3
- package/handlers/transform/loaders/sanitizeImageTransformations.js +24 -30
- package/handlers/transform/loaders/sanitizeImageTransformations.js.map +1 -0
- package/handlers/transform/managers/imageManager.d.ts +12 -6
- package/handlers/transform/managers/imageManager.js +46 -27
- package/handlers/transform/managers/imageManager.js.map +1 -0
- package/handlers/transform/managers/index.d.ts +2 -6
- package/handlers/transform/managers/index.js +1 -4
- package/handlers/transform/managers/index.js.map +1 -0
- package/handlers/transform/optimizeImage.d.ts +2 -1
- package/handlers/transform/optimizeImage.js +4 -7
- package/handlers/transform/optimizeImage.js.map +1 -0
- package/handlers/transform/transformImage.d.ts +5 -4
- package/handlers/transform/transformImage.js +4 -9
- package/handlers/transform/transformImage.js.map +1 -0
- package/handlers/transform/utils.d.ts +2 -2
- package/handlers/transform/utils.js +8 -18
- package/handlers/transform/utils.js.map +1 -0
- package/handlers/types.d.ts +8 -0
- package/handlers/types.js +5 -0
- package/handlers/types.js.map +1 -0
- package/handlers/utils/getEnvironment.js +0 -2
- package/handlers/utils/getEnvironment.js.map +1 -0
- package/handlers/utils/getObjectParams.d.ts +3 -4
- package/handlers/utils/getObjectParams.js +1 -7
- package/handlers/utils/getObjectParams.js.map +1 -0
- package/handlers/utils/index.d.ts +0 -1
- package/handlers/utils/index.js +1 -12
- package/handlers/utils/index.js.map +1 -0
- package/index.d.ts +7 -0
- package/index.js +52 -0
- package/index.js.map +1 -0
- package/modelModifier/CmsModelModifier.d.ts +24 -0
- package/modelModifier/CmsModelModifier.js +59 -0
- package/modelModifier/CmsModelModifier.js.map +1 -0
- package/package.json +32 -32
- package/plugins/FilePhysicalStoragePlugin.d.ts +21 -0
- package/plugins/{definitions/FilePhysicalStoragePlugin.js → FilePhysicalStoragePlugin.js} +1 -12
- package/plugins/FilePhysicalStoragePlugin.js.map +1 -0
- package/plugins/{definitions/FileStorageTransformPlugin.d.ts → FileStorageTransformPlugin.d.ts} +10 -10
- package/plugins/{definitions/FileStorageTransformPlugin.js → FileStorageTransformPlugin.js} +2 -13
- package/plugins/FileStorageTransformPlugin.js.map +1 -0
- package/plugins/index.d.ts +2 -2
- package/plugins/index.js +22 -19
- package/plugins/index.js.map +1 -0
- package/storage/FileStorage.d.ts +32 -0
- package/storage/FileStorage.js +86 -0
- package/storage/FileStorage.js.map +1 -0
- package/types/file.d.ts +37 -0
- package/types/file.js +5 -0
- package/types/file.js.map +1 -0
- package/types/file.lifecycle.d.ts +44 -0
- package/types/file.lifecycle.js +5 -0
- package/types/file.lifecycle.js.map +1 -0
- package/types.d.ts +76 -83
- package/types.js +22 -0
- package/types.js.map +1 -0
- package/handlers/utils/createHandler.d.ts +0 -24
- package/handlers/utils/createHandler.js +0 -68
- package/plugins/crud/files/validation.d.ts +0 -3
- package/plugins/crud/files/validation.js +0 -41
- package/plugins/crud/files.crud.d.ts +0 -4
- package/plugins/crud/files.crud.js +0 -427
- package/plugins/crud/settings.crud.d.ts +0 -5
- package/plugins/crud/settings.crud.js +0 -115
- package/plugins/crud/system.crud.d.ts +0 -4
- package/plugins/crud/system.crud.js +0 -145
- package/plugins/crud/utils/checkBasePermissions.d.ts +0 -5
- package/plugins/crud/utils/checkBasePermissions.js +0 -33
- package/plugins/crud/utils/createFileModel.d.ts +0 -2
- package/plugins/crud/utils/createFileModel.js +0 -64
- package/plugins/crud/utils/lifecycleEvents.d.ts +0 -6
- package/plugins/crud/utils/lifecycleEvents.js +0 -33
- package/plugins/definitions/FilePhysicalStoragePlugin.d.ts +0 -22
- package/plugins/definitions/FilePlugin.d.ts +0 -133
- package/plugins/definitions/FilePlugin.js +0 -64
- package/plugins/definitions/FilesStorageOperationsProviderPlugin.d.ts +0 -9
- package/plugins/definitions/FilesStorageOperationsProviderPlugin.js +0 -17
- package/plugins/definitions/InstallationPlugin.d.ts +0 -19
- package/plugins/definitions/InstallationPlugin.js +0 -40
- package/plugins/definitions/SettingsStorageOperationsProviderPlugin.d.ts +0 -9
- package/plugins/definitions/SettingsStorageOperationsProviderPlugin.js +0 -17
- package/plugins/definitions/SystemStorageOperationsProviderPlugin.d.ts +0 -9
- package/plugins/definitions/SystemStorageOperationsProviderPlugin.js +0 -17
- package/plugins/graphql.d.ts +0 -4
- package/plugins/graphql.js +0 -274
- package/plugins/storage/FileStorage.d.ts +0 -31
- package/plugins/storage/FileStorage.js +0 -95
- package/plugins/storage/index.d.ts +0 -4
- package/plugins/storage/index.js +0 -22
- package/utils.d.ts +0 -4
- package/utils.js +0 -16
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _apiSecurity = require("@webiny/api-security");
|
|
9
|
-
|
|
10
|
-
var _default = async (context, check = {}) => {
|
|
11
|
-
await context.i18nContent.checkI18NContentPermission();
|
|
12
|
-
const filePermission = await context.security.getPermission("fm.file");
|
|
13
|
-
|
|
14
|
-
if (!filePermission) {
|
|
15
|
-
throw new _apiSecurity.NotAuthorizedError();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (check.rwd && !hasRwd(filePermission, check.rwd)) {
|
|
19
|
-
throw new _apiSecurity.NotAuthorizedError();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return filePermission;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
exports.default = _default;
|
|
26
|
-
|
|
27
|
-
const hasRwd = (filesFilePermission, rwd) => {
|
|
28
|
-
if (typeof filesFilePermission.rwd !== "string") {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return filesFilePermission.rwd.includes(rwd);
|
|
33
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _fields = require("@commodo/fields");
|
|
9
|
-
|
|
10
|
-
var _commodoFieldsObject = require("commodo-fields-object");
|
|
11
|
-
|
|
12
|
-
var _validation = require("@webiny/validation");
|
|
13
|
-
|
|
14
|
-
var _default = (create = true) => {
|
|
15
|
-
return (0, _fields.withFields)({
|
|
16
|
-
key: (0, _fields.string)({
|
|
17
|
-
validation: _validation.validation.create(`${create ? "required," : ""}maxLength:1000`)
|
|
18
|
-
}),
|
|
19
|
-
name: (0, _fields.string)({
|
|
20
|
-
validation: _validation.validation.create("maxLength:1000")
|
|
21
|
-
}),
|
|
22
|
-
size: (0, _fields.number)(),
|
|
23
|
-
type: (0, _fields.string)({
|
|
24
|
-
validation: _validation.validation.create("maxLength:255")
|
|
25
|
-
}),
|
|
26
|
-
meta: (0, _commodoFieldsObject.object)({
|
|
27
|
-
value: {
|
|
28
|
-
private: false
|
|
29
|
-
}
|
|
30
|
-
}),
|
|
31
|
-
tags: (0, _fields.onSet)(value => {
|
|
32
|
-
if (!Array.isArray(value)) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return value.map(item => item.toLowerCase());
|
|
37
|
-
})((0, _fields.string)({
|
|
38
|
-
list: true,
|
|
39
|
-
validation: tags => {
|
|
40
|
-
if (!Array.isArray(tags)) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (tags.length > 15) {
|
|
45
|
-
throw Error("You cannot set more than 15 tags.");
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
for (let i = 0; i < tags.length; i++) {
|
|
49
|
-
const tag = tags[i];
|
|
50
|
-
|
|
51
|
-
if (typeof tag !== "string") {
|
|
52
|
-
throw Error("Tag must be typeof string.");
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (tag.length > 50) {
|
|
56
|
-
throw Error(`Tag ${tag} is more than 50 characters long.`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}))
|
|
61
|
-
})();
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
exports.default = _default;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FilePlugin } from "../../definitions/FilePlugin";
|
|
2
|
-
import { FileManagerContext } from "../../../types";
|
|
3
|
-
export declare const runLifecycleEvent: (hook: string, params: {
|
|
4
|
-
context: FileManagerContext;
|
|
5
|
-
plugins: FilePlugin[];
|
|
6
|
-
} & Record<string, any>) => Promise<void>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.runLifecycleEvent = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
|
|
12
|
-
const _excluded = ["plugins"];
|
|
13
|
-
|
|
14
|
-
const runLifecycleEvent = async (hook, params) => {
|
|
15
|
-
const {
|
|
16
|
-
plugins
|
|
17
|
-
} = params,
|
|
18
|
-
rest = (0, _objectWithoutProperties2.default)(params, _excluded);
|
|
19
|
-
|
|
20
|
-
if (plugins.length === 0) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
for (const plugin of plugins) {
|
|
25
|
-
if (!plugin[hook]) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
await plugin[hook](rest);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
exports.runLifecycleEvent = runLifecycleEvent;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Plugin } from "@webiny/plugins";
|
|
3
|
-
import { FileManagerSettings } from "../../types";
|
|
4
|
-
export interface Params {
|
|
5
|
-
upload: (args: UploadParams) => Promise<any>;
|
|
6
|
-
delete: (args: DeleteParams) => Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export interface UploadParams {
|
|
9
|
-
settings: FileManagerSettings;
|
|
10
|
-
buffer: Buffer;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}
|
|
13
|
-
export interface DeleteParams {
|
|
14
|
-
key: string;
|
|
15
|
-
}
|
|
16
|
-
export declare class FilePhysicalStoragePlugin extends Plugin {
|
|
17
|
-
static readonly type = "api-file-manager-storage";
|
|
18
|
-
private readonly _params;
|
|
19
|
-
constructor(params: Params);
|
|
20
|
-
upload(params: UploadParams): Promise<any>;
|
|
21
|
-
delete(params: DeleteParams): Promise<any>;
|
|
22
|
-
}
|
|
@@ -1,133 +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 Params {
|
|
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 = "fm.file";
|
|
122
|
-
private readonly _params;
|
|
123
|
-
constructor(params?: Params);
|
|
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
|
-
private _execute;
|
|
133
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
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
|
-
async _execute(callback, params) {
|
|
54
|
-
if (typeof this._params[callback] !== "function") {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
await this._params[callback](params);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
exports.FilePlugin = FilePlugin;
|
|
64
|
-
(0, _defineProperty2.default)(FilePlugin, "type", "fm.file");
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import { FileManagerContext, FileManagerFilesStorageOperations } from "../../types";
|
|
3
|
-
export interface Params {
|
|
4
|
-
context: FileManagerContext;
|
|
5
|
-
}
|
|
6
|
-
export declare abstract class FilesStorageOperationsProviderPlugin extends Plugin {
|
|
7
|
-
static readonly type = "fm.storageOperationsProvider.files";
|
|
8
|
-
abstract provide(params: Params): Promise<FileManagerFilesStorageOperations>;
|
|
9
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
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,19 +0,0 @@
|
|
|
1
|
-
import { FileManagerContext } from "../../types";
|
|
2
|
-
import { Plugin } from "@webiny/plugins";
|
|
3
|
-
export declare type CallbackFunction<TParams> = (params: TParams) => Promise<void>;
|
|
4
|
-
export interface Params {
|
|
5
|
-
context: FileManagerContext;
|
|
6
|
-
}
|
|
7
|
-
interface Config {
|
|
8
|
-
beforeInstall?: CallbackFunction<Params>;
|
|
9
|
-
afterInstall?: CallbackFunction<Params>;
|
|
10
|
-
}
|
|
11
|
-
export declare abstract class InstallationPlugin extends Plugin {
|
|
12
|
-
static readonly type = "fm.install";
|
|
13
|
-
private readonly _config;
|
|
14
|
-
constructor(config?: Partial<Config>);
|
|
15
|
-
beforeInstall(params: Params): Promise<void>;
|
|
16
|
-
afterInstall(params: Params): Promise<void>;
|
|
17
|
-
private _execute;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
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
|
-
if (typeof this._config[callback] !== "function") {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return this._config[callback](params);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
exports.InstallationPlugin = InstallationPlugin;
|
|
40
|
-
(0, _defineProperty2.default)(InstallationPlugin, "type", "fm.install");
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import { FileManagerContext, FileManagerSettingsStorageOperations } from "../../types";
|
|
3
|
-
export interface Params {
|
|
4
|
-
context: FileManagerContext;
|
|
5
|
-
}
|
|
6
|
-
export declare abstract class SettingsStorageOperationsProviderPlugin extends Plugin {
|
|
7
|
-
static readonly type = "fm.storageOperationsProvider.settings";
|
|
8
|
-
abstract provide(params: Params): Promise<FileManagerSettingsStorageOperations>;
|
|
9
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
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,9 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import { FileManagerContext, FileManagerSystemStorageOperations } from "../../types";
|
|
3
|
-
export interface Params {
|
|
4
|
-
context: FileManagerContext;
|
|
5
|
-
}
|
|
6
|
-
export declare abstract class SystemStorageOperationsProviderPlugin extends Plugin {
|
|
7
|
-
static readonly type = "fm.storageOperationsProvider.system";
|
|
8
|
-
abstract provide(params: Params): Promise<FileManagerSystemStorageOperations>;
|
|
9
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
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");
|
package/plugins/graphql.d.ts
DELETED