@rewloy/node 0.2.1 → 0.2.2
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/CHANGELOG.md +31 -0
- package/README.md +73 -1
- package/dist/client.d.ts +3 -1
- package/dist/client.js +16 -3
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js +3 -0
- package/dist/generated/methods.d.ts +58 -34
- package/dist/generated/methods.js +61 -35
- package/dist/generated/operations.d.ts +1 -1
- package/dist/generated/operations.js +6 -2
- package/dist/generated/types.d.ts +179 -90
- package/dist/generated/types.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/generated/types.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* const rewloy = new Rewloy({ apiKey: process.env.REWLOY_API_KEY! });
|
|
7
7
|
* ```
|
|
8
8
|
*/
|
|
9
|
-
export { Rewloy, DEFAULT_BASE_URL } from './client.js';
|
|
9
|
+
export { Rewloy, DEFAULT_BASE_URL, parseRateLimit } from './client.js';
|
|
10
10
|
export type { RewloyOptions } from './client.js';
|
|
11
11
|
export { RewloyError, RateLimitError, RewloyConnectionError, RewloyTimeoutError } from './errors.js';
|
|
12
12
|
export type { RewloyErrorInit } from './errors.js';
|
|
@@ -15,7 +15,7 @@ export type { ServerSentEvent } from './sse.js';
|
|
|
15
15
|
export { verifyWebhook, signWebhook, WebhookSignatureError } from './webhooks.js';
|
|
16
16
|
export type { WebhookEvent, PassEventData, VerifyWebhookOptions, SignWebhookOptions, WebhookSignatureReason } from './webhooks.js';
|
|
17
17
|
export { OPERATIONS, ERROR_TITLES, API_VERSION } from './generated/operations.js';
|
|
18
|
-
export type { ApiResponse, AuthKind, HttpMethod, OperationMeta, Page, RequestOptions, ResponseKind, StreamOptions } from './types.js';
|
|
18
|
+
export type { ApiResponse, AuthKind, HttpMethod, OperationMeta, Page, RateLimitInfo, RequestOptions, ResponseKind, StreamOptions } from './types.js';
|
|
19
19
|
export type * from './generated/types.js';
|
|
20
20
|
export { VERSION } from './version.js';
|
|
21
21
|
import { Rewloy } from './client.js';
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* const rewloy = new Rewloy({ apiKey: process.env.REWLOY_API_KEY! });
|
|
7
7
|
* ```
|
|
8
8
|
*/
|
|
9
|
-
export { Rewloy, DEFAULT_BASE_URL } from "./client.js";
|
|
9
|
+
export { Rewloy, DEFAULT_BASE_URL, parseRateLimit } from "./client.js";
|
|
10
10
|
export { RewloyError, RateLimitError, RewloyConnectionError, RewloyTimeoutError } from "./errors.js";
|
|
11
11
|
export { EventStream, SseParser } from "./sse.js";
|
|
12
12
|
export { verifyWebhook, signWebhook, WebhookSignatureError } from "./webhooks.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -83,6 +83,18 @@ export interface Page<T> {
|
|
|
83
83
|
data: T[];
|
|
84
84
|
meta: PageMeta;
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* The request budget the API reports on every answer to an authenticated call
|
|
88
|
+
* (`RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`).
|
|
89
|
+
*/
|
|
90
|
+
export interface RateLimitInfo {
|
|
91
|
+
/** `RateLimit-Limit`: requests allowed per minute. */
|
|
92
|
+
limit: number;
|
|
93
|
+
/** `RateLimit-Remaining`: requests left in this minute. */
|
|
94
|
+
remaining: number;
|
|
95
|
+
/** `RateLimit-Reset`: seconds until the limit renews. */
|
|
96
|
+
reset: number;
|
|
97
|
+
}
|
|
86
98
|
/** The whole answer to a call (`Rewloy.request`). */
|
|
87
99
|
export interface ApiResponse<T> {
|
|
88
100
|
/** What `data` held (a `Blob` for files, `undefined` for 204). */
|
|
@@ -94,6 +106,8 @@ export interface ApiResponse<T> {
|
|
|
94
106
|
headers: Headers;
|
|
95
107
|
/** `x-request-id`: quote it to Rewloy support. */
|
|
96
108
|
requestId: string | null;
|
|
109
|
+
/** The `RateLimit-*` headers; `null` when the answer carries none (anonymous calls). */
|
|
110
|
+
rateLimit: RateLimitInfo | null;
|
|
97
111
|
/**
|
|
98
112
|
* `Rewloy-Mode`: which mode answered (`test` for test keys, once the platform
|
|
99
113
|
* has test mode); `null` when the answer does not say.
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** This library's version (package.json's; test/client.test.ts keeps them equal). */
|
|
2
|
-
export declare const VERSION = "0.2.
|
|
2
|
+
export declare const VERSION = "0.2.2";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** This library's version (package.json's; test/client.test.ts keeps them equal). */
|
|
2
|
-
export const VERSION = '0.2.
|
|
2
|
+
export const VERSION = '0.2.2';
|
package/package.json
CHANGED