@genz-its/sevdesk-cli 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -83,6 +83,8 @@ sevdesk transactions:list --unbooked --json | jq -r '.[].id'
83
83
  - [`login`](#login)
84
84
  - [`logout`](#logout)
85
85
  - [`doctor`](#doctor)
86
+ - [`accounts-datev:get`](#accounts-datevget)
87
+ - [`accounts-datev:list`](#accounts-datevlist)
86
88
  - [`accounts:balance`](#accountsbalance)
87
89
  - [`accounts:create-clearing`](#accountscreate-clearing)
88
90
  - [`accounts:create-file-import`](#accountscreate-file-import)
@@ -160,6 +162,35 @@ sevdesk doctor [options]
160
162
 
161
163
  - `--json`: Output in JSON format.
162
164
 
165
+ ### `accounts-datev:get`
166
+
167
+ Show a single booking account (AccountDatev), including hidden accounts that [`accounts-datev:list`](#accounts-datevlist) does not return. Backed by an undocumented sevdesk endpoint that may change without notice.
168
+
169
+ ```bash
170
+ sevdesk accounts-datev:get [options]
171
+ ```
172
+
173
+ **Options:**
174
+
175
+ - `--id`: The booking account ID. If omitted, you will be prompted.
176
+ - `--json`: Output in JSON format.
177
+
178
+ ### `accounts-datev:list`
179
+
180
+ List booking accounts (AccountDatev). Covers only accounts visible in the sevdesk account picker; hidden accounts (for example some tax accounts) are reachable via [`accounts-datev:get`](#accounts-datevget). Backed by an undocumented sevdesk endpoint that may change without notice.
181
+
182
+ ```bash
183
+ sevdesk accounts-datev:list [options]
184
+ ```
185
+
186
+ **Options:**
187
+
188
+ - `--number`: Only show accounts with this account number. Filtered client-side across all visible accounts.
189
+ - `--name-like`: Only show accounts whose name contains this text. Filtered client-side across all visible accounts.
190
+ - `--limit`: Maximum number of accounts to return.
191
+ - `--offset`: Number of accounts to skip. Ignored when a filter is used.
192
+ - `--json`: Output in JSON format.
193
+
163
194
  ### `accounts:balance`
164
195
 
165
196
  Show the balance of a check account at a given date. The balance is the sum of all transactions known to sevdesk, which is not necessarily the real bank balance.
@@ -496,7 +527,7 @@ sevdesk export:vouchers [options]
496
527
 
497
528
  ### `guidance:accounts`
498
529
 
499
- 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.
530
+ List bookable accounts and their allowed tax rules. Covers only the ReceiptGuidance subset of VAT-relevant accounts — use [`accounts-datev:list`](#accounts-datevlist) for all booking accounts. The first matching filter wins: `--account-number`, `--tax-rule`, `--revenue`, `--expense`. Without a filter, all accounts are listed.
500
531
 
501
532
  ```bash
502
533
  sevdesk guidance:accounts [options]
@@ -719,7 +750,7 @@ sevdesk transactions:list [options]
719
750
  **Options:**
720
751
 
721
752
  - `--check-account`: Only show transactions of this check account ID.
722
- - `--unbooked`: Only show transactions that are not yet booked. Defaults to `false`.
753
+ - `--unbooked`: Only show transactions with status `100` (created). Filtered client-side because the sevdesk API ignores its `isBooked=false` filter, so a page fetched with `--limit` may yield fewer rows. Defaults to `false`.
723
754
  - `--start-date`: Only show transactions on or after this date (ISO 8601).
724
755
  - `--end-date`: Only show transactions on or before this date (ISO 8601).
725
756
  - `--payee`: Only show transactions with this payee or payer name.
package/dist/index.js CHANGED
@@ -161,6 +161,89 @@ function printTable(rows) {
161
161
  for (const row of rows) console.log(line(columns.map((column) => row[column] ?? "")));
162
162
  }
163
163
  //#endregion
164
+ //#region src/commands/accounts-datev/get.ts
165
+ var get_default$8 = defineCommand({
166
+ description: "Show a single booking account (AccountDatev), including hidden accounts that accounts-datev:list does not return. Backed by an undocumented sevdesk endpoint that may change without notice.",
167
+ options: defineOptions(z.object({
168
+ id: z.coerce.number().optional().describe("The booking account ID. If omitted, you will be prompted."),
169
+ json: z.boolean().default(false).describe("Output in JSON format.")
170
+ })),
171
+ action: async (options) => {
172
+ const client = await requireClient();
173
+ const accountDatevId = await requireNumberOption({
174
+ value: options.id,
175
+ requirement: "a booking account via --id",
176
+ question: "Enter the booking account ID:"
177
+ });
178
+ const account = await client.accountsDatev.get({ accountDatevId });
179
+ if (options.json) {
180
+ printJson(account);
181
+ return;
182
+ }
183
+ consola.info(`ID: ${account.id}`);
184
+ consola.info(`Number: ${account.number ?? "-"}`);
185
+ consola.info(`Name: ${account.name ?? "-"}`);
186
+ consola.info(`Tax rate: ${account.taxRate ?? "-"}`);
187
+ consola.info(`Deprecated: ${account.deprecated ?? "-"}`);
188
+ consola.info(`Hidden: ${account.hidden ?? "-"}`);
189
+ consola.info(`Deactivated: ${account.deactivated ?? "-"}`);
190
+ }
191
+ });
192
+ //#endregion
193
+ //#region src/commands/accounts-datev/list.ts
194
+ const PAGE_SIZE = 1e3;
195
+ var list_default$9 = defineCommand({
196
+ description: "List booking accounts (AccountDatev). Covers only accounts visible in the sevdesk account picker; hidden accounts (for example some tax accounts) are reachable via accounts-datev:get. Backed by an undocumented sevdesk endpoint that may change without notice.",
197
+ options: defineOptions(z.object({
198
+ number: z.string().optional().describe("Only show accounts with this account number. Filtered client-side across all visible accounts."),
199
+ nameLike: z.string().optional().describe("Only show accounts whose name contains this text. Filtered client-side across all visible accounts."),
200
+ limit: z.coerce.number().optional().describe("Maximum number of accounts to return."),
201
+ offset: z.coerce.number().optional().describe("Number of accounts to skip. Ignored when a filter is used."),
202
+ json: z.boolean().default(false).describe("Output in JSON format.")
203
+ })),
204
+ action: async (options) => {
205
+ const client = await requireClient();
206
+ const filtering = options.number !== void 0 || options.nameLike !== void 0;
207
+ let accounts;
208
+ if (filtering) {
209
+ accounts = [];
210
+ for (let offset = 0;; offset += PAGE_SIZE) {
211
+ const page = await client.accountsDatev.list({
212
+ limit: PAGE_SIZE,
213
+ offset
214
+ });
215
+ accounts.push(...page);
216
+ if (page.length < PAGE_SIZE) break;
217
+ }
218
+ if (options.number !== void 0) accounts = accounts.filter((account) => account.number === options.number);
219
+ if (options.nameLike !== void 0) {
220
+ const needle = options.nameLike.toLowerCase();
221
+ accounts = accounts.filter((account) => (account.name ?? "").toLowerCase().includes(needle));
222
+ }
223
+ if (options.limit !== void 0) accounts = accounts.slice(0, options.limit);
224
+ } else accounts = await client.accountsDatev.list({
225
+ limit: options.limit,
226
+ offset: options.offset
227
+ });
228
+ if (options.json) {
229
+ printJson(accounts);
230
+ return;
231
+ }
232
+ if (accounts.length === 0) {
233
+ consola.info("No booking accounts found.");
234
+ return;
235
+ }
236
+ printTable(accounts.map((account) => ({
237
+ id: account.id,
238
+ number: account.number ?? "",
239
+ name: account.name ?? "",
240
+ taxRate: account.taxRate ?? "",
241
+ deprecated: account.deprecated ?? "",
242
+ hidden: account.hidden ?? ""
243
+ })));
244
+ }
245
+ });
246
+ //#endregion
164
247
  //#region src/commands/accounts/balance.ts
165
248
  var balance_default = defineCommand({
166
249
  description: "Show the balance of a check account at a given date.",
@@ -1003,7 +1086,7 @@ function formatTaxRules(taxRules) {
1003
1086
  return names.join(", ");
1004
1087
  }
1005
1088
  var accounts_default = defineCommand({
1006
- description: "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.",
1089
+ description: "List bookable accounts and their allowed tax rules. Covers only the ReceiptGuidance subset of VAT-relevant accounts — use accounts-datev:list for all booking accounts. The first matching filter wins: --account-number, --tax-rule, --revenue, --expense. Without a filter, all accounts are listed.",
1007
1090
  options: defineOptions(z.object({
1008
1091
  accountNumber: z.string().optional().describe("Only show the account with this datev account number."),
1009
1092
  taxRule: z.string().optional().describe("Tax rule name, for example USTPFL_UMS_EINN."),
@@ -1561,7 +1644,7 @@ var list_default$1 = defineCommand({
1561
1644
  description: "List transactions of your check accounts.",
1562
1645
  options: defineOptions(z.object({
1563
1646
  checkAccount: z.coerce.number().optional().describe("Only show transactions of this check account ID."),
1564
- unbooked: z.boolean().default(false).describe("Only show transactions that are not yet booked."),
1647
+ unbooked: z.boolean().default(false).describe("Only show transactions with status 100 (created). Filtered client-side because the sevdesk API ignores its isBooked=false filter, so a page fetched with --limit may yield fewer rows."),
1565
1648
  startDate: z.string().optional().describe("Only show transactions on or after this date (ISO 8601)."),
1566
1649
  endDate: z.string().optional().describe("Only show transactions on or before this date (ISO 8601)."),
1567
1650
  payee: z.string().optional().describe("Only show transactions with this payee or payer name."),
@@ -1571,9 +1654,8 @@ var list_default$1 = defineCommand({
1571
1654
  json: z.boolean().default(false).describe("Output in JSON format.")
1572
1655
  })),
1573
1656
  action: async (options) => {
1574
- const transactions = await (await requireClient()).transactions.list({
1657
+ let transactions = await (await requireClient()).transactions.list({
1575
1658
  checkAccountId: options.checkAccount,
1576
- isBooked: options.unbooked ? false : void 0,
1577
1659
  startDate: options.startDate,
1578
1660
  endDate: options.endDate,
1579
1661
  payeePayerName: options.payee,
@@ -1581,6 +1663,7 @@ var list_default$1 = defineCommand({
1581
1663
  limit: options.limit,
1582
1664
  offset: options.offset
1583
1665
  });
1666
+ if (options.unbooked) transactions = transactions.filter((transaction) => transaction.status === "100");
1584
1667
  if (options.json) {
1585
1668
  printJson(transactions);
1586
1669
  return;
@@ -1875,7 +1958,7 @@ var positions_default = defineCommand({
1875
1958
  printTable(positions.map((position) => ({
1876
1959
  id: position.id,
1877
1960
  voucher: position.voucher.id,
1878
- account: accountLabel(position.accountDatev),
1961
+ account: accountLabel(position.accountDatev ?? position.accountingType),
1879
1962
  taxRate: position.taxRate,
1880
1963
  net: String(position.net),
1881
1964
  sumNet: position.sumNet,
@@ -1884,6 +1967,7 @@ var positions_default = defineCommand({
1884
1967
  }
1885
1968
  });
1886
1969
  function accountLabel(account) {
1970
+ if (!account) return "-";
1887
1971
  const parts = [account.number ?? account.accountNumber, account.name ?? account.accountName].filter((part) => part !== void 0 && part !== null && part !== "");
1888
1972
  return parts.length === 0 ? account.id : parts.join(" ");
1889
1973
  }
@@ -1957,6 +2041,8 @@ const config = defineConfig({
1957
2041
  login: login_default,
1958
2042
  logout: logout_default,
1959
2043
  doctor: doctor_default,
2044
+ "accounts-datev:get": get_default$8,
2045
+ "accounts-datev:list": list_default$9,
1960
2046
  "accounts:balance": balance_default,
1961
2047
  "accounts:create-clearing": create_clearing_default,
1962
2048
  "accounts:create-file-import": create_file_import_default,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["accountsBalance","accountsCreateClearing","accountsCreateFileImport","accountsGet","accountsList","contactsAddAddress","contactsAddEmail","contactsAddPhone","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","vouchersPositions","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/add-address.ts","../src/commands/contacts/add-email.ts","../src/commands/contacts/add-phone.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/positions.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 { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Add an address to a contact.',\n options: defineOptions(\n z.object({\n contact: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n street: z.string().optional().describe('Street and house number.'),\n zip: z.string().optional().describe('Zip code.'),\n city: z.string().optional().describe('City name.'),\n country: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the country as a StaticCountry ID, for example 1 for Germany. There is no lookup endpoint in this CLI, but an existing address of a contact reveals the IDs of other countries. If omitted, you will be prompted.',\n ),\n category: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the address category. The sevdesk API does not document the IDs, they are listed by a GET to /Category?objectType=ContactAddress and an existing address of a contact reveals the ones in use. 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 contactId = await requireNumberOption({\n value: options.contact,\n requirement: 'a contact ID via --contact',\n question: 'Enter the contact ID:',\n });\n const countryId = await requireNumberOption({\n value: options.country,\n requirement: 'a country ID via --country',\n question: 'Enter the country ID, for example 1 for Germany:',\n });\n const categoryId = await requireNumberOption({\n value: options.category,\n requirement: 'an address category ID via --category',\n question: 'Enter the address category ID:',\n });\n const address = await client.contactAddresses.create({\n contactId,\n countryId,\n categoryId,\n street: options.street,\n zip: options.zip,\n city: options.city,\n });\n if (options.json) {\n printJson(address);\n return;\n }\n consola.success(`Created contact address ${address.id}.`);\n },\n});\n","import { 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\nexport default defineCommand({\n description: 'Add an e-mail address to a contact.',\n options: defineOptions(\n z.object({\n contact: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n email: z\n .string()\n .optional()\n .describe('The e-mail address. If omitted, you will be prompted.'),\n key: z.coerce\n .number()\n .default(2)\n .describe(\n 'ID of the communication way key: 1 private, 2 work, 7 newsletter, 8 invoicing.',\n ),\n main: z\n .boolean()\n .default(false)\n .describe('Mark the e-mail address as the main one 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.contact,\n requirement: 'a contact ID via --contact',\n question: 'Enter the contact ID:',\n });\n const email = await requireStringOption({\n value: options.email,\n requirement: 'an e-mail address via --email',\n question: 'Enter the e-mail address:',\n });\n if (!email.includes('@')) {\n consola.error('The e-mail address must contain an \"@\".');\n process.exit(1);\n }\n const communicationWay = await client.communicationWays.create({\n contactId,\n type: 'EMAIL',\n value: email,\n keyId: options.key,\n main: options.main,\n });\n if (options.json) {\n printJson(communicationWay);\n return;\n }\n consola.success(`Created e-mail communication way ${communicationWay.id}.`);\n },\n});\n","import { 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\nexport default defineCommand({\n description: 'Add a phone number to a contact.',\n options: defineOptions(\n z.object({\n contact: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n phone: z\n .string()\n .optional()\n .describe('The phone number. If omitted, you will be prompted.'),\n key: z.coerce\n .number()\n .default(2)\n .describe(\n 'ID of the communication way key: 1 private, 2 work, 3 fax, 4 mobile.',\n ),\n main: z\n .boolean()\n .default(false)\n .describe('Mark the phone number as the main one 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.contact,\n requirement: 'a contact ID via --contact',\n question: 'Enter the contact ID:',\n });\n const phone = await requireStringOption({\n value: options.phone,\n requirement: 'a phone number via --phone',\n question: 'Enter the phone number:',\n });\n const communicationWay = await client.communicationWays.create({\n contactId,\n type: 'PHONE',\n value: phone,\n keyId: options.key,\n main: options.main,\n });\n if (options.json) {\n printJson(communicationWay);\n return;\n }\n consola.success(`Created phone communication way ${communicationWay.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: '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 type { CommunicationWay, ContactAddress } 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 } from '../../options';\nimport { printJson } from '../../output';\n\n/** The `/ContactAddress` endpoint cannot filter by contact, so we filter here. */\nconst ADDRESS_LOOKUP_LIMIT = 100;\n\nexport default defineCommand({\n description:\n 'Show a single contact with its addresses and communication ways.',\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 const allAddresses = await client.contactAddresses.list({\n limit: ADDRESS_LOOKUP_LIMIT,\n });\n const addresses = allAddresses.filter(\n (address) => address.contact.id === String(contactId),\n );\n const communicationWays = await client.communicationWays.list({\n contactId,\n });\n if (options.json) {\n printJson({ contact, addresses, communicationWays });\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 printSection('Addresses:', addresses.map(formatAddress));\n printSection(\n 'Communication ways:',\n communicationWays.map(formatCommunicationWay),\n );\n },\n});\n\nfunction printSection(title: string, lines: string[]): void {\n consola.info(title);\n for (const line of lines.length === 0 ? ['-'] : lines) {\n consola.info(` ${line}`);\n }\n}\n\nfunction formatAddress(address: ContactAddress): string {\n const parts = [\n address.street,\n [address.zip, address.city].filter((part) => part).join(' '),\n `country ${address.country.id}`,\n ];\n return parts.filter((part) => part).join(', ');\n}\n\nfunction formatCommunicationWay(communicationWay: CommunicationWay): string {\n const main = communicationWay.main === '1' ? ' (main)' : '';\n return `${communicationWay.type}: ${communicationWay.value}${main}`;\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 depth: z.coerce\n .number()\n .optional()\n .describe(\n 'Contact depth: 0 returns only organizations, 1 organizations and persons. Defaults to 0.',\n ),\n category: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the contact category to filter by: 2 supplier, 3 customer, 4 partner.',\n ),\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 depth: toDepth(options.depth),\n categoryId: options.category,\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 toDepth(depth: number | undefined): '0' | '1' | undefined {\n if (depth === undefined) {\n return undefined;\n }\n return depth === 0 ? '0' : '1';\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 type { ModelRefResponse } 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\n/**\n * The booking account of a position. The number and name fields are only\n * present when the reference was inflated with the `embed` query parameter.\n */\ninterface AccountDatevLike extends ModelRefResponse {\n number?: string | number | null;\n accountNumber?: string | number | null;\n name?: string | null;\n accountName?: string | null;\n}\n\nexport default defineCommand({\n description: 'List voucher positions.',\n options: defineOptions(\n z.object({\n voucher: z.coerce\n .number()\n .optional()\n .describe('ID of the voucher whose positions to list.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of positions to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of positions 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 positions = await client.vouchers.listPositions({\n voucherId: options.voucher,\n limit: options.limit,\n offset: options.offset,\n embed: ['accountDatev'],\n });\n if (options.json) {\n printJson(positions);\n return;\n }\n if (positions.length === 0) {\n consola.info('No voucher positions found.');\n return;\n }\n printTable(\n positions.map((position) => ({\n id: position.id,\n voucher: position.voucher.id,\n account: accountLabel(position.accountDatev),\n taxRate: position.taxRate,\n net: String(position.net),\n sumNet: position.sumNet,\n sumGross: position.sumGross,\n })),\n );\n },\n});\n\nfunction accountLabel(account: AccountDatevLike): string {\n const parts = [\n account.number ?? account.accountNumber,\n account.name ?? account.accountName,\n ].filter((part) => part !== undefined && part !== null && part !== '');\n return parts.length === 0 ? account.id : parts.join(' ');\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 contactsAddAddress from './commands/contacts/add-address';\nimport contactsAddEmail from './commands/contacts/add-email';\nimport contactsAddPhone from './commands/contacts/add-phone';\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 vouchersPositions from './commands/vouchers/positions';\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:add-address': contactsAddAddress,\n 'contacts:add-email': contactsAddEmail,\n 'contacts:add-phone': contactsAddPhone,\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:positions': vouchersPositions,\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,W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AAiBC;EACjB,mBAAmBC;EACnB,oBAAoBC;EACpB,qBAAqBC;EACrB,oBAAoBC;EACpB,mBAAmBC;EACnB,gBAAgBC;EAChB,mBAAmBC;EACnB,uBAAuBC;EACvB,mBAAmBC;EACnB,qBAAqBC;EACrB,gBAAgBC;EAChB,iBAAiBC;EACjB,gBAAgBC;EAChB,cAAcC;EACd,eAAeC;EACf,cAAcC;EACd,aAAaC;EACb,cAAcC;EACd,eAAeC;EACf,eAAeC;EACf,aAAaC;EACb,uBAAuBC;EACvB,oBAAoBC;EACpB,qBAAqBC;EACrB,iBAAiBC;EACjB,mBAAmBC;EACnB,qBAAqBC;EACrB,gBAAgBC;EAChB,iBAAiBC;EACjB,sBAAsBC;EACtB,2BAA2BC;EAC3B,0BAA0BC;CAC5B;AACF,CAAC;AAED,IAAI;CACF,MAAM,SAAS,cAAc,QAAQ,QAAQ,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"}
1
+ {"version":3,"file":"index.js","names":["accountsDatevGet","accountsDatevList","accountsBalance","accountsCreateClearing","accountsCreateFileImport","accountsGet","accountsList","contactsAddAddress","contactsAddEmail","contactsAddPhone","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","vouchersPositions","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-datev/get.ts","../src/commands/accounts-datev/list.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/add-address.ts","../src/commands/contacts/add-email.ts","../src/commands/contacts/add-phone.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/positions.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:\n 'Show a single booking account (AccountDatev), including hidden accounts that accounts-datev:list does not return. Backed by an undocumented sevdesk endpoint that may change without notice.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('The booking 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 accountDatevId = await requireNumberOption({\n value: options.id,\n requirement: 'a booking account via --id',\n question: 'Enter the booking account ID:',\n });\n const account = await client.accountsDatev.get({ accountDatevId });\n if (options.json) {\n printJson(account);\n return;\n }\n consola.info(`ID: ${account.id}`);\n consola.info(`Number: ${account.number ?? '-'}`);\n consola.info(`Name: ${account.name ?? '-'}`);\n consola.info(`Tax rate: ${account.taxRate ?? '-'}`);\n consola.info(`Deprecated: ${account.deprecated ?? '-'}`);\n consola.info(`Hidden: ${account.hidden ?? '-'}`);\n consola.info(`Deactivated: ${account.deactivated ?? '-'}`);\n },\n});\n","import type { AccountDatev } 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 PAGE_SIZE = 1000;\n\nexport default defineCommand({\n description:\n 'List booking accounts (AccountDatev). Covers only accounts visible in the sevdesk account picker; hidden accounts (for example some tax accounts) are reachable via accounts-datev:get. Backed by an undocumented sevdesk endpoint that may change without notice.',\n options: defineOptions(\n z.object({\n number: z\n .string()\n .optional()\n .describe(\n 'Only show accounts with this account number. Filtered client-side across all visible accounts.',\n ),\n nameLike: z\n .string()\n .optional()\n .describe(\n 'Only show accounts whose name contains this text. Filtered client-side across all visible accounts.',\n ),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of accounts to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of accounts to skip. Ignored when a filter is used.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const filtering =\n options.number !== undefined || options.nameLike !== undefined;\n let accounts: AccountDatev[];\n if (filtering) {\n accounts = [];\n for (let offset = 0; ; offset += PAGE_SIZE) {\n const page = await client.accountsDatev.list({\n limit: PAGE_SIZE,\n offset,\n });\n accounts.push(...page);\n if (page.length < PAGE_SIZE) {\n break;\n }\n }\n if (options.number !== undefined) {\n accounts = accounts.filter(\n (account) => account.number === options.number,\n );\n }\n if (options.nameLike !== undefined) {\n const needle = options.nameLike.toLowerCase();\n accounts = accounts.filter((account) =>\n (account.name ?? '').toLowerCase().includes(needle),\n );\n }\n if (options.limit !== undefined) {\n accounts = accounts.slice(0, options.limit);\n }\n } else {\n accounts = await client.accountsDatev.list({\n limit: options.limit,\n offset: options.offset,\n });\n }\n if (options.json) {\n printJson(accounts);\n return;\n }\n if (accounts.length === 0) {\n consola.info('No booking accounts found.');\n return;\n }\n printTable(\n accounts.map((account) => ({\n id: account.id,\n number: account.number ?? '',\n name: account.name ?? '',\n taxRate: account.taxRate ?? '',\n deprecated: account.deprecated ?? '',\n hidden: account.hidden ?? '',\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 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 { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Add an address to a contact.',\n options: defineOptions(\n z.object({\n contact: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n street: z.string().optional().describe('Street and house number.'),\n zip: z.string().optional().describe('Zip code.'),\n city: z.string().optional().describe('City name.'),\n country: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the country as a StaticCountry ID, for example 1 for Germany. There is no lookup endpoint in this CLI, but an existing address of a contact reveals the IDs of other countries. If omitted, you will be prompted.',\n ),\n category: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the address category. The sevdesk API does not document the IDs, they are listed by a GET to /Category?objectType=ContactAddress and an existing address of a contact reveals the ones in use. 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 contactId = await requireNumberOption({\n value: options.contact,\n requirement: 'a contact ID via --contact',\n question: 'Enter the contact ID:',\n });\n const countryId = await requireNumberOption({\n value: options.country,\n requirement: 'a country ID via --country',\n question: 'Enter the country ID, for example 1 for Germany:',\n });\n const categoryId = await requireNumberOption({\n value: options.category,\n requirement: 'an address category ID via --category',\n question: 'Enter the address category ID:',\n });\n const address = await client.contactAddresses.create({\n contactId,\n countryId,\n categoryId,\n street: options.street,\n zip: options.zip,\n city: options.city,\n });\n if (options.json) {\n printJson(address);\n return;\n }\n consola.success(`Created contact address ${address.id}.`);\n },\n});\n","import { 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\nexport default defineCommand({\n description: 'Add an e-mail address to a contact.',\n options: defineOptions(\n z.object({\n contact: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n email: z\n .string()\n .optional()\n .describe('The e-mail address. If omitted, you will be prompted.'),\n key: z.coerce\n .number()\n .default(2)\n .describe(\n 'ID of the communication way key: 1 private, 2 work, 7 newsletter, 8 invoicing.',\n ),\n main: z\n .boolean()\n .default(false)\n .describe('Mark the e-mail address as the main one 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.contact,\n requirement: 'a contact ID via --contact',\n question: 'Enter the contact ID:',\n });\n const email = await requireStringOption({\n value: options.email,\n requirement: 'an e-mail address via --email',\n question: 'Enter the e-mail address:',\n });\n if (!email.includes('@')) {\n consola.error('The e-mail address must contain an \"@\".');\n process.exit(1);\n }\n const communicationWay = await client.communicationWays.create({\n contactId,\n type: 'EMAIL',\n value: email,\n keyId: options.key,\n main: options.main,\n });\n if (options.json) {\n printJson(communicationWay);\n return;\n }\n consola.success(`Created e-mail communication way ${communicationWay.id}.`);\n },\n});\n","import { 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\nexport default defineCommand({\n description: 'Add a phone number to a contact.',\n options: defineOptions(\n z.object({\n contact: z.coerce\n .number()\n .optional()\n .describe('The contact ID. If omitted, you will be prompted.'),\n phone: z\n .string()\n .optional()\n .describe('The phone number. If omitted, you will be prompted.'),\n key: z.coerce\n .number()\n .default(2)\n .describe(\n 'ID of the communication way key: 1 private, 2 work, 3 fax, 4 mobile.',\n ),\n main: z\n .boolean()\n .default(false)\n .describe('Mark the phone number as the main one 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.contact,\n requirement: 'a contact ID via --contact',\n question: 'Enter the contact ID:',\n });\n const phone = await requireStringOption({\n value: options.phone,\n requirement: 'a phone number via --phone',\n question: 'Enter the phone number:',\n });\n const communicationWay = await client.communicationWays.create({\n contactId,\n type: 'PHONE',\n value: phone,\n keyId: options.key,\n main: options.main,\n });\n if (options.json) {\n printJson(communicationWay);\n return;\n }\n consola.success(`Created phone communication way ${communicationWay.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: '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 type { CommunicationWay, ContactAddress } 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 } from '../../options';\nimport { printJson } from '../../output';\n\n/** The `/ContactAddress` endpoint cannot filter by contact, so we filter here. */\nconst ADDRESS_LOOKUP_LIMIT = 100;\n\nexport default defineCommand({\n description:\n 'Show a single contact with its addresses and communication ways.',\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 const allAddresses = await client.contactAddresses.list({\n limit: ADDRESS_LOOKUP_LIMIT,\n });\n const addresses = allAddresses.filter(\n (address) => address.contact.id === String(contactId),\n );\n const communicationWays = await client.communicationWays.list({\n contactId,\n });\n if (options.json) {\n printJson({ contact, addresses, communicationWays });\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 printSection('Addresses:', addresses.map(formatAddress));\n printSection(\n 'Communication ways:',\n communicationWays.map(formatCommunicationWay),\n );\n },\n});\n\nfunction printSection(title: string, lines: string[]): void {\n consola.info(title);\n for (const line of lines.length === 0 ? ['-'] : lines) {\n consola.info(` ${line}`);\n }\n}\n\nfunction formatAddress(address: ContactAddress): string {\n const parts = [\n address.street,\n [address.zip, address.city].filter((part) => part).join(' '),\n `country ${address.country.id}`,\n ];\n return parts.filter((part) => part).join(', ');\n}\n\nfunction formatCommunicationWay(communicationWay: CommunicationWay): string {\n const main = communicationWay.main === '1' ? ' (main)' : '';\n return `${communicationWay.type}: ${communicationWay.value}${main}`;\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 depth: z.coerce\n .number()\n .optional()\n .describe(\n 'Contact depth: 0 returns only organizations, 1 organizations and persons. Defaults to 0.',\n ),\n category: z.coerce\n .number()\n .optional()\n .describe(\n 'ID of the contact category to filter by: 2 supplier, 3 customer, 4 partner.',\n ),\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 depth: toDepth(options.depth),\n categoryId: options.category,\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 toDepth(depth: number | undefined): '0' | '1' | undefined {\n if (depth === undefined) {\n return undefined;\n }\n return depth === 0 ? '0' : '1';\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. Covers only the ReceiptGuidance subset of VAT-relevant accounts — use accounts-datev:list for all booking accounts. 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(\n 'Only show transactions with status 100 (created). Filtered client-side because the sevdesk API ignores its isBooked=false filter, so a page fetched with --limit may yield fewer rows.',\n ),\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 let transactions = await client.transactions.list({\n checkAccountId: options.checkAccount,\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.unbooked) {\n transactions = transactions.filter(\n (transaction) => transaction.status === '100',\n );\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 type { ModelRefResponse } 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\n/**\n * The booking account of a position. The number and name fields are only\n * present when the reference was inflated with the `embed` query parameter.\n */\ninterface AccountDatevLike extends ModelRefResponse {\n number?: string | number | null;\n accountNumber?: string | number | null;\n name?: string | null;\n accountName?: string | null;\n}\n\nexport default defineCommand({\n description: 'List voucher positions.',\n options: defineOptions(\n z.object({\n voucher: z.coerce\n .number()\n .optional()\n .describe('ID of the voucher whose positions to list.'),\n limit: z.coerce\n .number()\n .optional()\n .describe('Maximum number of positions to return.'),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of positions 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 positions = await client.vouchers.listPositions({\n voucherId: options.voucher,\n limit: options.limit,\n offset: options.offset,\n embed: ['accountDatev'],\n });\n if (options.json) {\n printJson(positions);\n return;\n }\n if (positions.length === 0) {\n consola.info('No voucher positions found.');\n return;\n }\n printTable(\n positions.map((position) => ({\n id: position.id,\n voucher: position.voucher.id,\n account: accountLabel(position.accountDatev ?? position.accountingType),\n taxRate: position.taxRate,\n net: String(position.net),\n sumNet: position.sumNet,\n sumGross: position.sumGross,\n })),\n );\n },\n});\n\nfunction accountLabel(account: AccountDatevLike | null | undefined): string {\n if (!account) {\n return '-';\n }\n const parts = [\n account.number ?? account.accountNumber,\n account.name ?? account.accountName,\n ].filter((part) => part !== undefined && part !== null && part !== '');\n return parts.length === 0 ? account.id : parts.join(' ');\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 accountsDatevGet from './commands/accounts-datev/get';\nimport accountsDatevList from './commands/accounts-datev/list';\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 contactsAddAddress from './commands/contacts/add-address';\nimport contactsAddEmail from './commands/contacts/add-email';\nimport contactsAddPhone from './commands/contacts/add-phone';\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 vouchersPositions from './commands/vouchers/positions';\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-datev:get': accountsDatevGet,\n 'accounts-datev:list': accountsDatevList,\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:add-address': contactsAddAddress,\n 'contacts:add-email': contactsAddEmail,\n 'contacts:add-phone': contactsAddPhone,\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:positions': vouchersPositions,\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,KAAK,EACpE,MAAM,IACR,CAAC;AACH;AAIA,eAAsB,eAGnB;CACD,MAAM,mBAAmB,QAAQ,IAAI,gBAAgB,EAAE,KAAK;CAC5D,IAAI,kBACF,OAAO;EAAE,OAAO;EAAkB,QAAQ;CAAc;CAE1D,MAAM,eAAe,MAAM,WAAW,EAAA,CAAG,OAAO,KAAK;CACrD,IAAI,aACF,OAAO;EAAE,OAAO;EAAa,QAAQ;CAAS;CAEhD,OAAO,EAAE,QAAQ,OAAO;AAC1B;;;AC9CA,MAAa,MAAM,cAAc,YAAY,GAAG,CAAC,CAAC,iBAAiB;;;ACGnE,SAAgB,aAAa,OAAwB;CACnD,OAAO,IAAI,QAAQ;EAAE;EAAO,WAAW,GAAG,IAAI,KAAK,GAAG,IAAI;CAAU,CAAC;AACvE;;;;;AAMA,eAAsB,gBAAkC;CACtD,MAAM,EAAE,UAAU,MAAM,aAAa;CACrC,IAAI,CAAC,OAAO;EACV,QAAQ,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AAO;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.1.1",
3
+ "version": "0.1.3",
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.1.1",
19
+ "@genz-its/sevdesk-sdk": "0.1.3",
20
20
  "@robingenz/zli": "0.2.0",
21
21
  "consola": "3.4.2",
22
22
  "zod": "4.4.3"