订单提交

This commit is contained in:
ray
2026-05-06 15:13:03 +08:00
parent ac4c7d9c3f
commit d14ed90597
5 changed files with 90 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ const args = process.argv.slice(2);
const command = args[0] || 'sync';
const extraArgs = args.slice(1);
const billsResume = extraArgs.includes('--resume');
const ordersIncremental = extraArgs.includes('--incremental');
for (const arg of extraArgs) {
if (arg.startsWith('--incremental-order-start-date=')) {
@@ -11,7 +12,7 @@ for (const arg of extraArgs) {
}
}
const { login, scheduleSync, syncAll, syncAllIncremental, syncBillsOnly, syncMessagesOnly } = await import('./sync.js');
const { login, scheduleSync, syncAll, syncAllIncremental, syncBillsOnly, syncMessagesOnly, syncOrdersOnly } = await import('./sync.js');
if (command === 'login') {
await login();
@@ -36,6 +37,12 @@ if (command === 'bills') {
process.exit(0);
}
if (command === 'orders') {
const summary = await syncOrdersOnly({ resume: billsResume, incremental: ordersIncremental });
console.log(JSON.stringify(summary, null, 2));
process.exit(0);
}
if (command === 'messages') {
const summary = await syncMessagesOnly({ incremental: config.scheduleMode === 'incremental' });
console.log(JSON.stringify(summary, null, 2));