@blocklet/payment-js 1.19.2 → 1.19.4

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
@@ -41,7 +41,6 @@ declare const _default: {
41
41
  did?: string;
42
42
  }>, data?: never) => Promise<import("@blocklet/payment-types").Paginated<import("@blocklet/payment-types").TCustomerExpanded>>;
43
43
  search: (_params: any, data?: never) => Promise<import("@blocklet/payment-types").Paginated<import("@blocklet/payment-types").TCustomerExpanded>>;
44
- me: (_params: never, data?: never) => Promise<import("@blocklet/payment-types").TCustomerExpanded>;
45
44
  overdueInvoices: (_params: string, data?: never) => Promise<{
46
45
  customer: import("sequelize").InferAttributes<import("@blocklet/payment-types").Customer, {
47
46
  omit: never;
@@ -371,6 +370,7 @@ declare const _default: {
371
370
  customer_id?: string;
372
371
  subscription_id?: string;
373
372
  credit_grant_id?: string;
373
+ meter_id?: string;
374
374
  source?: string;
375
375
  start?: number;
376
376
  end?: number;
@@ -388,6 +388,7 @@ declare const _default: {
388
388
  customer_id?: string;
389
389
  subscription_id?: string;
390
390
  currency_id?: string;
391
+ meter_id?: string;
391
392
  start?: number;
392
393
  end?: number;
393
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
  };
@@ -10,7 +10,6 @@ declare const _default: {
10
10
  did?: string;
11
11
  }>, data?: never) => Promise<Paginated<TCustomerExpanded>>;
12
12
  search: (_params: any, data?: never) => Promise<Paginated<TCustomerExpanded>>;
13
- me: (_params: never, data?: never) => Promise<TCustomerExpanded>;
14
13
  overdueInvoices: (_params: string, data?: never) => Promise<{
15
14
  customer: import("sequelize").InferAttributes<import("@blocklet/payment-types").Customer, {
16
15
  omit: never;
@@ -2,10 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const resource_1 = require("../resource");
4
4
  exports.default = {
5
- // create: createResourceCreateMethod<TCustomer, Partial<TCustomer>, never>({
6
- // method: 'POST',
7
- // path: '/api/customers',
8
- // }),
9
5
  // get customer by id or did
10
6
  retrieve: (0, resource_1.createResourceMethod)({ method: 'GET', path: '/api/customers/{id}' }),
11
7
  update: (0, resource_1.createResourceMethod)({
@@ -20,10 +16,6 @@ exports.default = {
20
16
  method: 'GET',
21
17
  path: '/api/customers/search',
22
18
  }),
23
- me: (0, resource_1.createResourceMethod)({
24
- method: 'GET',
25
- path: '/api/customers/me',
26
- }),
27
19
  overdueInvoices: (0, resource_1.createResourceMethod)({
28
20
  method: 'GET',
29
21
  path: '/api/customers/{id}/overdue/invoices',
@@ -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.2",
3
+ "version": "1.19.4",
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.2",
40
- "@blocklet/sdk": "^1.16.44"
39
+ "@blocklet/payment-types": "1.19.4",
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": "741c897204afc412721a942201516932bff59235"
66
+ "gitHead": "ced79cc9e205a344b6fdce2f43ac8d27bb37f5f4"
67
67
  }