@amos.com/node 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +64 -11
- package/dist/index.d.ts +64 -11
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/openapi/schema.ts +58 -5
- package/package.json +1 -1
- package/src/index.ts +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -950,7 +950,8 @@ interface paths {
|
|
|
950
950
|
};
|
|
951
951
|
/** Retrieve a subscription by ID */
|
|
952
952
|
get: operations["GetSubscription"];
|
|
953
|
-
|
|
953
|
+
/** Update a subscription by ID */
|
|
954
|
+
put: operations["UpdateSubscription"];
|
|
954
955
|
post?: never;
|
|
955
956
|
delete?: never;
|
|
956
957
|
options?: never;
|
|
@@ -1561,7 +1562,7 @@ interface components {
|
|
|
1561
1562
|
bank_account_number?: string;
|
|
1562
1563
|
bank_routing_number?: string;
|
|
1563
1564
|
/** @enum {string} */
|
|
1564
|
-
business_category?: "
|
|
1565
|
+
business_category?: "business_association" | "charity" | "church" | "county" | "federal" | "fraternal_org" | "government" | "higher_education" | "k12" | "labor_union" | "local" | "ministry" | "pac" | "parachurch" | "party" | "preschool" | "social_club" | "social_welfare" | "state" | "tribal" | "vendor" | "veterans_org";
|
|
1565
1566
|
business_description?: string;
|
|
1566
1567
|
city?: string;
|
|
1567
1568
|
country_code?: string;
|
|
@@ -1588,7 +1589,7 @@ interface components {
|
|
|
1588
1589
|
id?: string;
|
|
1589
1590
|
annual_credit_card_sales_volume?: number;
|
|
1590
1591
|
/** @enum {string} */
|
|
1591
|
-
business_category?: "
|
|
1592
|
+
business_category?: "business_association" | "charity" | "church" | "county" | "federal" | "fraternal_org" | "government" | "higher_education" | "k12" | "labor_union" | "local" | "ministry" | "pac" | "parachurch" | "party" | "preschool" | "social_club" | "social_welfare" | "state" | "tribal" | "vendor" | "veterans_org";
|
|
1592
1593
|
business_description?: string;
|
|
1593
1594
|
city?: string;
|
|
1594
1595
|
country_code?: string;
|
|
@@ -1784,6 +1785,8 @@ interface components {
|
|
|
1784
1785
|
external_account_id: string;
|
|
1785
1786
|
amount: number;
|
|
1786
1787
|
currency?: string;
|
|
1788
|
+
/** @enum {string} */
|
|
1789
|
+
direction: "credit" | "debit";
|
|
1787
1790
|
metadata?: components["schemas"]["Metadata"];
|
|
1788
1791
|
};
|
|
1789
1792
|
CreatePayoutRequest: {
|
|
@@ -1796,6 +1799,8 @@ interface components {
|
|
|
1796
1799
|
external_account_id: string;
|
|
1797
1800
|
amount: number;
|
|
1798
1801
|
currency?: string;
|
|
1802
|
+
/** @enum {string} */
|
|
1803
|
+
direction: "credit" | "debit";
|
|
1799
1804
|
metadata?: components["schemas"]["Metadata"];
|
|
1800
1805
|
};
|
|
1801
1806
|
CreateBulkPayoutsRequest: {
|
|
@@ -1810,6 +1815,8 @@ interface components {
|
|
|
1810
1815
|
external_account_id?: string;
|
|
1811
1816
|
amount?: number;
|
|
1812
1817
|
currency?: string;
|
|
1818
|
+
/** @enum {string} */
|
|
1819
|
+
direction?: "credit" | "debit";
|
|
1813
1820
|
metadata?: components["schemas"]["Metadata"];
|
|
1814
1821
|
/** @enum {string} */
|
|
1815
1822
|
state?: "pending" | "succeeded" | "failed" | "accepted" | "rejected";
|
|
@@ -2001,6 +2008,14 @@ interface components {
|
|
|
2001
2008
|
CreateSubscriptionRequest: {
|
|
2002
2009
|
subscription: components["schemas"]["CreateSubscriptionInput"];
|
|
2003
2010
|
};
|
|
2011
|
+
UpdateSubscriptionInput: {
|
|
2012
|
+
/** Format: uuid */
|
|
2013
|
+
payment_method_id?: string;
|
|
2014
|
+
metadata?: components["schemas"]["Metadata"];
|
|
2015
|
+
};
|
|
2016
|
+
UpdateSubscriptionRequest: {
|
|
2017
|
+
subscription: components["schemas"]["UpdateSubscriptionInput"];
|
|
2018
|
+
};
|
|
2004
2019
|
Subscription: {
|
|
2005
2020
|
/** Format: uuid */
|
|
2006
2021
|
id?: string;
|
|
@@ -2150,7 +2165,8 @@ interface components {
|
|
|
2150
2165
|
updated_at?: string;
|
|
2151
2166
|
};
|
|
2152
2167
|
CreateWebhookEndpointInput: {
|
|
2153
|
-
|
|
2168
|
+
/** @enum {string} */
|
|
2169
|
+
event?: "charge.cancelled" | "charge.created" | "charge.errored" | "charge.failed" | "charge.processing" | "charge.requires_capture" | "charge.requires_confirmation" | "charge.succeeded" | "customer.created" | "customer.updated" | "legal_entity.created" | "legal_entity.updated" | "legal_entity_principal.created" | "legal_entity_principal.updated" | "merchant.created" | "merchant.updated" | "payment_intent.cancelled" | "payment_intent.created" | "payment_intent.processing_authorization" | "payment_intent.processing_capture" | "payment_intent.processing_sale" | "payment_intent.requires_capture" | "payment_intent.requires_confirmation" | "payment_intent.requires_payment_method" | "payment_intent.requires_review" | "payment_intent.succeeded" | "processor_transaction.completed" | "reconciliation.created" | "refund.cancelled" | "refund.created" | "refund.failed" | "refund.pending" | "refund.processing" | "refund.requires_review" | "refund.succeeded" | "void.created" | "void.failed" | "void.pending" | "void.processing" | "void.requires_review" | "void.succeeded";
|
|
2154
2170
|
metadata?: components["schemas"]["Metadata"];
|
|
2155
2171
|
active?: boolean;
|
|
2156
2172
|
url?: string;
|
|
@@ -2161,7 +2177,8 @@ interface components {
|
|
|
2161
2177
|
WebhookEndpoint: {
|
|
2162
2178
|
/** Format: uuid */
|
|
2163
2179
|
id?: string;
|
|
2164
|
-
|
|
2180
|
+
/** @enum {string} */
|
|
2181
|
+
event?: "charge.cancelled" | "charge.created" | "charge.errored" | "charge.failed" | "charge.processing" | "charge.requires_capture" | "charge.requires_confirmation" | "charge.succeeded" | "customer.created" | "customer.updated" | "legal_entity.created" | "legal_entity.updated" | "legal_entity_principal.created" | "legal_entity_principal.updated" | "merchant.created" | "merchant.updated" | "payment_intent.cancelled" | "payment_intent.created" | "payment_intent.processing_authorization" | "payment_intent.processing_capture" | "payment_intent.processing_sale" | "payment_intent.requires_capture" | "payment_intent.requires_confirmation" | "payment_intent.requires_payment_method" | "payment_intent.requires_review" | "payment_intent.succeeded" | "processor_transaction.completed" | "reconciliation.created" | "refund.cancelled" | "refund.created" | "refund.failed" | "refund.pending" | "refund.processing" | "refund.requires_review" | "refund.succeeded" | "void.created" | "void.failed" | "void.pending" | "void.processing" | "void.requires_review" | "void.succeeded";
|
|
2165
2182
|
metadata?: components["schemas"]["Metadata"];
|
|
2166
2183
|
secret?: string;
|
|
2167
2184
|
url?: string;
|
|
@@ -4278,6 +4295,42 @@ interface operations {
|
|
|
4278
4295
|
};
|
|
4279
4296
|
};
|
|
4280
4297
|
};
|
|
4298
|
+
UpdateSubscription: {
|
|
4299
|
+
parameters: {
|
|
4300
|
+
query?: never;
|
|
4301
|
+
header?: never;
|
|
4302
|
+
path: {
|
|
4303
|
+
/** @description The ID of the subscription to update */
|
|
4304
|
+
id: string;
|
|
4305
|
+
};
|
|
4306
|
+
cookie?: never;
|
|
4307
|
+
};
|
|
4308
|
+
requestBody: {
|
|
4309
|
+
content: {
|
|
4310
|
+
"application/json": components["schemas"]["UpdateSubscriptionRequest"];
|
|
4311
|
+
};
|
|
4312
|
+
};
|
|
4313
|
+
responses: {
|
|
4314
|
+
/** @description Subscription updated successfully */
|
|
4315
|
+
200: {
|
|
4316
|
+
headers: {
|
|
4317
|
+
[name: string]: unknown;
|
|
4318
|
+
};
|
|
4319
|
+
content: {
|
|
4320
|
+
"application/json": components["schemas"]["Subscription"];
|
|
4321
|
+
};
|
|
4322
|
+
};
|
|
4323
|
+
/** @description Unprocessable entity */
|
|
4324
|
+
422: {
|
|
4325
|
+
headers: {
|
|
4326
|
+
[name: string]: unknown;
|
|
4327
|
+
};
|
|
4328
|
+
content: {
|
|
4329
|
+
"application/json": components["schemas"]["Error"];
|
|
4330
|
+
};
|
|
4331
|
+
};
|
|
4332
|
+
};
|
|
4333
|
+
};
|
|
4281
4334
|
CancelSubscription: {
|
|
4282
4335
|
parameters: {
|
|
4283
4336
|
query?: never;
|
|
@@ -4660,11 +4713,11 @@ interface operations {
|
|
|
4660
4713
|
};
|
|
4661
4714
|
}
|
|
4662
4715
|
|
|
4663
|
-
declare const PAY_API_BASE_URL_PRODUCTION = "https://pay.
|
|
4664
|
-
declare const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.
|
|
4716
|
+
declare const PAY_API_BASE_URL_PRODUCTION = "https://pay.amos.com";
|
|
4717
|
+
declare const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.amos.com";
|
|
4665
4718
|
declare const PAY_API_VERSION = "1";
|
|
4666
4719
|
/**
|
|
4667
|
-
* Create a typed `openapi-fetch` client for the
|
|
4720
|
+
* Create a typed `openapi-fetch` client for the Amos Pay API.
|
|
4668
4721
|
*
|
|
4669
4722
|
* The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each
|
|
4670
4723
|
* fully typed against the OpenAPI spec — paths, path/query/header params,
|
|
@@ -4681,12 +4734,12 @@ declare const PAY_API_VERSION = "1";
|
|
|
4681
4734
|
* createPayApiClient,
|
|
4682
4735
|
* PAY_API_BASE_URL_SANDBOX,
|
|
4683
4736
|
* PAY_API_VERSION,
|
|
4684
|
-
* } from "@
|
|
4737
|
+
* } from "@amos.com/node";
|
|
4685
4738
|
*
|
|
4686
4739
|
* const pay = createPayApiClient({
|
|
4687
4740
|
* baseUrl: PAY_API_BASE_URL_SANDBOX,
|
|
4688
4741
|
* headers: {
|
|
4689
|
-
* "X-Api-Key": process.env.
|
|
4742
|
+
* "X-Api-Key": process.env.AMOS_API_KEY!,
|
|
4690
4743
|
* "X-Api-Version": PAY_API_VERSION,
|
|
4691
4744
|
* },
|
|
4692
4745
|
* });
|
|
@@ -4698,7 +4751,7 @@ declare const PAY_API_VERSION = "1";
|
|
|
4698
4751
|
* ```
|
|
4699
4752
|
*/
|
|
4700
4753
|
declare function createPayApiClient(options: ClientOptions): openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
4701
|
-
/** A configured
|
|
4754
|
+
/** A configured Amos Pay API client returned by {@link createPayApiClient}. */
|
|
4702
4755
|
type PayApiClient = ReturnType<typeof createPayApiClient>;
|
|
4703
4756
|
|
|
4704
4757
|
export { type $defs, PAY_API_BASE_URL_PRODUCTION, PAY_API_BASE_URL_SANDBOX, PAY_API_VERSION, type PayApiClient, type components, createPayApiClient, type operations, type paths, type webhooks };
|
package/dist/index.d.ts
CHANGED
|
@@ -950,7 +950,8 @@ interface paths {
|
|
|
950
950
|
};
|
|
951
951
|
/** Retrieve a subscription by ID */
|
|
952
952
|
get: operations["GetSubscription"];
|
|
953
|
-
|
|
953
|
+
/** Update a subscription by ID */
|
|
954
|
+
put: operations["UpdateSubscription"];
|
|
954
955
|
post?: never;
|
|
955
956
|
delete?: never;
|
|
956
957
|
options?: never;
|
|
@@ -1561,7 +1562,7 @@ interface components {
|
|
|
1561
1562
|
bank_account_number?: string;
|
|
1562
1563
|
bank_routing_number?: string;
|
|
1563
1564
|
/** @enum {string} */
|
|
1564
|
-
business_category?: "
|
|
1565
|
+
business_category?: "business_association" | "charity" | "church" | "county" | "federal" | "fraternal_org" | "government" | "higher_education" | "k12" | "labor_union" | "local" | "ministry" | "pac" | "parachurch" | "party" | "preschool" | "social_club" | "social_welfare" | "state" | "tribal" | "vendor" | "veterans_org";
|
|
1565
1566
|
business_description?: string;
|
|
1566
1567
|
city?: string;
|
|
1567
1568
|
country_code?: string;
|
|
@@ -1588,7 +1589,7 @@ interface components {
|
|
|
1588
1589
|
id?: string;
|
|
1589
1590
|
annual_credit_card_sales_volume?: number;
|
|
1590
1591
|
/** @enum {string} */
|
|
1591
|
-
business_category?: "
|
|
1592
|
+
business_category?: "business_association" | "charity" | "church" | "county" | "federal" | "fraternal_org" | "government" | "higher_education" | "k12" | "labor_union" | "local" | "ministry" | "pac" | "parachurch" | "party" | "preschool" | "social_club" | "social_welfare" | "state" | "tribal" | "vendor" | "veterans_org";
|
|
1592
1593
|
business_description?: string;
|
|
1593
1594
|
city?: string;
|
|
1594
1595
|
country_code?: string;
|
|
@@ -1784,6 +1785,8 @@ interface components {
|
|
|
1784
1785
|
external_account_id: string;
|
|
1785
1786
|
amount: number;
|
|
1786
1787
|
currency?: string;
|
|
1788
|
+
/** @enum {string} */
|
|
1789
|
+
direction: "credit" | "debit";
|
|
1787
1790
|
metadata?: components["schemas"]["Metadata"];
|
|
1788
1791
|
};
|
|
1789
1792
|
CreatePayoutRequest: {
|
|
@@ -1796,6 +1799,8 @@ interface components {
|
|
|
1796
1799
|
external_account_id: string;
|
|
1797
1800
|
amount: number;
|
|
1798
1801
|
currency?: string;
|
|
1802
|
+
/** @enum {string} */
|
|
1803
|
+
direction: "credit" | "debit";
|
|
1799
1804
|
metadata?: components["schemas"]["Metadata"];
|
|
1800
1805
|
};
|
|
1801
1806
|
CreateBulkPayoutsRequest: {
|
|
@@ -1810,6 +1815,8 @@ interface components {
|
|
|
1810
1815
|
external_account_id?: string;
|
|
1811
1816
|
amount?: number;
|
|
1812
1817
|
currency?: string;
|
|
1818
|
+
/** @enum {string} */
|
|
1819
|
+
direction?: "credit" | "debit";
|
|
1813
1820
|
metadata?: components["schemas"]["Metadata"];
|
|
1814
1821
|
/** @enum {string} */
|
|
1815
1822
|
state?: "pending" | "succeeded" | "failed" | "accepted" | "rejected";
|
|
@@ -2001,6 +2008,14 @@ interface components {
|
|
|
2001
2008
|
CreateSubscriptionRequest: {
|
|
2002
2009
|
subscription: components["schemas"]["CreateSubscriptionInput"];
|
|
2003
2010
|
};
|
|
2011
|
+
UpdateSubscriptionInput: {
|
|
2012
|
+
/** Format: uuid */
|
|
2013
|
+
payment_method_id?: string;
|
|
2014
|
+
metadata?: components["schemas"]["Metadata"];
|
|
2015
|
+
};
|
|
2016
|
+
UpdateSubscriptionRequest: {
|
|
2017
|
+
subscription: components["schemas"]["UpdateSubscriptionInput"];
|
|
2018
|
+
};
|
|
2004
2019
|
Subscription: {
|
|
2005
2020
|
/** Format: uuid */
|
|
2006
2021
|
id?: string;
|
|
@@ -2150,7 +2165,8 @@ interface components {
|
|
|
2150
2165
|
updated_at?: string;
|
|
2151
2166
|
};
|
|
2152
2167
|
CreateWebhookEndpointInput: {
|
|
2153
|
-
|
|
2168
|
+
/** @enum {string} */
|
|
2169
|
+
event?: "charge.cancelled" | "charge.created" | "charge.errored" | "charge.failed" | "charge.processing" | "charge.requires_capture" | "charge.requires_confirmation" | "charge.succeeded" | "customer.created" | "customer.updated" | "legal_entity.created" | "legal_entity.updated" | "legal_entity_principal.created" | "legal_entity_principal.updated" | "merchant.created" | "merchant.updated" | "payment_intent.cancelled" | "payment_intent.created" | "payment_intent.processing_authorization" | "payment_intent.processing_capture" | "payment_intent.processing_sale" | "payment_intent.requires_capture" | "payment_intent.requires_confirmation" | "payment_intent.requires_payment_method" | "payment_intent.requires_review" | "payment_intent.succeeded" | "processor_transaction.completed" | "reconciliation.created" | "refund.cancelled" | "refund.created" | "refund.failed" | "refund.pending" | "refund.processing" | "refund.requires_review" | "refund.succeeded" | "void.created" | "void.failed" | "void.pending" | "void.processing" | "void.requires_review" | "void.succeeded";
|
|
2154
2170
|
metadata?: components["schemas"]["Metadata"];
|
|
2155
2171
|
active?: boolean;
|
|
2156
2172
|
url?: string;
|
|
@@ -2161,7 +2177,8 @@ interface components {
|
|
|
2161
2177
|
WebhookEndpoint: {
|
|
2162
2178
|
/** Format: uuid */
|
|
2163
2179
|
id?: string;
|
|
2164
|
-
|
|
2180
|
+
/** @enum {string} */
|
|
2181
|
+
event?: "charge.cancelled" | "charge.created" | "charge.errored" | "charge.failed" | "charge.processing" | "charge.requires_capture" | "charge.requires_confirmation" | "charge.succeeded" | "customer.created" | "customer.updated" | "legal_entity.created" | "legal_entity.updated" | "legal_entity_principal.created" | "legal_entity_principal.updated" | "merchant.created" | "merchant.updated" | "payment_intent.cancelled" | "payment_intent.created" | "payment_intent.processing_authorization" | "payment_intent.processing_capture" | "payment_intent.processing_sale" | "payment_intent.requires_capture" | "payment_intent.requires_confirmation" | "payment_intent.requires_payment_method" | "payment_intent.requires_review" | "payment_intent.succeeded" | "processor_transaction.completed" | "reconciliation.created" | "refund.cancelled" | "refund.created" | "refund.failed" | "refund.pending" | "refund.processing" | "refund.requires_review" | "refund.succeeded" | "void.created" | "void.failed" | "void.pending" | "void.processing" | "void.requires_review" | "void.succeeded";
|
|
2165
2182
|
metadata?: components["schemas"]["Metadata"];
|
|
2166
2183
|
secret?: string;
|
|
2167
2184
|
url?: string;
|
|
@@ -4278,6 +4295,42 @@ interface operations {
|
|
|
4278
4295
|
};
|
|
4279
4296
|
};
|
|
4280
4297
|
};
|
|
4298
|
+
UpdateSubscription: {
|
|
4299
|
+
parameters: {
|
|
4300
|
+
query?: never;
|
|
4301
|
+
header?: never;
|
|
4302
|
+
path: {
|
|
4303
|
+
/** @description The ID of the subscription to update */
|
|
4304
|
+
id: string;
|
|
4305
|
+
};
|
|
4306
|
+
cookie?: never;
|
|
4307
|
+
};
|
|
4308
|
+
requestBody: {
|
|
4309
|
+
content: {
|
|
4310
|
+
"application/json": components["schemas"]["UpdateSubscriptionRequest"];
|
|
4311
|
+
};
|
|
4312
|
+
};
|
|
4313
|
+
responses: {
|
|
4314
|
+
/** @description Subscription updated successfully */
|
|
4315
|
+
200: {
|
|
4316
|
+
headers: {
|
|
4317
|
+
[name: string]: unknown;
|
|
4318
|
+
};
|
|
4319
|
+
content: {
|
|
4320
|
+
"application/json": components["schemas"]["Subscription"];
|
|
4321
|
+
};
|
|
4322
|
+
};
|
|
4323
|
+
/** @description Unprocessable entity */
|
|
4324
|
+
422: {
|
|
4325
|
+
headers: {
|
|
4326
|
+
[name: string]: unknown;
|
|
4327
|
+
};
|
|
4328
|
+
content: {
|
|
4329
|
+
"application/json": components["schemas"]["Error"];
|
|
4330
|
+
};
|
|
4331
|
+
};
|
|
4332
|
+
};
|
|
4333
|
+
};
|
|
4281
4334
|
CancelSubscription: {
|
|
4282
4335
|
parameters: {
|
|
4283
4336
|
query?: never;
|
|
@@ -4660,11 +4713,11 @@ interface operations {
|
|
|
4660
4713
|
};
|
|
4661
4714
|
}
|
|
4662
4715
|
|
|
4663
|
-
declare const PAY_API_BASE_URL_PRODUCTION = "https://pay.
|
|
4664
|
-
declare const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.
|
|
4716
|
+
declare const PAY_API_BASE_URL_PRODUCTION = "https://pay.amos.com";
|
|
4717
|
+
declare const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.amos.com";
|
|
4665
4718
|
declare const PAY_API_VERSION = "1";
|
|
4666
4719
|
/**
|
|
4667
|
-
* Create a typed `openapi-fetch` client for the
|
|
4720
|
+
* Create a typed `openapi-fetch` client for the Amos Pay API.
|
|
4668
4721
|
*
|
|
4669
4722
|
* The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each
|
|
4670
4723
|
* fully typed against the OpenAPI spec — paths, path/query/header params,
|
|
@@ -4681,12 +4734,12 @@ declare const PAY_API_VERSION = "1";
|
|
|
4681
4734
|
* createPayApiClient,
|
|
4682
4735
|
* PAY_API_BASE_URL_SANDBOX,
|
|
4683
4736
|
* PAY_API_VERSION,
|
|
4684
|
-
* } from "@
|
|
4737
|
+
* } from "@amos.com/node";
|
|
4685
4738
|
*
|
|
4686
4739
|
* const pay = createPayApiClient({
|
|
4687
4740
|
* baseUrl: PAY_API_BASE_URL_SANDBOX,
|
|
4688
4741
|
* headers: {
|
|
4689
|
-
* "X-Api-Key": process.env.
|
|
4742
|
+
* "X-Api-Key": process.env.AMOS_API_KEY!,
|
|
4690
4743
|
* "X-Api-Version": PAY_API_VERSION,
|
|
4691
4744
|
* },
|
|
4692
4745
|
* });
|
|
@@ -4698,7 +4751,7 @@ declare const PAY_API_VERSION = "1";
|
|
|
4698
4751
|
* ```
|
|
4699
4752
|
*/
|
|
4700
4753
|
declare function createPayApiClient(options: ClientOptions): openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
4701
|
-
/** A configured
|
|
4754
|
+
/** A configured Amos Pay API client returned by {@link createPayApiClient}. */
|
|
4702
4755
|
type PayApiClient = ReturnType<typeof createPayApiClient>;
|
|
4703
4756
|
|
|
4704
4757
|
export { type $defs, PAY_API_BASE_URL_PRODUCTION, PAY_API_BASE_URL_SANDBOX, PAY_API_VERSION, type PayApiClient, type components, createPayApiClient, type operations, type paths, type webhooks };
|
package/dist/index.js
CHANGED
|
@@ -37,8 +37,8 @@ __export(index_exports, {
|
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(index_exports);
|
|
39
39
|
var import_openapi_fetch = __toESM(require("openapi-fetch"));
|
|
40
|
-
var PAY_API_BASE_URL_PRODUCTION = "https://pay.
|
|
41
|
-
var PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.
|
|
40
|
+
var PAY_API_BASE_URL_PRODUCTION = "https://pay.amos.com";
|
|
41
|
+
var PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.amos.com";
|
|
42
42
|
var PAY_API_VERSION = "1";
|
|
43
43
|
function createPayApiClient(options) {
|
|
44
44
|
return (0, import_openapi_fetch.default)(options);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n\ttype ClientOptions,\n\ttype Middleware,\n} from \"openapi-fetch\";\nimport type { paths } from \"../openapi/schema\";\n\nexport * from \"../openapi/schema\";\n\nexport const PAY_API_BASE_URL_PRODUCTION = \"https://pay.amos.com\";\nexport const PAY_API_BASE_URL_SANDBOX = \"https://pay-sandbox.amos.com\";\nexport const PAY_API_VERSION = \"1\";\n\n/**\n * Create a typed `openapi-fetch` client for the Amos Pay API.\n *\n * The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each\n * fully typed against the OpenAPI spec — paths, path/query/header params,\n * request bodies, and response bodies are all checked at compile time.\n *\n * Provide credentials and the required `X-Api-Version` header either as\n * default `headers` here or via `params.header` on each call. Use\n * `client.use(middleware)` to add per-request behavior such as fresh\n * idempotency keys.\n *\n * @example\n * ```ts\n * import {\n * createPayApiClient,\n * PAY_API_BASE_URL_SANDBOX,\n * PAY_API_VERSION,\n * } from \"@amos.com/node\";\n *\n * const pay = createPayApiClient({\n * baseUrl: PAY_API_BASE_URL_SANDBOX,\n * headers: {\n * \"X-Api-Key\": process.env.AMOS_API_KEY!,\n * \"X-Api-Version\": PAY_API_VERSION,\n * },\n * });\n *\n * const { data, error } = await pay.POST(\"/customers\", {\n * params: { header: { \"X-Api-Version\": PAY_API_VERSION } },\n * body: { customer: { email: \"alex@example.com\" } },\n * });\n * ```\n */\nexport function createPayApiClient(options: ClientOptions) {\n\treturn createClient<paths>(options);\n}\n\n/** A configured Amos Pay API client returned by {@link createPayApiClient}. */\nexport type PayApiClient = ReturnType<typeof createPayApiClient>;\n\nexport type { ClientOptions, Middleware };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAGO;AAKA,IAAM,8BAA8B;AACpC,IAAM,2BAA2B;AACjC,IAAM,kBAAkB;AAoCxB,SAAS,mBAAmB,SAAwB;AAC1D,aAAO,qBAAAA,SAAoB,OAAO;AACnC;","names":["createClient"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import createClient from "openapi-fetch";
|
|
3
|
-
var PAY_API_BASE_URL_PRODUCTION = "https://pay.
|
|
4
|
-
var PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.
|
|
3
|
+
var PAY_API_BASE_URL_PRODUCTION = "https://pay.amos.com";
|
|
4
|
+
var PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.amos.com";
|
|
5
5
|
var PAY_API_VERSION = "1";
|
|
6
6
|
function createPayApiClient(options) {
|
|
7
7
|
return createClient(options);
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n\ttype ClientOptions,\n\ttype Middleware,\n} from \"openapi-fetch\";\nimport type { paths } from \"../openapi/schema\";\n\nexport * from \"../openapi/schema\";\n\nexport const PAY_API_BASE_URL_PRODUCTION = \"https://pay.amos.com\";\nexport const PAY_API_BASE_URL_SANDBOX = \"https://pay-sandbox.amos.com\";\nexport const PAY_API_VERSION = \"1\";\n\n/**\n * Create a typed `openapi-fetch` client for the Amos Pay API.\n *\n * The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each\n * fully typed against the OpenAPI spec — paths, path/query/header params,\n * request bodies, and response bodies are all checked at compile time.\n *\n * Provide credentials and the required `X-Api-Version` header either as\n * default `headers` here or via `params.header` on each call. Use\n * `client.use(middleware)` to add per-request behavior such as fresh\n * idempotency keys.\n *\n * @example\n * ```ts\n * import {\n * createPayApiClient,\n * PAY_API_BASE_URL_SANDBOX,\n * PAY_API_VERSION,\n * } from \"@amos.com/node\";\n *\n * const pay = createPayApiClient({\n * baseUrl: PAY_API_BASE_URL_SANDBOX,\n * headers: {\n * \"X-Api-Key\": process.env.AMOS_API_KEY!,\n * \"X-Api-Version\": PAY_API_VERSION,\n * },\n * });\n *\n * const { data, error } = await pay.POST(\"/customers\", {\n * params: { header: { \"X-Api-Version\": PAY_API_VERSION } },\n * body: { customer: { email: \"alex@example.com\" } },\n * });\n * ```\n */\nexport function createPayApiClient(options: ClientOptions) {\n\treturn createClient<paths>(options);\n}\n\n/** A configured Amos Pay API client returned by {@link createPayApiClient}. */\nexport type PayApiClient = ReturnType<typeof createPayApiClient>;\n\nexport type { ClientOptions, Middleware };\n"],"mappings":";AAAA,OAAO,kBAGA;AAKA,IAAM,8BAA8B;AACpC,IAAM,2BAA2B;AACjC,IAAM,kBAAkB;AAoCxB,SAAS,mBAAmB,SAAwB;AAC1D,SAAO,aAAoB,OAAO;AACnC;","names":[]}
|
package/openapi/schema.ts
CHANGED
|
@@ -947,7 +947,8 @@ export interface paths {
|
|
|
947
947
|
};
|
|
948
948
|
/** Retrieve a subscription by ID */
|
|
949
949
|
get: operations["GetSubscription"];
|
|
950
|
-
|
|
950
|
+
/** Update a subscription by ID */
|
|
951
|
+
put: operations["UpdateSubscription"];
|
|
951
952
|
post?: never;
|
|
952
953
|
delete?: never;
|
|
953
954
|
options?: never;
|
|
@@ -1558,7 +1559,7 @@ export interface components {
|
|
|
1558
1559
|
bank_account_number?: string;
|
|
1559
1560
|
bank_routing_number?: string;
|
|
1560
1561
|
/** @enum {string} */
|
|
1561
|
-
business_category?: "
|
|
1562
|
+
business_category?: "business_association" | "charity" | "church" | "county" | "federal" | "fraternal_org" | "government" | "higher_education" | "k12" | "labor_union" | "local" | "ministry" | "pac" | "parachurch" | "party" | "preschool" | "social_club" | "social_welfare" | "state" | "tribal" | "vendor" | "veterans_org";
|
|
1562
1563
|
business_description?: string;
|
|
1563
1564
|
city?: string;
|
|
1564
1565
|
country_code?: string;
|
|
@@ -1585,7 +1586,7 @@ export interface components {
|
|
|
1585
1586
|
id?: string;
|
|
1586
1587
|
annual_credit_card_sales_volume?: number;
|
|
1587
1588
|
/** @enum {string} */
|
|
1588
|
-
business_category?: "
|
|
1589
|
+
business_category?: "business_association" | "charity" | "church" | "county" | "federal" | "fraternal_org" | "government" | "higher_education" | "k12" | "labor_union" | "local" | "ministry" | "pac" | "parachurch" | "party" | "preschool" | "social_club" | "social_welfare" | "state" | "tribal" | "vendor" | "veterans_org";
|
|
1589
1590
|
business_description?: string;
|
|
1590
1591
|
city?: string;
|
|
1591
1592
|
country_code?: string;
|
|
@@ -1781,6 +1782,8 @@ export interface components {
|
|
|
1781
1782
|
external_account_id: string;
|
|
1782
1783
|
amount: number;
|
|
1783
1784
|
currency?: string;
|
|
1785
|
+
/** @enum {string} */
|
|
1786
|
+
direction: "credit" | "debit";
|
|
1784
1787
|
metadata?: components["schemas"]["Metadata"];
|
|
1785
1788
|
};
|
|
1786
1789
|
CreatePayoutRequest: {
|
|
@@ -1793,6 +1796,8 @@ export interface components {
|
|
|
1793
1796
|
external_account_id: string;
|
|
1794
1797
|
amount: number;
|
|
1795
1798
|
currency?: string;
|
|
1799
|
+
/** @enum {string} */
|
|
1800
|
+
direction: "credit" | "debit";
|
|
1796
1801
|
metadata?: components["schemas"]["Metadata"];
|
|
1797
1802
|
};
|
|
1798
1803
|
CreateBulkPayoutsRequest: {
|
|
@@ -1807,6 +1812,8 @@ export interface components {
|
|
|
1807
1812
|
external_account_id?: string;
|
|
1808
1813
|
amount?: number;
|
|
1809
1814
|
currency?: string;
|
|
1815
|
+
/** @enum {string} */
|
|
1816
|
+
direction?: "credit" | "debit";
|
|
1810
1817
|
metadata?: components["schemas"]["Metadata"];
|
|
1811
1818
|
/** @enum {string} */
|
|
1812
1819
|
state?: "pending" | "succeeded" | "failed" | "accepted" | "rejected";
|
|
@@ -1998,6 +2005,14 @@ export interface components {
|
|
|
1998
2005
|
CreateSubscriptionRequest: {
|
|
1999
2006
|
subscription: components["schemas"]["CreateSubscriptionInput"];
|
|
2000
2007
|
};
|
|
2008
|
+
UpdateSubscriptionInput: {
|
|
2009
|
+
/** Format: uuid */
|
|
2010
|
+
payment_method_id?: string;
|
|
2011
|
+
metadata?: components["schemas"]["Metadata"];
|
|
2012
|
+
};
|
|
2013
|
+
UpdateSubscriptionRequest: {
|
|
2014
|
+
subscription: components["schemas"]["UpdateSubscriptionInput"];
|
|
2015
|
+
};
|
|
2001
2016
|
Subscription: {
|
|
2002
2017
|
/** Format: uuid */
|
|
2003
2018
|
id?: string;
|
|
@@ -2147,7 +2162,8 @@ export interface components {
|
|
|
2147
2162
|
updated_at?: string;
|
|
2148
2163
|
};
|
|
2149
2164
|
CreateWebhookEndpointInput: {
|
|
2150
|
-
|
|
2165
|
+
/** @enum {string} */
|
|
2166
|
+
event?: "charge.cancelled" | "charge.created" | "charge.errored" | "charge.failed" | "charge.processing" | "charge.requires_capture" | "charge.requires_confirmation" | "charge.succeeded" | "customer.created" | "customer.updated" | "legal_entity.created" | "legal_entity.updated" | "legal_entity_principal.created" | "legal_entity_principal.updated" | "merchant.created" | "merchant.updated" | "payment_intent.cancelled" | "payment_intent.created" | "payment_intent.processing_authorization" | "payment_intent.processing_capture" | "payment_intent.processing_sale" | "payment_intent.requires_capture" | "payment_intent.requires_confirmation" | "payment_intent.requires_payment_method" | "payment_intent.requires_review" | "payment_intent.succeeded" | "processor_transaction.completed" | "reconciliation.created" | "refund.cancelled" | "refund.created" | "refund.failed" | "refund.pending" | "refund.processing" | "refund.requires_review" | "refund.succeeded" | "void.created" | "void.failed" | "void.pending" | "void.processing" | "void.requires_review" | "void.succeeded";
|
|
2151
2167
|
metadata?: components["schemas"]["Metadata"];
|
|
2152
2168
|
active?: boolean;
|
|
2153
2169
|
url?: string;
|
|
@@ -2158,7 +2174,8 @@ export interface components {
|
|
|
2158
2174
|
WebhookEndpoint: {
|
|
2159
2175
|
/** Format: uuid */
|
|
2160
2176
|
id?: string;
|
|
2161
|
-
|
|
2177
|
+
/** @enum {string} */
|
|
2178
|
+
event?: "charge.cancelled" | "charge.created" | "charge.errored" | "charge.failed" | "charge.processing" | "charge.requires_capture" | "charge.requires_confirmation" | "charge.succeeded" | "customer.created" | "customer.updated" | "legal_entity.created" | "legal_entity.updated" | "legal_entity_principal.created" | "legal_entity_principal.updated" | "merchant.created" | "merchant.updated" | "payment_intent.cancelled" | "payment_intent.created" | "payment_intent.processing_authorization" | "payment_intent.processing_capture" | "payment_intent.processing_sale" | "payment_intent.requires_capture" | "payment_intent.requires_confirmation" | "payment_intent.requires_payment_method" | "payment_intent.requires_review" | "payment_intent.succeeded" | "processor_transaction.completed" | "reconciliation.created" | "refund.cancelled" | "refund.created" | "refund.failed" | "refund.pending" | "refund.processing" | "refund.requires_review" | "refund.succeeded" | "void.created" | "void.failed" | "void.pending" | "void.processing" | "void.requires_review" | "void.succeeded";
|
|
2162
2179
|
metadata?: components["schemas"]["Metadata"];
|
|
2163
2180
|
secret?: string;
|
|
2164
2181
|
url?: string;
|
|
@@ -4275,6 +4292,42 @@ export interface operations {
|
|
|
4275
4292
|
};
|
|
4276
4293
|
};
|
|
4277
4294
|
};
|
|
4295
|
+
UpdateSubscription: {
|
|
4296
|
+
parameters: {
|
|
4297
|
+
query?: never;
|
|
4298
|
+
header?: never;
|
|
4299
|
+
path: {
|
|
4300
|
+
/** @description The ID of the subscription to update */
|
|
4301
|
+
id: string;
|
|
4302
|
+
};
|
|
4303
|
+
cookie?: never;
|
|
4304
|
+
};
|
|
4305
|
+
requestBody: {
|
|
4306
|
+
content: {
|
|
4307
|
+
"application/json": components["schemas"]["UpdateSubscriptionRequest"];
|
|
4308
|
+
};
|
|
4309
|
+
};
|
|
4310
|
+
responses: {
|
|
4311
|
+
/** @description Subscription updated successfully */
|
|
4312
|
+
200: {
|
|
4313
|
+
headers: {
|
|
4314
|
+
[name: string]: unknown;
|
|
4315
|
+
};
|
|
4316
|
+
content: {
|
|
4317
|
+
"application/json": components["schemas"]["Subscription"];
|
|
4318
|
+
};
|
|
4319
|
+
};
|
|
4320
|
+
/** @description Unprocessable entity */
|
|
4321
|
+
422: {
|
|
4322
|
+
headers: {
|
|
4323
|
+
[name: string]: unknown;
|
|
4324
|
+
};
|
|
4325
|
+
content: {
|
|
4326
|
+
"application/json": components["schemas"]["Error"];
|
|
4327
|
+
};
|
|
4328
|
+
};
|
|
4329
|
+
};
|
|
4330
|
+
};
|
|
4278
4331
|
CancelSubscription: {
|
|
4279
4332
|
parameters: {
|
|
4280
4333
|
query?: never;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import createClient, {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type ClientOptions,
|
|
3
|
+
type Middleware,
|
|
4
4
|
} from "openapi-fetch";
|
|
5
5
|
import type { paths } from "../openapi/schema";
|
|
6
6
|
|
|
7
7
|
export * from "../openapi/schema";
|
|
8
8
|
|
|
9
|
-
export const PAY_API_BASE_URL_PRODUCTION = "https://pay.
|
|
10
|
-
export const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.
|
|
9
|
+
export const PAY_API_BASE_URL_PRODUCTION = "https://pay.amos.com";
|
|
10
|
+
export const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.amos.com";
|
|
11
11
|
export const PAY_API_VERSION = "1";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Create a typed `openapi-fetch` client for the
|
|
14
|
+
* Create a typed `openapi-fetch` client for the Amos Pay API.
|
|
15
15
|
*
|
|
16
16
|
* The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each
|
|
17
17
|
* fully typed against the OpenAPI spec — paths, path/query/header params,
|
|
@@ -28,12 +28,12 @@ export const PAY_API_VERSION = "1";
|
|
|
28
28
|
* createPayApiClient,
|
|
29
29
|
* PAY_API_BASE_URL_SANDBOX,
|
|
30
30
|
* PAY_API_VERSION,
|
|
31
|
-
* } from "@
|
|
31
|
+
* } from "@amos.com/node";
|
|
32
32
|
*
|
|
33
33
|
* const pay = createPayApiClient({
|
|
34
34
|
* baseUrl: PAY_API_BASE_URL_SANDBOX,
|
|
35
35
|
* headers: {
|
|
36
|
-
* "X-Api-Key": process.env.
|
|
36
|
+
* "X-Api-Key": process.env.AMOS_API_KEY!,
|
|
37
37
|
* "X-Api-Version": PAY_API_VERSION,
|
|
38
38
|
* },
|
|
39
39
|
* });
|
|
@@ -45,10 +45,10 @@ export const PAY_API_VERSION = "1";
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
export function createPayApiClient(options: ClientOptions) {
|
|
48
|
-
|
|
48
|
+
return createClient<paths>(options);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
/** A configured
|
|
51
|
+
/** A configured Amos Pay API client returned by {@link createPayApiClient}. */
|
|
52
52
|
export type PayApiClient = ReturnType<typeof createPayApiClient>;
|
|
53
53
|
|
|
54
54
|
export type { ClientOptions, Middleware };
|