@edirect/storage-gateway 11.0.65 → 11.0.66

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/package.json CHANGED
@@ -1,39 +1,22 @@
1
1
  {
2
2
  "name": "@edirect/storage-gateway",
3
- "version": "11.0.65",
4
- "packageScope": "@edirect",
5
- "main": "./dist/src/index.js",
6
- "types": "./dist/src/index.d.ts",
3
+ "version": "11.0.66",
4
+ "main": "./src/index.js",
5
+ "types": "./src/index.d.ts",
7
6
  "exports": {
8
7
  ".": {
9
- "import": "./dist/src/index.js",
10
- "default": "./dist/src/index.js",
11
- "require": "./dist/src/index.js",
12
- "types": "./dist/src/index.d.ts"
8
+ "import": "./src/index.js",
9
+ "default": "./src/index.js",
10
+ "require": "./src/index.js",
11
+ "types": "./src/index.d.ts"
13
12
  },
14
13
  "./package.json": "./package.json"
15
14
  },
16
15
  "files": [
17
- "dist"
16
+ "src"
18
17
  ],
19
18
  "dependencies": {
20
19
  "tslib": "^2.8.1"
21
20
  },
22
- "nx": {
23
- "name": "@edirect/storage-gateway",
24
- "targets": {
25
- "build": {
26
- "executor": "@nx/js:tsc",
27
- "options": {
28
- "main": "{workspaceRoot}/packages/edirect-storage-gateway/src/index.ts",
29
- "tsConfig": "{workspaceRoot}/packages/edirect-storage-gateway/tsconfig.lib.json",
30
- "outputPath": "{workspaceRoot}/packages/edirect-storage-gateway/dist",
31
- "assets": [
32
- "{workspaceRoot}/packages/edirect-storage-gateway/package.json",
33
- "{workspaceRoot}/packages/edirect-storage-gateway/README.md"
34
- ]
35
- }
36
- }
37
- }
38
- }
21
+ "type": "commonjs"
39
22
  }
package/dist/README.md DELETED
@@ -1,362 +0,0 @@
1
- # @edirect/storage-gateway
2
-
3
- Storage Gateway client library for eDirect applications. Provides a simple interface to interact with the Storage Gateway API for managing storage configurations and file operations across multiple cloud providers (S3, Azure Blob, GCS, local).
4
-
5
- ## Installation
6
-
7
- ```sh
8
- pnpm add @edirect/storage-gateway
9
- # or
10
- npm install @edirect/storage-gateway
11
- ```
12
-
13
- ## Quick Start
14
-
15
- ```typescript
16
- import { StorageGatewayClient } from '@edirect/storage-gateway';
17
-
18
- // Create client without headers
19
- const client = new StorageGatewayClient('https://api.example.com');
20
-
21
- // Or with authentication headers
22
- const client = new StorageGatewayClient('https://api.example.com', {
23
- authorization: 'Bearer your-token-here',
24
- });
25
-
26
- // List storage configurations
27
- const configs = await client.listStorageConfigurations();
28
-
29
- // Upload a file
30
- const file = new File(['content'], 'example.txt');
31
- const result = await client.uploadFile({
32
- storageKey: 'my-storage',
33
- file: file,
34
- path: 'documents/example.txt',
35
- });
36
- ```
37
-
38
- ## API Reference
39
-
40
- ### Constructor
41
-
42
- ```typescript
43
- new StorageGatewayClient(baseUrl: string, headers?: StorageGatewayHeaders)
44
- ```
45
-
46
- **Parameters:**
47
-
48
- - `baseUrl` - The base URL of the Storage Gateway API
49
- - `headers` (optional) - Headers to include in all requests
50
-
51
- **Types:**
52
-
53
- ```typescript
54
- interface StorageGatewayHeaders {
55
- authorization: string;
56
- [key: string]: string;
57
- }
58
- ```
59
-
60
- ---
61
-
62
- ## Storage Configuration Methods
63
-
64
- ### listStorageConfigurations
65
-
66
- List all storage configurations with optional pagination.
67
-
68
- ```typescript
69
- const configs = await client.listStorageConfigurations();
70
-
71
- // With pagination
72
- const configs = await client.listStorageConfigurations({
73
- skip: 0,
74
- take: 10,
75
- });
76
- ```
77
-
78
- **Parameters:**
79
-
80
- - `params.skip` (optional) - Number of records to skip
81
- - `params.take` (optional) - Number of records to return
82
-
83
- ---
84
-
85
- ### createStorageConfiguration
86
-
87
- Create a new storage configuration.
88
-
89
- ```typescript
90
- const config = await client.createStorageConfiguration({
91
- key: 'my-storage',
92
- provider: 's3',
93
- credentials: {
94
- accessKeyId: 'your-access-key',
95
- secretAccessKey: 'your-secret-key',
96
- region: 'us-east-1',
97
- bucket: 'my-bucket',
98
- },
99
- });
100
- ```
101
-
102
- **Parameters:**
103
-
104
- - `data` - Configuration data object
105
-
106
- ---
107
-
108
- ### getStorageConfiguration
109
-
110
- Get a specific storage configuration by key.
111
-
112
- ```typescript
113
- const config = await client.getStorageConfiguration('my-storage');
114
- ```
115
-
116
- **Parameters:**
117
-
118
- - `key` - The storage configuration key
119
-
120
- ---
121
-
122
- ### updateStorageConfiguration
123
-
124
- Update an existing storage configuration.
125
-
126
- ```typescript
127
- const updated = await client.updateStorageConfiguration({
128
- key: 'my-storage',
129
- data: {
130
- credentials: {
131
- accessKeyId: 'new-access-key',
132
- secretAccessKey: 'new-secret-key',
133
- },
134
- },
135
- });
136
- ```
137
-
138
- **Parameters:**
139
-
140
- - `params.key` - The storage configuration key
141
- - `params.data` - Updated configuration data
142
-
143
- ---
144
-
145
- ### deleteStorageConfiguration
146
-
147
- Delete a storage configuration.
148
-
149
- ```typescript
150
- await client.deleteStorageConfiguration('my-storage');
151
- ```
152
-
153
- **Parameters:**
154
-
155
- - `key` - The storage configuration key to delete
156
-
157
- ---
158
-
159
- ## Storage Operations Methods
160
-
161
- ### listFiles
162
-
163
- List files in storage.
164
-
165
- ```typescript
166
- const files = await client.listFiles({
167
- storageKey: 'my-storage',
168
- });
169
-
170
- // With path filter
171
- const files = await client.listFiles({
172
- storageKey: 'my-storage',
173
- path: 'documents/',
174
- });
175
- ```
176
-
177
- **Parameters:**
178
-
179
- - `params.storageKey` - The storage configuration key
180
- - `params.path` (optional) - Path to list files from
181
-
182
- ---
183
-
184
- ### uploadFile
185
-
186
- Upload a file to storage.
187
-
188
- ```typescript
189
- const file = new File(['Hello, World!'], 'hello.txt', { type: 'text/plain' });
190
-
191
- const result = await client.uploadFile({
192
- storageKey: 'my-storage',
193
- file: file,
194
- path: 'documents/hello.txt',
195
- });
196
- ```
197
-
198
- **Parameters:**
199
-
200
- - `params.storageKey` - The storage configuration key
201
- - `params.file` - The file to upload (File or Blob)
202
- - `params.path` (optional) - Destination path for the file
203
-
204
- ---
205
-
206
- ### downloadFile
207
-
208
- Download a file from storage.
209
-
210
- ```typescript
211
- const blob = await client.downloadFile({
212
- storageKey: 'my-storage',
213
- path: 'documents/hello.txt',
214
- });
215
-
216
- // Save to file (Node.js)
217
- const buffer = await blob.arrayBuffer();
218
- fs.writeFileSync('downloaded.txt', Buffer.from(buffer));
219
-
220
- // Or create download link (Browser)
221
- const url = URL.createObjectURL(blob);
222
- ```
223
-
224
- **Parameters:**
225
-
226
- - `params.storageKey` - The storage configuration key
227
- - `params.path` - Path to the file to download
228
-
229
- **Returns:** `Promise<Blob>`
230
-
231
- ---
232
-
233
- ### getFileInfo
234
-
235
- Get file metadata information.
236
-
237
- ```typescript
238
- const info = await client.getFileInfo({
239
- storageKey: 'my-storage',
240
- path: 'documents/hello.txt',
241
- });
242
-
243
- console.log(info);
244
- // { name: 'hello.txt', size: 1024, lastModified: '2024-01-01T00:00:00Z', ... }
245
- ```
246
-
247
- **Parameters:**
248
-
249
- - `params.storageKey` - The storage configuration key
250
- - `params.path` - Path to the file
251
-
252
- ---
253
-
254
- ### deleteFile
255
-
256
- Delete a file from storage.
257
-
258
- ```typescript
259
- await client.deleteFile({
260
- storageKey: 'my-storage',
261
- path: 'documents/hello.txt',
262
- });
263
- ```
264
-
265
- **Parameters:**
266
-
267
- - `params.storageKey` - The storage configuration key
268
- - `params.path` - Path to the file to delete
269
-
270
- ---
271
-
272
- ## Storage Provider Methods
273
-
274
- ### listStorageProviders
275
-
276
- List available storage providers.
277
-
278
- ```typescript
279
- const providers = await client.listStorageProviders();
280
-
281
- console.log(providers);
282
- // ['s3', 'azure-blob', 'gcs', 'local', ...]
283
- ```
284
-
285
- ---
286
-
287
- ## Complete Example
288
-
289
- ```typescript
290
- import { StorageGatewayClient } from '@edirect/storage-gateway';
291
-
292
- async function main() {
293
- // Initialize client
294
- const client = new StorageGatewayClient(
295
- 'https://storage-gateway.example.com',
296
- {
297
- authorization: 'Bearer your-jwt-token',
298
- }
299
- );
300
-
301
- // List available providers
302
- const providers = await client.listStorageProviders();
303
- console.log('Available providers:', providers);
304
-
305
- // Create a new storage configuration
306
- const config = await client.createStorageConfiguration({
307
- key: 'documents-storage',
308
- provider: 's3',
309
- credentials: {
310
- accessKeyId: process.env.AWS_ACCESS_KEY_ID,
311
- secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
312
- region: 'us-east-1',
313
- bucket: 'my-documents-bucket',
314
- },
315
- });
316
- console.log('Created config:', config);
317
-
318
- // Upload a file
319
- const file = new File(['Hello, World!'], 'hello.txt', { type: 'text/plain' });
320
- const uploadResult = await client.uploadFile({
321
- storageKey: 'documents-storage',
322
- file: file,
323
- path: 'greetings/hello.txt',
324
- });
325
- console.log('Upload result:', uploadResult);
326
-
327
- // List files
328
- const files = await client.listFiles({
329
- storageKey: 'documents-storage',
330
- path: 'greetings/',
331
- });
332
- console.log('Files:', files);
333
-
334
- // Get file info
335
- const fileInfo = await client.getFileInfo({
336
- storageKey: 'documents-storage',
337
- path: 'greetings/hello.txt',
338
- });
339
- console.log('File info:', fileInfo);
340
-
341
- // Download file
342
- const blob = await client.downloadFile({
343
- storageKey: 'documents-storage',
344
- path: 'greetings/hello.txt',
345
- });
346
- const text = await blob.text();
347
- console.log('Downloaded content:', text);
348
-
349
- // Delete file
350
- await client.deleteFile({
351
- storageKey: 'documents-storage',
352
- path: 'greetings/hello.txt',
353
- });
354
- console.log('File deleted');
355
-
356
- // Delete storage configuration
357
- await client.deleteStorageConfiguration('documents-storage');
358
- console.log('Configuration deleted');
359
- }
360
-
361
- main().catch(console.error);
362
- ```
package/dist/package.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "name": "@edirect/storage-gateway",
3
- "version": "11.0.65",
4
- "main": "./dist/src/index.js",
5
- "types": "./dist/src/index.d.ts",
6
- "exports": {
7
- ".": {
8
- "import": "./dist/src/index.js",
9
- "default": "./dist/src/index.js",
10
- "require": "./dist/src/index.js",
11
- "types": "./dist/src/index.d.ts"
12
- },
13
- "./package.json": "./package.json"
14
- },
15
- "files": [
16
- "dist"
17
- ],
18
- "dependencies": {
19
- "tslib": "^2.8.1"
20
- },
21
- "type": "commonjs"
22
- }
@@ -1 +0,0 @@
1
- {"version":"5.9.3"}
File without changes
File without changes
File without changes
File without changes
File without changes