payment-kit 1.16.2 → 1.16.3
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/api/src/crons/index.ts
CHANGED
|
@@ -97,7 +97,7 @@ function init() {
|
|
|
97
97
|
name: 'metering.subscription.detection',
|
|
98
98
|
time: meteringSubscriptionDetectionCronTime,
|
|
99
99
|
fn: () => createMeteringSubscriptionDetection(),
|
|
100
|
-
options: { runOnInit:
|
|
100
|
+
options: { runOnInit: true },
|
|
101
101
|
},
|
|
102
102
|
],
|
|
103
103
|
onError: (error: Error, name: string) => {
|
|
@@ -124,10 +124,10 @@ export class MeteringSubscriptionDetectionTemplate implements BaseEmailTemplate<
|
|
|
124
124
|
}
|
|
125
125
|
})
|
|
126
126
|
);
|
|
127
|
-
const meteringInvoiceIds = meteringInvoices.map((invoice) => invoice.id);
|
|
128
|
-
const meteringSubscriptionIds =
|
|
129
|
-
.map((invoice) => invoice?.subscription_id)
|
|
130
|
-
|
|
127
|
+
const meteringInvoiceIds = Array.from(new Set(meteringInvoices.map((invoice) => invoice.id)));
|
|
128
|
+
const meteringSubscriptionIds = Array.from(
|
|
129
|
+
new Set(meteringInvoices.map((invoice) => invoice?.subscription_id).filter(Boolean) as string[])
|
|
130
|
+
);
|
|
131
131
|
|
|
132
132
|
const abnormalSubscriptions = await this.getAbnormalSubscriptions(meteringInvoiceIds, meteringSubscriptionIds);
|
|
133
133
|
const userDid = await getOwnerDid();
|
|
@@ -141,7 +141,7 @@ export class MeteringSubscriptionDetectionTemplate implements BaseEmailTemplate<
|
|
|
141
141
|
locale,
|
|
142
142
|
userDid,
|
|
143
143
|
summary: {
|
|
144
|
-
totalCount:
|
|
144
|
+
totalCount: meteringSubscriptionIds.length,
|
|
145
145
|
normalCount: Math.max(0, meteringSubscriptionIds.length - abnormalSubscriptions.subscriptions.length),
|
|
146
146
|
unreportedCount: abnormalSubscriptions.unreported.length,
|
|
147
147
|
discrepantCount: abnormalSubscriptions.discrepant.length,
|
package/blocklet.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payment-kit",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.3",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "blocklet dev --open",
|
|
6
6
|
"eject": "vite eject",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@arcblock/validator": "^1.18.147",
|
|
54
54
|
"@blocklet/js-sdk": "1.16.33-beta-20241031-073543-49b1ff9b",
|
|
55
55
|
"@blocklet/logger": "1.16.33-beta-20241031-073543-49b1ff9b",
|
|
56
|
-
"@blocklet/payment-react": "1.16.
|
|
56
|
+
"@blocklet/payment-react": "1.16.3",
|
|
57
57
|
"@blocklet/sdk": "1.16.33-beta-20241031-073543-49b1ff9b",
|
|
58
58
|
"@blocklet/ui-react": "^2.10.67",
|
|
59
59
|
"@blocklet/uploader": "^0.1.52",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@abtnode/types": "1.16.33-beta-20241031-073543-49b1ff9b",
|
|
122
122
|
"@arcblock/eslint-config-ts": "^0.3.3",
|
|
123
|
-
"@blocklet/payment-types": "1.16.
|
|
123
|
+
"@blocklet/payment-types": "1.16.3",
|
|
124
124
|
"@types/cookie-parser": "^1.4.7",
|
|
125
125
|
"@types/cors": "^2.8.17",
|
|
126
126
|
"@types/debug": "^4.1.12",
|
|
@@ -166,5 +166,5 @@
|
|
|
166
166
|
"parser": "typescript"
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
|
-
"gitHead": "
|
|
169
|
+
"gitHead": "6accc56a51e4ea0906e65f69dc5f41eaa82685fb"
|
|
170
170
|
}
|