@oppulence/stripe-sync-engine-sdk 1.10.9 → 1.14.15

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.
Files changed (6) hide show
  1. package/README.md +43 -146
  2. package/dist/index.d.mts +4586 -2295
  3. package/dist/index.d.ts +4586 -2295
  4. package/dist/index.js +2740 -937
  5. package/dist/index.mjs +2542 -886
  6. package/package.json +30 -14
package/README.md CHANGED
@@ -1,180 +1,77 @@
1
- # Oppulence Stripe Sync SDK for TypeScript
1
+ # @oppulence/stripe-sync-sdk
2
2
 
3
- TypeScript/JavaScript SDK for interacting with the Oppulence Stripe Sync Engine API.
3
+ TypeScript SDK for Stripe Sync Engine - REST API for managing Stripe data synchronization and tenant operations.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @oppulence/stripe-sync-engine-sdk
9
- ```
10
-
11
- or with yarn:
12
-
13
- ```bash
14
- yarn add @oppulence/stripe-sync-engine-sdk
15
- ```
16
-
17
- or with pnpm:
18
-
19
- ```bash
20
- pnpm add @oppulence/stripe-sync-engine-sdk
8
+ npm install @oppulence/stripe-sync-sdk
9
+ # or
10
+ yarn add @oppulence/stripe-sync-sdk
11
+ # or
12
+ pnpm add @oppulence/stripe-sync-sdk
21
13
  ```
22
14
 
23
15
  ## Usage
24
16
 
25
- ### Basic Setup
26
-
27
17
  ```typescript
28
- import { Configuration, TenantsApi, SyncApi } from '@oppulence/stripe-sync-engine-sdk'
18
+ import { Configuration, TenantsApi, StripeCustomersApi } from '@oppulence/stripe-sync-sdk'
29
19
 
30
- // Configure the SDK with your API credentials
20
+ // Configure the API client
31
21
  const config = new Configuration({
32
- basePath: 'https://your-sync-engine.example.com',
33
- headers: {
34
- 'x-api-key': 'your-api-key-here',
35
- },
22
+ basePath: 'https://your-api-endpoint.com',
23
+ apiKey: 'your-api-key',
36
24
  })
37
25
 
38
- // Initialize API clients
26
+ // Use the Tenants API
39
27
  const tenantsApi = new TenantsApi(config)
40
- const syncApi = new SyncApi(config)
41
- ```
42
-
43
- ### Create a Tenant
44
-
45
- ```typescript
46
- const createTenantResponse = await tenantsApi.createTenant({
47
- createTenantRequest: {
48
- tenantId: 'customer-123',
49
- stripeSecretKey: 'sk_test_...',
50
- // optional fields
51
- webhookSecret: 'whsec_...',
52
- metadata: { customerId: '123' },
53
- },
54
- })
28
+ const tenants = await tenantsApi.listTenants()
55
29
 
56
- console.log('Tenant created:', createTenantResponse)
30
+ // Use the Stripe Customers API
31
+ const customersApi = new StripeCustomersApi(config)
32
+ const customers = await customersApi.apiV1StripeCustomersGet()
57
33
  ```
58
34
 
59
- ### Trigger a Sync
35
+ ## Available APIs
60
36
 
61
- ```typescript
62
- const syncResponse = await syncApi.syncTenant({
63
- tenantId: 'customer-123',
64
- })
65
-
66
- console.log('Sync initiated:', syncResponse)
67
- ```
68
-
69
- ### List Tenants
70
-
71
- ```typescript
72
- const tenants = await tenantsApi.listTenants({
73
- limit: 100,
74
- offset: 0,
75
- })
37
+ - `BillingApi` - Billing management
38
+ - `BusinessMetricsApi` - Business metrics and analytics
39
+ - `HealthApi` - Health check endpoints
40
+ - `RecurringTransactionsApi` - Recurring transaction management
41
+ - `StripeChargesApi` - Stripe charges data
42
+ - `StripeCustomersApi` - Stripe customers data
43
+ - `StripeInvoicesApi` - Stripe invoices data
44
+ - `StripePaymentIntentsApi` - Stripe payment intents
45
+ - `StripePricesApi` - Stripe prices data
46
+ - `StripeProductsApi` - Stripe products data
47
+ - `StripeSubscriptionsApi` - Stripe subscriptions data
48
+ - `StripeTransactionsApi` - Stripe transactions data
49
+ - `TenantsApi` - Multi-tenant management
50
+ - `TransactionsApi` - Transaction management
51
+ - `WebhooksApi` - Webhook management
76
52
 
77
- console.log('Tenants:', tenants.data)
78
- ```
53
+ ## Authentication
79
54
 
80
- ### Get Tenant Health
55
+ The SDK supports multiple authentication methods:
81
56
 
82
57
  ```typescript
83
- const health = await tenantsApi.getTenantHealth({
84
- tenantId: 'customer-123',
58
+ // API Key authentication
59
+ const config = new Configuration({
60
+ apiKey: 'your-api-key',
85
61
  })
86
62
 
87
- console.log('Tenant health:', health)
88
- ```
89
-
90
- ### Trigger Backfill
91
-
92
- ```typescript
93
- const backfillResponse = await syncApi.syncBackfill({
94
- tenantId: 'customer-123',
95
- syncBackfillRequest: {
96
- entities: ['customer', 'subscription', 'invoice'],
97
- startDate: '2024-01-01',
98
- endDate: '2024-12-31',
99
- },
63
+ // Bearer token authentication
64
+ const config = new Configuration({
65
+ accessToken: 'your-bearer-token',
100
66
  })
101
67
 
102
- console.log('Backfill initiated:', backfillResponse)
103
- ```
104
-
105
- ## API Reference
106
-
107
- ### Available APIs
108
-
109
- - **TenantsApi**: Manage tenants (create, update, list, delete)
110
- - **SyncApi**: Trigger sync operations
111
- - **HealthApi**: Check API and tenant health status
112
- - **WebhooksApi**: Process webhooks
113
-
114
- ### Configuration Options
115
-
116
- ```typescript
68
+ // Basic authentication
117
69
  const config = new Configuration({
118
- basePath: 'https://api.example.com', // API base URL
119
- headers: {
120
- 'x-api-key': 'your-api-key', // API key for authentication
121
- 'Content-Type': 'application/json',
122
- },
123
- fetchApi: fetch, // Optional: custom fetch implementation
70
+ username: 'your-username',
71
+ password: 'your-password',
124
72
  })
125
73
  ```
126
74
 
127
- ## Error Handling
128
-
129
- ```typescript
130
- try {
131
- const response = await tenantsApi.createTenant({
132
- createTenantRequest: {
133
- /* ... */
134
- },
135
- })
136
- } catch (error) {
137
- if (error instanceof Response) {
138
- const errorData = await error.json()
139
- console.error('API Error:', errorData)
140
- } else {
141
- console.error('Unexpected error:', error)
142
- }
143
- }
144
- ```
145
-
146
- ## TypeScript Support
147
-
148
- This SDK is written in TypeScript and provides full type definitions out of the box. All request and response types are exported and can be imported:
149
-
150
- ```typescript
151
- import type {
152
- CreateTenantRequest,
153
- CreateTenant201Response,
154
- ListTenants200Response,
155
- SyncBackfillRequest,
156
- } from '@oppulence/stripe-sync-engine-sdk'
157
- ```
158
-
159
- ## Development
160
-
161
- ### Building
162
-
163
- ```bash
164
- npm run build
165
- ```
166
-
167
- ### Publishing
168
-
169
- This SDK is automatically published to npm when a new release is created. See the main repository documentation for release procedures.
170
-
171
- ## Support
172
-
173
- For issues and questions, please visit:
174
-
175
- - GitHub Issues: https://github.com/Oppulence-Engineering/oppulence-sync-engine/issues
176
- - Documentation: https://github.com/Oppulence-Engineering/oppulence-sync-engine
177
-
178
75
  ## License
179
76
 
180
77
  MIT