@blocklet/payment-js 1.25.6 → 1.25.8
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 +30 -0
- package/lib/resources/credit-grant.d.ts +41 -0
- package/lib/resources/credit-grant.js +13 -0
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -435,6 +435,36 @@ declare const _default: {
|
|
|
435
435
|
totalPages: number;
|
|
436
436
|
};
|
|
437
437
|
}>;
|
|
438
|
+
stats: (_params: {
|
|
439
|
+
granted_by?: string;
|
|
440
|
+
category?: "paid" | "promotional";
|
|
441
|
+
currency_id: string;
|
|
442
|
+
start_date: number;
|
|
443
|
+
end_date: number;
|
|
444
|
+
timezone_offset?: number;
|
|
445
|
+
}, data?: never) => Promise<{
|
|
446
|
+
stats: {
|
|
447
|
+
currency_id: string;
|
|
448
|
+
currency: {
|
|
449
|
+
id: string;
|
|
450
|
+
name: string;
|
|
451
|
+
symbol: string;
|
|
452
|
+
decimal: number;
|
|
453
|
+
} | null;
|
|
454
|
+
grant_count: number;
|
|
455
|
+
total_granted: string;
|
|
456
|
+
total_remaining: string;
|
|
457
|
+
total_consumed: string;
|
|
458
|
+
};
|
|
459
|
+
daily_stats: Array<{
|
|
460
|
+
date: string;
|
|
461
|
+
currency_id: string;
|
|
462
|
+
grant_count: number;
|
|
463
|
+
total_granted: string;
|
|
464
|
+
total_remaining: string;
|
|
465
|
+
total_consumed: string;
|
|
466
|
+
}>;
|
|
467
|
+
}>;
|
|
438
468
|
};
|
|
439
469
|
creditTransactions: {
|
|
440
470
|
retrieve: (_params: string, data?: never) => Promise<import("@blocklet/payment-types").TCreditTransactionExpanded>;
|
|
@@ -64,6 +64,37 @@ type HoldersResponse = {
|
|
|
64
64
|
totalPages: number;
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
+
type StatsParams = {
|
|
68
|
+
granted_by?: string;
|
|
69
|
+
category?: 'paid' | 'promotional';
|
|
70
|
+
currency_id: string;
|
|
71
|
+
start_date: number;
|
|
72
|
+
end_date: number;
|
|
73
|
+
timezone_offset?: number;
|
|
74
|
+
};
|
|
75
|
+
type StatsResponse = {
|
|
76
|
+
stats: {
|
|
77
|
+
currency_id: string;
|
|
78
|
+
currency: {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
symbol: string;
|
|
82
|
+
decimal: number;
|
|
83
|
+
} | null;
|
|
84
|
+
grant_count: number;
|
|
85
|
+
total_granted: string;
|
|
86
|
+
total_remaining: string;
|
|
87
|
+
total_consumed: string;
|
|
88
|
+
};
|
|
89
|
+
daily_stats: Array<{
|
|
90
|
+
date: string;
|
|
91
|
+
currency_id: string;
|
|
92
|
+
grant_count: number;
|
|
93
|
+
total_granted: string;
|
|
94
|
+
total_remaining: string;
|
|
95
|
+
total_consumed: string;
|
|
96
|
+
}>;
|
|
97
|
+
};
|
|
67
98
|
declare const _default: {
|
|
68
99
|
create: (data: CreateCreditGrantData, params?: never) => Promise<TCreditGrantExpanded>;
|
|
69
100
|
retrieve: (_params: string, data?: never) => Promise<TCreditGrantExpanded>;
|
|
@@ -90,5 +121,15 @@ declare const _default: {
|
|
|
90
121
|
* @param params.livemode - Filter by livemode
|
|
91
122
|
*/
|
|
92
123
|
holders: (_params: HoldersParams, data?: never) => Promise<HoldersResponse>;
|
|
124
|
+
/**
|
|
125
|
+
* Get credit grant statistics with flexible filtering
|
|
126
|
+
* @param params.granted_by - Filter by DID of who granted the credits
|
|
127
|
+
* @param params.category - Filter by category ('paid' | 'promotional')
|
|
128
|
+
* @param params.currency_id - Filter by currency (required)
|
|
129
|
+
* @param params.start_date - Filter by start date in Unix timestamp (required)
|
|
130
|
+
* @param params.end_date - Filter by end date in Unix timestamp (required)
|
|
131
|
+
* @param params.timezone_offset - Minutes offset from UTC, used for daily grouping
|
|
132
|
+
*/
|
|
133
|
+
stats: (_params: StatsParams, data?: never) => Promise<StatsResponse>;
|
|
93
134
|
};
|
|
94
135
|
export default _default;
|
|
@@ -37,4 +37,17 @@ exports.default = {
|
|
|
37
37
|
method: 'GET',
|
|
38
38
|
path: '/api/credit-grants/holders',
|
|
39
39
|
}),
|
|
40
|
+
/**
|
|
41
|
+
* Get credit grant statistics with flexible filtering
|
|
42
|
+
* @param params.granted_by - Filter by DID of who granted the credits
|
|
43
|
+
* @param params.category - Filter by category ('paid' | 'promotional')
|
|
44
|
+
* @param params.currency_id - Filter by currency (required)
|
|
45
|
+
* @param params.start_date - Filter by start date in Unix timestamp (required)
|
|
46
|
+
* @param params.end_date - Filter by end date in Unix timestamp (required)
|
|
47
|
+
* @param params.timezone_offset - Minutes offset from UTC, used for daily grouping
|
|
48
|
+
*/
|
|
49
|
+
stats: (0, resource_1.createResourceMethod)({
|
|
50
|
+
method: 'GET',
|
|
51
|
+
path: '/api/credit-grants/stats',
|
|
52
|
+
}),
|
|
40
53
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-js",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.8",
|
|
4
4
|
"description": "Node.js client for Payment Kit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"types",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@blocklet/constant": "^1.17.8-beta-20260104-120132-cb5b1914",
|
|
40
|
-
"@blocklet/payment-types": "1.25.
|
|
40
|
+
"@blocklet/payment-types": "1.25.8",
|
|
41
41
|
"@blocklet/sdk": "^1.17.8-beta-20260104-120132-cb5b1914"
|
|
42
42
|
},
|
|
43
43
|
"importSort": {
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"type-fest": "^4.41.0",
|
|
65
65
|
"typescript": "5.5.4"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "b40c46bcf52d4c1758bb10eb4c4583355960e18f"
|
|
68
68
|
}
|