@payloadcms/plugin-cloud-storage 1.0.16 → 1.0.17-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 (74) hide show
  1. package/.editorconfig +10 -0
  2. package/.gitignore +248 -0
  3. package/.prettierignore +1 -0
  4. package/.prettierrc.js +8 -0
  5. package/.vscode/launch.json +40 -0
  6. package/.vscode/settings.json +9 -0
  7. package/README.md +20 -2
  8. package/dev/.env +21 -0
  9. package/dev/.env.example +21 -0
  10. package/dev/nodemon.json +8 -0
  11. package/dev/package.json +34 -0
  12. package/dev/src/collections/Media.ts +56 -0
  13. package/dev/src/collections/Users.ts +23 -0
  14. package/dev/src/mocks/fsMock.js +1 -0
  15. package/dev/src/mocks/promisifyMock.js +1 -0
  16. package/dev/src/payload.config.ts +111 -0
  17. package/dev/src/server.ts +26 -0
  18. package/dev/tsconfig.json +20 -0
  19. package/dist/plugin.d.ts +1 -1
  20. package/dist/plugin.js +10 -4
  21. package/dist/plugin.js.map +1 -1
  22. package/dist/types.d.ts +6 -0
  23. package/docs/local-dev.md +47 -0
  24. package/eslint-config/index.js +15 -0
  25. package/eslint-config/rules/import.js +38 -0
  26. package/eslint-config/rules/prettier.js +7 -0
  27. package/eslint-config/rules/style.js +21 -0
  28. package/eslint-config/rules/typescript.js +628 -0
  29. package/package.json +1 -1
  30. package/src/adapters/azure/emulator/docker-compose.yml +16 -0
  31. package/src/adapters/azure/fileStub.js +1 -0
  32. package/src/adapters/azure/generateURL.ts +13 -0
  33. package/src/adapters/azure/handleDelete.ts +16 -0
  34. package/src/adapters/azure/handleUpload.ts +41 -0
  35. package/src/adapters/azure/index.ts +48 -0
  36. package/src/adapters/azure/mock.js +13 -0
  37. package/src/adapters/azure/staticHandler.ts +38 -0
  38. package/src/adapters/azure/webpack.ts +24 -0
  39. package/src/adapters/gcs/emulator/docker-compose.yml +15 -0
  40. package/src/adapters/gcs/generateURL.ts +16 -0
  41. package/src/adapters/gcs/handleDelete.ts +16 -0
  42. package/src/adapters/gcs/handleUpload.ts +34 -0
  43. package/src/adapters/gcs/index.ts +37 -0
  44. package/src/adapters/gcs/mock.js +3 -0
  45. package/src/adapters/gcs/staticHandler.ts +34 -0
  46. package/src/adapters/gcs/webpack.ts +21 -0
  47. package/src/adapters/s3/emulator/.localstack/cache/machine.json +1 -0
  48. package/src/adapters/s3/emulator/.localstack/cache/server.test.pem +127 -0
  49. package/src/adapters/s3/emulator/.localstack/cache/server.test.pem.crt +99 -0
  50. package/src/adapters/s3/emulator/.localstack/cache/server.test.pem.key +28 -0
  51. package/src/adapters/s3/emulator/.localstack/cache/service-catalog-2_1_1_dev-1_29_149.pickle +0 -0
  52. package/src/adapters/s3/emulator/docker-compose.yml +15 -0
  53. package/src/adapters/s3/fileStub.js +1 -0
  54. package/src/adapters/s3/generateURL.ts +14 -0
  55. package/src/adapters/s3/handleDelete.ts +17 -0
  56. package/src/adapters/s3/handleUpload.ts +62 -0
  57. package/src/adapters/s3/index.ts +38 -0
  58. package/src/adapters/s3/mock.js +9 -0
  59. package/src/adapters/s3/staticHandler.ts +41 -0
  60. package/src/adapters/s3/webpack.ts +23 -0
  61. package/src/fields/getFields.ts +155 -0
  62. package/src/hooks/afterDelete.ts +35 -0
  63. package/src/hooks/afterRead.ts +38 -0
  64. package/src/hooks/beforeChange.ts +59 -0
  65. package/src/index.ts +1 -0
  66. package/src/plugin.ts +101 -0
  67. package/src/types.ts +79 -0
  68. package/src/utilities/getFilePrefix.ts +26 -0
  69. package/src/utilities/getIncomingFiles.ts +44 -0
  70. package/src/utilities/getRangeFromHeader.ts +27 -0
  71. package/src/webpack.ts +46 -0
  72. package/tsconfig.json +23 -0
  73. package/yarn-error.log +8163 -0
  74. package/yarn.lock +8062 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "lib": [
5
+ "dom",
6
+ "dom.iterable",
7
+ "esnext"
8
+ ],
9
+ "strict": false,
10
+ "esModuleInterop": true,
11
+ "skipLibCheck": true,
12
+ "outDir": "./dist",
13
+ "rootDir": "../",
14
+ "jsx": "react",
15
+ "sourceMap": true
16
+ },
17
+ "ts-node": {
18
+ "transpileOnly": true
19
+ }
20
+ }
package/dist/plugin.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { Config } from 'payload/config';
2
2
  import type { PluginOptions } from './types';
3
- export declare const cloudStorage: (pluginOptions: PluginOptions) => (config: Config) => Config;
3
+ export declare const cloudStorage: (pluginOptions: PluginOptions) => (incomingConfig: Config) => Config;
package/dist/plugin.js CHANGED
@@ -68,11 +68,17 @@ var getFields_1 = require("./fields/getFields");
68
68
  // 1. handleUpload, 2. handleDelete, 3. generateURL, 4. staticHandler
69
69
  // Optionally, the adapter can specify any Webpack config overrides if they are necessary.
70
70
  var cloudStorage = function (pluginOptions) {
71
- return function (config) {
72
- var allCollectionOptions = pluginOptions.collections;
73
- var webpack = (0, webpack_1.extendWebpackConfig)({ options: pluginOptions, config: config });
71
+ return function (incomingConfig) {
72
+ var allCollectionOptions = pluginOptions.collections, enabled = pluginOptions.enabled;
73
+ var config = __assign({}, incomingConfig);
74
+ var webpack = (0, webpack_1.extendWebpackConfig)({ options: pluginOptions, config: incomingConfig });
75
+ config.admin = __assign(__assign({}, (config.admin || {})), { webpack: webpack });
76
+ // Return early if disabled. Only webpack config mods are applied.
77
+ if (enabled === false) {
78
+ return config;
79
+ }
74
80
  var initFunctions = [];
75
- return __assign(__assign({}, config), { admin: __assign(__assign({}, (config.admin || {})), { webpack: webpack }), collections: (config.collections || []).map(function (existingCollection) {
81
+ return __assign(__assign({}, config), { collections: (config.collections || []).map(function (existingCollection) {
76
82
  var _a, _b;
77
83
  var options = allCollectionOptions[existingCollection.slug];
78
84
  if (options === null || options === void 0 ? void 0 : options.adapter) {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;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kCACP,CAAC,CAAA,MAAA,kBAAkB,CAAC,KAAK,0CAAE,YAAY,KAAI,EAAE,CAAC;gCACjD,IAAA,kCAAmB,EAAC,EAAE,OAAO,SAAA,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC;uCAElE,WAAW,kCACN,CAAC,CAAA,MAAA,kBAAkB,CAAC,KAAK,0CAAE,WAAW,KAAI,EAAE,CAAC;gCAChD,IAAA,gCAAkB,EAAC,EAAE,OAAO,SAAA,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC;0CAGnE,MAAM,QAAA,IACP;iBACF;gBAED,OAAO,kBAAkB,CAAA;YAC3B,CAAC,CAAC,EACF,MAAM,EAAE,UAAM,OAAO;;;;4BACnB,aAAa,CAAC,OAAO,CAAC,UAAA,EAAE,IAAI,OAAA,EAAE,EAAE,EAAJ,CAAI,CAAC,CAAA;iCAC7B,MAAM,CAAC,MAAM,EAAb,wBAAa;4BAAE,qBAAM,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAA;;4BAA5B,SAA4B,CAAA;;;;;iBAChD,IACF;IACH,CAAC;AAlFD,CAkFC,CAAA;AApFU,QAAA,YAAY,gBAoFtB"}
package/dist/types.d.ts CHANGED
@@ -58,5 +58,11 @@ export interface CollectionOptions {
58
58
  adapter: Adapter | null;
59
59
  }
60
60
  export interface PluginOptions {
61
+ /**
62
+ * Whether or not to enable the plugin
63
+ *
64
+ * Default: true
65
+ */
66
+ enabled?: boolean;
61
67
  collections: Record<string, CollectionOptions>;
62
68
  }
@@ -0,0 +1,47 @@
1
+ # Developing with this plugin locally
2
+
3
+ This repository includes a local development environment for local testing and development of this plugin. To run the local sandbox, follow the instructions below.
4
+
5
+ 1. Make sure you have Node and a MongoDB to work with
6
+ 1. Clone the repo
7
+ 1. `yarn` in both the root folder of the repo, and the `./dev` folder
8
+ 1. `cd` into `./dev` and run `cp .env.example .env` to create an `.env` file
9
+ 1. Open your newly created `./dev/.env` file and _completely_ fill out each property
10
+
11
+ ### Azure Adapter Development
12
+
13
+ This repository comes with a Docker emulator for Azure Blob Storage.
14
+
15
+ If you would like to test locally with an emulated blob storage container, you can `cd` into `./src/adapters/azure/emulator` and then run `docker-compose up -d`.
16
+
17
+ The default `./dev/.env.example` file comes pre-loaded with correct `env` variables that correspond to the Azure Docker emulator.
18
+
19
+ Otherwise, if you are not using the emulator, make sure your environment variables within `./dev/.env` are configured for your Azure connection.
20
+
21
+ Finally, to start the Payload dev server with the Azure adapter, run `yarn dev:azure` and then open `http://localhost:3000/admin` in your browser.
22
+
23
+ ### S3 Adapter Development
24
+
25
+ This repository also includes a Docker LocalStack emulator for S3. It requires a few more steps to get up and running.
26
+
27
+ To use the S3 emulator, use the following steps:
28
+
29
+ 1. Make sure you have `awscli` installed. On Mac, run `brew install awscli` to get started.
30
+ 1. Make sure you have an AWS profile created. LocalStack does not verify credentials, so you can create a profile with dummy credentials. However, your `region` will need to match. To create a dummy profile for LocalStack, type `aws configure --profile localstack`. Use the access key and secret from the `./dev/.env.example` and use region `us-east-1`.
31
+ 1. Now you can start the Docker container via moving to the `./src/adapters/s3/emulator` folder and running `docker-compose up -d`.
32
+ 1. Once the Docker container is running, you can create a new bucket with the following command: `aws --endpoint-url=http://localhost:4566 s3 mb s3://payload-bucket`. Note that our bucket is called `payload-bucket`.
33
+ 1. Finally, attach an ACL to the bucket so it is readable: `aws --endpoint-url=http://localhost:4566 s3api put-bucket-acl --bucket payload-bucket --acl public-read`
34
+
35
+ Finally, you can run `yarn dev:s3` and then open `http://localhost:3000/admin` in your browser.
36
+
37
+ ### Google Cloud Storage(GCS) Adapter Development
38
+
39
+ This repository comes with a Docker emulator for Google Cloud Storage.
40
+
41
+ If you would like to test locally with an emulated GCS container, you can `cd` into `./src/adapters/gcs/emulator` and then run `docker-compose up -d`.
42
+
43
+ The default `./dev/.env.example` file comes pre-loaded with correct `env` variables that correspond to the GCS Docker emulator.
44
+
45
+ Otherwise, if you are not using the emulator, make sure your environment variables within `./dev/.env` are configured for your Google connection.
46
+
47
+ Finally, to start the Payload dev server with the GCS adapter, run `yarn dev:gcs` and then open `http://localhost:3000/admin` in your browser.
@@ -0,0 +1,15 @@
1
+ module.exports = {
2
+ parser: '@typescript-eslint/parser',
3
+ extends: [
4
+ 'airbnb-base',
5
+ require.resolve('./rules/style.js'),
6
+ require.resolve('./rules/import.js'),
7
+ require.resolve('./rules/typescript.js'),
8
+ require.resolve('./rules/prettier.js'),
9
+ ],
10
+ env: {
11
+ es6: true,
12
+ browser: true,
13
+ node: true,
14
+ },
15
+ }
@@ -0,0 +1,38 @@
1
+ module.exports = {
2
+ env: {
3
+ es6: true,
4
+ },
5
+ extends: ['plugin:import/errors', 'plugin:import/warnings', 'plugin:import/typescript'],
6
+ plugins: ['import'],
7
+ settings: {
8
+ 'import/parsers': {
9
+ '@typescript-eslint/parser': ['.ts'],
10
+ },
11
+ },
12
+ rules: {
13
+ /**
14
+ * https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
15
+ */
16
+ 'import/no-unresolved': ['error', { commonjs: true, caseSensitive: true }],
17
+ 'import/no-default-export': 'off',
18
+ 'import/prefer-default-export': 'off',
19
+ 'import/extensions': [
20
+ 'error',
21
+ 'ignorePackages',
22
+ {
23
+ ts: 'never',
24
+ tsx: 'never',
25
+ js: 'never',
26
+ jsx: 'never',
27
+ },
28
+ ],
29
+ 'import/no-extraneous-dependencies': 'off',
30
+ /**
31
+ * https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
32
+ */
33
+ 'import/named': 'error',
34
+ 'import/no-relative-packages': 'warn',
35
+ 'import/no-import-module-exports': 'warn',
36
+ 'import/no-cycle': 'warn',
37
+ },
38
+ }
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ plugins: ['prettier'],
3
+ extends: ['plugin:prettier/recommended'],
4
+ rules: {
5
+ 'prettier/prettier': 'error',
6
+ },
7
+ }
@@ -0,0 +1,21 @@
1
+ module.exports = {
2
+ rules: {
3
+ 'prefer-named-exports': 'off',
4
+
5
+ 'prefer-destructuring': 'off',
6
+ // 'prefer-destructuring': ['warn', { object: true, array: true }],
7
+ // ensure all object/arrays end with a comma
8
+ 'comma-dangle': ['error', 'always-multiline'],
9
+ 'class-methods-use-this': 'off',
10
+ // consistent new lines
11
+ 'function-paren-newline': ['error', 'consistent'],
12
+ 'eol-last': ['error', 'always'],
13
+ // allow restricted syntax like for...of loops
14
+ 'no-restricted-syntax': 'off',
15
+ 'no-await-in-loop': 'off',
16
+ 'no-console': 'error',
17
+ // 'no-floating-promises': true,
18
+ // do not allow process.env access in files
19
+ 'no-process-env': 'warn',
20
+ },
21
+ }