@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.
- package/LICENSE +21 -0
- package/README.md +478 -0
- package/dist/errors-B0i1OvBd.d.mts +909 -0
- package/dist/errors-B0i1OvBd.d.ts +909 -0
- package/dist/index.d.mts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +883 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +844 -0
- package/dist/index.mjs.map +1 -0
- package/dist/nextjs.d.mts +135 -0
- package/dist/nextjs.d.ts +135 -0
- package/dist/nextjs.js +955 -0
- package/dist/nextjs.js.map +1 -0
- package/dist/nextjs.mjs +920 -0
- package/dist/nextjs.mjs.map +1 -0
- package/package.json +66 -0
package/dist/index.d.mts
ADDED
|
@@ -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 };
|
package/dist/index.d.ts
ADDED
|
@@ -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 };
|