@aderis-erp/cli 1.0.4 → 1.0.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.
Files changed (123) hide show
  1. package/dist/commands/access-groups.js +5 -5
  2. package/dist/commands/{access-groups 3.d.ts → account-transaction-allocations.d.ts} +1 -1
  3. package/dist/commands/{async-endpoints-internal.js → account-transaction-allocations.js} +19 -15
  4. package/dist/commands/account-transactions.js +7 -7
  5. package/dist/commands/accounts.js +5 -5
  6. package/dist/commands/agent-runs.js +5 -5
  7. package/dist/commands/audit-log.js +5 -5
  8. package/dist/commands/auth/login.js +1 -2
  9. package/dist/commands/auth/tenant.d.ts +1 -1
  10. package/dist/commands/auth/tenant.js +11 -11
  11. package/dist/commands/auth.js +1 -1
  12. package/dist/commands/bank-accounts.js +5 -5
  13. package/dist/commands/bank-integrations.js +5 -5
  14. package/dist/commands/business-partners---contacts.js +5 -5
  15. package/dist/commands/business-partners.js +5 -5
  16. package/dist/commands/credit-card-accounts.js +5 -5
  17. package/dist/commands/documents.js +5 -5
  18. package/dist/commands/dunning-configs.js +5 -5
  19. package/dist/commands/dunning-reminders.js +5 -5
  20. package/dist/commands/dunning-runs.js +5 -5
  21. package/dist/commands/employees.js +5 -5
  22. package/dist/commands/event-processor-mappings.js +5 -5
  23. package/dist/commands/files-internal.js +5 -5
  24. package/dist/commands/health.js +5 -5
  25. package/dist/commands/inbox.js +5 -5
  26. package/dist/commands/integrations.js +5 -5
  27. package/dist/commands/item-categories.js +5 -5
  28. package/dist/commands/items.js +5 -5
  29. package/dist/commands/journal-lines.js +5 -5
  30. package/dist/commands/journals.js +5 -5
  31. package/dist/commands/ledgers.js +5 -5
  32. package/dist/commands/office-locations.js +5 -5
  33. package/dist/commands/payment-method-ledger-mappings.js +5 -5
  34. package/dist/commands/payment-methods.js +5 -5
  35. package/dist/commands/payment-runs.js +5 -5
  36. package/dist/commands/payment-terms.js +5 -5
  37. package/dist/commands/price-lists.js +5 -5
  38. package/dist/commands/processor-mappings.js +5 -5
  39. package/dist/commands/processors.js +5 -5
  40. package/dist/commands/reports.js +5 -5
  41. package/dist/commands/salary-types.js +5 -5
  42. package/dist/commands/sales-invoices.js +5 -5
  43. package/dist/commands/sales-orders.js +5 -5
  44. package/dist/commands/tags.js +5 -5
  45. package/dist/commands/tax-codes.js +5 -5
  46. package/dist/commands/tax-matrix.js +5 -5
  47. package/dist/commands/tenants.js +5 -5
  48. package/dist/commands/text-templates.js +5 -5
  49. package/dist/commands/tools.js +5 -5
  50. package/dist/commands/{price-lists 3.d.ts → vat-declaration.d.ts} +2 -2
  51. package/dist/commands/{webhooks 3.js → vat-declaration.js} +33 -25
  52. package/dist/commands/vendor-invoices.js +5 -5
  53. package/dist/commands/webhooks.js +5 -5
  54. package/dist/commands/workflows.js +5 -5
  55. package/dist/lib/api-client.d.ts +3 -2
  56. package/dist/lib/api-client.js +4 -0
  57. package/dist/lib/auth.js +1 -0
  58. package/oclif.manifest.json +696 -6069
  59. package/package.json +15 -13
  60. package/dist/commands/access-groups 3.js +0 -1072
  61. package/dist/commands/accounts 2.d.ts +0 -41
  62. package/dist/commands/accounts 2.js +0 -1078
  63. package/dist/commands/async-endpoints-internal 3.d.ts +0 -40
  64. package/dist/commands/async-endpoints-internal 3.js +0 -1062
  65. package/dist/commands/async-endpoints-internal.d.ts +0 -40
  66. package/dist/commands/audit-log 3.d.ts +0 -40
  67. package/dist/commands/audit-log 3.js +0 -1066
  68. package/dist/commands/business-partners 3.d.ts +0 -41
  69. package/dist/commands/business-partners 3.js +0 -1078
  70. package/dist/commands/business-partners---contacts 3.d.ts +0 -42
  71. package/dist/commands/business-partners---contacts 3.js +0 -1072
  72. package/dist/commands/credit-card-accounts 3.d.ts +0 -42
  73. package/dist/commands/credit-card-accounts 3.js +0 -1084
  74. package/dist/commands/dunning-configs 3.d.ts +0 -40
  75. package/dist/commands/dunning-configs 3.js +0 -1072
  76. package/dist/commands/dunning-runs 3.d.ts +0 -40
  77. package/dist/commands/dunning-runs 3.js +0 -1061
  78. package/dist/commands/event-processor-mappings 3.d.ts +0 -40
  79. package/dist/commands/event-processor-mappings 3.js +0 -1071
  80. package/dist/commands/files-internal 3.d.ts +0 -40
  81. package/dist/commands/files-internal 3.js +0 -1073
  82. package/dist/commands/health 3.d.ts +0 -40
  83. package/dist/commands/health 3.js +0 -1067
  84. package/dist/commands/inbox 3.d.ts +0 -40
  85. package/dist/commands/inbox 3.js +0 -1065
  86. package/dist/commands/integrations 3.d.ts +0 -41
  87. package/dist/commands/integrations 3.js +0 -1067
  88. package/dist/commands/item-categories 3.d.ts +0 -40
  89. package/dist/commands/item-categories 3.js +0 -1072
  90. package/dist/commands/items 3.d.ts +0 -40
  91. package/dist/commands/items 3.js +0 -1072
  92. package/dist/commands/journals 3.d.ts +0 -42
  93. package/dist/commands/journals 3.js +0 -1088
  94. package/dist/commands/office-locations 3.d.ts +0 -40
  95. package/dist/commands/office-locations 3.js +0 -1072
  96. package/dist/commands/payment-method-ledger-mappings 3.d.ts +0 -41
  97. package/dist/commands/payment-method-ledger-mappings 3.js +0 -1066
  98. package/dist/commands/payment-methods 3.d.ts +0 -40
  99. package/dist/commands/payment-methods 3.js +0 -1072
  100. package/dist/commands/payment-runs 3.d.ts +0 -42
  101. package/dist/commands/payment-runs 3.js +0 -1087
  102. package/dist/commands/payment-terms 3.d.ts +0 -40
  103. package/dist/commands/payment-terms 3.js +0 -1073
  104. package/dist/commands/price-lists 3.js +0 -1078
  105. package/dist/commands/processor-mappings 2.d.ts +0 -40
  106. package/dist/commands/processor-mappings 2.js +0 -1070
  107. package/dist/commands/reconciliation 3.d.ts +0 -40
  108. package/dist/commands/reconciliation 3.js +0 -1069
  109. package/dist/commands/reconciliation.d.ts +0 -40
  110. package/dist/commands/reconciliation.js +0 -1071
  111. package/dist/commands/salary-types 3.d.ts +0 -40
  112. package/dist/commands/salary-types 3.js +0 -1072
  113. package/dist/commands/sales-invoices 3.d.ts +0 -43
  114. package/dist/commands/sales-invoices 3.js +0 -1100
  115. package/dist/commands/sales-orders 3.d.ts +0 -43
  116. package/dist/commands/sales-orders 3.js +0 -1098
  117. package/dist/commands/tags 3.d.ts +0 -40
  118. package/dist/commands/tags 3.js +0 -1072
  119. package/dist/commands/tax-codes 3.d.ts +0 -40
  120. package/dist/commands/tax-codes 3.js +0 -1075
  121. package/dist/commands/text-templates 3.d.ts +0 -40
  122. package/dist/commands/text-templates 3.js +0 -1072
  123. package/dist/commands/webhooks 3.d.ts +0 -40
@@ -6,25 +6,30 @@ const HAS_IMPORT = true;
6
6
  const HAS_EXPORT = true;
7
7
  const HAS_CAMT053 = false;
8
8
  const NESTED_IMPORTS = [];
9
- const SUBCOMMANDS = [...["list", "create", "events", "events-relations", "get", "update", "delete"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
9
+ const SUBCOMMANDS = [...["list", "create", "preview", "get", "update", "regenerate", "replace", "fields-contributions", "fields-contributions-export", "approve", "mark-as-filed", "xml"], ...(HAS_IMPORT ? ['import'] : []), ...(HAS_EXPORT ? ['export'] : []), ...NESTED_IMPORTS.map(n => `import-${n}`)];
10
10
  const ENDPOINTS = {
11
- 'list': { method: 'GET', path: '/v1/webhooks', summary: 'List all webhook subscriptions', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
12
- 'create': { method: 'POST', path: '/v1/webhooks', summary: 'Create a new webhook subscription', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['tenantIds'] },
13
- 'events': { method: 'GET', path: '/v1/webhooks/events', summary: 'Get available event types', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
- 'events-relations': { method: 'GET', path: '/v1/webhooks/events/{eventType}/relations', summary: 'Get valid relations for an event type', pathParams: ['eventType'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
15
- 'get': { method: 'GET', path: '/v1/webhooks/{id}', summary: 'Get a webhook subscription by ID', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
16
- 'update': { method: 'PATCH', path: '/v1/webhooks/{id}', summary: 'Update a webhook subscription', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['tenantIds'] },
17
- 'delete': { method: 'DELETE', path: '/v1/webhooks/{id}', summary: 'Delete a webhook subscription', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
11
+ 'list': { method: 'GET', path: '/v1/vat-declaration', summary: 'List VAT reports (paginated)', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
12
+ 'create': { method: 'POST', path: '/v1/vat-declaration', summary: 'Create a VAT declaration report (always async-accepted)', pathParams: [], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
13
+ 'preview': { method: 'GET', path: '/v1/vat-declaration/preview', summary: 'Preview the in-scope counts and late entries for a candidate period', pathParams: [], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
14
+ 'get': { method: 'GET', path: '/v1/vat-declaration/{id}', summary: 'Get a VAT report by id (this is the polling endpoint for async generation)', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
15
+ 'update': { method: 'PATCH', path: '/v1/vat-declaration/{id}', summary: 'Update manualAdjustments and/or generalInfo on a DRAFT report', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: ['manualAdjustments'] },
16
+ 'regenerate': { method: 'POST', path: '/v1/vat-declaration/{id}/regenerate', summary: 'Re-run the full generation pipeline on a DRAFT report', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
17
+ 'replace': { method: 'POST', path: '/v1/vat-declaration/{id}/replace', summary: 'Create a corrective DRAFT (Berichtigungsabrechnung) from a FILED report', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
18
+ 'fields-contributions': { method: 'GET', path: '/v1/vat-declaration/{id}/fields/{fieldId}/contributions', summary: 'Drill into the contributions for a single Ziffer', pathParams: ['id', 'fieldId'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
19
+ 'fields-contributions-export': { method: 'GET', path: '/v1/vat-declaration/{id}/fields/{fieldId}/contributions/export', summary: 'Export the drill-down result set as an Excel workbook', pathParams: ['id', 'fieldId'], hasBody: false, isMultipart: false, isBinaryResponse: true, bodyArrayFields: [] },
20
+ 'approve': { method: 'POST', path: '/v1/vat-declaration/{id}/approve', summary: 'Approve a VAT report and produce the eCH-0217 XML submission file.', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
21
+ 'mark-as-filed': { method: 'POST', path: '/v1/vat-declaration/{id}/mark-as-filed', summary: 'Record the ESTV filing reference for a FINALIZED VAT report.', pathParams: ['id'], hasBody: true, isMultipart: false, isBinaryResponse: false, bodyArrayFields: [] },
22
+ 'xml': { method: 'GET', path: '/v1/vat-declaration/{id}/xml', summary: 'Download the eCH-0217 XML submission file for a FINALIZED or FILED VAT report.', pathParams: ['id'], hasBody: false, isMultipart: false, isBinaryResponse: true, bodyArrayFields: [] },
18
23
  };
19
- export default class Webhooks extends Command {
20
- static description = 'Manage webhooks';
24
+ export default class VatDeclaration extends Command {
25
+ static description = 'Manage vat declaration';
21
26
  static examples = [
22
- '<%= config.bin %> webhooks list',
23
- '<%= config.bin %> webhooks get <id>',
24
- '<%= config.bin %> webhooks create --data \'{...}\'',
25
- '<%= config.bin %> webhooks update <id> --set field=value',
26
- '<%= config.bin %> webhooks import --file data.json',
27
- '<%= config.bin %> webhooks export --csv > webhooks.csv',
27
+ '<%= config.bin %> vat-declaration list',
28
+ '<%= config.bin %> vat-declaration get <id>',
29
+ '<%= config.bin %> vat-declaration create --data \'{...}\'',
30
+ '<%= config.bin %> vat-declaration update <id> --set field=value',
31
+ '<%= config.bin %> vat-declaration import --file data.json',
32
+ '<%= config.bin %> vat-declaration export --csv > vat-declaration.csv',
28
33
  ];
29
34
  static args = {
30
35
  action: Args.string({ description: 'Action: ' + SUBCOMMANDS.join(', '), required: true }),
@@ -38,6 +43,7 @@ export default class Webhooks extends Command {
38
43
  data: Flags.string({ char: 'd', description: 'JSON data for request body' }),
39
44
  file: Flags.string({ char: 'f', description: 'Read request body from file' }),
40
45
  set: Flags.string({ char: 's', description: 'Set individual field (e.g. --set firstName=John)', multiple: true }),
46
+ 'field-id': Flags.string({ description: 'Path param: fieldId' }),
41
47
  page: Flags.string({ description: 'Page number' }),
42
48
  limit: Flags.string({ description: 'Items per page' }),
43
49
  include: Flags.string({ description: 'Relations to include' }),
@@ -50,7 +56,7 @@ export default class Webhooks extends Command {
50
56
  'show-http-request': Flags.boolean({ description: 'Show HTTP request details (method, URL, body)' }),
51
57
  };
52
58
  async run() {
53
- const { args, flags } = await this.parse(Webhooks);
59
+ const { args, flags } = await this.parse(VatDeclaration);
54
60
  // Handle import action specially
55
61
  if (args.action === 'import') {
56
62
  if (!HAS_IMPORT)
@@ -83,11 +89,6 @@ export default class Webhooks extends Command {
83
89
  const endpoint = ENDPOINTS[args.action];
84
90
  if (!endpoint)
85
91
  this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
86
- const context = flags.context ? getContext(flags.context) : getCurrentContext();
87
- if (!context)
88
- this.error('No context configured. Run: aderis auth login --new');
89
- if (!context.tokens)
90
- this.error('Not logged in. Run: aderis auth login');
91
92
  let apiPath = endpoint.path;
92
93
  for (let i = 0; i < endpoint.pathParams.length; i++) {
93
94
  const param = endpoint.pathParams[i];
@@ -96,7 +97,7 @@ export default class Webhooks extends Command {
96
97
  // First path param always comes from positional argument
97
98
  value = args.id;
98
99
  if (!value)
99
- this.error('Missing required argument: id. Usage: aderis webhooks <action> <id>');
100
+ this.error('Missing required argument: id. Usage: aderis vat-declaration <action> <id>');
100
101
  }
101
102
  else {
102
103
  const flagName = param.replace(/\./g, '-').replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '');
@@ -106,6 +107,11 @@ export default class Webhooks extends Command {
106
107
  }
107
108
  apiPath = apiPath.replace(`{${param}}`, String(value));
108
109
  }
110
+ const context = flags.context ? getContext(flags.context) : getCurrentContext();
111
+ if (!context)
112
+ this.error('No context configured. Run: aderis auth login --new');
113
+ if (!context.tokens)
114
+ this.error('Not logged in. Run: aderis auth login');
109
115
  const queryParams = {};
110
116
  if (flags.page)
111
117
  queryParams.page = flags.page;
@@ -165,7 +171,9 @@ export default class Webhooks extends Command {
165
171
  data = form;
166
172
  }
167
173
  else if (endpoint.hasBody) {
168
- if (flags.file) {
174
+ // For binary-response endpoints, --file is the output path, not a JSON
175
+ // input file — skip the read-as-body branch.
176
+ if (flags.file && !endpoint.isBinaryResponse) {
169
177
  const fsModule = await import('node:fs');
170
178
  try {
171
179
  data = JSON.parse(fsModule.readFileSync(flags.file, 'utf-8'));
@@ -688,7 +696,7 @@ export default class Webhooks extends Command {
688
696
  }
689
697
  async runNestedImport(suffix, parentId, flags) {
690
698
  if (!parentId) {
691
- this.error(`Missing required argument: id. Usage: aderis webhooks import-${suffix} <parent-id> --file data.json`);
699
+ this.error(`Missing required argument: id. Usage: aderis vat-declaration import-${suffix} <parent-id> --file data.json`);
692
700
  }
693
701
  const context = flags.context ? getContext(flags.context) : getCurrentContext();
694
702
  if (!context)
@@ -114,11 +114,6 @@ export default class VendorInvoices extends Command {
114
114
  const endpoint = ENDPOINTS[args.action];
115
115
  if (!endpoint)
116
116
  this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
117
- const context = flags.context ? getContext(flags.context) : getCurrentContext();
118
- if (!context)
119
- this.error('No context configured. Run: aderis auth login --new');
120
- if (!context.tokens)
121
- this.error('Not logged in. Run: aderis auth login');
122
117
  let apiPath = endpoint.path;
123
118
  for (let i = 0; i < endpoint.pathParams.length; i++) {
124
119
  const param = endpoint.pathParams[i];
@@ -137,6 +132,11 @@ export default class VendorInvoices extends Command {
137
132
  }
138
133
  apiPath = apiPath.replace(`{${param}}`, String(value));
139
134
  }
135
+ const context = flags.context ? getContext(flags.context) : getCurrentContext();
136
+ if (!context)
137
+ this.error('No context configured. Run: aderis auth login --new');
138
+ if (!context.tokens)
139
+ this.error('Not logged in. Run: aderis auth login');
140
140
  const queryParams = {};
141
141
  if (flags.page)
142
142
  queryParams.page = flags.page;
@@ -83,11 +83,6 @@ export default class Webhooks extends Command {
83
83
  const endpoint = ENDPOINTS[args.action];
84
84
  if (!endpoint)
85
85
  this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
86
- const context = flags.context ? getContext(flags.context) : getCurrentContext();
87
- if (!context)
88
- this.error('No context configured. Run: aderis auth login --new');
89
- if (!context.tokens)
90
- this.error('Not logged in. Run: aderis auth login');
91
86
  let apiPath = endpoint.path;
92
87
  for (let i = 0; i < endpoint.pathParams.length; i++) {
93
88
  const param = endpoint.pathParams[i];
@@ -106,6 +101,11 @@ export default class Webhooks extends Command {
106
101
  }
107
102
  apiPath = apiPath.replace(`{${param}}`, String(value));
108
103
  }
104
+ const context = flags.context ? getContext(flags.context) : getCurrentContext();
105
+ if (!context)
106
+ this.error('No context configured. Run: aderis auth login --new');
107
+ if (!context.tokens)
108
+ this.error('Not logged in. Run: aderis auth login');
109
109
  const queryParams = {};
110
110
  if (flags.page)
111
111
  queryParams.page = flags.page;
@@ -75,11 +75,6 @@ export default class Workflows extends Command {
75
75
  const endpoint = ENDPOINTS[args.action];
76
76
  if (!endpoint)
77
77
  this.error(`Unknown action: ${args.action}. Available: ${SUBCOMMANDS.join(', ')}`);
78
- const context = flags.context ? getContext(flags.context) : getCurrentContext();
79
- if (!context)
80
- this.error('No context configured. Run: aderis auth login --new');
81
- if (!context.tokens)
82
- this.error('Not logged in. Run: aderis auth login');
83
78
  let apiPath = endpoint.path;
84
79
  for (let i = 0; i < endpoint.pathParams.length; i++) {
85
80
  const param = endpoint.pathParams[i];
@@ -98,6 +93,11 @@ export default class Workflows extends Command {
98
93
  }
99
94
  apiPath = apiPath.replace(`{${param}}`, String(value));
100
95
  }
96
+ const context = flags.context ? getContext(flags.context) : getCurrentContext();
97
+ if (!context)
98
+ this.error('No context configured. Run: aderis auth login --new');
99
+ if (!context.tokens)
100
+ this.error('Not logged in. Run: aderis auth login');
101
101
  const queryParams = {};
102
102
  if (flags.page)
103
103
  queryParams.page = flags.page;
@@ -25,10 +25,10 @@ export declare class ApiError extends Error {
25
25
  data?: unknown | undefined;
26
26
  constructor(message: string, status: number, data?: unknown | undefined);
27
27
  }
28
- export declare function createApiClient(contextName?: string, options?: {
28
+ export declare function createApiClient(contextName?: string, options?: boolean | {
29
29
  acceptAny?: boolean;
30
30
  binary?: boolean;
31
- } | boolean): Promise<AxiosInstance>;
31
+ }): Promise<AxiosInstance>;
32
32
  export declare function apiRequest<T = unknown>(method: string, path: string, options?: {
33
33
  acceptAny?: boolean;
34
34
  binary?: boolean;
@@ -36,6 +36,7 @@ export declare function apiRequest<T = unknown>(method: string, path: string, op
36
36
  contextName?: string;
37
37
  data?: unknown;
38
38
  params?: Record<string, unknown>;
39
+ responseType?: 'arraybuffer' | 'json' | 'stream' | 'text';
39
40
  }): Promise<ApiResponse<T>>;
40
41
  export declare function apiGet<T = unknown>(path: string, params?: Record<string, unknown>, contextName?: string): Promise<ApiResponse<T>>;
41
42
  export declare function apiPost<T = unknown>(path: string, data?: unknown, contextName?: string): Promise<ApiResponse<T>>;
@@ -109,6 +109,10 @@ export async function apiRequest(method, path, options = {}) {
109
109
  if (options.contentType) {
110
110
  config.headers = { ...config.headers, 'Content-Type': options.contentType };
111
111
  }
112
+ // Override responseType if specified (takes precedence over client-level default)
113
+ if (options.responseType) {
114
+ config.responseType = options.responseType;
115
+ }
112
116
  const response = await client.request(config);
113
117
  return {
114
118
  data: response.data,
package/dist/lib/auth.js CHANGED
@@ -160,6 +160,7 @@ export async function login(context, options = {}) {
160
160
  const authorizationUrl = buildAuthorizeUrl(context, pkce, state, options);
161
161
  return new Promise((resolve, reject) => {
162
162
  const connections = new Set();
163
+ // eslint-disable-next-line prefer-const -- assigned after server creation; closure captures the reference safely
163
164
  let timeoutId;
164
165
  const server = http.createServer(async (req, res) => {
165
166
  const url = new URL(req.url || '', `http://localhost:${CALLBACK_PORT}`);