@closeloop/sdk 0.1.0

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.
@@ -0,0 +1,26 @@
1
+ export { A as AuthenticationError, B as Balances, k as BatchConsumeParams, l as BatchConsumeResponse, C as CloseLoop, c as CloseLoopError, a as CloseLoopOptions, i as ConsumeCreditsParams, j as ConsumeCreditsResponse, m as CreditBalance, r as CreditStats, o as CreditTransaction, b as Credits, d as CreditsExpiredError, v as CreditsExpiredPayload, u as CreditsLowPayload, G as GetBalanceParams, I as InsufficientCreditsError, L as ListBalancesParams, n as ListBalancesResponse, p as ListTransactionsParams, q as ListTransactionsResponse, N as NetworkError, e as NotFoundError, P as PaymentSuccessPayload, R as RateLimitError, f as ValidationError, g as VerifyCreditsParams, h as VerifyCreditsResponse, V as VerifyWebhookParams, t as WebhookEvent, s as WebhookEventType, w as WebhookPayload, W as Webhooks } from './errors-B0i1OvBd.mjs';
2
+
3
+ /**
4
+ * Generic schema interface for validation
5
+ */
6
+ interface ValidationSchema<T> {
7
+ safeParse: (data: unknown) => {
8
+ success: boolean;
9
+ data?: T;
10
+ error?: {
11
+ message: string;
12
+ };
13
+ };
14
+ }
15
+ /**
16
+ * Validate input against a Zod schema
17
+ * Throws CloseLoopError if validation fails
18
+ *
19
+ * @param schema - Zod schema to validate against
20
+ * @param data - Data to validate
21
+ * @returns Validated and typed data
22
+ * @throws {CloseLoopError} When validation fails
23
+ */
24
+ declare function validateInput<T>(schema: ValidationSchema<T>, data: unknown): T;
25
+
26
+ export { validateInput };
@@ -0,0 +1,26 @@
1
+ export { A as AuthenticationError, B as Balances, k as BatchConsumeParams, l as BatchConsumeResponse, C as CloseLoop, c as CloseLoopError, a as CloseLoopOptions, i as ConsumeCreditsParams, j as ConsumeCreditsResponse, m as CreditBalance, r as CreditStats, o as CreditTransaction, b as Credits, d as CreditsExpiredError, v as CreditsExpiredPayload, u as CreditsLowPayload, G as GetBalanceParams, I as InsufficientCreditsError, L as ListBalancesParams, n as ListBalancesResponse, p as ListTransactionsParams, q as ListTransactionsResponse, N as NetworkError, e as NotFoundError, P as PaymentSuccessPayload, R as RateLimitError, f as ValidationError, g as VerifyCreditsParams, h as VerifyCreditsResponse, V as VerifyWebhookParams, t as WebhookEvent, s as WebhookEventType, w as WebhookPayload, W as Webhooks } from './errors-B0i1OvBd.js';
2
+
3
+ /**
4
+ * Generic schema interface for validation
5
+ */
6
+ interface ValidationSchema<T> {
7
+ safeParse: (data: unknown) => {
8
+ success: boolean;
9
+ data?: T;
10
+ error?: {
11
+ message: string;
12
+ };
13
+ };
14
+ }
15
+ /**
16
+ * Validate input against a Zod schema
17
+ * Throws CloseLoopError if validation fails
18
+ *
19
+ * @param schema - Zod schema to validate against
20
+ * @param data - Data to validate
21
+ * @returns Validated and typed data
22
+ * @throws {CloseLoopError} When validation fails
23
+ */
24
+ declare function validateInput<T>(schema: ValidationSchema<T>, data: unknown): T;
25
+
26
+ export { validateInput };