Skip to content

Commit 6efd497

Browse files
authored
feat: allowing queryAll operation for sf job (#228)
1 parent bd4a0b6 commit 6efd497

File tree

3 files changed

+37
-10
lines changed

3 files changed

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

src/platforms/salesforce/client.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,23 @@ export const client = {
240240
schema: salesforceQueryResponse,
241241
})),
242242
jobs: {
243-
create: request(({ query }: { query: string }) => ({
244-
url: `/jobs/query`,
245-
method: 'POST',
246-
json: {
247-
operation: 'query',
243+
create: request(
244+
({
248245
query,
249-
},
250-
schema: salesforceJob,
251-
})),
246+
operation = 'query',
247+
}: {
248+
query: string;
249+
operation?: 'query' | 'queryAll';
250+
}) => ({
251+
url: `/jobs/query`,
252+
method: 'POST',
253+
json: {
254+
query,
255+
operation,
256+
},
257+
schema: salesforceJob,
258+
}),
259+
),
252260
find: request(({ Id }: { Id: string }) => ({
253261
url: `/jobs/query/${Id}`,
254262
method: 'GET',

src/platforms/salesforce/schemas.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ export const salesforceUser = custom.addNativeToZodSchema(
9898
Email: z.string().nullable(),
9999
CreatedDate: custom.date(),
100100
LastModifiedDate: custom.date(),
101+
IsDeleted: z.boolean().nullable(),
102+
IsArchived: z.boolean().nullable(),
101103
})
102104
.partial()
103105
.required(requiredFields),
@@ -120,6 +122,8 @@ export const salesforceContact = custom.addNativeToZodSchema(
120122
LastModifiedDate: custom.date(),
121123
AccountId: z.string().nullable(),
122124
OwnerId: z.string().nullable(),
125+
IsDeleted: z.boolean(),
126+
IsArchived: z.boolean(),
123127
})
124128
.partial()
125129
.required(requiredFields),
@@ -190,6 +194,8 @@ export const salesforceAccount = custom.addNativeToZodSchema(
190194
Opportunities: z
191195
.object({ records: z.array(z.object({ Id: z.string() })) })
192196
.nullable(),
197+
IsDeleted: z.boolean().nullable(),
198+
IsArchived: z.boolean().nullable(),
193199
})
194200
.partial()
195201
.required(requiredFields),
@@ -266,6 +272,8 @@ export const salesforceOpportunity = custom.addNativeToZodSchema(
266272
CreatedDate: custom.date(),
267273
OwnerId: z.string().nullable(),
268274
LastModifiedDate: custom.date(),
275+
IsDeleted: z.boolean().nullable(),
276+
IsArchived: z.boolean().nullable(),
269277
})
270278
.partial()
271279
.required(requiredFields),
@@ -321,6 +329,9 @@ export const salesforceLead = custom.addNativeToZodSchema(
321329
OwnerId: z.string().nullable(),
322330
CreatedDate: custom.date(),
323331
LastModifiedDate: custom.date(),
332+
IsDeleted: z.boolean().nullable(),
333+
IsArchived: z.boolean().nullable(),
334+
IsConverted: z.boolean().nullable(),
324335
})
325336
.partial()
326337
.required(requiredFields),
@@ -374,6 +385,8 @@ export const salesforceNote = custom.addNativeToZodSchema(
374385
OwnerId: z.string().nullable(),
375386
ParentId: z.string().nullable(),
376387
Parent: z.object({ Type: z.string() }).nullable(),
388+
IsDeleted: z.boolean().nullable(),
389+
IsArchived: z.boolean().nullable(),
377390
})
378391
.partial()
379392
.required(requiredFields),
@@ -464,6 +477,8 @@ export const salesforceContentNote = custom.addNativeToZodSchema(
464477
records: z.array(salesforceContentDocumentLink),
465478
})
466479
.nullable(),
480+
IsDeleted: z.boolean().nullable(),
481+
IsArchived: z.boolean().nullable(),
467482
})
468483
.partial()
469484
.required(requiredFields),
@@ -520,6 +535,8 @@ export const salesforceTask = custom.addNativeToZodSchema(
520535
What: z
521536
.object({ Id: z.string(), Type: z.string().optional() })
522537
.nullable(),
538+
IsDeleted: z.boolean().nullable(),
539+
IsArchived: z.boolean().nullable(),
523540
})
524541
.partial()
525542
.required(requiredFields),
@@ -616,6 +633,8 @@ export const salesforceEvent = custom.addNativeToZodSchema(
616633
),
617634
})
618635
.nullable(),
636+
IsDeleted: z.boolean().nullable(),
637+
IsArchived: z.boolean().nullable(),
619638
})
620639
.partial()
621640
.required(requiredFields),
@@ -730,8 +749,8 @@ export const salesforceEmailMessage = custom.addNativeToZodSchema(
730749
CreatedDate: custom.date(),
731750
LastModifiedDate: custom.date(),
732751
CreatedById: z.string().nullable(),
733-
IsArchived: z.boolean().nullable(),
734752
IsDeleted: z.boolean().nullable(),
753+
IsArchived: z.boolean().nullable(),
735754
RelatedTo: z
736755
.object({
737756
Id: z.string(),

0 commit comments

Comments
 (0)