@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.
@@ -1,3 +1,3 @@
1
1
  // Generated by scripts/generate.ts from the Rewloy OpenAPI document
2
- // (openapi/openapi.json, API 1.0.0). Do not edit: run `npm run generate`.
2
+ // (openapi/openapi.json, API 1.1.0). Do not edit: run `npm run generate`.
3
3
  export {};
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.1";
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.1';
2
+ export const VERSION = '0.2.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rewloy/node",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Rewloy API için resmî Node.js ve TypeScript kütüphanesi / The official Node.js and TypeScript library for the Rewloy API",
5
5
  "license": "MIT",
6
6
  "author": "Rewloy",