Skip to content

Commit 0bc8cb9

Browse files
authored
fix: updating pipedrive schemas (#255)
1 parent 2949f4a commit 0bc8cb9

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vesselapi/integrations",
3-
"version": "1.0.40",
3+
"version": "1.0.41",
44
"description": "Vessel integrations",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",

src/platforms/pipedrive/schemas.ts

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ export type PipedriveUserMe = z.infer<typeof pipedriveUserMeSchema>;
132132
export const pipedriveUserSchema = custom.addNativeToZodSchema(
133133
z.object({
134134
id: z.number(),
135-
name: z.string(),
136-
email: z.string(),
135+
name: z.string().nullable(),
136+
email: z.string().nullable(),
137137
created: custom.date(),
138-
modified: custom.date().optional(),
139-
active_flag: z.boolean(),
138+
modified: custom.date().optional().nullable(),
139+
active_flag: z.boolean().nullable(),
140140
}),
141141
);
142142
export type PipedriveUser = z.infer<typeof pipedriveUserSchema>;
@@ -147,16 +147,16 @@ export type PipedriveUser = z.infer<typeof pipedriveUserSchema>;
147147
const pipedrivePersonSchema = custom.addNativeToZodSchema(
148148
z.object({
149149
id: z.number(),
150-
name: z.string(),
151-
first_name: z.string(),
152-
last_name: z.string(),
153-
email: z.array(pipedriveEmailAddressSchema),
154-
phone: z.array(pipedrivePhoneNumberSchema),
150+
name: z.string().nullable(),
151+
first_name: z.string().nullable(),
152+
last_name: z.string().nullable(),
153+
email: z.array(pipedriveEmailAddressSchema).nullable(),
154+
phone: z.array(pipedrivePhoneNumberSchema).nullable(),
155155
add_time: custom.date(),
156156
update_time: custom.date(),
157-
active_flag: z.boolean(),
158-
org_id: pipedriveAssociationId.optional(),
159-
owner_id: pipedriveAssociationId.optional(),
157+
active_flag: z.boolean().nullable(),
158+
org_id: pipedriveAssociationId.optional().nullable(),
159+
owner_id: pipedriveAssociationId.optional().nullable(),
160160
}),
161161
);
162162
export type PipedrivePerson = z.infer<typeof pipedrivePersonSchema>;
@@ -184,20 +184,20 @@ export type PipedrivePersonUpdate = z.infer<
184184
export const pipedriveDealSchema = custom.addNativeToZodSchema(
185185
z.object({
186186
id: z.number(),
187-
title: z.string(),
188-
stage_id: z.number(),
189-
value: z.string(),
190-
expected_close_date: custom.date(),
191-
weighted_value: z.string(),
192-
status: z.string(),
193-
active: z.boolean(),
194-
probability: z.string(),
187+
title: z.string().nullable(),
188+
stage_id: z.number().nullable(),
189+
value: z.union([z.string(), z.number()]).nullable(),
190+
expected_close_date: custom.date().nullable(),
191+
weighted_value: z.union([z.string(), z.number()]).nullable(),
192+
status: z.string().nullable(),
193+
active: z.boolean().nullable(),
194+
probability: z.union([z.string(), z.number()]).nullable(),
195195
update_time: custom.date(),
196196
add_time: custom.date(),
197-
deleted: z.boolean(),
198-
person_id: z.object({ value: z.number() }),
199-
org_id: z.object({ value: z.number() }),
200-
user_id: z.object({ value: z.number() }),
197+
deleted: z.boolean().nullable(),
198+
person_id: z.object({ value: z.number() }).nullable(),
199+
org_id: z.object({ value: z.number() }).nullable(),
200+
user_id: z.object({ value: z.number() }).nullable(),
201201
}),
202202
);
203203
export type PipedriveDeal = z.infer<typeof pipedriveDealSchema>;
@@ -223,16 +223,16 @@ export type PipedriveDealUpdate = z.infer<typeof pipedriveDealUpsertSchema> & {
223223
export const pipedriveOrganizationSchema = custom.addNativeToZodSchema(
224224
z.object({
225225
id: z.number(),
226-
name: z.string(),
227-
address_route: z.string(),
228-
address_locality: z.string(),
229-
address_admin_area_level_1: z.string(),
230-
address_postal_code: z.string(),
231-
address_country: z.string(),
226+
name: z.string().nullable(),
227+
address_route: z.string().nullable(),
228+
address_locality: z.string().nullable(),
229+
address_admin_area_level_1: z.string().nullable(),
230+
address_postal_code: z.string().nullable(),
231+
address_country: z.string().nullable(),
232232
update_time: custom.date(),
233233
add_time: custom.date(),
234-
active_flag: z.boolean(), // isDeleted
235-
owner_id: z.object({ value: z.number() }),
234+
active_flag: z.boolean().nullable(), // isDeleted
235+
owner_id: z.object({ value: z.number() }).nullable(),
236236
}),
237237
);
238238
export type PipedriveOrganization = z.infer<typeof pipedriveOrganizationSchema>;
@@ -259,13 +259,13 @@ export const pipedriveNoteSchema = custom.addNativeToZodSchema(
259259
id: z.number(),
260260
add_time: custom.date(),
261261
update_time: custom.date(),
262-
content: z.string(),
263-
user_id: z.number(),
264-
active_flag: z.boolean(),
265-
deal_id: z.number().optional(),
266-
person_id: z.number().optional(),
267-
org_id: z.number().optional(),
268-
lead_id: z.number().optional(),
262+
content: z.string().nullable(),
263+
user_id: z.number().nullable(),
264+
active_flag: z.boolean().nullable(),
265+
deal_id: z.number().optional().nullable(),
266+
person_id: z.number().optional().nullable(),
267+
org_id: z.number().optional().nullable(),
268+
lead_id: z.number().optional().nullable(),
269269
}),
270270
);
271271
export type PipedriveNote = z.infer<typeof pipedriveNoteSchema>;

0 commit comments

Comments
 (0)