@blocklet/payment-js 1.19.3 → 1.19.5

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/lib/index.d.ts CHANGED
@@ -370,6 +370,7 @@ declare const _default: {
370
370
  customer_id?: string;
371
371
  subscription_id?: string;
372
372
  credit_grant_id?: string;
373
+ meter_id?: string;
373
374
  source?: string;
374
375
  start?: number;
375
376
  end?: number;
@@ -387,6 +388,7 @@ declare const _default: {
387
388
  customer_id?: string;
388
389
  subscription_id?: string;
389
390
  currency_id?: string;
391
+ meter_id?: string;
390
392
  start?: number;
391
393
  end?: number;
392
394
  }, data?: never) => Promise<import("./resources/credit-transaction").UsageSummary>;
@@ -1,4 +1,4 @@
1
- import type { Paginated, Pagination, TCreditGrantExpanded } from '@blocklet/payment-types';
1
+ import type { Paginated, Pagination, TCreditGrantExpanded, TPaymentCurrency } from '@blocklet/payment-types';
2
2
  export interface CreateCreditGrantData {
3
3
  amount: string;
4
4
  currency_id: string;
@@ -19,20 +19,12 @@ export interface CreateCreditGrantData {
19
19
  export interface UpdateCreditGrantData {
20
20
  metadata?: Record<string, any>;
21
21
  }
22
- export interface CreditSummary {
23
- customer_id: string;
24
- total_balance: Record<string, {
25
- currency_id: string;
26
- total_amount: string;
27
- available_amount: string;
28
- pending_amount: string;
29
- currency: {
30
- id: string;
31
- symbol: string;
32
- decimal: number;
33
- };
34
- }>;
35
- }
22
+ export type CreditSummary = Record<string, {
23
+ paymentCurrency: TPaymentCurrency;
24
+ totalAmount: string;
25
+ remainingAmount: string;
26
+ grantCount: number;
27
+ }>;
36
28
  type ListParams = Pagination<{
37
29
  customer_id?: string;
38
30
  currency_id?: string;
@@ -16,31 +16,24 @@ export interface TCreditTransaction {
16
16
  metadata?: Record<string, any>;
17
17
  }
18
18
  export interface UsageSummary {
19
- customer_id?: string;
20
- subscription_id?: string;
21
- currency_id?: string;
22
- total_consumption: string;
23
- total_grants: string;
24
- net_balance: string;
19
+ total_quantity: string;
20
+ total_credit_amount: string;
25
21
  transaction_count: number;
26
- period_start?: string;
27
- period_end?: string;
28
- breakdown: {
29
- by_type: Record<string, {
30
- amount: string;
31
- count: number;
32
- }>;
33
- by_meter?: Record<string, {
34
- amount: string;
35
- count: number;
36
- meter_name: string;
37
- }>;
22
+ filters: {
23
+ customer_id?: string;
24
+ subscription_id?: string;
25
+ meter_event_name?: string;
26
+ meter_id?: string;
27
+ currency_id?: string;
28
+ start_time?: string;
29
+ end_time?: string;
38
30
  };
39
31
  }
40
32
  type ListParams = Pagination<{
41
33
  customer_id?: string;
42
34
  subscription_id?: string;
43
35
  credit_grant_id?: string;
36
+ meter_id?: string;
44
37
  source?: string;
45
38
  start?: number;
46
39
  end?: number;
@@ -51,6 +44,7 @@ type SummaryParams = {
51
44
  customer_id?: string;
52
45
  subscription_id?: string;
53
46
  currency_id?: string;
47
+ meter_id?: string;
54
48
  start?: number;
55
49
  end?: number;
56
50
  };
@@ -11,7 +11,7 @@ export interface TMeterExpanded extends TMeter {
11
11
  export interface CreateMeterData {
12
12
  name: string;
13
13
  event_name: string;
14
- aggregation_method?: 'sum' | 'count' | 'last';
14
+ aggregation_method?: 'sum';
15
15
  unit: string;
16
16
  currency_id?: string;
17
17
  description?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-js",
3
- "version": "1.19.3",
3
+ "version": "1.19.5",
4
4
  "description": "Node.js client for Payment Kit",
5
5
  "keywords": [
6
6
  "types",
@@ -36,8 +36,8 @@
36
36
  "url": "https://github.com/blocklet/payment-kit/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@blocklet/payment-types": "1.19.3",
40
- "@blocklet/sdk": "^1.16.45"
39
+ "@blocklet/payment-types": "1.19.5",
40
+ "@blocklet/sdk": "^1.16.46"
41
41
  },
42
42
  "importSort": {
43
43
  ".js, .jsx, .mjs": {
@@ -63,5 +63,5 @@
63
63
  "type-fest": "^4.41.0",
64
64
  "typescript": "5.5.4"
65
65
  },
66
- "gitHead": "f274edb338c8f5a23ae46d9f7fea8458a6001cf7"
66
+ "gitHead": "b2cb3888b7efa2cc71591f75240616c36e945b09"
67
67
  }