Skip to content

Commit cd854d7

Browse files
authored
feat: updating hubspot client to include info data (#292)
1 parent 87a3061 commit cd854d7

File tree

6 files changed

+44
-1
lines changed

6 files changed

+44
-1
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.62",
3+
"version": "1.0.63",
44
"description": "Vessel integrations",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",

src/platforms/hubspot/client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import {
5151
HubspotMeetingCreate,
5252
hubspotMeetingSchema,
5353
HubspotMeetingUpdate,
54+
hubspotMeOutputSchema,
5455
HubspotModule,
5556
HubspotNote,
5657
HubspotNoteCreate,
@@ -448,6 +449,11 @@ const makeClient = () => {
448449
method: 'GET',
449450
schema: hubspotAccessTokenOutputSchema,
450451
})),
452+
me: request(({}) => ({
453+
url: `/integrations/v1/me`,
454+
method: 'GET',
455+
schema: hubspotMeOutputSchema,
456+
})),
451457
passthrough: request.passthrough(),
452458
};
453459
};

src/platforms/hubspot/schemas.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ const dealPropertiesSchema = z.object({
214214
)
215215
.nullable(),
216216
dealstage: z.string().nullable(),
217+
deal_currency_code: z.string().nullable().optional(),
217218
hs_deal_stage_probability: z.union([z.string(), z.number()]).nullable(),
218219
hs_projected_amount: z.union([z.string(), z.number()]).nullable(),
219220
hs_is_closed_won: hubspotBooleanSchema.nullable(),
@@ -715,3 +716,11 @@ export const hubspotAccessTokenOutputSchema = z.object({
715716
export type HubspotAccessTokenOutputSchema = z.infer<
716717
typeof hubspotAccessTokenOutputSchema
717718
>;
719+
720+
export const hubspotMeOutputSchema = z.object({
721+
portalId: hubspotIdSchema.nullable(),
722+
timeZone: z.string().nullable(),
723+
currency: z.string().nullable(),
724+
utcOffsetMilliseconds: z.number().nullable(),
725+
utcOffset: z.string().nullable(),
726+
});

src/platforms/pipedrive/schemas.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ export const pipedriveDealSchema = custom.addNativeToZodSchema(
196196
update_time: custom.date(),
197197
add_time: custom.date(),
198198
deleted: z.boolean().nullable(),
199+
currency: z.string().nullable(),
199200
person_id: z.object({ value: z.number() }).nullable(),
200201
org_id: z.object({ value: z.number() }).nullable(),
201202
user_id: z.object({ value: z.number() }).nullable(),

src/platforms/salesforce/client.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
salesforceAccountCreateResponse,
1111
salesforceAccountRelationalSelect,
1212
SalesforceAccountUpdate,
13+
salesforceConnectOrganizationResponse,
1314
salesforceContact,
1415
SalesforceContactCreate,
1516
salesforceContactCreateResponse,
@@ -238,6 +239,13 @@ export const client = {
238239
}),
239240
),
240241
},
242+
connect: {
243+
organization: request(({}) => ({
244+
url: `/connect/organization`,
245+
method: 'GET',
246+
schema: salesforceConnectOrganizationResponse,
247+
})),
248+
},
241249
query: request(({ query }: { query: string }) => ({
242250
url: `/query/`,
243251
method: 'GET',

src/platforms/salesforce/schemas.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ export const salesforceSObject = z.object({
2424
sobjects: z.array(z.object({ name: z.string() })),
2525
});
2626

27+
// -
28+
// Connect Organization
29+
// -
30+
export const salesforceConnectOrganizationResponse = z
31+
.object({
32+
features: z
33+
.object({
34+
defaultCurrencyIsoCode: z.string().nullable(),
35+
})
36+
.partial(),
37+
})
38+
.partial();
39+
2740
// -
2841
// SObject Describe
2942
// -
@@ -35,6 +48,11 @@ export const salesforceField = z.object({
3548
custom: z.boolean(),
3649
createable: z.boolean(),
3750
updateable: z.boolean(),
51+
defaultValue: z
52+
.object({
53+
value: z.string().nullish(),
54+
})
55+
.nullish(),
3856
picklistValues: z
3957
.array(
4058
z.object({
@@ -269,6 +287,7 @@ export const salesforceOpportunity = custom.addNativeToZodSchema(
269287
IsClosed: z.boolean().nullable(),
270288
ContactId: z.string().nullable(),
271289
AccountId: z.string().nullable(),
290+
CurrencyIsoCode: z.string().nullable(),
272291
CreatedDate: custom.date(),
273292
OwnerId: z.string().nullable(),
274293
LastModifiedDate: custom.date(),

0 commit comments

Comments
 (0)