@lavapayments/nodejs 1.1.0 → 2.0.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/README.md CHANGED
@@ -16,7 +16,7 @@ npm install @lavapayments/nodejs
16
16
  import { Lava } from '@lavapayments/nodejs';
17
17
 
18
18
  const lava = new Lava('your_secret_key', {
19
- apiVersion: '2025-03-10.v1',
19
+ apiVersion: '2025-03-27.v1',
20
20
  });
21
21
  ```
22
22
 
@@ -42,7 +42,7 @@ const forwardToken = lava.generateForwardToken({
42
42
  product_secret: 'product_secret',
43
43
  });
44
44
 
45
- // Use the token to make an API request through Lava's proxy
45
+ // Use the token to make an API request through Lava
46
46
  const response = await fetch(lava.openaiUrl, {
47
47
  method: 'POST',
48
48
  headers: {
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- type ApiVersion = "2025-03-10.v1";
1
+ type ApiVersion = "2025-03-27.v1";
2
2
  interface Config {
3
3
  apiVersion: ApiVersion;
4
4
  /**
@@ -178,13 +178,23 @@ interface RequestsListResponse {
178
178
  next_cursor?: string;
179
179
  }
180
180
  interface UsageData {
181
- date: string;
182
- total_requests: number;
183
- total_usage_tokens: number;
184
- total_usage_cost: string;
185
- total_fee_amount: string;
186
- total_service_charge_amount: string;
187
- total_request_cost: string;
181
+ items: {
182
+ date: string;
183
+ total_requests: number;
184
+ total_usage_tokens: number;
185
+ total_usage_cost: string;
186
+ total_fee_amount: string;
187
+ total_service_charge_amount: string;
188
+ total_request_cost: string;
189
+ }[];
190
+ totals: {
191
+ total_requests: number;
192
+ total_usage_tokens: number;
193
+ total_usage_cost: string;
194
+ total_fee_amount: string;
195
+ total_service_charge_amount: string;
196
+ total_request_cost: string;
197
+ };
188
198
  }
189
199
  interface UsageParams {
190
200
  start: string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- type ApiVersion = "2025-03-10.v1";
1
+ type ApiVersion = "2025-03-27.v1";
2
2
  interface Config {
3
3
  apiVersion: ApiVersion;
4
4
  /**
@@ -178,13 +178,23 @@ interface RequestsListResponse {
178
178
  next_cursor?: string;
179
179
  }
180
180
  interface UsageData {
181
- date: string;
182
- total_requests: number;
183
- total_usage_tokens: number;
184
- total_usage_cost: string;
185
- total_fee_amount: string;
186
- total_service_charge_amount: string;
187
- total_request_cost: string;
181
+ items: {
182
+ date: string;
183
+ total_requests: number;
184
+ total_usage_tokens: number;
185
+ total_usage_cost: string;
186
+ total_fee_amount: string;
187
+ total_service_charge_amount: string;
188
+ total_request_cost: string;
189
+ }[];
190
+ totals: {
191
+ total_requests: number;
192
+ total_usage_tokens: number;
193
+ total_usage_cost: string;
194
+ total_fee_amount: string;
195
+ total_service_charge_amount: string;
196
+ total_request_cost: string;
197
+ };
188
198
  }
189
199
  interface UsageParams {
190
200
  start: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lavapayments/nodejs",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "description": "Backend SDK for Lava Payments API - enabling usage-based billing for AI services",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",