framepayments 1.0.0 → 1.0.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/README.md +41 -1
- package/dist/api/disputes-api.d.ts +11 -0
- package/dist/api/disputes-api.d.ts.map +1 -0
- package/dist/api/disputes-api.js +22 -0
- package/dist/api/disputes-api.js.map +1 -0
- package/dist/api/invoice_line_item-api.d.ts +13 -0
- package/dist/api/invoice_line_item-api.d.ts.map +1 -0
- package/dist/api/invoice_line_item-api.js +26 -0
- package/dist/api/invoice_line_item-api.js.map +1 -0
- package/dist/api/invoices-api.d.ts +13 -0
- package/dist/api/invoices-api.d.ts.map +1 -0
- package/dist/api/invoices-api.js +32 -0
- package/dist/api/invoices-api.js.map +1 -0
- package/dist/api/products-api.d.ts +14 -0
- package/dist/api/products-api.d.ts.map +1 -0
- package/dist/api/products-api.js +39 -0
- package/dist/api/products-api.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/types/charge_intents.d.ts +2 -2
- package/dist/types/customers.d.ts +1 -1
- package/dist/types/disputes.d.ts +40 -0
- package/dist/types/disputes.d.ts.map +1 -0
- package/dist/types/disputes.js +2 -0
- package/dist/types/disputes.js.map +1 -0
- package/dist/types/invoice_line_items.d.ts +28 -0
- package/dist/types/invoice_line_items.d.ts.map +1 -0
- package/dist/types/invoice_line_items.js +2 -0
- package/dist/types/invoice_line_items.js.map +1 -0
- package/dist/types/invoices.d.ts +64 -0
- package/dist/types/invoices.d.ts.map +1 -0
- package/dist/types/invoices.js +2 -0
- package/dist/types/invoices.js.map +1 -0
- package/dist/types/payment_methods.d.ts +2 -2
- package/dist/types/products.d.ts +54 -0
- package/dist/types/products.d.ts.map +1 -0
- package/dist/types/products.js +2 -0
- package/dist/types/products.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,2 +1,42 @@
|
|
|
1
1
|
# Frame-Node.js Library
|
|
2
|
-
The Frame Node.js Library simplifies the process of creating a seamless payment experience within your web app.
|
|
2
|
+
The Frame Node.js Library simplifies the process of creating a seamless payment experience within your web app. It provides direct access to the underlying APIs that drive these components, allowing you to design fully customized payment workflows tailored to your app's needs.
|
|
3
|
+
|
|
4
|
+
## 📦 Installation
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npm install framepayments
|
|
8
|
+
# or
|
|
9
|
+
yarn add framepayments
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 🤖 Usage
|
|
13
|
+
|
|
14
|
+
1. Initalize the client. You'll need your developer secret key from Frame, if you don't already have one you can sign up at https://www.framepayments.com
|
|
15
|
+
```bash
|
|
16
|
+
import { FrameSDK } from 'framepayments';
|
|
17
|
+
|
|
18
|
+
const frame = new FrameSDK({
|
|
19
|
+
apiKey: 'your_api_key_here', // replace with your secret API key
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. Access API endpoints directly using available types and dot notation. For a list of all available endpoints: https://docs.framepayments.com
|
|
24
|
+
```bash
|
|
25
|
+
const newCustomer = await frame.customers.create({
|
|
26
|
+
name: 'Alice Johnson',
|
|
27
|
+
email: 'alice@example.com',
|
|
28
|
+
});
|
|
29
|
+
console.log(newCustomer.id); // e.g. cust_abc123
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
const subscription = await frame.subscriptions.create({
|
|
34
|
+
customer: 'cust_abc123',
|
|
35
|
+
plan: 'plan_basic_monthly',
|
|
36
|
+
});
|
|
37
|
+
console.log(subscription.status); // e.g. active
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 🔒 Privacy
|
|
41
|
+
|
|
42
|
+
Our privacy policy can be found at https://framepayments.com/privacy.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { Dispute, DisputeListResponse, UpdateDisputeParams } from '../types/disputes';
|
|
3
|
+
export declare class DisputesAPI {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: AxiosInstance);
|
|
6
|
+
update(id: string, params: UpdateDisputeParams): Promise<Dispute>;
|
|
7
|
+
get(id: string): Promise<Dispute>;
|
|
8
|
+
list(per_page?: number, page?: number, charge?: string, charge_intent?: string): Promise<DisputeListResponse>;
|
|
9
|
+
close(id: string): Promise<Dispute>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=disputes-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disputes-api.d.ts","sourceRoot":"","sources":["../../src/api/disputes-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAKjE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKjC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAK7G,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAI1C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class DisputesAPI {
|
|
2
|
+
constructor(client) {
|
|
3
|
+
this.client = client;
|
|
4
|
+
}
|
|
5
|
+
async update(id, params) {
|
|
6
|
+
const resp = await this.client.post(`/v1/disputes/${id}`, params);
|
|
7
|
+
return resp.data;
|
|
8
|
+
}
|
|
9
|
+
async get(id) {
|
|
10
|
+
const resp = await this.client.get(`/v1/disputes/${id}`);
|
|
11
|
+
return resp.data;
|
|
12
|
+
}
|
|
13
|
+
async list(per_page, page, charge, charge_intent) {
|
|
14
|
+
const resp = await this.client.get('/v1/disputes', { params: { per_page, page, charge, charge_intent } });
|
|
15
|
+
return resp.data;
|
|
16
|
+
}
|
|
17
|
+
async close(id) {
|
|
18
|
+
const resp = await this.client.post(`/v1/disputes/${id}/close`);
|
|
19
|
+
return resp.data;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=disputes-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disputes-api.js","sourceRoot":"","sources":["../../src/api/disputes-api.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,WAAW;IACtB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,MAA2B;QAClD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAiB,EAAE,IAAa,EAAE,MAAe,EAAE,aAAsB;QAClF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC;QAC1G,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,EAAU;QACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { InvoiceLineItem, InvoiceLineItemListResponse, CreateInvoiceLineItemParams, UpdateInvoiceLineItemParams } from '../types/invoice_line_items';
|
|
3
|
+
import type { DeleteInvoiceResponse } from '../types/invoices';
|
|
4
|
+
export declare class InvoiceLineItemsAPI {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(client: AxiosInstance);
|
|
7
|
+
list(invoiceId: string): Promise<InvoiceLineItemListResponse>;
|
|
8
|
+
create(invoiceId: string, params: CreateInvoiceLineItemParams): Promise<InvoiceLineItem>;
|
|
9
|
+
update(invoiceId: string, lineItemId: string, params: UpdateInvoiceLineItemParams): Promise<InvoiceLineItem>;
|
|
10
|
+
get(invoiceId: string, lineItemId: string): Promise<InvoiceLineItem>;
|
|
11
|
+
delete(invoiceId: string, lineItemId: string): Promise<DeleteInvoiceResponse>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=invoice_line_item-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice_line_item-api.d.ts","sourceRoot":"","sources":["../../src/api/invoice_line_item-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,eAAe,EACf,2BAA2B,EAC3B,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACR,qBAAqB,EACxB,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,mBAAmB;IAClB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAK7D,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,eAAe,CAAC;IAKxF,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,eAAe,CAAC;IAK5G,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAKpE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAIpF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export class InvoiceLineItemsAPI {
|
|
2
|
+
constructor(client) {
|
|
3
|
+
this.client = client;
|
|
4
|
+
}
|
|
5
|
+
async list(invoiceId) {
|
|
6
|
+
const resp = await this.client.get(`/v1/invoices/${invoiceId}/line_items`);
|
|
7
|
+
return resp.data;
|
|
8
|
+
}
|
|
9
|
+
async create(invoiceId, params) {
|
|
10
|
+
const resp = await this.client.post(`/v1/invoices/${invoiceId}/line_items`, params);
|
|
11
|
+
return resp.data;
|
|
12
|
+
}
|
|
13
|
+
async update(invoiceId, lineItemId, params) {
|
|
14
|
+
const resp = await this.client.patch(`/v1/invoices/${invoiceId}/line_items/${lineItemId}`, params);
|
|
15
|
+
return resp.data;
|
|
16
|
+
}
|
|
17
|
+
async get(invoiceId, lineItemId) {
|
|
18
|
+
const resp = await this.client.get(`/v1/invoices/${invoiceId}/line_items/${lineItemId}`);
|
|
19
|
+
return resp.data;
|
|
20
|
+
}
|
|
21
|
+
async delete(invoiceId, lineItemId) {
|
|
22
|
+
const resp = await this.client.delete(`/v1/invoices/${invoiceId}/line_items/${lineItemId}`);
|
|
23
|
+
return resp.data;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=invoice_line_item-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice_line_item-api.js","sourceRoot":"","sources":["../../src/api/invoice_line_item-api.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,mBAAmB;IAC9B,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,IAAI,CAAC,SAAiB;QAC1B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,SAAS,aAAa,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAiB,EAAE,MAAmC;QACjE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,SAAS,aAAa,EAAE,MAAM,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAiB,EAAE,UAAkB,EAAE,MAAmC;QACrF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,SAAS,eAAe,UAAU,EAAE,EAAE,MAAM,CAAC,CAAC;QACnG,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,SAAiB,EAAE,UAAkB;QAC7C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,SAAS,eAAe,UAAU,EAAE,CAAC,CAAC;QACzF,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAiB,EAAE,UAAkB;QAChD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,SAAS,eAAe,UAAU,EAAE,CAAC,CAAC;QAC5F,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { Invoice, InvoiceListResponse, CreateInvoiceParams, UpdateInvoiceParams, DeleteInvoiceResponse } from '../types/invoices';
|
|
3
|
+
export declare class InvoicesAPI {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: AxiosInstance);
|
|
6
|
+
create(params: CreateInvoiceParams): Promise<Invoice>;
|
|
7
|
+
update(id: string, params: UpdateInvoiceParams): Promise<Invoice>;
|
|
8
|
+
get(id: string): Promise<Invoice>;
|
|
9
|
+
list(per_page?: number, page?: number, customer?: string, status?: string): Promise<InvoiceListResponse>;
|
|
10
|
+
delete(id: string): Promise<DeleteInvoiceResponse>;
|
|
11
|
+
issue(id: string): Promise<Invoice>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=invoices-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices-api.d.ts","sourceRoot":"","sources":["../../src/api/invoices-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACR,OAAO,EACP,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACxB,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAKrD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAKjE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKjC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAOxG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAKlD,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAI1C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class InvoicesAPI {
|
|
2
|
+
constructor(client) {
|
|
3
|
+
this.client = client;
|
|
4
|
+
}
|
|
5
|
+
async create(params) {
|
|
6
|
+
const resp = await this.client.post('/v1/invoices', params);
|
|
7
|
+
return resp.data;
|
|
8
|
+
}
|
|
9
|
+
async update(id, params) {
|
|
10
|
+
const resp = await this.client.patch(`/v1/invoices/${id}`, params);
|
|
11
|
+
return resp.data;
|
|
12
|
+
}
|
|
13
|
+
async get(id) {
|
|
14
|
+
const resp = await this.client.get(`/v1/invoices/${id}`);
|
|
15
|
+
return resp.data;
|
|
16
|
+
}
|
|
17
|
+
async list(per_page, page, customer, status) {
|
|
18
|
+
const resp = await this.client.get('/v1/invoices', {
|
|
19
|
+
params: { per_page, page, customer, status }
|
|
20
|
+
});
|
|
21
|
+
return resp.data;
|
|
22
|
+
}
|
|
23
|
+
async delete(id) {
|
|
24
|
+
const resp = await this.client.delete(`/v1/invoices/${id}`);
|
|
25
|
+
return resp.data;
|
|
26
|
+
}
|
|
27
|
+
async issue(id) {
|
|
28
|
+
const resp = await this.client.post(`/v1/invoices/${id}/issue`);
|
|
29
|
+
return resp.data;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=invoices-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices-api.js","sourceRoot":"","sources":["../../src/api/invoices-api.ts"],"names":[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IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { Product, ProductListResponse, CreateProductParams, UpdateProductParams, SearchProductParams, DeletedProduct } from '../types/products';
|
|
3
|
+
export declare class ProductsAPI {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: AxiosInstance);
|
|
6
|
+
create(params: CreateProductParams): Promise<Product>;
|
|
7
|
+
update(id: string, params: UpdateProductParams): Promise<Product>;
|
|
8
|
+
get(id: string): Promise<Product>;
|
|
9
|
+
list(per_page?: number, page?: number): Promise<ProductListResponse>;
|
|
10
|
+
iterateAllProducts(per_page?: number): Promise<AsyncGenerator<Product, any, any>>;
|
|
11
|
+
search(params: SearchProductParams): Promise<ProductListResponse>;
|
|
12
|
+
delete(id: string): Promise<DeletedProduct>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=products-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products-api.d.ts","sourceRoot":"","sources":["../../src/api/products-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGrJ,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAKrD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAKjE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKjC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAKpE,kBAAkB,CAAC,QAAQ,SAAK;IAShC,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAKjE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;CAIlD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { paginate } from '../utils/paginator';
|
|
2
|
+
export class ProductsAPI {
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
async create(params) {
|
|
7
|
+
const resp = await this.client.post('/v1/products', params);
|
|
8
|
+
return resp.data;
|
|
9
|
+
}
|
|
10
|
+
async update(id, params) {
|
|
11
|
+
const resp = await this.client.patch(`/v1/products/${id}`, params);
|
|
12
|
+
return resp.data;
|
|
13
|
+
}
|
|
14
|
+
async get(id) {
|
|
15
|
+
const resp = await this.client.get(`/v1/products/${id}`);
|
|
16
|
+
return resp.data;
|
|
17
|
+
}
|
|
18
|
+
async list(per_page, page) {
|
|
19
|
+
const resp = await this.client.get('/v1/products', { params: { per_page, page } });
|
|
20
|
+
return resp.data;
|
|
21
|
+
}
|
|
22
|
+
async iterateAllProducts(per_page = 20) {
|
|
23
|
+
return paginate(async (page) => {
|
|
24
|
+
const res = await this.client.get('/v1/products', {
|
|
25
|
+
params: { per_page, page }
|
|
26
|
+
});
|
|
27
|
+
return res.data;
|
|
28
|
+
}, per_page);
|
|
29
|
+
}
|
|
30
|
+
async search(params) {
|
|
31
|
+
const resp = await this.client.get('/v1/products/search', { params });
|
|
32
|
+
return resp.data;
|
|
33
|
+
}
|
|
34
|
+
async delete(id) {
|
|
35
|
+
const resp = await this.client.delete(`/v1/products/${id}`);
|
|
36
|
+
return resp.data;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=products-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products-api.js","sourceRoot":"","sources":["../../src/api/products-api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,OAAO,WAAW;IACtB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,MAAM,CAAC,MAA2B;QACtC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,MAA2B;QAClD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAiB,EAAE,IAAa;QACzC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACnF,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,QAAQ,GAAG,EAAE;QACpC,OAAO,QAAQ,CAAU,KAAK,EAAE,IAAY,EAAE,EAAE;YAC9C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE;gBAChD,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;aAC3B,CAAC,CAAC;YACH,OAAO,GAAG,CAAC,IAAI,CAAC;QAClB,CAAC,EAAE,QAAQ,CAAC,CAAC;IACf,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAA2B;QACtC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACtE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ import { RefundsAPI } from './api/refunds-api';
|
|
|
6
6
|
import { SubscriptionsAPI } from './api/subscriptions-api';
|
|
7
7
|
import { CustomerIdentityVerificationsAPI } from './api/customer_identity-api';
|
|
8
8
|
import { SubscriptionPhasesAPI } from './api/subscription_phases-api';
|
|
9
|
+
import { InvoicesAPI } from './api/invoices-api';
|
|
10
|
+
import { InvoiceLineItemsAPI } from './api/invoice_line_item-api';
|
|
11
|
+
import { DisputesAPI } from './api/disputes-api';
|
|
12
|
+
import { ProductsAPI } from './api/products-api';
|
|
9
13
|
export { paginate } from './utils/paginator';
|
|
10
14
|
export { FrameAPIError } from './errors/frame_api_error';
|
|
11
15
|
export declare class FrameSDK {
|
|
@@ -16,6 +20,10 @@ export declare class FrameSDK {
|
|
|
16
20
|
subscriptions: SubscriptionsAPI;
|
|
17
21
|
customerIdentityVerifications: CustomerIdentityVerificationsAPI;
|
|
18
22
|
subscriptionPhases: SubscriptionPhasesAPI;
|
|
23
|
+
invoices: InvoicesAPI;
|
|
24
|
+
invoiceLineItems: InvoiceLineItemsAPI;
|
|
25
|
+
disputes: DisputesAPI;
|
|
26
|
+
products: ProductsAPI;
|
|
19
27
|
constructor(config: ClientConfig);
|
|
20
28
|
}
|
|
21
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,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAExD,qBAAa,QAAQ;IACZ,SAAS,EAAE,YAAY,CAAC;IACxB,cAAc,EAAE,iBAAiB,CAAC;IAClC,aAAa,EAAE,gBAAgB,CAAC;IAChC,OAAO,EAAE,UAAU,CAAC;IACpB,aAAa,EAAE,gBAAgB,CAAC;IAChC,6BAA6B,EAAE,gCAAgC,CAAC;IAChE,kBAAkB,EAAE,qBAAqB,CAAC;IAC1C,QAAQ,EAAE,WAAW,CAAC;IACtB,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,WAAW,CAAC;gBAEjB,MAAM,EAAE,YAAY;CAcjC"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,10 @@ import { RefundsAPI } from './api/refunds-api';
|
|
|
6
6
|
import { SubscriptionsAPI } from './api/subscriptions-api';
|
|
7
7
|
import { CustomerIdentityVerificationsAPI } from './api/customer_identity-api';
|
|
8
8
|
import { SubscriptionPhasesAPI } from './api/subscription_phases-api';
|
|
9
|
+
import { InvoicesAPI } from './api/invoices-api';
|
|
10
|
+
import { InvoiceLineItemsAPI } from './api/invoice_line_item-api';
|
|
11
|
+
import { DisputesAPI } from './api/disputes-api';
|
|
12
|
+
import { ProductsAPI } from './api/products-api';
|
|
9
13
|
export { paginate } from './utils/paginator';
|
|
10
14
|
export { FrameAPIError } from './errors/frame_api_error';
|
|
11
15
|
export class FrameSDK {
|
|
@@ -18,6 +22,10 @@ export class FrameSDK {
|
|
|
18
22
|
this.subscriptions = new SubscriptionsAPI(client);
|
|
19
23
|
this.customerIdentityVerifications = new CustomerIdentityVerificationsAPI(client);
|
|
20
24
|
this.subscriptionPhases = new SubscriptionPhasesAPI(client);
|
|
25
|
+
this.invoices = new InvoicesAPI(client);
|
|
26
|
+
this.invoiceLineItems = new InvoiceLineItemsAPI(client);
|
|
27
|
+
this.disputes = new DisputesAPI(client);
|
|
28
|
+
this.products = new ProductsAPI(client);
|
|
21
29
|
}
|
|
22
30
|
}
|
|
23
31
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAqB,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAqB,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,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M,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -45,7 +45,7 @@ export interface CreateChargeIntentParams {
|
|
|
45
45
|
confirm?: boolean;
|
|
46
46
|
receipt_email?: string;
|
|
47
47
|
metadata?: Record<string, any>;
|
|
48
|
-
authorization_mode:
|
|
48
|
+
authorization_mode: 'automatic' | 'manual';
|
|
49
49
|
customer_data?: CustomerDataParams;
|
|
50
50
|
payment_method_data?: PaymentMethodDataParams;
|
|
51
51
|
}
|
|
@@ -56,7 +56,7 @@ export interface CustomerDataParams {
|
|
|
56
56
|
export interface PaymentMethodDataParams {
|
|
57
57
|
attach: boolean;
|
|
58
58
|
billing?: Address;
|
|
59
|
-
type:
|
|
59
|
+
type: 'card';
|
|
60
60
|
card_number: string;
|
|
61
61
|
exp_month: string;
|
|
62
62
|
exp_year: string;
|
|
@@ -19,7 +19,7 @@ export interface Customer {
|
|
|
19
19
|
date_of_birth?: string | null;
|
|
20
20
|
billing_address?: Address | null;
|
|
21
21
|
shipping_address?: Address | null;
|
|
22
|
-
status:
|
|
22
|
+
status: 'active' | 'blocked';
|
|
23
23
|
payment_methods: PaymentMethod[];
|
|
24
24
|
metadata: Record<string, any>;
|
|
25
25
|
object: string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type DisputeReason = 'bank_cannot_process' | 'check_returned' | 'credit_not_processed' | 'customer_initiated' | 'debit_not_authorized' | 'duplicate' | 'fraudulent' | 'general' | 'incorrect_account_details' | 'insufficient_funds' | 'product_not_received' | 'product_unacceptable' | 'subscription_canceled' | 'unrecognized';
|
|
2
|
+
export type DisputeStatus = 'warning_needs_response' | 'warning_under_review' | 'warning_closed' | 'needs_response' | 'under_review' | 'won' | 'lost';
|
|
3
|
+
export interface DisputeEvidence {
|
|
4
|
+
access_activity_log?: string;
|
|
5
|
+
billing_address?: string;
|
|
6
|
+
cancellation_policy?: string;
|
|
7
|
+
cancellation_policy_disclosure?: string;
|
|
8
|
+
cancellation_rebuttal?: string;
|
|
9
|
+
customer_email_address?: string;
|
|
10
|
+
customer_name?: string;
|
|
11
|
+
customer_purchase_ip?: string;
|
|
12
|
+
duplicate_charge_explanation?: string;
|
|
13
|
+
duplicate_charge_id?: string;
|
|
14
|
+
product_description?: string;
|
|
15
|
+
refund_policy_disclosure?: string;
|
|
16
|
+
shipping_tracking_number?: string;
|
|
17
|
+
uncategorized_text?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface Dispute {
|
|
20
|
+
id: string;
|
|
21
|
+
object: string;
|
|
22
|
+
amount: number;
|
|
23
|
+
charge?: string | null;
|
|
24
|
+
currency: string;
|
|
25
|
+
evidence: DisputeEvidence;
|
|
26
|
+
charge_intent?: string | null;
|
|
27
|
+
reason: DisputeReason;
|
|
28
|
+
status: DisputeStatus;
|
|
29
|
+
livemode: boolean;
|
|
30
|
+
created: number;
|
|
31
|
+
updated: number;
|
|
32
|
+
}
|
|
33
|
+
export interface DisputeListResponse {
|
|
34
|
+
data: Dispute[];
|
|
35
|
+
}
|
|
36
|
+
export interface UpdateDisputeParams {
|
|
37
|
+
evidence?: DisputeEvidence;
|
|
38
|
+
submit?: boolean;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=disputes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disputes.d.ts","sourceRoot":"","sources":["../../src/types/disputes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,qBAAqB,GAAG,gBAAgB,GAAG,sBAAsB,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,2BAA2B,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,uBAAuB,GAAG,cAAc,CAAC;AAEzU,MAAM,MAAM,aAAa,GAAG,wBAAwB,GAAG,sBAAsB,GAAG,gBAAgB,GAAG,gBAAgB,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0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disputes.js","sourceRoot":"","sources":["../../src/types/disputes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface InvoiceLineItem {
|
|
2
|
+
object: string;
|
|
3
|
+
id: string;
|
|
4
|
+
quantity: number;
|
|
5
|
+
description: string;
|
|
6
|
+
unit_amount_cents?: number;
|
|
7
|
+
unit_amount_currency?: number;
|
|
8
|
+
created?: number;
|
|
9
|
+
updated?: number;
|
|
10
|
+
product?: {
|
|
11
|
+
object: string;
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
price: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface InvoiceLineItemListResponse {
|
|
18
|
+
data: InvoiceLineItem[];
|
|
19
|
+
}
|
|
20
|
+
export interface CreateInvoiceLineItemParams {
|
|
21
|
+
product: string;
|
|
22
|
+
quantity: number;
|
|
23
|
+
}
|
|
24
|
+
export interface UpdateInvoiceLineItemParams {
|
|
25
|
+
product?: string;
|
|
26
|
+
quantity?: number;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=invoice_line_items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice_line_items.d.ts","sourceRoot":"","sources":["../../src/types/invoice_line_items.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,eAAe,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice_line_items.js","sourceRoot":"","sources":["../../src/types/invoice_line_items.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { InvoiceLineItem } from "./invoice_line_items";
|
|
2
|
+
export type InvoiceStatus = 'draft' | 'outstanding' | 'due' | 'overdue' | 'paid' | 'written_off' | 'voided';
|
|
3
|
+
export type CollectionMethod = 'auto_charge' | 'request_payment';
|
|
4
|
+
export interface CustomerRef {
|
|
5
|
+
object: string;
|
|
6
|
+
id: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Invoice {
|
|
10
|
+
id: string;
|
|
11
|
+
customer: CustomerRef;
|
|
12
|
+
object: string;
|
|
13
|
+
total: number;
|
|
14
|
+
currency: string;
|
|
15
|
+
status: InvoiceStatus;
|
|
16
|
+
collection_method: CollectionMethod;
|
|
17
|
+
net_terms: number;
|
|
18
|
+
invoice_number?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
memo?: string;
|
|
21
|
+
livemode: boolean;
|
|
22
|
+
metadata?: Record<string, any>;
|
|
23
|
+
line_items: InvoiceLineItem[];
|
|
24
|
+
created: number;
|
|
25
|
+
updated: number;
|
|
26
|
+
}
|
|
27
|
+
export interface InvoiceListResponse {
|
|
28
|
+
data: Invoice[];
|
|
29
|
+
meta?: {
|
|
30
|
+
page?: number;
|
|
31
|
+
has_more?: boolean;
|
|
32
|
+
url?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface DeleteInvoiceResponse {
|
|
36
|
+
object: string;
|
|
37
|
+
deleted: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface CreateInvoiceParams {
|
|
40
|
+
customer: string;
|
|
41
|
+
collection_method: CollectionMethod;
|
|
42
|
+
net_terms?: number;
|
|
43
|
+
number?: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
memo?: string;
|
|
46
|
+
metadata?: Record<string, any>;
|
|
47
|
+
line_items?: Array<{
|
|
48
|
+
product: string;
|
|
49
|
+
quantity: number;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
export interface UpdateInvoiceParams {
|
|
53
|
+
collection_method?: CollectionMethod;
|
|
54
|
+
net_terms?: number;
|
|
55
|
+
number?: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
memo?: string;
|
|
58
|
+
metadata?: Record<string, any>;
|
|
59
|
+
line_items?: Array<{
|
|
60
|
+
product: string;
|
|
61
|
+
quantity: number;
|
|
62
|
+
}>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=invoices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../../src/types/invoices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,aAAa,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,aAAa,GAAG,QAAQ,CAAC;AAE5G,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,OAAO;I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,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,KAAK,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../src/types/invoices.ts"],"names":[],"mappings":""}
|
|
@@ -18,7 +18,7 @@ export interface PaymentMethod {
|
|
|
18
18
|
livemode: Boolean;
|
|
19
19
|
created: number;
|
|
20
20
|
updated: number;
|
|
21
|
-
status:
|
|
21
|
+
status: 'active' | 'blocked';
|
|
22
22
|
card: PaymentCard;
|
|
23
23
|
}
|
|
24
24
|
export interface PaymentMethodListResponse {
|
|
@@ -32,7 +32,7 @@ export interface PaymentMethodListResponse {
|
|
|
32
32
|
export interface CreatePaymentMethodParams {
|
|
33
33
|
customer?: string;
|
|
34
34
|
billing?: Address;
|
|
35
|
-
type:
|
|
35
|
+
type: 'card' | 'ach';
|
|
36
36
|
card_number: string;
|
|
37
37
|
exp_month: string;
|
|
38
38
|
exp_year: string;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface Product {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
livemode: boolean;
|
|
5
|
+
image: string | null;
|
|
6
|
+
description: string;
|
|
7
|
+
url: string | null;
|
|
8
|
+
shippable: boolean;
|
|
9
|
+
active: boolean;
|
|
10
|
+
default_price: number;
|
|
11
|
+
metadata: Record<string, string>;
|
|
12
|
+
created: number;
|
|
13
|
+
updated: number;
|
|
14
|
+
object: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DeletedProduct {
|
|
17
|
+
id: string;
|
|
18
|
+
object: string;
|
|
19
|
+
deleted: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface ProductListResponse {
|
|
22
|
+
meta: {
|
|
23
|
+
page: number;
|
|
24
|
+
url: string;
|
|
25
|
+
has_more: boolean;
|
|
26
|
+
};
|
|
27
|
+
data: Product[];
|
|
28
|
+
}
|
|
29
|
+
export type ProductRecurringInterval = 'daily' | 'weekly' | 'monthly' | 'yearly' | 'every_3_months' | 'every_6_months';
|
|
30
|
+
export type ProductPurchaseType = 'one_time' | 'recurring';
|
|
31
|
+
export interface CreateProductParams {
|
|
32
|
+
name: string;
|
|
33
|
+
description: string;
|
|
34
|
+
default_price: number;
|
|
35
|
+
purchase_type: ProductPurchaseType;
|
|
36
|
+
recurring_interval?: ProductRecurringInterval | null;
|
|
37
|
+
shippable?: boolean | null;
|
|
38
|
+
url?: string | null;
|
|
39
|
+
metadata?: Record<string, string> | null;
|
|
40
|
+
}
|
|
41
|
+
export interface UpdateProductParams {
|
|
42
|
+
name?: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
default_price?: number;
|
|
45
|
+
shippable?: boolean;
|
|
46
|
+
url?: string;
|
|
47
|
+
metadata?: Record<string, string>;
|
|
48
|
+
}
|
|
49
|
+
export interface SearchProductParams {
|
|
50
|
+
name?: string;
|
|
51
|
+
active?: boolean;
|
|
52
|
+
shippable?: boolean;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=products.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/types/products.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,O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AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../src/types/products.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "framepayments",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "The Frame Node.js Library simplifies the process of creating a seamless payment experience within your web app. it provides access to the underlying APIs that drive these components, allowing you to design fully customized payment workflows tailored to your app's needs.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|