@memberjunction/integration-connectors 5.14.0 → 5.16.0
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/README.md +241 -50
- package/dist/QuickBooksConnector.d.ts +92 -0
- package/dist/QuickBooksConnector.d.ts.map +1 -0
- package/dist/QuickBooksConnector.js +693 -0
- package/dist/QuickBooksConnector.js.map +1 -0
- package/dist/SageIntacctConnector.d.ts +179 -0
- package/dist/SageIntacctConnector.d.ts.map +1 -0
- package/dist/SageIntacctConnector.js +1008 -0
- package/dist/SageIntacctConnector.js.map +1 -0
- package/dist/SalesforceConnector.d.ts +233 -18
- package/dist/SalesforceConnector.d.ts.map +1 -1
- package/dist/SalesforceConnector.js +1136 -32
- package/dist/SalesforceConnector.js.map +1 -1
- package/dist/generate-integration-actions.d.ts +9 -5
- package/dist/generate-integration-actions.d.ts.map +1 -1
- package/dist/generate-integration-actions.js +92 -22
- package/dist/generate-integration-actions.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,73 +1,250 @@
|
|
|
1
1
|
# @memberjunction/integration-connectors
|
|
2
2
|
|
|
3
|
-
Concrete integration connectors for the MemberJunction Integration Engine. This package provides
|
|
3
|
+
Concrete integration connectors for the MemberJunction Integration Engine. This package provides connectors for CRM, accounting, membership, newsletter, and file-based systems — all implementing `BaseIntegrationConnector` from `@memberjunction/integration-engine`.
|
|
4
4
|
|
|
5
5
|
## Connectors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Production REST API Connectors
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
These connectors call live external APIs and extend `BaseRESTIntegrationConnector`.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
#### SalesforceConnector
|
|
12
|
+
|
|
13
|
+
Production connector for Salesforce CRM using the REST API v61.0 with full bidirectional sync.
|
|
14
|
+
|
|
15
|
+
**Registration:** `@RegisterClass(BaseIntegrationConnector, 'SalesforceConnector')`
|
|
16
|
+
|
|
17
|
+
**Authentication — Two Supported Flows:**
|
|
18
|
+
|
|
19
|
+
The connector auto-detects the auth flow based on the credentials provided.
|
|
20
|
+
|
|
21
|
+
**1. Client Credentials Flow** (recommended for new setups):
|
|
12
22
|
```json
|
|
13
23
|
{
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
24
|
+
"authFlow": "client_credentials",
|
|
25
|
+
"loginUrl": "https://myorg.my.salesforce.com",
|
|
26
|
+
"clientId": "3MVG9...your-consumer-key",
|
|
27
|
+
"clientSecret": "D4A28...your-client-secret",
|
|
28
|
+
"apiVersion": "61.0"
|
|
18
29
|
}
|
|
19
30
|
```
|
|
20
31
|
|
|
21
|
-
**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
**2. JWT Bearer Token Flow** (RS256, certificate-based):
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"authFlow": "jwt_bearer",
|
|
36
|
+
"loginUrl": "https://login.salesforce.com",
|
|
37
|
+
"tokenUrl": "https://myorg.my.salesforce.com",
|
|
38
|
+
"clientId": "3MVG9...your-consumer-key",
|
|
39
|
+
"username": "integration-user@myorg.com",
|
|
40
|
+
"privateKey": "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----",
|
|
41
|
+
"apiVersion": "61.0"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
| Field | Required | Description |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| `loginUrl` | Yes | Org URL. For Client Credentials: My Domain URL. For JWT: `login.salesforce.com` (prod) or `test.salesforce.com` (sandbox) as the JWT audience. |
|
|
48
|
+
| `clientId` | Yes | Connected App Consumer Key |
|
|
49
|
+
| `clientSecret` | CC only | Client Secret from Connected App |
|
|
50
|
+
| `username` | JWT only | Integration user's Salesforce email |
|
|
51
|
+
| `privateKey` | JWT only | PEM-encoded RSA private key (matching X.509 cert uploaded to Connected App) |
|
|
52
|
+
| `tokenUrl` | No | Token endpoint URL if different from `loginUrl` (e.g., My Domain URL for JWT flow) |
|
|
53
|
+
| `apiVersion` | No | Salesforce REST API version (default: `61.0`) |
|
|
54
|
+
| `authFlow` | No | Explicit flow selection. Auto-detected: `clientSecret` present → `client_credentials`; `privateKey` + `username` present → `jwt_bearer` |
|
|
55
|
+
|
|
56
|
+
**Capabilities:**
|
|
57
|
+
- Full CRUD (Create, Read, Update, Delete)
|
|
58
|
+
- SOQL-based search
|
|
59
|
+
- Live schema discovery via Describe API (standard + custom objects)
|
|
60
|
+
- Incremental sync with `SystemModstamp` watermarks and `queryAll` for deleted records
|
|
61
|
+
- Governor limit tracking (throttles at 80%, pauses at 95%)
|
|
62
|
+
- Automatic token caching and refresh
|
|
63
|
+
|
|
64
|
+
**Standard Objects (9):** Account, Contact, Lead, Opportunity, Task, Event, Case, Campaign, User (read-only)
|
|
65
|
+
|
|
66
|
+
**Default field mappings:**
|
|
67
|
+
| Source Object | Target Entity | Key Mappings |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| Contact | Contacts | Email (key), FirstName, LastName, Phone, MobilePhone, Title, Department, mailing address fields (12 total) |
|
|
70
|
+
| Account | Companies | Name (key), Industry, Phone, Website, billing address fields, Type, AnnualRevenue, NumberOfEmployees (10 total) |
|
|
71
|
+
| Lead | Contacts | Email (key), FirstName, LastName, Company, Phone, Title (6 total) |
|
|
72
|
+
|
|
73
|
+
See also: [Connector usage guide](../docs/salesforce-connector.md) · [Connected App setup guide](../docs/salesforce-connected-app-setup.md)
|
|
27
74
|
|
|
28
|
-
|
|
75
|
+
#### HubSpotConnector
|
|
29
76
|
|
|
30
|
-
|
|
77
|
+
Production connector for HubSpot CRM using the V3 API with full bidirectional sync, including association objects.
|
|
31
78
|
|
|
32
79
|
**Registration:** `@RegisterClass(BaseIntegrationConnector, 'HubSpotConnector')`
|
|
33
80
|
|
|
81
|
+
**Authentication:** OAuth2 Bearer token via HubSpot Private App credentials.
|
|
82
|
+
|
|
83
|
+
**Capabilities:** Full CRUD, search, list, association fetching (v4 per-object associations endpoint)
|
|
84
|
+
|
|
85
|
+
**Objects:** Contacts, Companies, Deals, Owners, Tickets, Line Items, plus association objects (Contact↔Company, Deal↔Company, etc.)
|
|
86
|
+
|
|
34
87
|
**Default field mappings:**
|
|
35
|
-
| Source Object | Target Entity | Mappings |
|
|
88
|
+
| Source Object | Target Entity | Key Mappings |
|
|
36
89
|
|---|---|---|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
| `hs_Deals` | — | No default mappings |
|
|
90
|
+
| Contacts | Contacts | email (key), firstname, lastname, phone, company, lifecyclestage |
|
|
91
|
+
| Companies | Companies | name (key), domain, industry, city, state |
|
|
40
92
|
|
|
41
|
-
|
|
93
|
+
#### RasaConnector
|
|
42
94
|
|
|
43
|
-
|
|
95
|
+
Production connector for Rasa.io newsletter platform. Read-only — pulls newsletter and subscriber data.
|
|
44
96
|
|
|
45
|
-
|
|
97
|
+
**Registration:** `@RegisterClass(BaseIntegrationConnector, 'RasaConnector')`
|
|
46
98
|
|
|
47
|
-
**
|
|
99
|
+
**Authentication:** Basic auth (username/password) to obtain a JWT, scoped to a community ID.
|
|
100
|
+
|
|
101
|
+
**Objects:** Newsletters, Newsletter Sections, Newsletter Section Items, Subscribers
|
|
102
|
+
|
|
103
|
+
#### WicketConnector
|
|
104
|
+
|
|
105
|
+
Production connector for Wicket membership management platform with full bidirectional sync.
|
|
106
|
+
|
|
107
|
+
**Registration:** `@RegisterClass(BaseIntegrationConnector, 'WicketConnector')`
|
|
108
|
+
|
|
109
|
+
**Authentication:** HMAC-SHA256 signed requests.
|
|
110
|
+
|
|
111
|
+
**Capabilities:** Full CRUD, search
|
|
112
|
+
|
|
113
|
+
### Accounting Connectors
|
|
114
|
+
|
|
115
|
+
These connectors integrate with accounting and ERP systems.
|
|
116
|
+
|
|
117
|
+
#### SageIntacctConnector
|
|
118
|
+
|
|
119
|
+
Production connector for Sage Intacct accounting/ERP using the XML Web Services API with full bidirectional sync.
|
|
120
|
+
|
|
121
|
+
**Registration:** `@RegisterClass(BaseIntegrationConnector, 'SageIntacctConnector')`
|
|
122
|
+
|
|
123
|
+
**Authentication:** Session-based — Sender ID/Password (app credentials) + User ID/Password authenticate via `getAPISession`, returning a session ID for subsequent requests.
|
|
124
|
+
|
|
125
|
+
**Credentials JSON:**
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"CompanyId": "your-company-id",
|
|
129
|
+
"SenderId": "your-sender-id",
|
|
130
|
+
"SenderPassword": "your-sender-password",
|
|
131
|
+
"UserId": "your-user-id",
|
|
132
|
+
"UserPassword": "your-user-password",
|
|
133
|
+
"EntityId": "optional-entity-id"
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
| Field | Required | Description |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| `CompanyId` | Yes | Sage Intacct Company ID |
|
|
140
|
+
| `SenderId` | Yes | Web Services Sender ID (from Marketplace subscription) |
|
|
141
|
+
| `SenderPassword` | Yes | Web Services Sender Password |
|
|
142
|
+
| `UserId` | Yes | User ID for API authentication |
|
|
143
|
+
| `UserPassword` | Yes | User password |
|
|
144
|
+
| `EntityId` | No | Entity ID for multi-entity shared companies |
|
|
145
|
+
|
|
146
|
+
**Capabilities:**
|
|
147
|
+
- Full CRUD (Create, Read, Update, Delete)
|
|
148
|
+
- Query-based search via `readByQuery`
|
|
149
|
+
- Paginated listing via `readMore`
|
|
150
|
+
- Live schema discovery via `inspect` API
|
|
151
|
+
- Incremental sync with `WHENMODIFIED` watermarks
|
|
152
|
+
- Session caching and automatic refresh
|
|
153
|
+
- Retry with exponential backoff
|
|
154
|
+
|
|
155
|
+
**Objects (9):** Customer, Vendor, GL Account, AP Bill, AR Invoice, Project, Employee, Department, Class
|
|
156
|
+
|
|
157
|
+
**Default field mappings:**
|
|
158
|
+
| Source Object | Target Entity | Key Mappings |
|
|
159
|
+
|---|---|---|
|
|
160
|
+
| CUSTOMER | Contacts | CUSTOMERID (key), NAME, EMAIL, PHONE, STATUS |
|
|
161
|
+
| VENDOR | Companies | VENDORID (key), NAME, EMAIL, PHONE, STATUS |
|
|
162
|
+
|
|
163
|
+
#### QuickBooksConnector
|
|
164
|
+
|
|
165
|
+
Production connector for QuickBooks Online using the REST API v3 with OAuth 2.0 authentication.
|
|
166
|
+
|
|
167
|
+
**Registration:** `@RegisterClass(BaseIntegrationConnector, 'QuickBooksConnector')`
|
|
168
|
+
|
|
169
|
+
**Authentication:** OAuth 2.0 with automatic token refresh. Requires a QuickBooks app with client ID/secret and an initial refresh token obtained through the OAuth consent flow.
|
|
170
|
+
|
|
171
|
+
**Credentials JSON:**
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"ClientId": "your-client-id",
|
|
175
|
+
"ClientSecret": "your-client-secret",
|
|
176
|
+
"RefreshToken": "your-refresh-token",
|
|
177
|
+
"RealmId": "your-company-realm-id",
|
|
178
|
+
"Environment": "production"
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
| Field | Required | Description |
|
|
183
|
+
|---|---|---|
|
|
184
|
+
| `ClientId` | Yes | OAuth 2.0 Client ID from QuickBooks developer portal |
|
|
185
|
+
| `ClientSecret` | Yes | OAuth 2.0 Client Secret |
|
|
186
|
+
| `RefreshToken` | Yes | OAuth 2.0 refresh token (auto-refreshed on each use) |
|
|
187
|
+
| `RealmId` | Yes | QuickBooks Company ID (Realm ID) |
|
|
188
|
+
| `Environment` | No | `production` (default) or `sandbox` |
|
|
189
|
+
|
|
190
|
+
**Capabilities:**
|
|
191
|
+
- Full CRUD (Create, Read, Update, Delete)
|
|
192
|
+
- SQL-like query via QuickBooks Query Language
|
|
193
|
+
- Paginated listing
|
|
194
|
+
- Live schema discovery
|
|
195
|
+
- Incremental sync with `MetaData.LastUpdatedTime` watermarks
|
|
196
|
+
- Automatic OAuth token refresh
|
|
197
|
+
- Minor version pinning for API stability
|
|
198
|
+
|
|
199
|
+
**Objects (10):** Customer, Vendor, Account, Invoice, Bill, Item, Payment, Employee, Department, Class
|
|
48
200
|
|
|
49
201
|
**Default field mappings:**
|
|
50
|
-
| Source Object | Target Entity | Mappings |
|
|
202
|
+
| Source Object | Target Entity | Key Mappings |
|
|
51
203
|
|---|---|---|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
204
|
+
| Customer | Contacts | Id (key), DisplayName, PrimaryEmailAddr, PrimaryPhone, Active |
|
|
205
|
+
| Vendor | Companies | Id (key), DisplayName, PrimaryEmailAddr, PrimaryPhone, Active |
|
|
54
206
|
|
|
55
|
-
|
|
207
|
+
### SQL-Based Connectors
|
|
56
208
|
|
|
57
|
-
|
|
209
|
+
These connectors read from SQL Server databases and extend `RelationalDBConnector`.
|
|
58
210
|
|
|
59
|
-
|
|
211
|
+
#### RelationalDBConnector (Base Class)
|
|
212
|
+
|
|
213
|
+
Abstract base class for connectors backed by SQL Server via the `mssql` package.
|
|
214
|
+
|
|
215
|
+
**Configuration JSON:**
|
|
216
|
+
```json
|
|
217
|
+
{
|
|
218
|
+
"server": "your-sql-server",
|
|
219
|
+
"database": "YourDatabase",
|
|
220
|
+
"user": "username",
|
|
221
|
+
"password": "password"
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**Shared capabilities:**
|
|
226
|
+
- `TestConnection` — runs `SELECT @@VERSION`
|
|
227
|
+
- `DiscoverObjects` — queries `INFORMATION_SCHEMA.TABLES`
|
|
228
|
+
- `DiscoverFields` — queries `INFORMATION_SCHEMA.COLUMNS`
|
|
229
|
+
- `FetchChangesFromTable` — incremental fetch with watermark filtering and batch limiting
|
|
230
|
+
- Connection pool caching per server+database pair
|
|
231
|
+
|
|
232
|
+
#### YourMembershipConnector
|
|
233
|
+
|
|
234
|
+
Reads from YourMembership database tables: `ym_Members`, `ym_Events`, `ym_EventRegistrations`, `ym_Chapters`, `ym_MembershipLevels`.
|
|
60
235
|
|
|
61
236
|
**Registration:** `@RegisterClass(BaseIntegrationConnector, 'YourMembershipConnector')`
|
|
62
237
|
|
|
63
238
|
**Default field mappings:**
|
|
64
|
-
| Source Object | Target Entity | Mappings |
|
|
239
|
+
| Source Object | Target Entity | Key Mappings |
|
|
65
240
|
|---|---|---|
|
|
66
|
-
|
|
|
241
|
+
| ym_Members | Contacts | email (key), first_name, last_name, phone, status |
|
|
242
|
+
|
|
243
|
+
### File-Based Connectors
|
|
67
244
|
|
|
68
|
-
|
|
245
|
+
#### FileFeedConnector
|
|
69
246
|
|
|
70
|
-
Reads data from local CSV files. Always performs a full load (no incremental sync
|
|
247
|
+
Reads data from local CSV files. Always performs a full load (no incremental sync).
|
|
71
248
|
|
|
72
249
|
**Registration:** `@RegisterClass(BaseIntegrationConnector, 'FileFeedConnector')`
|
|
73
250
|
|
|
@@ -83,13 +260,24 @@ Reads data from local CSV files. Always performs a full load (no incremental syn
|
|
|
83
260
|
- `TestConnection` — checks that the file exists on disk
|
|
84
261
|
- `DiscoverObjects` — returns the file name as the single available object
|
|
85
262
|
- `DiscoverFields` — parses the CSV header row
|
|
86
|
-
- `FetchChanges` — parses all
|
|
263
|
+
- `FetchChanges` — parses all rows into `ExternalRecord[]` (watermark ignored)
|
|
264
|
+
|
|
265
|
+
## Action Generation
|
|
87
266
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
267
|
+
Integration connectors can auto-generate MJ Action metadata for use by AI agents and workflow engines. Each connector declares its objects and fields via `GetIntegrationObjects()`, and the CLI generator produces mj-sync compatible JSON files.
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# Generate actions for all connectors
|
|
271
|
+
npx tsx src/generate-integration-actions.ts
|
|
272
|
+
|
|
273
|
+
# Generate for a specific connector
|
|
274
|
+
npx tsx src/generate-integration-actions.ts salesforce
|
|
275
|
+
npx tsx src/generate-integration-actions.ts hubspot
|
|
276
|
+
npx tsx src/generate-integration-actions.ts sage-intacct
|
|
277
|
+
npx tsx src/generate-integration-actions.ts quickbooks
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
See [INTEGRATION_ACTIONS.md](../INTEGRATION_ACTIONS.md) for full documentation.
|
|
93
281
|
|
|
94
282
|
## Building
|
|
95
283
|
|
|
@@ -100,8 +288,6 @@ npm run build
|
|
|
100
288
|
|
|
101
289
|
## Testing
|
|
102
290
|
|
|
103
|
-
Tests are integration tests that connect to the mock SQL Server databases.
|
|
104
|
-
|
|
105
291
|
```bash
|
|
106
292
|
cd packages/Integration/connectors
|
|
107
293
|
npm run test # single run
|
|
@@ -112,13 +298,18 @@ npm run test:watch # watch mode
|
|
|
112
298
|
|
|
113
299
|
```
|
|
114
300
|
src/
|
|
115
|
-
index.ts
|
|
116
|
-
RelationalDBConnector.ts
|
|
117
|
-
HubSpotConnector.ts
|
|
118
|
-
SalesforceConnector.ts
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
301
|
+
index.ts # Package exports
|
|
302
|
+
RelationalDBConnector.ts # Base class for SQL-based connectors
|
|
303
|
+
HubSpotConnector.ts # HubSpot REST API connector (full CRUD)
|
|
304
|
+
SalesforceConnector.ts # Salesforce REST API connector (full CRUD)
|
|
305
|
+
SageIntacctConnector.ts # Sage Intacct XML API connector (full CRUD)
|
|
306
|
+
QuickBooksConnector.ts # QuickBooks Online REST API connector (full CRUD)
|
|
307
|
+
RasaConnector.ts # Rasa.io REST API connector (read-only)
|
|
308
|
+
WicketConnector.ts # Wicket REST API connector (full CRUD)
|
|
309
|
+
YourMembershipConnector.ts # YourMembership SQL connector
|
|
310
|
+
FileFeedConnector.ts # CSV file connector
|
|
311
|
+
generate-integration-actions.ts # CLI: auto-generate action metadata from connectors
|
|
312
|
+
__tests__/ # Unit and integration tests
|
|
122
313
|
test-fixtures/
|
|
123
|
-
sample-contacts.csv
|
|
314
|
+
sample-contacts.csv # 100-row sample for FileFeed testing
|
|
124
315
|
```
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type UserInfo } from '@memberjunction/core';
|
|
2
|
+
import type { MJCompanyIntegrationEntity } from '@memberjunction/core-entities';
|
|
3
|
+
import { BaseIntegrationConnector, type ConnectionTestResult, type ExternalObjectSchema, type ExternalFieldSchema, type FetchContext, type FetchBatchResult, type DefaultFieldMapping, type DefaultIntegrationConfig, type ExternalRecord, type CRUDResult, type CreateRecordContext, type UpdateRecordContext, type DeleteRecordContext, type GetRecordContext, type SearchContext, type SearchResult, type ListContext, type ListResult, type IntegrationObjectInfo, type ActionGeneratorConfig } from '@memberjunction/integration-engine';
|
|
4
|
+
/** Connection configuration parsed from CompanyIntegration credentials */
|
|
5
|
+
export interface QuickBooksConnectionConfig {
|
|
6
|
+
/** OAuth 2.0 Client ID from QuickBooks developer portal */
|
|
7
|
+
ClientId: string;
|
|
8
|
+
/** OAuth 2.0 Client Secret */
|
|
9
|
+
ClientSecret: string;
|
|
10
|
+
/** OAuth 2.0 Refresh Token (auto-refreshed on each use) */
|
|
11
|
+
RefreshToken: string;
|
|
12
|
+
/** QuickBooks Company ID (Realm ID) */
|
|
13
|
+
RealmId: string;
|
|
14
|
+
/** Environment: 'production' or 'sandbox'. Default: 'production' */
|
|
15
|
+
Environment?: QuickBooksEnvironment;
|
|
16
|
+
/** Maximum retries for rate-limited or failed requests. Default: 3 */
|
|
17
|
+
MaxRetries?: number;
|
|
18
|
+
/** HTTP request timeout in milliseconds. Default: 30000 */
|
|
19
|
+
RequestTimeoutMs?: number;
|
|
20
|
+
/** Minimum milliseconds between API requests. Default: 200 */
|
|
21
|
+
MinRequestIntervalMs?: number;
|
|
22
|
+
}
|
|
23
|
+
type QuickBooksEnvironment = 'production' | 'sandbox';
|
|
24
|
+
/**
|
|
25
|
+
* Connector for QuickBooks Online REST API v3.
|
|
26
|
+
*
|
|
27
|
+
* Extends BaseIntegrationConnector directly. While QBO is REST/JSON, its
|
|
28
|
+
* query model uses a custom SQL-like query language and its update operations
|
|
29
|
+
* require the full object with SyncToken, making it distinct from the
|
|
30
|
+
* generic BaseRESTIntegrationConnector pagination pattern.
|
|
31
|
+
*
|
|
32
|
+
* Auth flow:
|
|
33
|
+
* 1. Exchange refresh token for access token via OAuth 2.0 token endpoint
|
|
34
|
+
* 2. Access token is Bearer-authenticated on all API calls
|
|
35
|
+
* 3. Refresh tokens are rotated — the connector stores the latest refresh token
|
|
36
|
+
*
|
|
37
|
+
* API operations:
|
|
38
|
+
* - Query: SQL-like SELECT statements (e.g., "SELECT * FROM Customer WHERE Active = true")
|
|
39
|
+
* - Read: GET /v3/company/{realmId}/{objectType}/{id}
|
|
40
|
+
* - Create: POST /v3/company/{realmId}/{objectType}
|
|
41
|
+
* - Update: POST /v3/company/{realmId}/{objectType} (full object with SyncToken)
|
|
42
|
+
* - Delete: POST /v3/company/{realmId}/{objectType}?operation=delete
|
|
43
|
+
*
|
|
44
|
+
* Pagination:
|
|
45
|
+
* - Query supports STARTPOSITION and MAXRESULTS
|
|
46
|
+
* - COUNT query to determine total records
|
|
47
|
+
*/
|
|
48
|
+
export declare class QuickBooksConnector extends BaseIntegrationConnector {
|
|
49
|
+
private authState;
|
|
50
|
+
/** Timestamp of the last API request, used for throttling */
|
|
51
|
+
private lastRequestTime;
|
|
52
|
+
get SupportsCreate(): boolean;
|
|
53
|
+
get SupportsUpdate(): boolean;
|
|
54
|
+
get SupportsDelete(): boolean;
|
|
55
|
+
get SupportsSearch(): boolean;
|
|
56
|
+
get SupportsListing(): boolean;
|
|
57
|
+
get IntegrationName(): string;
|
|
58
|
+
GetIntegrationObjects(): IntegrationObjectInfo[];
|
|
59
|
+
GetActionGeneratorConfig(): ActionGeneratorConfig | null;
|
|
60
|
+
GetDefaultConfiguration(): DefaultIntegrationConfig | null;
|
|
61
|
+
GetDefaultFieldMappings(objectName: string, _entityName: string): DefaultFieldMapping[];
|
|
62
|
+
TestConnection(companyIntegration: MJCompanyIntegrationEntity, contextUser: UserInfo): Promise<ConnectionTestResult>;
|
|
63
|
+
DiscoverObjects(_companyIntegration: MJCompanyIntegrationEntity, _contextUser: UserInfo): Promise<ExternalObjectSchema[]>;
|
|
64
|
+
DiscoverFields(_companyIntegration: MJCompanyIntegrationEntity, objectName: string, _contextUser: UserInfo): Promise<ExternalFieldSchema[]>;
|
|
65
|
+
FetchChanges(ctx: FetchContext): Promise<FetchBatchResult>;
|
|
66
|
+
CreateRecord(ctx: CreateRecordContext): Promise<CRUDResult>;
|
|
67
|
+
UpdateRecord(ctx: UpdateRecordContext): Promise<CRUDResult>;
|
|
68
|
+
DeleteRecord(ctx: DeleteRecordContext): Promise<CRUDResult>;
|
|
69
|
+
GetRecord(ctx: GetRecordContext): Promise<ExternalRecord | null>;
|
|
70
|
+
SearchRecords(ctx: SearchContext): Promise<SearchResult>;
|
|
71
|
+
ListRecords(ctx: ListContext): Promise<ListResult>;
|
|
72
|
+
private GetAuth;
|
|
73
|
+
private IsTokenValid;
|
|
74
|
+
private RefreshAccessToken;
|
|
75
|
+
private ParseConfig;
|
|
76
|
+
private LoadFromCredentialEntity;
|
|
77
|
+
private ValidateConfig;
|
|
78
|
+
private MakeRequest;
|
|
79
|
+
private ExecuteQuery;
|
|
80
|
+
private FetchSingleRecord;
|
|
81
|
+
private ExtractQueryRecords;
|
|
82
|
+
private ExtractLastUpdatedTime;
|
|
83
|
+
private ComputeWatermark;
|
|
84
|
+
private ExtractQBOErrorMessage;
|
|
85
|
+
private Throttle;
|
|
86
|
+
private Sleep;
|
|
87
|
+
private BuildCRUDError;
|
|
88
|
+
}
|
|
89
|
+
/** Tree-shaking prevention function — import and call from module entry point */
|
|
90
|
+
export declare function LoadQuickBooksConnector(): void;
|
|
91
|
+
export {};
|
|
92
|
+
//# sourceMappingURL=QuickBooksConnector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuickBooksConnector.d.ts","sourceRoot":"","s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