@genz-its/sevdesk-cli 0.0.0 → 0.1.0

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/README.md CHANGED
@@ -795,6 +795,6 @@ sevdesk vouchers:reset-to-open [options]
795
795
 
796
796
  ## License
797
797
 
798
- [MIT](../../LICENSE)
798
+ See [LICENSE](https://github.com/genz-its/sevdesk/blob/main/LICENSE).
799
799
 
800
800
  [^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by sevDesk GmbH or any of their affiliates or subsidiaries.
package/dist/index.js CHANGED
@@ -142,6 +142,12 @@ function requireInteractive(requirement) {
142
142
  }
143
143
  //#endregion
144
144
  //#region src/output.ts
145
+ /** Formats a contact reference as its organization or person name. */
146
+ function contactLabel(ref) {
147
+ if (!ref) return "-";
148
+ const personName = [ref.surename, ref.familyname].filter((part) => part).join(" ");
149
+ return ref.name || personName || ref.id || "-";
150
+ }
145
151
  function printJson(value) {
146
152
  console.log(JSON.stringify(value, null, 2));
147
153
  }
@@ -501,7 +507,10 @@ var get_default$5 = defineCommand({
501
507
  requirement: "a credit note ID via --id",
502
508
  question: "Enter the credit note ID:"
503
509
  });
504
- const creditNote = await client.creditNotes.get({ creditNoteId });
510
+ const creditNote = await client.creditNotes.get({
511
+ creditNoteId,
512
+ embed: ["contact"]
513
+ });
505
514
  if (options.json) {
506
515
  printJson(creditNote);
507
516
  return;
@@ -510,7 +519,7 @@ var get_default$5 = defineCommand({
510
519
  consola.info(`Number: ${creditNote.creditNoteNumber ?? "-"}`);
511
520
  consola.info(`Date: ${creditNote.creditNoteDate}`);
512
521
  consola.info(`Status: ${creditNote.status}`);
513
- consola.info(`Contact: ${creditNote.contact?.id ?? "-"}`);
522
+ consola.info(`Contact: ${contactLabel(creditNote.contact)}`);
514
523
  consola.info(`Net: ${creditNote.sumNet}`);
515
524
  consola.info(`Tax: ${creditNote.sumTax}`);
516
525
  consola.info(`Gross: ${creditNote.sumGross}`);
@@ -539,7 +548,8 @@ var list_default$6 = defineCommand({
539
548
  endDate: options.endDate,
540
549
  contactId: options.contact,
541
550
  limit: options.limit,
542
- offset: options.offset
551
+ offset: options.offset,
552
+ embed: ["contact"]
543
553
  });
544
554
  if (options.json) {
545
555
  printJson(creditNotes);
@@ -553,7 +563,7 @@ var list_default$6 = defineCommand({
553
563
  id: creditNote.id,
554
564
  number: creditNote.creditNoteNumber ?? "",
555
565
  date: creditNote.creditNoteDate,
556
- contact: creditNote.contact?.id ?? "",
566
+ contact: contactLabel(creditNote.contact),
557
567
  gross: creditNote.sumGross,
558
568
  status: creditNote.status
559
569
  })));
@@ -884,7 +894,10 @@ var get_default$4 = defineCommand({
884
894
  requirement: "an invoice ID via --id",
885
895
  question: "Enter the invoice ID:"
886
896
  });
887
- const invoice = await client.invoices.get({ invoiceId });
897
+ const invoice = await client.invoices.get({
898
+ invoiceId,
899
+ embed: ["contact"]
900
+ });
888
901
  if (options.json) {
889
902
  printJson(invoice);
890
903
  return;
@@ -893,7 +906,7 @@ var get_default$4 = defineCommand({
893
906
  consola.info(`Number: ${invoice.invoiceNumber ?? "-"}`);
894
907
  consola.info(`Date: ${invoice.invoiceDate}`);
895
908
  consola.info(`Status: ${invoice.status}`);
896
- consola.info(`Contact: ${invoice.contact?.id ?? "-"}`);
909
+ consola.info(`Contact: ${contactLabel(invoice.contact)}`);
897
910
  consola.info(`Net: ${invoice.sumNet}`);
898
911
  consola.info(`Tax: ${invoice.sumTax}`);
899
912
  consola.info(`Gross: ${invoice.sumGross}`);
@@ -922,7 +935,8 @@ var list_default$5 = defineCommand({
922
935
  endDate: options.endDate,
923
936
  contactId: options.contact,
924
937
  limit: options.limit,
925
- offset: options.offset
938
+ offset: options.offset,
939
+ embed: ["contact"]
926
940
  });
927
941
  if (options.json) {
928
942
  printJson(invoices);
@@ -936,7 +950,7 @@ var list_default$5 = defineCommand({
936
950
  id: invoice.id,
937
951
  number: invoice.invoiceNumber ?? "",
938
952
  date: invoice.invoiceDate,
939
- contact: invoice.contact?.id ?? "",
953
+ contact: contactLabel(invoice.contact),
940
954
  gross: invoice.sumGross,
941
955
  status: invoice.status
942
956
  })));
@@ -1030,7 +1044,10 @@ var get_default$3 = defineCommand({
1030
1044
  requirement: "an order ID via --id",
1031
1045
  question: "Enter the order ID:"
1032
1046
  });
1033
- const order = await client.orders.get({ orderId });
1047
+ const order = await client.orders.get({
1048
+ orderId,
1049
+ embed: ["contact"]
1050
+ });
1034
1051
  if (options.json) {
1035
1052
  printJson(order);
1036
1053
  return;
@@ -1039,7 +1056,7 @@ var get_default$3 = defineCommand({
1039
1056
  consola.info(`Number: ${order.orderNumber}`);
1040
1057
  consola.info(`Date: ${order.orderDate}`);
1041
1058
  consola.info(`Status: ${order.status}`);
1042
- consola.info(`Contact: ${order.contact?.id ?? "-"}`);
1059
+ consola.info(`Contact: ${contactLabel(order.contact)}`);
1043
1060
  consola.info(`Net: ${order.sumNet}`);
1044
1061
  consola.info(`Tax: ${order.sumTax}`);
1045
1062
  consola.info(`Gross: ${order.sumGross}`);
@@ -1068,7 +1085,8 @@ var list_default$4 = defineCommand({
1068
1085
  endDate: options.endDate,
1069
1086
  contactId: options.contact,
1070
1087
  limit: options.limit,
1071
- offset: options.offset
1088
+ offset: options.offset,
1089
+ embed: ["contact"]
1072
1090
  });
1073
1091
  if (options.json) {
1074
1092
  printJson(orders);
@@ -1082,7 +1100,7 @@ var list_default$4 = defineCommand({
1082
1100
  id: order.id,
1083
1101
  number: order.orderNumber,
1084
1102
  date: order.orderDate,
1085
- contact: order.contact?.id ?? "",
1103
+ contact: contactLabel(order.contact),
1086
1104
  gross: order.sumGross,
1087
1105
  status: order.status
1088
1106
  })));
@@ -1608,7 +1626,10 @@ var get_default = defineCommand({
1608
1626
  requirement: "a voucher ID via --id",
1609
1627
  question: "Enter the voucher ID:"
1610
1628
  });
1611
- const voucher = await client.vouchers.get({ voucherId });
1629
+ const voucher = await client.vouchers.get({
1630
+ voucherId,
1631
+ embed: ["supplier"]
1632
+ });
1612
1633
  if (options.json) {
1613
1634
  printJson(voucher);
1614
1635
  return;
@@ -1616,7 +1637,7 @@ var get_default = defineCommand({
1616
1637
  consola.info(`ID: ${voucher.id}`);
1617
1638
  consola.info(`Status: ${voucher.status ?? "-"}`);
1618
1639
  consola.info(`Date: ${voucher.voucherDate ?? "-"}`);
1619
- consola.info(`Supplier: ${voucher.supplierName ?? voucher.supplier?.id ?? "-"}`);
1640
+ consola.info(`Supplier: ${voucher.supplierName ?? contactLabel(voucher.supplier)}`);
1620
1641
  consola.info(`Description: ${voucher.description ?? "-"}`);
1621
1642
  consola.info(`Net: ${voucher.sumNet}`);
1622
1643
  consola.info(`Tax: ${voucher.sumTax}`);
@@ -1649,7 +1670,8 @@ var list_default = defineCommand({
1649
1670
  endDate: options.endDate,
1650
1671
  contactId: options.contact,
1651
1672
  limit: options.limit,
1652
- offset: options.offset
1673
+ offset: options.offset,
1674
+ embed: ["supplier"]
1653
1675
  });
1654
1676
  if (options.json) {
1655
1677
  printJson(vouchers);
@@ -1662,7 +1684,7 @@ var list_default = defineCommand({
1662
1684
  printTable(vouchers.map((voucher) => ({
1663
1685
  id: voucher.id,
1664
1686
  date: voucher.voucherDate ?? "",
1665
- supplier: voucher.supplierName ?? voucher.supplier?.id ?? "",
1687
+ supplier: voucher.supplierName ?? contactLabel(voucher.supplier),
1666
1688
  description: voucher.description ?? "",
1667
1689
  gross: voucher.sumGross,
1668
1690
  status: voucher.status ?? ""
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["accountsBalance","accountsCreateClearing","accountsCreateFileImport","accountsGet","accountsList","contactsCreate","contactsDelete","contactsGet","contactsList","contactsUpdate","creditNotesGet","creditNotesList","creditNotesPdf","exportContacts","exportDatev","exportInvoices","exportTransactions","exportVouchers","guidanceAccounts","invoicesGet","invoicesList","invoicesPdf","ordersGet","ordersList","ordersPdf","partsGet","partsList","tagsCreate","tagsDelete","tagsList","transactionsCreate","transactionsGet","transactionsList","vouchersBook","vouchersCreate","vouchersEnshrine","vouchersGet","vouchersList","vouchersResetToDraft","vouchersResetToOpen"],"sources":["../src/config.ts","../src/package.ts","../src/client.ts","../src/interactive.ts","../src/prompt.ts","../src/options.ts","../src/output.ts","../src/commands/accounts/balance.ts","../src/commands/accounts/create-clearing.ts","../src/commands/accounts/create-file-import.ts","../src/commands/accounts/get.ts","../src/commands/accounts/list.ts","../src/commands/contacts/create.ts","../src/commands/contacts/delete.ts","../src/commands/contacts/get.ts","../src/commands/contacts/list.ts","../src/commands/contacts/update.ts","../src/commands/credit-notes/get.ts","../src/commands/credit-notes/list.ts","../src/commands/credit-notes/pdf.ts","../src/errors.ts","../src/commands/doctor.ts","../src/commands/export/contacts.ts","../src/commands/export/datev.ts","../src/commands/export/invoices.ts","../src/commands/export/transactions.ts","../src/commands/export/vouchers.ts","../src/commands/guidance/accounts.ts","../src/commands/invoices/get.ts","../src/commands/invoices/list.ts","../src/commands/invoices/pdf.ts","../src/commands/login.ts","../src/commands/logout.ts","../src/commands/orders/get.ts","../src/commands/orders/list.ts","../src/commands/orders/pdf.ts","../src/commands/parts/get.ts","../src/commands/parts/list.ts","../src/commands/tags/create.ts","../src/commands/tags/delete.ts","../src/commands/tags/list.ts","../src/commands/transactions/create.ts","../src/commands/transactions/get.ts","../src/commands/transactions/list.ts","../src/commands/vouchers/book.ts","../src/commands/vouchers/create.ts","../src/commands/vouchers/enshrine.ts","../src/commands/vouchers/get.ts","../src/commands/vouchers/list.ts","../src/commands/vouchers/reset-to-draft.ts","../src/commands/vouchers/reset-to-open.ts","../src/index.ts"],"sourcesContent":["import { mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\n\nexport interface CliConfig {\n token?: string;\n}\n\nfunction configDir(): string {\n const xdgConfigHome = process.env['XDG_CONFIG_HOME'];\n const base = xdgConfigHome ? xdgConfigHome : join(homedir(), '.config');\n return join(base, 'sevdesk');\n}\n\nexport function configPath(): string {\n return join(configDir(), 'config.json');\n}\n\nexport async function readConfig(): Promise<CliConfig> {\n try {\n return JSON.parse(await readFile(configPath(), 'utf8')) as CliConfig;\n } catch {\n return {};\n }\n}\n\nexport async function writeConfig(config: CliConfig): Promise<void> {\n await mkdir(configDir(), { recursive: true });\n await writeFile(configPath(), `${JSON.stringify(config, null, 2)}\\n`, {\n mode: 0o600,\n });\n}\n\nexport type TokenSource = 'environment' | 'config' | 'none';\n\nexport async function resolveToken(): Promise<{\n token?: string;\n source: TokenSource;\n}> {\n const environmentToken = process.env['SEVDESK_TOKEN']?.trim();\n if (environmentToken) {\n return { token: environmentToken, source: 'environment' };\n }\n const configToken = (await readConfig()).token?.trim();\n if (configToken) {\n return { token: configToken, source: 'config' };\n }\n return { source: 'none' };\n}\n","import { createRequire } from 'node:module';\n\nexport const pkg = createRequire(import.meta.url)('../package.json') as {\n name: string;\n version: string;\n description: string;\n};\n","import { SevDesk } from '@genz-its/sevdesk-sdk';\nimport { consola } from 'consola';\nimport { resolveToken } from './config';\nimport { pkg } from './package';\n\nexport function createClient(token: string): SevDesk {\n return new SevDesk({ token, userAgent: `${pkg.name}/${pkg.version}` });\n}\n\n/**\n * Resolves the API token and returns a ready-to-use client. Exits with an\n * explanation when no token is available.\n */\nexport async function requireClient(): Promise<SevDesk> {\n const { token } = await resolveToken();\n if (!token) {\n consola.error(\n 'You must be logged in. Run `sevdesk login` or set the SEVDESK_TOKEN environment variable.',\n );\n process.exit(1);\n }\n return createClient(token);\n}\n","export function isInteractive(): boolean {\n return (\n process.stdin.isTTY === true &&\n process.stdout.isTTY === true &&\n !process.env['CI']\n );\n}\n","import { consola } from 'consola';\n\nexport async function promptText(message: string): Promise<string> {\n const response = await consola.prompt(message, {\n type: 'text',\n cancel: 'symbol',\n });\n if (typeof response === 'symbol') {\n process.exit(0);\n }\n return response;\n}\n\nexport async function promptConfirm(\n message: string,\n initial = true,\n): Promise<boolean> {\n const response = await consola.prompt(message, {\n type: 'confirm',\n initial,\n cancel: 'symbol',\n });\n if (typeof response === 'symbol') {\n process.exit(0);\n }\n return response;\n}\n","import { consola } from 'consola';\nimport { isInteractive } from './interactive';\nimport { promptConfirm, promptText } from './prompt';\n\ninterface RequiredOption<T> {\n value: T | undefined;\n /** Describes the missing option, for example `a voucher ID via --id`. */\n requirement: string;\n /** Question asked when the option is missing in an interactive environment. */\n question: string;\n}\n\n/**\n * Returns the option value, asking for it when it is missing. Exits when the\n * value is missing in a non-interactive environment.\n */\nexport async function requireStringOption(\n options: RequiredOption<string>,\n): Promise<string> {\n const value = options.value?.trim();\n if (value) {\n return value;\n }\n requireInteractive(options.requirement);\n const answer = (await promptText(options.question)).trim();\n if (!answer) {\n consola.error('The value must not be empty.');\n process.exit(1);\n }\n return answer;\n}\n\n/**\n * Returns the option value, asking for it when it is missing. Exits when the\n * value is missing in a non-interactive environment or is not a number.\n */\nexport async function requireNumberOption(\n options: RequiredOption<number>,\n): Promise<number> {\n if (options.value !== undefined) {\n return options.value;\n }\n requireInteractive(options.requirement);\n const answer = (await promptText(options.question)).trim();\n const value = Number(answer);\n if (!answer || !Number.isFinite(value)) {\n consola.error('The value must be a number.');\n process.exit(1);\n }\n return value;\n}\n\n/**\n * Asks for confirmation unless `yes` is set. Returns `false` when the user\n * declines, in which case the command must stop. Exits when the confirmation\n * is missing in a non-interactive environment.\n */\nexport async function confirmOrAbort(options: {\n message: string;\n yes: boolean;\n /** Preselected answer. Defaults to the answer preselected by the prompt. */\n initial?: boolean;\n}): Promise<boolean> {\n if (options.yes) {\n return true;\n }\n if (!isInteractive()) {\n consola.error(\n 'You must pass --yes to confirm this action when running in a non-interactive environment.',\n );\n process.exit(1);\n }\n const confirmed =\n options.initial === undefined\n ? await promptConfirm(options.message)\n : await promptConfirm(options.message, options.initial);\n if (!confirmed) {\n consola.info('Aborted.');\n }\n return confirmed;\n}\n\nfunction requireInteractive(requirement: string): void {\n if (!isInteractive()) {\n consola.error(\n `You must provide ${requirement} when running in a non-interactive environment.`,\n );\n process.exit(1);\n }\n}\n","export function printJson(value: unknown): void {\n console.log(JSON.stringify(value, null, 2));\n}\n\nexport function printTable(rows: Array<Record<string, string>>): void {\n const first = rows[0];\n if (!first) {\n return;\n }\n const columns = Object.keys(first);\n const widths = columns.map((column) =>\n Math.max(column.length, ...rows.map((row) => (row[column] ?? '').length)),\n );\n const line = (values: string[]): string =>\n values.map((value, index) => value.padEnd(widths[index] ?? 0)).join(' ');\n console.log(line(columns.map((column) => column.toUpperCase())));\n for (const row of rows) {\n console.log(line(columns.map((column) => row[column] ?? '')));\n }\n}\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show the balance of a check account at a given date.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The check account ID. If omitted, you will be prompted.'),\n date: z\n .string()\n .default(() => new Date().toISOString().slice(0, 10))\n .describe('The date to calculate the balance for (YYYY-MM-DD).'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const checkAccountId = await requireNumberOption({\n value: options.id,\n requirement: 'a check account ID via --id',\n question: 'Enter the check account ID:',\n });\n const balance = await client.checkAccounts.getBalanceAtDate({\n checkAccountId,\n date: options.date,\n });\n if (options.json) {\n printJson({ checkAccountId, date: options.date, balance });\n return;\n }\n consola.info(`Balance at ${options.date}: ${balance}`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Create a clearing check account.',\n options: defineOptions(\n z.object({\n name: z\n .string()\n .optional()\n .describe(\n 'The name of the check account. If omitted, you will be prompted.',\n ),\n accountingNumber: z.coerce\n .number()\n .optional()\n .describe('The booking account number of the check account.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const name = await requireStringOption({\n value: options.name,\n requirement: 'a name via --name',\n question: 'Enter the name of the check account:',\n });\n const checkAccount = await client.checkAccounts.createClearingAccount({\n name,\n accountingNumber: options.accountingNumber,\n });\n if (options.json) {\n printJson(checkAccount);\n return;\n }\n consola.success(`Created clearing account ${checkAccount.id}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description:\n 'Create a check account that imports its transactions from files.',\n options: defineOptions(\n z.object({\n name: z\n .string()\n .optional()\n .describe(\n 'The name of the check account. If omitted, you will be prompted.',\n ),\n importType: z\n .enum(['CSV', 'MT940'])\n .default('CSV')\n .describe(\n 'The file format used to import transactions. Supported values are CSV and MT940.',\n ),\n accountingNumber: z.coerce\n .number()\n .optional()\n .describe('The booking account number of the check account.'),\n iban: z.string().optional().describe('The IBAN of the check account.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const name = await requireStringOption({\n value: options.name,\n requirement: 'a name via --name',\n question: 'Enter the name of the check account:',\n });\n const checkAccount = await client.checkAccounts.createFileImportAccount({\n name,\n importType: options.importType,\n accountingNumber: options.accountingNumber,\n iban: options.iban,\n });\n if (options.json) {\n printJson(checkAccount);\n return;\n }\n consola.success(`Created file import account ${checkAccount.id}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single check account.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The check account ID. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const checkAccountId = await requireNumberOption({\n value: options.id,\n requirement: 'a check account ID via --id',\n question: 'Enter the check account ID:',\n });\n const checkAccount = await client.checkAccounts.get({ checkAccountId });\n if (options.json) {\n printJson(checkAccount);\n return;\n }\n consola.info(`ID: ${checkAccount.id}`);\n consola.info(`Name: ${checkAccount.name}`);\n consola.info(`Type: ${checkAccount.type}`);\n consola.info(`Import type: ${checkAccount.importType ?? '-'}`);\n consola.info(`IBAN: ${checkAccount.iban ?? '-'}`);\n consola.info(`Accounting number: ${checkAccount.accountingNumber ?? '-'}`);\n consola.info(`Currency: ${checkAccount.currency}`);\n consola.info(`Balance: ${checkAccount.balance ?? '-'}`);\n consola.info(`Status: ${checkAccount.status}`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List your check accounts.',\n options: defineOptions(\n z.object({\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of check accounts to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('The number of check accounts to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const checkAccounts = await client.checkAccounts.list({\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(checkAccounts);\n return;\n }\n if (checkAccounts.length === 0) {\n consola.info('No check accounts found.');\n return;\n }\n printTable(\n checkAccounts.map((checkAccount) => ({\n id: checkAccount.id,\n name: checkAccount.name,\n type: checkAccount.type,\n importType: checkAccount.importType ?? '',\n accountingNumber: checkAccount.accountingNumber ?? '',\n currency: checkAccount.currency,\n status: checkAccount.status,\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Create a contact.',\n options: defineOptions(\n z.object({\n name: z\n .string()\n .optional()\n .describe(\n 'Name of the organization. Not to be used for persons. If both --name and --familyname are omitted, you will be prompted for the organization name.',\n ),\n surename: z\n .string()\n .optional()\n .describe(\n 'First name of the person. Not to be used for organizations.',\n ),\n familyname: z\n .string()\n .optional()\n .describe('Last name of the person. Not to be used for organizations.'),\n category: z.coerce\n .number()\n .default(3)\n .describe(\n 'ID of the contact category: 2 supplier, 3 customer, 4 partner.',\n ),\n customerNumber: z\n .string()\n .optional()\n .describe('Customer number of the contact.'),\n description: z\n .string()\n .optional()\n .describe('Description of the contact.'),\n vatNumber: z.string().optional().describe('VAT number of the contact.'),\n taxNumber: z.string().optional().describe('Tax number of the contact.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const name =\n !options.name && !options.familyname\n ? await requireStringOption({\n value: undefined,\n requirement: 'a name via --name or --familyname',\n question: 'Enter the organization name:',\n })\n : options.name;\n const contact = await client.contacts.create({\n categoryId: options.category,\n name,\n surename: options.surename,\n familyname: options.familyname,\n customerNumber: options.customerNumber,\n description: options.description,\n vatNumber: options.vatNumber,\n taxNumber: options.taxNumber,\n });\n if (options.json) {\n printJson(contact);\n return;\n }\n consola.success(`Created contact ${contact.id}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Delete a contact.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const contactId = await requireNumberOption({\n value: options.id,\n requirement: 'a contact ID via --id',\n question: 'Enter the contact ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Delete contact ${contactId}?`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n await client.contacts.delete({ contactId });\n if (options.json) {\n printJson({ deleted: true });\n return;\n }\n consola.success('Contact deleted.');\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single contact.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const contactId = await requireNumberOption({\n value: options.id,\n requirement: 'a contact ID via --id',\n question: 'Enter the contact ID:',\n });\n const contact = await client.contacts.get({ contactId });\n if (options.json) {\n printJson(contact);\n return;\n }\n consola.info(`ID: ${contact.id}`);\n consola.info(`Name: ${contact.name ?? '-'}`);\n consola.info(`First name: ${contact.surename ?? '-'}`);\n consola.info(`Last name: ${contact.familyname ?? '-'}`);\n consola.info(`Customer number: ${contact.customerNumber ?? '-'}`);\n consola.info(`Category: ${contact.category.id}`);\n consola.info(`Status: ${contact.status ?? '-'}`);\n consola.info(`Description: ${contact.description ?? '-'}`);\n consola.info(`VAT number: ${contact.vatNumber ?? '-'}`);\n consola.info(`Tax number: ${contact.taxNumber ?? '-'}`);\n },\n});\n","import type { Contact } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List contacts.',\n options: defineOptions(\n z.object({\n name: z\n .string()\n .optional()\n .describe('Filter by organization, first or last name.'),\n customerNumber: z\n .string()\n .optional()\n .describe('Filter by customer number.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of contacts to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of contacts to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const contacts = await client.contacts.list({\n name: options.name,\n customerNumber: options.customerNumber,\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(contacts);\n return;\n }\n if (contacts.length === 0) {\n consola.info('No contacts found.');\n return;\n }\n printTable(\n contacts.map((contact) => ({\n id: contact.id,\n number: contact.customerNumber ?? '',\n name: formatContactName(contact),\n status: contact.status ?? '',\n category: contact.category.id,\n })),\n );\n },\n});\n\nfunction formatContactName(contact: Contact): string {\n return (\n contact.name ??\n [contact.surename, contact.familyname].filter(Boolean).join(' ')\n );\n}\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Update a contact.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n name: z\n .string()\n .optional()\n .describe('Name of the organization. Not to be used for persons.'),\n surename: z\n .string()\n .optional()\n .describe(\n 'First name of the person. Not to be used for organizations.',\n ),\n familyname: z\n .string()\n .optional()\n .describe('Last name of the person. Not to be used for organizations.'),\n category: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the contact category: 2 supplier, 3 customer, 4 partner.',\n ),\n customerNumber: z\n .string()\n .optional()\n .describe('Customer number of the contact.'),\n description: z\n .string()\n .optional()\n .describe('Description of the contact.'),\n vatNumber: z.string().optional().describe('VAT number of the contact.'),\n taxNumber: z.string().optional().describe('Tax number of the contact.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const contactId = await requireNumberOption({\n value: options.id,\n requirement: 'a contact ID via --id',\n question: 'Enter the contact ID:',\n });\n const contact = await client.contacts.update({\n contactId,\n categoryId: options.category,\n name: options.name,\n surename: options.surename,\n familyname: options.familyname,\n customerNumber: options.customerNumber,\n description: options.description,\n vatNumber: options.vatNumber,\n taxNumber: options.taxNumber,\n });\n if (options.json) {\n printJson(contact);\n return;\n }\n consola.success(`Updated contact ${contact.id}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single credit note.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the credit note. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const creditNoteId = await requireNumberOption({\n value: options.id,\n requirement: 'a credit note ID via --id',\n question: 'Enter the credit note ID:',\n });\n const creditNote = await client.creditNotes.get({ creditNoteId });\n if (options.json) {\n printJson(creditNote);\n return;\n }\n consola.info(`ID: ${creditNote.id}`);\n consola.info(`Number: ${creditNote.creditNoteNumber ?? '-'}`);\n consola.info(`Date: ${creditNote.creditNoteDate}`);\n consola.info(`Status: ${creditNote.status}`);\n consola.info(`Contact: ${creditNote.contact?.id ?? '-'}`);\n consola.info(`Net: ${creditNote.sumNet}`);\n consola.info(`Tax: ${creditNote.sumTax}`);\n consola.info(`Gross: ${creditNote.sumGross}`);\n consola.info(`Currency: ${creditNote.currency ?? '-'}`);\n },\n});\n","import type { CreditNoteStatus } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List credit notes.',\n options: defineOptions(\n z.object({\n status: z.coerce\n .number()\n .optional()\n .describe(\n 'Filter by status: 100 draft, 200 open, 750 partially paid, 1000 paid.',\n ),\n creditNoteNumber: z\n .string()\n .optional()\n .describe('Filter by credit note number.'),\n startDate: z\n .string()\n .optional()\n .describe(\n 'Only credit notes on or after this date as dd.mm.yyyy or Unix timestamp.',\n ),\n endDate: z\n .string()\n .optional()\n .describe(\n 'Only credit notes on or before this date as dd.mm.yyyy or Unix timestamp.',\n ),\n contact: z.coerce\n .number()\n .optional()\n .describe('ID of the contact whose credit notes to list.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of credit notes to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of credit notes to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const creditNotes = await client.creditNotes.list({\n status: options.status as CreditNoteStatus | undefined,\n creditNoteNumber: options.creditNoteNumber,\n startDate: options.startDate,\n endDate: options.endDate,\n contactId: options.contact,\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(creditNotes);\n return;\n }\n if (creditNotes.length === 0) {\n consola.info('No credit notes found.');\n return;\n }\n printTable(\n creditNotes.map((creditNote) => ({\n id: creditNote.id,\n number: creditNote.creditNoteNumber ?? '',\n date: creditNote.creditNoteDate,\n contact: creditNote.contact?.id ?? '',\n gross: creditNote.sumGross,\n status: creditNote.status,\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Download the PDF of a credit note.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the credit note. If omitted, you will be prompted.'),\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the PDF to. Defaults to the file name reported by the API.',\n ),\n preventSendBy: z\n .boolean()\n .default(false)\n .describe('Do not mark the credit note as sent by download.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const creditNoteId = await requireNumberOption({\n value: options.id,\n requirement: 'a credit note ID via --id',\n question: 'Enter the credit note ID:',\n });\n const pdf = await client.creditNotes.getPdf({\n creditNoteId,\n preventSendBy: options.preventSendBy,\n });\n const path = resolve(options.output ?? pdf.filename);\n await writeFile(path, Buffer.from(pdf.content, 'base64'));\n if (options.json) {\n printJson({ filename: pdf.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { SevDeskError } from '@genz-its/sevdesk-sdk';\nimport { ZliError } from '@robingenz/zli';\nimport { z } from 'zod';\n\nexport function formatError(error: unknown): string {\n if (error instanceof ZliError) {\n return error.message;\n }\n if (error instanceof z.ZodError) {\n return error.issues\n .map((issue) => `${issue.path.join('.') || 'input'}: ${issue.message}`)\n .join('\\n');\n }\n if (error instanceof SevDeskError) {\n if (error.status === 401) {\n return 'Authentication failed. Check your API token or run `sevdesk login` again.';\n }\n return error.message;\n }\n return error instanceof Error ? error.message : String(error);\n}\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { createClient } from '../client';\nimport { resolveToken } from '../config';\nimport { formatError } from '../errors';\nimport { printJson } from '../output';\nimport { pkg } from '../package';\n\nexport default defineCommand({\n description: 'Check the CLI setup and the connection to the sevdesk API.',\n options: defineOptions(\n z.object({\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const { token, source } = await resolveToken();\n let bookkeepingSystemVersion: string | undefined;\n let apiError: string | undefined;\n if (token) {\n try {\n bookkeepingSystemVersion =\n await createClient(token).basics.getBookkeepingSystemVersion();\n } catch (error) {\n apiError = formatError(error);\n }\n }\n if (options.json) {\n printJson({\n cliVersion: pkg.version,\n nodeVersion: process.version,\n tokenSource: source,\n bookkeepingSystemVersion: bookkeepingSystemVersion ?? null,\n apiError: apiError ?? null,\n });\n } else {\n consola.info(`CLI version: ${pkg.version}`);\n consola.info(`Node.js version: ${process.version}`);\n consola.info(`Token source: ${source}`);\n if (!token) {\n consola.warn(\n 'No API token found. Run `sevdesk login` or set the SEVDESK_TOKEN environment variable.',\n );\n } else if (apiError) {\n consola.error(`API connection failed: ${apiError}`);\n } else {\n consola.success(\n `API connection succeeded. Bookkeeping system version: ${bookkeepingSystemVersion}`,\n );\n }\n }\n if (bookkeepingSystemVersion === '1.0') {\n consola.warn(\n 'This sevdesk account still uses bookkeeping system version 1.0, which is not supported.',\n );\n process.exitCode = 1;\n } else if (!token || apiError) {\n process.exitCode = 1;\n }\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Export contacts as a CSV file.',\n options: defineOptions(\n z.object({\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the CSV file to. Defaults to the filename of the export.',\n ),\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of contacts to export.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const file = await client.exports.exportContactsCsv({\n limit: options.limit,\n });\n const path = options.output ?? file.filename;\n await writeFile(\n path,\n file.base64Encoded ? Buffer.from(file.content, 'base64') : file.content,\n );\n if (options.json) {\n printJson({ filename: file.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import type { ExportJobDownloadInfo, SevDesk } from '@genz-its/sevdesk-sdk';\nimport { SevDeskError } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nconst POLL_INTERVAL = 3_000;\n\nexport default defineCommand({\n description: 'Export accounting data in the DATEV format as a ZIP archive.',\n options: defineOptions(\n z.object({\n startDate: z\n .string()\n .optional()\n .describe(\n 'Start of the export period as dd.mm.yyyy or Unix timestamp. If omitted, you will be prompted.',\n ),\n endDate: z\n .string()\n .optional()\n .describe(\n 'End of the export period as dd.mm.yyyy or Unix timestamp. If omitted, you will be prompted.',\n ),\n format: z\n .enum(['csv', 'xml'])\n .default('csv')\n .describe('The DATEV export format. Supported values are csv and xml.'),\n scope: z\n .string()\n .default('EXTCD')\n .describe(\n 'The models to include as a string of letters: E (earnings), X (expenditure), T (transactions), C (cash register) and D (assets). XML exports support only E and X.',\n ),\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the ZIP archive to. Defaults to the filename of the export.',\n ),\n timeout: z.coerce\n .number()\n .default(300)\n .describe('Maximum number of seconds to wait for the export job.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const startDate = await requireStringOption({\n value: options.startDate,\n requirement: 'a start date via --start-date',\n question: 'Enter the start date (dd.mm.yyyy):',\n });\n const endDate = await requireStringOption({\n value: options.endDate,\n requirement: 'an end date via --end-date',\n question: 'Enter the end date (dd.mm.yyyy):',\n });\n const jobOptions = { startDate, endDate, scope: options.scope };\n const jobId =\n options.format === 'csv'\n ? await client.exports.createDatevCsvZipExportJob(jobOptions)\n : await client.exports.createDatevXmlZipExportJob(jobOptions);\n if (!options.json) {\n consola.start('Waiting for the export job to finish...');\n }\n const info = await waitForDownloadInfo(client, jobId, options.timeout);\n if (!info) {\n consola.error(\n `The export job did not finish within ${options.timeout} seconds.`,\n );\n process.exit(1);\n }\n const response = await fetch(info.link);\n if (!response.ok) {\n consola.error(\n `The export file could not be downloaded (status ${response.status}).`,\n );\n process.exit(1);\n }\n const path = options.output ?? info.filename;\n await writeFile(path, new Uint8Array(await response.arrayBuffer()));\n if (options.json) {\n printJson({ jobId, filename: info.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n\nasync function waitForDownloadInfo(\n client: SevDesk,\n jobId: string,\n timeoutSeconds: number,\n): Promise<ExportJobDownloadInfo | undefined> {\n const deadline = Date.now() + timeoutSeconds * 1000;\n while (Date.now() < deadline) {\n const info = await getDownloadInfo(client, jobId);\n if (info) {\n return info;\n }\n await delay(POLL_INTERVAL);\n }\n return undefined;\n}\n\nasync function getDownloadInfo(\n client: SevDesk,\n jobId: string,\n): Promise<ExportJobDownloadInfo | undefined> {\n try {\n const [info] = await client.exports.getJobDownloadInfo({ jobId });\n return info?.link ? info : undefined;\n } catch (error) {\n if (error instanceof SevDeskError) {\n return undefined;\n }\n throw error;\n }\n}\n\nfunction delay(milliseconds: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, milliseconds));\n}\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Export invoices as a CSV file.',\n options: defineOptions(\n z.object({\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the CSV file to. Defaults to the filename of the export.',\n ),\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of invoices to export.'),\n startDate: z\n .string()\n .optional()\n .describe('Only export invoices on or after this date (ISO 8601).'),\n endDate: z\n .string()\n .optional()\n .describe('Only export invoices on or before this date (ISO 8601).'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const file = await client.exports.exportInvoicesCsv({\n limit: options.limit,\n filter: { startDate: options.startDate, endDate: options.endDate },\n });\n const path = options.output ?? file.filename;\n await writeFile(\n path,\n file.base64Encoded ? Buffer.from(file.content, 'base64') : file.content,\n );\n if (options.json) {\n printJson({ filename: file.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Export transactions as a CSV file.',\n options: defineOptions(\n z.object({\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the CSV file to. Defaults to the filename of the export.',\n ),\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of transactions to export.'),\n startDate: z\n .string()\n .optional()\n .describe('Only export transactions on or after this date (ISO 8601).'),\n endDate: z\n .string()\n .optional()\n .describe(\n 'Only export transactions on or before this date (ISO 8601).',\n ),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const file = await client.exports.exportTransactionsCsv({\n limit: options.limit,\n filter: { startDate: options.startDate, endDate: options.endDate },\n });\n const path = options.output ?? file.filename;\n await writeFile(\n path,\n file.base64Encoded ? Buffer.from(file.content, 'base64') : file.content,\n );\n if (options.json) {\n printJson({ filename: file.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Export vouchers as a CSV file.',\n options: defineOptions(\n z.object({\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the CSV file to. Defaults to the filename of the export.',\n ),\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of vouchers to export.'),\n startDate: z\n .string()\n .optional()\n .describe('Only export vouchers on or after this date (ISO 8601).'),\n endDate: z\n .string()\n .optional()\n .describe('Only export vouchers on or before this date (ISO 8601).'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const file = await client.exports.exportVouchersCsv({\n limit: options.limit,\n filter: { startDate: options.startDate, endDate: options.endDate },\n });\n const path = options.output ?? file.filename;\n await writeFile(\n path,\n file.base64Encoded ? Buffer.from(file.content, 'base64') : file.content,\n );\n if (options.json) {\n printJson({ filename: file.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import type { AllowedTaxRule, ReceiptGuide } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nconst MAX_TAX_RULES = 3;\n\nfunction formatTaxRules(taxRules: AllowedTaxRule[]): string {\n const names = taxRules.map((taxRule) => taxRule.name);\n if (names.length > MAX_TAX_RULES) {\n return `${names.slice(0, MAX_TAX_RULES).join(', ')}, …`;\n }\n return names.join(', ');\n}\n\nexport default defineCommand({\n description:\n 'List bookable accounts and their allowed tax rules. The first matching filter wins: --account-number, --tax-rule, --revenue, --expense. Without a filter, all accounts are listed.',\n options: defineOptions(\n z.object({\n accountNumber: z\n .string()\n .optional()\n .describe('Only show the account with this datev account number.'),\n taxRule: z\n .string()\n .optional()\n .describe('Tax rule name, for example USTPFL_UMS_EINN.'),\n revenue: z\n .boolean()\n .default(false)\n .describe('Only show accounts that can be used for revenue.'),\n expense: z\n .boolean()\n .default(false)\n .describe('Only show accounts that can be used for expenses.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n let guides: ReceiptGuide[];\n if (options.accountNumber) {\n guides = await client.receiptGuidance.forAccountNumber({\n accountNumber: options.accountNumber,\n });\n } else if (options.taxRule) {\n guides = await client.receiptGuidance.forTaxRule({\n taxRule: options.taxRule,\n });\n } else if (options.revenue) {\n guides = await client.receiptGuidance.forRevenue();\n } else if (options.expense) {\n guides = await client.receiptGuidance.forExpense();\n } else {\n guides = await client.receiptGuidance.forAllAccounts();\n }\n if (options.json) {\n printJson(guides);\n return;\n }\n if (guides.length === 0) {\n consola.info('No accounts found.');\n return;\n }\n printTable(\n guides.map((guide) => ({\n id: String(guide.accountDatevId),\n number: guide.accountNumber,\n name: guide.accountName,\n taxRules: formatTaxRules(guide.allowedTaxRules),\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single invoice.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the invoice. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const invoiceId = await requireNumberOption({\n value: options.id,\n requirement: 'an invoice ID via --id',\n question: 'Enter the invoice ID:',\n });\n const invoice = await client.invoices.get({ invoiceId });\n if (options.json) {\n printJson(invoice);\n return;\n }\n consola.info(`ID: ${invoice.id}`);\n consola.info(`Number: ${invoice.invoiceNumber ?? '-'}`);\n consola.info(`Date: ${invoice.invoiceDate}`);\n consola.info(`Status: ${invoice.status}`);\n consola.info(`Contact: ${invoice.contact?.id ?? '-'}`);\n consola.info(`Net: ${invoice.sumNet}`);\n consola.info(`Tax: ${invoice.sumTax}`);\n consola.info(`Gross: ${invoice.sumGross}`);\n consola.info(`Currency: ${invoice.currency}`);\n },\n});\n","import type { InvoiceStatus } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List invoices.',\n options: defineOptions(\n z.object({\n status: z.coerce\n .number()\n .optional()\n .describe(\n 'Filter by status: 50 deactivated recurring, 100 draft, 200 open, 750 partially paid, 1000 paid.',\n ),\n invoiceNumber: z\n .string()\n .optional()\n .describe('Filter by invoice number.'),\n startDate: z\n .string()\n .optional()\n .describe(\n 'Only invoices on or after this date as dd.mm.yyyy or Unix timestamp.',\n ),\n endDate: z\n .string()\n .optional()\n .describe(\n 'Only invoices on or before this date as dd.mm.yyyy or Unix timestamp.',\n ),\n contact: z.coerce\n .number()\n .optional()\n .describe('ID of the contact whose invoices to list.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of invoices to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of invoices to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const invoices = await client.invoices.list({\n status: options.status as InvoiceStatus | undefined,\n invoiceNumber: options.invoiceNumber,\n startDate: options.startDate,\n endDate: options.endDate,\n contactId: options.contact,\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(invoices);\n return;\n }\n if (invoices.length === 0) {\n consola.info('No invoices found.');\n return;\n }\n printTable(\n invoices.map((invoice) => ({\n id: invoice.id,\n number: invoice.invoiceNumber ?? '',\n date: invoice.invoiceDate,\n contact: invoice.contact?.id ?? '',\n gross: invoice.sumGross,\n status: invoice.status,\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Download the PDF of an invoice.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the invoice. If omitted, you will be prompted.'),\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the PDF to. Defaults to the file name reported by the API.',\n ),\n preventSendBy: z\n .boolean()\n .default(false)\n .describe('Do not mark the invoice as sent by download.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const invoiceId = await requireNumberOption({\n value: options.id,\n requirement: 'an invoice ID via --id',\n question: 'Enter the invoice ID:',\n });\n const pdf = await client.invoices.getPdf({\n invoiceId,\n preventSendBy: options.preventSendBy,\n });\n const path = resolve(options.output ?? pdf.filename);\n await writeFile(path, Buffer.from(pdf.content, 'base64'));\n if (options.json) {\n printJson({ filename: pdf.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { createClient } from '../client';\nimport { configPath, readConfig, writeConfig } from '../config';\nimport { isInteractive } from '../interactive';\nimport { promptText } from '../prompt';\n\nexport default defineCommand({\n description: 'Log in with your sevdesk API token.',\n options: defineOptions(\n z.object({\n token: z\n .string()\n .optional()\n .describe('The sevdesk API token. If omitted, you will be prompted.'),\n }),\n ),\n action: async (options) => {\n let token = options.token?.trim();\n if (!token) {\n if (!isInteractive()) {\n consola.error(\n 'You must provide a token via --token when running in a non-interactive environment.',\n );\n process.exit(1);\n }\n consola.info(\n 'You can find your API token in sevdesk under Settings > User > API token.',\n );\n token = (await promptText('Enter your sevdesk API token:')).trim();\n }\n const client = createClient(token);\n const version = await client.basics.getBookkeepingSystemVersion();\n if (version === '1.0') {\n consola.error(\n 'This sevdesk account still uses bookkeeping system version 1.0, which is not supported. Please update your account to sevdesk-Update 2.0.',\n );\n process.exit(1);\n }\n await writeConfig({ ...(await readConfig()), token });\n consola.success(`Logged in. Token stored in ${configPath()}.`);\n },\n});\n","import { defineCommand } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { readConfig, writeConfig } from '../config';\n\nexport default defineCommand({\n description: 'Log out by removing the stored API token.',\n action: async () => {\n const { token, ...config } = await readConfig();\n if (!token) {\n consola.info('You are not logged in.');\n } else {\n await writeConfig(config);\n consola.success('Logged out.');\n }\n if (process.env['SEVDESK_TOKEN']) {\n consola.warn(\n 'The SEVDESK_TOKEN environment variable is still set and will be used for authentication.',\n );\n }\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single order.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the order. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const orderId = await requireNumberOption({\n value: options.id,\n requirement: 'an order ID via --id',\n question: 'Enter the order ID:',\n });\n const order = await client.orders.get({ orderId });\n if (options.json) {\n printJson(order);\n return;\n }\n consola.info(`ID: ${order.id}`);\n consola.info(`Number: ${order.orderNumber}`);\n consola.info(`Date: ${order.orderDate}`);\n consola.info(`Status: ${order.status}`);\n consola.info(`Contact: ${order.contact?.id ?? '-'}`);\n consola.info(`Net: ${order.sumNet}`);\n consola.info(`Tax: ${order.sumTax}`);\n consola.info(`Gross: ${order.sumGross}`);\n consola.info(`Currency: ${order.currency}`);\n },\n});\n","import type { OrderStatus } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List orders.',\n options: defineOptions(\n z.object({\n status: z.coerce\n .number()\n .optional()\n .describe(\n 'Filter by status: 100 draft, 200 delivered, 300 rejected, 500 accepted, 750 partially calculated, 1000 calculated.',\n ),\n orderNumber: z.string().optional().describe('Filter by order number.'),\n startDate: z\n .string()\n .optional()\n .describe(\n 'Only orders on or after this date as dd.mm.yyyy or Unix timestamp.',\n ),\n endDate: z\n .string()\n .optional()\n .describe(\n 'Only orders on or before this date as dd.mm.yyyy or Unix timestamp.',\n ),\n contact: z.coerce\n .number()\n .optional()\n .describe('ID of the contact whose orders to list.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of orders to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of orders to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const orders = await client.orders.list({\n status: options.status as OrderStatus | undefined,\n orderNumber: options.orderNumber,\n startDate: options.startDate,\n endDate: options.endDate,\n contactId: options.contact,\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(orders);\n return;\n }\n if (orders.length === 0) {\n consola.info('No orders found.');\n return;\n }\n printTable(\n orders.map((order) => ({\n id: order.id,\n number: order.orderNumber,\n date: order.orderDate,\n contact: order.contact?.id ?? '',\n gross: order.sumGross,\n status: order.status,\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Download the PDF of an order.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the order. If omitted, you will be prompted.'),\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the PDF to. Defaults to the file name reported by the API.',\n ),\n preventSendBy: z\n .boolean()\n .default(false)\n .describe('Do not mark the order as sent by download.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const orderId = await requireNumberOption({\n value: options.id,\n requirement: 'an order ID via --id',\n question: 'Enter the order ID:',\n });\n const pdf = await client.orders.getPdf({\n orderId,\n preventSendBy: options.preventSendBy,\n });\n const path = resolve(options.output ?? pdf.filename);\n await writeFile(path, Buffer.from(pdf.content, 'base64'));\n if (options.json) {\n printJson({ filename: pdf.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single part.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The part ID. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const partId = await requireNumberOption({\n value: options.id,\n requirement: 'a part ID via --id',\n question: 'Enter the part ID:',\n });\n const part = await client.parts.get({ partId });\n if (options.json) {\n printJson(part);\n return;\n }\n consola.info(`ID: ${part.id}`);\n consola.info(`Part number: ${part.partNumber}`);\n consola.info(`Name: ${part.name}`);\n consola.info(`Text: ${part.text ?? '-'}`);\n consola.info(`Price: ${part.price ?? '-'}`);\n consola.info(`Price net: ${part.priceNet ?? '-'}`);\n consola.info(`Price gross: ${part.priceGross ?? '-'}`);\n consola.info(`Tax rate: ${part.taxRate}`);\n consola.info(`Stock: ${part.stock}`);\n consola.info(`Status: ${part.status ?? '-'}`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List parts.',\n options: defineOptions(\n z.object({\n name: z.string().optional().describe('Filter by part name.'),\n partNumber: z.string().optional().describe('Filter by part number.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of parts to return.'),\n offset: z.coerce.number().optional().describe('Number of parts to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const parts = await client.parts.list({\n name: options.name,\n partNumber: options.partNumber,\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(parts);\n return;\n }\n if (parts.length === 0) {\n consola.info('No parts found.');\n return;\n }\n printTable(\n parts.map((part) => ({\n id: part.id,\n partNumber: part.partNumber,\n name: part.name,\n price: part.price ?? '',\n taxRate: part.taxRate,\n status: part.status ?? '',\n stock: part.stock,\n })),\n );\n },\n});\n","import type { TagObjectType } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption, requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nconst OBJECT_TYPES = ['Invoice', 'Voucher', 'Order', 'CreditNote'] as const;\n\nexport default defineCommand({\n description: 'Create a tag and attach it to a document.',\n options: defineOptions(\n z.object({\n name: z\n .string()\n .optional()\n .describe('Name of the tag. If omitted, you will be prompted.'),\n objectType: z\n .string()\n .optional()\n .describe(\n 'Type of the document to tag: Invoice, Voucher, Order or CreditNote. If omitted, you will be prompted.',\n ),\n objectId: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the document to tag. If omitted, you will be prompted.',\n ),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const name = await requireStringOption({\n value: options.name,\n requirement: 'a tag name via --name',\n question: 'Enter the tag name:',\n });\n const objectType = await requireStringOption({\n value: options.objectType,\n requirement: 'a document type via --object-type',\n question: `Enter the document type (${OBJECT_TYPES.join(', ')}):`,\n });\n if (!isTagObjectType(objectType)) {\n consola.error(\n `The document type must be one of: ${OBJECT_TYPES.join(', ')}.`,\n );\n process.exit(1);\n }\n const objectId = await requireNumberOption({\n value: options.objectId,\n requirement: 'a document ID via --object-id',\n question: 'Enter the document ID:',\n });\n const relation = await client.tags.create({\n name,\n objectId,\n objectName: objectType,\n });\n if (options.json) {\n printJson(relation);\n return;\n }\n consola.success(`Created tag ${relation.tag.id}.`);\n },\n});\n\nfunction isTagObjectType(value: string): value is TagObjectType {\n return OBJECT_TYPES.some((objectType) => objectType === value);\n}\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Delete a tag.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The tag ID. If omitted, you will be prompted.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const tagId = await requireNumberOption({\n value: options.id,\n requirement: 'a tag ID via --id',\n question: 'Enter the tag ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Delete tag ${tagId}?`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n await client.tags.delete({ tagId });\n if (options.json) {\n printJson({ deleted: true });\n return;\n }\n consola.success('Tag deleted.');\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List tags.',\n options: defineOptions(\n z.object({\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of tags to return.'),\n offset: z.coerce.number().optional().describe('Number of tags to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const tags = await client.tags.list({\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(tags);\n return;\n }\n if (tags.length === 0) {\n consola.info('No tags found.');\n return;\n }\n printTable(tags.map((tag) => ({ id: tag.id, name: tag.name })));\n },\n});\n","import type { TransactionStatus } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption, requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\n/**\n * Creates a transaction manually. This should only be used on check accounts\n * of type online, preferably on accounts that import their transactions from\n * files, because transactions of connected bank accounts are synchronized by\n * sevdesk itself.\n */\nexport default defineCommand({\n description:\n 'Create a transaction. Only use this on file import (online) check accounts.',\n options: defineOptions(\n z.object({\n checkAccount: z.coerce\n .number()\n .optional()\n .describe(\n 'The ID of the check account the transaction belongs to. If omitted, you will be prompted.',\n ),\n amount: z.coerce\n .number()\n .optional()\n .describe(\n 'The amount of the transaction. Negative for expenses. If omitted, you will be prompted.',\n ),\n payee: z\n .string()\n .optional()\n .describe(\n 'The name of the payee or payer. If omitted, you will be prompted.',\n ),\n valueDate: z\n .string()\n .default(() => new Date().toISOString())\n .describe('The date the transaction was booked (ISO 8601).'),\n entryDate: z\n .string()\n .optional()\n .describe('The date the transaction was imported (ISO 8601).'),\n purpose: z\n .string()\n .optional()\n .describe('The payment purpose of the transaction.'),\n status: z.coerce\n .number()\n .default(100)\n .describe('100 created, 200 linked, 300 private, 400 booked.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const checkAccountId = await requireNumberOption({\n value: options.checkAccount,\n requirement: 'a check account ID via --check-account',\n question: 'Enter the check account ID:',\n });\n const amount = await requireNumberOption({\n value: options.amount,\n requirement: 'an amount via --amount',\n question: 'Enter the amount:',\n });\n const payee = await requireStringOption({\n value: options.payee,\n requirement: 'a payee via --payee',\n question: 'Enter the payee or payer name:',\n });\n const transaction = await client.transactions.create({\n checkAccountId,\n amount,\n payeePayerName: payee,\n valueDate: options.valueDate,\n entryDate: options.entryDate,\n paymtPurpose: options.purpose,\n status: options.status as TransactionStatus,\n });\n if (options.json) {\n printJson(transaction);\n return;\n }\n consola.success(`Created transaction ${transaction.id}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single transaction.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The transaction ID. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const transactionId = await requireNumberOption({\n value: options.id,\n requirement: 'a transaction ID via --id',\n question: 'Enter the transaction ID:',\n });\n const transaction = await client.transactions.get({ transactionId });\n if (options.json) {\n printJson(transaction);\n return;\n }\n consola.info(`ID: ${transaction.id}`);\n consola.info(`Value date: ${transaction.valueDate}`);\n consola.info(`Amount: ${transaction.amount}`);\n consola.info(`Payee: ${transaction.payeePayerName ?? '-'}`);\n consola.info(`Purpose: ${transaction.paymtPurpose ?? '-'}`);\n consola.info(`Status: ${transaction.status}`);\n consola.info(`Check account: ${transaction.checkAccount.id}`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List transactions of your check accounts.',\n options: defineOptions(\n z.object({\n checkAccount: z.coerce\n .number()\n .optional()\n .describe('Only show transactions of this check account ID.'),\n unbooked: z\n .boolean()\n .default(false)\n .describe('Only show transactions that are not yet booked.'),\n startDate: z\n .string()\n .optional()\n .describe('Only show transactions on or after this date (ISO 8601).'),\n endDate: z\n .string()\n .optional()\n .describe('Only show transactions on or before this date (ISO 8601).'),\n payee: z\n .string()\n .optional()\n .describe('Only show transactions with this payee or payer name.'),\n purpose: z\n .string()\n .optional()\n .describe('Only show transactions with this payment purpose.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of transactions to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('The number of transactions to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const transactions = await client.transactions.list({\n checkAccountId: options.checkAccount,\n isBooked: options.unbooked ? false : undefined,\n startDate: options.startDate,\n endDate: options.endDate,\n payeePayerName: options.payee,\n paymtPurpose: options.purpose,\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(transactions);\n return;\n }\n if (transactions.length === 0) {\n consola.info('No transactions found.');\n return;\n }\n printTable(\n transactions.map((transaction) => ({\n id: transaction.id,\n valueDate: transaction.valueDate,\n payee: transaction.payeePayerName ?? '',\n purpose: transaction.paymtPurpose ?? '',\n amount: transaction.amount,\n status: transaction.status,\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Book a payment on a voucher.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n amount: z.coerce\n .number()\n .optional()\n .describe('Amount to book. Can also be a partial amount.'),\n date: z\n .string()\n .default(() => new Date().toISOString())\n .describe('Booking date as ISO 8601. Defaults to now.'),\n type: z\n .enum(['FULL_PAYMENT', 'N', 'CB', 'O', 'OF', 'MTC'])\n .default('FULL_PAYMENT')\n .describe(\n 'Type of the booking. Supported values are FULL_PAYMENT, N (partial), CB (cash discount), O (other), OF (reminder charges) and MTC (monetary traffic costs).',\n ),\n checkAccount: z.coerce\n .number()\n .optional()\n .describe('ID of the check account.'),\n transaction: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the bank transaction to link. Required for online check accounts, omit for clearing accounts.',\n ),\n createFeed: z\n .boolean()\n .optional()\n .describe('Create a feed entry for the booking.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher via --id',\n question: 'Enter the voucher ID:',\n });\n const amount = await requireNumberOption({\n value: options.amount,\n requirement: 'an amount via --amount',\n question: 'Enter the amount to book:',\n });\n const checkAccountId = await requireNumberOption({\n value: options.checkAccount,\n requirement: 'a check account via --check-account',\n question: 'Enter the check account ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Book ${amount} on voucher ${voucherId}?`,\n yes: options.yes,\n });\n if (!confirmed) {\n return;\n }\n const result = await client.vouchers.book({\n voucherId,\n amount,\n date: options.date,\n type: options.type,\n checkAccountId,\n checkAccountTransactionId: options.transaction,\n createFeed: options.createFeed,\n });\n if (options.json) {\n printJson(result);\n return;\n }\n consola.success(\n `Booked ${amount} on voucher ${voucherId}. Status changed from ${result.fromStatus} to ${result.toStatus}.`,\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { readFile } from 'node:fs/promises';\nimport { basename } from 'node:path';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption, requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Create a voucher from a receipt file.',\n options: defineOptions(\n z.object({\n file: z\n .string()\n .optional()\n .describe(\n 'Path to the receipt file to attach, for example a PDF, an image or an XML invoice.',\n ),\n status: z\n .enum(['draft', 'open'])\n .default('open')\n .describe(\n 'Status of the created voucher. Supported values are draft and open.',\n ),\n creditDebit: z\n .enum(['C', 'D'])\n .default('C')\n .describe('C for expense (credit), D for income (debit) vouchers.'),\n taxRule: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the tax rule, for example 9 for deductible input tax expenses.',\n ),\n accountDatev: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the booking account (AccountDatev). Find it with guidance:accounts.',\n ),\n amount: z.coerce\n .number()\n .optional()\n .describe('Amount of the voucher position.'),\n net: z\n .boolean()\n .default(false)\n .describe('Treat the amount as net instead of gross.'),\n taxRate: z.coerce\n .number()\n .default(19)\n .describe('Tax rate of the voucher position in percent.'),\n voucherDate: z\n .string()\n .optional()\n .describe('Date as dd.mm.yyyy or Unix timestamp.'),\n payDate: z\n .string()\n .optional()\n .describe('Date as dd.mm.yyyy or Unix timestamp.'),\n supplierId: z.coerce\n .number()\n .optional()\n .describe('ID of the supplier contact.'),\n supplierName: z\n .string()\n .optional()\n .describe('Name of the supplier, used when no supplier ID is given.'),\n description: z.string().optional().describe('The voucher number.'),\n comment: z\n .string()\n .optional()\n .describe('Comment for the voucher position.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const path = await requireStringOption({\n value: options.file,\n requirement: 'a file via --file',\n question: 'Enter the path to the receipt file:',\n });\n const taxRuleId = await requireNumberOption({\n value: options.taxRule,\n requirement: 'a tax rule via --tax-rule',\n question: 'Enter the tax rule ID:',\n });\n const accountDatevId = await requireNumberOption({\n value: options.accountDatev,\n requirement: 'a booking account via --account-datev',\n question: 'Enter the booking account ID:',\n });\n const amount = await requireNumberOption({\n value: options.amount,\n requirement: 'an amount via --amount',\n question: 'Enter the amount:',\n });\n const supplierName =\n options.supplierId === undefined && !options.supplierName\n ? await requireStringOption({\n value: undefined,\n requirement: 'a supplier via --supplier-id or --supplier-name',\n question: 'Enter the supplier name:',\n })\n : options.supplierName;\n const file = await readFile(path).catch(() => {\n consola.error(\n `The file \"${path}\" could not be read. Check that the path is correct.`,\n );\n process.exit(1);\n });\n const result = await client.vouchers.createFromFile({\n file,\n filename: basename(path),\n voucher: {\n status: options.status === 'draft' ? 50 : 100,\n creditDebit: options.creditDebit,\n taxRuleId,\n voucherDate: options.voucherDate,\n payDate: options.payDate,\n supplierId: options.supplierId,\n supplierName,\n description: options.description,\n },\n positions: [\n {\n accountDatevId,\n taxRate: options.taxRate,\n net: options.net,\n ...(options.net ? { sumNet: amount } : { sumGross: amount }),\n comment: options.comment,\n },\n ],\n });\n if (options.json) {\n printJson(result);\n return;\n }\n consola.success(\n `Created voucher ${result.voucher.id} with status ${result.voucher.status}.`,\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Enshrine a voucher so that it can no longer be changed.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher ID via --id',\n question: 'Enter the voucher ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Enshrine voucher ${voucherId}? This cannot be undone.`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n await client.vouchers.enshrine({ voucherId });\n if (options.json) {\n printJson({ enshrined: true });\n return;\n }\n consola.success(`Enshrined voucher ${voucherId}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single voucher.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher ID via --id',\n question: 'Enter the voucher ID:',\n });\n const voucher = await client.vouchers.get({ voucherId });\n if (options.json) {\n printJson(voucher);\n return;\n }\n consola.info(`ID: ${voucher.id}`);\n consola.info(`Status: ${voucher.status ?? '-'}`);\n consola.info(`Date: ${voucher.voucherDate ?? '-'}`);\n consola.info(\n `Supplier: ${voucher.supplierName ?? voucher.supplier?.id ?? '-'}`,\n );\n consola.info(`Description: ${voucher.description ?? '-'}`);\n consola.info(`Net: ${voucher.sumNet}`);\n consola.info(`Tax: ${voucher.sumTax}`);\n consola.info(`Gross: ${voucher.sumGross}`);\n consola.info(`Currency: ${voucher.currency ?? '-'}`);\n consola.info(`Enshrined: ${voucher.enshrined ?? 'no'}`);\n },\n});\n","import type { VoucherStatus } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List vouchers.',\n options: defineOptions(\n z.object({\n status: z.coerce\n .number()\n .optional()\n .describe(\n 'Filter by status: 50 draft, 100 open, 150 transferred, 750 partially paid, 1000 paid.',\n ),\n creditDebit: z\n .enum(['C', 'D'])\n .optional()\n .describe('Filter by C for expense or D for income vouchers.'),\n descriptionLike: z\n .string()\n .optional()\n .describe('Filter by voucher number, matching partially.'),\n startDate: z\n .string()\n .optional()\n .describe(\n 'Only vouchers on or after this date as dd.mm.yyyy or Unix timestamp.',\n ),\n endDate: z\n .string()\n .optional()\n .describe(\n 'Only vouchers on or before this date as dd.mm.yyyy or Unix timestamp.',\n ),\n contact: z.coerce\n .number()\n .optional()\n .describe('ID of the contact whose vouchers to list.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of vouchers to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of vouchers to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const vouchers = await client.vouchers.list({\n status: options.status as VoucherStatus | undefined,\n creditDebit: options.creditDebit,\n descriptionLike: options.descriptionLike,\n startDate: options.startDate,\n endDate: options.endDate,\n contactId: options.contact,\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(vouchers);\n return;\n }\n if (vouchers.length === 0) {\n consola.info('No vouchers found.');\n return;\n }\n printTable(\n vouchers.map((voucher) => ({\n id: voucher.id,\n date: voucher.voucherDate ?? '',\n supplier: voucher.supplierName ?? voucher.supplier?.id ?? '',\n description: voucher.description ?? '',\n gross: voucher.sumGross,\n status: voucher.status ?? '',\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Reset a voucher to the draft status.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher ID via --id',\n question: 'Enter the voucher ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Reset voucher ${voucherId} to draft? This unlinks existing payments.`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n const voucher = await client.vouchers.resetToDraft({ voucherId });\n if (options.json) {\n printJson(voucher);\n return;\n }\n consola.success(\n `Reset voucher ${voucher.id}. New status: ${voucher.status ?? '-'}.`,\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Reset a voucher to the open status.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher ID via --id',\n question: 'Enter the voucher ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Reset voucher ${voucherId} to open? This unlinks existing payments.`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n const voucher = await client.vouchers.resetToOpen({ voucherId });\n if (options.json) {\n printJson(voucher);\n return;\n }\n consola.success(\n `Reset voucher ${voucher.id}. New status: ${voucher.status ?? '-'}.`,\n );\n },\n});\n","#!/usr/bin/env node\nimport { defineConfig, processConfig } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport accountsBalance from './commands/accounts/balance';\nimport accountsCreateClearing from './commands/accounts/create-clearing';\nimport accountsCreateFileImport from './commands/accounts/create-file-import';\nimport accountsGet from './commands/accounts/get';\nimport accountsList from './commands/accounts/list';\nimport contactsCreate from './commands/contacts/create';\nimport contactsDelete from './commands/contacts/delete';\nimport contactsGet from './commands/contacts/get';\nimport contactsList from './commands/contacts/list';\nimport contactsUpdate from './commands/contacts/update';\nimport creditNotesGet from './commands/credit-notes/get';\nimport creditNotesList from './commands/credit-notes/list';\nimport creditNotesPdf from './commands/credit-notes/pdf';\nimport doctor from './commands/doctor';\nimport exportContacts from './commands/export/contacts';\nimport exportDatev from './commands/export/datev';\nimport exportInvoices from './commands/export/invoices';\nimport exportTransactions from './commands/export/transactions';\nimport exportVouchers from './commands/export/vouchers';\nimport guidanceAccounts from './commands/guidance/accounts';\nimport invoicesGet from './commands/invoices/get';\nimport invoicesList from './commands/invoices/list';\nimport invoicesPdf from './commands/invoices/pdf';\nimport login from './commands/login';\nimport logout from './commands/logout';\nimport ordersGet from './commands/orders/get';\nimport ordersList from './commands/orders/list';\nimport ordersPdf from './commands/orders/pdf';\nimport partsGet from './commands/parts/get';\nimport partsList from './commands/parts/list';\nimport tagsCreate from './commands/tags/create';\nimport tagsDelete from './commands/tags/delete';\nimport tagsList from './commands/tags/list';\nimport transactionsCreate from './commands/transactions/create';\nimport transactionsGet from './commands/transactions/get';\nimport transactionsList from './commands/transactions/list';\nimport vouchersBook from './commands/vouchers/book';\nimport vouchersCreate from './commands/vouchers/create';\nimport vouchersEnshrine from './commands/vouchers/enshrine';\nimport vouchersGet from './commands/vouchers/get';\nimport vouchersList from './commands/vouchers/list';\nimport vouchersResetToDraft from './commands/vouchers/reset-to-draft';\nimport vouchersResetToOpen from './commands/vouchers/reset-to-open';\nimport { formatError } from './errors';\nimport { pkg } from './package';\n\nconst config = defineConfig({\n meta: {\n name: 'sevdesk',\n version: pkg.version,\n description: pkg.description,\n },\n commands: {\n login,\n logout,\n doctor,\n 'accounts:balance': accountsBalance,\n 'accounts:create-clearing': accountsCreateClearing,\n 'accounts:create-file-import': accountsCreateFileImport,\n 'accounts:get': accountsGet,\n 'accounts:list': accountsList,\n 'contacts:create': contactsCreate,\n 'contacts:delete': contactsDelete,\n 'contacts:get': contactsGet,\n 'contacts:list': contactsList,\n 'contacts:update': contactsUpdate,\n 'credit-notes:get': creditNotesGet,\n 'credit-notes:list': creditNotesList,\n 'credit-notes:pdf': creditNotesPdf,\n 'export:contacts': exportContacts,\n 'export:datev': exportDatev,\n 'export:invoices': exportInvoices,\n 'export:transactions': exportTransactions,\n 'export:vouchers': exportVouchers,\n 'guidance:accounts': guidanceAccounts,\n 'invoices:get': invoicesGet,\n 'invoices:list': invoicesList,\n 'invoices:pdf': invoicesPdf,\n 'orders:get': ordersGet,\n 'orders:list': ordersList,\n 'orders:pdf': ordersPdf,\n 'parts:get': partsGet,\n 'parts:list': partsList,\n 'tags:create': tagsCreate,\n 'tags:delete': tagsDelete,\n 'tags:list': tagsList,\n 'transactions:create': transactionsCreate,\n 'transactions:get': transactionsGet,\n 'transactions:list': transactionsList,\n 'vouchers:book': vouchersBook,\n 'vouchers:create': vouchersCreate,\n 'vouchers:enshrine': vouchersEnshrine,\n 'vouchers:get': vouchersGet,\n 'vouchers:list': vouchersList,\n 'vouchers:reset-to-draft': vouchersResetToDraft,\n 'vouchers:reset-to-open': vouchersResetToOpen,\n },\n});\n\ntry {\n const result = processConfig(config, process.argv.slice(2));\n await result.command.action(result.options, result.args);\n} catch (error) {\n consola.error(formatError(error));\n process.exitCode = 1;\n}\n"],"mappings":";;;;;;;;;;AAQA,SAAS,YAAoB;CAC3B,MAAM,gBAAgB,QAAQ,IAAI;CAClC,MAAM,OAAO,gBAAgB,gBAAgB,KAAK,QAAQ,GAAG,SAAS;CACtE,OAAO,KAAK,MAAM,S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MAAM,OAAO,QAAQ,OAAO,OAAO,SAAS,OAAO,IAAI;AACzD,SAAS,OAAO;CACd,QAAQ,MAAM,YAAY,KAAK,CAAC;CAChC,QAAQ,WAAW;AACrB"}
1
+ {"version":3,"file":"index.js","names":["accountsBalance","accountsCreateClearing","accountsCreateFileImport","accountsGet","accountsList","contactsCreate","contactsDelete","contactsGet","contactsList","contactsUpdate","creditNotesGet","creditNotesList","creditNotesPdf","exportContacts","exportDatev","exportInvoices","exportTransactions","exportVouchers","guidanceAccounts","invoicesGet","invoicesList","invoicesPdf","ordersGet","ordersList","ordersPdf","partsGet","partsList","tagsCreate","tagsDelete","tagsList","transactionsCreate","transactionsGet","transactionsList","vouchersBook","vouchersCreate","vouchersEnshrine","vouchersGet","vouchersList","vouchersResetToDraft","vouchersResetToOpen"],"sources":["../src/config.ts","../src/package.ts","../src/client.ts","../src/interactive.ts","../src/prompt.ts","../src/options.ts","../src/output.ts","../src/commands/accounts/balance.ts","../src/commands/accounts/create-clearing.ts","../src/commands/accounts/create-file-import.ts","../src/commands/accounts/get.ts","../src/commands/accounts/list.ts","../src/commands/contacts/create.ts","../src/commands/contacts/delete.ts","../src/commands/contacts/get.ts","../src/commands/contacts/list.ts","../src/commands/contacts/update.ts","../src/commands/credit-notes/get.ts","../src/commands/credit-notes/list.ts","../src/commands/credit-notes/pdf.ts","../src/errors.ts","../src/commands/doctor.ts","../src/commands/export/contacts.ts","../src/commands/export/datev.ts","../src/commands/export/invoices.ts","../src/commands/export/transactions.ts","../src/commands/export/vouchers.ts","../src/commands/guidance/accounts.ts","../src/commands/invoices/get.ts","../src/commands/invoices/list.ts","../src/commands/invoices/pdf.ts","../src/commands/login.ts","../src/commands/logout.ts","../src/commands/orders/get.ts","../src/commands/orders/list.ts","../src/commands/orders/pdf.ts","../src/commands/parts/get.ts","../src/commands/parts/list.ts","../src/commands/tags/create.ts","../src/commands/tags/delete.ts","../src/commands/tags/list.ts","../src/commands/transactions/create.ts","../src/commands/transactions/get.ts","../src/commands/transactions/list.ts","../src/commands/vouchers/book.ts","../src/commands/vouchers/create.ts","../src/commands/vouchers/enshrine.ts","../src/commands/vouchers/get.ts","../src/commands/vouchers/list.ts","../src/commands/vouchers/reset-to-draft.ts","../src/commands/vouchers/reset-to-open.ts","../src/index.ts"],"sourcesContent":["import { mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\n\nexport interface CliConfig {\n token?: string;\n}\n\nfunction configDir(): string {\n const xdgConfigHome = process.env['XDG_CONFIG_HOME'];\n const base = xdgConfigHome ? xdgConfigHome : join(homedir(), '.config');\n return join(base, 'sevdesk');\n}\n\nexport function configPath(): string {\n return join(configDir(), 'config.json');\n}\n\nexport async function readConfig(): Promise<CliConfig> {\n try {\n return JSON.parse(await readFile(configPath(), 'utf8')) as CliConfig;\n } catch {\n return {};\n }\n}\n\nexport async function writeConfig(config: CliConfig): Promise<void> {\n await mkdir(configDir(), { recursive: true });\n await writeFile(configPath(), `${JSON.stringify(config, null, 2)}\\n`, {\n mode: 0o600,\n });\n}\n\nexport type TokenSource = 'environment' | 'config' | 'none';\n\nexport async function resolveToken(): Promise<{\n token?: string;\n source: TokenSource;\n}> {\n const environmentToken = process.env['SEVDESK_TOKEN']?.trim();\n if (environmentToken) {\n return { token: environmentToken, source: 'environment' };\n }\n const configToken = (await readConfig()).token?.trim();\n if (configToken) {\n return { token: configToken, source: 'config' };\n }\n return { source: 'none' };\n}\n","import { createRequire } from 'node:module';\n\nexport const pkg = createRequire(import.meta.url)('../package.json') as {\n name: string;\n version: string;\n description: string;\n};\n","import { SevDesk } from '@genz-its/sevdesk-sdk';\nimport { consola } from 'consola';\nimport { resolveToken } from './config';\nimport { pkg } from './package';\n\nexport function createClient(token: string): SevDesk {\n return new SevDesk({ token, userAgent: `${pkg.name}/${pkg.version}` });\n}\n\n/**\n * Resolves the API token and returns a ready-to-use client. Exits with an\n * explanation when no token is available.\n */\nexport async function requireClient(): Promise<SevDesk> {\n const { token } = await resolveToken();\n if (!token) {\n consola.error(\n 'You must be logged in. Run `sevdesk login` or set the SEVDESK_TOKEN environment variable.',\n );\n process.exit(1);\n }\n return createClient(token);\n}\n","export function isInteractive(): boolean {\n return (\n process.stdin.isTTY === true &&\n process.stdout.isTTY === true &&\n !process.env['CI']\n );\n}\n","import { consola } from 'consola';\n\nexport async function promptText(message: string): Promise<string> {\n const response = await consola.prompt(message, {\n type: 'text',\n cancel: 'symbol',\n });\n if (typeof response === 'symbol') {\n process.exit(0);\n }\n return response;\n}\n\nexport async function promptConfirm(\n message: string,\n initial = true,\n): Promise<boolean> {\n const response = await consola.prompt(message, {\n type: 'confirm',\n initial,\n cancel: 'symbol',\n });\n if (typeof response === 'symbol') {\n process.exit(0);\n }\n return response;\n}\n","import { consola } from 'consola';\nimport { isInteractive } from './interactive';\nimport { promptConfirm, promptText } from './prompt';\n\ninterface RequiredOption<T> {\n value: T | undefined;\n /** Describes the missing option, for example `a voucher ID via --id`. */\n requirement: string;\n /** Question asked when the option is missing in an interactive environment. */\n question: string;\n}\n\n/**\n * Returns the option value, asking for it when it is missing. Exits when the\n * value is missing in a non-interactive environment.\n */\nexport async function requireStringOption(\n options: RequiredOption<string>,\n): Promise<string> {\n const value = options.value?.trim();\n if (value) {\n return value;\n }\n requireInteractive(options.requirement);\n const answer = (await promptText(options.question)).trim();\n if (!answer) {\n consola.error('The value must not be empty.');\n process.exit(1);\n }\n return answer;\n}\n\n/**\n * Returns the option value, asking for it when it is missing. Exits when the\n * value is missing in a non-interactive environment or is not a number.\n */\nexport async function requireNumberOption(\n options: RequiredOption<number>,\n): Promise<number> {\n if (options.value !== undefined) {\n return options.value;\n }\n requireInteractive(options.requirement);\n const answer = (await promptText(options.question)).trim();\n const value = Number(answer);\n if (!answer || !Number.isFinite(value)) {\n consola.error('The value must be a number.');\n process.exit(1);\n }\n return value;\n}\n\n/**\n * Asks for confirmation unless `yes` is set. Returns `false` when the user\n * declines, in which case the command must stop. Exits when the confirmation\n * is missing in a non-interactive environment.\n */\nexport async function confirmOrAbort(options: {\n message: string;\n yes: boolean;\n /** Preselected answer. Defaults to the answer preselected by the prompt. */\n initial?: boolean;\n}): Promise<boolean> {\n if (options.yes) {\n return true;\n }\n if (!isInteractive()) {\n consola.error(\n 'You must pass --yes to confirm this action when running in a non-interactive environment.',\n );\n process.exit(1);\n }\n const confirmed =\n options.initial === undefined\n ? await promptConfirm(options.message)\n : await promptConfirm(options.message, options.initial);\n if (!confirmed) {\n consola.info('Aborted.');\n }\n return confirmed;\n}\n\nfunction requireInteractive(requirement: string): void {\n if (!isInteractive()) {\n consola.error(\n `You must provide ${requirement} when running in a non-interactive environment.`,\n );\n process.exit(1);\n }\n}\n","/**\n * A contact reference as returned by the API. The name fields are only present\n * when the reference was inflated with the `embed` query parameter.\n */\nexport interface ContactLike {\n id: string;\n name?: string | null;\n surename?: string | null;\n familyname?: string | null;\n}\n\n/** Formats a contact reference as its organization or person name. */\nexport function contactLabel(ref: ContactLike | null | undefined): string {\n if (!ref) {\n return '-';\n }\n const personName = [ref.surename, ref.familyname]\n .filter((part) => part)\n .join(' ');\n return ref.name || personName || ref.id || '-';\n}\n\nexport function printJson(value: unknown): void {\n console.log(JSON.stringify(value, null, 2));\n}\n\nexport function printTable(rows: Array<Record<string, string>>): void {\n const first = rows[0];\n if (!first) {\n return;\n }\n const columns = Object.keys(first);\n const widths = columns.map((column) =>\n Math.max(column.length, ...rows.map((row) => (row[column] ?? '').length)),\n );\n const line = (values: string[]): string =>\n values.map((value, index) => value.padEnd(widths[index] ?? 0)).join(' ');\n console.log(line(columns.map((column) => column.toUpperCase())));\n for (const row of rows) {\n console.log(line(columns.map((column) => row[column] ?? '')));\n }\n}\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show the balance of a check account at a given date.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The check account ID. If omitted, you will be prompted.'),\n date: z\n .string()\n .default(() => new Date().toISOString().slice(0, 10))\n .describe('The date to calculate the balance for (YYYY-MM-DD).'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const checkAccountId = await requireNumberOption({\n value: options.id,\n requirement: 'a check account ID via --id',\n question: 'Enter the check account ID:',\n });\n const balance = await client.checkAccounts.getBalanceAtDate({\n checkAccountId,\n date: options.date,\n });\n if (options.json) {\n printJson({ checkAccountId, date: options.date, balance });\n return;\n }\n consola.info(`Balance at ${options.date}: ${balance}`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Create a clearing check account.',\n options: defineOptions(\n z.object({\n name: z\n .string()\n .optional()\n .describe(\n 'The name of the check account. If omitted, you will be prompted.',\n ),\n accountingNumber: z.coerce\n .number()\n .optional()\n .describe('The booking account number of the check account.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const name = await requireStringOption({\n value: options.name,\n requirement: 'a name via --name',\n question: 'Enter the name of the check account:',\n });\n const checkAccount = await client.checkAccounts.createClearingAccount({\n name,\n accountingNumber: options.accountingNumber,\n });\n if (options.json) {\n printJson(checkAccount);\n return;\n }\n consola.success(`Created clearing account ${checkAccount.id}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description:\n 'Create a check account that imports its transactions from files.',\n options: defineOptions(\n z.object({\n name: z\n .string()\n .optional()\n .describe(\n 'The name of the check account. If omitted, you will be prompted.',\n ),\n importType: z\n .enum(['CSV', 'MT940'])\n .default('CSV')\n .describe(\n 'The file format used to import transactions. Supported values are CSV and MT940.',\n ),\n accountingNumber: z.coerce\n .number()\n .optional()\n .describe('The booking account number of the check account.'),\n iban: z.string().optional().describe('The IBAN of the check account.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const name = await requireStringOption({\n value: options.name,\n requirement: 'a name via --name',\n question: 'Enter the name of the check account:',\n });\n const checkAccount = await client.checkAccounts.createFileImportAccount({\n name,\n importType: options.importType,\n accountingNumber: options.accountingNumber,\n iban: options.iban,\n });\n if (options.json) {\n printJson(checkAccount);\n return;\n }\n consola.success(`Created file import account ${checkAccount.id}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single check account.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The check account ID. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const checkAccountId = await requireNumberOption({\n value: options.id,\n requirement: 'a check account ID via --id',\n question: 'Enter the check account ID:',\n });\n const checkAccount = await client.checkAccounts.get({ checkAccountId });\n if (options.json) {\n printJson(checkAccount);\n return;\n }\n consola.info(`ID: ${checkAccount.id}`);\n consola.info(`Name: ${checkAccount.name}`);\n consola.info(`Type: ${checkAccount.type}`);\n consola.info(`Import type: ${checkAccount.importType ?? '-'}`);\n consola.info(`IBAN: ${checkAccount.iban ?? '-'}`);\n consola.info(`Accounting number: ${checkAccount.accountingNumber ?? '-'}`);\n consola.info(`Currency: ${checkAccount.currency}`);\n consola.info(`Balance: ${checkAccount.balance ?? '-'}`);\n consola.info(`Status: ${checkAccount.status}`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List your check accounts.',\n options: defineOptions(\n z.object({\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of check accounts to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('The number of check accounts to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const checkAccounts = await client.checkAccounts.list({\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(checkAccounts);\n return;\n }\n if (checkAccounts.length === 0) {\n consola.info('No check accounts found.');\n return;\n }\n printTable(\n checkAccounts.map((checkAccount) => ({\n id: checkAccount.id,\n name: checkAccount.name,\n type: checkAccount.type,\n importType: checkAccount.importType ?? '',\n accountingNumber: checkAccount.accountingNumber ?? '',\n currency: checkAccount.currency,\n status: checkAccount.status,\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Create a contact.',\n options: defineOptions(\n z.object({\n name: z\n .string()\n .optional()\n .describe(\n 'Name of the organization. Not to be used for persons. If both --name and --familyname are omitted, you will be prompted for the organization name.',\n ),\n surename: z\n .string()\n .optional()\n .describe(\n 'First name of the person. Not to be used for organizations.',\n ),\n familyname: z\n .string()\n .optional()\n .describe('Last name of the person. Not to be used for organizations.'),\n category: z.coerce\n .number()\n .default(3)\n .describe(\n 'ID of the contact category: 2 supplier, 3 customer, 4 partner.',\n ),\n customerNumber: z\n .string()\n .optional()\n .describe('Customer number of the contact.'),\n description: z\n .string()\n .optional()\n .describe('Description of the contact.'),\n vatNumber: z.string().optional().describe('VAT number of the contact.'),\n taxNumber: z.string().optional().describe('Tax number of the contact.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const name =\n !options.name && !options.familyname\n ? await requireStringOption({\n value: undefined,\n requirement: 'a name via --name or --familyname',\n question: 'Enter the organization name:',\n })\n : options.name;\n const contact = await client.contacts.create({\n categoryId: options.category,\n name,\n surename: options.surename,\n familyname: options.familyname,\n customerNumber: options.customerNumber,\n description: options.description,\n vatNumber: options.vatNumber,\n taxNumber: options.taxNumber,\n });\n if (options.json) {\n printJson(contact);\n return;\n }\n consola.success(`Created contact ${contact.id}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Delete a contact.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const contactId = await requireNumberOption({\n value: options.id,\n requirement: 'a contact ID via --id',\n question: 'Enter the contact ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Delete contact ${contactId}?`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n await client.contacts.delete({ contactId });\n if (options.json) {\n printJson({ deleted: true });\n return;\n }\n consola.success('Contact deleted.');\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single contact.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const contactId = await requireNumberOption({\n value: options.id,\n requirement: 'a contact ID via --id',\n question: 'Enter the contact ID:',\n });\n const contact = await client.contacts.get({ contactId });\n if (options.json) {\n printJson(contact);\n return;\n }\n consola.info(`ID: ${contact.id}`);\n consola.info(`Name: ${contact.name ?? '-'}`);\n consola.info(`First name: ${contact.surename ?? '-'}`);\n consola.info(`Last name: ${contact.familyname ?? '-'}`);\n consola.info(`Customer number: ${contact.customerNumber ?? '-'}`);\n consola.info(`Category: ${contact.category.id}`);\n consola.info(`Status: ${contact.status ?? '-'}`);\n consola.info(`Description: ${contact.description ?? '-'}`);\n consola.info(`VAT number: ${contact.vatNumber ?? '-'}`);\n consola.info(`Tax number: ${contact.taxNumber ?? '-'}`);\n },\n});\n","import type { Contact } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List contacts.',\n options: defineOptions(\n z.object({\n name: z\n .string()\n .optional()\n .describe('Filter by organization, first or last name.'),\n customerNumber: z\n .string()\n .optional()\n .describe('Filter by customer number.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of contacts to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of contacts to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const contacts = await client.contacts.list({\n name: options.name,\n customerNumber: options.customerNumber,\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(contacts);\n return;\n }\n if (contacts.length === 0) {\n consola.info('No contacts found.');\n return;\n }\n printTable(\n contacts.map((contact) => ({\n id: contact.id,\n number: contact.customerNumber ?? '',\n name: formatContactName(contact),\n status: contact.status ?? '',\n category: contact.category.id,\n })),\n );\n },\n});\n\nfunction formatContactName(contact: Contact): string {\n return (\n contact.name ??\n [contact.surename, contact.familyname].filter(Boolean).join(' ')\n );\n}\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Update a contact.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n name: z\n .string()\n .optional()\n .describe('Name of the organization. Not to be used for persons.'),\n surename: z\n .string()\n .optional()\n .describe(\n 'First name of the person. Not to be used for organizations.',\n ),\n familyname: z\n .string()\n .optional()\n .describe('Last name of the person. Not to be used for organizations.'),\n category: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the contact category: 2 supplier, 3 customer, 4 partner.',\n ),\n customerNumber: z\n .string()\n .optional()\n .describe('Customer number of the contact.'),\n description: z\n .string()\n .optional()\n .describe('Description of the contact.'),\n vatNumber: z.string().optional().describe('VAT number of the contact.'),\n taxNumber: z.string().optional().describe('Tax number of the contact.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const contactId = await requireNumberOption({\n value: options.id,\n requirement: 'a contact ID via --id',\n question: 'Enter the contact ID:',\n });\n const contact = await client.contacts.update({\n contactId,\n categoryId: options.category,\n name: options.name,\n surename: options.surename,\n familyname: options.familyname,\n customerNumber: options.customerNumber,\n description: options.description,\n vatNumber: options.vatNumber,\n taxNumber: options.taxNumber,\n });\n if (options.json) {\n printJson(contact);\n return;\n }\n consola.success(`Updated contact ${contact.id}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { contactLabel, printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single credit note.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the credit note. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const creditNoteId = await requireNumberOption({\n value: options.id,\n requirement: 'a credit note ID via --id',\n question: 'Enter the credit note ID:',\n });\n const creditNote = await client.creditNotes.get({\n creditNoteId,\n embed: ['contact'],\n });\n if (options.json) {\n printJson(creditNote);\n return;\n }\n consola.info(`ID: ${creditNote.id}`);\n consola.info(`Number: ${creditNote.creditNoteNumber ?? '-'}`);\n consola.info(`Date: ${creditNote.creditNoteDate}`);\n consola.info(`Status: ${creditNote.status}`);\n consola.info(`Contact: ${contactLabel(creditNote.contact)}`);\n consola.info(`Net: ${creditNote.sumNet}`);\n consola.info(`Tax: ${creditNote.sumTax}`);\n consola.info(`Gross: ${creditNote.sumGross}`);\n consola.info(`Currency: ${creditNote.currency ?? '-'}`);\n },\n});\n","import type { CreditNoteStatus } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { contactLabel, printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List credit notes.',\n options: defineOptions(\n z.object({\n status: z.coerce\n .number()\n .optional()\n .describe(\n 'Filter by status: 100 draft, 200 open, 750 partially paid, 1000 paid.',\n ),\n creditNoteNumber: z\n .string()\n .optional()\n .describe('Filter by credit note number.'),\n startDate: z\n .string()\n .optional()\n .describe(\n 'Only credit notes on or after this date as dd.mm.yyyy or Unix timestamp.',\n ),\n endDate: z\n .string()\n .optional()\n .describe(\n 'Only credit notes on or before this date as dd.mm.yyyy or Unix timestamp.',\n ),\n contact: z.coerce\n .number()\n .optional()\n .describe('ID of the contact whose credit notes to list.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of credit notes to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of credit notes to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const creditNotes = await client.creditNotes.list({\n status: options.status as CreditNoteStatus | undefined,\n creditNoteNumber: options.creditNoteNumber,\n startDate: options.startDate,\n endDate: options.endDate,\n contactId: options.contact,\n limit: options.limit,\n offset: options.offset,\n embed: ['contact'],\n });\n if (options.json) {\n printJson(creditNotes);\n return;\n }\n if (creditNotes.length === 0) {\n consola.info('No credit notes found.');\n return;\n }\n printTable(\n creditNotes.map((creditNote) => ({\n id: creditNote.id,\n number: creditNote.creditNoteNumber ?? '',\n date: creditNote.creditNoteDate,\n contact: contactLabel(creditNote.contact),\n gross: creditNote.sumGross,\n status: creditNote.status,\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Download the PDF of a credit note.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the credit note. If omitted, you will be prompted.'),\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the PDF to. Defaults to the file name reported by the API.',\n ),\n preventSendBy: z\n .boolean()\n .default(false)\n .describe('Do not mark the credit note as sent by download.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const creditNoteId = await requireNumberOption({\n value: options.id,\n requirement: 'a credit note ID via --id',\n question: 'Enter the credit note ID:',\n });\n const pdf = await client.creditNotes.getPdf({\n creditNoteId,\n preventSendBy: options.preventSendBy,\n });\n const path = resolve(options.output ?? pdf.filename);\n await writeFile(path, Buffer.from(pdf.content, 'base64'));\n if (options.json) {\n printJson({ filename: pdf.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { SevDeskError } from '@genz-its/sevdesk-sdk';\nimport { ZliError } from '@robingenz/zli';\nimport { z } from 'zod';\n\nexport function formatError(error: unknown): string {\n if (error instanceof ZliError) {\n return error.message;\n }\n if (error instanceof z.ZodError) {\n return error.issues\n .map((issue) => `${issue.path.join('.') || 'input'}: ${issue.message}`)\n .join('\\n');\n }\n if (error instanceof SevDeskError) {\n if (error.status === 401) {\n return 'Authentication failed. Check your API token or run `sevdesk login` again.';\n }\n return error.message;\n }\n return error instanceof Error ? error.message : String(error);\n}\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { createClient } from '../client';\nimport { resolveToken } from '../config';\nimport { formatError } from '../errors';\nimport { printJson } from '../output';\nimport { pkg } from '../package';\n\nexport default defineCommand({\n description: 'Check the CLI setup and the connection to the sevdesk API.',\n options: defineOptions(\n z.object({\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const { token, source } = await resolveToken();\n let bookkeepingSystemVersion: string | undefined;\n let apiError: string | undefined;\n if (token) {\n try {\n bookkeepingSystemVersion =\n await createClient(token).basics.getBookkeepingSystemVersion();\n } catch (error) {\n apiError = formatError(error);\n }\n }\n if (options.json) {\n printJson({\n cliVersion: pkg.version,\n nodeVersion: process.version,\n tokenSource: source,\n bookkeepingSystemVersion: bookkeepingSystemVersion ?? null,\n apiError: apiError ?? null,\n });\n } else {\n consola.info(`CLI version: ${pkg.version}`);\n consola.info(`Node.js version: ${process.version}`);\n consola.info(`Token source: ${source}`);\n if (!token) {\n consola.warn(\n 'No API token found. Run `sevdesk login` or set the SEVDESK_TOKEN environment variable.',\n );\n } else if (apiError) {\n consola.error(`API connection failed: ${apiError}`);\n } else {\n consola.success(\n `API connection succeeded. Bookkeeping system version: ${bookkeepingSystemVersion}`,\n );\n }\n }\n if (bookkeepingSystemVersion === '1.0') {\n consola.warn(\n 'This sevdesk account still uses bookkeeping system version 1.0, which is not supported.',\n );\n process.exitCode = 1;\n } else if (!token || apiError) {\n process.exitCode = 1;\n }\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Export contacts as a CSV file.',\n options: defineOptions(\n z.object({\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the CSV file to. Defaults to the filename of the export.',\n ),\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of contacts to export.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const file = await client.exports.exportContactsCsv({\n limit: options.limit,\n });\n const path = options.output ?? file.filename;\n await writeFile(\n path,\n file.base64Encoded ? Buffer.from(file.content, 'base64') : file.content,\n );\n if (options.json) {\n printJson({ filename: file.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import type { ExportJobDownloadInfo, SevDesk } from '@genz-its/sevdesk-sdk';\nimport { SevDeskError } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nconst POLL_INTERVAL = 3_000;\n\nexport default defineCommand({\n description: 'Export accounting data in the DATEV format as a ZIP archive.',\n options: defineOptions(\n z.object({\n startDate: z\n .string()\n .optional()\n .describe(\n 'Start of the export period as dd.mm.yyyy or Unix timestamp. If omitted, you will be prompted.',\n ),\n endDate: z\n .string()\n .optional()\n .describe(\n 'End of the export period as dd.mm.yyyy or Unix timestamp. If omitted, you will be prompted.',\n ),\n format: z\n .enum(['csv', 'xml'])\n .default('csv')\n .describe('The DATEV export format. Supported values are csv and xml.'),\n scope: z\n .string()\n .default('EXTCD')\n .describe(\n 'The models to include as a string of letters: E (earnings), X (expenditure), T (transactions), C (cash register) and D (assets). XML exports support only E and X.',\n ),\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the ZIP archive to. Defaults to the filename of the export.',\n ),\n timeout: z.coerce\n .number()\n .default(300)\n .describe('Maximum number of seconds to wait for the export job.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const startDate = await requireStringOption({\n value: options.startDate,\n requirement: 'a start date via --start-date',\n question: 'Enter the start date (dd.mm.yyyy):',\n });\n const endDate = await requireStringOption({\n value: options.endDate,\n requirement: 'an end date via --end-date',\n question: 'Enter the end date (dd.mm.yyyy):',\n });\n const jobOptions = { startDate, endDate, scope: options.scope };\n const jobId =\n options.format === 'csv'\n ? await client.exports.createDatevCsvZipExportJob(jobOptions)\n : await client.exports.createDatevXmlZipExportJob(jobOptions);\n if (!options.json) {\n consola.start('Waiting for the export job to finish...');\n }\n const info = await waitForDownloadInfo(client, jobId, options.timeout);\n if (!info) {\n consola.error(\n `The export job did not finish within ${options.timeout} seconds.`,\n );\n process.exit(1);\n }\n const response = await fetch(info.link);\n if (!response.ok) {\n consola.error(\n `The export file could not be downloaded (status ${response.status}).`,\n );\n process.exit(1);\n }\n const path = options.output ?? info.filename;\n await writeFile(path, new Uint8Array(await response.arrayBuffer()));\n if (options.json) {\n printJson({ jobId, filename: info.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n\nasync function waitForDownloadInfo(\n client: SevDesk,\n jobId: string,\n timeoutSeconds: number,\n): Promise<ExportJobDownloadInfo | undefined> {\n const deadline = Date.now() + timeoutSeconds * 1000;\n while (Date.now() < deadline) {\n const info = await getDownloadInfo(client, jobId);\n if (info) {\n return info;\n }\n await delay(POLL_INTERVAL);\n }\n return undefined;\n}\n\nasync function getDownloadInfo(\n client: SevDesk,\n jobId: string,\n): Promise<ExportJobDownloadInfo | undefined> {\n try {\n const [info] = await client.exports.getJobDownloadInfo({ jobId });\n return info?.link ? info : undefined;\n } catch (error) {\n if (error instanceof SevDeskError) {\n return undefined;\n }\n throw error;\n }\n}\n\nfunction delay(milliseconds: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, milliseconds));\n}\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Export invoices as a CSV file.',\n options: defineOptions(\n z.object({\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the CSV file to. Defaults to the filename of the export.',\n ),\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of invoices to export.'),\n startDate: z\n .string()\n .optional()\n .describe('Only export invoices on or after this date (ISO 8601).'),\n endDate: z\n .string()\n .optional()\n .describe('Only export invoices on or before this date (ISO 8601).'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const file = await client.exports.exportInvoicesCsv({\n limit: options.limit,\n filter: { startDate: options.startDate, endDate: options.endDate },\n });\n const path = options.output ?? file.filename;\n await writeFile(\n path,\n file.base64Encoded ? Buffer.from(file.content, 'base64') : file.content,\n );\n if (options.json) {\n printJson({ filename: file.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Export transactions as a CSV file.',\n options: defineOptions(\n z.object({\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the CSV file to. Defaults to the filename of the export.',\n ),\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of transactions to export.'),\n startDate: z\n .string()\n .optional()\n .describe('Only export transactions on or after this date (ISO 8601).'),\n endDate: z\n .string()\n .optional()\n .describe(\n 'Only export transactions on or before this date (ISO 8601).',\n ),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const file = await client.exports.exportTransactionsCsv({\n limit: options.limit,\n filter: { startDate: options.startDate, endDate: options.endDate },\n });\n const path = options.output ?? file.filename;\n await writeFile(\n path,\n file.base64Encoded ? Buffer.from(file.content, 'base64') : file.content,\n );\n if (options.json) {\n printJson({ filename: file.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Export vouchers as a CSV file.',\n options: defineOptions(\n z.object({\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the CSV file to. Defaults to the filename of the export.',\n ),\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of vouchers to export.'),\n startDate: z\n .string()\n .optional()\n .describe('Only export vouchers on or after this date (ISO 8601).'),\n endDate: z\n .string()\n .optional()\n .describe('Only export vouchers on or before this date (ISO 8601).'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const file = await client.exports.exportVouchersCsv({\n limit: options.limit,\n filter: { startDate: options.startDate, endDate: options.endDate },\n });\n const path = options.output ?? file.filename;\n await writeFile(\n path,\n file.base64Encoded ? Buffer.from(file.content, 'base64') : file.content,\n );\n if (options.json) {\n printJson({ filename: file.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import type { AllowedTaxRule, ReceiptGuide } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nconst MAX_TAX_RULES = 3;\n\nfunction formatTaxRules(taxRules: AllowedTaxRule[]): string {\n const names = taxRules.map((taxRule) => taxRule.name);\n if (names.length > MAX_TAX_RULES) {\n return `${names.slice(0, MAX_TAX_RULES).join(', ')}, …`;\n }\n return names.join(', ');\n}\n\nexport default defineCommand({\n description:\n 'List bookable accounts and their allowed tax rules. The first matching filter wins: --account-number, --tax-rule, --revenue, --expense. Without a filter, all accounts are listed.',\n options: defineOptions(\n z.object({\n accountNumber: z\n .string()\n .optional()\n .describe('Only show the account with this datev account number.'),\n taxRule: z\n .string()\n .optional()\n .describe('Tax rule name, for example USTPFL_UMS_EINN.'),\n revenue: z\n .boolean()\n .default(false)\n .describe('Only show accounts that can be used for revenue.'),\n expense: z\n .boolean()\n .default(false)\n .describe('Only show accounts that can be used for expenses.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n let guides: ReceiptGuide[];\n if (options.accountNumber) {\n guides = await client.receiptGuidance.forAccountNumber({\n accountNumber: options.accountNumber,\n });\n } else if (options.taxRule) {\n guides = await client.receiptGuidance.forTaxRule({\n taxRule: options.taxRule,\n });\n } else if (options.revenue) {\n guides = await client.receiptGuidance.forRevenue();\n } else if (options.expense) {\n guides = await client.receiptGuidance.forExpense();\n } else {\n guides = await client.receiptGuidance.forAllAccounts();\n }\n if (options.json) {\n printJson(guides);\n return;\n }\n if (guides.length === 0) {\n consola.info('No accounts found.');\n return;\n }\n printTable(\n guides.map((guide) => ({\n id: String(guide.accountDatevId),\n number: guide.accountNumber,\n name: guide.accountName,\n taxRules: formatTaxRules(guide.allowedTaxRules),\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { contactLabel, printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single invoice.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the invoice. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const invoiceId = await requireNumberOption({\n value: options.id,\n requirement: 'an invoice ID via --id',\n question: 'Enter the invoice ID:',\n });\n const invoice = await client.invoices.get({\n invoiceId,\n embed: ['contact'],\n });\n if (options.json) {\n printJson(invoice);\n return;\n }\n consola.info(`ID: ${invoice.id}`);\n consola.info(`Number: ${invoice.invoiceNumber ?? '-'}`);\n consola.info(`Date: ${invoice.invoiceDate}`);\n consola.info(`Status: ${invoice.status}`);\n consola.info(`Contact: ${contactLabel(invoice.contact)}`);\n consola.info(`Net: ${invoice.sumNet}`);\n consola.info(`Tax: ${invoice.sumTax}`);\n consola.info(`Gross: ${invoice.sumGross}`);\n consola.info(`Currency: ${invoice.currency}`);\n },\n});\n","import type { InvoiceStatus } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { contactLabel, printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List invoices.',\n options: defineOptions(\n z.object({\n status: z.coerce\n .number()\n .optional()\n .describe(\n 'Filter by status: 50 deactivated recurring, 100 draft, 200 open, 750 partially paid, 1000 paid.',\n ),\n invoiceNumber: z\n .string()\n .optional()\n .describe('Filter by invoice number.'),\n startDate: z\n .string()\n .optional()\n .describe(\n 'Only invoices on or after this date as dd.mm.yyyy or Unix timestamp.',\n ),\n endDate: z\n .string()\n .optional()\n .describe(\n 'Only invoices on or before this date as dd.mm.yyyy or Unix timestamp.',\n ),\n contact: z.coerce\n .number()\n .optional()\n .describe('ID of the contact whose invoices to list.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of invoices to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of invoices to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const invoices = await client.invoices.list({\n status: options.status as InvoiceStatus | undefined,\n invoiceNumber: options.invoiceNumber,\n startDate: options.startDate,\n endDate: options.endDate,\n contactId: options.contact,\n limit: options.limit,\n offset: options.offset,\n embed: ['contact'],\n });\n if (options.json) {\n printJson(invoices);\n return;\n }\n if (invoices.length === 0) {\n consola.info('No invoices found.');\n return;\n }\n printTable(\n invoices.map((invoice) => ({\n id: invoice.id,\n number: invoice.invoiceNumber ?? '',\n date: invoice.invoiceDate,\n contact: contactLabel(invoice.contact),\n gross: invoice.sumGross,\n status: invoice.status,\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Download the PDF of an invoice.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the invoice. If omitted, you will be prompted.'),\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the PDF to. Defaults to the file name reported by the API.',\n ),\n preventSendBy: z\n .boolean()\n .default(false)\n .describe('Do not mark the invoice as sent by download.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const invoiceId = await requireNumberOption({\n value: options.id,\n requirement: 'an invoice ID via --id',\n question: 'Enter the invoice ID:',\n });\n const pdf = await client.invoices.getPdf({\n invoiceId,\n preventSendBy: options.preventSendBy,\n });\n const path = resolve(options.output ?? pdf.filename);\n await writeFile(path, Buffer.from(pdf.content, 'base64'));\n if (options.json) {\n printJson({ filename: pdf.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { createClient } from '../client';\nimport { configPath, readConfig, writeConfig } from '../config';\nimport { isInteractive } from '../interactive';\nimport { promptText } from '../prompt';\n\nexport default defineCommand({\n description: 'Log in with your sevdesk API token.',\n options: defineOptions(\n z.object({\n token: z\n .string()\n .optional()\n .describe('The sevdesk API token. If omitted, you will be prompted.'),\n }),\n ),\n action: async (options) => {\n let token = options.token?.trim();\n if (!token) {\n if (!isInteractive()) {\n consola.error(\n 'You must provide a token via --token when running in a non-interactive environment.',\n );\n process.exit(1);\n }\n consola.info(\n 'You can find your API token in sevdesk under Settings > User > API token.',\n );\n token = (await promptText('Enter your sevdesk API token:')).trim();\n }\n const client = createClient(token);\n const version = await client.basics.getBookkeepingSystemVersion();\n if (version === '1.0') {\n consola.error(\n 'This sevdesk account still uses bookkeeping system version 1.0, which is not supported. Please update your account to sevdesk-Update 2.0.',\n );\n process.exit(1);\n }\n await writeConfig({ ...(await readConfig()), token });\n consola.success(`Logged in. Token stored in ${configPath()}.`);\n },\n});\n","import { defineCommand } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { readConfig, writeConfig } from '../config';\n\nexport default defineCommand({\n description: 'Log out by removing the stored API token.',\n action: async () => {\n const { token, ...config } = await readConfig();\n if (!token) {\n consola.info('You are not logged in.');\n } else {\n await writeConfig(config);\n consola.success('Logged out.');\n }\n if (process.env['SEVDESK_TOKEN']) {\n consola.warn(\n 'The SEVDESK_TOKEN environment variable is still set and will be used for authentication.',\n );\n }\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { contactLabel, printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single order.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the order. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const orderId = await requireNumberOption({\n value: options.id,\n requirement: 'an order ID via --id',\n question: 'Enter the order ID:',\n });\n const order = await client.orders.get({ orderId, embed: ['contact'] });\n if (options.json) {\n printJson(order);\n return;\n }\n consola.info(`ID: ${order.id}`);\n consola.info(`Number: ${order.orderNumber}`);\n consola.info(`Date: ${order.orderDate}`);\n consola.info(`Status: ${order.status}`);\n consola.info(`Contact: ${contactLabel(order.contact)}`);\n consola.info(`Net: ${order.sumNet}`);\n consola.info(`Tax: ${order.sumTax}`);\n consola.info(`Gross: ${order.sumGross}`);\n consola.info(`Currency: ${order.currency}`);\n },\n});\n","import type { OrderStatus } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { contactLabel, printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List orders.',\n options: defineOptions(\n z.object({\n status: z.coerce\n .number()\n .optional()\n .describe(\n 'Filter by status: 100 draft, 200 delivered, 300 rejected, 500 accepted, 750 partially calculated, 1000 calculated.',\n ),\n orderNumber: z.string().optional().describe('Filter by order number.'),\n startDate: z\n .string()\n .optional()\n .describe(\n 'Only orders on or after this date as dd.mm.yyyy or Unix timestamp.',\n ),\n endDate: z\n .string()\n .optional()\n .describe(\n 'Only orders on or before this date as dd.mm.yyyy or Unix timestamp.',\n ),\n contact: z.coerce\n .number()\n .optional()\n .describe('ID of the contact whose orders to list.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of orders to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of orders to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const orders = await client.orders.list({\n status: options.status as OrderStatus | undefined,\n orderNumber: options.orderNumber,\n startDate: options.startDate,\n endDate: options.endDate,\n contactId: options.contact,\n limit: options.limit,\n offset: options.offset,\n embed: ['contact'],\n });\n if (options.json) {\n printJson(orders);\n return;\n }\n if (orders.length === 0) {\n consola.info('No orders found.');\n return;\n }\n printTable(\n orders.map((order) => ({\n id: order.id,\n number: order.orderNumber,\n date: order.orderDate,\n contact: contactLabel(order.contact),\n gross: order.sumGross,\n status: order.status,\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Download the PDF of an order.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the order. If omitted, you will be prompted.'),\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the PDF to. Defaults to the file name reported by the API.',\n ),\n preventSendBy: z\n .boolean()\n .default(false)\n .describe('Do not mark the order as sent by download.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const orderId = await requireNumberOption({\n value: options.id,\n requirement: 'an order ID via --id',\n question: 'Enter the order ID:',\n });\n const pdf = await client.orders.getPdf({\n orderId,\n preventSendBy: options.preventSendBy,\n });\n const path = resolve(options.output ?? pdf.filename);\n await writeFile(path, Buffer.from(pdf.content, 'base64'));\n if (options.json) {\n printJson({ filename: pdf.filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single part.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The part ID. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const partId = await requireNumberOption({\n value: options.id,\n requirement: 'a part ID via --id',\n question: 'Enter the part ID:',\n });\n const part = await client.parts.get({ partId });\n if (options.json) {\n printJson(part);\n return;\n }\n consola.info(`ID: ${part.id}`);\n consola.info(`Part number: ${part.partNumber}`);\n consola.info(`Name: ${part.name}`);\n consola.info(`Text: ${part.text ?? '-'}`);\n consola.info(`Price: ${part.price ?? '-'}`);\n consola.info(`Price net: ${part.priceNet ?? '-'}`);\n consola.info(`Price gross: ${part.priceGross ?? '-'}`);\n consola.info(`Tax rate: ${part.taxRate}`);\n consola.info(`Stock: ${part.stock}`);\n consola.info(`Status: ${part.status ?? '-'}`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List parts.',\n options: defineOptions(\n z.object({\n name: z.string().optional().describe('Filter by part name.'),\n partNumber: z.string().optional().describe('Filter by part number.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of parts to return.'),\n offset: z.coerce.number().optional().describe('Number of parts to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const parts = await client.parts.list({\n name: options.name,\n partNumber: options.partNumber,\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(parts);\n return;\n }\n if (parts.length === 0) {\n consola.info('No parts found.');\n return;\n }\n printTable(\n parts.map((part) => ({\n id: part.id,\n partNumber: part.partNumber,\n name: part.name,\n price: part.price ?? '',\n taxRate: part.taxRate,\n status: part.status ?? '',\n stock: part.stock,\n })),\n );\n },\n});\n","import type { TagObjectType } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption, requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nconst OBJECT_TYPES = ['Invoice', 'Voucher', 'Order', 'CreditNote'] as const;\n\nexport default defineCommand({\n description: 'Create a tag and attach it to a document.',\n options: defineOptions(\n z.object({\n name: z\n .string()\n .optional()\n .describe('Name of the tag. If omitted, you will be prompted.'),\n objectType: z\n .string()\n .optional()\n .describe(\n 'Type of the document to tag: Invoice, Voucher, Order or CreditNote. If omitted, you will be prompted.',\n ),\n objectId: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the document to tag. If omitted, you will be prompted.',\n ),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const name = await requireStringOption({\n value: options.name,\n requirement: 'a tag name via --name',\n question: 'Enter the tag name:',\n });\n const objectType = await requireStringOption({\n value: options.objectType,\n requirement: 'a document type via --object-type',\n question: `Enter the document type (${OBJECT_TYPES.join(', ')}):`,\n });\n if (!isTagObjectType(objectType)) {\n consola.error(\n `The document type must be one of: ${OBJECT_TYPES.join(', ')}.`,\n );\n process.exit(1);\n }\n const objectId = await requireNumberOption({\n value: options.objectId,\n requirement: 'a document ID via --object-id',\n question: 'Enter the document ID:',\n });\n const relation = await client.tags.create({\n name,\n objectId,\n objectName: objectType,\n });\n if (options.json) {\n printJson(relation);\n return;\n }\n consola.success(`Created tag ${relation.tag.id}.`);\n },\n});\n\nfunction isTagObjectType(value: string): value is TagObjectType {\n return OBJECT_TYPES.some((objectType) => objectType === value);\n}\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Delete a tag.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The tag ID. If omitted, you will be prompted.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const tagId = await requireNumberOption({\n value: options.id,\n requirement: 'a tag ID via --id',\n question: 'Enter the tag ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Delete tag ${tagId}?`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n await client.tags.delete({ tagId });\n if (options.json) {\n printJson({ deleted: true });\n return;\n }\n consola.success('Tag deleted.');\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List tags.',\n options: defineOptions(\n z.object({\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of tags to return.'),\n offset: z.coerce.number().optional().describe('Number of tags to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const tags = await client.tags.list({\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(tags);\n return;\n }\n if (tags.length === 0) {\n consola.info('No tags found.');\n return;\n }\n printTable(tags.map((tag) => ({ id: tag.id, name: tag.name })));\n },\n});\n","import type { TransactionStatus } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption, requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\n/**\n * Creates a transaction manually. This should only be used on check accounts\n * of type online, preferably on accounts that import their transactions from\n * files, because transactions of connected bank accounts are synchronized by\n * sevdesk itself.\n */\nexport default defineCommand({\n description:\n 'Create a transaction. Only use this on file import (online) check accounts.',\n options: defineOptions(\n z.object({\n checkAccount: z.coerce\n .number()\n .optional()\n .describe(\n 'The ID of the check account the transaction belongs to. If omitted, you will be prompted.',\n ),\n amount: z.coerce\n .number()\n .optional()\n .describe(\n 'The amount of the transaction. Negative for expenses. If omitted, you will be prompted.',\n ),\n payee: z\n .string()\n .optional()\n .describe(\n 'The name of the payee or payer. If omitted, you will be prompted.',\n ),\n valueDate: z\n .string()\n .default(() => new Date().toISOString())\n .describe('The date the transaction was booked (ISO 8601).'),\n entryDate: z\n .string()\n .optional()\n .describe('The date the transaction was imported (ISO 8601).'),\n purpose: z\n .string()\n .optional()\n .describe('The payment purpose of the transaction.'),\n status: z.coerce\n .number()\n .default(100)\n .describe('100 created, 200 linked, 300 private, 400 booked.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const checkAccountId = await requireNumberOption({\n value: options.checkAccount,\n requirement: 'a check account ID via --check-account',\n question: 'Enter the check account ID:',\n });\n const amount = await requireNumberOption({\n value: options.amount,\n requirement: 'an amount via --amount',\n question: 'Enter the amount:',\n });\n const payee = await requireStringOption({\n value: options.payee,\n requirement: 'a payee via --payee',\n question: 'Enter the payee or payer name:',\n });\n const transaction = await client.transactions.create({\n checkAccountId,\n amount,\n payeePayerName: payee,\n valueDate: options.valueDate,\n entryDate: options.entryDate,\n paymtPurpose: options.purpose,\n status: options.status as TransactionStatus,\n });\n if (options.json) {\n printJson(transaction);\n return;\n }\n consola.success(`Created transaction ${transaction.id}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single transaction.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The transaction ID. If omitted, you will be prompted.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const transactionId = await requireNumberOption({\n value: options.id,\n requirement: 'a transaction ID via --id',\n question: 'Enter the transaction ID:',\n });\n const transaction = await client.transactions.get({ transactionId });\n if (options.json) {\n printJson(transaction);\n return;\n }\n consola.info(`ID: ${transaction.id}`);\n consola.info(`Value date: ${transaction.valueDate}`);\n consola.info(`Amount: ${transaction.amount}`);\n consola.info(`Payee: ${transaction.payeePayerName ?? '-'}`);\n consola.info(`Purpose: ${transaction.paymtPurpose ?? '-'}`);\n consola.info(`Status: ${transaction.status}`);\n consola.info(`Check account: ${transaction.checkAccount.id}`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List transactions of your check accounts.',\n options: defineOptions(\n z.object({\n checkAccount: z.coerce\n .number()\n .optional()\n .describe('Only show transactions of this check account ID.'),\n unbooked: z\n .boolean()\n .default(false)\n .describe('Only show transactions that are not yet booked.'),\n startDate: z\n .string()\n .optional()\n .describe('Only show transactions on or after this date (ISO 8601).'),\n endDate: z\n .string()\n .optional()\n .describe('Only show transactions on or before this date (ISO 8601).'),\n payee: z\n .string()\n .optional()\n .describe('Only show transactions with this payee or payer name.'),\n purpose: z\n .string()\n .optional()\n .describe('Only show transactions with this payment purpose.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('The maximum number of transactions to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('The number of transactions to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const transactions = await client.transactions.list({\n checkAccountId: options.checkAccount,\n isBooked: options.unbooked ? false : undefined,\n startDate: options.startDate,\n endDate: options.endDate,\n payeePayerName: options.payee,\n paymtPurpose: options.purpose,\n limit: options.limit,\n offset: options.offset,\n });\n if (options.json) {\n printJson(transactions);\n return;\n }\n if (transactions.length === 0) {\n consola.info('No transactions found.');\n return;\n }\n printTable(\n transactions.map((transaction) => ({\n id: transaction.id,\n valueDate: transaction.valueDate,\n payee: transaction.payeePayerName ?? '',\n purpose: transaction.paymtPurpose ?? '',\n amount: transaction.amount,\n status: transaction.status,\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Book a payment on a voucher.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n amount: z.coerce\n .number()\n .optional()\n .describe('Amount to book. Can also be a partial amount.'),\n date: z\n .string()\n .default(() => new Date().toISOString())\n .describe('Booking date as ISO 8601. Defaults to now.'),\n type: z\n .enum(['FULL_PAYMENT', 'N', 'CB', 'O', 'OF', 'MTC'])\n .default('FULL_PAYMENT')\n .describe(\n 'Type of the booking. Supported values are FULL_PAYMENT, N (partial), CB (cash discount), O (other), OF (reminder charges) and MTC (monetary traffic costs).',\n ),\n checkAccount: z.coerce\n .number()\n .optional()\n .describe('ID of the check account.'),\n transaction: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the bank transaction to link. Required for online check accounts, omit for clearing accounts.',\n ),\n createFeed: z\n .boolean()\n .optional()\n .describe('Create a feed entry for the booking.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher via --id',\n question: 'Enter the voucher ID:',\n });\n const amount = await requireNumberOption({\n value: options.amount,\n requirement: 'an amount via --amount',\n question: 'Enter the amount to book:',\n });\n const checkAccountId = await requireNumberOption({\n value: options.checkAccount,\n requirement: 'a check account via --check-account',\n question: 'Enter the check account ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Book ${amount} on voucher ${voucherId}?`,\n yes: options.yes,\n });\n if (!confirmed) {\n return;\n }\n const result = await client.vouchers.book({\n voucherId,\n amount,\n date: options.date,\n type: options.type,\n checkAccountId,\n checkAccountTransactionId: options.transaction,\n createFeed: options.createFeed,\n });\n if (options.json) {\n printJson(result);\n return;\n }\n consola.success(\n `Booked ${amount} on voucher ${voucherId}. Status changed from ${result.fromStatus} to ${result.toStatus}.`,\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { readFile } from 'node:fs/promises';\nimport { basename } from 'node:path';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption, requireStringOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Create a voucher from a receipt file.',\n options: defineOptions(\n z.object({\n file: z\n .string()\n .optional()\n .describe(\n 'Path to the receipt file to attach, for example a PDF, an image or an XML invoice.',\n ),\n status: z\n .enum(['draft', 'open'])\n .default('open')\n .describe(\n 'Status of the created voucher. Supported values are draft and open.',\n ),\n creditDebit: z\n .enum(['C', 'D'])\n .default('C')\n .describe('C for expense (credit), D for income (debit) vouchers.'),\n taxRule: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the tax rule, for example 9 for deductible input tax expenses.',\n ),\n accountDatev: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the booking account (AccountDatev). Find it with guidance:accounts.',\n ),\n amount: z.coerce\n .number()\n .optional()\n .describe('Amount of the voucher position.'),\n net: z\n .boolean()\n .default(false)\n .describe('Treat the amount as net instead of gross.'),\n taxRate: z.coerce\n .number()\n .default(19)\n .describe('Tax rate of the voucher position in percent.'),\n voucherDate: z\n .string()\n .optional()\n .describe('Date as dd.mm.yyyy or Unix timestamp.'),\n payDate: z\n .string()\n .optional()\n .describe('Date as dd.mm.yyyy or Unix timestamp.'),\n supplierId: z.coerce\n .number()\n .optional()\n .describe('ID of the supplier contact.'),\n supplierName: z\n .string()\n .optional()\n .describe('Name of the supplier, used when no supplier ID is given.'),\n description: z.string().optional().describe('The voucher number.'),\n comment: z\n .string()\n .optional()\n .describe('Comment for the voucher position.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const path = await requireStringOption({\n value: options.file,\n requirement: 'a file via --file',\n question: 'Enter the path to the receipt file:',\n });\n const taxRuleId = await requireNumberOption({\n value: options.taxRule,\n requirement: 'a tax rule via --tax-rule',\n question: 'Enter the tax rule ID:',\n });\n const accountDatevId = await requireNumberOption({\n value: options.accountDatev,\n requirement: 'a booking account via --account-datev',\n question: 'Enter the booking account ID:',\n });\n const amount = await requireNumberOption({\n value: options.amount,\n requirement: 'an amount via --amount',\n question: 'Enter the amount:',\n });\n const supplierName =\n options.supplierId === undefined && !options.supplierName\n ? await requireStringOption({\n value: undefined,\n requirement: 'a supplier via --supplier-id or --supplier-name',\n question: 'Enter the supplier name:',\n })\n : options.supplierName;\n const file = await readFile(path).catch(() => {\n consola.error(\n `The file \"${path}\" could not be read. Check that the path is correct.`,\n );\n process.exit(1);\n });\n const result = await client.vouchers.createFromFile({\n file,\n filename: basename(path),\n voucher: {\n status: options.status === 'draft' ? 50 : 100,\n creditDebit: options.creditDebit,\n taxRuleId,\n voucherDate: options.voucherDate,\n payDate: options.payDate,\n supplierId: options.supplierId,\n supplierName,\n description: options.description,\n },\n positions: [\n {\n accountDatevId,\n taxRate: options.taxRate,\n net: options.net,\n ...(options.net ? { sumNet: amount } : { sumGross: amount }),\n comment: options.comment,\n },\n ],\n });\n if (options.json) {\n printJson(result);\n return;\n }\n consola.success(\n `Created voucher ${result.voucher.id} with status ${result.voucher.status}.`,\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Enshrine a voucher so that it can no longer be changed.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher ID via --id',\n question: 'Enter the voucher ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Enshrine voucher ${voucherId}? This cannot be undone.`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n await client.vouchers.enshrine({ voucherId });\n if (options.json) {\n printJson({ enshrined: true });\n return;\n }\n consola.success(`Enshrined voucher ${voucherId}.`);\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { contactLabel, printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Show a single voucher.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher ID via --id',\n question: 'Enter the voucher ID:',\n });\n const voucher = await client.vouchers.get({\n voucherId,\n embed: ['supplier'],\n });\n if (options.json) {\n printJson(voucher);\n return;\n }\n consola.info(`ID: ${voucher.id}`);\n consola.info(`Status: ${voucher.status ?? '-'}`);\n consola.info(`Date: ${voucher.voucherDate ?? '-'}`);\n consola.info(\n `Supplier: ${voucher.supplierName ?? contactLabel(voucher.supplier)}`,\n );\n consola.info(`Description: ${voucher.description ?? '-'}`);\n consola.info(`Net: ${voucher.sumNet}`);\n consola.info(`Tax: ${voucher.sumTax}`);\n consola.info(`Gross: ${voucher.sumGross}`);\n consola.info(`Currency: ${voucher.currency ?? '-'}`);\n consola.info(`Enshrined: ${voucher.enshrined ?? 'no'}`);\n },\n});\n","import type { VoucherStatus } from '@genz-its/sevdesk-sdk';\nimport { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { contactLabel, printJson, printTable } from '../../output';\n\nexport default defineCommand({\n description: 'List vouchers.',\n options: defineOptions(\n z.object({\n status: z.coerce\n .number()\n .optional()\n .describe(\n 'Filter by status: 50 draft, 100 open, 150 transferred, 750 partially paid, 1000 paid.',\n ),\n creditDebit: z\n .enum(['C', 'D'])\n .optional()\n .describe('Filter by C for expense or D for income vouchers.'),\n descriptionLike: z\n .string()\n .optional()\n .describe('Filter by voucher number, matching partially.'),\n startDate: z\n .string()\n .optional()\n .describe(\n 'Only vouchers on or after this date as dd.mm.yyyy or Unix timestamp.',\n ),\n endDate: z\n .string()\n .optional()\n .describe(\n 'Only vouchers on or before this date as dd.mm.yyyy or Unix timestamp.',\n ),\n contact: z.coerce\n .number()\n .optional()\n .describe('ID of the contact whose vouchers to list.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of vouchers to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of vouchers to skip.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const vouchers = await client.vouchers.list({\n status: options.status as VoucherStatus | undefined,\n creditDebit: options.creditDebit,\n descriptionLike: options.descriptionLike,\n startDate: options.startDate,\n endDate: options.endDate,\n contactId: options.contact,\n limit: options.limit,\n offset: options.offset,\n embed: ['supplier'],\n });\n if (options.json) {\n printJson(vouchers);\n return;\n }\n if (vouchers.length === 0) {\n consola.info('No vouchers found.');\n return;\n }\n printTable(\n vouchers.map((voucher) => ({\n id: voucher.id,\n date: voucher.voucherDate ?? '',\n supplier: voucher.supplierName ?? contactLabel(voucher.supplier),\n description: voucher.description ?? '',\n gross: voucher.sumGross,\n status: voucher.status ?? '',\n })),\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Reset a voucher to the draft status.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher ID via --id',\n question: 'Enter the voucher ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Reset voucher ${voucherId} to draft? This unlinks existing payments.`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n const voucher = await client.vouchers.resetToDraft({ voucherId });\n if (options.json) {\n printJson(voucher);\n return;\n }\n consola.success(\n `Reset voucher ${voucher.id}. New status: ${voucher.status ?? '-'}.`,\n );\n },\n});\n","import { defineCommand, defineOptions } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Reset a voucher to the open status.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n yes: z.boolean().default(false).describe('Skip the confirmation prompt.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher ID via --id',\n question: 'Enter the voucher ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Reset voucher ${voucherId} to open? This unlinks existing payments.`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n const voucher = await client.vouchers.resetToOpen({ voucherId });\n if (options.json) {\n printJson(voucher);\n return;\n }\n consola.success(\n `Reset voucher ${voucher.id}. New status: ${voucher.status ?? '-'}.`,\n );\n },\n});\n","#!/usr/bin/env node\nimport { defineConfig, processConfig } from '@robingenz/zli';\nimport { consola } from 'consola';\nimport accountsBalance from './commands/accounts/balance';\nimport accountsCreateClearing from './commands/accounts/create-clearing';\nimport accountsCreateFileImport from './commands/accounts/create-file-import';\nimport accountsGet from './commands/accounts/get';\nimport accountsList from './commands/accounts/list';\nimport contactsCreate from './commands/contacts/create';\nimport contactsDelete from './commands/contacts/delete';\nimport contactsGet from './commands/contacts/get';\nimport contactsList from './commands/contacts/list';\nimport contactsUpdate from './commands/contacts/update';\nimport creditNotesGet from './commands/credit-notes/get';\nimport creditNotesList from './commands/credit-notes/list';\nimport creditNotesPdf from './commands/credit-notes/pdf';\nimport doctor from './commands/doctor';\nimport exportContacts from './commands/export/contacts';\nimport exportDatev from './commands/export/datev';\nimport exportInvoices from './commands/export/invoices';\nimport exportTransactions from './commands/export/transactions';\nimport exportVouchers from './commands/export/vouchers';\nimport guidanceAccounts from './commands/guidance/accounts';\nimport invoicesGet from './commands/invoices/get';\nimport invoicesList from './commands/invoices/list';\nimport invoicesPdf from './commands/invoices/pdf';\nimport login from './commands/login';\nimport logout from './commands/logout';\nimport ordersGet from './commands/orders/get';\nimport ordersList from './commands/orders/list';\nimport ordersPdf from './commands/orders/pdf';\nimport partsGet from './commands/parts/get';\nimport partsList from './commands/parts/list';\nimport tagsCreate from './commands/tags/create';\nimport tagsDelete from './commands/tags/delete';\nimport tagsList from './commands/tags/list';\nimport transactionsCreate from './commands/transactions/create';\nimport transactionsGet from './commands/transactions/get';\nimport transactionsList from './commands/transactions/list';\nimport vouchersBook from './commands/vouchers/book';\nimport vouchersCreate from './commands/vouchers/create';\nimport vouchersEnshrine from './commands/vouchers/enshrine';\nimport vouchersGet from './commands/vouchers/get';\nimport vouchersList from './commands/vouchers/list';\nimport vouchersResetToDraft from './commands/vouchers/reset-to-draft';\nimport vouchersResetToOpen from './commands/vouchers/reset-to-open';\nimport { formatError } from './errors';\nimport { pkg } from './package';\n\nconst config = defineConfig({\n meta: {\n name: 'sevdesk',\n version: pkg.version,\n description: pkg.description,\n },\n commands: {\n login,\n logout,\n doctor,\n 'accounts:balance': accountsBalance,\n 'accounts:create-clearing': accountsCreateClearing,\n 'accounts:create-file-import': accountsCreateFileImport,\n 'accounts:get': accountsGet,\n 'accounts:list': accountsList,\n 'contacts:create': contactsCreate,\n 'contacts:delete': contactsDelete,\n 'contacts:get': contactsGet,\n 'contacts:list': contactsList,\n 'contacts:update': contactsUpdate,\n 'credit-notes:get': creditNotesGet,\n 'credit-notes:list': creditNotesList,\n 'credit-notes:pdf': creditNotesPdf,\n 'export:contacts': exportContacts,\n 'export:datev': exportDatev,\n 'export:invoices': exportInvoices,\n 'export:transactions': exportTransactions,\n 'export:vouchers': exportVouchers,\n 'guidance:accounts': guidanceAccounts,\n 'invoices:get': invoicesGet,\n 'invoices:list': invoicesList,\n 'invoices:pdf': invoicesPdf,\n 'orders:get': ordersGet,\n 'orders:list': ordersList,\n 'orders:pdf': ordersPdf,\n 'parts:get': partsGet,\n 'parts:list': partsList,\n 'tags:create': tagsCreate,\n 'tags:delete': tagsDelete,\n 'tags:list': tagsList,\n 'transactions:create': transactionsCreate,\n 'transactions:get': transactionsGet,\n 'transactions:list': transactionsList,\n 'vouchers:book': vouchersBook,\n 'vouchers:create': vouchersCreate,\n 'vouchers:enshrine': vouchersEnshrine,\n 'vouchers:get': vouchersGet,\n 'vouchers:list': vouchersList,\n 'vouchers:reset-to-draft': vouchersResetToDraft,\n 'vouchers:reset-to-open': vouchersResetToOpen,\n },\n});\n\ntry {\n const result = processConfig(config, process.argv.slice(2));\n await result.command.action(result.options, result.args);\n} catch (error) {\n consola.error(formatError(error));\n process.exitCode = 1;\n}\n"],"mappings":";;;;;;;;;;AAQA,SAAS,YAAoB;CAC3B,MAAM,gBAAgB,QAAQ,IAAI;CAClC,MAAM,OAAO,gBAAgB,gBAAgB,KAAK,QAAQ,GAAG,SAAS;CACtE,OAAO,KAAK,MAAM,SAAS;AAC7B;AAEA,SAAgB,aAAqB;CACnC,OAAO,KAAK,UAAU,GAAG,aAAa;AACxC;AAEA,eAAsB,aAAiC;CACrD,IAAI;EACF,OAAO,KAAK,MAAM,MAAM,SAAS,WAAW,GAAG,MAAM,CAAC;CACxD,QAAQ;EACN,OAAO,CAAC;CACV;AACF;AAEA,eAAsB,YAAY,QAAkC;CAClE,MAAM,MAAM,UAAU,GAAG,EAAE,WAAW,KAAK,CAAC;CAC5C,MAAM,UAAU,WAAW,GAAG,GAAG,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE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AAQ,KAAK,MAAM,CAAC,CAAC;CAC1D,MAAM,OAAO,QAAQ,OAAO,OAAO,SAAS,OAAO,IAAI;AACzD,SAAS,OAAO;CACd,QAAQ,MAAM,YAAY,KAAK,CAAC;CAChC,QAAQ,WAAW;AACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genz-its/sevdesk-cli",
3
- "version": "0.0.0",
3
+ "version": "0.1.0",
4
4
  "description": "Unofficial command-line interface for the sevdesk API.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,7 @@
16
16
  "test": "vitest run"
17
17
  },
18
18
  "dependencies": {
19
- "@genz-its/sevdesk-sdk": "0.0.0",
19
+ "@genz-its/sevdesk-sdk": "0.1.0",
20
20
  "@robingenz/zli": "0.2.0",
21
21
  "consola": "3.4.2",
22
22
  "zod": "4.4.3"