Skip to content

Commit 3cedcf0

Browse files
feat(quickbooks): add credential-scoped integration and triggers (#6099)
Co-authored-by: Waleed Latif <walif6@gmail.com>
1 parent 7b4e737 commit 3cedcf0

194 files changed

Lines changed: 51304 additions & 212 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/docs/components/icons.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2710,6 +2710,25 @@ export function BrexIcon(props: SVGProps<SVGSVGElement>) {
27102710
)
27112711
}
27122712

2713+
/**
2714+
* Official QuickBooks circular mark, cropped from the user-supplied
2715+
* Intuit_QuickBooks_logo.svg wordmark.
2716+
*/
2717+
export function QuickBooksIcon(props: SVGProps<SVGSVGElement>) {
2718+
return (
2719+
<svg {...props} viewBox='0 0 61.54 61.54' fill='none' xmlns='http://www.w3.org/2000/svg'>
2720+
<path
2721+
fill='#2CA01C'
2722+
d='M30.77 61.54c16.99 0 30.77-13.78 30.77-30.77S47.76 0 30.77 0 0 13.78 0 30.77s13.77 30.77 30.77 30.77Z'
2723+
/>
2724+
<path
2725+
fill='#FFF'
2726+
d='M20.51 18.8c-6.61 0-11.97 5.36-11.97 11.97s5.35 11.96 11.97 11.96h1.71v-4.44h-1.71c-4.15 0-7.52-3.37-7.52-7.52 0-4.15 3.37-7.52 7.52-7.52h4.11V46.5c0 2.45 1.99 4.44 4.44 4.44V18.8h-8.55Zm20.52 23.93c6.61 0 11.97-5.36 11.97-11.96S47.65 18.81 41.03 18.81h-1.71v4.44h1.71c4.15 0 7.52 3.37 7.52 7.52s-3.37 7.52-7.52 7.52h-4.11V15.04c0-2.45-1.99-4.44-4.44-4.44v32.13h8.55Z'
2727+
/>
2728+
</svg>
2729+
)
2730+
}
2731+
27132732
export function BrightDataIcon(props: SVGProps<SVGSVGElement>) {
27142733
return (
27152734
<svg

apps/docs/components/ui/icon-mapping.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ import {
194194
PulseIcon,
195195
QdrantIcon,
196196
QuartrIcon,
197+
QuickBooksIcon,
197198
QuiverIcon,
198199
RabbitmqIcon,
199200
RailwayIcon,
@@ -500,6 +501,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
500501
pulse_v2: PulseIcon,
501502
qdrant: QdrantIcon,
502503
quartr: QuartrIcon,
504+
quickbooks: QuickBooksIcon,
503505
quiver: QuiverIcon,
504506
rabbitmq: RabbitmqIcon,
505507
railway: RailwayIcon,

apps/docs/content/docs/integrations/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
"pulse",
207207
"qdrant",
208208
"quartr",
209+
"quickbooks",
209210
"quiver",
210211
"rabbitmq",
211212
"railway",

apps/docs/content/docs/integrations/quickbooks.mdx

Lines changed: 3834 additions & 0 deletions
Large diffs are not rendered by default.

apps/docs/openapi-v2-resources.json

Lines changed: 260 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7498,6 +7498,90 @@
74987498
"additionalProperties": false
74997499
},
75007500
"description": "Authorization servers available for this OAuth service."
7501+
},
7502+
"fields": {
7503+
"maxItems": 20,
7504+
"type": "array",
7505+
"items": {
7506+
"type": "object",
7507+
"properties": {
7508+
"id": {
7509+
"type": "string",
7510+
"minLength": 1,
7511+
"maxLength": 255,
7512+
"description": "Exact create-body field name."
7513+
},
7514+
"label": {
7515+
"type": "string",
7516+
"minLength": 1,
7517+
"maxLength": 255,
7518+
"description": "Human-readable field label."
7519+
},
7520+
"placeholder": {
7521+
"type": "string",
7522+
"minLength": 1,
7523+
"maxLength": 1000,
7524+
"description": "Suggested input placeholder."
7525+
},
7526+
"required": {
7527+
"type": "boolean",
7528+
"description": "Whether the field is required for the selected flow."
7529+
},
7530+
"secret": {
7531+
"type": "boolean",
7532+
"description": "Whether the submitted field is write-only secret material."
7533+
},
7534+
"multiline": {
7535+
"type": "boolean",
7536+
"description": "Whether the field is intended for multi-line input."
7537+
},
7538+
"requiredForAuthMethods": {
7539+
"description": "Authentication methods for which this field is required.",
7540+
"minItems": 1,
7541+
"maxItems": 10,
7542+
"type": "array",
7543+
"items": {
7544+
"type": "string",
7545+
"minLength": 1,
7546+
"maxLength": 64
7547+
}
7548+
},
7549+
"options": {
7550+
"description": "Fixed values accepted by a selector field.",
7551+
"minItems": 1,
7552+
"maxItems": 20,
7553+
"type": "array",
7554+
"items": {
7555+
"type": "object",
7556+
"properties": {
7557+
"value": {
7558+
"type": "string",
7559+
"minLength": 1,
7560+
"maxLength": 255,
7561+
"description": "Submitted option value."
7562+
},
7563+
"label": {
7564+
"type": "string",
7565+
"minLength": 1,
7566+
"maxLength": 255,
7567+
"description": "Human-readable option label."
7568+
}
7569+
},
7570+
"required": ["value", "label"],
7571+
"additionalProperties": false
7572+
}
7573+
},
7574+
"hint": {
7575+
"description": "Provider-specific setup guidance.",
7576+
"type": "string",
7577+
"minLength": 1,
7578+
"maxLength": 2000
7579+
}
7580+
},
7581+
"required": ["id", "label", "placeholder", "required", "secret", "multiline"],
7582+
"additionalProperties": false
7583+
},
7584+
"description": "Write-only setup fields required before starting this OAuth flow."
75017585
}
75027586
},
75037587
"required": [
@@ -7508,7 +7592,8 @@
75087592
"providerFamily",
75097593
"available",
75107594
"supportsReconnect",
7511-
"authorizationOptions"
7595+
"authorizationOptions",
7596+
"fields"
75127597
],
75137598
"additionalProperties": false
75147599
},
@@ -7710,6 +7795,7 @@
77107795
"providerFamily": "salesforce",
77117796
"available": true,
77127797
"supportsReconnect": true,
7798+
"fields": [],
77137799
"authorizationOptions": [
77147800
{
77157801
"providerId": "salesforce",
@@ -7886,29 +7972,147 @@
78867972
"CreateCredentialConnectionBody": {
78877973
"anyOf": [
78887974
{
7889-
"type": "object",
7890-
"properties": {
7891-
"workspaceId": {
7892-
"type": "string",
7893-
"minLength": 1,
7894-
"maxLength": 128,
7895-
"description": "Workspace that will own the credential."
7896-
},
7897-
"providerId": {
7898-
"type": "string",
7899-
"minLength": 1,
7900-
"maxLength": 255,
7901-
"description": "Exact OAuth provider ID returned by credential-provider discovery."
7975+
"anyOf": [
7976+
{
7977+
"type": "object",
7978+
"properties": {
7979+
"workspaceId": {
7980+
"type": "string",
7981+
"minLength": 1,
7982+
"maxLength": 128,
7983+
"description": "Workspace that will own the credential."
7984+
},
7985+
"displayName": {
7986+
"type": "string",
7987+
"minLength": 1,
7988+
"maxLength": 255,
7989+
"description": "Name shown for the new credential in Sim."
7990+
},
7991+
"providerId": {
7992+
"type": "string",
7993+
"const": "quickbooks",
7994+
"description": "QuickBooks OAuth provider ID returned by credential-provider discovery."
7995+
},
7996+
"oauthClientConfig": {
7997+
"type": "object",
7998+
"properties": {
7999+
"clientId": {
8000+
"type": "string",
8001+
"minLength": 1,
8002+
"maxLength": 255,
8003+
"description": "Client ID for the caller-managed Intuit OAuth application."
8004+
},
8005+
"clientSecret": {
8006+
"type": "string",
8007+
"minLength": 1,
8008+
"maxLength": 512,
8009+
"description": "Write-only client secret for the caller-managed Intuit OAuth application.",
8010+
"writeOnly": true
8011+
},
8012+
"environment": {
8013+
"type": "string",
8014+
"enum": ["sandbox", "production"],
8015+
"description": "Intuit company environment used for authorization and API requests."
8016+
},
8017+
"webhookVerifierToken": {
8018+
"type": "string",
8019+
"minLength": 1,
8020+
"maxLength": 512,
8021+
"description": "Write-only verifier token for webhook signatures from the caller-managed app.",
8022+
"writeOnly": true
8023+
}
8024+
},
8025+
"required": ["clientId", "clientSecret", "environment", "webhookVerifierToken"],
8026+
"additionalProperties": false,
8027+
"description": "Write-only caller-managed Intuit OAuth app configuration."
8028+
}
8029+
},
8030+
"required": ["workspaceId", "displayName", "providerId", "oauthClientConfig"],
8031+
"additionalProperties": false
79028032
},
7903-
"displayName": {
7904-
"type": "string",
7905-
"minLength": 1,
7906-
"maxLength": 255,
7907-
"description": "Name shown for the new credential in Sim."
8033+
{
8034+
"type": "object",
8035+
"properties": {
8036+
"workspaceId": {
8037+
"type": "string",
8038+
"minLength": 1,
8039+
"maxLength": 128,
8040+
"description": "Workspace that will own the credential."
8041+
},
8042+
"displayName": {
8043+
"type": "string",
8044+
"minLength": 1,
8045+
"maxLength": 255,
8046+
"description": "Name shown for the new credential in Sim."
8047+
},
8048+
"providerId": {
8049+
"type": "string",
8050+
"enum": [
8051+
"google-email",
8052+
"google-drive",
8053+
"google-docs",
8054+
"google-sheets",
8055+
"google-forms",
8056+
"google-calendar",
8057+
"google-contacts",
8058+
"google-ads",
8059+
"google-bigquery",
8060+
"google-tasks",
8061+
"google-vault",
8062+
"google-groups",
8063+
"google-chat",
8064+
"google-meet",
8065+
"vertex-ai",
8066+
"microsoft-ad",
8067+
"microsoft-dataverse",
8068+
"microsoft-excel",
8069+
"microsoft-planner",
8070+
"microsoft-teams",
8071+
"microsoft-word",
8072+
"outlook",
8073+
"onedrive",
8074+
"sharepoint",
8075+
"x",
8076+
"tiktok",
8077+
"confluence",
8078+
"jira",
8079+
"airtable",
8080+
"bitbucket",
8081+
"notion",
8082+
"clickup",
8083+
"linear",
8084+
"manageengine-sdp",
8085+
"monday",
8086+
"box",
8087+
"dropbox",
8088+
"shopify",
8089+
"slack",
8090+
"reddit",
8091+
"wealthbox",
8092+
"webflow",
8093+
"trello",
8094+
"asana",
8095+
"attio",
8096+
"calcom",
8097+
"docusign",
8098+
"pipedrive",
8099+
"hubspot",
8100+
"linkedin",
8101+
"instagram",
8102+
"salesforce",
8103+
"salesforce-sandbox",
8104+
"zoho-desk",
8105+
"zoom",
8106+
"wordpress",
8107+
"spotify"
8108+
],
8109+
"description": "Exact OAuth provider ID returned by credential-provider discovery."
8110+
}
8111+
},
8112+
"required": ["workspaceId", "displayName", "providerId"],
8113+
"additionalProperties": false
79088114
}
7909-
},
7910-
"required": ["workspaceId", "providerId", "displayName"],
7911-
"additionalProperties": false
8115+
]
79128116
},
79138117
{
79148118
"type": "object",
@@ -7923,7 +8127,40 @@
79238127
"type": "string",
79248128
"minLength": 1,
79258129
"maxLength": 255,
7926-
"description": "Existing OAuth credential to reconnect in place."
8130+
"description": "Existing OAuth credential to reconnect in place. QuickBooks reconnects also require oauthClientConfig with the Intuit client ID, client secret, environment, and webhook verifier token."
8131+
},
8132+
"oauthClientConfig": {
8133+
"description": "Write-only Intuit OAuth app configuration. Required when credentialId identifies a QuickBooks credential; omit it for other providers.",
8134+
"type": "object",
8135+
"properties": {
8136+
"clientId": {
8137+
"type": "string",
8138+
"minLength": 1,
8139+
"maxLength": 255,
8140+
"description": "Client ID for the caller-managed Intuit OAuth application."
8141+
},
8142+
"clientSecret": {
8143+
"type": "string",
8144+
"minLength": 1,
8145+
"maxLength": 512,
8146+
"description": "Write-only client secret for the caller-managed Intuit OAuth application.",
8147+
"writeOnly": true
8148+
},
8149+
"environment": {
8150+
"type": "string",
8151+
"enum": ["sandbox", "production"],
8152+
"description": "Intuit company environment used for authorization and API requests."
8153+
},
8154+
"webhookVerifierToken": {
8155+
"type": "string",
8156+
"minLength": 1,
8157+
"maxLength": 512,
8158+
"description": "Write-only verifier token for webhook signatures from the caller-managed app.",
8159+
"writeOnly": true
8160+
}
8161+
},
8162+
"required": ["clientId", "clientSecret", "environment", "webhookVerifierToken"],
8163+
"additionalProperties": false
79278164
}
79288165
},
79298166
"required": ["workspaceId", "credentialId"],

apps/sim/app/api/auth/oauth/disconnect/route.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('OAuth Disconnect API Route', () => {
2828
beforeEach(() => {
2929
vi.clearAllMocks()
3030
resetDbChainMock()
31-
dbChainMockFns.where.mockResolvedValue([])
31+
dbChainMockFns.limit.mockResolvedValue([])
3232
mockGetUserOrganization.mockResolvedValue(null)
3333
})
3434

@@ -102,7 +102,7 @@ describe('OAuth Disconnect API Route', () => {
102102
session: { id: 'session-1' },
103103
})
104104

105-
dbChainMockFns.where.mockRejectedValueOnce(new Error('Database error'))
105+
dbChainMockFns.limit.mockRejectedValueOnce(new Error('Database error'))
106106

107107
const req = createMockRequest('POST', {
108108
provider: 'google',

0 commit comments

Comments
 (0)