@ever-works/minio-plugin 1.0.0 → 1.0.2

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.
@@ -1,107 +0,0 @@
1
- import { AwsS3StoragePlugin, type S3Config } from '@ever-works/aws-s3-plugin';
2
- import type { PluginCategory, PluginManifest, JsonSchema, PluginContext } from '@ever-works/plugin';
3
-
4
- /**
5
- * EW-637 — MinIO storage backend.
6
- *
7
- * Functionally identical to AWS S3 but pointed at a custom endpoint
8
- * (typically a self-hosted MinIO cluster) with path-style URLs forced on
9
- * (MinIO doesn't always support virtual-hosted-style with arbitrary
10
- * bucket names). We reuse `AwsS3StoragePlugin` and only override the
11
- * env-resolution + manifest metadata.
12
- */
13
- export class MinioStoragePlugin extends AwsS3StoragePlugin {
14
- override readonly id = 'minio';
15
- override readonly name = 'MinIO';
16
- override readonly category: PluginCategory = 'storage';
17
- override readonly providerName = 'minio';
18
-
19
- override readonly settingsSchema: JsonSchema = {
20
- type: 'object',
21
- properties: {
22
- endpoint: {
23
- type: 'string',
24
- title: 'MinIO Endpoint',
25
- description: 'Full endpoint URL (e.g. https://minio.example.com:9000).',
26
- 'x-envVar': 'MINIO_ENDPOINT'
27
- },
28
- region: {
29
- type: 'string',
30
- title: 'Region Label',
31
- description: 'Region string sent in S3 requests. MinIO ignores it (default us-east-1).',
32
- default: 'us-east-1',
33
- 'x-envVar': 'MINIO_REGION'
34
- },
35
- bucket: {
36
- type: 'string',
37
- title: 'Bucket',
38
- description: 'MinIO bucket name.',
39
- 'x-envVar': 'MINIO_BUCKET'
40
- },
41
- accessKey: {
42
- type: 'string',
43
- title: 'Access Key',
44
- description: 'MinIO access key.',
45
- 'x-secret': true,
46
- 'x-envVar': 'MINIO_ACCESS_KEY'
47
- },
48
- secretKey: {
49
- type: 'string',
50
- title: 'Secret Key',
51
- description: 'MinIO secret key.',
52
- 'x-secret': true,
53
- 'x-envVar': 'MINIO_SECRET_KEY'
54
- },
55
- presignExpiresSeconds: {
56
- type: 'number',
57
- title: 'Presign URL TTL (seconds)',
58
- description: 'How long pre-signed upload URLs stay valid. Default 600 (10 min).',
59
- default: 600,
60
- minimum: 60,
61
- maximum: 3600,
62
- 'x-envVar': 'MINIO_PRESIGN_EXPIRES_SECONDS'
63
- }
64
- },
65
- required: ['endpoint', 'bucket']
66
- };
67
-
68
- protected override envOverrides(): Partial<S3Config> {
69
- const endpoint = process.env.MINIO_ENDPOINT;
70
- if (!endpoint) {
71
- throw new Error('MINIO_ENDPOINT is not set');
72
- }
73
- return {
74
- endpoint,
75
- region: process.env.MINIO_REGION || 'us-east-1',
76
- bucket: process.env.MINIO_BUCKET || '',
77
- accessKeyId: process.env.MINIO_ACCESS_KEY,
78
- secretAccessKey: process.env.MINIO_SECRET_KEY,
79
- forcePathStyle: true,
80
- presignExpiresSeconds: Number(process.env.MINIO_PRESIGN_EXPIRES_SECONDS) || 600
81
- };
82
- }
83
-
84
- override async onLoad(context: PluginContext): Promise<void> {
85
- // Chain to the parent so `this.context` (and the S3Client cache
86
- // state managed there) is initialized. The previous override
87
- // skipped super and left context undefined.
88
- await super.onLoad(context);
89
- context.logger.log('MinIO storage plugin loaded');
90
- }
91
-
92
- override getManifest(): PluginManifest {
93
- return {
94
- id: this.id,
95
- name: this.name,
96
- version: this.version,
97
- description: 'Self-hosted S3-compatible storage backend (MinIO).',
98
- category: this.category,
99
- capabilities: [...this.capabilities],
100
- builtIn: false,
101
- systemPlugin: false,
102
- icon: { type: 'lucide', value: 'Server', backgroundColor: '#c72e29' }
103
- };
104
- }
105
- }
106
-
107
- export default MinioStoragePlugin;
package/tsconfig.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "ESNext",
4
- "moduleResolution": "bundler",
5
- "target": "ES2021",
6
- "types": ["node"],
7
- "strict": true,
8
- "strictNullChecks": true,
9
- "noImplicitAny": true,
10
- "declaration": true,
11
- "declarationMap": true,
12
- "sourceMap": true,
13
- "outDir": "./dist",
14
- "rootDir": "./src",
15
- "esModuleInterop": true,
16
- "skipLibCheck": true,
17
- "forceConsistentCasingInFileNames": true,
18
- "isolatedModules": true,
19
- "noEmit": true
20
- },
21
- "include": ["src/**/*"],
22
- "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"]
23
- }
package/tsup.config.ts DELETED
@@ -1,12 +0,0 @@
1
- import { defineConfig } from 'tsup';
2
-
3
- export default defineConfig({
4
- entry: ['src/index.ts'],
5
- noExternal: ['@ever-works/plugin', '@ever-works/aws-s3-plugin'],
6
- format: ['cjs', 'esm'],
7
- dts: true,
8
- clean: true,
9
- sourcemap: false,
10
- splitting: false,
11
- treeshake: true
12
- });