chargefy-js 1.1.7 → 1.1.10
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 +79 -0
- package/dist/chargefy.d.ts +15 -12
- package/dist/chargefy.d.ts.map +1 -1
- package/dist/chargefy.js +16 -12
- package/dist/core.d.ts +9 -9
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +3 -3
- package/dist/funcs/checkoutsClientConfirm.d.ts +11 -11
- package/dist/funcs/checkoutsClientConfirm.d.ts.map +1 -1
- package/dist/funcs/checkoutsClientConfirm.js +3 -3
- package/dist/funcs/checkoutsClientGet.d.ts +7 -7
- package/dist/funcs/checkoutsClientGet.d.ts.map +1 -1
- package/dist/funcs/checkoutsClientGet.js +3 -3
- package/dist/funcs/checkoutsClientUpdate.d.ts +10 -10
- package/dist/funcs/checkoutsClientUpdate.d.ts.map +1 -1
- package/dist/funcs/checkoutsClientUpdate.js +3 -3
- package/dist/index.d.ts +25 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -10
- package/dist/models/checkoutLink.d.ts +6 -0
- package/dist/models/checkoutLink.d.ts.map +1 -1
- package/dist/models/components/checkoutconfirmcelcoin.d.ts +1 -1
- package/dist/models/components/checkoutconfirmcelcoin.d.ts.map +1 -1
- package/dist/models/components/checkoutpublicconfirmed.d.ts +1 -1
- package/dist/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
- package/dist/models/components/checkoutupdatepublic.d.ts +1 -1
- package/dist/models/components/checkoutupdatepublic.d.ts.map +1 -1
- package/dist/models/product.d.ts +5 -0
- package/dist/models/product.d.ts.map +1 -1
- package/dist/models/sub-organization.d.ts +2 -0
- package/dist/models/sub-organization.d.ts.map +1 -1
- package/dist/models/webhook.d.ts +47 -0
- package/dist/models/webhook.d.ts.map +1 -0
- package/dist/models/webhook.js +13 -0
- package/dist/namespaces/buyers.d.ts +4 -4
- package/dist/namespaces/buyers.d.ts.map +1 -1
- package/dist/namespaces/checkoutLinks.d.ts +6 -4
- package/dist/namespaces/checkoutLinks.d.ts.map +1 -1
- package/dist/namespaces/checkoutLinks.js +11 -0
- package/dist/namespaces/checkouts.d.ts +4 -4
- package/dist/namespaces/checkouts.d.ts.map +1 -1
- package/dist/namespaces/checkouts.js +1 -1
- package/dist/namespaces/embed-onboarding.d.ts +3 -3
- package/dist/namespaces/embed-onboarding.d.ts.map +1 -1
- package/dist/namespaces/kyc.d.ts +3 -3
- package/dist/namespaces/kyc.d.ts.map +1 -1
- package/dist/namespaces/onboarding-links.d.ts +3 -3
- package/dist/namespaces/onboarding-links.d.ts.map +1 -1
- package/dist/namespaces/organizations.d.ts +3 -3
- package/dist/namespaces/organizations.d.ts.map +1 -1
- package/dist/namespaces/products.d.ts +7 -5
- package/dist/namespaces/products.d.ts.map +1 -1
- package/dist/namespaces/products.js +16 -3
- package/dist/namespaces/sales.d.ts +4 -4
- package/dist/namespaces/sales.d.ts.map +1 -1
- package/dist/namespaces/sub-organizations.d.ts +17 -3
- package/dist/namespaces/sub-organizations.d.ts.map +1 -1
- package/dist/namespaces/sub-organizations.js +25 -0
- package/dist/namespaces/subscriptions.d.ts +4 -4
- package/dist/namespaces/subscriptions.d.ts.map +1 -1
- package/dist/namespaces/webhooks.d.ts +89 -0
- package/dist/namespaces/webhooks.d.ts.map +1 -0
- package/dist/namespaces/webhooks.js +133 -0
- package/dist/utils/errors.d.ts +8 -8
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +8 -8
- package/dist/utils/transformers.d.ts +1 -1
- package/dist/utils/transformers.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/chargefy.ts +16 -12
- package/src/core.ts +11 -11
- package/src/funcs/checkoutsClientConfirm.ts +13 -13
- package/src/funcs/checkoutsClientGet.ts +9 -9
- package/src/funcs/checkoutsClientUpdate.ts +12 -12
- package/src/index.ts +33 -23
- package/src/models/checkoutLink.ts +6 -0
- package/src/models/components/checkoutconfirmcelcoin.ts +1 -1
- package/src/models/components/checkoutpublicconfirmed.ts +1 -1
- package/src/models/components/checkoutupdatepublic.ts +1 -1
- package/src/models/product.ts +5 -0
- package/src/models/sub-organization.ts +2 -0
- package/src/models/webhook.ts +96 -0
- package/src/namespaces/buyers.ts +4 -4
- package/src/namespaces/checkoutLinks.ts +13 -4
- package/src/namespaces/checkouts.ts +5 -5
- package/src/namespaces/embed-onboarding.ts +3 -3
- package/src/namespaces/kyc.ts +3 -3
- package/src/namespaces/onboarding-links.ts +3 -3
- package/src/namespaces/organizations.ts +3 -3
- package/src/namespaces/products.ts +23 -8
- package/src/namespaces/sales.ts +4 -4
- package/src/namespaces/sub-organizations.ts +31 -3
- package/src/namespaces/subscriptions.ts +4 -4
- package/src/namespaces/webhooks.ts +180 -0
- package/src/utils/errors.ts +8 -8
- package/src/utils/transformers.ts +1 -1
package/README.md
CHANGED
|
@@ -112,6 +112,17 @@ const result = await chargefy.products.create({
|
|
|
112
112
|
prices: [{ amount: 4900 }], // R$ 49,00/month
|
|
113
113
|
})
|
|
114
114
|
|
|
115
|
+
// Create product with referenceId (upsert: update if exists for org)
|
|
116
|
+
const result = await chargefy.products.create({
|
|
117
|
+
organizationId: 'org_xxx',
|
|
118
|
+
name: 'My Product',
|
|
119
|
+
referenceId: 'my-product-123', // Your internal ID
|
|
120
|
+
prices: [{ amount: 9900 }],
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
// Get product by reference_id (OAT uses token's org)
|
|
124
|
+
const result = await chargefy.products.getByReferenceId('my-product-123')
|
|
125
|
+
|
|
115
126
|
// Update product
|
|
116
127
|
const result = await chargefy.products.update({
|
|
117
128
|
id: 'prod_xxx',
|
|
@@ -120,6 +131,10 @@ const result = await chargefy.products.update({
|
|
|
120
131
|
})
|
|
121
132
|
```
|
|
122
133
|
|
|
134
|
+
| Create/Update field | Type | Description |
|
|
135
|
+
|---------------------|------|-------------|
|
|
136
|
+
| `referenceId` | `string \| null` | Optional. Your internal product ID. When set on create, upserts: if a product with this `referenceId` exists for the org, it updates; else creates. Unique per org. |
|
|
137
|
+
|
|
123
138
|
---
|
|
124
139
|
|
|
125
140
|
## Checkout Links
|
|
@@ -143,14 +158,36 @@ const result = await chargefy.checkoutLinks.create({
|
|
|
143
158
|
})
|
|
144
159
|
// result.value.url → share this URL with buyers
|
|
145
160
|
|
|
161
|
+
// Create checkout link with custom price (override product's default)
|
|
162
|
+
const result = await chargefy.checkoutLinks.create({
|
|
163
|
+
organizationId: 'org_xxx',
|
|
164
|
+
productId: 'prod_xxx',
|
|
165
|
+
successUrl: 'https://mysite.com/thank-you',
|
|
166
|
+
customPriceAmount: 7900, // R$ 79,00 in cents — buyers pay this instead of product price
|
|
167
|
+
})
|
|
168
|
+
|
|
146
169
|
// Update checkout link
|
|
147
170
|
const result = await chargefy.checkoutLinks.update({
|
|
148
171
|
id: 'cl_xxx',
|
|
149
172
|
successUrl: 'https://mysite.com/new-success-page',
|
|
150
173
|
allowDiscountCodes: true,
|
|
151
174
|
})
|
|
175
|
+
|
|
176
|
+
// Update checkout link price (or clear with null)
|
|
177
|
+
const result = await chargefy.checkoutLinks.update({
|
|
178
|
+
id: 'cl_xxx',
|
|
179
|
+
customPriceAmount: 9900, // R$ 99,00 — override for this link only
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
// Get shareable URL (convenience)
|
|
183
|
+
const urlResult = await chargefy.checkoutLinks.getLink('cl_xxx')
|
|
184
|
+
// urlResult.value → full redirect URL to share with buyers
|
|
152
185
|
```
|
|
153
186
|
|
|
187
|
+
| Create/Update field | Type | Description |
|
|
188
|
+
|---------------------|------|-------------|
|
|
189
|
+
| `customPriceAmount` | `number \| null` | Optional. Price override in cents. When set, buyers pay this amount instead of the product's default. Pass `null` on update to clear. |
|
|
190
|
+
|
|
154
191
|
---
|
|
155
192
|
|
|
156
193
|
## Sub-Organizations
|
|
@@ -187,6 +224,14 @@ const result = await chargefy.subOrganizations.createProduct('org_child_xxx', {
|
|
|
187
224
|
prices: [{ amountType: 'fixed', priceAmount: 9900, priceCurrency: 'brl' }],
|
|
188
225
|
})
|
|
189
226
|
|
|
227
|
+
// Create product with referenceId (upsert for child org)
|
|
228
|
+
const result = await chargefy.subOrganizations.createProduct('org_child_xxx', {
|
|
229
|
+
feePercent: 5,
|
|
230
|
+
name: 'Child Product',
|
|
231
|
+
referenceId: 'child-prod-123',
|
|
232
|
+
prices: [{ amountType: 'fixed', priceAmount: 9900, priceCurrency: 'brl' }],
|
|
233
|
+
})
|
|
234
|
+
|
|
190
235
|
// List/create/revoke child's API keys
|
|
191
236
|
const tokens = await chargefy.subOrganizations.listApiKeys('org_child_xxx')
|
|
192
237
|
const newToken = await chargefy.subOrganizations.createApiKey('org_child_xxx', { comment: 'Marketing' })
|
|
@@ -195,6 +240,40 @@ await chargefy.subOrganizations.revokeApiKey('org_child_xxx', 'token_id')
|
|
|
195
240
|
|
|
196
241
|
---
|
|
197
242
|
|
|
243
|
+
## Sub-Organization Administration
|
|
244
|
+
|
|
245
|
+
Child organizations can manage their own products and checkout links using their **OAT** (Organization Access Token). Use the same `products` and `checkoutLinks` namespaces with the child's token:
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
// Initialize with child org's OAT (from createApiKey or parent's dashboard)
|
|
249
|
+
const childChargefy = new Chargefy({
|
|
250
|
+
accessToken: 'chargefy_oat_CHILD_TOKEN',
|
|
251
|
+
server: 'production',
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
// Child creates products (org inferred from token)
|
|
255
|
+
const product = await childChargefy.products.create({
|
|
256
|
+
organizationId: 'org_child_xxx', // Same as token's org
|
|
257
|
+
name: 'My Product',
|
|
258
|
+
referenceId: 'my-internal-id',
|
|
259
|
+
prices: [{ amount: 9900 }],
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
// Child creates checkout link with custom price
|
|
263
|
+
const link = await childChargefy.checkoutLinks.create({
|
|
264
|
+
organizationId: 'org_child_xxx',
|
|
265
|
+
productId: product.value.id,
|
|
266
|
+
successUrl: 'https://child-site.com/thanks',
|
|
267
|
+
customPriceAmount: 7900,
|
|
268
|
+
})
|
|
269
|
+
|
|
270
|
+
// Get shareable URL
|
|
271
|
+
const urlResult = await childChargefy.checkoutLinks.getLink(link.value.id)
|
|
272
|
+
console.log('Share:', urlResult.value)
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
198
277
|
## Onboarding Links
|
|
199
278
|
|
|
200
279
|
Create reusable embed onboarding links. **OAT required.**
|
package/dist/chargefy.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { type ChargefyCoreOptions } from './core';
|
|
2
|
-
import { Organizations } from './namespaces/organizations';
|
|
3
|
-
import { Products } from './namespaces/products';
|
|
4
|
-
import { CheckoutLinks } from './namespaces/checkoutLinks';
|
|
5
|
-
import { Buyers } from './namespaces/buyers';
|
|
6
|
-
import { Checkouts } from './namespaces/checkouts';
|
|
7
|
-
import { Sales } from './namespaces/sales';
|
|
8
|
-
import { Subscriptions } from './namespaces/subscriptions';
|
|
9
|
-
import { SubOrganizations } from './namespaces/sub-organizations';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { type ChargefyCoreOptions } from './core.js';
|
|
2
|
+
import { Organizations } from './namespaces/organizations.js';
|
|
3
|
+
import { Products } from './namespaces/products.js';
|
|
4
|
+
import { CheckoutLinks } from './namespaces/checkoutLinks.js';
|
|
5
|
+
import { Buyers } from './namespaces/buyers.js';
|
|
6
|
+
import { Checkouts } from './namespaces/checkouts.js';
|
|
7
|
+
import { Sales } from './namespaces/sales.js';
|
|
8
|
+
import { Subscriptions } from './namespaces/subscriptions.js';
|
|
9
|
+
import { SubOrganizations } from './namespaces/sub-organizations.js';
|
|
10
|
+
import { Webhooks } from './namespaces/webhooks.js';
|
|
11
|
+
import { EmbedOnboarding } from './namespaces/embed-onboarding.js';
|
|
12
|
+
import { OnboardingLinks } from './namespaces/onboarding-links.js';
|
|
13
|
+
import { Kyc } from './namespaces/kyc.js';
|
|
13
14
|
export type { ChargefyCoreOptions };
|
|
14
15
|
/**
|
|
15
16
|
* Chargefy SDK
|
|
@@ -43,6 +44,8 @@ export declare class Chargefy {
|
|
|
43
44
|
readonly subscriptions: Subscriptions;
|
|
44
45
|
/** Sub-organization onboarding and API key management (parent OAT required). */
|
|
45
46
|
readonly subOrganizations: SubOrganizations;
|
|
47
|
+
/** Webhook endpoint management. Create endpoints to receive events (including suborganization events). */
|
|
48
|
+
readonly webhooks: Webhooks;
|
|
46
49
|
/** Embed onboarding flow — no auth, uses link_token. */
|
|
47
50
|
readonly embedOnboarding: EmbedOnboarding;
|
|
48
51
|
/** Create onboarding links (OAT required). */
|
package/dist/chargefy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chargefy.d.ts","sourceRoot":"","sources":["../src/chargefy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"chargefy.d.ts","sourceRoot":"","sources":["../src/chargefy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAEzC,YAAY,EAAE,mBAAmB,EAAE,CAAA;AAEnC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,QAAQ;IACnB,mCAAmC;IACnC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAA;IACrC,oCAAoC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,+BAA+B;IAC/B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAA;IACrC,uBAAuB;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,kCAAkC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;IACrB,8BAA8B;IAC9B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAA;IACrC,gFAAgF;IAChF,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAA;IAC3C,0GAA0G;IAC1G,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,wDAAwD;IACxD,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAA;IACzC,8CAA8C;IAC9C,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAA;IACzC,4DAA4D;IAC5D,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;gBAEL,OAAO,GAAE,mBAAwB;CAe9C"}
|
package/dist/chargefy.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { ChargefyCore } from './core';
|
|
2
|
-
import { Organizations } from './namespaces/organizations';
|
|
3
|
-
import { Products } from './namespaces/products';
|
|
4
|
-
import { CheckoutLinks } from './namespaces/checkoutLinks';
|
|
5
|
-
import { Buyers } from './namespaces/buyers';
|
|
6
|
-
import { Checkouts } from './namespaces/checkouts';
|
|
7
|
-
import { Sales } from './namespaces/sales';
|
|
8
|
-
import { Subscriptions } from './namespaces/subscriptions';
|
|
9
|
-
import { SubOrganizations } from './namespaces/sub-organizations';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { ChargefyCore } from './core.js';
|
|
2
|
+
import { Organizations } from './namespaces/organizations.js';
|
|
3
|
+
import { Products } from './namespaces/products.js';
|
|
4
|
+
import { CheckoutLinks } from './namespaces/checkoutLinks.js';
|
|
5
|
+
import { Buyers } from './namespaces/buyers.js';
|
|
6
|
+
import { Checkouts } from './namespaces/checkouts.js';
|
|
7
|
+
import { Sales } from './namespaces/sales.js';
|
|
8
|
+
import { Subscriptions } from './namespaces/subscriptions.js';
|
|
9
|
+
import { SubOrganizations } from './namespaces/sub-organizations.js';
|
|
10
|
+
import { Webhooks } from './namespaces/webhooks.js';
|
|
11
|
+
import { EmbedOnboarding } from './namespaces/embed-onboarding.js';
|
|
12
|
+
import { OnboardingLinks } from './namespaces/onboarding-links.js';
|
|
13
|
+
import { Kyc } from './namespaces/kyc.js';
|
|
13
14
|
/**
|
|
14
15
|
* Chargefy SDK
|
|
15
16
|
*
|
|
@@ -42,6 +43,8 @@ export class Chargefy {
|
|
|
42
43
|
subscriptions;
|
|
43
44
|
/** Sub-organization onboarding and API key management (parent OAT required). */
|
|
44
45
|
subOrganizations;
|
|
46
|
+
/** Webhook endpoint management. Create endpoints to receive events (including suborganization events). */
|
|
47
|
+
webhooks;
|
|
45
48
|
/** Embed onboarding flow — no auth, uses link_token. */
|
|
46
49
|
embedOnboarding;
|
|
47
50
|
/** Create onboarding links (OAT required). */
|
|
@@ -58,6 +61,7 @@ export class Chargefy {
|
|
|
58
61
|
this.sales = new Sales(core);
|
|
59
62
|
this.subscriptions = new Subscriptions(core);
|
|
60
63
|
this.subOrganizations = new SubOrganizations(core);
|
|
64
|
+
this.webhooks = new Webhooks(core);
|
|
61
65
|
this.embedOnboarding = new EmbedOnboarding(core);
|
|
62
66
|
this.onboardingLinks = new OnboardingLinks(core);
|
|
63
67
|
this.kyc = new Kyc(core);
|
package/dist/core.d.ts
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* ChargefyCore — typed HTTP client
|
|
3
3
|
* Handles auth, base URL, timeout, and snake_case↔camelCase transformation.
|
|
4
4
|
*/
|
|
5
|
-
import type { Result } from './types/fp';
|
|
6
|
-
import { ConnectionError, RequestTimeoutError, SDKError, type UnexpectedClientError, type InvalidRequestError, type RequestAbortedError } from './models/errors/httpclienterrors';
|
|
7
|
-
import type { ResourceNotFound } from './models/errors/resourcenotfound';
|
|
8
|
-
import type { ExpiredCheckoutError } from './models/errors/expiredcheckouterror';
|
|
9
|
-
import type { HTTPValidationError } from './models/errors/httpvalidationerror';
|
|
10
|
-
import type { PaymentError } from './models/errors/paymenterror';
|
|
11
|
-
import type { NotOpenCheckout } from './models/errors/notopencheckout';
|
|
12
|
-
import type { AlreadyActiveSubscriptionError } from './models/errors/alreadyactivesubscriptionerror';
|
|
13
|
-
import type { PaymentNotReady } from './models/errors/paymentnotready';
|
|
5
|
+
import type { Result } from './types/fp.js';
|
|
6
|
+
import { ConnectionError, RequestTimeoutError, SDKError, type UnexpectedClientError, type InvalidRequestError, type RequestAbortedError } from './models/errors/httpclienterrors.js';
|
|
7
|
+
import type { ResourceNotFound } from './models/errors/resourcenotfound.js';
|
|
8
|
+
import type { ExpiredCheckoutError } from './models/errors/expiredcheckouterror.js';
|
|
9
|
+
import type { HTTPValidationError } from './models/errors/httpvalidationerror.js';
|
|
10
|
+
import type { PaymentError } from './models/errors/paymenterror.js';
|
|
11
|
+
import type { NotOpenCheckout } from './models/errors/notopencheckout.js';
|
|
12
|
+
import type { AlreadyActiveSubscriptionError } from './models/errors/alreadyactivesubscriptionerror.js';
|
|
13
|
+
import type { PaymentNotReady } from './models/errors/paymentnotready.js';
|
|
14
14
|
export interface ChargefyCoreOptions {
|
|
15
15
|
/** Organization Access Token (chargefy_oat_xxx). Required for authenticated endpoints. */
|
|
16
16
|
accessToken?: string;
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAA;AACnF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAA;AACvG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAEzE,MAAM,WAAW,mBAAmB;IAClC,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACjC,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC;AAED,MAAM,MAAM,QAAQ,GAChB,gBAAgB,GAChB,oBAAoB,GACpB,mBAAmB,GACnB,YAAY,GACZ,eAAe,GACf,8BAA8B,GAC9B,eAAe,GACf,QAAQ,GACR,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAAA;AAEnB,UAAU,cAAc;IACtB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,oFAAoF;IACpF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC,CAAA;IACpE,gDAAgD;IAChD,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAED,qBAAa,YAAY;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;gBAE5B,OAAO,GAAE,mBAAwB;IAiBvC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;CAgExE"}
|
package/dist/core.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* ChargefyCore — typed HTTP client
|
|
3
3
|
* Handles auth, base URL, timeout, and snake_case↔camelCase transformation.
|
|
4
4
|
*/
|
|
5
|
-
import { parseAPIError } from './utils/errors';
|
|
6
|
-
import { genericToCamelCase } from './utils/transformers';
|
|
7
|
-
import { ConnectionError, RequestTimeoutError, } from './models/errors/httpclienterrors';
|
|
5
|
+
import { parseAPIError } from './utils/errors.js';
|
|
6
|
+
import { genericToCamelCase } from './utils/transformers.js';
|
|
7
|
+
import { ConnectionError, RequestTimeoutError, } from './models/errors/httpclienterrors.js';
|
|
8
8
|
export class ChargefyCore {
|
|
9
9
|
serverURL;
|
|
10
10
|
accessToken;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Confirm checkout by client secret (public endpoint, no auth required)
|
|
3
3
|
*/
|
|
4
|
-
import type { ChargefyCore } from '../core';
|
|
5
|
-
import type { CheckoutPublicConfirmed } from '../models/components/checkoutpublicconfirmed';
|
|
6
|
-
import type { CheckoutConfirmCelcoin } from '../models/components/checkoutconfirmcelcoin';
|
|
7
|
-
import type { ResourceNotFound } from '../models/errors/resourcenotfound';
|
|
8
|
-
import type { ExpiredCheckoutError } from '../models/errors/expiredcheckouterror';
|
|
9
|
-
import type { HTTPValidationError } from '../models/errors/httpvalidationerror';
|
|
10
|
-
import type { NotOpenCheckout } from '../models/errors/notopencheckout';
|
|
11
|
-
import type { AlreadyActiveSubscriptionError } from '../models/errors/alreadyactivesubscriptionerror';
|
|
12
|
-
import type { PaymentError } from '../models/errors/paymenterror';
|
|
13
|
-
import { SDKError, UnexpectedClientError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, ConnectionError } from '../models/errors/httpclienterrors';
|
|
14
|
-
import type { Result } from '../types/fp';
|
|
4
|
+
import type { ChargefyCore } from '../core.js';
|
|
5
|
+
import type { CheckoutPublicConfirmed } from '../models/components/checkoutpublicconfirmed.js';
|
|
6
|
+
import type { CheckoutConfirmCelcoin } from '../models/components/checkoutconfirmcelcoin.js';
|
|
7
|
+
import type { ResourceNotFound } from '../models/errors/resourcenotfound.js';
|
|
8
|
+
import type { ExpiredCheckoutError } from '../models/errors/expiredcheckouterror.js';
|
|
9
|
+
import type { HTTPValidationError } from '../models/errors/httpvalidationerror.js';
|
|
10
|
+
import type { NotOpenCheckout } from '../models/errors/notopencheckout.js';
|
|
11
|
+
import type { AlreadyActiveSubscriptionError } from '../models/errors/alreadyactivesubscriptionerror.js';
|
|
12
|
+
import type { PaymentError } from '../models/errors/paymenterror.js';
|
|
13
|
+
import { SDKError, UnexpectedClientError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, ConnectionError } from '../models/errors/httpclienterrors.js';
|
|
14
|
+
import type { Result } from '../types/fp.js';
|
|
15
15
|
export interface CheckoutsClientConfirmRequest {
|
|
16
16
|
clientSecret: string;
|
|
17
17
|
checkoutConfirmCelcoin: CheckoutConfirmCelcoin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutsClientConfirm.d.ts","sourceRoot":"","sources":["../../src/funcs/checkoutsClientConfirm.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"checkoutsClientConfirm.d.ts","sourceRoot":"","sources":["../../src/funcs/checkoutsClientConfirm.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAA;AAC9F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAA;AAC5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AACpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAA;AACxG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EAChB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAI5C,MAAM,WAAW,6BAA6B;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,sBAAsB,EAAE,sBAAsB,CAAA;CAC/C;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,6BAA6B,GACrC,OAAO,CACR,MAAM,CACJ,uBAAuB,EACrB,8BAA8B,GAC9B,eAAe,GACf,oBAAoB,GACpB,YAAY,GACZ,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,GACR,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAmDA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Confirm checkout by client secret (public endpoint, no auth required)
|
|
3
3
|
*/
|
|
4
|
-
import { RequestTimeoutError, ConnectionError, } from '../models/errors/httpclienterrors';
|
|
5
|
-
import { parseAPIError } from '../utils/errors';
|
|
6
|
-
import { transformCheckoutToCamelCase, transformToSnakeCase } from '../utils/transformers';
|
|
4
|
+
import { RequestTimeoutError, ConnectionError, } from '../models/errors/httpclienterrors.js';
|
|
5
|
+
import { parseAPIError } from '../utils/errors.js';
|
|
6
|
+
import { transformCheckoutToCamelCase, transformToSnakeCase } from '../utils/transformers.js';
|
|
7
7
|
export async function checkoutsClientConfirm(client, request) {
|
|
8
8
|
const { clientSecret, checkoutConfirmCelcoin } = request;
|
|
9
9
|
try {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Get checkout by client secret (public endpoint, no auth required)
|
|
3
3
|
*/
|
|
4
|
-
import type { ChargefyCore } from '../core';
|
|
5
|
-
import type { CheckoutPublic } from '../models/components/checkoutpublic';
|
|
6
|
-
import type { ResourceNotFound } from '../models/errors/resourcenotfound';
|
|
7
|
-
import type { ExpiredCheckoutError } from '../models/errors/expiredcheckouterror';
|
|
8
|
-
import type { HTTPValidationError } from '../models/errors/httpvalidationerror';
|
|
9
|
-
import { SDKError, UnexpectedClientError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, ConnectionError } from '../models/errors/httpclienterrors';
|
|
10
|
-
import type { Result } from '../types/fp';
|
|
4
|
+
import type { ChargefyCore } from '../core.js';
|
|
5
|
+
import type { CheckoutPublic } from '../models/components/checkoutpublic.js';
|
|
6
|
+
import type { ResourceNotFound } from '../models/errors/resourcenotfound.js';
|
|
7
|
+
import type { ExpiredCheckoutError } from '../models/errors/expiredcheckouterror.js';
|
|
8
|
+
import type { HTTPValidationError } from '../models/errors/httpvalidationerror.js';
|
|
9
|
+
import { SDKError, UnexpectedClientError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, ConnectionError } from '../models/errors/httpclienterrors.js';
|
|
10
|
+
import type { Result } from '../types/fp.js';
|
|
11
11
|
export interface CheckoutsClientGetRequest {
|
|
12
12
|
clientSecret: string;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutsClientGet.d.ts","sourceRoot":"","sources":["../../src/funcs/checkoutsClientGet.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"checkoutsClientGet.d.ts","sourceRoot":"","sources":["../../src/funcs/checkoutsClientGet.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AACpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EAChB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAI5C,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CACR,MAAM,CACJ,cAAc,EACZ,gBAAgB,GAChB,oBAAoB,GACpB,mBAAmB,GACnB,QAAQ,GACR,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CA0CA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Get checkout by client secret (public endpoint, no auth required)
|
|
3
3
|
*/
|
|
4
|
-
import { RequestTimeoutError, ConnectionError, } from '../models/errors/httpclienterrors';
|
|
5
|
-
import { parseAPIError } from '../utils/errors';
|
|
6
|
-
import { transformCheckoutToCamelCase } from '../utils/transformers';
|
|
4
|
+
import { RequestTimeoutError, ConnectionError, } from '../models/errors/httpclienterrors.js';
|
|
5
|
+
import { parseAPIError } from '../utils/errors.js';
|
|
6
|
+
import { transformCheckoutToCamelCase } from '../utils/transformers.js';
|
|
7
7
|
export async function checkoutsClientGet(client, request) {
|
|
8
8
|
const { clientSecret } = request;
|
|
9
9
|
try {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Update checkout by client secret (public endpoint, no auth required)
|
|
3
3
|
*/
|
|
4
|
-
import type { ChargefyCore } from '../core';
|
|
5
|
-
import type { CheckoutPublic } from '../models/components/checkoutpublic';
|
|
6
|
-
import type { CheckoutUpdatePublic } from '../models/components/checkoutupdatepublic';
|
|
7
|
-
import type { ResourceNotFound } from '../models/errors/resourcenotfound';
|
|
8
|
-
import type { ExpiredCheckoutError } from '../models/errors/expiredcheckouterror';
|
|
9
|
-
import type { HTTPValidationError } from '../models/errors/httpvalidationerror';
|
|
10
|
-
import type { NotOpenCheckout } from '../models/errors/notopencheckout';
|
|
11
|
-
import type { AlreadyActiveSubscriptionError } from '../models/errors/alreadyactivesubscriptionerror';
|
|
12
|
-
import { SDKError, UnexpectedClientError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, ConnectionError } from '../models/errors/httpclienterrors';
|
|
13
|
-
import type { Result } from '../types/fp';
|
|
4
|
+
import type { ChargefyCore } from '../core.js';
|
|
5
|
+
import type { CheckoutPublic } from '../models/components/checkoutpublic.js';
|
|
6
|
+
import type { CheckoutUpdatePublic } from '../models/components/checkoutupdatepublic.js';
|
|
7
|
+
import type { ResourceNotFound } from '../models/errors/resourcenotfound.js';
|
|
8
|
+
import type { ExpiredCheckoutError } from '../models/errors/expiredcheckouterror.js';
|
|
9
|
+
import type { HTTPValidationError } from '../models/errors/httpvalidationerror.js';
|
|
10
|
+
import type { NotOpenCheckout } from '../models/errors/notopencheckout.js';
|
|
11
|
+
import type { AlreadyActiveSubscriptionError } from '../models/errors/alreadyactivesubscriptionerror.js';
|
|
12
|
+
import { SDKError, UnexpectedClientError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, ConnectionError } from '../models/errors/httpclienterrors.js';
|
|
13
|
+
import type { Result } from '../types/fp.js';
|
|
14
14
|
export interface CheckoutsClientUpdateRequest {
|
|
15
15
|
clientSecret: string;
|
|
16
16
|
checkoutUpdatePublic: CheckoutUpdatePublic;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutsClientUpdate.d.ts","sourceRoot":"","sources":["../../src/funcs/checkoutsClientUpdate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"checkoutsClientUpdate.d.ts","sourceRoot":"","sources":["../../src/funcs/checkoutsClientUpdate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAA;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AACpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAA;AACxG,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EAChB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAI5C,MAAM,WAAW,4BAA4B;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,oBAAoB,EAAE,oBAAoB,CAAA;CAC3C;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,4BAA4B,GACpC,OAAO,CACR,MAAM,CACJ,cAAc,EACZ,8BAA8B,GAC9B,eAAe,GACf,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,GACR,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CA8CA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Update checkout by client secret (public endpoint, no auth required)
|
|
3
3
|
*/
|
|
4
|
-
import { RequestTimeoutError, ConnectionError, } from '../models/errors/httpclienterrors';
|
|
5
|
-
import { parseAPIError } from '../utils/errors';
|
|
6
|
-
import { transformCheckoutToCamelCase, transformToSnakeCase } from '../utils/transformers';
|
|
4
|
+
import { RequestTimeoutError, ConnectionError, } from '../models/errors/httpclienterrors.js';
|
|
5
|
+
import { parseAPIError } from '../utils/errors.js';
|
|
6
|
+
import { transformCheckoutToCamelCase, transformToSnakeCase } from '../utils/transformers.js';
|
|
7
7
|
export async function checkoutsClientUpdate(client, request) {
|
|
8
8
|
const { clientSecret, checkoutUpdatePublic } = request;
|
|
9
9
|
try {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @chargefy/sdk — Chargefy TypeScript SDK
|
|
3
3
|
*/
|
|
4
|
-
export { Chargefy, type ChargefyCoreOptions } from './chargefy';
|
|
5
|
-
export { ChargefyCore } from './core';
|
|
6
|
-
export type { APIError } from './core';
|
|
7
|
-
export type { Result } from './types/fp';
|
|
8
|
-
export type { Organization } from './models/organization';
|
|
9
|
-
export type { Product, ProductPrice, CreateProductRequest, UpdateProductRequest, } from './models/product';
|
|
10
|
-
export type { CheckoutLink, CreateCheckoutLinkRequest, UpdateCheckoutLinkRequest, } from './models/checkoutLink';
|
|
11
|
-
export type { Buyer, BuyerListItem, BuyerListParams, CreateBuyerRequest, CreateBuyerResponse, BuyerLookupResult, } from './models/buyer';
|
|
12
|
-
export type { Checkout, CheckoutConfirmed, CheckoutProduct, InstallmentOption, CreateCheckoutRequest, UpdateCheckoutRequest, ConfirmCheckoutRequest, GeneratePixRequest, CardData, PixPaymentData, } from './models/checkout';
|
|
13
|
-
export type { ListResponse, ListParams } from './models/pagination';
|
|
14
|
-
export type { Sale, SaleListParams, SaleStatus, PaymentType, SaleCardData, SaleBoletoData, SalePixData, SaleCustomer, SaleProduct, } from './models/sale';
|
|
15
|
-
export type { Subscription, SubscriptionListParams, SubscriptionStatus, SubscriptionRecurringInterval, CustomerCancellationReason, SubscriptionProduct, SubscriptionCustomer, } from './models/subscription';
|
|
16
|
-
export type { SubOrganizationListItem, SubOrgAddress, SubOrgIndividual, SubOrgBusiness, SubOrgBankAccount, CreateSubOrganizationRequest, CreateSubOrganizationResponse, EmbedSubmitRequest, CheckExistingResponse, LinkExistingResponse, CreateProductForChildRequest, OrgAccessToken, CreateOrgAccessTokenRequest, CreateOrgAccessTokenResponse, } from './models/sub-organization';
|
|
17
|
-
export type {
|
|
18
|
-
export
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
4
|
+
export { Chargefy, type ChargefyCoreOptions } from './chargefy.js';
|
|
5
|
+
export { ChargefyCore } from './core.js';
|
|
6
|
+
export type { APIError } from './core.js';
|
|
7
|
+
export type { Result } from './types/fp.js';
|
|
8
|
+
export type { Organization } from './models/organization.js';
|
|
9
|
+
export type { Product, ProductPrice, CreateProductRequest, UpdateProductRequest, } from './models/product.js';
|
|
10
|
+
export type { CheckoutLink, CreateCheckoutLinkRequest, UpdateCheckoutLinkRequest, } from './models/checkoutLink.js';
|
|
11
|
+
export type { Buyer, BuyerListItem, BuyerListParams, CreateBuyerRequest, CreateBuyerResponse, BuyerLookupResult, } from './models/buyer.js';
|
|
12
|
+
export type { Checkout, CheckoutConfirmed, CheckoutProduct, InstallmentOption, CreateCheckoutRequest, UpdateCheckoutRequest, ConfirmCheckoutRequest, GeneratePixRequest, CardData, PixPaymentData, } from './models/checkout.js';
|
|
13
|
+
export type { ListResponse, ListParams } from './models/pagination.js';
|
|
14
|
+
export type { Sale, SaleListParams, SaleStatus, PaymentType, SaleCardData, SaleBoletoData, SalePixData, SaleCustomer, SaleProduct, } from './models/sale.js';
|
|
15
|
+
export type { Subscription, SubscriptionListParams, SubscriptionStatus, SubscriptionRecurringInterval, CustomerCancellationReason, SubscriptionProduct, SubscriptionCustomer, } from './models/subscription.js';
|
|
16
|
+
export type { SubOrganizationListItem, SubOrgAddress, SubOrgIndividual, SubOrgBusiness, SubOrgBankAccount, CreateSubOrganizationRequest, CreateSubOrganizationResponse, EmbedSubmitRequest, CheckExistingResponse, LinkExistingResponse, CreateProductForChildRequest, OrgAccessToken, CreateOrgAccessTokenRequest, CreateOrgAccessTokenResponse, } from './models/sub-organization.js';
|
|
17
|
+
export type { WebhookEndpoint, WebhookEventType, WebhookFormat, CreateWebhookEndpointRequest, UpdateWebhookEndpointRequest, WebhookEndpointListParams, WebhookDeliveryListParams, } from './models/webhook.js';
|
|
18
|
+
export { SUBORGANIZATION_EVENTS } from './models/webhook.js';
|
|
19
|
+
export type { CreateOnboardingLinkRequest, CreateOnboardingLinkResponse, } from './models/onboarding-link.js';
|
|
20
|
+
export type { KycDocumentType, KycDocumentsResponse, UploadDocumentResponse, } from './models/kyc.js';
|
|
21
|
+
export { SDKError, SDKValidationError, UnexpectedClientError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, ConnectionError, } from './models/errors/httpclienterrors.js';
|
|
22
|
+
export { HTTPValidationError, type ValidationErrorDetail } from './models/errors/httpvalidationerror.js';
|
|
23
|
+
export { ResourceNotFound } from './models/errors/resourcenotfound.js';
|
|
24
|
+
export { ExpiredCheckoutError } from './models/errors/expiredcheckouterror.js';
|
|
25
|
+
export { PaymentError } from './models/errors/paymenterror.js';
|
|
26
|
+
export { NotOpenCheckout } from './models/errors/notopencheckout.js';
|
|
27
|
+
export { AlreadyActiveSubscriptionError } from './models/errors/alreadyactivesubscriptionerror.js';
|
|
28
|
+
export { PaymentNotReady } from './models/errors/paymentnotready.js';
|
|
27
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,KAAK,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAGzC,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,YAAY,EACV,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,KAAK,EACL,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,QAAQ,EACR,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,QAAQ,EACR,cAAc,GACf,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACtE,YAAY,EACV,IAAI,EACJ,cAAc,EACd,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,GACZ,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACV,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,6BAA6B,EAC7B,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,4BAA4B,EAC5B,6BAA6B,EAC7B,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,cAAc,EACd,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,8BAA8B,CAAA;AACrC,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,YAAY,EACV,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,6BAA6B,CAAA;AACpC,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,GAChB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,KAAK,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AACxG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAA;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAA;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
* @chargefy/sdk — Chargefy TypeScript SDK
|
|
3
3
|
*/
|
|
4
4
|
// Main client
|
|
5
|
-
export { Chargefy } from './chargefy';
|
|
6
|
-
export { ChargefyCore } from './core';
|
|
5
|
+
export { Chargefy } from './chargefy.js';
|
|
6
|
+
export { ChargefyCore } from './core.js';
|
|
7
|
+
export { SUBORGANIZATION_EVENTS } from './models/webhook.js';
|
|
7
8
|
// Errors
|
|
8
|
-
export { SDKError, SDKValidationError, UnexpectedClientError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, ConnectionError, } from './models/errors/httpclienterrors';
|
|
9
|
-
export { HTTPValidationError } from './models/errors/httpvalidationerror';
|
|
10
|
-
export { ResourceNotFound } from './models/errors/resourcenotfound';
|
|
11
|
-
export { ExpiredCheckoutError } from './models/errors/expiredcheckouterror';
|
|
12
|
-
export { PaymentError } from './models/errors/paymenterror';
|
|
13
|
-
export { NotOpenCheckout } from './models/errors/notopencheckout';
|
|
14
|
-
export { AlreadyActiveSubscriptionError } from './models/errors/alreadyactivesubscriptionerror';
|
|
15
|
-
export { PaymentNotReady } from './models/errors/paymentnotready';
|
|
9
|
+
export { SDKError, SDKValidationError, UnexpectedClientError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, ConnectionError, } from './models/errors/httpclienterrors.js';
|
|
10
|
+
export { HTTPValidationError } from './models/errors/httpvalidationerror.js';
|
|
11
|
+
export { ResourceNotFound } from './models/errors/resourcenotfound.js';
|
|
12
|
+
export { ExpiredCheckoutError } from './models/errors/expiredcheckouterror.js';
|
|
13
|
+
export { PaymentError } from './models/errors/paymenterror.js';
|
|
14
|
+
export { NotOpenCheckout } from './models/errors/notopencheckout.js';
|
|
15
|
+
export { AlreadyActiveSubscriptionError } from './models/errors/alreadyactivesubscriptionerror.js';
|
|
16
|
+
export { PaymentNotReady } from './models/errors/paymentnotready.js';
|
|
@@ -9,6 +9,8 @@ export interface CheckoutLink {
|
|
|
9
9
|
allowDiscountCodes: boolean;
|
|
10
10
|
isArchived: boolean;
|
|
11
11
|
metadata?: Record<string, unknown>;
|
|
12
|
+
/** Optional price override in cents. When set, used instead of product price when buyer opens the link. */
|
|
13
|
+
customPriceAmount?: number | null;
|
|
12
14
|
createdAt: string;
|
|
13
15
|
}
|
|
14
16
|
export interface CreateCheckoutLinkRequest {
|
|
@@ -19,11 +21,15 @@ export interface CreateCheckoutLinkRequest {
|
|
|
19
21
|
successUrl?: string;
|
|
20
22
|
allowDiscountCodes?: boolean;
|
|
21
23
|
metadata?: Record<string, unknown>;
|
|
24
|
+
/** Optional price override in cents. When set, buyers pay this amount instead of the product's default price. */
|
|
25
|
+
customPriceAmount?: number | null;
|
|
22
26
|
}
|
|
23
27
|
export interface UpdateCheckoutLinkRequest {
|
|
24
28
|
id: string;
|
|
25
29
|
successUrl?: string;
|
|
26
30
|
allowDiscountCodes?: boolean;
|
|
27
31
|
metadata?: Record<string, unknown>;
|
|
32
|
+
/** Optional price override in cents. When set, buyers pay this amount instead of the product's default price. Pass null to clear. */
|
|
33
|
+
customPriceAmount?: number | null;
|
|
28
34
|
}
|
|
29
35
|
//# sourceMappingURL=checkoutLink.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutLink.d.ts","sourceRoot":"","sources":["../../src/models/checkoutLink.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,kBAAkB,EAAE,OAAO,CAAA;IAC3B,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"checkoutLink.d.ts","sourceRoot":"","sources":["../../src/models/checkoutLink.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,kBAAkB,EAAE,OAAO,CAAA;IAC3B,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,2GAA2G;IAC3G,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,iHAAiH;IACjH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,qIAAqI;IACrI,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* CheckoutConfirmCelcoin - Parameters for confirming a checkout with Celcoin
|
|
3
3
|
* This replaces Polar's CheckoutConfirmStripe
|
|
4
4
|
*/
|
|
5
|
-
import type { CheckoutUpdatePublic } from './checkoutupdatepublic';
|
|
5
|
+
import type { CheckoutUpdatePublic } from './checkoutupdatepublic.js';
|
|
6
6
|
export interface CardData {
|
|
7
7
|
number: string;
|
|
8
8
|
holderName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutconfirmcelcoin.d.ts","sourceRoot":"","sources":["../../../src/models/components/checkoutconfirmcelcoin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"checkoutconfirmcelcoin.d.ts","sourceRoot":"","sources":["../../../src/models/components/checkoutconfirmcelcoin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAErE,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAElE,cAAc,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,aAAa,CAAA;IAGjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,QAAQ,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IAGrB,eAAe,CAAC,EAAE,MAAM,CAAA;IAGxB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAG/B,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CheckoutPublicConfirmed - Confirmed checkout with customer session token
|
|
3
3
|
*/
|
|
4
|
-
import type { CheckoutPublic } from './checkoutpublic';
|
|
4
|
+
import type { CheckoutPublic } from './checkoutpublic.js';
|
|
5
5
|
export interface CheckoutPublicConfirmed extends CheckoutPublic {
|
|
6
6
|
status: 'confirmed';
|
|
7
7
|
customerSessionToken: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutpublicconfirmed.d.ts","sourceRoot":"","sources":["../../../src/models/components/checkoutpublicconfirmed.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"checkoutpublicconfirmed.d.ts","sourceRoot":"","sources":["../../../src/models/components/checkoutpublicconfirmed.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,MAAM,EAAE,WAAW,CAAA;IACnB,oBAAoB,EAAE,MAAM,CAAA;CAC7B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* CheckoutUpdatePublic - Parameters for updating a checkout
|
|
3
3
|
* Compatible with Polar's CheckoutUpdatePublic structure
|
|
4
4
|
*/
|
|
5
|
-
import type { Address } from './checkoutpublic';
|
|
5
|
+
import type { Address } from './checkoutpublic.js';
|
|
6
6
|
export interface CheckoutUpdatePublic {
|
|
7
7
|
productId?: string;
|
|
8
8
|
productPriceId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutupdatepublic.d.ts","sourceRoot":"","sources":["../../../src/models/components/checkoutupdatepublic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"checkoutupdatepublic.d.ts","sourceRoot":"","sources":["../../../src/models/components/checkoutupdatepublic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,MAAM,WAAW,oBAAoB;IAEnC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IAGf,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAG5B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAG1B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACtC"}
|