@happyvertical/accounting 0.101.3 → 0.102.1
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/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @happyvertical/accounting - Multi-provider accounting integration
|
|
3
|
+
*
|
|
4
|
+
* This package provides a unified interface for syncing and auditing
|
|
5
|
+
* accounting data (AR/AP) with external providers like QuickBooks Online,
|
|
6
|
+
* Stripe, PayPal, and Coinbase Commerce.
|
|
7
|
+
*
|
|
8
|
+
* Key components:
|
|
9
|
+
* - getAccountingProvider() - Factory function for creating provider instances
|
|
10
|
+
* - AccountingProvider - Unified interface for all providers
|
|
11
|
+
* - Audit operations for reconciling local vs external data
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { getAccountingProvider } from '@happyvertical/accounting';
|
|
16
|
+
*
|
|
17
|
+
* const provider = await getAccountingProvider({
|
|
18
|
+
* type: 'quickbooks',
|
|
19
|
+
* clientId: 'xxx',
|
|
20
|
+
* clientSecret: 'xxx',
|
|
21
|
+
* realmId: 'xxx',
|
|
22
|
+
* refreshToken: 'xxx'
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // Sync a customer
|
|
26
|
+
* const result = await provider.customers.sync(customer);
|
|
27
|
+
*
|
|
28
|
+
* // Audit invoices
|
|
29
|
+
* const report = await provider.audit.reconcileInvoices(localInvoices);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import type { AccountingOptions, AccountingProvider, QuickBooksOptions, StripeOptions } from './types.js';
|
|
2
33
|
export type { QuickBooksOAuthErrorCode } from './errors.js';
|
|
3
34
|
export { QuickBooksOAuthError, QuickBooksWriteError, StripeApiError, } from './errors.js';
|
|
4
35
|
export { prepareQuickBooksInvoiceRequest } from './providers/quickbooks/invoice-request.js';
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* QuickBooks Online Provider
|
|
3
|
+
*
|
|
4
|
+
* Implements the AccountingProvider interface for QuickBooks Online.
|
|
5
|
+
* Uses the Intuit OAuth2 library for authentication and the QBO API for operations.
|
|
6
|
+
*/
|
|
7
|
+
import type { AccountingProvider, AuditOperations, BillOperations, CustomerOperations, InvoiceOperations, PaymentOperations, QuickBooksInvoiceRequest, QuickBooksOptions, VendorOperations, WebhookOperations } from '../../types.js';
|
|
2
8
|
/**
|
|
3
9
|
* QuickBooks Online accounting provider
|
|
4
10
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvoiceInput, QuickBooksInvoiceRequest } from '../../types.js';
|
|
1
|
+
import type { InvoiceInput, QuickBooksInvoiceRequest } from '../../types.js';
|
|
2
2
|
/** Prepare once, persist before sending, and reuse unchanged. Performs no I/O. */
|
|
3
3
|
export declare function prepareQuickBooksInvoiceRequest(invoice: InvoiceInput, identity: Omit<QuickBooksInvoiceRequest, 'payloadHash'>): QuickBooksInvoiceRequest;
|
|
4
4
|
export declare function validateQuickBooksInvoiceRequest(request: QuickBooksInvoiceRequest, realmId: string, environment: 'sandbox' | 'production', payload: string | undefined): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QuickBooksOAuthClient, QuickBooksOAuthOptions } from '../../types.js';
|
|
1
|
+
import type { QuickBooksOAuthClient, QuickBooksOAuthOptions } from '../../types.js';
|
|
2
2
|
/** Create a public QuickBooks connection helper backed by Intuit's OAuth client. */
|
|
3
3
|
export declare function createQuickBooksOAuthClient(options: QuickBooksOAuthOptions): Promise<QuickBooksOAuthClient>;
|
|
4
4
|
//# sourceMappingURL=oauth.d.ts.map
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Stripe Provider
|
|
3
|
+
*
|
|
4
|
+
* Implements Stripe AR, payment, webhook, and billing operations using the
|
|
5
|
+
* Stripe HTTP API directly. The SDK keeps Stripe as an optional runtime
|
|
6
|
+
* dependency by relying on the platform fetch implementation.
|
|
7
|
+
*/
|
|
8
|
+
import type { AuditOperations, BillOperations, CustomerOperations, InvoiceOperations, PaymentOperations, StripeAccountingProvider, StripeBillingOperations, StripeOptions, VendorOperations, WebhookOperations } from '../../types.js';
|
|
2
9
|
type StripePrimitive = string | number | boolean | Date | null | undefined;
|
|
3
10
|
type StripeFormValue = StripePrimitive | StripeFormValue[] | {
|
|
4
11
|
[key: string]: StripeFormValue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/accounting",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.102.1",
|
|
4
4
|
"description": "Multi-provider accounting integration for AR/AP sync and audit with QuickBooks, Stripe, and more",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"homepage": "https://github.com/happyvertical/sdk/tree/main/packages/accounting#readme",
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@happyvertical/utils": "0.
|
|
39
|
+
"@happyvertical/utils": "0.102.1",
|
|
40
40
|
"intuit-oauth": "^4.2.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|