@zola_do/seaweed 0.2.8 → 0.2.12

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 (2) hide show
  1. package/README.md +15 -15
  2. package/package.json +92 -92
package/README.md CHANGED
@@ -47,8 +47,8 @@ AWS_REGION=us-east-1
47
47
  ### 2. Register Module
48
48
 
49
49
  ```typescript
50
- import { Module } from "@nestjs/common";
51
- import { StorageModule } from "@zola_do/seaweed";
50
+ import { Module } from '@nestjs/common';
51
+ import { StorageModule } from '@zola_do/seaweed';
52
52
 
53
53
  @Module({
54
54
  imports: [StorageModule],
@@ -59,8 +59,8 @@ export class AppModule {}
59
59
  ### 3. Use Storage Service
60
60
 
61
61
  ```typescript
62
- import { Injectable } from "@nestjs/common";
63
- import { StorageService } from "@zola_do/seaweed";
62
+ import { Injectable } from '@nestjs/common';
63
+ import { StorageService } from '@zola_do/seaweed';
64
64
 
65
65
  @Injectable()
66
66
  export class FileService {
@@ -219,15 +219,15 @@ async getDownloadUrl(fileInfo: FileInfo): Promise<string> {
219
219
  // Server generates URL
220
220
  const { presignedUrl, file } =
221
221
  await this.storageService.generatePresignedUploadUrl({
222
- originalname: "document.pdf",
223
- contentType: "application/pdf",
222
+ originalname: 'document.pdf',
223
+ contentType: 'application/pdf',
224
224
  });
225
225
 
226
226
  // Client uploads directly
227
227
  fetch(presignedUrl, {
228
- method: "PUT",
228
+ method: 'PUT',
229
229
  body: fileBuffer,
230
- headers: { "Content-Type": "application/pdf" },
230
+ headers: { 'Content-Type': 'application/pdf' },
231
231
  });
232
232
  ```
233
233
 
@@ -247,12 +247,12 @@ interface FileInfo {
247
247
  Implement a custom storage provider:
248
248
 
249
249
  ```typescript
250
- import { S3, FileInfo } from "@zola_do/seaweed";
250
+ import { S3, FileInfo } from '@zola_do/seaweed';
251
251
 
252
252
  class CustomS3Provider extends S3 {
253
253
  constructor() {
254
254
  super({
255
- region: "custom-region",
255
+ region: 'custom-region',
256
256
  credentials: {
257
257
  accessKeyId: process.env.CUSTOM_KEY!,
258
258
  secretAccessKey: process.env.CUSTOM_SECRET!,
@@ -373,16 +373,16 @@ class FileNotFoundException extends NotFoundException {
373
373
  Subpath imports are recommended for tree-shaking:
374
374
 
375
375
  ```typescript
376
- import { StorageModule } from "@zola_do/seaweed/module";
377
- import { StorageService, AwsS3 } from "@zola_do/seaweed/services";
378
- import type { FileInfo } from "@zola_do/seaweed/types";
379
- import { FileNotFoundException } from "@zola_do/seaweed/exceptions";
376
+ import { StorageModule } from '@zola_do/seaweed/module';
377
+ import { StorageService, AwsS3 } from '@zola_do/seaweed/services';
378
+ import type { FileInfo } from '@zola_do/seaweed/types';
379
+ import { FileNotFoundException } from '@zola_do/seaweed/exceptions';
380
380
  ```
381
381
 
382
382
  Root import is supported for backward compatibility:
383
383
 
384
384
  ```typescript
385
- import { StorageModule, StorageService, FileInfo } from "@zola_do/seaweed";
385
+ import { StorageModule, StorageService, FileInfo } from '@zola_do/seaweed';
386
386
  ```
387
387
 
388
388
  ## Troubleshooting
package/package.json CHANGED
@@ -1,92 +1,92 @@
1
- {
2
- "name": "@zola_do/seaweed",
3
- "version": "0.2.8",
4
- "description": "AWS S3-compatible storage for NestJS",
5
- "author": "zolaDO",
6
- "license": "ISC",
7
- "sideEffects": false,
8
- "engines": {
9
- "node": ">=20.0.0"
10
- },
11
- "publishConfig": {
12
- "access": "public"
13
- },
14
- "main": "./dist/index.js",
15
- "types": "./dist/index.d.ts",
16
- "exports": {
17
- ".": {
18
- "types": "./dist/index.d.ts",
19
- "require": "./dist/index.js",
20
- "default": "./dist/index.js"
21
- },
22
- "./module": {
23
- "types": "./dist/module.d.ts",
24
- "require": "./dist/module.js",
25
- "default": "./dist/module.js"
26
- },
27
- "./services": {
28
- "types": "./dist/services/index.d.ts",
29
- "require": "./dist/services/index.js",
30
- "default": "./dist/services/index.js"
31
- },
32
- "./types": {
33
- "types": "./dist/types.d.ts",
34
- "require": "./dist/types.js",
35
- "default": "./dist/types.js"
36
- },
37
- "./exceptions": {
38
- "types": "./dist/exceptions/index.d.ts",
39
- "require": "./dist/exceptions/index.js",
40
- "default": "./dist/exceptions/index.js"
41
- }
42
- },
43
- "files": [
44
- "dist",
45
- "README.md"
46
- ],
47
- "scripts": {
48
- "clean": "rimraf dist",
49
- "typecheck": "tsc --noEmit",
50
- "build": "npm run clean && tsc",
51
- "prepublishOnly": "npm run build"
52
- },
53
- "peerDependencies": {
54
- "@nestjs/common": "^10.0.0 || ^11.0.0",
55
- "reflect-metadata": "^0.1.0 || ^0.2.0",
56
- "rxjs": "^7.0.0 || ^8.0.0"
57
- },
58
- "dependencies": {
59
- "@aws-sdk/client-s3": "^3.1004.0",
60
- "@aws-sdk/s3-request-presigner": "^3.1004.0"
61
- },
62
- "devDependencies": {
63
- "rimraf": "^6.1.3",
64
- "typescript": "^5.9.3"
65
- },
66
- "repository": {
67
- "directory": "packages/seaweed",
68
- "type": "git",
69
- "url": "https://github.com/zola0031/zola-nestjs-shared.git"
70
- },
71
- "homepage": "https://github.com/zola0031/zola-nestjs-shared#readme",
72
- "bugs": {
73
- "url": "https://github.com/zola0031/zola-nestjs-shared/issues"
74
- },
75
- "funding": {
76
- "type": "github",
77
- "url": "https://github.com/sponsors/zola0031"
78
- },
79
- "keywords": [
80
- "nestjs",
81
- "typescript",
82
- "library",
83
- "shared",
84
- "monorepo",
85
- "zola_do",
86
- "s3",
87
- "storage",
88
- "seaweedfs",
89
- "object-storage",
90
- "nestjs-shared"
91
- ]
92
- }
1
+ {
2
+ "name": "@zola_do/seaweed",
3
+ "version": "0.2.12",
4
+ "description": "AWS S3-compatible storage for NestJS",
5
+ "author": "zolaDO",
6
+ "license": "ISC",
7
+ "sideEffects": false,
8
+ "engines": {
9
+ "node": ">=20.0.0"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "require": "./dist/index.js",
20
+ "default": "./dist/index.js"
21
+ },
22
+ "./module": {
23
+ "types": "./dist/module.d.ts",
24
+ "require": "./dist/module.js",
25
+ "default": "./dist/module.js"
26
+ },
27
+ "./services": {
28
+ "types": "./dist/services/index.d.ts",
29
+ "require": "./dist/services/index.js",
30
+ "default": "./dist/services/index.js"
31
+ },
32
+ "./types": {
33
+ "types": "./dist/types.d.ts",
34
+ "require": "./dist/types.js",
35
+ "default": "./dist/types.js"
36
+ },
37
+ "./exceptions": {
38
+ "types": "./dist/exceptions/index.d.ts",
39
+ "require": "./dist/exceptions/index.js",
40
+ "default": "./dist/exceptions/index.js"
41
+ }
42
+ },
43
+ "files": [
44
+ "dist",
45
+ "README.md"
46
+ ],
47
+ "scripts": {
48
+ "clean": "rimraf dist",
49
+ "typecheck": "tsc --noEmit",
50
+ "build": "npm run clean && tsc",
51
+ "prepublishOnly": "npm run build"
52
+ },
53
+ "peerDependencies": {
54
+ "@nestjs/common": "^10.0.0 || ^11.0.0",
55
+ "reflect-metadata": "^0.1.0 || ^0.2.0",
56
+ "rxjs": "^7.0.0 || ^8.0.0"
57
+ },
58
+ "dependencies": {
59
+ "@aws-sdk/client-s3": "^3.1004.0",
60
+ "@aws-sdk/s3-request-presigner": "^3.1004.0"
61
+ },
62
+ "devDependencies": {
63
+ "rimraf": "^6.1.3",
64
+ "typescript": "^5.9.3"
65
+ },
66
+ "repository": {
67
+ "directory": "packages/seaweed",
68
+ "type": "git",
69
+ "url": "https://github.com/zola0031/zola-nestjs-shared.git"
70
+ },
71
+ "homepage": "https://github.com/zola0031/zola-nestjs-shared#readme",
72
+ "bugs": {
73
+ "url": "https://github.com/zola0031/zola-nestjs-shared/issues"
74
+ },
75
+ "funding": {
76
+ "type": "github",
77
+ "url": "https://github.com/sponsors/zola0031"
78
+ },
79
+ "keywords": [
80
+ "nestjs",
81
+ "typescript",
82
+ "library",
83
+ "shared",
84
+ "monorepo",
85
+ "zola_do",
86
+ "s3",
87
+ "storage",
88
+ "seaweedfs",
89
+ "object-storage",
90
+ "nestjs-shared"
91
+ ]
92
+ }