@builderbot/manager 1.3.15-alpha.151 → 1.3.15-alpha.2
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/index.cjs +10 -4
- package/dist/schemas.d.ts +15 -131
- package/dist/schemas.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -35910,7 +35910,9 @@ const tenantIdSchema = zod.z
|
|
|
35910
35910
|
.min(1, 'tenantId is required')
|
|
35911
35911
|
.max(50, 'tenantId must be 50 characters or less')
|
|
35912
35912
|
.regex(/^[a-zA-Z0-9-_]+$/, 'tenantId can only contain letters, numbers, hyphens and underscores')
|
|
35913
|
-
.refine((val) => !RESERVED_TENANT_IDS.includes(val),
|
|
35913
|
+
.refine((val) => !RESERVED_TENANT_IDS.includes(val), {
|
|
35914
|
+
message: 'is a reserved tenantId and cannot be used',
|
|
35915
|
+
});
|
|
35914
35916
|
/**
|
|
35915
35917
|
* Schema for creating a new bot
|
|
35916
35918
|
*/
|
|
@@ -35924,7 +35926,7 @@ const createBotSchema = zod.z.object({
|
|
|
35924
35926
|
.min(1024, 'port must be 1024 or higher')
|
|
35925
35927
|
.max(65535, 'port must be 65535 or lower')
|
|
35926
35928
|
.optional(),
|
|
35927
|
-
providerOptions: zod.z.record(zod.z.any()).optional(),
|
|
35929
|
+
providerOptions: zod.z.record(zod.z.string(), zod.z.any()).optional(),
|
|
35928
35930
|
});
|
|
35929
35931
|
/**
|
|
35930
35932
|
* Schema for updating a bot
|
|
@@ -35984,7 +35986,9 @@ const createFlowSchema = zod.z.object({
|
|
|
35984
35986
|
.min(1, 'id is required')
|
|
35985
35987
|
.max(50, 'id must be 50 characters or less')
|
|
35986
35988
|
.regex(/^[a-zA-Z0-9-_]+$/, 'id can only contain letters, numbers, hyphens and underscores')
|
|
35987
|
-
.refine((val) => !RESERVED_FLOW_IDS.includes(val),
|
|
35989
|
+
.refine((val) => !RESERVED_FLOW_IDS.includes(val), {
|
|
35990
|
+
message: 'is a reserved flow id',
|
|
35991
|
+
}),
|
|
35988
35992
|
/** Display name for the flow */
|
|
35989
35993
|
name: zod.z.string().min(1).max(100),
|
|
35990
35994
|
/** Keywords that trigger this flow */
|
|
@@ -36011,7 +36015,9 @@ function validate(schema, data) {
|
|
|
36011
36015
|
data: result.data,
|
|
36012
36016
|
};
|
|
36013
36017
|
}
|
|
36014
|
-
|
|
36018
|
+
// Zod v4 uses 'issues'
|
|
36019
|
+
const zodErrors = result.error.issues;
|
|
36020
|
+
const errors = zodErrors.map((err) => ({
|
|
36015
36021
|
field: err.path.join('.') || 'root',
|
|
36016
36022
|
message: err.message,
|
|
36017
36023
|
}));
|
package/dist/schemas.d.ts
CHANGED
|
@@ -3,34 +3,18 @@ import { z } from 'zod';
|
|
|
3
3
|
* Schema for creating a new bot
|
|
4
4
|
*/
|
|
5
5
|
export declare const createBotSchema: z.ZodObject<{
|
|
6
|
-
tenantId: z.
|
|
6
|
+
tenantId: z.ZodString;
|
|
7
7
|
name: z.ZodOptional<z.ZodString>;
|
|
8
|
-
flowIds: z.ZodArray<z.ZodString
|
|
8
|
+
flowIds: z.ZodArray<z.ZodString>;
|
|
9
9
|
port: z.ZodOptional<z.ZodNumber>;
|
|
10
10
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
11
|
-
},
|
|
12
|
-
tenantId?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
flowIds?: string[];
|
|
15
|
-
port?: number;
|
|
16
|
-
providerOptions?: Record<string, any>;
|
|
17
|
-
}, {
|
|
18
|
-
tenantId?: string;
|
|
19
|
-
name?: string;
|
|
20
|
-
flowIds?: string[];
|
|
21
|
-
port?: number;
|
|
22
|
-
providerOptions?: Record<string, any>;
|
|
23
|
-
}>;
|
|
11
|
+
}, z.core.$strip>;
|
|
24
12
|
/**
|
|
25
13
|
* Schema for updating a bot
|
|
26
14
|
*/
|
|
27
15
|
export declare const updateBotSchema: z.ZodObject<{
|
|
28
16
|
name: z.ZodOptional<z.ZodString>;
|
|
29
|
-
},
|
|
30
|
-
name?: string;
|
|
31
|
-
}, {
|
|
32
|
-
name?: string;
|
|
33
|
-
}>;
|
|
17
|
+
}, z.core.$strip>;
|
|
34
18
|
/**
|
|
35
19
|
* Schema for sending a message
|
|
36
20
|
*/
|
|
@@ -38,151 +22,51 @@ export declare const sendMessageSchema: z.ZodObject<{
|
|
|
38
22
|
number: z.ZodString;
|
|
39
23
|
message: z.ZodString;
|
|
40
24
|
media: z.ZodOptional<z.ZodString>;
|
|
41
|
-
},
|
|
42
|
-
number?: string;
|
|
43
|
-
message?: string;
|
|
44
|
-
media?: string;
|
|
45
|
-
}, {
|
|
46
|
-
number?: string;
|
|
47
|
-
message?: string;
|
|
48
|
-
media?: string;
|
|
49
|
-
}>;
|
|
25
|
+
}, z.core.$strip>;
|
|
50
26
|
/**
|
|
51
27
|
* Schema for restarting a bot
|
|
52
28
|
*/
|
|
53
29
|
export declare const restartBotSchema: z.ZodObject<{
|
|
54
|
-
flowIds: z.ZodArray<z.ZodString
|
|
30
|
+
flowIds: z.ZodArray<z.ZodString>;
|
|
55
31
|
port: z.ZodOptional<z.ZodNumber>;
|
|
56
32
|
name: z.ZodOptional<z.ZodString>;
|
|
57
|
-
},
|
|
58
|
-
name?: string;
|
|
59
|
-
flowIds?: string[];
|
|
60
|
-
port?: number;
|
|
61
|
-
}, {
|
|
62
|
-
name?: string;
|
|
63
|
-
flowIds?: string[];
|
|
64
|
-
port?: number;
|
|
65
|
-
}>;
|
|
33
|
+
}, z.core.$strip>;
|
|
66
34
|
/**
|
|
67
35
|
* Flow step schema - defines a single step in the flow
|
|
68
36
|
*/
|
|
69
37
|
declare const flowStepSchema: z.ZodObject<{
|
|
70
|
-
/** The message to send */
|
|
71
38
|
answer: z.ZodString;
|
|
72
|
-
/** Optional delay before sending (ms) */
|
|
73
39
|
delay: z.ZodOptional<z.ZodNumber>;
|
|
74
|
-
/** Optional media URL to attach */
|
|
75
40
|
media: z.ZodOptional<z.ZodString>;
|
|
76
|
-
/** Whether to capture user response */
|
|
77
41
|
capture: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
-
},
|
|
79
|
-
media?: string;
|
|
80
|
-
answer?: string;
|
|
81
|
-
delay?: number;
|
|
82
|
-
capture?: boolean;
|
|
83
|
-
}, {
|
|
84
|
-
media?: string;
|
|
85
|
-
answer?: string;
|
|
86
|
-
delay?: number;
|
|
87
|
-
capture?: boolean;
|
|
88
|
-
}>;
|
|
42
|
+
}, z.core.$strip>;
|
|
89
43
|
/**
|
|
90
44
|
* Schema for creating a dynamic flow
|
|
91
45
|
*/
|
|
92
46
|
export declare const createFlowSchema: z.ZodObject<{
|
|
93
|
-
|
|
94
|
-
id: z.ZodEffects<z.ZodString, string, string>;
|
|
95
|
-
/** Display name for the flow */
|
|
47
|
+
id: z.ZodString;
|
|
96
48
|
name: z.ZodString;
|
|
97
|
-
|
|
98
|
-
keyword: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
99
|
-
/** Steps/answers in the flow */
|
|
49
|
+
keyword: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
100
50
|
steps: z.ZodArray<z.ZodObject<{
|
|
101
|
-
/** The message to send */
|
|
102
51
|
answer: z.ZodString;
|
|
103
|
-
/** Optional delay before sending (ms) */
|
|
104
52
|
delay: z.ZodOptional<z.ZodNumber>;
|
|
105
|
-
/** Optional media URL to attach */
|
|
106
53
|
media: z.ZodOptional<z.ZodString>;
|
|
107
|
-
/** Whether to capture user response */
|
|
108
54
|
capture: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
answer?: string;
|
|
112
|
-
delay?: number;
|
|
113
|
-
capture?: boolean;
|
|
114
|
-
}, {
|
|
115
|
-
media?: string;
|
|
116
|
-
answer?: string;
|
|
117
|
-
delay?: number;
|
|
118
|
-
capture?: boolean;
|
|
119
|
-
}>, "many">;
|
|
120
|
-
}, "strip", z.ZodTypeAny, {
|
|
121
|
-
name?: string;
|
|
122
|
-
id?: string;
|
|
123
|
-
keyword?: string | string[];
|
|
124
|
-
steps?: {
|
|
125
|
-
media?: string;
|
|
126
|
-
answer?: string;
|
|
127
|
-
delay?: number;
|
|
128
|
-
capture?: boolean;
|
|
129
|
-
}[];
|
|
130
|
-
}, {
|
|
131
|
-
name?: string;
|
|
132
|
-
id?: string;
|
|
133
|
-
keyword?: string | string[];
|
|
134
|
-
steps?: {
|
|
135
|
-
media?: string;
|
|
136
|
-
answer?: string;
|
|
137
|
-
delay?: number;
|
|
138
|
-
capture?: boolean;
|
|
139
|
-
}[];
|
|
140
|
-
}>;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
}, z.core.$strip>;
|
|
141
57
|
/**
|
|
142
58
|
* Schema for updating a flow
|
|
143
59
|
*/
|
|
144
60
|
export declare const updateFlowSchema: z.ZodObject<{
|
|
145
61
|
name: z.ZodOptional<z.ZodString>;
|
|
146
|
-
keyword: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString
|
|
62
|
+
keyword: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
147
63
|
steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
148
|
-
/** The message to send */
|
|
149
64
|
answer: z.ZodString;
|
|
150
|
-
/** Optional delay before sending (ms) */
|
|
151
65
|
delay: z.ZodOptional<z.ZodNumber>;
|
|
152
|
-
/** Optional media URL to attach */
|
|
153
66
|
media: z.ZodOptional<z.ZodString>;
|
|
154
|
-
/** Whether to capture user response */
|
|
155
67
|
capture: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
answer?: string;
|
|
159
|
-
delay?: number;
|
|
160
|
-
capture?: boolean;
|
|
161
|
-
}, {
|
|
162
|
-
media?: string;
|
|
163
|
-
answer?: string;
|
|
164
|
-
delay?: number;
|
|
165
|
-
capture?: boolean;
|
|
166
|
-
}>, "many">>;
|
|
167
|
-
}, "strip", z.ZodTypeAny, {
|
|
168
|
-
name?: string;
|
|
169
|
-
keyword?: string | string[];
|
|
170
|
-
steps?: {
|
|
171
|
-
media?: string;
|
|
172
|
-
answer?: string;
|
|
173
|
-
delay?: number;
|
|
174
|
-
capture?: boolean;
|
|
175
|
-
}[];
|
|
176
|
-
}, {
|
|
177
|
-
name?: string;
|
|
178
|
-
keyword?: string | string[];
|
|
179
|
-
steps?: {
|
|
180
|
-
media?: string;
|
|
181
|
-
answer?: string;
|
|
182
|
-
delay?: number;
|
|
183
|
-
capture?: boolean;
|
|
184
|
-
}[];
|
|
185
|
-
}>;
|
|
68
|
+
}, z.core.$strip>>>;
|
|
69
|
+
}, z.core.$strip>;
|
|
186
70
|
/**
|
|
187
71
|
* Type exports inferred from schemas
|
|
188
72
|
*/
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAmBvB;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;iBAW1B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;iBAE1B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;iBAQ5B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;iBAS3B,CAAA;AAOF;;GAEG;AACH,QAAA,MAAM,cAAc;;;;;iBASlB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;iBAgB3B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,gBA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
|
|
5
5
|
"author": "Leifer Mendez <leifer33@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/codigoencasa/bot-whatsapp#readme",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@ffmpeg-installer/ffmpeg": "^1.1.0",
|
|
50
50
|
"fluent-ffmpeg": "^2.1.3",
|
|
51
51
|
"polka": "^0.5.2",
|
|
52
|
-
"zod": "^
|
|
52
|
+
"zod": "^4.1.13"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@builderbot/bot": ">=1.0.0"
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"optional": true
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "6fe2b64bd3006f6f4805ac0ff36c616a3b91fa09"
|
|
72
72
|
}
|