glitch-javascript-sdk 2.6.9 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Communities.d.ts +21 -0
- package/dist/esm/index.js +37 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +21 -0
- package/package.json +1 -1
- package/src/api/Communities.ts +31 -5
- package/src/api/Subscriptions.ts +1 -0
- package/src/routes/CommunitiesRoute.ts +17 -4
package/dist/index.d.ts
CHANGED
|
@@ -1796,6 +1796,27 @@ declare class Communities {
|
|
|
1796
1796
|
amount: number;
|
|
1797
1797
|
description: string;
|
|
1798
1798
|
}, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1799
|
+
/**
|
|
1800
|
+
* Get a detailed breakdown of a specific invoice including per-title usage.
|
|
1801
|
+
*
|
|
1802
|
+
* @param community_id The ID of the community.
|
|
1803
|
+
* @param invoice_id The Stripe Invoice ID (e.g., in_123...).
|
|
1804
|
+
*/
|
|
1805
|
+
static getInvoiceDetails<T>(community_id: string, invoice_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1806
|
+
/**
|
|
1807
|
+
* Generate a custom date-range statement for reimbursement.
|
|
1808
|
+
*
|
|
1809
|
+
* @param community_id The ID of the community.
|
|
1810
|
+
* @param params Should include { start_date: 'YYYY-MM-DD', end_date: 'YYYY-MM-DD' }
|
|
1811
|
+
*/
|
|
1812
|
+
static getCustomStatement<T>(community_id: string, params: {
|
|
1813
|
+
start_date: string;
|
|
1814
|
+
end_date: string;
|
|
1815
|
+
}): AxiosPromise<Response<T>>;
|
|
1816
|
+
/**
|
|
1817
|
+
* List all Stripe invoices for the community.
|
|
1818
|
+
*/
|
|
1819
|
+
static listInvoices<T>(community_id: string): AxiosPromise<Response<T>>;
|
|
1799
1820
|
}
|
|
1800
1821
|
|
|
1801
1822
|
declare class Users {
|
package/package.json
CHANGED
package/src/api/Communities.ts
CHANGED
|
@@ -929,16 +929,42 @@ class Communities {
|
|
|
929
929
|
return Requests.processRoute(CommunitiesRoute.routes.deleteInvite, {}, { community_id: community_id, invite_id: invite_id }, params);
|
|
930
930
|
}
|
|
931
931
|
|
|
932
|
-
|
|
933
|
-
|
|
932
|
+
/**
|
|
933
|
+
* Create a one-time immediate invoice for a business account.
|
|
934
|
+
*
|
|
935
|
+
* @param community_id The ID of the community.
|
|
936
|
+
* @param data { amount: number, description: string }
|
|
937
|
+
*/
|
|
938
|
+
public static createOneTimeInvoice<T>(community_id: string, data: { amount: number, description: string }, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
939
|
+
return Requests.processRoute(CommunitiesRoute.routes.createOneTimeInvoice, data, { community_id }, params);
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Get a detailed breakdown of a specific invoice including per-title usage.
|
|
934
944
|
*
|
|
935
945
|
* @param community_id The ID of the community.
|
|
936
|
-
* @param
|
|
946
|
+
* @param invoice_id The Stripe Invoice ID (e.g., in_123...).
|
|
937
947
|
*/
|
|
938
|
-
public static
|
|
939
|
-
return Requests.processRoute(CommunitiesRoute.routes.
|
|
948
|
+
public static getInvoiceDetails<T>(community_id: string, invoice_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
949
|
+
return Requests.processRoute(CommunitiesRoute.routes.getInvoiceDetails, undefined, { community_id, invoice_id }, params);
|
|
940
950
|
}
|
|
941
951
|
|
|
952
|
+
/**
|
|
953
|
+
* Generate a custom date-range statement for reimbursement.
|
|
954
|
+
*
|
|
955
|
+
* @param community_id The ID of the community.
|
|
956
|
+
* @param params Should include { start_date: 'YYYY-MM-DD', end_date: 'YYYY-MM-DD' }
|
|
957
|
+
*/
|
|
958
|
+
public static getCustomStatement<T>(community_id: string, params: { start_date: string, end_date: string }): AxiosPromise<Response<T>> {
|
|
959
|
+
return Requests.processRoute(CommunitiesRoute.routes.getCustomStatement, undefined, { community_id }, params);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* List all Stripe invoices for the community.
|
|
964
|
+
*/
|
|
965
|
+
public static listInvoices<T>(community_id: string): AxiosPromise<Response<T>> {
|
|
966
|
+
return Requests.processRoute(CommunitiesRoute.routes.listInvoices, undefined, { community_id });
|
|
967
|
+
}
|
|
942
968
|
|
|
943
969
|
}
|
|
944
970
|
|
package/src/api/Subscriptions.ts
CHANGED
|
@@ -94,11 +94,24 @@ class CommunitiesRoute {
|
|
|
94
94
|
// Subscriber registration (open route)
|
|
95
95
|
registerNewsletterSubscriber: { url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers', method: HTTP_METHODS.POST },
|
|
96
96
|
|
|
97
|
-
createOneTimeInvoice: {
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
createOneTimeInvoice: {
|
|
98
|
+
url: '/communities/{community_id}/invoice-once',
|
|
99
|
+
method: HTTP_METHODS.POST
|
|
100
|
+
},
|
|
101
|
+
// New Invoicing and Statement Routes
|
|
102
|
+
listInvoices: {
|
|
103
|
+
url: '/communities/{community_id}/payment/invoices',
|
|
104
|
+
method: HTTP_METHODS.GET
|
|
105
|
+
},
|
|
106
|
+
getInvoiceDetails: {
|
|
107
|
+
url: '/communities/{community_id}/payment/invoices/{invoice_id}',
|
|
108
|
+
method: HTTP_METHODS.GET
|
|
100
109
|
},
|
|
101
|
-
|
|
110
|
+
getCustomStatement: {
|
|
111
|
+
url: '/communities/{community_id}/payment/statement',
|
|
112
|
+
method: HTTP_METHODS.GET
|
|
113
|
+
},
|
|
114
|
+
|
|
102
115
|
};
|
|
103
116
|
|
|
104
117
|
|