@deallony/shared 1.1.92 → 1.1.96

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.
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ import { aiFillAdFormSchema, aiFillFormSchema } from "../../schema/ai";
3
+ export type AIFillFormBody = z.infer<typeof aiFillFormSchema>;
4
+ export type AIFillAdFormBody = z.infer<typeof aiFillAdFormSchema>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,3 @@
1
1
  export { AdDto } from './ad/Ad.dto';
2
2
  export * as EVENTS from './events';
3
+ export * as Ai from './ai/Ai.dto';
@@ -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.AdDto = void 0;
36
+ exports.Ai = exports.EVENTS = exports.AdDto = void 0;
37
37
  var Ad_dto_1 = require("./ad/Ad.dto");
38
38
  Object.defineProperty(exports, "AdDto", { enumerable: true, get: function () { return Ad_dto_1.AdDto; } });
39
39
  exports.EVENTS = __importStar(require("./events"));
40
+ exports.Ai = __importStar(require("./ai/Ai.dto"));
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ export declare const aiAdFillFormFileSchema: z.ZodObject<{
3
+ URL: z.ZodString;
4
+ mimeType: z.ZodString;
5
+ name: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export declare const aiFillAdFormSchema: z.ZodObject<{
8
+ text: z.ZodString;
9
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
10
+ URL: z.ZodString;
11
+ mimeType: z.ZodString;
12
+ name: z.ZodString;
13
+ }, z.core.$strip>>>;
14
+ }, z.core.$strip>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.aiFillAdFormSchema = exports.aiAdFillFormFileSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.aiAdFillFormFileSchema = zod_1.z.object({
6
+ URL: zod_1.z.string().trim().min(1),
7
+ mimeType: zod_1.z.string().trim().min(1),
8
+ name: zod_1.z.string().trim().min(1),
9
+ });
10
+ exports.aiFillAdFormSchema = zod_1.z.object({
11
+ text: zod_1.z.string().trim(),
12
+ files: zod_1.z.array(exports.aiAdFillFormFileSchema).optional(),
13
+ });
@@ -0,0 +1,89 @@
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>;
@@ -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,2 @@
1
+ export * from './ai-fill-form.schema';
2
+ export * from './ai-fill-ad-form.schema';
@@ -0,0 +1,18 @@
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);
18
+ __exportStar(require("./ai-fill-ad-form.schema"), exports);
@@ -1,3 +1,4 @@
1
1
  export * as AD from './ad';
2
+ export * as AI from './ai';
2
3
  export * as COMMON from './common';
3
4
  export * as EVENTS from './events';
@@ -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"));
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,3 @@
1
1
  export { AdDto } from './ad/Ad.dto.js';
2
2
  export * as EVENTS from './events/index.js';
3
+ export * as Ai from './ai/Ai.dto.js';
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ export const aiAdFillFormFileSchema = z.object({
3
+ URL: z.string().trim().min(1),
4
+ mimeType: z.string().trim().min(1),
5
+ name: z.string().trim().min(1),
6
+ });
7
+ export const aiFillAdFormSchema = z.object({
8
+ text: z.string().trim(),
9
+ files: z.array(aiAdFillFormFileSchema).optional(),
10
+ });
@@ -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,2 @@
1
+ export * from './ai-fill-form.schema.js';
2
+ export * from './ai-fill-ad-form.schema.js';
@@ -1,3 +1,4 @@
1
1
  export * as AD from './ad/index.js';
2
+ export * as AI from './ai/index.js';
2
3
  export * as COMMON from './common/index.js';
3
4
  export * as EVENTS from './events/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deallony/shared",
3
- "version": "1.1.92",
3
+ "version": "1.1.96",
4
4
  "private": false,
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -26,6 +26,8 @@
26
26
  "backend:update": "cd ../backend-service-marketplace && pnpm uninstall @deallony/shared && pnpm install @deallony/shared@latest",
27
27
  "dashboard:update": "cd ../frontend-react-aloo && node ./scripts/upgrade-dellony.js",
28
28
  "current": "npm view @deallony/shared version",
29
+ "============================= Links with project =============================": "",
30
+ "link:backend": "cd ../backend-service-marketplace && pnpm add @deallony/shared@file:../shared-deallony",
29
31
  "========": "============ DEFAULT ============",
30
32
  "build": "tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && node ./scripts/fix-esm-imports.mjs",
31
33
  "watch": "tsc -p tsconfig.cjs.json --watch",