@geekmidas/storage 0.0.1 → 0.0.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/AmazonStorageClient-C16fG3G4.d.cts +39 -0
- package/dist/AmazonStorageClient-CP8Tx5oE.d.mts +39 -0
- package/dist/AmazonStorageClient.d.cts +3 -0
- package/dist/AmazonStorageClient.d.mts +3 -0
- package/dist/StorageClient-CJbHRTVV.d.mts +77 -0
- package/dist/StorageClient-D-y4QLDq.d.cts +77 -0
- package/dist/StorageClient.d.cts +2 -0
- package/dist/StorageClient.d.mts +2 -0
- package/dist/__tests__/AmazonStorageClient.spec.cjs +1 -1
- package/dist/__tests__/AmazonStorageClient.spec.d.cts +1 -0
- package/dist/__tests__/AmazonStorageClient.spec.d.mts +1 -0
- package/dist/__tests__/AmazonStorageClient.spec.mjs +1 -1
- package/dist/__tests__/StorageClient.spec.cjs +1 -1
- package/dist/__tests__/StorageClient.spec.d.cts +1 -0
- package/dist/__tests__/StorageClient.spec.d.mts +1 -0
- package/dist/__tests__/StorageClient.spec.mjs +1 -1
- package/dist/aws.d.cts +3 -0
- package/dist/aws.d.mts +3 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/{vi.bdSIJ99Y-B0LMQgq6.mjs → vi.bdSIJ99Y-CucmVasy.mjs} +4 -4
- package/dist/{vi.bdSIJ99Y-wDZVsqf8.cjs → vi.bdSIJ99Y-D0m6qImj.cjs} +4 -4
- package/package.json +5 -5
- package/src/__tests__/StorageClient.spec.ts +5 -2
- package/src/aws.ts +11 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DocumentVersion, File, GetUploadParams, GetUploadResponse, StorageClient, StorageProvider } from "./StorageClient-D-y4QLDq.cjs";
|
|
2
|
+
import { S3Client } from "@aws-sdk/client-s3";
|
|
3
|
+
|
|
4
|
+
//#region src/AmazonStorageClient.d.ts
|
|
5
|
+
declare class AmazonStorageClient implements StorageClient {
|
|
6
|
+
private readonly client;
|
|
7
|
+
private readonly bucket;
|
|
8
|
+
private readonly acl;
|
|
9
|
+
readonly provider = StorageProvider.AWSS3;
|
|
10
|
+
static create(options: AmazonStorageClientCreateOptions): AmazonStorageClient;
|
|
11
|
+
constructor(client: S3Client, bucket: string, acl?: AmazonCannedAccessControlList);
|
|
12
|
+
getVersionDownloadURL(file: File, versionId: string): Promise<string>;
|
|
13
|
+
getVersions(key: string): Promise<DocumentVersion[]>;
|
|
14
|
+
getDownloadURL(file: File, expiresIn?: number): Promise<string>;
|
|
15
|
+
getUploadURL(params: GetUploadParams, expiresIn?: number): Promise<string>;
|
|
16
|
+
getUpload(params: GetUploadParams, expiresIn?: number): Promise<GetUploadResponse>;
|
|
17
|
+
upload(key: string, data: string | Buffer, contentType: string): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
declare enum AmazonCannedAccessControlList {
|
|
20
|
+
AuthenticatedRead = "authenticated-read",
|
|
21
|
+
Private = "private",
|
|
22
|
+
PublicRead = "public-read",
|
|
23
|
+
PublicReadWrite = "public-read-write",
|
|
24
|
+
AwsExecRead = "aws-exec-read",
|
|
25
|
+
BucketOwnerRead = "bucket-owner-read",
|
|
26
|
+
BucketOwnerFullControl = "bucket-owner-full-control",
|
|
27
|
+
LogDeliveryWrite = "log-delivery-write",
|
|
28
|
+
}
|
|
29
|
+
interface AmazonStorageClientCreateOptions {
|
|
30
|
+
bucket: string;
|
|
31
|
+
region?: string;
|
|
32
|
+
acl?: AmazonCannedAccessControlList;
|
|
33
|
+
accessKeyId?: string;
|
|
34
|
+
secretAccessKey?: string;
|
|
35
|
+
endpoint?: string;
|
|
36
|
+
forcePathStyle?: boolean;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { AmazonCannedAccessControlList, AmazonStorageClient };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DocumentVersion, File, GetUploadParams, GetUploadResponse, StorageClient, StorageProvider } from "./StorageClient-CJbHRTVV.mjs";
|
|
2
|
+
import { S3Client } from "@aws-sdk/client-s3";
|
|
3
|
+
|
|
4
|
+
//#region src/AmazonStorageClient.d.ts
|
|
5
|
+
declare class AmazonStorageClient implements StorageClient {
|
|
6
|
+
private readonly client;
|
|
7
|
+
private readonly bucket;
|
|
8
|
+
private readonly acl;
|
|
9
|
+
readonly provider = StorageProvider.AWSS3;
|
|
10
|
+
static create(options: AmazonStorageClientCreateOptions): AmazonStorageClient;
|
|
11
|
+
constructor(client: S3Client, bucket: string, acl?: AmazonCannedAccessControlList);
|
|
12
|
+
getVersionDownloadURL(file: File, versionId: string): Promise<string>;
|
|
13
|
+
getVersions(key: string): Promise<DocumentVersion[]>;
|
|
14
|
+
getDownloadURL(file: File, expiresIn?: number): Promise<string>;
|
|
15
|
+
getUploadURL(params: GetUploadParams, expiresIn?: number): Promise<string>;
|
|
16
|
+
getUpload(params: GetUploadParams, expiresIn?: number): Promise<GetUploadResponse>;
|
|
17
|
+
upload(key: string, data: string | Buffer, contentType: string): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
declare enum AmazonCannedAccessControlList {
|
|
20
|
+
AuthenticatedRead = "authenticated-read",
|
|
21
|
+
Private = "private",
|
|
22
|
+
PublicRead = "public-read",
|
|
23
|
+
PublicReadWrite = "public-read-write",
|
|
24
|
+
AwsExecRead = "aws-exec-read",
|
|
25
|
+
BucketOwnerRead = "bucket-owner-read",
|
|
26
|
+
BucketOwnerFullControl = "bucket-owner-full-control",
|
|
27
|
+
LogDeliveryWrite = "log-delivery-write",
|
|
28
|
+
}
|
|
29
|
+
interface AmazonStorageClientCreateOptions {
|
|
30
|
+
bucket: string;
|
|
31
|
+
region?: string;
|
|
32
|
+
acl?: AmazonCannedAccessControlList;
|
|
33
|
+
accessKeyId?: string;
|
|
34
|
+
secretAccessKey?: string;
|
|
35
|
+
endpoint?: string;
|
|
36
|
+
forcePathStyle?: boolean;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { AmazonCannedAccessControlList, AmazonStorageClient };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//#region src/StorageClient.d.ts
|
|
2
|
+
interface DocumentVersion {
|
|
3
|
+
id: string;
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
}
|
|
6
|
+
declare enum StorageProvider {
|
|
7
|
+
AWSS3 = "geekimdas.toolbox.storage.aws.s3",
|
|
8
|
+
GCP = "geekimdas.toolbox.storage.gcp",
|
|
9
|
+
AZURE = "geekimdas.toolbox.storage.azure",
|
|
10
|
+
}
|
|
11
|
+
interface StorageClient {
|
|
12
|
+
readonly provider: StorageProvider;
|
|
13
|
+
/**
|
|
14
|
+
* Get a URL to upload a file to.
|
|
15
|
+
*
|
|
16
|
+
* @param params - The parameters to get the upload URL for.
|
|
17
|
+
* @param expiresIn - The number of minutes the URL should be valid for.
|
|
18
|
+
* Defaults to 60 * 60 (1 hour).
|
|
19
|
+
* @returns A promise that resolves to the upload URL.
|
|
20
|
+
*/
|
|
21
|
+
getUploadURL(params: GetUploadParams, expiresIn?: number): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Get a URL to download a file from.
|
|
24
|
+
*
|
|
25
|
+
* @param file - The file to get the download URL for.
|
|
26
|
+
* @param expiresIn - The number of seconds the URL should be valid for.
|
|
27
|
+
* Defaults to 60 * 60 (1 hour).
|
|
28
|
+
* @returns A promise that resolves to the download URL.
|
|
29
|
+
*/
|
|
30
|
+
getDownloadURL(file: File, expiresIn?: number): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Get the versions for a key.
|
|
33
|
+
*
|
|
34
|
+
* @param key - The key to get the versions for.
|
|
35
|
+
*/
|
|
36
|
+
getVersions(key: string): Promise<DocumentVersion[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a URL to download a version of a file from.
|
|
39
|
+
*
|
|
40
|
+
* @param file - The file to get the download URL for.
|
|
41
|
+
* @param versionId - The version ID to get the download URL for.
|
|
42
|
+
*/
|
|
43
|
+
getVersionDownloadURL(file: File, versionId: string): Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param key - The key to upload the file to.
|
|
47
|
+
* @param data - The data to upload.
|
|
48
|
+
* @param contentType - The content type of the data.
|
|
49
|
+
*/
|
|
50
|
+
upload(key: string, data: string | Buffer, contentType: string): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Get a URL to upload a file to.
|
|
53
|
+
*
|
|
54
|
+
* @param params - The parameters to get the upload URL for.
|
|
55
|
+
* @param expiresIn - The number of minutes the URL should be valid for.
|
|
56
|
+
*/
|
|
57
|
+
getUpload(params: GetUploadParams, expiresIn?: number): Promise<GetUploadResponse>;
|
|
58
|
+
}
|
|
59
|
+
interface GetUploadParams {
|
|
60
|
+
path: string;
|
|
61
|
+
contentType: string;
|
|
62
|
+
contentLength: number;
|
|
63
|
+
}
|
|
64
|
+
type UploadField = {
|
|
65
|
+
key: string;
|
|
66
|
+
value: string;
|
|
67
|
+
};
|
|
68
|
+
type GetUploadResponse = {
|
|
69
|
+
url: string;
|
|
70
|
+
fields: UploadField[];
|
|
71
|
+
};
|
|
72
|
+
interface File {
|
|
73
|
+
name?: string;
|
|
74
|
+
path: string;
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { DocumentVersion, File, GetUploadParams, GetUploadResponse, StorageClient, StorageProvider, UploadField };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//#region src/StorageClient.d.ts
|
|
2
|
+
interface DocumentVersion {
|
|
3
|
+
id: string;
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
}
|
|
6
|
+
declare enum StorageProvider {
|
|
7
|
+
AWSS3 = "geekimdas.toolbox.storage.aws.s3",
|
|
8
|
+
GCP = "geekimdas.toolbox.storage.gcp",
|
|
9
|
+
AZURE = "geekimdas.toolbox.storage.azure",
|
|
10
|
+
}
|
|
11
|
+
interface StorageClient {
|
|
12
|
+
readonly provider: StorageProvider;
|
|
13
|
+
/**
|
|
14
|
+
* Get a URL to upload a file to.
|
|
15
|
+
*
|
|
16
|
+
* @param params - The parameters to get the upload URL for.
|
|
17
|
+
* @param expiresIn - The number of minutes the URL should be valid for.
|
|
18
|
+
* Defaults to 60 * 60 (1 hour).
|
|
19
|
+
* @returns A promise that resolves to the upload URL.
|
|
20
|
+
*/
|
|
21
|
+
getUploadURL(params: GetUploadParams, expiresIn?: number): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Get a URL to download a file from.
|
|
24
|
+
*
|
|
25
|
+
* @param file - The file to get the download URL for.
|
|
26
|
+
* @param expiresIn - The number of seconds the URL should be valid for.
|
|
27
|
+
* Defaults to 60 * 60 (1 hour).
|
|
28
|
+
* @returns A promise that resolves to the download URL.
|
|
29
|
+
*/
|
|
30
|
+
getDownloadURL(file: File, expiresIn?: number): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Get the versions for a key.
|
|
33
|
+
*
|
|
34
|
+
* @param key - The key to get the versions for.
|
|
35
|
+
*/
|
|
36
|
+
getVersions(key: string): Promise<DocumentVersion[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a URL to download a version of a file from.
|
|
39
|
+
*
|
|
40
|
+
* @param file - The file to get the download URL for.
|
|
41
|
+
* @param versionId - The version ID to get the download URL for.
|
|
42
|
+
*/
|
|
43
|
+
getVersionDownloadURL(file: File, versionId: string): Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param key - The key to upload the file to.
|
|
47
|
+
* @param data - The data to upload.
|
|
48
|
+
* @param contentType - The content type of the data.
|
|
49
|
+
*/
|
|
50
|
+
upload(key: string, data: string | Buffer, contentType: string): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Get a URL to upload a file to.
|
|
53
|
+
*
|
|
54
|
+
* @param params - The parameters to get the upload URL for.
|
|
55
|
+
* @param expiresIn - The number of minutes the URL should be valid for.
|
|
56
|
+
*/
|
|
57
|
+
getUpload(params: GetUploadParams, expiresIn?: number): Promise<GetUploadResponse>;
|
|
58
|
+
}
|
|
59
|
+
interface GetUploadParams {
|
|
60
|
+
path: string;
|
|
61
|
+
contentType: string;
|
|
62
|
+
contentLength: number;
|
|
63
|
+
}
|
|
64
|
+
type UploadField = {
|
|
65
|
+
key: string;
|
|
66
|
+
value: string;
|
|
67
|
+
};
|
|
68
|
+
type GetUploadResponse = {
|
|
69
|
+
url: string;
|
|
70
|
+
fields: UploadField[];
|
|
71
|
+
};
|
|
72
|
+
interface File {
|
|
73
|
+
name?: string;
|
|
74
|
+
path: string;
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { DocumentVersion, File, GetUploadParams, GetUploadResponse, StorageClient, StorageProvider, UploadField };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require('../chunk-DWy1uDak.cjs');
|
|
2
2
|
const require_StorageClient = require('../StorageClient-BDRVrMJj.cjs');
|
|
3
3
|
const require_AmazonStorageClient = require('../AmazonStorageClient-DT9DeKVz.cjs');
|
|
4
|
-
const require_vi_bdSIJ99Y = require('../vi.bdSIJ99Y-
|
|
4
|
+
const require_vi_bdSIJ99Y = require('../vi.bdSIJ99Y-D0m6qImj.cjs');
|
|
5
5
|
const __aws_sdk_client_s3 = require_chunk.__toESM(require("@aws-sdk/client-s3"));
|
|
6
6
|
|
|
7
7
|
//#region src/__tests__/AmazonStorageClient.spec.ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { beforeAll, describe, globalExpect, it } from "../vi.bdSIJ99Y-
|
|
1
|
+
import { beforeAll, describe, globalExpect, it } from "../vi.bdSIJ99Y-CucmVasy.mjs";
|
|
2
2
|
import { StorageProvider } from "../StorageClient-CZGIC_fz.mjs";
|
|
3
3
|
import { AmazonCannedAccessControlList, AmazonStorageClient } from "../AmazonStorageClient-DJMWn8vO.mjs";
|
|
4
4
|
import { S3Client } from "@aws-sdk/client-s3";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_StorageClient = require('../StorageClient-BDRVrMJj.cjs');
|
|
2
|
-
const require_vi_bdSIJ99Y = require('../vi.bdSIJ99Y-
|
|
2
|
+
const require_vi_bdSIJ99Y = require('../vi.bdSIJ99Y-D0m6qImj.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/__tests__/StorageClient.spec.ts
|
|
5
5
|
require_vi_bdSIJ99Y.describe("StorageClient", () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/aws.d.cts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DocumentVersion, File, GetUploadParams, GetUploadResponse, StorageClient } from "./StorageClient-D-y4QLDq.cjs";
|
|
2
|
+
import { AmazonCannedAccessControlList, AmazonStorageClient } from "./AmazonStorageClient-C16fG3G4.cjs";
|
|
3
|
+
export { AmazonCannedAccessControlList, AmazonStorageClient, DocumentVersion, File, GetUploadParams, GetUploadResponse, StorageClient };
|
package/dist/aws.d.mts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DocumentVersion, File, GetUploadParams, GetUploadResponse, StorageClient } from "./StorageClient-CJbHRTVV.mjs";
|
|
2
|
+
import { AmazonCannedAccessControlList, AmazonStorageClient } from "./AmazonStorageClient-CP8Tx5oE.mjs";
|
|
3
|
+
export { AmazonCannedAccessControlList, AmazonStorageClient, DocumentVersion, File, GetUploadParams, GetUploadResponse, StorageClient };
|
package/dist/index.d.cts
ADDED
package/dist/index.d.mts
ADDED
|
@@ -10335,7 +10335,7 @@ function createTestHook(name, handler) {
|
|
|
10335
10335
|
}
|
|
10336
10336
|
|
|
10337
10337
|
//#endregion
|
|
10338
|
-
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.
|
|
10338
|
+
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.0_lightningcss@_9e855e585de3badded1a4cd0b32436f6/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js
|
|
10339
10339
|
const NAME_WORKER_STATE = "__vitest_worker__";
|
|
10340
10340
|
function getWorkerState() {
|
|
10341
10341
|
const workerState = globalThis[NAME_WORKER_STATE];
|
|
@@ -10384,7 +10384,7 @@ async function waitForImportsToResolve() {
|
|
|
10384
10384
|
}
|
|
10385
10385
|
|
|
10386
10386
|
//#endregion
|
|
10387
|
-
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.
|
|
10387
|
+
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.0_lightningcss@_9e855e585de3badded1a4cd0b32436f6/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js
|
|
10388
10388
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
10389
10389
|
function getDefaultExportFromCjs(x) {
|
|
10390
10390
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -12235,7 +12235,7 @@ var SnapshotClient = class {
|
|
|
12235
12235
|
};
|
|
12236
12236
|
|
|
12237
12237
|
//#endregion
|
|
12238
|
-
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.
|
|
12238
|
+
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.0_lightningcss@_9e855e585de3badded1a4cd0b32436f6/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js
|
|
12239
12239
|
const RealDate = Date;
|
|
12240
12240
|
let now = null;
|
|
12241
12241
|
var MockDate = class MockDate extends RealDate {
|
|
@@ -12284,7 +12284,7 @@ function resetDate() {
|
|
|
12284
12284
|
}
|
|
12285
12285
|
|
|
12286
12286
|
//#endregion
|
|
12287
|
-
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.
|
|
12287
|
+
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.0_lightningcss@_9e855e585de3badded1a4cd0b32436f6/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js
|
|
12288
12288
|
const unsupported = [
|
|
12289
12289
|
"matchSnapshot",
|
|
12290
12290
|
"toMatchSnapshot",
|
|
@@ -10310,7 +10310,7 @@ function createTestHook(name, handler) {
|
|
|
10310
10310
|
}
|
|
10311
10311
|
|
|
10312
10312
|
//#endregion
|
|
10313
|
-
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.
|
|
10313
|
+
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.0_lightningcss@_9e855e585de3badded1a4cd0b32436f6/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js
|
|
10314
10314
|
const NAME_WORKER_STATE = "__vitest_worker__";
|
|
10315
10315
|
function getWorkerState() {
|
|
10316
10316
|
const workerState = globalThis[NAME_WORKER_STATE];
|
|
@@ -10359,7 +10359,7 @@ async function waitForImportsToResolve() {
|
|
|
10359
10359
|
}
|
|
10360
10360
|
|
|
10361
10361
|
//#endregion
|
|
10362
|
-
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.
|
|
10362
|
+
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.0_lightningcss@_9e855e585de3badded1a4cd0b32436f6/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js
|
|
10363
10363
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
10364
10364
|
function getDefaultExportFromCjs(x) {
|
|
10365
10365
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -12210,7 +12210,7 @@ var SnapshotClient = class {
|
|
|
12210
12210
|
};
|
|
12211
12211
|
|
|
12212
12212
|
//#endregion
|
|
12213
|
-
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.
|
|
12213
|
+
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.0_lightningcss@_9e855e585de3badded1a4cd0b32436f6/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js
|
|
12214
12214
|
const RealDate = Date;
|
|
12215
12215
|
let now = null;
|
|
12216
12216
|
var MockDate = class MockDate extends RealDate {
|
|
@@ -12259,7 +12259,7 @@ function resetDate() {
|
|
|
12259
12259
|
}
|
|
12260
12260
|
|
|
12261
12261
|
//#endregion
|
|
12262
|
-
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.
|
|
12262
|
+
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+node@22.16.3_@vitest+ui@3.2.4_jiti@2.4.2_jsdom@26.1.0_lightningcss@_9e855e585de3badded1a4cd0b32436f6/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js
|
|
12263
12263
|
const unsupported = [
|
|
12264
12264
|
"matchSnapshot",
|
|
12265
12265
|
"toMatchSnapshot",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/storage",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"exports": {
|
|
11
11
|
"./aws": {
|
|
12
|
+
"types": "./dist/aws.d.ts",
|
|
12
13
|
"import": "./dist/aws.mjs",
|
|
13
|
-
"require": "./dist/aws.cjs"
|
|
14
|
-
"types": "./src/aws.ts"
|
|
14
|
+
"require": "./dist/aws.cjs"
|
|
15
15
|
},
|
|
16
16
|
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
17
18
|
"import": "./dist/index.mjs",
|
|
18
|
-
"require": "./dist/index.cjs"
|
|
19
|
-
"types": "./src/index.ts"
|
|
19
|
+
"require": "./dist/index.cjs"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
@@ -69,7 +69,10 @@ describe('StorageClient', () => {
|
|
|
69
69
|
|
|
70
70
|
expect(response.url).toBe('https://example.com/upload');
|
|
71
71
|
expect(response.fields).toHaveLength(2);
|
|
72
|
-
expect(response.fields[0]).toEqual({
|
|
72
|
+
expect(response.fields[0]).toEqual({
|
|
73
|
+
key: 'key',
|
|
74
|
+
value: 'test/path.txt',
|
|
75
|
+
});
|
|
73
76
|
expect(response.fields[1]).toEqual({ key: 'acl', value: 'public-read' });
|
|
74
77
|
});
|
|
75
78
|
|
|
@@ -83,4 +86,4 @@ describe('StorageClient', () => {
|
|
|
83
86
|
expect(field.value).toBe('test-value');
|
|
84
87
|
});
|
|
85
88
|
});
|
|
86
|
-
});
|
|
89
|
+
});
|
package/src/aws.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export {
|
|
2
|
+
AmazonStorageClient,
|
|
3
|
+
AmazonCannedAccessControlList,
|
|
4
|
+
} from './AmazonStorageClient';
|
|
5
|
+
export type {
|
|
6
|
+
StorageClient,
|
|
7
|
+
DocumentVersion,
|
|
8
|
+
File,
|
|
9
|
+
GetUploadParams,
|
|
10
|
+
GetUploadResponse,
|
|
11
|
+
} from './StorageClient';
|