@lavapayments/nodejs 7.0.0 → 8.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 +2 -2
- package/dist/index.d.mts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,8 +38,8 @@ console.log(checkoutSession.checkout_session_token);
|
|
|
38
38
|
```typescript
|
|
39
39
|
// Generate a forward token
|
|
40
40
|
const forwardToken = lava.generateForwardToken({
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
connection_id: 'connection_id',
|
|
42
|
+
meter_slug: 'meter_slug',
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
// Use the token to make an API request through Lava
|
package/dist/index.d.mts
CHANGED
|
@@ -18,8 +18,8 @@ interface RequestsListParams {
|
|
|
18
18
|
}
|
|
19
19
|
interface CreateRequestParams {
|
|
20
20
|
request_id: string;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
connection_id: string;
|
|
22
|
+
meter_slug: string;
|
|
23
23
|
metadata?: Record<string, string>;
|
|
24
24
|
input_tokens?: number;
|
|
25
25
|
output_tokens?: number;
|
|
@@ -95,7 +95,6 @@ type RestConnectionSubscriptionResponse = {
|
|
|
95
95
|
};
|
|
96
96
|
type RestConnection = {
|
|
97
97
|
connection_id: string;
|
|
98
|
-
connection_secret: string;
|
|
99
98
|
has_lava_credit_balance: boolean;
|
|
100
99
|
customer: RestConnectionCustomer;
|
|
101
100
|
subscription: RestConnectionSubscription | null;
|
|
@@ -251,7 +250,7 @@ type RestMeterTier = {
|
|
|
251
250
|
};
|
|
252
251
|
type RestMeter = {
|
|
253
252
|
meter_id: string;
|
|
254
|
-
|
|
253
|
+
meter_slug: string;
|
|
255
254
|
name: string;
|
|
256
255
|
rate_type: 'fixed' | 'percentage';
|
|
257
256
|
token_basis: 'input+output' | 'output';
|
|
@@ -443,12 +442,12 @@ interface Config {
|
|
|
443
442
|
baseUrl?: string;
|
|
444
443
|
}
|
|
445
444
|
type ForwardTokenOptions = {
|
|
446
|
-
|
|
447
|
-
|
|
445
|
+
connection_id: string;
|
|
446
|
+
meter_slug: string;
|
|
448
447
|
provider_key?: string;
|
|
449
448
|
} | {
|
|
450
|
-
|
|
451
|
-
|
|
449
|
+
connection_id: null;
|
|
450
|
+
meter_slug: null;
|
|
452
451
|
provider_key: string;
|
|
453
452
|
};
|
|
454
453
|
declare class Lava {
|
package/dist/index.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ interface RequestsListParams {
|
|
|
18
18
|
}
|
|
19
19
|
interface CreateRequestParams {
|
|
20
20
|
request_id: string;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
connection_id: string;
|
|
22
|
+
meter_slug: string;
|
|
23
23
|
metadata?: Record<string, string>;
|
|
24
24
|
input_tokens?: number;
|
|
25
25
|
output_tokens?: number;
|
|
@@ -95,7 +95,6 @@ type RestConnectionSubscriptionResponse = {
|
|
|
95
95
|
};
|
|
96
96
|
type RestConnection = {
|
|
97
97
|
connection_id: string;
|
|
98
|
-
connection_secret: string;
|
|
99
98
|
has_lava_credit_balance: boolean;
|
|
100
99
|
customer: RestConnectionCustomer;
|
|
101
100
|
subscription: RestConnectionSubscription | null;
|
|
@@ -251,7 +250,7 @@ type RestMeterTier = {
|
|
|
251
250
|
};
|
|
252
251
|
type RestMeter = {
|
|
253
252
|
meter_id: string;
|
|
254
|
-
|
|
253
|
+
meter_slug: string;
|
|
255
254
|
name: string;
|
|
256
255
|
rate_type: 'fixed' | 'percentage';
|
|
257
256
|
token_basis: 'input+output' | 'output';
|
|
@@ -443,12 +442,12 @@ interface Config {
|
|
|
443
442
|
baseUrl?: string;
|
|
444
443
|
}
|
|
445
444
|
type ForwardTokenOptions = {
|
|
446
|
-
|
|
447
|
-
|
|
445
|
+
connection_id: string;
|
|
446
|
+
meter_slug: string;
|
|
448
447
|
provider_key?: string;
|
|
449
448
|
} | {
|
|
450
|
-
|
|
451
|
-
|
|
449
|
+
connection_id: null;
|
|
450
|
+
meter_slug: null;
|
|
452
451
|
provider_key: string;
|
|
453
452
|
};
|
|
454
453
|
declare class Lava {
|
package/dist/index.js
CHANGED
|
@@ -416,8 +416,8 @@ var Lava = class {
|
|
|
416
416
|
generateForwardToken(options) {
|
|
417
417
|
const tokenData = {
|
|
418
418
|
secret_key: this.secretKey,
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
connection_id: options.connection_id,
|
|
420
|
+
meter_slug: options.meter_slug,
|
|
421
421
|
provider_key: options.provider_key
|
|
422
422
|
};
|
|
423
423
|
return Buffer.from(JSON.stringify(tokenData)).toString("base64");
|
package/dist/index.mjs
CHANGED
|
@@ -389,8 +389,8 @@ var Lava = class {
|
|
|
389
389
|
generateForwardToken(options) {
|
|
390
390
|
const tokenData = {
|
|
391
391
|
secret_key: this.secretKey,
|
|
392
|
-
|
|
393
|
-
|
|
392
|
+
connection_id: options.connection_id,
|
|
393
|
+
meter_slug: options.meter_slug,
|
|
394
394
|
provider_key: options.provider_key
|
|
395
395
|
};
|
|
396
396
|
return Buffer.from(JSON.stringify(tokenData)).toString("base64");
|