@veruna/api-contracts 1.0.18 → 1.0.19
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/build/controllers/ai-provider.controllers.d.ts +5 -0
- package/build/controllers/ai-provider.controllers.js +8 -0
- package/build/controllers/file.controllers.d.ts +5 -0
- package/build/controllers/file.controllers.js +8 -0
- package/build/controllers/index.d.ts +2 -0
- package/build/controllers/index.js +6 -1
- package/build/rest-api.d.ts +21 -0
- package/build/rest-api.js +26 -0
- package/build/routes/ai-provider-admin.routes.d.ts +11 -0
- package/build/routes/ai-provider-admin.routes.js +14 -0
- package/build/routes/ai-provider-public.routes.d.ts +7 -0
- package/build/routes/ai-provider-public.routes.js +10 -0
- package/build/routes/file.routes.d.ts +14 -0
- package/build/routes/file.routes.js +20 -0
- package/build/routes/index.d.ts +3 -0
- package/build/routes/index.js +7 -1
- package/build/v1/ai-provider/admin/commands/create-provider.command.d.ts +23 -0
- package/build/v1/ai-provider/admin/commands/create-provider.command.js +13 -0
- package/build/v1/ai-provider/admin/commands/delete-provider.command.d.ts +14 -0
- package/build/v1/ai-provider/admin/commands/delete-provider.command.js +17 -0
- package/build/v1/ai-provider/admin/commands/index.d.ts +3 -0
- package/build/v1/ai-provider/admin/commands/index.js +19 -0
- package/build/v1/ai-provider/admin/commands/update-provider.command.d.ts +27 -0
- package/build/v1/ai-provider/admin/commands/update-provider.command.js +14 -0
- package/build/v1/ai-provider/admin/queries/get-provider.query.d.ts +20 -0
- package/build/v1/ai-provider/admin/queries/get-provider.query.js +13 -0
- package/build/v1/ai-provider/admin/queries/get-providers.query.d.ts +31 -0
- package/build/v1/ai-provider/admin/queries/get-providers.query.js +14 -0
- package/build/v1/ai-provider/admin/queries/index.d.ts +2 -0
- package/build/v1/ai-provider/admin/queries/index.js +18 -0
- package/build/v1/ai-provider/ai-provider.errors.d.ts +7 -0
- package/build/v1/ai-provider/ai-provider.errors.js +23 -0
- package/build/v1/ai-provider/index.d.ts +5 -0
- package/build/v1/ai-provider/index.js +21 -0
- package/build/v1/ai-provider/public/queries/get-active-providers.query.d.ts +18 -0
- package/build/v1/ai-provider/public/queries/get-active-providers.query.js +16 -0
- package/build/v1/ai-provider/public/queries/index.d.ts +1 -0
- package/build/v1/ai-provider/public/queries/index.js +17 -0
- package/build/v1/ai-provider/schemas/ai-provider-status.enum.d.ts +7 -0
- package/build/v1/ai-provider/schemas/ai-provider-status.enum.js +11 -0
- package/build/v1/ai-provider/schemas/create-provider-request.schema.d.ts +9 -0
- package/build/v1/ai-provider/schemas/create-provider-request.schema.js +16 -0
- package/build/v1/ai-provider/schemas/index.d.ts +5 -0
- package/build/v1/ai-provider/schemas/index.js +21 -0
- package/build/v1/ai-provider/schemas/provider-response.schema.d.ts +15 -0
- package/build/v1/ai-provider/schemas/provider-response.schema.js +18 -0
- package/build/v1/ai-provider/schemas/route-params.schema.d.ts +4 -0
- package/build/v1/ai-provider/schemas/route-params.schema.js +8 -0
- package/build/v1/ai-provider/schemas/update-provider-request.schema.d.ts +9 -0
- package/build/v1/ai-provider/schemas/update-provider-request.schema.js +17 -0
- package/build/v1/file/commands/delete-file-by-key.command.d.ts +15 -0
- package/build/v1/file/commands/delete-file-by-key.command.js +15 -0
- package/build/v1/file/commands/delete-file.command.d.ts +15 -0
- package/build/v1/file/commands/delete-file.command.js +18 -0
- package/build/v1/file/commands/index.d.ts +4 -0
- package/build/v1/file/commands/index.js +20 -0
- package/build/v1/file/commands/upload-file.command.d.ts +16 -0
- package/build/v1/file/commands/upload-file.command.js +15 -0
- package/build/v1/file/commands/upload-image.command.d.ts +19 -0
- package/build/v1/file/commands/upload-image.command.js +15 -0
- package/build/v1/file/file.errors.d.ts +15 -0
- package/build/v1/file/file.errors.js +73 -0
- package/build/v1/file/index.d.ts +6 -0
- package/build/v1/file/index.js +26 -0
- package/build/v1/file/queries/get-file.query.d.ts +33 -0
- package/build/v1/file/queries/get-file.query.js +18 -0
- package/build/v1/file/queries/index.d.ts +3 -0
- package/build/v1/file/queries/index.js +19 -0
- package/build/v1/file/queries/list-files.query.d.ts +38 -0
- package/build/v1/file/queries/list-files.query.js +15 -0
- package/build/v1/file/queries/list-folders.query.d.ts +17 -0
- package/build/v1/file/queries/list-folders.query.js +15 -0
- package/build/v1/file/schemas/delete-file-by-key-request.schema.d.ts +7 -0
- package/build/v1/file/schemas/delete-file-by-key-request.schema.js +10 -0
- package/build/v1/file/schemas/delete-file-response.schema.d.ts +15 -0
- package/build/v1/file/schemas/delete-file-response.schema.js +18 -0
- package/build/v1/file/schemas/file-category.enum.d.ts +9 -0
- package/build/v1/file/schemas/file-category.enum.js +13 -0
- package/build/v1/file/schemas/file-response.schema.d.ts +18 -0
- package/build/v1/file/schemas/file-response.schema.js +21 -0
- package/build/v1/file/schemas/file-status.enum.d.ts +10 -0
- package/build/v1/file/schemas/file-status.enum.js +14 -0
- package/build/v1/file/schemas/file-variant-response.schema.d.ts +13 -0
- package/build/v1/file/schemas/file-variant-response.schema.js +16 -0
- package/build/v1/file/schemas/file-with-variants-response.schema.d.ts +26 -0
- package/build/v1/file/schemas/file-with-variants-response.schema.js +13 -0
- package/build/v1/file/schemas/folder-response.schema.d.ts +17 -0
- package/build/v1/file/schemas/folder-response.schema.js +17 -0
- package/build/v1/file/schemas/image-format.enum.d.ts +7 -0
- package/build/v1/file/schemas/image-format.enum.js +11 -0
- package/build/v1/file/schemas/index.d.ts +16 -0
- package/build/v1/file/schemas/index.js +37 -0
- package/build/v1/file/schemas/list-files-request.schema.d.ts +14 -0
- package/build/v1/file/schemas/list-files-request.schema.js +17 -0
- package/build/v1/file/schemas/list-files-response.schema.d.ts +26 -0
- package/build/v1/file/schemas/list-files-response.schema.js +13 -0
- package/build/v1/file/schemas/list-folders-request.schema.d.ts +7 -0
- package/build/v1/file/schemas/list-folders-request.schema.js +10 -0
- package/build/v1/file/schemas/upload-file-request.schema.d.ts +7 -0
- package/build/v1/file/schemas/upload-file-request.schema.js +10 -0
- package/build/v1/file/schemas/upload-file-response.schema.d.ts +9 -0
- package/build/v1/file/schemas/upload-file-response.schema.js +12 -0
- package/build/v1/file/schemas/upload-image-request.schema.d.ts +18 -0
- package/build/v1/file/schemas/upload-image-request.schema.js +28 -0
- package/build/v1/file/schemas/upload-image-response.schema.d.ts +10 -0
- package/build/v1/file/schemas/upload-image-response.schema.js +19 -0
- package/build/v1/index.d.ts +1 -0
- package/build/v1/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteFileByKeyResponseSchema = exports.DeleteFileResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Delete file by ID response schema
|
|
7
|
+
*/
|
|
8
|
+
exports.DeleteFileResponseSchema = zod_1.z.object({
|
|
9
|
+
success: zod_1.z.boolean(),
|
|
10
|
+
message: zod_1.z.string(),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Delete file by key response schema (legacy)
|
|
14
|
+
*/
|
|
15
|
+
exports.DeleteFileByKeyResponseSchema = zod_1.z.object({
|
|
16
|
+
message: zod_1.z.string(),
|
|
17
|
+
key: zod_1.z.string(),
|
|
18
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileCategory = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* File category based on content type
|
|
6
|
+
*/
|
|
7
|
+
var FileCategory;
|
|
8
|
+
(function (FileCategory) {
|
|
9
|
+
FileCategory["IMAGE"] = "image";
|
|
10
|
+
FileCategory["DOCUMENT"] = "document";
|
|
11
|
+
FileCategory["VIDEO"] = "video";
|
|
12
|
+
FileCategory["OTHER"] = "other";
|
|
13
|
+
})(FileCategory || (exports.FileCategory = FileCategory = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { FileStatus } from './file-status.enum';
|
|
3
|
+
import { FileCategory } from './file-category.enum';
|
|
4
|
+
/**
|
|
5
|
+
* File item schema (for list responses)
|
|
6
|
+
*/
|
|
7
|
+
export declare const FileItemResponseSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
folder: z.ZodString;
|
|
10
|
+
filename: z.ZodString;
|
|
11
|
+
size: z.ZodNumber;
|
|
12
|
+
contentType: z.ZodString;
|
|
13
|
+
category: z.ZodEnum<typeof FileCategory>;
|
|
14
|
+
status: z.ZodEnum<typeof FileStatus>;
|
|
15
|
+
url: z.ZodOptional<z.ZodString>;
|
|
16
|
+
uploadedBy: z.ZodString;
|
|
17
|
+
uploadedAt: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileItemResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const file_status_enum_1 = require("./file-status.enum");
|
|
6
|
+
const file_category_enum_1 = require("./file-category.enum");
|
|
7
|
+
/**
|
|
8
|
+
* File item schema (for list responses)
|
|
9
|
+
*/
|
|
10
|
+
exports.FileItemResponseSchema = zod_1.z.object({
|
|
11
|
+
id: zod_1.z.string().uuid(),
|
|
12
|
+
folder: zod_1.z.string(),
|
|
13
|
+
filename: zod_1.z.string(),
|
|
14
|
+
size: zod_1.z.number().int().nonnegative(),
|
|
15
|
+
contentType: zod_1.z.string(),
|
|
16
|
+
category: zod_1.z.enum(file_category_enum_1.FileCategory),
|
|
17
|
+
status: zod_1.z.enum(file_status_enum_1.FileStatus),
|
|
18
|
+
url: zod_1.z.string().optional(),
|
|
19
|
+
uploadedBy: zod_1.z.string(),
|
|
20
|
+
uploadedAt: zod_1.z.string().datetime(),
|
|
21
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* File processing status
|
|
6
|
+
*/
|
|
7
|
+
var FileStatus;
|
|
8
|
+
(function (FileStatus) {
|
|
9
|
+
FileStatus["UPLOADING"] = "UPLOADING";
|
|
10
|
+
FileStatus["PROCESSING"] = "PROCESSING";
|
|
11
|
+
FileStatus["READY"] = "READY";
|
|
12
|
+
FileStatus["FAILED"] = "FAILED";
|
|
13
|
+
FileStatus["DELETED"] = "DELETED";
|
|
14
|
+
})(FileStatus || (exports.FileStatus = FileStatus = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* File variant schema (for images with different sizes/formats)
|
|
4
|
+
*/
|
|
5
|
+
export declare const FileVariantResponseSchema: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
sizeName: z.ZodString;
|
|
8
|
+
format: z.ZodString;
|
|
9
|
+
sizeBytes: z.ZodNumber;
|
|
10
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
url: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileVariantResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* File variant schema (for images with different sizes/formats)
|
|
7
|
+
*/
|
|
8
|
+
exports.FileVariantResponseSchema = zod_1.z.object({
|
|
9
|
+
id: zod_1.z.string().uuid(),
|
|
10
|
+
sizeName: zod_1.z.string(),
|
|
11
|
+
format: zod_1.z.string(),
|
|
12
|
+
sizeBytes: zod_1.z.number().int().nonnegative(),
|
|
13
|
+
width: zod_1.z.number().int().positive().optional(),
|
|
14
|
+
height: zod_1.z.number().int().positive().optional(),
|
|
15
|
+
url: zod_1.z.string().optional(),
|
|
16
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* File with variants schema (for single file response)
|
|
4
|
+
*/
|
|
5
|
+
export declare const FileWithVariantsResponseSchema: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
folder: z.ZodString;
|
|
8
|
+
filename: z.ZodString;
|
|
9
|
+
size: z.ZodNumber;
|
|
10
|
+
contentType: z.ZodString;
|
|
11
|
+
category: z.ZodEnum<typeof import("./file-category.enum").FileCategory>;
|
|
12
|
+
status: z.ZodEnum<typeof import("./file-status.enum").FileStatus>;
|
|
13
|
+
url: z.ZodOptional<z.ZodString>;
|
|
14
|
+
uploadedBy: z.ZodString;
|
|
15
|
+
uploadedAt: z.ZodString;
|
|
16
|
+
updatedAt: z.ZodString;
|
|
17
|
+
variants: z.ZodArray<z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
sizeName: z.ZodString;
|
|
20
|
+
format: z.ZodString;
|
|
21
|
+
sizeBytes: z.ZodNumber;
|
|
22
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
url: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileWithVariantsResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const file_response_schema_1 = require("./file-response.schema");
|
|
6
|
+
const file_variant_response_schema_1 = require("./file-variant-response.schema");
|
|
7
|
+
/**
|
|
8
|
+
* File with variants schema (for single file response)
|
|
9
|
+
*/
|
|
10
|
+
exports.FileWithVariantsResponseSchema = file_response_schema_1.FileItemResponseSchema.extend({
|
|
11
|
+
updatedAt: zod_1.z.string().datetime(),
|
|
12
|
+
variants: zod_1.z.array(file_variant_response_schema_1.FileVariantResponseSchema),
|
|
13
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Folder item schema
|
|
4
|
+
*/
|
|
5
|
+
export declare const FolderItemSchema: z.ZodObject<{
|
|
6
|
+
path: z.ZodString;
|
|
7
|
+
fileCount: z.ZodNumber;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
/**
|
|
10
|
+
* List folders response schema
|
|
11
|
+
*/
|
|
12
|
+
export declare const ListFoldersResponseSchema: z.ZodObject<{
|
|
13
|
+
folders: z.ZodArray<z.ZodObject<{
|
|
14
|
+
path: z.ZodString;
|
|
15
|
+
fileCount: z.ZodNumber;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListFoldersResponseSchema = exports.FolderItemSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Folder item schema
|
|
7
|
+
*/
|
|
8
|
+
exports.FolderItemSchema = zod_1.z.object({
|
|
9
|
+
path: zod_1.z.string(),
|
|
10
|
+
fileCount: zod_1.z.number().int().nonnegative(),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* List folders response schema
|
|
14
|
+
*/
|
|
15
|
+
exports.ListFoldersResponseSchema = zod_1.z.object({
|
|
16
|
+
folders: zod_1.z.array(exports.FolderItemSchema),
|
|
17
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageFormat = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Supported image formats for conversion
|
|
6
|
+
*/
|
|
7
|
+
var ImageFormat;
|
|
8
|
+
(function (ImageFormat) {
|
|
9
|
+
ImageFormat["WEBP"] = "webp";
|
|
10
|
+
ImageFormat["JPEG"] = "jpeg";
|
|
11
|
+
})(ImageFormat || (exports.ImageFormat = ImageFormat = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './file-status.enum';
|
|
2
|
+
export * from './file-category.enum';
|
|
3
|
+
export * from './image-format.enum';
|
|
4
|
+
export * from './file-response.schema';
|
|
5
|
+
export * from './file-variant-response.schema';
|
|
6
|
+
export * from './file-with-variants-response.schema';
|
|
7
|
+
export * from './folder-response.schema';
|
|
8
|
+
export * from './upload-image-request.schema';
|
|
9
|
+
export * from './upload-image-response.schema';
|
|
10
|
+
export * from './upload-file-request.schema';
|
|
11
|
+
export * from './upload-file-response.schema';
|
|
12
|
+
export * from './list-files-request.schema';
|
|
13
|
+
export * from './list-files-response.schema';
|
|
14
|
+
export * from './list-folders-request.schema';
|
|
15
|
+
export * from './delete-file-response.schema';
|
|
16
|
+
export * from './delete-file-by-key-request.schema';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Enums
|
|
18
|
+
__exportStar(require("./file-status.enum"), exports);
|
|
19
|
+
__exportStar(require("./file-category.enum"), exports);
|
|
20
|
+
__exportStar(require("./image-format.enum"), exports);
|
|
21
|
+
// Response schemas
|
|
22
|
+
__exportStar(require("./file-response.schema"), exports);
|
|
23
|
+
__exportStar(require("./file-variant-response.schema"), exports);
|
|
24
|
+
__exportStar(require("./file-with-variants-response.schema"), exports);
|
|
25
|
+
__exportStar(require("./folder-response.schema"), exports);
|
|
26
|
+
// Upload schemas
|
|
27
|
+
__exportStar(require("./upload-image-request.schema"), exports);
|
|
28
|
+
__exportStar(require("./upload-image-response.schema"), exports);
|
|
29
|
+
__exportStar(require("./upload-file-request.schema"), exports);
|
|
30
|
+
__exportStar(require("./upload-file-response.schema"), exports);
|
|
31
|
+
// List schemas
|
|
32
|
+
__exportStar(require("./list-files-request.schema"), exports);
|
|
33
|
+
__exportStar(require("./list-files-response.schema"), exports);
|
|
34
|
+
__exportStar(require("./list-folders-request.schema"), exports);
|
|
35
|
+
// Delete schemas
|
|
36
|
+
__exportStar(require("./delete-file-response.schema"), exports);
|
|
37
|
+
__exportStar(require("./delete-file-by-key-request.schema"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { FileStatus } from './file-status.enum';
|
|
3
|
+
import { FileCategory } from './file-category.enum';
|
|
4
|
+
/**
|
|
5
|
+
* List files query parameters schema
|
|
6
|
+
*/
|
|
7
|
+
export declare const ListFilesQuerySchema: z.ZodObject<{
|
|
8
|
+
folder: z.ZodOptional<z.ZodString>;
|
|
9
|
+
status: z.ZodOptional<z.ZodEnum<typeof FileStatus>>;
|
|
10
|
+
category: z.ZodOptional<z.ZodEnum<typeof FileCategory>>;
|
|
11
|
+
uploadedBy: z.ZodOptional<z.ZodString>;
|
|
12
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
13
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListFilesQuerySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const file_status_enum_1 = require("./file-status.enum");
|
|
6
|
+
const file_category_enum_1 = require("./file-category.enum");
|
|
7
|
+
/**
|
|
8
|
+
* List files query parameters schema
|
|
9
|
+
*/
|
|
10
|
+
exports.ListFilesQuerySchema = zod_1.z.object({
|
|
11
|
+
folder: zod_1.z.string().optional(),
|
|
12
|
+
status: zod_1.z.enum(file_status_enum_1.FileStatus).optional(),
|
|
13
|
+
category: zod_1.z.enum(file_category_enum_1.FileCategory).optional(),
|
|
14
|
+
uploadedBy: zod_1.z.string().optional(),
|
|
15
|
+
page: zod_1.z.coerce.number().int().positive().default(1),
|
|
16
|
+
limit: zod_1.z.coerce.number().int().positive().max(100).default(20),
|
|
17
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* List files paginated response schema
|
|
4
|
+
*/
|
|
5
|
+
export declare const ListFilesResponseSchema: z.ZodObject<{
|
|
6
|
+
data: z.ZodArray<z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
folder: z.ZodString;
|
|
9
|
+
filename: z.ZodString;
|
|
10
|
+
size: z.ZodNumber;
|
|
11
|
+
contentType: z.ZodString;
|
|
12
|
+
category: z.ZodEnum<typeof import("./file-category.enum").FileCategory>;
|
|
13
|
+
status: z.ZodEnum<typeof import("./file-status.enum").FileStatus>;
|
|
14
|
+
url: z.ZodOptional<z.ZodString>;
|
|
15
|
+
uploadedBy: z.ZodString;
|
|
16
|
+
uploadedAt: z.ZodString;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
meta: z.ZodObject<{
|
|
19
|
+
page: z.ZodNumber;
|
|
20
|
+
limit: z.ZodNumber;
|
|
21
|
+
total: z.ZodNumber;
|
|
22
|
+
totalPages: z.ZodNumber;
|
|
23
|
+
hasNext: z.ZodBoolean;
|
|
24
|
+
hasPrev: z.ZodBoolean;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListFilesResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const file_response_schema_1 = require("./file-response.schema");
|
|
6
|
+
const shared_1 = require("../../../shared");
|
|
7
|
+
/**
|
|
8
|
+
* List files paginated response schema
|
|
9
|
+
*/
|
|
10
|
+
exports.ListFilesResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.array(file_response_schema_1.FileItemResponseSchema),
|
|
12
|
+
meta: shared_1.PaginationMetaSchema,
|
|
13
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListFoldersQuerySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* List folders query parameters schema
|
|
7
|
+
*/
|
|
8
|
+
exports.ListFoldersQuerySchema = zod_1.z.object({
|
|
9
|
+
prefix: zod_1.z.string().optional(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UploadFileQuerySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Upload file query parameters schema
|
|
7
|
+
*/
|
|
8
|
+
exports.UploadFileQuerySchema = zod_1.z.object({
|
|
9
|
+
folder: zod_1.z.string().min(1),
|
|
10
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UploadFileResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Upload file response schema
|
|
7
|
+
*/
|
|
8
|
+
exports.UploadFileResponseSchema = zod_1.z.object({
|
|
9
|
+
key: zod_1.z.string(),
|
|
10
|
+
cdnUrl: zod_1.z.string().url(),
|
|
11
|
+
s3Url: zod_1.z.string().url(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageFormat } from './image-format.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Upload image query parameters schema
|
|
5
|
+
*/
|
|
6
|
+
export declare const UploadImageQuerySchema: z.ZodObject<{
|
|
7
|
+
folder: z.ZodString;
|
|
8
|
+
formats: z.ZodString;
|
|
9
|
+
sizes: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
/**
|
|
12
|
+
* Helper to parse formats string to array
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseFormats(formats: string): ImageFormat[];
|
|
15
|
+
/**
|
|
16
|
+
* Helper to parse sizes string to array
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseSizes(sizes: string | undefined): string[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UploadImageQuerySchema = void 0;
|
|
4
|
+
exports.parseFormats = parseFormats;
|
|
5
|
+
exports.parseSizes = parseSizes;
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
/**
|
|
8
|
+
* Upload image query parameters schema
|
|
9
|
+
*/
|
|
10
|
+
exports.UploadImageQuerySchema = zod_1.z.object({
|
|
11
|
+
folder: zod_1.z.string().min(1),
|
|
12
|
+
formats: zod_1.z.string().min(1), // comma-separated: "webp" | "jpeg" | "webp,jpeg"
|
|
13
|
+
sizes: zod_1.z.string().optional(), // comma-separated: "1024x1024,512x512"
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* Helper to parse formats string to array
|
|
17
|
+
*/
|
|
18
|
+
function parseFormats(formats) {
|
|
19
|
+
return formats.split(',').map((f) => f.trim());
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Helper to parse sizes string to array
|
|
23
|
+
*/
|
|
24
|
+
function parseSizes(sizes) {
|
|
25
|
+
if (!sizes)
|
|
26
|
+
return [];
|
|
27
|
+
return sizes.split(',').map((s) => s.trim());
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Upload image response schema
|
|
4
|
+
*/
|
|
5
|
+
export declare const UploadImageResponseSchema: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
variants: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8
|
+
cdnUrl: z.ZodString;
|
|
9
|
+
s3Url: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UploadImageResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Variants map: size -> format -> path
|
|
7
|
+
* Example: { "1024x1024": { "webp": "path/to/file.webp", "jpeg": "path/to/file.jpg" } }
|
|
8
|
+
*/
|
|
9
|
+
const VariantsMapSchema = zod_1.z.record(zod_1.z.string(), // size name
|
|
10
|
+
zod_1.z.record(zod_1.z.string(), zod_1.z.string()));
|
|
11
|
+
/**
|
|
12
|
+
* Upload image response schema
|
|
13
|
+
*/
|
|
14
|
+
exports.UploadImageResponseSchema = zod_1.z.object({
|
|
15
|
+
id: zod_1.z.string().uuid(),
|
|
16
|
+
variants: VariantsMapSchema,
|
|
17
|
+
cdnUrl: zod_1.z.string().url(),
|
|
18
|
+
s3Url: zod_1.z.string().url(),
|
|
19
|
+
});
|
package/build/v1/index.d.ts
CHANGED
package/build/v1/index.js
CHANGED