@stephendolan/ynab-cli 2.8.0 → 2.8.2

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/dist/cli.js CHANGED
@@ -429,7 +429,7 @@ var YnabClient = class {
429
429
  return this.api;
430
430
  }
431
431
  async getBudgetId(budgetIdOrDefault) {
432
- const budgetId = budgetIdOrDefault || config.getDefaultBudget() || process.env.YNAB_BUDGET_ID;
432
+ const budgetId = (budgetIdOrDefault && budgetIdOrDefault !== "default" ? budgetIdOrDefault : void 0) || config.getDefaultBudget() || process.env.YNAB_BUDGET_ID;
433
433
  if (!budgetId) {
434
434
  throw new YnabCliError(
435
435
  'No budget specified. Use --budget flag, set default with "ynab budgets set-default", or set YNAB_BUDGET_ID environment variable',
@@ -438,338 +438,271 @@ var YnabClient = class {
438
438
  }
439
439
  return budgetId;
440
440
  }
441
- async withErrorHandling(fn) {
442
- try {
443
- return await fn();
444
- } catch (error) {
445
- handleYnabError(error);
446
- }
447
- }
448
441
  async getUser() {
449
- return this.withErrorHandling(async () => {
450
- const api = await this.getApi();
451
- const response = await api.user.getUser();
452
- return response.data.user;
453
- });
442
+ const api = await this.getApi();
443
+ const response = await api.user.getUser();
444
+ return response.data.user;
454
445
  }
455
446
  async getBudgets(includeAccounts = false) {
456
- return this.withErrorHandling(async () => {
457
- const api = await this.getApi();
458
- const response = await api.budgets.getBudgets(includeAccounts);
459
- return {
460
- budgets: response.data.budgets,
461
- server_knowledge: 0
462
- };
463
- });
447
+ const api = await this.getApi();
448
+ const response = await api.budgets.getBudgets(includeAccounts);
449
+ return {
450
+ budgets: response.data.budgets,
451
+ server_knowledge: 0
452
+ };
464
453
  }
465
454
  async getBudget(budgetId, lastKnowledgeOfServer) {
466
- return this.withErrorHandling(async () => {
467
- const api = await this.getApi();
468
- const id = await this.getBudgetId(budgetId);
469
- const response = await api.budgets.getBudgetById(id, lastKnowledgeOfServer);
470
- return {
471
- budget: response.data.budget,
472
- server_knowledge: response.data.server_knowledge
473
- };
474
- });
455
+ const api = await this.getApi();
456
+ const id = await this.getBudgetId(budgetId);
457
+ const response = await api.budgets.getBudgetById(id, lastKnowledgeOfServer);
458
+ return {
459
+ budget: response.data.budget,
460
+ server_knowledge: response.data.server_knowledge
461
+ };
475
462
  }
476
463
  async getBudgetSettings(budgetId) {
477
- return this.withErrorHandling(async () => {
478
- const api = await this.getApi();
479
- const id = await this.getBudgetId(budgetId);
480
- const response = await api.budgets.getBudgetSettingsById(id);
481
- return response.data.settings;
482
- });
464
+ const api = await this.getApi();
465
+ const id = await this.getBudgetId(budgetId);
466
+ const response = await api.budgets.getBudgetSettingsById(id);
467
+ return response.data.settings;
483
468
  }
484
469
  async getAccounts(budgetId, lastKnowledgeOfServer) {
485
- return this.withErrorHandling(async () => {
486
- const api = await this.getApi();
487
- const id = await this.getBudgetId(budgetId);
488
- const response = await api.accounts.getAccounts(id, lastKnowledgeOfServer);
489
- return {
490
- accounts: response.data.accounts,
491
- server_knowledge: response.data.server_knowledge
492
- };
493
- });
470
+ const api = await this.getApi();
471
+ const id = await this.getBudgetId(budgetId);
472
+ const response = await api.accounts.getAccounts(id, lastKnowledgeOfServer);
473
+ return {
474
+ accounts: response.data.accounts,
475
+ server_knowledge: response.data.server_knowledge
476
+ };
494
477
  }
495
478
  async getAccount(accountId, budgetId) {
496
- return this.withErrorHandling(async () => {
497
- const api = await this.getApi();
498
- const id = await this.getBudgetId(budgetId);
499
- const response = await api.accounts.getAccountById(id, accountId);
500
- return response.data.account;
501
- });
479
+ const api = await this.getApi();
480
+ const id = await this.getBudgetId(budgetId);
481
+ const response = await api.accounts.getAccountById(id, accountId);
482
+ return response.data.account;
502
483
  }
503
484
  async getCategories(budgetId, lastKnowledgeOfServer) {
504
- return this.withErrorHandling(async () => {
505
- const api = await this.getApi();
506
- const id = await this.getBudgetId(budgetId);
507
- const response = await api.categories.getCategories(id, lastKnowledgeOfServer);
508
- return {
509
- category_groups: response.data.category_groups,
510
- server_knowledge: response.data.server_knowledge
511
- };
512
- });
485
+ const api = await this.getApi();
486
+ const id = await this.getBudgetId(budgetId);
487
+ const response = await api.categories.getCategories(id, lastKnowledgeOfServer);
488
+ return {
489
+ category_groups: response.data.category_groups,
490
+ server_knowledge: response.data.server_knowledge
491
+ };
513
492
  }
514
493
  async getCategory(categoryId, budgetId) {
515
- return this.withErrorHandling(async () => {
516
- const api = await this.getApi();
517
- const id = await this.getBudgetId(budgetId);
518
- const response = await api.categories.getCategoryById(id, categoryId);
519
- return response.data.category;
520
- });
494
+ const api = await this.getApi();
495
+ const id = await this.getBudgetId(budgetId);
496
+ const response = await api.categories.getCategoryById(id, categoryId);
497
+ return response.data.category;
521
498
  }
522
499
  async updateMonthCategory(month, categoryId, data, budgetId) {
523
- return this.withErrorHandling(async () => {
524
- const api = await this.getApi();
525
- const id = await this.getBudgetId(budgetId);
526
- const response = await api.categories.updateMonthCategory(id, month, categoryId, data);
527
- return response.data.category;
528
- });
500
+ const api = await this.getApi();
501
+ const id = await this.getBudgetId(budgetId);
502
+ const response = await api.categories.updateMonthCategory(id, month, categoryId, data);
503
+ return response.data.category;
529
504
  }
530
505
  async updateCategory(categoryId, data, budgetId) {
531
- return this.withErrorHandling(async () => {
532
- const api = await this.getApi();
533
- const id = await this.getBudgetId(budgetId);
534
- const response = await api.categories.updateCategory(id, categoryId, data);
535
- return response.data.category;
536
- });
506
+ const api = await this.getApi();
507
+ const id = await this.getBudgetId(budgetId);
508
+ const response = await api.categories.updateCategory(id, categoryId, data);
509
+ return response.data.category;
537
510
  }
538
511
  async getPayees(budgetId, lastKnowledgeOfServer) {
539
- return this.withErrorHandling(async () => {
540
- const api = await this.getApi();
541
- const id = await this.getBudgetId(budgetId);
542
- const response = await api.payees.getPayees(id, lastKnowledgeOfServer);
543
- return {
544
- payees: response.data.payees,
545
- server_knowledge: response.data.server_knowledge
546
- };
547
- });
512
+ const api = await this.getApi();
513
+ const id = await this.getBudgetId(budgetId);
514
+ const response = await api.payees.getPayees(id, lastKnowledgeOfServer);
515
+ return {
516
+ payees: response.data.payees,
517
+ server_knowledge: response.data.server_knowledge
518
+ };
548
519
  }
549
520
  async getPayee(payeeId, budgetId) {
550
- return this.withErrorHandling(async () => {
551
- const api = await this.getApi();
552
- const id = await this.getBudgetId(budgetId);
553
- const response = await api.payees.getPayeeById(id, payeeId);
554
- return response.data.payee;
555
- });
521
+ const api = await this.getApi();
522
+ const id = await this.getBudgetId(budgetId);
523
+ const response = await api.payees.getPayeeById(id, payeeId);
524
+ return response.data.payee;
556
525
  }
557
526
  async updatePayee(payeeId, data, budgetId) {
558
- return this.withErrorHandling(async () => {
559
- const api = await this.getApi();
560
- const id = await this.getBudgetId(budgetId);
561
- const response = await api.payees.updatePayee(id, payeeId, data);
562
- return response.data.payee;
563
- });
527
+ const api = await this.getApi();
528
+ const id = await this.getBudgetId(budgetId);
529
+ const response = await api.payees.updatePayee(id, payeeId, data);
530
+ return response.data.payee;
564
531
  }
565
532
  async getPayeeLocationsByPayee(payeeId, budgetId) {
566
- return this.withErrorHandling(async () => {
567
- const api = await this.getApi();
568
- const id = await this.getBudgetId(budgetId);
569
- const response = await api.payeeLocations.getPayeeLocationsByPayee(id, payeeId);
570
- return response.data.payee_locations;
571
- });
533
+ const api = await this.getApi();
534
+ const id = await this.getBudgetId(budgetId);
535
+ const response = await api.payeeLocations.getPayeeLocationsByPayee(id, payeeId);
536
+ return response.data.payee_locations;
572
537
  }
573
538
  async getBudgetMonths(budgetId, lastKnowledgeOfServer) {
574
- return this.withErrorHandling(async () => {
575
- const api = await this.getApi();
576
- const id = await this.getBudgetId(budgetId);
577
- const response = await api.months.getBudgetMonths(id, lastKnowledgeOfServer);
578
- return {
579
- months: response.data.months,
580
- server_knowledge: response.data.server_knowledge
581
- };
582
- });
539
+ const api = await this.getApi();
540
+ const id = await this.getBudgetId(budgetId);
541
+ const response = await api.months.getBudgetMonths(id, lastKnowledgeOfServer);
542
+ return {
543
+ months: response.data.months,
544
+ server_knowledge: response.data.server_knowledge
545
+ };
583
546
  }
584
547
  async getBudgetMonth(month, budgetId) {
585
- return this.withErrorHandling(async () => {
586
- const api = await this.getApi();
587
- const id = await this.getBudgetId(budgetId);
588
- const response = await api.months.getBudgetMonth(id, month);
589
- return response.data.month;
590
- });
548
+ const api = await this.getApi();
549
+ const id = await this.getBudgetId(budgetId);
550
+ const response = await api.months.getBudgetMonth(id, month);
551
+ return response.data.month;
591
552
  }
592
553
  async getTransactions(params) {
593
- return this.withErrorHandling(async () => {
594
- const api = await this.getApi();
595
- const id = await this.getBudgetId(params.budgetId);
596
- const response = await api.transactions.getTransactions(
597
- id,
598
- params.sinceDate,
599
- params.type,
600
- params.lastKnowledgeOfServer
601
- );
602
- return {
603
- transactions: response.data.transactions,
604
- server_knowledge: response.data.server_knowledge
605
- };
606
- });
554
+ const api = await this.getApi();
555
+ const id = await this.getBudgetId(params.budgetId);
556
+ const response = await api.transactions.getTransactions(
557
+ id,
558
+ params.sinceDate,
559
+ params.type,
560
+ params.lastKnowledgeOfServer
561
+ );
562
+ return {
563
+ transactions: response.data.transactions,
564
+ server_knowledge: response.data.server_knowledge
565
+ };
607
566
  }
608
567
  async getTransactionsByAccount(accountId, params) {
609
- return this.withErrorHandling(async () => {
610
- const api = await this.getApi();
611
- const id = await this.getBudgetId(params.budgetId);
612
- const response = await api.transactions.getTransactionsByAccount(
613
- id,
614
- accountId,
615
- params.sinceDate,
616
- params.type,
617
- params.lastKnowledgeOfServer
618
- );
619
- return {
620
- transactions: response.data.transactions,
621
- server_knowledge: response.data.server_knowledge
622
- };
623
- });
568
+ const api = await this.getApi();
569
+ const id = await this.getBudgetId(params.budgetId);
570
+ const response = await api.transactions.getTransactionsByAccount(
571
+ id,
572
+ accountId,
573
+ params.sinceDate,
574
+ params.type,
575
+ params.lastKnowledgeOfServer
576
+ );
577
+ return {
578
+ transactions: response.data.transactions,
579
+ server_knowledge: response.data.server_knowledge
580
+ };
624
581
  }
625
582
  async getTransactionsByCategory(categoryId, params) {
626
- return this.withErrorHandling(async () => {
627
- const api = await this.getApi();
628
- const id = await this.getBudgetId(params.budgetId);
629
- const response = await api.transactions.getTransactionsByCategory(
630
- id,
631
- categoryId,
632
- params.sinceDate,
633
- params.type,
634
- params.lastKnowledgeOfServer
635
- );
636
- return {
637
- transactions: response.data.transactions,
638
- server_knowledge: response.data.server_knowledge
639
- };
640
- });
583
+ const api = await this.getApi();
584
+ const id = await this.getBudgetId(params.budgetId);
585
+ const response = await api.transactions.getTransactionsByCategory(
586
+ id,
587
+ categoryId,
588
+ params.sinceDate,
589
+ params.type,
590
+ params.lastKnowledgeOfServer
591
+ );
592
+ return {
593
+ transactions: response.data.transactions,
594
+ server_knowledge: response.data.server_knowledge
595
+ };
641
596
  }
642
597
  async getTransactionsByPayee(payeeId, params) {
643
- return this.withErrorHandling(async () => {
644
- const api = await this.getApi();
645
- const id = await this.getBudgetId(params.budgetId);
646
- const response = await api.transactions.getTransactionsByPayee(
647
- id,
648
- payeeId,
649
- params.sinceDate,
650
- params.type,
651
- params.lastKnowledgeOfServer
652
- );
653
- return {
654
- transactions: response.data.transactions,
655
- server_knowledge: response.data.server_knowledge
656
- };
657
- });
598
+ const api = await this.getApi();
599
+ const id = await this.getBudgetId(params.budgetId);
600
+ const response = await api.transactions.getTransactionsByPayee(
601
+ id,
602
+ payeeId,
603
+ params.sinceDate,
604
+ params.type,
605
+ params.lastKnowledgeOfServer
606
+ );
607
+ return {
608
+ transactions: response.data.transactions,
609
+ server_knowledge: response.data.server_knowledge
610
+ };
658
611
  }
659
612
  async getTransaction(transactionId, budgetId) {
660
- return this.withErrorHandling(async () => {
661
- const api = await this.getApi();
662
- const id = await this.getBudgetId(budgetId);
663
- const response = await api.transactions.getTransactionById(id, transactionId);
664
- return response.data.transaction;
665
- });
613
+ const api = await this.getApi();
614
+ const id = await this.getBudgetId(budgetId);
615
+ const response = await api.transactions.getTransactionById(id, transactionId);
616
+ return response.data.transaction;
666
617
  }
667
618
  async createTransaction(transactionData, budgetId) {
668
- return this.withErrorHandling(async () => {
669
- const api = await this.getApi();
670
- const id = await this.getBudgetId(budgetId);
671
- const response = await api.transactions.createTransaction(id, transactionData);
672
- return response.data.transaction;
673
- });
619
+ const api = await this.getApi();
620
+ const id = await this.getBudgetId(budgetId);
621
+ const response = await api.transactions.createTransaction(id, transactionData);
622
+ return response.data.transaction;
674
623
  }
675
624
  async updateTransaction(transactionId, transactionData, budgetId) {
676
- return this.withErrorHandling(async () => {
677
- const api = await this.getApi();
678
- const id = await this.getBudgetId(budgetId);
679
- const response = await api.transactions.updateTransaction(id, transactionId, transactionData);
680
- return response.data.transaction;
681
- });
625
+ const api = await this.getApi();
626
+ const id = await this.getBudgetId(budgetId);
627
+ const response = await api.transactions.updateTransaction(id, transactionId, transactionData);
628
+ return response.data.transaction;
682
629
  }
683
630
  async updateTransactions(transactions, budgetId) {
684
- return this.withErrorHandling(async () => {
685
- const api = await this.getApi();
686
- const id = await this.getBudgetId(budgetId);
687
- const response = await api.transactions.updateTransactions(id, transactions);
688
- return {
689
- transactions: response.data.transactions,
690
- transaction_ids: response.data.transaction_ids,
691
- server_knowledge: response.data.server_knowledge
692
- };
693
- });
631
+ const api = await this.getApi();
632
+ const id = await this.getBudgetId(budgetId);
633
+ const response = await api.transactions.updateTransactions(id, transactions);
634
+ return {
635
+ transactions: response.data.transactions,
636
+ transaction_ids: response.data.transaction_ids,
637
+ server_knowledge: response.data.server_knowledge
638
+ };
694
639
  }
695
640
  async deleteTransaction(transactionId, budgetId) {
696
- return this.withErrorHandling(async () => {
697
- const api = await this.getApi();
698
- const id = await this.getBudgetId(budgetId);
699
- const response = await api.transactions.deleteTransaction(id, transactionId);
700
- return response.data.transaction;
701
- });
641
+ const api = await this.getApi();
642
+ const id = await this.getBudgetId(budgetId);
643
+ const response = await api.transactions.deleteTransaction(id, transactionId);
644
+ return response.data.transaction;
702
645
  }
703
646
  async importTransactions(budgetId) {
704
- return this.withErrorHandling(async () => {
705
- const api = await this.getApi();
706
- const id = await this.getBudgetId(budgetId);
707
- const response = await api.transactions.importTransactions(id);
708
- return response.data.transaction_ids;
709
- });
647
+ const api = await this.getApi();
648
+ const id = await this.getBudgetId(budgetId);
649
+ const response = await api.transactions.importTransactions(id);
650
+ return response.data.transaction_ids;
710
651
  }
711
652
  async getScheduledTransactions(budgetId, lastKnowledgeOfServer) {
712
- return this.withErrorHandling(async () => {
713
- const api = await this.getApi();
714
- const id = await this.getBudgetId(budgetId);
715
- const response = await api.scheduledTransactions.getScheduledTransactions(
716
- id,
717
- lastKnowledgeOfServer
718
- );
719
- return {
720
- scheduled_transactions: response.data.scheduled_transactions,
721
- server_knowledge: response.data.server_knowledge
722
- };
723
- });
653
+ const api = await this.getApi();
654
+ const id = await this.getBudgetId(budgetId);
655
+ const response = await api.scheduledTransactions.getScheduledTransactions(
656
+ id,
657
+ lastKnowledgeOfServer
658
+ );
659
+ return {
660
+ scheduled_transactions: response.data.scheduled_transactions,
661
+ server_knowledge: response.data.server_knowledge
662
+ };
724
663
  }
725
664
  async getScheduledTransaction(scheduledTransactionId, budgetId) {
726
- return this.withErrorHandling(async () => {
727
- const api = await this.getApi();
728
- const id = await this.getBudgetId(budgetId);
729
- const response = await api.scheduledTransactions.getScheduledTransactionById(
730
- id,
731
- scheduledTransactionId
732
- );
733
- return response.data.scheduled_transaction;
734
- });
665
+ const api = await this.getApi();
666
+ const id = await this.getBudgetId(budgetId);
667
+ const response = await api.scheduledTransactions.getScheduledTransactionById(
668
+ id,
669
+ scheduledTransactionId
670
+ );
671
+ return response.data.scheduled_transaction;
735
672
  }
736
673
  async deleteScheduledTransaction(scheduledTransactionId, budgetId) {
737
- return this.withErrorHandling(async () => {
738
- const api = await this.getApi();
739
- const id = await this.getBudgetId(budgetId);
740
- const response = await api.scheduledTransactions.deleteScheduledTransaction(
741
- id,
742
- scheduledTransactionId
743
- );
744
- return response.data.scheduled_transaction;
745
- });
674
+ const api = await this.getApi();
675
+ const id = await this.getBudgetId(budgetId);
676
+ const response = await api.scheduledTransactions.deleteScheduledTransaction(
677
+ id,
678
+ scheduledTransactionId
679
+ );
680
+ return response.data.scheduled_transaction;
746
681
  }
747
682
  async rawApiCall(method, path, data, budgetId) {
748
- return this.withErrorHandling(async () => {
749
- await this.getApi();
750
- const fullPath = path.includes("{budget_id}") ? path.replace("{budget_id}", await this.getBudgetId(budgetId)) : path;
751
- const url = `https://api.ynab.com/v1${fullPath}`;
752
- const accessToken = await auth.getAccessToken() || process.env.YNAB_API_KEY;
753
- const headers = {
754
- Authorization: `Bearer ${accessToken}`,
755
- "Content-Type": "application/json"
756
- };
757
- const httpMethod = method.toUpperCase();
758
- const hasBody = ["POST", "PUT", "PATCH"].includes(httpMethod);
759
- if (!["GET", "POST", "PUT", "PATCH", "DELETE"].includes(httpMethod)) {
760
- throw new YnabCliError(`Unsupported HTTP method: ${method}`, 400);
761
- }
762
- const response = await fetch(url, {
763
- method: httpMethod,
764
- headers,
765
- ...hasBody && { body: JSON.stringify(data) }
766
- });
767
- if (!response.ok) {
768
- const errorData = await response.json();
769
- throw { error: sanitizeApiError(errorData.error || errorData) };
770
- }
771
- return await response.json();
683
+ await this.getApi();
684
+ const fullPath = path.includes("{budget_id}") ? path.replace("{budget_id}", await this.getBudgetId(budgetId)) : path;
685
+ const url = `https://api.ynab.com/v1${fullPath}`;
686
+ const accessToken = await auth.getAccessToken() || process.env.YNAB_API_KEY;
687
+ const headers = {
688
+ Authorization: `Bearer ${accessToken}`,
689
+ "Content-Type": "application/json"
690
+ };
691
+ const httpMethod = method.toUpperCase();
692
+ const hasBody = ["POST", "PUT", "PATCH"].includes(httpMethod);
693
+ if (!["GET", "POST", "PUT", "PATCH", "DELETE"].includes(httpMethod)) {
694
+ throw new YnabCliError(`Unsupported HTTP method: ${method}`, 400);
695
+ }
696
+ const response = await fetch(url, {
697
+ method: httpMethod,
698
+ headers,
699
+ ...hasBody && { body: JSON.stringify(data) }
772
700
  });
701
+ if (!response.ok) {
702
+ const errorData = await response.json();
703
+ throw { error: sanitizeApiError(errorData.error || errorData) };
704
+ }
705
+ return await response.json();
773
706
  }
774
707
  };
775
708
  var client = new YnabClient();
@@ -1635,6 +1568,37 @@ var server = new McpServer({
1635
1568
  name: "ynab",
1636
1569
  version: "1.0.0"
1637
1570
  });
1571
+ function mcpErrorResult(error) {
1572
+ let errorBody;
1573
+ if (typeof error === "object" && error !== null && "error" in error) {
1574
+ const apiError = sanitizeApiError(error.error);
1575
+ errorBody = { name: apiError.name, detail: apiError.detail };
1576
+ } else if (error instanceof YnabCliError) {
1577
+ errorBody = { name: "cli_error", detail: sanitizeErrorMessage(error.message) };
1578
+ } else if (error instanceof Error) {
1579
+ errorBody = { name: error.name, detail: sanitizeErrorMessage(error.message) };
1580
+ } else {
1581
+ errorBody = { name: "unknown_error", detail: "An unexpected error occurred" };
1582
+ }
1583
+ return {
1584
+ content: [{ type: "text", text: JSON.stringify({ error: errorBody }) }],
1585
+ isError: true
1586
+ };
1587
+ }
1588
+ var _serverTool = server.tool.bind(server);
1589
+ server.tool = (...args) => {
1590
+ const handler = args[args.length - 1];
1591
+ if (typeof handler === "function") {
1592
+ args[args.length - 1] = async (...handlerArgs) => {
1593
+ try {
1594
+ return await handler(...handlerArgs);
1595
+ } catch (error) {
1596
+ return mcpErrorResult(error);
1597
+ }
1598
+ };
1599
+ }
1600
+ return _serverTool.apply(null, args);
1601
+ };
1638
1602
  function jsonResponse(data) {
1639
1603
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
1640
1604
  }
@@ -2080,7 +2044,7 @@ function createMcpCommand() {
2080
2044
 
2081
2045
  // src/cli.ts
2082
2046
  var program = new Command12();
2083
- program.name("ynab").description("A command-line interface for You Need a Budget (YNAB)").version("2.8.0").option("-c, --compact", "Minified JSON output (single line)").hook("preAction", (thisCommand) => {
2047
+ program.name("ynab").description("A command-line interface for You Need a Budget (YNAB)").version("2.8.2").option("-c, --compact", "Minified JSON output (single line)").hook("preAction", (thisCommand) => {
2084
2048
  const options = thisCommand.opts();
2085
2049
  setOutputOptions({
2086
2050
  compact: options.compact