@tapsilat/tapsilat-js 1.0.2 → 1.0.3
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 +3 -9
- package/dist/TapsilatSDK.d.ts +156 -118
- package/dist/TapsilatSDK.d.ts.map +1 -1
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/index.d.ts +156 -118
- package/dist/index.esm.js +254 -165
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +254 -165
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/utils/index.d.ts +20 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,14 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
[](https://tapsilat.dev)
|
|
6
6
|
|
|
7
7
|
**Enterprise-grade TypeScript SDK for Tapsilat Payment Processing Platform**
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/tapsilat-js)
|
|
10
|
-
[](https://www.typescriptlang.org/)
|
|
11
|
-
[](LICENSE)
|
|
12
|
-
|
|
13
9
|
</div>
|
|
14
10
|
|
|
15
11
|
## 🏢 About Tapsilat
|
|
@@ -50,7 +46,7 @@ const order = await tapsilat.createOrder({
|
|
|
50
46
|
name: "John",
|
|
51
47
|
surname: "Doe",
|
|
52
48
|
email: "john.doe@example.com",
|
|
53
|
-
phone: "+
|
|
49
|
+
phone: "+9099999999",
|
|
54
50
|
},
|
|
55
51
|
description: "Premium subscription - Monthly plan",
|
|
56
52
|
});
|
|
@@ -79,7 +75,7 @@ const order = await tapsilat.createOrder({
|
|
|
79
75
|
name: 'Ahmet',
|
|
80
76
|
surname: 'Yılmaz',
|
|
81
77
|
email: 'ahmet@example.com',
|
|
82
|
-
phone: '+
|
|
78
|
+
phone: '+9099999999'
|
|
83
79
|
},
|
|
84
80
|
description: 'Product purchase',
|
|
85
81
|
callbackUrl: 'https://mystore.com/success',
|
|
@@ -244,8 +240,6 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
244
240
|
## 🔗 Resources
|
|
245
241
|
|
|
246
242
|
- 🌐 **Website**: [https://tapsilat.dev](https://tapsilat.dev)
|
|
247
|
-
- 📚 **API Documentation**: [https://docs.tapsilat.dev](https://docs.tapsilat.dev)
|
|
248
|
-
- 📞 **Support**: [support@tapsilat.dev](mailto:support@tapsilat.dev)
|
|
249
243
|
- 🐛 **Issues**: [GitHub Issues](https://github.com/tapsilat/tapsilat-js/issues)
|
|
250
244
|
|
|
251
245
|
---
|
package/dist/TapsilatSDK.d.ts
CHANGED
|
@@ -43,19 +43,19 @@ export interface OrderCreateResponse {
|
|
|
43
43
|
/**
|
|
44
44
|
* Main SDK class for Tapsilat payment operations
|
|
45
45
|
*
|
|
46
|
-
* @
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
46
|
+
* @summary Enterprise-grade TypeScript SDK for Tapsilat Payment Processing Platform
|
|
47
|
+
* @description
|
|
48
|
+
* The TapsilatSDK class provides a comprehensive interface for integrating with the Tapsilat payment platform.
|
|
49
|
+
* It offers secure, efficient, and type-safe methods for managing orders, payments, refunds, and other
|
|
50
|
+
* payment-related operations. The SDK includes built-in error handling, request validation, retry logic,
|
|
51
|
+
* and comprehensive logging capabilities.
|
|
52
52
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
53
|
+
* Key features:
|
|
54
|
+
* - Type-safe API with TypeScript support
|
|
55
|
+
* - Built-in error handling with custom error types
|
|
56
|
+
* - Automatic request/response validation
|
|
57
|
+
* - Configurable retry mechanism
|
|
58
|
+
* - Full compliance with Tapsilat API specifications
|
|
59
59
|
*/
|
|
60
60
|
export declare class TapsilatSDK {
|
|
61
61
|
private readonly httpClient;
|
|
@@ -63,109 +63,107 @@ export declare class TapsilatSDK {
|
|
|
63
63
|
/**
|
|
64
64
|
* Creates a new TapsilatSDK instance
|
|
65
65
|
*
|
|
66
|
-
* @
|
|
67
|
-
* @
|
|
66
|
+
* @summary Initializes the Tapsilat SDK with configuration options
|
|
67
|
+
* @description
|
|
68
|
+
* Creates and configures a new instance of the TapsilatSDK with the provided configuration.
|
|
69
|
+
* The constructor validates the bearer token, sets up the HTTP client with proper headers,
|
|
70
|
+
* configures retry mechanisms, and initializes internal state for API communication.
|
|
71
|
+
*
|
|
72
|
+
* The SDK instance is immutable after creation - configuration cannot be changed without
|
|
73
|
+
* creating a new instance. This ensures thread safety and predictable behavior.
|
|
74
|
+
*
|
|
75
|
+
* @param {TapsilatConfig} config - SDK configuration options
|
|
76
|
+
* @param {string} config.bearerToken - API authentication token (required)
|
|
77
|
+
* @param {string} [config.baseURL='https://api.tapsilat.com/v1'] - API base URL
|
|
78
|
+
* @param {number} [config.timeout=30000] - Request timeout in milliseconds
|
|
79
|
+
* @param {number} [config.maxRetries=3] - Maximum number of retry attempts
|
|
80
|
+
* @param {number} [config.retryDelay=1000] - Delay between retries in milliseconds
|
|
81
|
+
* @param {string} [config.version='v1'] - API version to use
|
|
82
|
+
* @param {boolean} [config.debug=false] - Enable debug logging
|
|
83
|
+
*
|
|
84
|
+
* @throws {TapsilatValidationError} When bearer token is invalid, missing, or malformed
|
|
85
|
+
* @throws {TypeError} When config parameter is not an object or missing required fields
|
|
68
86
|
*/
|
|
69
87
|
constructor(config: TapsilatConfig);
|
|
70
88
|
/**
|
|
71
|
-
* Creates a new order and returns a checkout URL
|
|
89
|
+
* Creates a new order and returns a checkout URL
|
|
72
90
|
*
|
|
73
|
-
* @
|
|
74
|
-
* @
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
91
|
+
* @summary Initiates a new payment order with buyer information and generates checkout URL
|
|
92
|
+
* @description
|
|
93
|
+
* Creates a new payment order in the Tapsilat system with the provided order details.
|
|
94
|
+
* This method performs comprehensive validation of all input parameters, creates the order
|
|
95
|
+
* on the payment platform, and returns a checkout URL that customers can use to complete
|
|
96
|
+
* their payment. The method supports multiple currencies, locales, and comprehensive
|
|
97
|
+
* buyer information for compliance and fraud prevention.
|
|
78
98
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* const orderResponse = await tapsilat.createOrder({
|
|
83
|
-
* amount: 100.50,
|
|
84
|
-
* currency: 'TRY',
|
|
85
|
-
* locale: 'en',
|
|
86
|
-
* buyer: {
|
|
87
|
-
* name: 'John',
|
|
88
|
-
* surname: 'Doe',
|
|
89
|
-
* email: 'john.doe@example.com'
|
|
90
|
-
* }
|
|
91
|
-
* });
|
|
92
|
-
* console.log(`Checkout URL: ${orderResponse.checkoutUrl}`);
|
|
93
|
-
* } catch (error) {
|
|
94
|
-
* console.error(`Order creation failed: ${error.message}`);
|
|
95
|
-
* }
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
createOrder(orderRequest: OrderCreateRequest): Promise<OrderCreateResponse>;
|
|
99
|
-
/**
|
|
100
|
-
* Validates an order request object
|
|
101
|
-
* @private
|
|
102
|
-
*/
|
|
103
|
-
private validateOrderRequest;
|
|
104
|
-
/**
|
|
105
|
-
* Basic email validation
|
|
106
|
-
* @private
|
|
107
|
-
*/
|
|
108
|
-
private isValidEmail;
|
|
109
|
-
/**
|
|
110
|
-
* Generic response handler - consistent way to handle API responses across SDK methods
|
|
111
|
-
* @private
|
|
99
|
+
* The returned checkout URL is valid for a limited time (typically 24 hours) and should
|
|
100
|
+
* be presented to the customer immediately. The order status can be tracked using the
|
|
101
|
+
* returned reference ID through the getOrderStatus method.
|
|
112
102
|
*
|
|
113
|
-
* @param
|
|
114
|
-
* @param
|
|
115
|
-
* @
|
|
116
|
-
* @
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
*
|
|
121
|
-
* @
|
|
103
|
+
* @param {OrderCreateRequest} orderRequest - Complete order information
|
|
104
|
+
* @param {number} orderRequest.amount - Payment amount (must be positive, max 2 decimal places)
|
|
105
|
+
* @param {Currency} orderRequest.currency - Payment currency ('TRY', 'USD', 'EUR', 'GBP')
|
|
106
|
+
* @param {Locale} orderRequest.locale - Display language ('tr' for Turkish, 'en' for English)
|
|
107
|
+
* @param {Buyer} orderRequest.buyer - Customer information for payment processing
|
|
108
|
+
* @param {string} orderRequest.buyer.name - Customer's first name (required)
|
|
109
|
+
* @param {string} orderRequest.buyer.surname - Customer's last name (required)
|
|
110
|
+
* @param {string} orderRequest.buyer.email - Customer's email address (required, validated)
|
|
111
|
+
* @param {string} [orderRequest.buyer.phone] - Customer's phone number
|
|
112
|
+
* @param {string} [orderRequest.buyer.identityNumber] - National ID or tax number
|
|
113
|
+
* @param {Address} [orderRequest.buyer.shippingAddress] - Shipping address for physical goods
|
|
114
|
+
* @param {Address} [orderRequest.buyer.billingAddress] - Billing address for invoicing
|
|
115
|
+
* @param {string} [orderRequest.description] - Order description for customer reference
|
|
116
|
+
* @param {string} [orderRequest.callbackUrl] - URL to redirect after payment completion
|
|
117
|
+
* @param {string} [orderRequest.conversationId] - Custom tracking ID for your system
|
|
118
|
+
* @param {Record<string, unknown>} [orderRequest.metadata] - Additional custom data
|
|
119
|
+
*
|
|
120
|
+
* @returns {Promise<OrderCreateResponse>} Promise resolving to order creation response
|
|
121
|
+
* @returns {string} OrderCreateResponse.referenceId - Unique order identifier for tracking
|
|
122
|
+
* @returns {string} OrderCreateResponse.conversationId - Echo of provided conversation ID
|
|
123
|
+
* @returns {string} OrderCreateResponse.checkoutUrl - Payment page URL for customer
|
|
124
|
+
* @returns {string} OrderCreateResponse.status - Initial order status (typically 'CREATED')
|
|
125
|
+
* @returns {string} [OrderCreateResponse.qrCodeUrl] - QR code URL for mobile payments
|
|
122
126
|
*
|
|
123
|
-
* @
|
|
124
|
-
*
|
|
125
|
-
*
|
|
127
|
+
* @throws {TapsilatValidationError} When input validation fails:
|
|
128
|
+
* - Amount is not positive or has more than 2 decimal places
|
|
129
|
+
* - Currency is not supported
|
|
130
|
+
* - Buyer information is incomplete or invalid
|
|
131
|
+
* - Email format is invalid
|
|
132
|
+
* - Required fields are missing
|
|
133
|
+
* @throws {TapsilatNetworkError} When network request fails:
|
|
134
|
+
* - Connection timeout
|
|
135
|
+
* - DNS resolution failure
|
|
136
|
+
* - Network connectivity issues
|
|
137
|
+
* @throws {TapsilatError} When API returns business logic errors:
|
|
138
|
+
* - Insufficient merchant balance
|
|
139
|
+
* - Currency not enabled for merchant
|
|
140
|
+
* - Buyer blocked due to fraud detection
|
|
141
|
+
* - Rate limiting exceeded
|
|
126
142
|
*/
|
|
127
|
-
|
|
143
|
+
createOrder(orderRequest: OrderCreateRequest): Promise<OrderCreateResponse>;
|
|
128
144
|
/**
|
|
129
145
|
* Gets an order by reference ID.
|
|
130
146
|
*
|
|
147
|
+
* @summary Retrieve complete order details and information
|
|
148
|
+
* @description Gets complete order data including buyer info, amounts, and current status using the unique reference ID.
|
|
149
|
+
*
|
|
131
150
|
* @param referenceId - The unique reference ID of the order
|
|
132
151
|
* @returns Promise resolving to the complete order details
|
|
133
152
|
* @throws {TapsilatValidationError} When referenceId is invalid
|
|
134
153
|
* @throws {TapsilatNetworkError} When API request fails due to network issues
|
|
135
154
|
* @throws {TapsilatError} When API returns an error response
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```typescript
|
|
139
|
-
* try {
|
|
140
|
-
* const order = await tapsilat.getOrder("ord_123456789");
|
|
141
|
-
* console.log(`Order amount: ${order.amount} ${order.currency}`);
|
|
142
|
-
* } catch (error) {
|
|
143
|
-
* console.error(`Failed to get order: ${error.message}`);
|
|
144
|
-
* }
|
|
145
|
-
* ```
|
|
146
155
|
*/
|
|
147
156
|
getOrder(referenceId: string): Promise<Order>;
|
|
148
157
|
/**
|
|
149
158
|
* Lists orders with pagination support.
|
|
150
159
|
*
|
|
160
|
+
* @summary Retrieve paginated list of merchant orders
|
|
161
|
+
* @description Gets orders with pagination support, filtering, and sorting options.
|
|
162
|
+
*
|
|
151
163
|
* @param params - Optional pagination parameters (page number and items per page)
|
|
152
164
|
* @returns Promise resolving to paginated list of orders
|
|
153
165
|
* @throws {TapsilatNetworkError} When API request fails due to network issues
|
|
154
166
|
* @throws {TapsilatError} When API returns an error response
|
|
155
|
-
*
|
|
156
|
-
* @example
|
|
157
|
-
* ```typescript
|
|
158
|
-
* try {
|
|
159
|
-
* // Get the second page with 20 items per page
|
|
160
|
-
* const orderList = await tapsilat.getOrders({ page: 2, per_page: 20 });
|
|
161
|
-
* console.log(`Total orders: ${orderList.total}`);
|
|
162
|
-
* orderList.rows.forEach(order => {
|
|
163
|
-
* console.log(`Order ${order.referenceId}: ${order.amount} ${order.currency}`);
|
|
164
|
-
* });
|
|
165
|
-
* } catch (error) {
|
|
166
|
-
* console.error(`Failed to list orders: ${error.message}`);
|
|
167
|
-
* }
|
|
168
|
-
* ```
|
|
169
167
|
*/
|
|
170
168
|
getOrders(params?: {
|
|
171
169
|
page?: number;
|
|
@@ -173,36 +171,55 @@ export declare class TapsilatSDK {
|
|
|
173
171
|
}): Promise<PaginatedResponse<Order>>;
|
|
174
172
|
/**
|
|
175
173
|
* Cancels an order by reference_id.
|
|
174
|
+
*
|
|
175
|
+
* @summary Cancel a pending order before payment completion
|
|
176
|
+
* @description Cancels unpaid order and prevents further payment processing.
|
|
176
177
|
*/
|
|
177
178
|
cancelOrder(referenceId: string): Promise<Order>;
|
|
178
179
|
/**
|
|
179
|
-
* Gets the status of an order by reference ID
|
|
180
|
+
* Gets the current status of an order by reference ID
|
|
180
181
|
*
|
|
181
|
-
* @
|
|
182
|
-
* @
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
182
|
+
* @summary Retrieves real-time payment status and tracking information for a specific order
|
|
183
|
+
* @description
|
|
184
|
+
* Queries the Tapsilat payment platform to retrieve the current status of an order using its
|
|
185
|
+
* unique reference ID. This method provides real-time information about payment progress,
|
|
186
|
+
* completion status, and last update timestamp. It's essential for tracking payment flow
|
|
187
|
+
* and implementing proper order state management in your application.
|
|
186
188
|
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
* }
|
|
199
|
-
*
|
|
189
|
+
* The status information includes payment state (CREATED, PENDING_PAYMENT, COMPLETED, CANCELLED),
|
|
190
|
+
* last update timestamp, and any relevant status metadata. This method should be used to:
|
|
191
|
+
* - Check if a payment has been completed after redirecting from checkout
|
|
192
|
+
* - Monitor payment status for pending transactions
|
|
193
|
+
* - Verify order state before fulfilling goods/services
|
|
194
|
+
* - Implement webhook verification and status synchronization
|
|
195
|
+
*
|
|
196
|
+
* @param {string} referenceId - Unique order reference identifier from order creation
|
|
197
|
+
*
|
|
198
|
+
* @returns {Promise<OrderStatusResponse>} Promise resolving to current order status information
|
|
199
|
+
* @returns {string} OrderStatusResponse.referenceId - Echo of the provided reference ID
|
|
200
|
+
* @returns {string} OrderStatusResponse.status - Current payment status (CREATED, PENDING_PAYMENT, COMPLETED, CANCELLED, FAILED)
|
|
201
|
+
* @returns {string} OrderStatusResponse.lastUpdatedAt - ISO 8601 timestamp of last status change
|
|
202
|
+
*
|
|
203
|
+
* @throws {TapsilatValidationError} When input validation fails:
|
|
204
|
+
* - Reference ID is null, undefined, or empty string
|
|
205
|
+
* - Reference ID format is invalid (should match order ID pattern)
|
|
206
|
+
* @throws {TapsilatNetworkError} When network request fails:
|
|
207
|
+
* - Connection timeout during status check
|
|
208
|
+
* - DNS resolution failure
|
|
209
|
+
* - Network connectivity issues
|
|
210
|
+
* @throws {TapsilatError} When API returns business logic errors:
|
|
211
|
+
* - ORDER_NOT_FOUND: Order with given reference ID doesn't exist
|
|
212
|
+
* - ACCESS_DENIED: Order belongs to different merchant
|
|
213
|
+
* - RATE_LIMIT_EXCEEDED: Too many status check requests
|
|
200
214
|
*/
|
|
201
215
|
getOrderStatus(referenceId: string): Promise<OrderStatusResponse>;
|
|
202
216
|
/**
|
|
203
217
|
* Partially refunds an order.
|
|
204
218
|
* Based on `refund_order` from the Python SDK.
|
|
205
219
|
*
|
|
220
|
+
* @summary Process partial refund for a completed order
|
|
221
|
+
* @description Refunds specified amount from a paid order and returns transaction details.
|
|
222
|
+
*
|
|
206
223
|
* @param refundData - The refund details, including referenceId and amount.
|
|
207
224
|
* @returns Promise resolving to the refund transaction details.
|
|
208
225
|
*/
|
|
@@ -211,6 +228,9 @@ export declare class TapsilatSDK {
|
|
|
211
228
|
* Fully refunds an order by its reference ID.
|
|
212
229
|
* Based on `refund_all_order` from the Python SDK.
|
|
213
230
|
*
|
|
231
|
+
* @summary Process full refund for a completed order
|
|
232
|
+
* @description Refunds entire order amount and returns transaction details.
|
|
233
|
+
*
|
|
214
234
|
* @param referenceId - The unique identifier of the order to fully refund.
|
|
215
235
|
* @returns Promise resolving to the refund transaction details.
|
|
216
236
|
*/
|
|
@@ -219,6 +239,9 @@ export declare class TapsilatSDK {
|
|
|
219
239
|
* Retrieves the payment details for an order.
|
|
220
240
|
* Based on `get_order_payment_details` from the Python SDK.
|
|
221
241
|
*
|
|
242
|
+
* @summary Retrieve detailed payment transaction information for an order
|
|
243
|
+
* @description Gets payment method, amount, status, and card info for order transactions.
|
|
244
|
+
*
|
|
222
245
|
* @param referenceId - The unique identifier of the order.
|
|
223
246
|
* @param conversationId - Optional conversation ID for more specific querying.
|
|
224
247
|
* @returns Promise resolving to a list of payment details.
|
|
@@ -227,16 +250,25 @@ export declare class TapsilatSDK {
|
|
|
227
250
|
/**
|
|
228
251
|
* Gets an order by conversation_id.
|
|
229
252
|
* Based on `get_order_by_conversation_id` from the Python SDK.
|
|
253
|
+
*
|
|
254
|
+
* @summary Find order using conversation ID instead of reference ID
|
|
255
|
+
* @description Alternative lookup method for orders using custom conversation identifier.
|
|
230
256
|
*/
|
|
231
257
|
getOrderByConversationId(conversationId: string): Promise<Order>;
|
|
232
258
|
/**
|
|
233
259
|
* Gets order transactions by reference_id.
|
|
234
260
|
* Based on `get_order_transactions` from the Python SDK.
|
|
261
|
+
*
|
|
262
|
+
* @summary Retrieve transaction history for an order
|
|
263
|
+
* @description Gets detailed transaction records and payment attempts for a specific order.
|
|
235
264
|
*/
|
|
236
265
|
getOrderTransactions(referenceId: string): Promise<any[]>;
|
|
237
266
|
/**
|
|
238
267
|
* Gets order submerchants with pagination.
|
|
239
268
|
* Based on `get_order_submerchants` from the Python SDK.
|
|
269
|
+
*
|
|
270
|
+
* @summary Retrieve paginated list of submerchants for orders
|
|
271
|
+
* @description Gets submerchant information with pagination support for order management.
|
|
240
272
|
*/
|
|
241
273
|
getOrderSubmerchants(params?: {
|
|
242
274
|
page?: number;
|
|
@@ -245,29 +277,29 @@ export declare class TapsilatSDK {
|
|
|
245
277
|
/**
|
|
246
278
|
* Gets checkout URL for an order.
|
|
247
279
|
* Based on `get_checkout_url` from the Python SDK.
|
|
280
|
+
*
|
|
281
|
+
* @summary Retrieve checkout URL for existing order
|
|
282
|
+
* @description Gets the payment checkout URL for an existing order using reference ID.
|
|
248
283
|
*/
|
|
249
284
|
getCheckoutUrl(referenceId: string): Promise<string>;
|
|
250
285
|
/**
|
|
251
286
|
* Verifies webhook signature for security
|
|
252
287
|
*
|
|
288
|
+
* @summary Validate webhook signature for security verification
|
|
289
|
+
* @description Verifies the authenticity of webhook payloads using HMAC signature validation.
|
|
290
|
+
*
|
|
253
291
|
* @param payload - Raw webhook payload string
|
|
254
292
|
* @param signature - Webhook signature from headers
|
|
255
293
|
* @param secret - Your webhook secret key
|
|
256
294
|
* @returns Promise resolving to true if signature is valid
|
|
257
|
-
*
|
|
258
|
-
* @example
|
|
259
|
-
* ```typescript
|
|
260
|
-
* const isValid = await sdk.verifyWebhook(
|
|
261
|
-
* JSON.stringify(req.body),
|
|
262
|
-
* req.headers['x-tapsilat-signature'],
|
|
263
|
-
* 'your-webhook-secret'
|
|
264
|
-
* );
|
|
265
|
-
* ```
|
|
266
295
|
*/
|
|
267
296
|
verifyWebhook(payload: string, signature: string, secret: string): Promise<boolean>;
|
|
268
297
|
/**
|
|
269
298
|
* Checks API service health and availability
|
|
270
299
|
*
|
|
300
|
+
* @summary Check API service health and availability
|
|
301
|
+
* @description Verifies that the Tapsilat API service is operational and accessible.
|
|
302
|
+
*
|
|
271
303
|
* @returns Promise resolving to service status
|
|
272
304
|
*/
|
|
273
305
|
healthCheck(): Promise<{
|
|
@@ -277,6 +309,9 @@ export declare class TapsilatSDK {
|
|
|
277
309
|
/**
|
|
278
310
|
* Gets current SDK configuration (without sensitive data)
|
|
279
311
|
*
|
|
312
|
+
* @summary Get current SDK configuration without sensitive information
|
|
313
|
+
* @description Returns a copy of the current configuration with sensitive data (like bearer token) excluded.
|
|
314
|
+
*
|
|
280
315
|
* @returns Copy of current configuration
|
|
281
316
|
*/
|
|
282
317
|
getConfig(): Omit<TapsilatConfig, "bearerToken"> & {
|
|
@@ -285,6 +320,9 @@ export declare class TapsilatSDK {
|
|
|
285
320
|
/**
|
|
286
321
|
* Updates SDK configuration
|
|
287
322
|
*
|
|
323
|
+
* @summary Update SDK configuration with new values
|
|
324
|
+
* @description Updates the SDK configuration with provided values, validating bearer token if changed.
|
|
325
|
+
*
|
|
288
326
|
* @param newConfig - Partial configuration to update
|
|
289
327
|
* @throws {TapsilatValidationError} When Bearer token is invalid
|
|
290
328
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TapsilatSDK.d.ts","sourceRoot":"","sources":["../src/TapsilatSDK.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TapsilatSDK.d.ts","sourceRoot":"","sources":["../src/TapsilatSDK.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,cAAc,EACd,iBAAiB,EACjB,KAAK,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EA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