@common_ch/common 1.0.405 → 1.0.410
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.
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import mongoose, { Types } from 'mongoose';
|
|
2
2
|
import { AiAttrs } from './ai';
|
|
3
3
|
import { ImageRoleEnum } from '../../enums/image';
|
|
4
|
+
import { AiOptionDoc } from './ai-option';
|
|
4
5
|
export type Images = {
|
|
5
|
-
|
|
6
|
+
aiOption: Types.ObjectId | AiOptionDoc;
|
|
6
7
|
role: ImageRoleEnum;
|
|
7
8
|
content: string;
|
|
8
9
|
deleted?: boolean;
|
|
@@ -10,6 +11,7 @@ export type Images = {
|
|
|
10
11
|
};
|
|
11
12
|
export interface ImageAttrs {
|
|
12
13
|
userId: Types.ObjectId;
|
|
14
|
+
ai: Types.ObjectId | AiAttrs;
|
|
13
15
|
imageName: string;
|
|
14
16
|
planId?: Types.ObjectId;
|
|
15
17
|
images: Images[];
|
|
@@ -24,6 +26,7 @@ interface ImageModel extends mongoose.Model<ImageDoc> {
|
|
|
24
26
|
export interface ImageDoc extends mongoose.Document {
|
|
25
27
|
_id: Types.ObjectId;
|
|
26
28
|
userId: Types.ObjectId;
|
|
29
|
+
ai: Types.ObjectId | AiAttrs;
|
|
27
30
|
imageName: string;
|
|
28
31
|
planId?: string;
|
|
29
32
|
images: Images[];
|
|
@@ -9,9 +9,14 @@ const mongoose_update_if_current_1 = require("mongoose-update-if-current");
|
|
|
9
9
|
const image_1 = require("../../enums/image");
|
|
10
10
|
const ImageSchema = new mongoose_1.default.Schema({
|
|
11
11
|
userId: {
|
|
12
|
-
type:
|
|
12
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
13
|
+
ref: 'User',
|
|
13
14
|
required: true,
|
|
14
15
|
},
|
|
16
|
+
ai: {
|
|
17
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
18
|
+
ref: 'Ai',
|
|
19
|
+
},
|
|
15
20
|
imageName: {
|
|
16
21
|
type: String,
|
|
17
22
|
required: true,
|
|
@@ -31,10 +36,6 @@ const ImageSchema = new mongoose_1.default.Schema({
|
|
|
31
36
|
},
|
|
32
37
|
images: [
|
|
33
38
|
{
|
|
34
|
-
ai: {
|
|
35
|
-
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
36
|
-
ref: 'Ai',
|
|
37
|
-
},
|
|
38
39
|
role: {
|
|
39
40
|
type: String,
|
|
40
41
|
required: true,
|
|
@@ -44,6 +45,10 @@ const ImageSchema = new mongoose_1.default.Schema({
|
|
|
44
45
|
type: String,
|
|
45
46
|
required: true,
|
|
46
47
|
},
|
|
48
|
+
aiOption: {
|
|
49
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
50
|
+
ref: 'AiOption',
|
|
51
|
+
},
|
|
47
52
|
deleted: {
|
|
48
53
|
type: Boolean,
|
|
49
54
|
required: false,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const IMAGE_CAPABILITIES: {
|
|
2
|
+
readonly 'gpt-image-1': {
|
|
3
|
+
readonly sizes: readonly ["256*256", "512*512", "1024*1024"];
|
|
4
|
+
readonly qualities: readonly ["standard", "hd"];
|
|
5
|
+
readonly formats: readonly ["png", "webp"];
|
|
6
|
+
readonly supportsTransparency: true;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMAGE_CAPABILITIES = void 0;
|
|
4
|
+
exports.IMAGE_CAPABILITIES = {
|
|
5
|
+
'gpt-image-1': {
|
|
6
|
+
sizes: ['256*256', '512*512', '1024*1024'],
|
|
7
|
+
qualities: ['standard', 'hd'],
|
|
8
|
+
formats: ['png', 'webp'],
|
|
9
|
+
supportsTransparency: true,
|
|
10
|
+
}
|
|
11
|
+
};
|