importer-storage 1.0.9 → 1.0.11

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/dist/index.cjs CHANGED
@@ -99,10 +99,17 @@ var S3Storage = class {
99
99
  let stream = void 0;
100
100
  let buffer = void 0;
101
101
  if (isHttp(filePath)) {
102
+ if (options.logging) {
103
+ console.info(`[Start downloading] ${filePath}`);
104
+ }
102
105
  const axiosResponse = yield import_axios.default.get(filePath, {
103
106
  responseType: "arraybuffer",
104
- headers: options.headers
107
+ headers: options.headers,
108
+ proxy: options.proxy
105
109
  });
110
+ if (options.logging) {
111
+ console.info(`[Success downloading] ${filePath}`);
112
+ }
106
113
  buffer = Buffer.from(axiosResponse.data);
107
114
  } else {
108
115
  stream = (0, import_fs.createReadStream)(filePath);
package/dist/index.d.cts CHANGED
@@ -7,6 +7,16 @@ interface IStorage {
7
7
  }>, options: {
8
8
  tags: Array<StorageTag>;
9
9
  savePath: string;
10
+ headers?: Record<string, string>;
11
+ logging?: boolean;
12
+ proxy?: {
13
+ host: string;
14
+ port: number;
15
+ auth: {
16
+ username: string;
17
+ password: string;
18
+ };
19
+ };
10
20
  }): Promise<{
11
21
  errored: Array<{
12
22
  key: string;
@@ -30,6 +40,15 @@ declare class S3Storage implements IStorage {
30
40
  tags: Array<StorageTag>;
31
41
  savePath: string;
32
42
  headers?: Record<string, string>;
43
+ logging?: boolean;
44
+ proxy: {
45
+ host: string;
46
+ port: number;
47
+ auth: {
48
+ username: string;
49
+ password: string;
50
+ };
51
+ };
33
52
  }): Promise<{
34
53
  result: {
35
54
  key: string;
package/dist/index.d.ts CHANGED
@@ -7,6 +7,16 @@ interface IStorage {
7
7
  }>, options: {
8
8
  tags: Array<StorageTag>;
9
9
  savePath: string;
10
+ headers?: Record<string, string>;
11
+ logging?: boolean;
12
+ proxy?: {
13
+ host: string;
14
+ port: number;
15
+ auth: {
16
+ username: string;
17
+ password: string;
18
+ };
19
+ };
10
20
  }): Promise<{
11
21
  errored: Array<{
12
22
  key: string;
@@ -30,6 +40,15 @@ declare class S3Storage implements IStorage {
30
40
  tags: Array<StorageTag>;
31
41
  savePath: string;
32
42
  headers?: Record<string, string>;
43
+ logging?: boolean;
44
+ proxy: {
45
+ host: string;
46
+ port: number;
47
+ auth: {
48
+ username: string;
49
+ password: string;
50
+ };
51
+ };
33
52
  }): Promise<{
34
53
  result: {
35
54
  key: string;
@@ -76252,10 +76252,17 @@ For more information please go to https://github.com/aws/aws-sdk-js-v3#functiona
76252
76252
  let stream5 = void 0;
76253
76253
  let buffer = void 0;
76254
76254
  if (isHttp(filePath)) {
76255
+ if (options.logging) {
76256
+ console.info(`[Start downloading] ${filePath}`);
76257
+ }
76255
76258
  const axiosResponse = yield axios_default.get(filePath, {
76256
76259
  responseType: "arraybuffer",
76257
- headers: options.headers
76260
+ headers: options.headers,
76261
+ proxy: options.proxy
76258
76262
  });
76263
+ if (options.logging) {
76264
+ console.info(`[Success downloading] ${filePath}`);
76265
+ }
76259
76266
  buffer = Buffer.from(axiosResponse.data);
76260
76267
  } else {
76261
76268
  stream5 = (0, import_fs8.createReadStream)(filePath);
package/dist/index.js CHANGED
@@ -70,10 +70,17 @@ var S3Storage = class {
70
70
  let stream = void 0;
71
71
  let buffer = void 0;
72
72
  if (isHttp(filePath)) {
73
+ if (options.logging) {
74
+ console.info(`[Start downloading] ${filePath}`);
75
+ }
73
76
  const axiosResponse = yield axios.get(filePath, {
74
77
  responseType: "arraybuffer",
75
- headers: options.headers
78
+ headers: options.headers,
79
+ proxy: options.proxy
76
80
  });
81
+ if (options.logging) {
82
+ console.info(`[Success downloading] ${filePath}`);
83
+ }
77
84
  buffer = Buffer.from(axiosResponse.data);
78
85
  } else {
79
86
  stream = createReadStream(filePath);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "importer-storage",
3
3
  "private": false,
4
- "version": "1.0.9",
4
+ "version": "1.0.11",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist",