@settlemint/sdk-minio 2.1.4-pr05b60a44 → 2.1.4-pr0619d764
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/minio.cjs +56 -5
- package/dist/minio.cjs.map +1 -1
- package/dist/minio.d.cts +1 -2
- package/dist/minio.d.ts +1 -2
- package/dist/minio.mjs +54 -3
- package/dist/minio.mjs.map +1 -1
- package/package.json +2 -2
package/dist/minio.cjs
CHANGED
|
@@ -23,8 +23,6 @@ __export(minio_exports, {
|
|
|
23
23
|
createServerMinioClient: () => createServerMinioClient
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(minio_exports);
|
|
26
|
-
var import_runtime = require("@settlemint/sdk-utils/runtime");
|
|
27
|
-
var import_validation2 = require("@settlemint/sdk-utils/validation");
|
|
28
26
|
var import_minio = require("minio");
|
|
29
27
|
|
|
30
28
|
// src/helpers/client-options.schema.ts
|
|
@@ -34,17 +32,70 @@ var ClientOptionsSchema = import_zod.z.object({
|
|
|
34
32
|
/** The URL of the MinIO instance to connect to */
|
|
35
33
|
instance: import_validation.UrlSchema
|
|
36
34
|
});
|
|
37
|
-
var ServerClientOptionsSchema =
|
|
35
|
+
var ServerClientOptionsSchema = import_zod.z.object({
|
|
36
|
+
/** The URL of the MinIO instance to connect to */
|
|
37
|
+
instance: import_validation.UrlSchema,
|
|
38
38
|
/** The MinIO access key used to authenticate with the MinIO server */
|
|
39
39
|
accessKey: import_zod.z.string(),
|
|
40
40
|
/** The MinIO secret key used to authenticate with the MinIO server */
|
|
41
41
|
secretKey: import_zod.z.string()
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
+
// src/helpers/runtime.ts
|
|
45
|
+
function ensureServer() {
|
|
46
|
+
if (typeof window !== "undefined") {
|
|
47
|
+
throw new Error("This function can only be called on the server.");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/helpers/schema.ts
|
|
52
|
+
var import_zod2 = require("zod");
|
|
53
|
+
var t = {
|
|
54
|
+
String: (options = {}) => {
|
|
55
|
+
let schema = import_zod2.z.string();
|
|
56
|
+
if (options.format === "date-time") {
|
|
57
|
+
schema = schema.datetime();
|
|
58
|
+
} else if (options.format === "uri") {
|
|
59
|
+
schema = schema.url();
|
|
60
|
+
}
|
|
61
|
+
return schema;
|
|
62
|
+
},
|
|
63
|
+
Number: () => {
|
|
64
|
+
return import_zod2.z.number();
|
|
65
|
+
},
|
|
66
|
+
Boolean: () => {
|
|
67
|
+
return import_zod2.z.boolean();
|
|
68
|
+
},
|
|
69
|
+
Object: (shape, options = {}) => {
|
|
70
|
+
return import_zod2.z.object(shape);
|
|
71
|
+
},
|
|
72
|
+
Array: (items) => {
|
|
73
|
+
return import_zod2.z.array(items);
|
|
74
|
+
},
|
|
75
|
+
Optional: (schema) => {
|
|
76
|
+
return schema.optional();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
function validate(schema, value) {
|
|
80
|
+
return schema.parse(value);
|
|
81
|
+
}
|
|
82
|
+
var FileMetadataSchema = t.Object(
|
|
83
|
+
{
|
|
84
|
+
id: t.String(),
|
|
85
|
+
name: t.String(),
|
|
86
|
+
contentType: t.String(),
|
|
87
|
+
size: t.Number(),
|
|
88
|
+
uploadedAt: t.String({ format: "date-time" }),
|
|
89
|
+
etag: t.String(),
|
|
90
|
+
url: t.Optional(t.String({ format: "uri" }))
|
|
91
|
+
},
|
|
92
|
+
{ $id: "FileMetadata" }
|
|
93
|
+
);
|
|
94
|
+
|
|
44
95
|
// src/minio.ts
|
|
45
96
|
function createServerMinioClient(options) {
|
|
46
|
-
|
|
47
|
-
const validatedOptions =
|
|
97
|
+
ensureServer();
|
|
98
|
+
const validatedOptions = validate(ServerClientOptionsSchema, options);
|
|
48
99
|
const url = new URL(validatedOptions.instance);
|
|
49
100
|
return {
|
|
50
101
|
client: new import_minio.Client({
|
package/dist/minio.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/minio.ts","../src/helpers/client-options.schema.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/minio.ts","../src/helpers/client-options.schema.ts","../src/helpers/runtime.ts","../src/helpers/schema.ts"],"sourcesContent":["import { Client } from \"minio\";\nimport { type ServerClientOptions, ServerClientOptionsSchema } from \"./helpers/client-options.schema.js\";\nimport { ensureServer } from \"./helpers/runtime.js\";\nimport { validate } from \"./helpers/schema.js\";\n\n/**\n * Creates a MinIO client for server-side use with authentication.\n *\n * @param options - The server client options for configuring the MinIO client\n * @returns An object containing the initialized MinIO client\n * @throws Will throw an error if not called on the server or if the options fail validation\n *\n * @example\n * import { createServerMinioClient } from \"@settlemint/sdk-minio\";\n *\n * const { client } = createServerMinioClient({\n * instance: process.env.SETTLEMINT_MINIO_ENDPOINT!,\n * accessKey: process.env.SETTLEMINT_MINIO_ACCESS_KEY!,\n * secretKey: process.env.SETTLEMINT_MINIO_SECRET_KEY!\n * });\n * client.listBuckets();\n */\nexport function createServerMinioClient(options: ServerClientOptions): { client: Client } {\n ensureServer();\n\n // Validate the options with our utility that formats validation errors\n const validatedOptions = validate(ServerClientOptionsSchema, options);\n\n const url = new URL(validatedOptions.instance);\n return {\n client: new Client({\n endPoint: url.hostname,\n accessKey: validatedOptions.accessKey,\n secretKey: validatedOptions.secretKey,\n useSSL: url.protocol !== \"http:\",\n port: url.port ? Number(url.port) : undefined,\n region: \"eu-central-1\",\n }),\n };\n}\n","import { UrlSchema } from \"@settlemint/sdk-utils/validation\";\nimport { z } from \"zod\";\n\n/**\n * Schema for validating client options for the MinIO client.\n */\nexport const ClientOptionsSchema = z.object({\n /** The URL of the MinIO instance to connect to */\n instance: UrlSchema,\n});\n\n/**\n * Type definition for client options derived from the ClientOptionsSchema.\n */\nexport type ClientOptions = z.infer<typeof ClientOptionsSchema>;\n\n/**\n * Schema for validating server client options for the MinIO client.\n * Extends the ClientOptionsSchema with additional server-specific fields.\n */\nexport const ServerClientOptionsSchema = z.object({\n /** The URL of the MinIO instance to connect to */\n instance: UrlSchema,\n /** The MinIO access key used to authenticate with the MinIO server */\n accessKey: z.string(),\n /** The MinIO secret key used to authenticate with the MinIO server */\n secretKey: z.string(),\n});\n\n/**\n * Type definition for server client options derived from the ServerClientOptionsSchema.\n */\nexport type ServerClientOptions = z.infer<typeof ServerClientOptionsSchema>;\n","/**\n * Runtime utilities for checking execution environment\n */\n\n/**\n * Ensures the current code is running on the server\n * @throws Will throw an error if called on the client\n */\nexport function ensureServer(): void {\n if (typeof window !== \"undefined\") {\n throw new Error(\"This function can only be called on the server.\");\n }\n}\n","/**\n * Zod-based schema validation utilities\n *\n * This module provides a wrapper around Zod with an API surface that maintains\n * compatibility with the previous validation system. It provides simple functions\n * for creating and validating schemas.\n */\nimport { z } from \"zod\";\n\n// Re-export Zod's infer type to maintain API compatibility\nexport type Static<T extends z.ZodType> = z.infer<T>;\n\n// Simple wrapper around Zod to maintain API compatibility\nexport const t = {\n String: (options: { format?: string } = {}): z.ZodString => {\n let schema = z.string();\n if (options.format === \"date-time\") {\n schema = schema.datetime();\n } else if (options.format === \"uri\") {\n schema = schema.url();\n }\n return schema;\n },\n\n Number: (): z.ZodNumber => {\n return z.number();\n },\n\n Boolean: (): z.ZodBoolean => {\n return z.boolean();\n },\n\n Object: <T extends Record<string, z.ZodType>>(shape: T, options: { $id?: string } = {}): z.ZodObject<T> => {\n // Zod doesn't use $id, we just use it for API compatibility\n return z.object(shape);\n },\n\n Array: <T extends z.ZodType>(items: T): z.ZodArray<T> => {\n return z.array(items);\n },\n\n Optional: <T extends z.ZodType>(schema: T): z.ZodOptional<T> => {\n return schema.optional();\n },\n};\n\n/**\n * Validate data against a schema\n *\n * @param schema The Zod schema to validate against\n * @param value The value to validate\n * @returns The validated and typed value\n * @throws Will throw an error if validation fails\n */\nexport function validate<T extends z.ZodType>(schema: T, value: unknown): Static<T> {\n return schema.parse(value);\n}\n\n// ----- Schema Definitions -----\n\n/**\n * Schema for file metadata\n */\nexport const FileMetadataSchema = t.Object(\n {\n id: t.String(),\n name: t.String(),\n contentType: t.String(),\n size: t.Number(),\n uploadedAt: t.String({ format: \"date-time\" }),\n etag: t.String(),\n url: t.Optional(t.String({ format: \"uri\" })),\n },\n { $id: \"FileMetadata\" },\n);\n\n/**\n * Default bucket to use for file storage\n */\nexport const DEFAULT_BUCKET = \"uploads\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAuB;;;ACAvB,wBAA0B;AAC1B,iBAAkB;AAKX,IAAM,sBAAsB,aAAE,OAAO;AAAA;AAAA,EAE1C,UAAU;AACZ,CAAC;AAWM,IAAM,4BAA4B,aAAE,OAAO;AAAA;AAAA,EAEhD,UAAU;AAAA;AAAA,EAEV,WAAW,aAAE,OAAO;AAAA;AAAA,EAEpB,WAAW,aAAE,OAAO;AACtB,CAAC;;;ACnBM,SAAS,eAAqB;AACnC,MAAI,OAAO,WAAW,aAAa;AACjC,UAAM,IAAI,MAAM,iDAAiD;AAAA,EACnE;AACF;;;ACLA,IAAAA,cAAkB;AAMX,IAAM,IAAI;AAAA,EACf,QAAQ,CAAC,UAA+B,CAAC,MAAmB;AAC1D,QAAI,SAAS,cAAE,OAAO;AACtB,QAAI,QAAQ,WAAW,aAAa;AAClC,eAAS,OAAO,SAAS;AAAA,IAC3B,WAAW,QAAQ,WAAW,OAAO;AACnC,eAAS,OAAO,IAAI;AAAA,IACtB;AACA,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ,MAAmB;AACzB,WAAO,cAAE,OAAO;AAAA,EAClB;AAAA,EAEA,SAAS,MAAoB;AAC3B,WAAO,cAAE,QAAQ;AAAA,EACnB;AAAA,EAEA,QAAQ,CAAsC,OAAU,UAA4B,CAAC,MAAsB;AAEzG,WAAO,cAAE,OAAO,KAAK;AAAA,EACvB;AAAA,EAEA,OAAO,CAAsB,UAA4B;AACvD,WAAO,cAAE,MAAM,KAAK;AAAA,EACtB;AAAA,EAEA,UAAU,CAAsB,WAAgC;AAC9D,WAAO,OAAO,SAAS;AAAA,EACzB;AACF;AAUO,SAAS,SAA8B,QAAW,OAA2B;AAClF,SAAO,OAAO,MAAM,KAAK;AAC3B;AAOO,IAAM,qBAAqB,EAAE;AAAA,EAClC;AAAA,IACE,IAAI,EAAE,OAAO;AAAA,IACb,MAAM,EAAE,OAAO;AAAA,IACf,aAAa,EAAE,OAAO;AAAA,IACtB,MAAM,EAAE,OAAO;AAAA,IACf,YAAY,EAAE,OAAO,EAAE,QAAQ,YAAY,CAAC;AAAA,IAC5C,MAAM,EAAE,OAAO;AAAA,IACf,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,MAAM,CAAC,CAAC;AAAA,EAC7C;AAAA,EACA,EAAE,KAAK,eAAe;AACxB;;;AHpDO,SAAS,wBAAwB,SAAkD;AACxF,eAAa;AAGb,QAAM,mBAAmB,SAAS,2BAA2B,OAAO;AAEpE,QAAM,MAAM,IAAI,IAAI,iBAAiB,QAAQ;AAC7C,SAAO;AAAA,IACL,QAAQ,IAAI,oBAAO;AAAA,MACjB,UAAU,IAAI;AAAA,MACd,WAAW,iBAAiB;AAAA,MAC5B,WAAW,iBAAiB;AAAA,MAC5B,QAAQ,IAAI,aAAa;AAAA,MACzB,MAAM,IAAI,OAAO,OAAO,IAAI,IAAI,IAAI;AAAA,MACpC,QAAQ;AAAA,IACV,CAAC;AAAA,EACH;AACF;","names":["import_zod"]}
|
package/dist/minio.d.cts
CHANGED
|
@@ -2,13 +2,12 @@ import { Client } from 'minio';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Schema for validating server client options for the
|
|
5
|
+
* Schema for validating server client options for the MinIO client.
|
|
6
6
|
* Extends the ClientOptionsSchema with additional server-specific fields.
|
|
7
7
|
*/
|
|
8
8
|
declare const ServerClientOptionsSchema: z.ZodObject<{
|
|
9
9
|
/** The URL of the MinIO instance to connect to */
|
|
10
10
|
instance: z.ZodString;
|
|
11
|
-
} & {
|
|
12
11
|
/** The MinIO access key used to authenticate with the MinIO server */
|
|
13
12
|
accessKey: z.ZodString;
|
|
14
13
|
/** The MinIO secret key used to authenticate with the MinIO server */
|
package/dist/minio.d.ts
CHANGED
|
@@ -2,13 +2,12 @@ import { Client } from 'minio';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Schema for validating server client options for the
|
|
5
|
+
* Schema for validating server client options for the MinIO client.
|
|
6
6
|
* Extends the ClientOptionsSchema with additional server-specific fields.
|
|
7
7
|
*/
|
|
8
8
|
declare const ServerClientOptionsSchema: z.ZodObject<{
|
|
9
9
|
/** The URL of the MinIO instance to connect to */
|
|
10
10
|
instance: z.ZodString;
|
|
11
|
-
} & {
|
|
12
11
|
/** The MinIO access key used to authenticate with the MinIO server */
|
|
13
12
|
accessKey: z.ZodString;
|
|
14
13
|
/** The MinIO secret key used to authenticate with the MinIO server */
|
package/dist/minio.mjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// src/minio.ts
|
|
2
|
-
import { ensureServer } from "@settlemint/sdk-utils/runtime";
|
|
3
|
-
import { validate } from "@settlemint/sdk-utils/validation";
|
|
4
2
|
import { Client } from "minio";
|
|
5
3
|
|
|
6
4
|
// src/helpers/client-options.schema.ts
|
|
@@ -10,13 +8,66 @@ var ClientOptionsSchema = z.object({
|
|
|
10
8
|
/** The URL of the MinIO instance to connect to */
|
|
11
9
|
instance: UrlSchema
|
|
12
10
|
});
|
|
13
|
-
var ServerClientOptionsSchema =
|
|
11
|
+
var ServerClientOptionsSchema = z.object({
|
|
12
|
+
/** The URL of the MinIO instance to connect to */
|
|
13
|
+
instance: UrlSchema,
|
|
14
14
|
/** The MinIO access key used to authenticate with the MinIO server */
|
|
15
15
|
accessKey: z.string(),
|
|
16
16
|
/** The MinIO secret key used to authenticate with the MinIO server */
|
|
17
17
|
secretKey: z.string()
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
// src/helpers/runtime.ts
|
|
21
|
+
function ensureServer() {
|
|
22
|
+
if (typeof window !== "undefined") {
|
|
23
|
+
throw new Error("This function can only be called on the server.");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// src/helpers/schema.ts
|
|
28
|
+
import { z as z2 } from "zod";
|
|
29
|
+
var t = {
|
|
30
|
+
String: (options = {}) => {
|
|
31
|
+
let schema = z2.string();
|
|
32
|
+
if (options.format === "date-time") {
|
|
33
|
+
schema = schema.datetime();
|
|
34
|
+
} else if (options.format === "uri") {
|
|
35
|
+
schema = schema.url();
|
|
36
|
+
}
|
|
37
|
+
return schema;
|
|
38
|
+
},
|
|
39
|
+
Number: () => {
|
|
40
|
+
return z2.number();
|
|
41
|
+
},
|
|
42
|
+
Boolean: () => {
|
|
43
|
+
return z2.boolean();
|
|
44
|
+
},
|
|
45
|
+
Object: (shape, options = {}) => {
|
|
46
|
+
return z2.object(shape);
|
|
47
|
+
},
|
|
48
|
+
Array: (items) => {
|
|
49
|
+
return z2.array(items);
|
|
50
|
+
},
|
|
51
|
+
Optional: (schema) => {
|
|
52
|
+
return schema.optional();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
function validate(schema, value) {
|
|
56
|
+
return schema.parse(value);
|
|
57
|
+
}
|
|
58
|
+
var FileMetadataSchema = t.Object(
|
|
59
|
+
{
|
|
60
|
+
id: t.String(),
|
|
61
|
+
name: t.String(),
|
|
62
|
+
contentType: t.String(),
|
|
63
|
+
size: t.Number(),
|
|
64
|
+
uploadedAt: t.String({ format: "date-time" }),
|
|
65
|
+
etag: t.String(),
|
|
66
|
+
url: t.Optional(t.String({ format: "uri" }))
|
|
67
|
+
},
|
|
68
|
+
{ $id: "FileMetadata" }
|
|
69
|
+
);
|
|
70
|
+
|
|
20
71
|
// src/minio.ts
|
|
21
72
|
function createServerMinioClient(options) {
|
|
22
73
|
ensureServer();
|
package/dist/minio.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/minio.ts","../src/helpers/client-options.schema.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/minio.ts","../src/helpers/client-options.schema.ts","../src/helpers/runtime.ts","../src/helpers/schema.ts"],"sourcesContent":["import { Client } from \"minio\";\nimport { type ServerClientOptions, ServerClientOptionsSchema } from \"./helpers/client-options.schema.js\";\nimport { ensureServer } from \"./helpers/runtime.js\";\nimport { validate } from \"./helpers/schema.js\";\n\n/**\n * Creates a MinIO client for server-side use with authentication.\n *\n * @param options - The server client options for configuring the MinIO client\n * @returns An object containing the initialized MinIO client\n * @throws Will throw an error if not called on the server or if the options fail validation\n *\n * @example\n * import { createServerMinioClient } from \"@settlemint/sdk-minio\";\n *\n * const { client } = createServerMinioClient({\n * instance: process.env.SETTLEMINT_MINIO_ENDPOINT!,\n * accessKey: process.env.SETTLEMINT_MINIO_ACCESS_KEY!,\n * secretKey: process.env.SETTLEMINT_MINIO_SECRET_KEY!\n * });\n * client.listBuckets();\n */\nexport function createServerMinioClient(options: ServerClientOptions): { client: Client } {\n ensureServer();\n\n // Validate the options with our utility that formats validation errors\n const validatedOptions = validate(ServerClientOptionsSchema, options);\n\n const url = new URL(validatedOptions.instance);\n return {\n client: new Client({\n endPoint: url.hostname,\n accessKey: validatedOptions.accessKey,\n secretKey: validatedOptions.secretKey,\n useSSL: url.protocol !== \"http:\",\n port: url.port ? Number(url.port) : undefined,\n region: \"eu-central-1\",\n }),\n };\n}\n","import { UrlSchema } from \"@settlemint/sdk-utils/validation\";\nimport { z } from \"zod\";\n\n/**\n * Schema for validating client options for the MinIO client.\n */\nexport const ClientOptionsSchema = z.object({\n /** The URL of the MinIO instance to connect to */\n instance: UrlSchema,\n});\n\n/**\n * Type definition for client options derived from the ClientOptionsSchema.\n */\nexport type ClientOptions = z.infer<typeof ClientOptionsSchema>;\n\n/**\n * Schema for validating server client options for the MinIO client.\n * Extends the ClientOptionsSchema with additional server-specific fields.\n */\nexport const ServerClientOptionsSchema = z.object({\n /** The URL of the MinIO instance to connect to */\n instance: UrlSchema,\n /** The MinIO access key used to authenticate with the MinIO server */\n accessKey: z.string(),\n /** The MinIO secret key used to authenticate with the MinIO server */\n secretKey: z.string(),\n});\n\n/**\n * Type definition for server client options derived from the ServerClientOptionsSchema.\n */\nexport type ServerClientOptions = z.infer<typeof ServerClientOptionsSchema>;\n","/**\n * Runtime utilities for checking execution environment\n */\n\n/**\n * Ensures the current code is running on the server\n * @throws Will throw an error if called on the client\n */\nexport function ensureServer(): void {\n if (typeof window !== \"undefined\") {\n throw new Error(\"This function can only be called on the server.\");\n }\n}\n","/**\n * Zod-based schema validation utilities\n *\n * This module provides a wrapper around Zod with an API surface that maintains\n * compatibility with the previous validation system. It provides simple functions\n * for creating and validating schemas.\n */\nimport { z } from \"zod\";\n\n// Re-export Zod's infer type to maintain API compatibility\nexport type Static<T extends z.ZodType> = z.infer<T>;\n\n// Simple wrapper around Zod to maintain API compatibility\nexport const t = {\n String: (options: { format?: string } = {}): z.ZodString => {\n let schema = z.string();\n if (options.format === \"date-time\") {\n schema = schema.datetime();\n } else if (options.format === \"uri\") {\n schema = schema.url();\n }\n return schema;\n },\n\n Number: (): z.ZodNumber => {\n return z.number();\n },\n\n Boolean: (): z.ZodBoolean => {\n return z.boolean();\n },\n\n Object: <T extends Record<string, z.ZodType>>(shape: T, options: { $id?: string } = {}): z.ZodObject<T> => {\n // Zod doesn't use $id, we just use it for API compatibility\n return z.object(shape);\n },\n\n Array: <T extends z.ZodType>(items: T): z.ZodArray<T> => {\n return z.array(items);\n },\n\n Optional: <T extends z.ZodType>(schema: T): z.ZodOptional<T> => {\n return schema.optional();\n },\n};\n\n/**\n * Validate data against a schema\n *\n * @param schema The Zod schema to validate against\n * @param value The value to validate\n * @returns The validated and typed value\n * @throws Will throw an error if validation fails\n */\nexport function validate<T extends z.ZodType>(schema: T, value: unknown): Static<T> {\n return schema.parse(value);\n}\n\n// ----- Schema Definitions -----\n\n/**\n * Schema for file metadata\n */\nexport const FileMetadataSchema = t.Object(\n {\n id: t.String(),\n name: t.String(),\n contentType: t.String(),\n size: t.Number(),\n uploadedAt: t.String({ format: \"date-time\" }),\n etag: t.String(),\n url: t.Optional(t.String({ format: \"uri\" })),\n },\n { $id: \"FileMetadata\" },\n);\n\n/**\n * Default bucket to use for file storage\n */\nexport const DEFAULT_BUCKET = \"uploads\";\n"],"mappings":";AAAA,SAAS,cAAc;;;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,SAAS;AAKX,IAAM,sBAAsB,EAAE,OAAO;AAAA;AAAA,EAE1C,UAAU;AACZ,CAAC;AAWM,IAAM,4BAA4B,EAAE,OAAO;AAAA;AAAA,EAEhD,UAAU;AAAA;AAAA,EAEV,WAAW,EAAE,OAAO;AAAA;AAAA,EAEpB,WAAW,EAAE,OAAO;AACtB,CAAC;;;ACnBM,SAAS,eAAqB;AACnC,MAAI,OAAO,WAAW,aAAa;AACjC,UAAM,IAAI,MAAM,iDAAiD;AAAA,EACnE;AACF;;;ACLA,SAAS,KAAAA,UAAS;AAMX,IAAM,IAAI;AAAA,EACf,QAAQ,CAAC,UAA+B,CAAC,MAAmB;AAC1D,QAAI,SAASA,GAAE,OAAO;AACtB,QAAI,QAAQ,WAAW,aAAa;AAClC,eAAS,OAAO,SAAS;AAAA,IAC3B,WAAW,QAAQ,WAAW,OAAO;AACnC,eAAS,OAAO,IAAI;AAAA,IACtB;AACA,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ,MAAmB;AACzB,WAAOA,GAAE,OAAO;AAAA,EAClB;AAAA,EAEA,SAAS,MAAoB;AAC3B,WAAOA,GAAE,QAAQ;AAAA,EACnB;AAAA,EAEA,QAAQ,CAAsC,OAAU,UAA4B,CAAC,MAAsB;AAEzG,WAAOA,GAAE,OAAO,KAAK;AAAA,EACvB;AAAA,EAEA,OAAO,CAAsB,UAA4B;AACvD,WAAOA,GAAE,MAAM,KAAK;AAAA,EACtB;AAAA,EAEA,UAAU,CAAsB,WAAgC;AAC9D,WAAO,OAAO,SAAS;AAAA,EACzB;AACF;AAUO,SAAS,SAA8B,QAAW,OAA2B;AAClF,SAAO,OAAO,MAAM,KAAK;AAC3B;AAOO,IAAM,qBAAqB,EAAE;AAAA,EAClC;AAAA,IACE,IAAI,EAAE,OAAO;AAAA,IACb,MAAM,EAAE,OAAO;AAAA,IACf,aAAa,EAAE,OAAO;AAAA,IACtB,MAAM,EAAE,OAAO;AAAA,IACf,YAAY,EAAE,OAAO,EAAE,QAAQ,YAAY,CAAC;AAAA,IAC5C,MAAM,EAAE,OAAO;AAAA,IACf,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,MAAM,CAAC,CAAC;AAAA,EAC7C;AAAA,EACA,EAAE,KAAK,eAAe;AACxB;;;AHpDO,SAAS,wBAAwB,SAAkD;AACxF,eAAa;AAGb,QAAM,mBAAmB,SAAS,2BAA2B,OAAO;AAEpE,QAAM,MAAM,IAAI,IAAI,iBAAiB,QAAQ;AAC7C,SAAO;AAAA,IACL,QAAQ,IAAI,OAAO;AAAA,MACjB,UAAU,IAAI;AAAA,MACd,WAAW,iBAAiB;AAAA,MAC5B,WAAW,iBAAiB;AAAA,MAC5B,QAAQ,IAAI,aAAa;AAAA,MACzB,MAAM,IAAI,OAAO,OAAO,IAAI,IAAI,IAAI;AAAA,MACpC,QAAQ;AAAA,IACV,CAAC;AAAA,EACH;AACF;","names":["z"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@settlemint/sdk-minio",
|
|
3
3
|
"description": "MinIO integration module for SettleMint SDK, providing S3-compatible object storage capabilities",
|
|
4
|
-
"version": "2.1.4-
|
|
4
|
+
"version": "2.1.4-pr0619d764",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
7
|
"license": "FSL-1.1-MIT",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@settlemint/sdk-utils": "2.1.4-
|
|
54
|
+
"@settlemint/sdk-utils": "2.1.4-pr0619d764",
|
|
55
55
|
"minio": "^8",
|
|
56
56
|
"zod": "^3"
|
|
57
57
|
},
|