@deallony/shared 1.1.91 → 1.1.94
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/cjs/constants/common/Subject.js +4 -4
- package/dist/cjs/schema/ai/ai-fill-form.schema.d.ts +90 -0
- package/dist/cjs/schema/ai/ai-fill-form.schema.js +53 -0
- package/dist/cjs/schema/ai/index.d.ts +1 -0
- package/dist/cjs/schema/ai/index.js +17 -0
- package/dist/cjs/schema/index.d.ts +1 -0
- package/dist/cjs/schema/index.js +2 -1
- package/dist/esm/constants/common/Subject.js +4 -4
- package/dist/esm/schema/ai/ai-fill-form.schema.js +50 -0
- package/dist/esm/schema/ai/index.js +1 -0
- package/dist/esm/schema/index.js +1 -0
- package/package.json +1 -1
|
@@ -9,8 +9,8 @@ var SubjectTableEnum;
|
|
|
9
9
|
SubjectTableEnum["USED_PRODUCTS"] = "used_products";
|
|
10
10
|
})(SubjectTableEnum || (exports.SubjectTableEnum = SubjectTableEnum = {}));
|
|
11
11
|
exports.SubjectTypeOptions = [
|
|
12
|
-
{ value: SubjectTableEnum.SERVICES, label: "Services", isCategory: true, color: "#3B82F6", isAge: false, isCondition: false, isFeature: false },
|
|
13
|
-
{ value: SubjectTableEnum.MOTORS, label: "Motors", isCategory: true, color: "#125b40ff", isAge: false, isCondition: false, isFeature: true },
|
|
14
|
-
{ value: SubjectTableEnum.USED_PRODUCTS, label: "Used Products", isCategory: true, color: "#6b5212ff", isAge: true, isCondition: true, isFeature: false },
|
|
15
|
-
{ value: SubjectTableEnum.PROPERTIES, label: "
|
|
12
|
+
{ value: SubjectTableEnum.SERVICES, label: "Services", name: { en: "Services", ar: "خدمات" }, isCategory: true, color: "#3B82F6", isAge: false, isCondition: false, isFeature: false },
|
|
13
|
+
{ value: SubjectTableEnum.MOTORS, label: "Motors", name: { en: "Motors", ar: "سيارات" }, isCategory: true, color: "#125b40ff", isAge: false, isCondition: false, isFeature: true },
|
|
14
|
+
{ value: SubjectTableEnum.USED_PRODUCTS, label: "Used Products", name: { en: "Used Products", ar: "منتجات" }, isCategory: true, color: "#6b5212ff", isAge: true, isCondition: true, isFeature: false },
|
|
15
|
+
{ value: SubjectTableEnum.PROPERTIES, label: "Properties", name: { en: "Properties", ar: "عقارات" }, isCategory: false, color: "#6c4fc3ff", isAge: true, isCondition: true, isFeature: true },
|
|
16
16
|
];
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const aiFormFieldTypeSchema: z.ZodEnum<{
|
|
3
|
+
number: "number";
|
|
4
|
+
boolean: "boolean";
|
|
5
|
+
object: "object";
|
|
6
|
+
date: "date";
|
|
7
|
+
array: "array";
|
|
8
|
+
text: "text";
|
|
9
|
+
textarea: "textarea";
|
|
10
|
+
select: "select";
|
|
11
|
+
"multi-select": "multi-select";
|
|
12
|
+
}>;
|
|
13
|
+
export declare const aiFormFieldOptionSchema: z.ZodObject<{
|
|
14
|
+
label: z.ZodString;
|
|
15
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const aiFormFieldSchema: z.ZodObject<{
|
|
18
|
+
key: z.ZodString;
|
|
19
|
+
label: z.ZodString;
|
|
20
|
+
type: z.ZodEnum<{
|
|
21
|
+
number: "number";
|
|
22
|
+
boolean: "boolean";
|
|
23
|
+
object: "object";
|
|
24
|
+
date: "date";
|
|
25
|
+
array: "array";
|
|
26
|
+
text: "text";
|
|
27
|
+
textarea: "textarea";
|
|
28
|
+
select: "select";
|
|
29
|
+
"multi-select": "multi-select";
|
|
30
|
+
}>;
|
|
31
|
+
interface: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
32
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
description: z.ZodOptional<z.ZodString>;
|
|
34
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
35
|
+
label: z.ZodString;
|
|
36
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
37
|
+
}, z.core.$strip>>>;
|
|
38
|
+
aiHints: z.ZodOptional<z.ZodObject<{
|
|
39
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
|
+
extractionInstructions: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export declare const aiFillFormFileSchema: z.ZodObject<{
|
|
45
|
+
URL: z.ZodString;
|
|
46
|
+
mimeType: z.ZodString;
|
|
47
|
+
name: z.ZodString;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export declare const aiFillFormSchema: z.ZodObject<{
|
|
50
|
+
text: z.ZodString;
|
|
51
|
+
schema: z.ZodArray<z.ZodObject<{
|
|
52
|
+
key: z.ZodString;
|
|
53
|
+
label: z.ZodString;
|
|
54
|
+
type: z.ZodEnum<{
|
|
55
|
+
number: "number";
|
|
56
|
+
boolean: "boolean";
|
|
57
|
+
object: "object";
|
|
58
|
+
date: "date";
|
|
59
|
+
array: "array";
|
|
60
|
+
text: "text";
|
|
61
|
+
textarea: "textarea";
|
|
62
|
+
select: "select";
|
|
63
|
+
"multi-select": "multi-select";
|
|
64
|
+
}>;
|
|
65
|
+
interface: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
66
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
description: z.ZodOptional<z.ZodString>;
|
|
68
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
69
|
+
label: z.ZodString;
|
|
70
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
71
|
+
}, z.core.$strip>>>;
|
|
72
|
+
aiHints: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
74
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
extractionInstructions: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
79
|
+
URL: z.ZodString;
|
|
80
|
+
mimeType: z.ZodString;
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
}, z.core.$strip>>>;
|
|
83
|
+
existingValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
84
|
+
aiHints: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
87
|
+
extractionInstructions: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
export type AIFillFormBody = z.infer<typeof aiFillFormSchema>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aiFillFormSchema = exports.aiFillFormFileSchema = exports.aiFormFieldSchema = exports.aiFormFieldOptionSchema = exports.aiFormFieldTypeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.aiFormFieldTypeSchema = zod_1.z.enum([
|
|
6
|
+
'text',
|
|
7
|
+
'textarea',
|
|
8
|
+
'number',
|
|
9
|
+
'boolean',
|
|
10
|
+
'select',
|
|
11
|
+
'multi-select',
|
|
12
|
+
'date',
|
|
13
|
+
'object',
|
|
14
|
+
'array',
|
|
15
|
+
]);
|
|
16
|
+
exports.aiFormFieldOptionSchema = zod_1.z.object({
|
|
17
|
+
label: zod_1.z.string().trim().min(1),
|
|
18
|
+
value: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean()]),
|
|
19
|
+
});
|
|
20
|
+
exports.aiFormFieldSchema = zod_1.z.object({
|
|
21
|
+
key: zod_1.z.string().trim().min(1),
|
|
22
|
+
label: zod_1.z.string().trim().min(1),
|
|
23
|
+
type: exports.aiFormFieldTypeSchema,
|
|
24
|
+
interface: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
25
|
+
required: zod_1.z.boolean().optional(),
|
|
26
|
+
description: zod_1.z.string().trim().optional(),
|
|
27
|
+
options: zod_1.z.array(exports.aiFormFieldOptionSchema).optional(),
|
|
28
|
+
aiHints: zod_1.z
|
|
29
|
+
.object({
|
|
30
|
+
aliases: zod_1.z.array(zod_1.z.string().trim().min(1)).optional(),
|
|
31
|
+
examples: zod_1.z.array(zod_1.z.string().trim().min(1)).optional(),
|
|
32
|
+
extractionInstructions: zod_1.z.string().trim().optional(),
|
|
33
|
+
})
|
|
34
|
+
.optional(),
|
|
35
|
+
});
|
|
36
|
+
exports.aiFillFormFileSchema = zod_1.z.object({
|
|
37
|
+
URL: zod_1.z.string().trim().min(1),
|
|
38
|
+
mimeType: zod_1.z.string().trim().min(1),
|
|
39
|
+
name: zod_1.z.string().trim().min(1),
|
|
40
|
+
});
|
|
41
|
+
exports.aiFillFormSchema = zod_1.z.object({
|
|
42
|
+
text: zod_1.z.string().trim().min(3),
|
|
43
|
+
schema: zod_1.z.array(exports.aiFormFieldSchema),
|
|
44
|
+
files: zod_1.z.array(exports.aiFillFormFileSchema).optional(),
|
|
45
|
+
existingValues: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
46
|
+
aiHints: zod_1.z
|
|
47
|
+
.object({
|
|
48
|
+
aliases: zod_1.z.array(zod_1.z.string().trim().min(1)).optional(),
|
|
49
|
+
examples: zod_1.z.array(zod_1.z.string().trim().min(1)).optional(),
|
|
50
|
+
extractionInstructions: zod_1.z.string().trim().optional(),
|
|
51
|
+
})
|
|
52
|
+
.optional(),
|
|
53
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ai-fill-form.schema';
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
__exportStar(require("./ai-fill-form.schema"), exports);
|
package/dist/cjs/schema/index.js
CHANGED
|
@@ -33,7 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.EVENTS = exports.COMMON = exports.AD = void 0;
|
|
36
|
+
exports.EVENTS = exports.COMMON = exports.AI = exports.AD = void 0;
|
|
37
37
|
exports.AD = __importStar(require("./ad"));
|
|
38
|
+
exports.AI = __importStar(require("./ai"));
|
|
38
39
|
exports.COMMON = __importStar(require("./common"));
|
|
39
40
|
exports.EVENTS = __importStar(require("./events"));
|
|
@@ -6,8 +6,8 @@ export var SubjectTableEnum;
|
|
|
6
6
|
SubjectTableEnum["USED_PRODUCTS"] = "used_products";
|
|
7
7
|
})(SubjectTableEnum || (SubjectTableEnum = {}));
|
|
8
8
|
export const SubjectTypeOptions = [
|
|
9
|
-
{ value: SubjectTableEnum.SERVICES, label: "Services", isCategory: true, color: "#3B82F6", isAge: false, isCondition: false, isFeature: false },
|
|
10
|
-
{ value: SubjectTableEnum.MOTORS, label: "Motors", isCategory: true, color: "#125b40ff", isAge: false, isCondition: false, isFeature: true },
|
|
11
|
-
{ value: SubjectTableEnum.USED_PRODUCTS, label: "Used Products", isCategory: true, color: "#6b5212ff", isAge: true, isCondition: true, isFeature: false },
|
|
12
|
-
{ value: SubjectTableEnum.PROPERTIES, label: "
|
|
9
|
+
{ value: SubjectTableEnum.SERVICES, label: "Services", name: { en: "Services", ar: "خدمات" }, isCategory: true, color: "#3B82F6", isAge: false, isCondition: false, isFeature: false },
|
|
10
|
+
{ value: SubjectTableEnum.MOTORS, label: "Motors", name: { en: "Motors", ar: "سيارات" }, isCategory: true, color: "#125b40ff", isAge: false, isCondition: false, isFeature: true },
|
|
11
|
+
{ value: SubjectTableEnum.USED_PRODUCTS, label: "Used Products", name: { en: "Used Products", ar: "منتجات" }, isCategory: true, color: "#6b5212ff", isAge: true, isCondition: true, isFeature: false },
|
|
12
|
+
{ value: SubjectTableEnum.PROPERTIES, label: "Properties", name: { en: "Properties", ar: "عقارات" }, isCategory: false, color: "#6c4fc3ff", isAge: true, isCondition: true, isFeature: true },
|
|
13
13
|
];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const aiFormFieldTypeSchema = z.enum([
|
|
3
|
+
'text',
|
|
4
|
+
'textarea',
|
|
5
|
+
'number',
|
|
6
|
+
'boolean',
|
|
7
|
+
'select',
|
|
8
|
+
'multi-select',
|
|
9
|
+
'date',
|
|
10
|
+
'object',
|
|
11
|
+
'array',
|
|
12
|
+
]);
|
|
13
|
+
export const aiFormFieldOptionSchema = z.object({
|
|
14
|
+
label: z.string().trim().min(1),
|
|
15
|
+
value: z.union([z.string(), z.number(), z.boolean()]),
|
|
16
|
+
});
|
|
17
|
+
export const aiFormFieldSchema = z.object({
|
|
18
|
+
key: z.string().trim().min(1),
|
|
19
|
+
label: z.string().trim().min(1),
|
|
20
|
+
type: aiFormFieldTypeSchema,
|
|
21
|
+
interface: z.record(z.string(), z.any()).optional(),
|
|
22
|
+
required: z.boolean().optional(),
|
|
23
|
+
description: z.string().trim().optional(),
|
|
24
|
+
options: z.array(aiFormFieldOptionSchema).optional(),
|
|
25
|
+
aiHints: z
|
|
26
|
+
.object({
|
|
27
|
+
aliases: z.array(z.string().trim().min(1)).optional(),
|
|
28
|
+
examples: z.array(z.string().trim().min(1)).optional(),
|
|
29
|
+
extractionInstructions: z.string().trim().optional(),
|
|
30
|
+
})
|
|
31
|
+
.optional(),
|
|
32
|
+
});
|
|
33
|
+
export const aiFillFormFileSchema = z.object({
|
|
34
|
+
URL: z.string().trim().min(1),
|
|
35
|
+
mimeType: z.string().trim().min(1),
|
|
36
|
+
name: z.string().trim().min(1),
|
|
37
|
+
});
|
|
38
|
+
export const aiFillFormSchema = z.object({
|
|
39
|
+
text: z.string().trim().min(3),
|
|
40
|
+
schema: z.array(aiFormFieldSchema),
|
|
41
|
+
files: z.array(aiFillFormFileSchema).optional(),
|
|
42
|
+
existingValues: z.record(z.string(), z.any()).optional(),
|
|
43
|
+
aiHints: z
|
|
44
|
+
.object({
|
|
45
|
+
aliases: z.array(z.string().trim().min(1)).optional(),
|
|
46
|
+
examples: z.array(z.string().trim().min(1)).optional(),
|
|
47
|
+
extractionInstructions: z.string().trim().optional(),
|
|
48
|
+
})
|
|
49
|
+
.optional(),
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ai-fill-form.schema.js';
|
package/dist/esm/schema/index.js
CHANGED