Comparing version
@@ -21,3 +21,13 @@ import { z } from "zod"; | ||
_securityKey: string; | ||
/** | ||
* Constructs a new CustomerVault instance with a given security key. | ||
* @param securityKey The security key used for authentication with the Customer Vault API. | ||
*/ | ||
constructor(securityKey: string); | ||
/** | ||
* Adds a new customer to the vault. | ||
* @param customerData Optional object containing customer details. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
addCustomer(customerData?: { | ||
@@ -44,2 +54,8 @@ ccnumber?: string; | ||
}>; | ||
/** | ||
* Updates an existing customer in the vault. | ||
* @param customerData Object containing customer details with mandatory customer_vault_id. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
updateCustomer(customerData?: { | ||
@@ -66,2 +82,8 @@ customer_vault_id: string | number; | ||
}>; | ||
/** | ||
* Initiates a transaction for a customer stored in the vault. | ||
* @param transactionData Object containing transaction details with mandatory customer_vault_id. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
initiateCustomerVaultTransaction(transactionData?: { | ||
@@ -75,2 +97,8 @@ customer_vault_id: string | number; | ||
}>; | ||
/** | ||
* Validates a customer by their vault ID. | ||
* @param validateData Object containing the customer_vault_id to validate. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
validateCustomerByVaultId(validateData?: { | ||
@@ -83,2 +111,8 @@ customer_vault_id: string | number; | ||
}>; | ||
/** | ||
* Authorizes a customer by their vault ID for a specified amount. | ||
* @param authorizeData Object containing the customer_vault_id and amount for authorization. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
authorizeCustomerByVaultId(authorizeData?: { | ||
@@ -92,2 +126,8 @@ customer_vault_id: string | number; | ||
}>; | ||
/** | ||
* Processes a credit transaction by vault ID. | ||
* @param creditData Object containing the customer_vault_id, amount, and optional billing_id for the credit transaction. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
creditTransactionByVaultId(creditData?: { | ||
@@ -102,2 +142,8 @@ customer_vault_id: string | number; | ||
}>; | ||
/** | ||
* Processes an offline transaction by vault ID. | ||
* @param offlineData Object containing the customer_vault_id, amount, and optional billing_id for the offline transaction. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
offlineTransactionByVaultId(offlineData?: { | ||
@@ -112,2 +158,8 @@ customer_vault_id: string | number; | ||
}>; | ||
/** | ||
* Adds billing information to a customer in the vault. | ||
* @param billingData Object containing the customer_vault_id and billing details. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
addBillingToCustomer(billingData?: { | ||
@@ -134,2 +186,8 @@ customer_vault_id: string | number; | ||
}>; | ||
/** | ||
* Updates billing information for a customer in the vault. | ||
* @param billingData Object containing the billing_id, customer_vault_id, and updated billing details. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
updateBillingForCustomer(billingData?: { | ||
@@ -157,2 +215,8 @@ billing_id: string; | ||
}>; | ||
/** | ||
* Deletes billing information for a customer in the vault. | ||
* @param deleteData Object containing the billing_id and customer_vault_id for the billing information to be deleted. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
deleteBillingForCustomer(deleteData?: { | ||
@@ -166,2 +230,8 @@ billing_id: string; | ||
}>; | ||
/** | ||
* Deletes a customer record from the vault. | ||
* @param deleteData Object containing the customer_vault_id for the customer to be deleted. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
deleteCustomerRecord(deleteData?: { | ||
@@ -168,0 +238,0 @@ customer_vault_id: string | number; |
@@ -13,4 +13,14 @@ import { CreateInvoiceRequestSchema, UpdateInvoiceRequestSchema, CloseInvoiceRequestSchema, SendInvoiceRequestSchema } from "@/types/invoiceRequestSchemas"; | ||
_securityKey: string; | ||
/** | ||
* Constructs a new Invoices instance with a given security key. | ||
* @param securityKey The security key used for authentication with the Invoices API. | ||
*/ | ||
constructor(securityKey: string); | ||
beforeRequest: (request: any) => any; | ||
/** | ||
* Creates a new invoice with the specified details. | ||
* @param invoiceData Optional object containing invoice details. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
createInvoice(invoiceData?: { | ||
@@ -44,2 +54,8 @@ amount: number; | ||
}>; | ||
/** | ||
* Updates an existing invoice with the specified details. | ||
* @param invoiceData Object containing invoice details with mandatory invoice_id. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
updateInvoice(invoiceData?: { | ||
@@ -73,2 +89,8 @@ invoice_id: string; | ||
}>; | ||
/** | ||
* Closes an existing invoice. | ||
* @param invoiceData Object containing the invoice_id to close. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
closeInvoice(invoiceData?: { | ||
@@ -81,2 +103,8 @@ invoice_id?: string; | ||
}>; | ||
/** | ||
* Sends an invoice to the specified email. | ||
* @param invoiceData Object containing the invoice_id and email to send the invoice to. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
sendInvoice(invoiceData?: { | ||
@@ -83,0 +111,0 @@ email: string; |
@@ -12,4 +12,14 @@ import { AddProductRequestSchema, UpdateProductRequestSchema, DeleteProductRequestSchema } from "@/types/productManagerRequest"; | ||
_securityKey: string; | ||
/** | ||
* Constructs a new Products instance with a given security key. | ||
* @param securityKey The security key used for authentication with the Product Manager API. | ||
*/ | ||
constructor(securityKey: string); | ||
beforeRequest: (request: any) => any; | ||
/** | ||
* Adds a new product with the specified details. | ||
* @param productData Optional object containing product details. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
addProduct(productData?: { | ||
@@ -31,2 +41,8 @@ product_sku: string; | ||
}>; | ||
/** | ||
* Updates an existing product with the specified details. | ||
* @param productData Object containing product details with mandatory product_id. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
updateProduct(productData?: { | ||
@@ -49,2 +65,8 @@ product_id: string; | ||
}>; | ||
/** | ||
* Deletes an existing product with the specified product ID. | ||
* @param productData Object containing the product_id of the product to be deleted. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
deleteProduct(productData?: { | ||
@@ -51,0 +73,0 @@ product_id: string; |
@@ -15,3 +15,13 @@ import { z } from "zod"; | ||
_securityKey: string; | ||
/** | ||
* Constructs a new Recurring instance with a given security key. | ||
* @param securityKey The security key used for authentication with the Recurring API. | ||
*/ | ||
constructor(securityKey: string); | ||
/** | ||
* Adds a new recurring plan with the specified details. | ||
* @param planDetails An optional object containing the plan's details. | ||
* @param planData An optional object containing additional data for the plan. | ||
* @returns A promise that resolves with the status, data, and message of the operation. | ||
*/ | ||
addRecurringPlan(planDetails?: { | ||
@@ -29,2 +39,8 @@ plan_name: string; | ||
}>; | ||
/** | ||
* Edits an existing recurring plan with the specified details. | ||
* @param planDetails An optional object containing the new details of the plan. | ||
* @param planData An optional object containing additional data for editing the plan. | ||
* @returns A promise that resolves with the status, data, and message of the operation. | ||
*/ | ||
editRecurringPlan(planDetails?: { | ||
@@ -43,2 +59,26 @@ current_plan_id: string; | ||
}>; | ||
/** | ||
* Adds a subscription to an existing plan with the specified details. | ||
* @param subscriptionData An optional object containing the subscription's details. | ||
* @param additionalData An optional object containing additional data for the subscription. | ||
* @returns A promise that resolves with the status, data, and message of the operation. | ||
*/ | ||
addSubscriptionToExistingPlan(subscriptionData?: { | ||
plan_id: string; | ||
amount: number; | ||
start_date: string; | ||
day_frequency?: number; | ||
month_frequency?: number; | ||
day_of_month?: number; | ||
}, additionalData?: Partial<AddSubscriptionToExistingPlan>): Promise<{ | ||
status: number; | ||
data?: RecurringResponse; | ||
message: string; | ||
}>; | ||
/** | ||
* Adds a custom subscription using credit card details. | ||
* @param subscriptionData An optional object containing the subscription and credit card details. | ||
* @param additionalData An optional object containing additional data for the subscription. | ||
* @returns A promise that resolves with the status, data, and message of the operation. | ||
*/ | ||
addCustomSubscriptionByCc(subscriptionData?: { | ||
@@ -63,3 +103,3 @@ plan_id: string; | ||
day_of_month?: number; | ||
}, additionalData?: Partial<AddSubscriptionToExistingPlan>): Promise<{ | ||
}, additionalData?: Partial<AddCustomSubscription>): Promise<{ | ||
status: number; | ||
@@ -69,2 +109,8 @@ data?: RecurringResponse; | ||
}>; | ||
/** | ||
* Adds a custom subscription using ACH (Automated Clearing House) details. | ||
* @param subscriptionData An optional object containing the subscription and ACH details. | ||
* @param additionalData An optional object containing additional data for the subscription. | ||
* @returns A promise that resolves with the status, data, and message of the operation. | ||
*/ | ||
addCustomSubscriptionByAch(subscriptionData?: { | ||
@@ -95,5 +141,22 @@ plan_id: string; | ||
}>; | ||
/** | ||
* Updates an existing subscription with the specified details. | ||
* @param subscriptionData An optional object containing the new details of the subscription. | ||
* @param additionalData An optional object containing additional data for updating the subscription. | ||
* @returns A promise that resolves with the status, data, and message of the operation. | ||
*/ | ||
updateSubscription(subscriptionData?: { | ||
subscription_id: string; | ||
amount: number; | ||
plan_amount: number; | ||
start_date?: string; | ||
first_name?: string; | ||
last_name?: string; | ||
address1?: string; | ||
address2?: string; | ||
city?: string; | ||
state?: string; | ||
zip?: string; | ||
country?: string; | ||
phone?: string; | ||
email?: string; | ||
plan_payments?: number; | ||
@@ -108,2 +171,8 @@ day_frequency?: number; | ||
}>; | ||
/** | ||
* Deletes an existing subscription with the specified ID. | ||
* @param subscriptionData An optional object containing the ID of the subscription to be deleted. | ||
* @param additionalData An optional object containing additional data for the deletion request. | ||
* @returns A promise that resolves with the status, data, and message of the operation. | ||
*/ | ||
deleteSubscription(subscriptionData?: { | ||
@@ -110,0 +179,0 @@ subscription_id: string; |
@@ -14,3 +14,13 @@ import { z } from "zod"; | ||
_securityKey: string; | ||
/** | ||
* Constructs a new Transactions instance with a given security key. | ||
* @param securityKey The security key used for authentication with the Transactions API. | ||
*/ | ||
constructor(securityKey: string); | ||
/** | ||
* Creates a new transaction with the specified details. | ||
* @param transactionData Optional object containing transaction details. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
createTransaction(transactionData?: { | ||
@@ -28,2 +38,8 @@ amount: number; | ||
}>; | ||
/** | ||
* Authorizes a transaction with the specified details. | ||
* @param transactionData Optional object containing transaction details for authorization. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
authorizeTransaction(transactionData?: { | ||
@@ -39,2 +55,8 @@ amount: number; | ||
}>; | ||
/** | ||
* Validates a transaction with the specified details. | ||
* @param transactionData Optional object containing transaction details for validation. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
validateTransaction(transactionData?: { | ||
@@ -49,2 +71,8 @@ ccnumber: string; | ||
}>; | ||
/** | ||
* Captures a previously authorized transaction. | ||
* @param transactionData Optional object containing transaction details for capture. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
captureTransaction(transactionData?: { | ||
@@ -58,2 +86,8 @@ transactionid: string; | ||
}>; | ||
/** | ||
* Refunds a previously settled transaction. | ||
* @param transactionData Optional object containing transaction details for refund. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
refundTransaction(transactionData?: { | ||
@@ -67,2 +101,8 @@ transactionid: string; | ||
}>; | ||
/** | ||
* Voids a previously authorized transaction. | ||
* @param transactionData Optional object containing transaction details for voiding. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
voidTransaction(transactionData?: { | ||
@@ -75,2 +115,8 @@ transactionid: string; | ||
}>; | ||
/** | ||
* Updates a previously created transaction. | ||
* @param transactionData Optional object containing transaction details for updating. | ||
* @param additionalOptions Optional object containing additional request options. | ||
* @returns A promise that resolves with the operation status, data, and message. | ||
*/ | ||
updateTransaction(transactionData?: { | ||
@@ -77,0 +123,0 @@ transactionid: string; |
{ | ||
"name": "znmi", | ||
"type": "module", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "A simple and easy TypeScript wrapper around NMI's API", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -116,2 +116,3 @@ # ZNMI TypeScript Wrapper | ||
0.1.9 - Added uh whatever they're called in javascript, JSDocs? type hints and descriptions to the functions kay? | ||
0.1.8 - Added missing function to recurring for adding a custom subscription by credit card, rather than only ACH, also updated ZOD parses to use safeParse rather than parse | ||
@@ -118,0 +119,0 @@ 0.1.7 - Exported types for requests and such from the functions, in theory that'll fix the typehints not showing up |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
428225
6.32%8499
6%125
0.81%