@genz-its/sevdesk-cli 0.1.7 → 0.1.8
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 +31 -0
- package/dist/index.js +97 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -129,9 +129,11 @@ sevdesk transactions:list --unbooked --json | jq -r '.[].id'
|
|
|
129
129
|
- [`vouchers:enshrine`](#vouchersenshrine)
|
|
130
130
|
- [`vouchers:get`](#vouchersget)
|
|
131
131
|
- [`vouchers:list`](#voucherslist)
|
|
132
|
+
- [`vouchers:open`](#vouchersopen)
|
|
132
133
|
- [`vouchers:positions`](#voucherspositions)
|
|
133
134
|
- [`vouchers:reset-to-draft`](#vouchersreset-to-draft)
|
|
134
135
|
- [`vouchers:reset-to-open`](#vouchersreset-to-open)
|
|
136
|
+
- [`vouchers:update`](#vouchersupdate)
|
|
135
137
|
|
|
136
138
|
### `login`
|
|
137
139
|
|
|
@@ -903,6 +905,19 @@ sevdesk vouchers:list [options]
|
|
|
903
905
|
- `--offset`: Number of vouchers to skip.
|
|
904
906
|
- `--json`: Output in JSON format.
|
|
905
907
|
|
|
908
|
+
### `vouchers:open`
|
|
909
|
+
|
|
910
|
+
Move a draft voucher to the open status. Everything else, including the attached document and the positions, stays unchanged. Exits with an error and changes nothing unless the voucher is a draft that is not enshrined.
|
|
911
|
+
|
|
912
|
+
```bash
|
|
913
|
+
sevdesk vouchers:open [options]
|
|
914
|
+
```
|
|
915
|
+
|
|
916
|
+
**Options:**
|
|
917
|
+
|
|
918
|
+
- `--id`: ID of the voucher. If omitted, you will be prompted.
|
|
919
|
+
- `--json`: Output in JSON format.
|
|
920
|
+
|
|
906
921
|
### `vouchers:positions`
|
|
907
922
|
|
|
908
923
|
List voucher positions.
|
|
@@ -946,6 +961,22 @@ sevdesk vouchers:reset-to-open [options]
|
|
|
946
961
|
- `--yes`: Skip the confirmation prompt. Defaults to `false`.
|
|
947
962
|
- `--json`: Output in JSON format.
|
|
948
963
|
|
|
964
|
+
### `vouchers:update`
|
|
965
|
+
|
|
966
|
+
Update the service period (Leistungszeitraum) of a voucher. Options you leave out keep their stored value.
|
|
967
|
+
|
|
968
|
+
```bash
|
|
969
|
+
sevdesk vouchers:update [options]
|
|
970
|
+
```
|
|
971
|
+
|
|
972
|
+
**Options:**
|
|
973
|
+
|
|
974
|
+
- `--id`: ID of the voucher. If omitted, you will be prompted.
|
|
975
|
+
- `--delivery-date`: Start of the service period, or the single service date, as `dd.mm.yyyy` or Unix timestamp.
|
|
976
|
+
- `--delivery-date-until`: End of the service period as `dd.mm.yyyy` or Unix timestamp.
|
|
977
|
+
- `--clear-delivery-date-until`: Remove the end of the service period, leaving a single service date. Cannot be combined with `--delivery-date-until`. Defaults to `false`.
|
|
978
|
+
- `--json`: Output in JSON format.
|
|
979
|
+
|
|
949
980
|
## License
|
|
950
981
|
|
|
951
982
|
See [LICENSE](https://github.com/genz-its/sevdesk/blob/main/LICENSE).
|
package/dist/index.js
CHANGED
|
@@ -760,7 +760,7 @@ function formatContactName(contact) {
|
|
|
760
760
|
}
|
|
761
761
|
//#endregion
|
|
762
762
|
//#region src/commands/contacts/update.ts
|
|
763
|
-
var update_default = defineCommand({
|
|
763
|
+
var update_default$1 = defineCommand({
|
|
764
764
|
description: "Update a contact.",
|
|
765
765
|
options: defineOptions(z.object({
|
|
766
766
|
id: z.coerce.number().optional().describe("The contact ID. If omitted, you will be prompted."),
|
|
@@ -2107,6 +2107,64 @@ var list_default = defineCommand({
|
|
|
2107
2107
|
}
|
|
2108
2108
|
});
|
|
2109
2109
|
//#endregion
|
|
2110
|
+
//#region src/commands/vouchers/open.ts
|
|
2111
|
+
var open_default = defineCommand({
|
|
2112
|
+
description: "Move a draft voucher to the open status.",
|
|
2113
|
+
options: defineOptions(z.object({
|
|
2114
|
+
id: z.coerce.number().optional().describe("ID of the voucher."),
|
|
2115
|
+
json: z.boolean().default(false).describe("Output in JSON format.")
|
|
2116
|
+
})),
|
|
2117
|
+
action: async (options) => {
|
|
2118
|
+
const client = await requireClient();
|
|
2119
|
+
const voucherId = await requireNumberOption({
|
|
2120
|
+
value: options.id,
|
|
2121
|
+
requirement: "a voucher ID via --id",
|
|
2122
|
+
question: "Enter the voucher ID:"
|
|
2123
|
+
});
|
|
2124
|
+
const voucher = await client.vouchers.get({ voucherId });
|
|
2125
|
+
if (voucher.status !== "50" || voucher.enshrined) {
|
|
2126
|
+
consola.error(`Voucher ${voucherId} is not an unenshrined draft (status ${voucher.status ?? "-"}). Only drafts can be opened.`);
|
|
2127
|
+
process.exit(1);
|
|
2128
|
+
}
|
|
2129
|
+
const positions = await fetchAll((page) => client.vouchers.listPositions({
|
|
2130
|
+
voucherId,
|
|
2131
|
+
...page
|
|
2132
|
+
}));
|
|
2133
|
+
if (positions.some((position) => position.accountDatev === null)) {
|
|
2134
|
+
consola.error(`Voucher ${voucherId} has legacy bookkeeping-1.0 positions, which cannot be saved.`);
|
|
2135
|
+
process.exit(1);
|
|
2136
|
+
}
|
|
2137
|
+
const result = await client.vouchers.save({
|
|
2138
|
+
voucher: {
|
|
2139
|
+
id: voucherId,
|
|
2140
|
+
status: 100,
|
|
2141
|
+
creditDebit: voucher.creditDebit,
|
|
2142
|
+
taxRuleId: Number(voucher.taxRule.id),
|
|
2143
|
+
voucherType: voucher.voucherType
|
|
2144
|
+
},
|
|
2145
|
+
positions: positions.map(toUnchangedPositionInput)
|
|
2146
|
+
});
|
|
2147
|
+
if (options.json) {
|
|
2148
|
+
printJson({
|
|
2149
|
+
id: result.voucher.id,
|
|
2150
|
+
status: result.voucher.status
|
|
2151
|
+
});
|
|
2152
|
+
return;
|
|
2153
|
+
}
|
|
2154
|
+
consola.success(`Opened voucher ${result.voucher.id}. New status: ${result.voucher.status ?? "-"}.`);
|
|
2155
|
+
}
|
|
2156
|
+
});
|
|
2157
|
+
function toUnchangedPositionInput(position) {
|
|
2158
|
+
return {
|
|
2159
|
+
id: Number(position.id),
|
|
2160
|
+
accountDatevId: Number(position.accountDatev?.id),
|
|
2161
|
+
taxRate: Number(position.taxRate),
|
|
2162
|
+
net: position.net === "1",
|
|
2163
|
+
sumNet: Number(position.sumNet),
|
|
2164
|
+
sumGross: Number(position.sumGross)
|
|
2165
|
+
};
|
|
2166
|
+
}
|
|
2167
|
+
//#endregion
|
|
2110
2168
|
//#region src/commands/vouchers/positions.ts
|
|
2111
2169
|
var positions_default = defineCommand({
|
|
2112
2170
|
description: "List voucher positions.",
|
|
@@ -2209,6 +2267,40 @@ var reset_to_open_default = defineCommand({
|
|
|
2209
2267
|
}
|
|
2210
2268
|
});
|
|
2211
2269
|
//#endregion
|
|
2270
|
+
//#region src/commands/vouchers/update.ts
|
|
2271
|
+
var update_default = defineCommand({
|
|
2272
|
+
description: "Update the service period of a voucher.",
|
|
2273
|
+
options: defineOptions(z.object({
|
|
2274
|
+
id: z.coerce.number().optional().describe("ID of the voucher."),
|
|
2275
|
+
deliveryDate: z.string().optional().describe("Start of the service period, or the single service date, as dd.mm.yyyy or Unix timestamp."),
|
|
2276
|
+
deliveryDateUntil: z.string().optional().describe("End of the service period as dd.mm.yyyy or Unix timestamp."),
|
|
2277
|
+
clearDeliveryDateUntil: z.boolean().default(false).describe("Remove the end of the service period, leaving a single service date."),
|
|
2278
|
+
json: z.boolean().default(false).describe("Output in JSON format.")
|
|
2279
|
+
})),
|
|
2280
|
+
action: async (options) => {
|
|
2281
|
+
if (options.clearDeliveryDateUntil && options.deliveryDateUntil !== void 0) {
|
|
2282
|
+
consola.error("You cannot use --delivery-date-until together with --clear-delivery-date-until.");
|
|
2283
|
+
process.exit(1);
|
|
2284
|
+
}
|
|
2285
|
+
const client = await requireClient();
|
|
2286
|
+
const voucherId = await requireNumberOption({
|
|
2287
|
+
value: options.id,
|
|
2288
|
+
requirement: "a voucher ID via --id",
|
|
2289
|
+
question: "Enter the voucher ID:"
|
|
2290
|
+
});
|
|
2291
|
+
const voucher = await client.vouchers.update({
|
|
2292
|
+
voucherId,
|
|
2293
|
+
deliveryDate: options.deliveryDate,
|
|
2294
|
+
deliveryDateUntil: options.clearDeliveryDateUntil ? null : options.deliveryDateUntil
|
|
2295
|
+
});
|
|
2296
|
+
if (options.json) {
|
|
2297
|
+
printJson(voucher);
|
|
2298
|
+
return;
|
|
2299
|
+
}
|
|
2300
|
+
consola.success(`Updated voucher ${voucher.id}.`);
|
|
2301
|
+
}
|
|
2302
|
+
});
|
|
2303
|
+
//#endregion
|
|
2212
2304
|
//#region src/index.ts
|
|
2213
2305
|
const config = defineConfig({
|
|
2214
2306
|
meta: {
|
|
@@ -2235,7 +2327,7 @@ const config = defineConfig({
|
|
|
2235
2327
|
"contacts:delete-address": delete_address_default,
|
|
2236
2328
|
"contacts:get": get_default$6,
|
|
2237
2329
|
"contacts:list": list_default$7,
|
|
2238
|
-
"contacts:update": update_default,
|
|
2330
|
+
"contacts:update": update_default$1,
|
|
2239
2331
|
"contacts:update-address": update_address_default,
|
|
2240
2332
|
"credit-notes:get": get_default$5,
|
|
2241
2333
|
"credit-notes:list": list_default$6,
|
|
@@ -2266,9 +2358,11 @@ const config = defineConfig({
|
|
|
2266
2358
|
"vouchers:enshrine": enshrine_default,
|
|
2267
2359
|
"vouchers:get": get_default,
|
|
2268
2360
|
"vouchers:list": list_default,
|
|
2361
|
+
"vouchers:open": open_default,
|
|
2269
2362
|
"vouchers:positions": positions_default,
|
|
2270
2363
|
"vouchers:reset-to-draft": reset_to_draft_default,
|
|
2271
|
-
"vouchers:reset-to-open": reset_to_open_default
|
|
2364
|
+
"vouchers:reset-to-open": reset_to_open_default,
|
|
2365
|
+
"vouchers:update": update_default
|
|
2272
2366
|
}
|
|
2273
2367
|
});
|
|
2274
2368
|
try {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["accountsDatevGet","accountsDatevList","accountsBalance","accountsCreateClearing","accountsCreateFileImport","accountsGet","accountsList","contactsAddAddress","contactsAddEmail","contactsAddPhone","contactsCreate","contactsDelete","contactsDeleteAddress","contactsGet","contactsList","contactsUpdate","contactsUpdateAddress","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","vouchersDocument","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/pagination.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/delete-address.ts","../src/commands/contacts/get.ts","../src/commands/contacts/list.ts","../src/commands/contacts/update.ts","../src/commands/contacts/update-address.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/document.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\n/**\n * Formats a service period (Leistungszeitraum) as plain dates, collapsing to a\n * single date when there is no end. The API returns local datetimes, so the\n * date part is sliced off instead of parsed, which would shift the day across\n * the UTC boundary.\n */\nexport function servicePeriodLabel(\n from: string | null | undefined,\n until: string | null | undefined,\n): string {\n if (!from) {\n return '';\n }\n const start = from.slice(0, 10);\n return until ? `${start} – ${until.slice(0, 10)}` : start;\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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","/**\n * Rows requested per page. The sevdesk API defaults to 100 when no `limit` is\n * sent, which is why an unpaginated list silently stops at 100 rows.\n */\nconst PAGE_SIZE = 1000;\n\nexport interface FetchAllOptions<T> {\n /** Maximum number of rows to return, counted after `keep`. */\n limit?: number;\n /** Number of rows to skip before the first page. */\n offset?: number;\n /** Client-side filter for endpoints whose own filters are unreliable. */\n keep?: (item: T) => boolean;\n}\n\n/**\n * Collects rows of a list endpoint across as many pages as needed.\n *\n * Paging stops on an empty page rather than a short one, so a server-side cap\n * on `limit` cannot truncate the result the way the API default does.\n */\nexport async function fetchAll<T>(\n fetchPage: (page: { limit: number; offset: number }) => Promise<T[]>,\n options: FetchAllOptions<T> = {},\n): Promise<T[]> {\n const { limit, keep } = options;\n const items: T[] = [];\n let offset = options.offset ?? 0;\n while (limit === undefined || items.length < limit) {\n const page = await fetchPage({\n limit: pageSize(limit, items.length, keep),\n offset,\n });\n if (page.length === 0) {\n break;\n }\n offset += page.length;\n items.push(...(keep === undefined ? page : page.filter(keep)));\n }\n return limit === undefined ? items : items.slice(0, limit);\n}\n\n/**\n * Without a `keep` filter every row counts towards `limit`, so a small `limit`\n * only needs a correspondingly small page.\n */\nfunction pageSize<T>(\n limit: number | undefined,\n collected: number,\n keep: FetchAllOptions<T>['keep'],\n): number {\n if (limit === undefined || keep !== undefined) {\n return PAGE_SIZE;\n }\n return Math.min(limit - collected, PAGE_SIZE);\n}\n","import { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of accounts to return. Defaults to all of them.',\n ),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of accounts to skip before filtering.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const needle = options.nameLike?.toLowerCase();\n const filtering = options.number !== undefined || needle !== undefined;\n const accounts = await fetchAll((page) => client.accountsDatev.list(page), {\n limit: options.limit,\n offset: options.offset,\n keep: filtering\n ? (account) =>\n (options.number === undefined ||\n account.number === options.number) &&\n (needle === undefined ||\n (account.name ?? '').toLowerCase().includes(needle))\n : undefined,\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'The maximum number of check accounts to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) => client.checkAccounts.list(page),\n { limit: options.limit, 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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Delete an address of a contact.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe(\n 'The contact address ID, as shown by contacts:get. If omitted, you will be prompted.',\n ),\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 contactAddressId = await requireNumberOption({\n value: options.id,\n requirement: 'a contact address ID via --id',\n question: 'Enter the contact address ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Delete contact address ${contactAddressId}?`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n await client.contactAddresses.delete({ contactAddressId });\n if (options.json) {\n printJson({ deleted: true });\n return;\n }\n consola.success('Contact address deleted.');\n },\n});\n","import type { CommunicationWay, ContactAddress } from '@genz-its/sevdesk-sdk';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\nimport { fetchAll } from '../../pagination';\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 /** The `/ContactAddress` endpoint cannot filter by contact, so we filter here. */\n const addresses = await fetchAll(\n (page) => client.contactAddresses.list(page),\n { keep: (address) => address.contact.id === String(contactId) },\n );\n const communicationWays = await fetchAll((page) =>\n client.communicationWays.list({ contactId, ...page }),\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\n/** The id is shown because contacts:update-address and contacts:delete-address need it. */\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 `#${address.id} ${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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of contacts to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n client.contacts.list({\n name: options.name,\n customerNumber: options.customerNumber,\n depth: toDepth(options.depth),\n categoryId: options.category,\n ...page,\n }),\n { limit: options.limit, 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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Update an address of a contact.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe(\n 'The contact address ID, as shown by contacts:get. If omitted, you will be prompted.',\n ),\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.',\n ),\n category: z.coerce\n .number()\n .optional()\n .describe('ID of the address category.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const fields = {\n street: options.street,\n zip: options.zip,\n city: options.city,\n countryId: options.country,\n categoryId: options.category,\n };\n if (Object.values(fields).every((value) => value === undefined)) {\n consola.error(\n 'You must provide at least one of --street, --zip, --city, --country or --category.',\n );\n process.exit(1);\n }\n const client = await requireClient();\n const contactAddressId = await requireNumberOption({\n value: options.id,\n requirement: 'a contact address ID via --id',\n question: 'Enter the contact address ID:',\n });\n const address = await client.contactAddresses.update({\n contactAddressId,\n ...fields,\n });\n if (options.json) {\n printJson(address);\n return;\n }\n consola.success(`Updated contact address ${address.id}.`);\n },\n});\n","import { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { contactLabel, printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of credit notes to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n 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 embed: ['contact'],\n ...page,\n }),\n { limit: options.limit, offset: options.offset },\n );\n if (options.json) {\n printJson(creditNotes);\n return;\n }\n if (creditNotes.length === 0) {\n consola.info('No credit notes found.');\n return;\n }\n printTable(\n creditNotes.map((creditNote) => ({\n id: creditNote.id,\n number: creditNote.creditNoteNumber ?? '',\n date: creditNote.creditNoteDate,\n contact: contactLabel(creditNote.contact),\n gross: creditNote.sumGross,\n status: creditNote.status,\n })),\n );\n },\n});\n","import { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { z } from 'zod';\nimport { ZodlineError } from 'zodline';\n\nexport function formatError(error: unknown): string {\n if (error instanceof ZodlineError) {\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { contactLabel, printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of invoices to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n 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 embed: ['contact'],\n ...page,\n }),\n { limit: options.limit, offset: options.offset },\n );\n if (options.json) {\n printJson(invoices);\n return;\n }\n if (invoices.length === 0) {\n consola.info('No invoices found.');\n return;\n }\n printTable(\n invoices.map((invoice) => ({\n id: invoice.id,\n number: invoice.invoiceNumber ?? '',\n date: invoice.invoiceDate,\n contact: contactLabel(invoice.contact),\n gross: invoice.sumGross,\n status: invoice.status,\n })),\n );\n },\n});\n","import { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { defineCommand } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { contactLabel, printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of orders to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n 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 embed: ['contact'],\n ...page,\n }),\n { limit: options.limit, offset: options.offset },\n );\n if (options.json) {\n printJson(orders);\n return;\n }\n if (orders.length === 0) {\n consola.info('No orders found.');\n return;\n }\n printTable(\n orders.map((order) => ({\n id: order.id,\n number: order.orderNumber,\n date: order.orderDate,\n contact: contactLabel(order.contact),\n gross: order.sumGross,\n status: order.status,\n })),\n );\n },\n});\n","import { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of parts to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n client.parts.list({\n name: options.name,\n partNumber: options.partNumber,\n ...page,\n }),\n { limit: options.limit, 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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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. Defaults to all of them.'),\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 fetchAll((page) => client.tags.list(page), {\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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.',\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(\n 'The maximum number of transactions to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n client.transactions.list({\n checkAccountId: options.checkAccount,\n startDate: options.startDate,\n endDate: options.endDate,\n payeePayerName: options.payee,\n paymtPurpose: options.purpose,\n ...page,\n }),\n {\n limit: options.limit,\n offset: options.offset,\n keep: options.unbooked\n ? (transaction) => transaction.status === '100'\n : undefined,\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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(\n 'Amount to book. Can also be a partial amount. The sign is derived from the voucher, so pass the amount as a positive number.',\n ),\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 voucher = await client.vouchers.get({ voucherId });\n const result = await client.vouchers.book({\n voucherId,\n amount:\n voucher.creditDebit === 'C' ? -Math.abs(amount) : Math.abs(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 { consola } from 'consola';\nimport { readFile } from 'node:fs/promises';\nimport { basename } from 'node:path';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 deliveryDate: z\n .string()\n .optional()\n .describe(\n 'Start of the service period, or the single service date, as dd.mm.yyyy or Unix timestamp.',\n ),\n deliveryDateUntil: z\n .string()\n .optional()\n .describe(\n 'End of the service period as dd.mm.yyyy or Unix timestamp. Requires --delivery-date.',\n ),\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 if (\n options.deliveryDateUntil !== undefined &&\n options.deliveryDate === undefined\n ) {\n consola.error(\n 'You must provide --delivery-date when using --delivery-date-until.',\n );\n process.exit(1);\n }\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 deliveryDate: options.deliveryDate,\n deliveryDateUntil: options.deliveryDateUntil,\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { basename, resolve } from 'node:path';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Download the document attached to a voucher.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the voucher. If omitted, you will be prompted.'),\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the document to. Defaults to the file name reported by the API. Existing files are never overwritten.',\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 voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher ID via --id',\n question: 'Enter the voucher ID:',\n });\n const voucher = await client.vouchers.get({ voucherId });\n if (!voucher.document) {\n consola.error(`Voucher ${voucherId} has no document attached.`);\n process.exit(1);\n }\n const file = await client.documents.download({\n documentId: Number(voucher.document.id),\n });\n // basename() keeps a reported name like `../x.pdf` inside the working directory.\n const filename = file.filename\n ? basename(file.filename)\n : `voucher-${voucherId}.${file.mimeType.split('/')[1]}`;\n const path = resolve(options.output ?? filename);\n // Decode unless explicitly flagged as raw: the flag's spelling is unverified.\n const content =\n file.base64Encoded === false\n ? file.content\n : Buffer.from(file.content, 'base64');\n await writeFile(path, content, { flag: 'wx' });\n if (options.json) {\n printJson({ filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { contactLabel, printJson, servicePeriodLabel } 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 `Service period: ${\n servicePeriodLabel(voucher.deliveryDate, voucher.deliveryDateUntil) ||\n '-'\n }`,\n );\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport {\n contactLabel,\n printJson,\n printTable,\n servicePeriodLabel,\n} from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of vouchers to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n 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 embed: ['supplier'],\n ...page,\n }),\n { limit: options.limit, offset: options.offset },\n );\n if (options.json) {\n printJson(vouchers);\n return;\n }\n if (vouchers.length === 0) {\n consola.info('No vouchers found.');\n return;\n }\n printTable(\n vouchers.map((voucher) => ({\n id: voucher.id,\n date: voucher.voucherDate ?? '',\n servicePeriod: servicePeriodLabel(\n voucher.deliveryDate,\n voucher.deliveryDateUntil,\n ),\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of positions to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n client.vouchers.listPositions({\n voucherId: options.voucher,\n embed: ['accountDatev'],\n ...page,\n }),\n { limit: options.limit, offset: options.offset },\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { defineConfig, processConfig } from 'zodline';\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 contactsDeleteAddress from './commands/contacts/delete-address';\nimport contactsGet from './commands/contacts/get';\nimport contactsList from './commands/contacts/list';\nimport contactsUpdate from './commands/contacts/update';\nimport contactsUpdateAddress from './commands/contacts/update-address';\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 vouchersDocument from './commands/vouchers/document';\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:delete-address': contactsDeleteAddress,\n 'contacts:get': contactsGet,\n 'contacts:list': contactsList,\n 'contacts:update': contactsUpdate,\n 'contacts:update-address': contactsUpdateAddress,\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:document': vouchersDocument,\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;AACv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A;EACtB,uBAAuBC;EACvB,oBAAoBC;EACpB,4BAA4BC;EAC5B,+BAA+BC;EAC/B,gBAAgBC;EAChB,iBAAiBC;EACjB,wBAAwBC;EACxB,sBAAsBC;EACtB,sBAAsBC;EACtB,mBAAmBC;EACnB,mBAAmBC;EACnB,2BAA2BC;EAC3B,gBAAgBC;EAChB,iBAAiBC;EACjB,mBAAmBC;EACnB,2BAA2BC;EAC3B,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,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","contactsDeleteAddress","contactsGet","contactsList","contactsUpdate","contactsUpdateAddress","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","vouchersDocument","vouchersEnshrine","vouchersGet","vouchersList","vouchersOpen","vouchersPositions","vouchersResetToDraft","vouchersResetToOpen","vouchersUpdate"],"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/pagination.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/delete-address.ts","../src/commands/contacts/get.ts","../src/commands/contacts/list.ts","../src/commands/contacts/update.ts","../src/commands/contacts/update-address.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/document.ts","../src/commands/vouchers/enshrine.ts","../src/commands/vouchers/get.ts","../src/commands/vouchers/list.ts","../src/commands/vouchers/open.ts","../src/commands/vouchers/positions.ts","../src/commands/vouchers/reset-to-draft.ts","../src/commands/vouchers/reset-to-open.ts","../src/commands/vouchers/update.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\n/**\n * Formats a service period (Leistungszeitraum) as plain dates, collapsing to a\n * single date when there is no end. The API returns local datetimes, so the\n * date part is sliced off instead of parsed, which would shift the day across\n * the UTC boundary.\n */\nexport function servicePeriodLabel(\n from: string | null | undefined,\n until: string | null | undefined,\n): string {\n if (!from) {\n return '';\n }\n const start = from.slice(0, 10);\n return until ? `${start} – ${until.slice(0, 10)}` : start;\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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","/**\n * Rows requested per page. The sevdesk API defaults to 100 when no `limit` is\n * sent, which is why an unpaginated list silently stops at 100 rows.\n */\nconst PAGE_SIZE = 1000;\n\nexport interface FetchAllOptions<T> {\n /** Maximum number of rows to return, counted after `keep`. */\n limit?: number;\n /** Number of rows to skip before the first page. */\n offset?: number;\n /** Client-side filter for endpoints whose own filters are unreliable. */\n keep?: (item: T) => boolean;\n}\n\n/**\n * Collects rows of a list endpoint across as many pages as needed.\n *\n * Paging stops on an empty page rather than a short one, so a server-side cap\n * on `limit` cannot truncate the result the way the API default does.\n */\nexport async function fetchAll<T>(\n fetchPage: (page: { limit: number; offset: number }) => Promise<T[]>,\n options: FetchAllOptions<T> = {},\n): Promise<T[]> {\n const { limit, keep } = options;\n const items: T[] = [];\n let offset = options.offset ?? 0;\n while (limit === undefined || items.length < limit) {\n const page = await fetchPage({\n limit: pageSize(limit, items.length, keep),\n offset,\n });\n if (page.length === 0) {\n break;\n }\n offset += page.length;\n items.push(...(keep === undefined ? page : page.filter(keep)));\n }\n return limit === undefined ? items : items.slice(0, limit);\n}\n\n/**\n * Without a `keep` filter every row counts towards `limit`, so a small `limit`\n * only needs a correspondingly small page.\n */\nfunction pageSize<T>(\n limit: number | undefined,\n collected: number,\n keep: FetchAllOptions<T>['keep'],\n): number {\n if (limit === undefined || keep !== undefined) {\n return PAGE_SIZE;\n }\n return Math.min(limit - collected, PAGE_SIZE);\n}\n","import { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of accounts to return. Defaults to all of them.',\n ),\n offset: z.coerce\n .number()\n .optional()\n .describe('Number of accounts to skip before filtering.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const needle = options.nameLike?.toLowerCase();\n const filtering = options.number !== undefined || needle !== undefined;\n const accounts = await fetchAll((page) => client.accountsDatev.list(page), {\n limit: options.limit,\n offset: options.offset,\n keep: filtering\n ? (account) =>\n (options.number === undefined ||\n account.number === options.number) &&\n (needle === undefined ||\n (account.name ?? '').toLowerCase().includes(needle))\n : undefined,\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'The maximum number of check accounts to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) => client.checkAccounts.list(page),\n { limit: options.limit, 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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { confirmOrAbort, requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Delete an address of a contact.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe(\n 'The contact address ID, as shown by contacts:get. If omitted, you will be prompted.',\n ),\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 contactAddressId = await requireNumberOption({\n value: options.id,\n requirement: 'a contact address ID via --id',\n question: 'Enter the contact address ID:',\n });\n const confirmed = await confirmOrAbort({\n message: `Delete contact address ${contactAddressId}?`,\n yes: options.yes,\n initial: false,\n });\n if (!confirmed) {\n return;\n }\n await client.contactAddresses.delete({ contactAddressId });\n if (options.json) {\n printJson({ deleted: true });\n return;\n }\n consola.success('Contact address deleted.');\n },\n});\n","import type { CommunicationWay, ContactAddress } from '@genz-its/sevdesk-sdk';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\nimport { fetchAll } from '../../pagination';\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 /** The `/ContactAddress` endpoint cannot filter by contact, so we filter here. */\n const addresses = await fetchAll(\n (page) => client.contactAddresses.list(page),\n { keep: (address) => address.contact.id === String(contactId) },\n );\n const communicationWays = await fetchAll((page) =>\n client.communicationWays.list({ contactId, ...page }),\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\n/** The id is shown because contacts:update-address and contacts:delete-address need it. */\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 `#${address.id} ${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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of contacts to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n client.contacts.list({\n name: options.name,\n customerNumber: options.customerNumber,\n depth: toDepth(options.depth),\n categoryId: options.category,\n ...page,\n }),\n { limit: options.limit, 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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Update an address of a contact.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe(\n 'The contact address ID, as shown by contacts:get. If omitted, you will be prompted.',\n ),\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.',\n ),\n category: z.coerce\n .number()\n .optional()\n .describe('ID of the address category.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const fields = {\n street: options.street,\n zip: options.zip,\n city: options.city,\n countryId: options.country,\n categoryId: options.category,\n };\n if (Object.values(fields).every((value) => value === undefined)) {\n consola.error(\n 'You must provide at least one of --street, --zip, --city, --country or --category.',\n );\n process.exit(1);\n }\n const client = await requireClient();\n const contactAddressId = await requireNumberOption({\n value: options.id,\n requirement: 'a contact address ID via --id',\n question: 'Enter the contact address ID:',\n });\n const address = await client.contactAddresses.update({\n contactAddressId,\n ...fields,\n });\n if (options.json) {\n printJson(address);\n return;\n }\n consola.success(`Updated contact address ${address.id}.`);\n },\n});\n","import { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { contactLabel, printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of credit notes to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n 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 embed: ['contact'],\n ...page,\n }),\n { limit: options.limit, offset: options.offset },\n );\n if (options.json) {\n printJson(creditNotes);\n return;\n }\n if (creditNotes.length === 0) {\n consola.info('No credit notes found.');\n return;\n }\n printTable(\n creditNotes.map((creditNote) => ({\n id: creditNote.id,\n number: creditNote.creditNoteNumber ?? '',\n date: creditNote.creditNoteDate,\n contact: contactLabel(creditNote.contact),\n gross: creditNote.sumGross,\n status: creditNote.status,\n })),\n );\n },\n});\n","import { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { z } from 'zod';\nimport { ZodlineError } from 'zodline';\n\nexport function formatError(error: unknown): string {\n if (error instanceof ZodlineError) {\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { contactLabel, printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of invoices to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n 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 embed: ['contact'],\n ...page,\n }),\n { limit: options.limit, offset: options.offset },\n );\n if (options.json) {\n printJson(invoices);\n return;\n }\n if (invoices.length === 0) {\n consola.info('No invoices found.');\n return;\n }\n printTable(\n invoices.map((invoice) => ({\n id: invoice.id,\n number: invoice.invoiceNumber ?? '',\n date: invoice.invoiceDate,\n contact: contactLabel(invoice.contact),\n gross: invoice.sumGross,\n status: invoice.status,\n })),\n );\n },\n});\n","import { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { defineCommand } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { contactLabel, printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of orders to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n 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 embed: ['contact'],\n ...page,\n }),\n { limit: options.limit, offset: options.offset },\n );\n if (options.json) {\n printJson(orders);\n return;\n }\n if (orders.length === 0) {\n consola.info('No orders found.');\n return;\n }\n printTable(\n orders.map((order) => ({\n id: order.id,\n number: order.orderNumber,\n date: order.orderDate,\n contact: contactLabel(order.contact),\n gross: order.sumGross,\n status: order.status,\n })),\n );\n },\n});\n","import { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of parts to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n client.parts.list({\n name: options.name,\n partNumber: options.partNumber,\n ...page,\n }),\n { limit: options.limit, 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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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. Defaults to all of them.'),\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 fetchAll((page) => client.tags.list(page), {\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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.',\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(\n 'The maximum number of transactions to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n client.transactions.list({\n checkAccountId: options.checkAccount,\n startDate: options.startDate,\n endDate: options.endDate,\n payeePayerName: options.payee,\n paymtPurpose: options.purpose,\n ...page,\n }),\n {\n limit: options.limit,\n offset: options.offset,\n keep: options.unbooked\n ? (transaction) => transaction.status === '100'\n : undefined,\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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(\n 'Amount to book. Can also be a partial amount. The sign is derived from the voucher, so pass the amount as a positive number.',\n ),\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 voucher = await client.vouchers.get({ voucherId });\n const result = await client.vouchers.book({\n voucherId,\n amount:\n voucher.creditDebit === 'C' ? -Math.abs(amount) : Math.abs(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 { consola } from 'consola';\nimport { readFile } from 'node:fs/promises';\nimport { basename } from 'node:path';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 deliveryDate: z\n .string()\n .optional()\n .describe(\n 'Start of the service period, or the single service date, as dd.mm.yyyy or Unix timestamp.',\n ),\n deliveryDateUntil: z\n .string()\n .optional()\n .describe(\n 'End of the service period as dd.mm.yyyy or Unix timestamp. Requires --delivery-date.',\n ),\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 if (\n options.deliveryDateUntil !== undefined &&\n options.deliveryDate === undefined\n ) {\n consola.error(\n 'You must provide --delivery-date when using --delivery-date-until.',\n );\n process.exit(1);\n }\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 deliveryDate: options.deliveryDate,\n deliveryDateUntil: options.deliveryDateUntil,\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 { consola } from 'consola';\nimport { writeFile } from 'node:fs/promises';\nimport { basename, resolve } from 'node:path';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Download the document attached to a voucher.',\n options: defineOptions(\n z.object({\n id: z.coerce\n .number()\n .optional()\n .describe('ID of the voucher. If omitted, you will be prompted.'),\n output: z\n .string()\n .optional()\n .describe(\n 'Path to write the document to. Defaults to the file name reported by the API. Existing files are never overwritten.',\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 voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher ID via --id',\n question: 'Enter the voucher ID:',\n });\n const voucher = await client.vouchers.get({ voucherId });\n if (!voucher.document) {\n consola.error(`Voucher ${voucherId} has no document attached.`);\n process.exit(1);\n }\n const file = await client.documents.download({\n documentId: Number(voucher.document.id),\n });\n // basename() keeps a reported name like `../x.pdf` inside the working directory.\n const filename = file.filename\n ? basename(file.filename)\n : `voucher-${voucherId}.${file.mimeType.split('/')[1]}`;\n const path = resolve(options.output ?? filename);\n // Decode unless explicitly flagged as raw: the flag's spelling is unverified.\n const content =\n file.base64Encoded === false\n ? file.content\n : Buffer.from(file.content, 'base64');\n await writeFile(path, content, { flag: 'wx' });\n if (options.json) {\n printJson({ filename, path });\n return;\n }\n consola.success(`Saved ${path}.`);\n },\n});\n","import { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { contactLabel, printJson, servicePeriodLabel } 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 `Service period: ${\n servicePeriodLabel(voucher.deliveryDate, voucher.deliveryDateUntil) ||\n '-'\n }`,\n );\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport {\n contactLabel,\n printJson,\n printTable,\n servicePeriodLabel,\n} from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of vouchers to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n 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 embed: ['supplier'],\n ...page,\n }),\n { limit: options.limit, offset: options.offset },\n );\n if (options.json) {\n printJson(vouchers);\n return;\n }\n if (vouchers.length === 0) {\n consola.info('No vouchers found.');\n return;\n }\n printTable(\n vouchers.map((voucher) => ({\n id: voucher.id,\n date: voucher.voucherDate ?? '',\n servicePeriod: servicePeriodLabel(\n voucher.deliveryDate,\n voucher.deliveryDateUntil,\n ),\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 { VoucherPosition } from '@genz-its/sevdesk-sdk';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\nimport { fetchAll } from '../../pagination';\n\nexport default defineCommand({\n description: 'Move a draft voucher to the open status.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n const client = await requireClient();\n const voucherId = await requireNumberOption({\n value: options.id,\n requirement: 'a voucher ID via --id',\n question: 'Enter the voucher ID:',\n });\n const voucher = await client.vouchers.get({ voucherId });\n if (voucher.status !== '50' || voucher.enshrined) {\n consola.error(\n `Voucher ${voucherId} is not an unenshrined draft (status ${voucher.status ?? '-'}). Only drafts can be opened.`,\n );\n process.exit(1);\n }\n const positions = await fetchAll((page) =>\n client.vouchers.listPositions({ voucherId, ...page }),\n );\n if (positions.some((position) => position.accountDatev === null)) {\n consola.error(\n `Voucher ${voucherId} has legacy bookkeeping-1.0 positions, which cannot be saved.`,\n );\n process.exit(1);\n }\n const result = await client.vouchers.save({\n voucher: {\n id: voucherId,\n status: 100,\n creditDebit: voucher.creditDebit as 'C' | 'D',\n taxRuleId: Number(voucher.taxRule.id),\n voucherType: voucher.voucherType as 'VOU' | 'RV',\n },\n positions: positions.map(toUnchangedPositionInput),\n });\n if (options.json) {\n printJson({ id: result.voucher.id, status: result.voucher.status });\n return;\n }\n consola.success(\n `Opened voucher ${result.voucher.id}. New status: ${result.voucher.status ?? '-'}.`,\n );\n },\n});\n\nfunction toUnchangedPositionInput(position: VoucherPosition) {\n return {\n id: Number(position.id),\n accountDatevId: Number(position.accountDatev?.id),\n taxRate: Number(position.taxRate),\n net: position.net === '1',\n sumNet: Number(position.sumNet),\n sumGross: Number(position.sumGross),\n };\n}\n","import type { ModelRefResponse } from '@genz-its/sevdesk-sdk';\nimport { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { printJson, printTable } from '../../output';\nimport { fetchAll } from '../../pagination';\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(\n 'Maximum number of positions to return. Defaults to all of them.',\n ),\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 fetchAll(\n (page) =>\n client.vouchers.listPositions({\n voucherId: options.voucher,\n embed: ['accountDatev'],\n ...page,\n }),\n { limit: options.limit, offset: options.offset },\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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 { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\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","import { consola } from 'consola';\nimport { z } from 'zod';\nimport { defineCommand, defineOptions } from 'zodline';\nimport { requireClient } from '../../client';\nimport { requireNumberOption } from '../../options';\nimport { printJson } from '../../output';\n\nexport default defineCommand({\n description: 'Update the service period of a voucher.',\n options: defineOptions(\n z.object({\n id: z.coerce.number().optional().describe('ID of the voucher.'),\n deliveryDate: z\n .string()\n .optional()\n .describe(\n 'Start of the service period, or the single service date, as dd.mm.yyyy or Unix timestamp.',\n ),\n deliveryDateUntil: z\n .string()\n .optional()\n .describe('End of the service period as dd.mm.yyyy or Unix timestamp.'),\n clearDeliveryDateUntil: z\n .boolean()\n .default(false)\n .describe(\n 'Remove the end of the service period, leaving a single service date.',\n ),\n json: z.boolean().default(false).describe('Output in JSON format.'),\n }),\n ),\n action: async (options) => {\n if (\n options.clearDeliveryDateUntil &&\n options.deliveryDateUntil !== undefined\n ) {\n consola.error(\n 'You cannot use --delivery-date-until together with --clear-delivery-date-until.',\n );\n process.exit(1);\n }\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.update({\n voucherId,\n deliveryDate: options.deliveryDate,\n deliveryDateUntil: options.clearDeliveryDateUntil\n ? null\n : options.deliveryDateUntil,\n });\n if (options.json) {\n printJson(voucher);\n return;\n }\n consola.success(`Updated voucher ${voucher.id}.`);\n },\n});\n","#!/usr/bin/env node\nimport { consola } from 'consola';\nimport { defineConfig, processConfig } from 'zodline';\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 contactsDeleteAddress from './commands/contacts/delete-address';\nimport contactsGet from './commands/contacts/get';\nimport contactsList from './commands/contacts/list';\nimport contactsUpdate from './commands/contacts/update';\nimport contactsUpdateAddress from './commands/contacts/update-address';\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 vouchersDocument from './commands/vouchers/document';\nimport vouchersEnshrine from './commands/vouchers/enshrine';\nimport vouchersGet from './commands/vouchers/get';\nimport vouchersList from './commands/vouchers/list';\nimport vouchersOpen from './commands/vouchers/open';\nimport vouchersPositions from './commands/vouchers/positions';\nimport vouchersResetToDraft from './commands/vouchers/reset-to-draft';\nimport vouchersResetToOpen from './commands/vouchers/reset-to-open';\nimport vouchersUpdate from './commands/vouchers/update';\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:delete-address': contactsDeleteAddress,\n 'contacts:get': contactsGet,\n 'contacts:list': contactsList,\n 'contacts:update': contactsUpdate,\n 'contacts:update-address': contactsUpdateAddress,\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:document': vouchersDocument,\n 'vouchers:enshrine': vouchersEnshrine,\n 'vouchers:get': vouchersGet,\n 'vouchers:list': vouchersList,\n 'vouchers:open': vouchersOpen,\n 'vouchers:positions': vouchersPositions,\n 'vouchers:reset-to-draft': vouchersResetToDraft,\n 'vouchers:reset-to-open': vouchersResetToOpen,\n 'vouchers:update': vouchersUpdate,\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,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cC;EACd,eAAeC;EACf,eAAeC;EACf,aAAaC;EACb,uBAAuBC;EACvB,oBAAoBC;EACpB,qBAAqBC;EACrB,iBAAiBC;EACjB,mBAAmBC;EACnB,qBAAqBC;EACrB,qBAAqBC;EACrB,gBAAgBC;EAChB,iBAAiBC;EACjB,iBAAiBC;EACjB,sBAAsBC;EACtB,2BAA2BC;EAC3B,0BAA0BC;EAC1B,mBAAmBC;CACrB;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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genz-its/sevdesk-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
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.
|
|
19
|
+
"@genz-its/sevdesk-sdk": "0.1.7",
|
|
20
20
|
"consola": "3.4.2",
|
|
21
21
|
"zod": "4.4.3",
|
|
22
22
|
"zodline": "0.3.0"
|