@maestro-js/file-storage 1.0.0-alpha.23 → 1.0.0-alpha.3

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.d.ts CHANGED
@@ -43,7 +43,6 @@ declare function createS3Driver({ client, bucket, prefix, url: baseUrl }: {
43
43
  url?: string;
44
44
  }): Driver<void>;
45
45
 
46
- type FileStorageDriver<T = any> = Driver<T>;
47
46
  interface FileInput {
48
47
  name: string;
49
48
  type: string;
@@ -62,7 +61,7 @@ declare function provider(key: FileStorage.Provider.Key): {
62
61
  missing: (path: string) => Promise<boolean>;
63
62
  download: (path: string, filename?: string, headers?: HeadersInit) => Promise<Response>;
64
63
  url: (path: string) => string;
65
- temporaryUrl: (path: string, expires: Iso.Instant | Iso.Duration, params?: any) => Promise<string>;
64
+ temporaryUrl: (path: string, expires: Iso.Instant, params?: any) => Promise<string>;
66
65
  temporaryUploadUrl: (path: string, expires: Iso.Instant) => Promise<{
67
66
  url: string;
68
67
  headers: Headers;
@@ -99,7 +98,7 @@ declare const FileStorage: {
99
98
  missing: (path: string) => Promise<boolean>;
100
99
  download: (path: string, filename?: string, headers?: HeadersInit) => Promise<Response>;
101
100
  url: (path: string) => string;
102
- temporaryUrl: (path: string, expires: Iso.Instant | Iso.Duration, params?: any) => Promise<string>;
101
+ temporaryUrl: (path: string, expires: Iso.Instant, params?: any) => Promise<string>;
103
102
  temporaryUploadUrl: (path: string, expires: Iso.Instant) => Promise<{
104
103
  url: string;
105
104
  headers: Headers;
@@ -128,7 +127,7 @@ declare const FileStorage: {
128
127
  };
129
128
  };
130
129
  declare namespace FileStorage {
131
- type Driver<T = any> = FileStorageDriver<T>;
130
+ type Driver<T = any> = Driver<T>;
132
131
  interface FileStorageService {
133
132
  get(path: string): Promise<Buffer>;
134
133
  text(path: string, encoding?: BufferEncoding): Promise<string>;
@@ -137,7 +136,7 @@ declare namespace FileStorage {
137
136
  missing(path: string): Promise<boolean>;
138
137
  download(path: string, filename?: string, headers?: HeadersInit): Promise<Response>;
139
138
  url(path: string): string;
140
- temporaryUrl(path: string, expires: Iso.Instant | Iso.Duration, params?: any): Promise<string>;
139
+ temporaryUrl(path: string, expires: Iso.Instant, params?: any): Promise<string>;
141
140
  temporaryUploadUrl(path: string, expires: Iso.Instant): Promise<{
142
141
  url: string;
143
142
  headers: Headers;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/index.ts
2
- import { durationFns, instantFns } from "iso-fns2";
2
+ import "iso-fns2";
3
3
  import { parse as parsePath, join as joinPath } from "path";
4
4
  import "stream";
5
5
  import "stream/web";
@@ -511,8 +511,7 @@ function create(config) {
511
511
  return driver.url(path2);
512
512
  }
513
513
  async function temporaryUrl(path2, expires, params) {
514
- const expirationDate = durationFns.isValid(expires) ? instantFns.add(instantFns.now(), expires) : expires;
515
- return await driver.temporaryUrl(path2, expirationDate, params);
514
+ return await driver.temporaryUrl(path2, expires, params);
516
515
  }
517
516
  async function temporaryUploadUrl(path2, expires) {
518
517
  return await driver.temporaryUploadUrl(path2, expires);
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "default": "./dist/index.js"
8
8
  }
9
9
  },
10
- "version": "1.0.0-alpha.23",
10
+ "version": "1.0.0-alpha.3",
11
11
  "publishConfig": {
12
12
  "access": "restricted"
13
13
  },
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "iso-fns2": "npm:iso-fns@2.0.0-alpha.26",
19
19
  "mime-types": "^2.1.35",
20
- "@maestro-js/service-registry": "1.0.0-alpha.23"
20
+ "@maestro-js/service-registry": "1.0.0-alpha.3"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@aws-sdk/client-s3": "^3.750.0",