@velaro/cli 1.4.46 → 1.4.48

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.
@@ -201,6 +201,33 @@ async function recognitionSchedule(invoiceId) {
201
201
  console.log(`\nTotal: ${money(rows.reduce((sum, r) => sum + r.amountCents, 0))}\n`);
202
202
  }
203
203
 
204
+ async function setAutoRenew(id, args) {
205
+ if (args.autoRenew == null) {
206
+ console.error('Usage: velaro billing-subscription set-auto-renew <id> --auto-renew true|false');
207
+ process.exit(1);
208
+ }
209
+ const body = { autoRenew: args.autoRenew === 'true' || args.autoRenew === true };
210
+ const result = await request('PUT', `/api/BillingSubscription/${id}/auto-renew`, body);
211
+ console.log(`Subscription ${result.id}: AutoRenew = ${result.autoRenew}`);
212
+ }
213
+
214
+ async function scheduleCadenceChange(id, args) {
215
+ if (args.cadence && !args.effectiveAt) {
216
+ console.error('Usage: velaro billing-subscription schedule-cadence-change <id> --cadence annual|monthly|quarterly --effective-at YYYY-MM-DD');
217
+ console.error(' or: velaro billing-subscription schedule-cadence-change <id> --cancel (cancels a previously-scheduled change)');
218
+ process.exit(1);
219
+ }
220
+ const body = args.cancel
221
+ ? { pendingCadence: null, effectiveAt: null }
222
+ : { pendingCadence: args.cadence, effectiveAt: args.effectiveAt };
223
+ const result = await request('PUT', `/api/BillingSubscription/${id}/schedule-cadence-change`, body);
224
+ if (result.pendingBillingCadence) {
225
+ console.log(`Subscription ${result.id}: scheduled to change to ${result.pendingBillingCadence} on ${result.pendingCadenceEffectiveAt?.slice(0, 10)}`);
226
+ } else {
227
+ console.log(`Subscription ${result.id}: no cadence change scheduled.`);
228
+ }
229
+ }
230
+
204
231
  export const billingSubscriptionCommand = {
205
232
  command: 'billing-subscription <subcommand>',
206
233
  describe: 'Manage standalone billing subscriptions, invoices, payments, and QBO dry-run sync status',
@@ -260,6 +287,14 @@ export const billingSubscriptionCommand = {
260
287
  .command('renewals', 'List subscriptions by upcoming renewal date, flagging who is still cancellable vs past their cancellation-notice deadline', {
261
288
  'within-days': { type: 'number', desc: 'Only show renewals within this many days (default: all)' },
262
289
  }, (args) => renewalsReport(args))
263
- .demandCommand(1, 'Specify a subcommand: list | get | create | attach-stripe-customer | invoice | provision-placeholder-site | recognition-schedule | payment | payments | qbo-status | renewals'),
290
+ .command('set-auto-renew <id>', 'Set whether a subscription auto-renews at ServiceEndDate (data flag only -- no sweep enforces it yet)', {
291
+ 'auto-renew': { type: 'string', describe: 'true or false' },
292
+ }, (args) => setAutoRenew(args.id, args))
293
+ .command('schedule-cadence-change <id>', 'Schedule (or cancel) a future BillingCadence change, applied by the hourly sweep once the effective date passes', {
294
+ cadence: { type: 'string', describe: 'annual | monthly | quarterly' },
295
+ 'effective-at': { type: 'string', describe: 'YYYY-MM-DD the change takes effect' },
296
+ cancel: { type: 'boolean', default: false, describe: 'Cancel a previously-scheduled change instead of setting one' },
297
+ }, (args) => scheduleCadenceChange(args.id, args))
298
+ .demandCommand(1, 'Specify a subcommand: list | get | create | attach-stripe-customer | invoice | provision-placeholder-site | recognition-schedule | payment | payments | qbo-status | renewals | set-auto-renew | schedule-cadence-change'),
264
299
  handler: () => {},
265
300
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.46",
3
+ "version": "1.4.48",
4
4
  "description": "Velaro Workspace v20 — command-line interface for managing bots, knowledge base ingestion, MCP API keys, search indexes, and ops health.",
5
5
  "type": "module",
6
6
  "bin": {