@hyperline/cli 0.1.0-build.1.1064600 → 0.1.0-build.1.462ba05

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.
@@ -71,6 +71,87 @@ async function clearCredentials() {
71
71
  } catch {
72
72
  }
73
73
  }
74
+ async function resolveCompanyId({ flagCompanyId }) {
75
+ if (flagCompanyId)
76
+ return flagCompanyId;
77
+ const envCompanyId = process.env.HYPERLINE_COMPANY_ID;
78
+ if (envCompanyId)
79
+ return envCompanyId;
80
+ const configFile = await readJsonFile(CONFIG_FILE);
81
+ return configFile?.companyId;
82
+ }
83
+ async function saveCompanyId({ companyId }) {
84
+ const existing = await readJsonFile(CONFIG_FILE) ?? {};
85
+ existing.companyId = companyId;
86
+ await writeJsonFile(CONFIG_FILE, existing);
87
+ }
88
+
89
+ // build/prompt.js
90
+ import * as readline from "node:readline";
91
+ function selectPrompt({ message, items }) {
92
+ if (items.length === 0)
93
+ return Promise.resolve(void 0);
94
+ if (items.length === 1)
95
+ return Promise.resolve(items[0].value);
96
+ return new Promise((resolve) => {
97
+ const input = process.stdin;
98
+ const output = process.stderr;
99
+ let selectedIndex = 0;
100
+ const wasRaw = input.isRaw;
101
+ if (!input.isTTY) {
102
+ resolve(items[0].value);
103
+ return;
104
+ }
105
+ input.setRawMode(true);
106
+ readline.emitKeypressEvents(input);
107
+ function render() {
108
+ output.write(`\x1B[?25l`);
109
+ output.write(`\x1B[${items.length}A`);
110
+ for (const [index, item] of items.entries()) {
111
+ const isSelected = index === selectedIndex;
112
+ const pointer = isSelected ? "\x1B[36m>\x1B[0m" : " ";
113
+ const label = isSelected ? `\x1B[36m${item.label}\x1B[0m` : item.label;
114
+ const hint = item.hint ? `\x1B[2m ${item.hint}\x1B[0m` : "";
115
+ output.write(`\x1B[2K${pointer} ${label}${hint}
116
+ `);
117
+ }
118
+ }
119
+ output.write(`${message}
120
+ `);
121
+ for (const [index, item] of items.entries()) {
122
+ const isSelected = index === selectedIndex;
123
+ const pointer = isSelected ? "\x1B[36m>\x1B[0m" : " ";
124
+ const label = isSelected ? `\x1B[36m${item.label}\x1B[0m` : item.label;
125
+ const hint = item.hint ? `\x1B[2m ${item.hint}\x1B[0m` : "";
126
+ output.write(`${pointer} ${label}${hint}
127
+ `);
128
+ }
129
+ function cleanup() {
130
+ input.setRawMode(wasRaw ?? false);
131
+ input.removeListener("keypress", onKeypress);
132
+ input.pause();
133
+ output.write("\x1B[?25h");
134
+ }
135
+ function onKeypress(_str, key) {
136
+ if (!key)
137
+ return;
138
+ if (key.name === "up" || key.name === "k" && !key.ctrl) {
139
+ selectedIndex = selectedIndex <= 0 ? items.length - 1 : selectedIndex - 1;
140
+ render();
141
+ } else if (key.name === "down" || key.name === "j" && !key.ctrl) {
142
+ selectedIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
143
+ render();
144
+ } else if (key.name === "return") {
145
+ cleanup();
146
+ resolve(items[selectedIndex]?.value);
147
+ } else if (key.name === "escape" || key.name === "c" && key.ctrl) {
148
+ cleanup();
149
+ resolve(void 0);
150
+ }
151
+ }
152
+ input.on("keypress", onKeypress);
153
+ });
154
+ }
74
155
 
75
156
  // build/auth.js
76
157
  var CLI_CLIENT_NAME = "Hyperline CLI";
@@ -88,7 +169,10 @@ function generateState() {
88
169
  async function registerDynamicClient({ baseUrl, redirectUri }) {
89
170
  const response = await fetch(`${baseUrl}/oauth/register`, {
90
171
  method: "POST",
91
- headers: { "Content-Type": "application/json" },
172
+ headers: {
173
+ "Content-Type": "application/json",
174
+ "Hyperline-Source": "cli"
175
+ },
92
176
  body: JSON.stringify({
93
177
  client_name: CLI_CLIENT_NAME,
94
178
  redirect_uris: [redirectUri],
@@ -106,7 +190,10 @@ async function registerDynamicClient({ baseUrl, redirectUri }) {
106
190
  async function exchangeCodeForTokens({ baseUrl, code, clientId, codeVerifier, redirectUri }) {
107
191
  const response = await fetch(`${baseUrl}/oauth/tokens`, {
108
192
  method: "POST",
109
- headers: { "Content-Type": "application/json" },
193
+ headers: {
194
+ "Content-Type": "application/json",
195
+ "Hyperline-Source": "cli"
196
+ },
110
197
  body: JSON.stringify({
111
198
  grant_type: "authorization_code",
112
199
  code,
@@ -238,11 +325,340 @@ Please open this URL in your browser:
238
325
  expiresIn: tokens.expires_in
239
326
  });
240
327
  process.stdout.write("Login successful!\n");
328
+ await promptCompanySelection({
329
+ baseUrl,
330
+ accessToken: tokens.access_token
331
+ });
241
332
  } catch (error) {
242
333
  server.close();
243
334
  throw error;
244
335
  }
245
336
  }
337
+ async function fetchCompanies({ baseUrl, accessToken }) {
338
+ const response = await fetch(`${baseUrl}/v1/companies`, {
339
+ headers: {
340
+ Authorization: `Bearer ${accessToken}`,
341
+ "Hyperline-Source": "cli"
342
+ }
343
+ });
344
+ if (!response.ok) {
345
+ throw new Error(`Failed to fetch companies: ${response.status}`);
346
+ }
347
+ const body = await response.json();
348
+ return body.data;
349
+ }
350
+ async function promptCompanySelection({ baseUrl, accessToken }) {
351
+ process.stdout.write("\nFetching your companies...\n");
352
+ const companies = await fetchCompanies({ baseUrl, accessToken });
353
+ if (companies.length === 0) {
354
+ process.stdout.write("No companies found for this account.\n");
355
+ return;
356
+ }
357
+ if (companies.length === 1) {
358
+ const onlyCompany = companies[0];
359
+ await saveCompanyId({ companyId: onlyCompany.id });
360
+ process.stdout.write(`Company set to ${onlyCompany.name}
361
+ `);
362
+ return;
363
+ }
364
+ const selectedCompanyId = await selectPrompt({
365
+ message: "Select a company:",
366
+ items: companies.map((company) => ({
367
+ label: company.name,
368
+ value: company.id,
369
+ hint: company.id
370
+ }))
371
+ });
372
+ if (!selectedCompanyId) {
373
+ process.stdout.write("No company selected. You can set one later with: hyperline company select\n");
374
+ return;
375
+ }
376
+ await saveCompanyId({ companyId: selectedCompanyId });
377
+ const selectedCompany = companies.find((company) => company.id === selectedCompanyId);
378
+ process.stdout.write(`Company set to ${selectedCompany?.name ?? selectedCompanyId}
379
+ `);
380
+ }
381
+
382
+ // build/commands/confirm.js
383
+ import * as readline2 from "node:readline";
384
+ function confirmPrompt(message) {
385
+ const rl = readline2.createInterface({
386
+ input: process.stdin,
387
+ output: process.stderr
388
+ });
389
+ return new Promise((resolve) => {
390
+ rl.question(message, (answer) => {
391
+ rl.close();
392
+ resolve(answer.toLowerCase() === "y");
393
+ });
394
+ });
395
+ }
396
+
397
+ // build/commands/events.js
398
+ function resolveIngestBaseUrl(apiBaseUrl) {
399
+ return apiBaseUrl.replace("api.", "ingest.");
400
+ }
401
+ function registerEventsCommands(parent) {
402
+ const resource = parent.command("events").description("Manage billable events");
403
+ resource.command("list").description(`List billable events filtered by event type with optional filters for customer_id, record_id, and timestamp range. Paginated with take/skip.`).requiredOption("--event-type <value>", `Event type to filter by`).option("--take <number>", `take`).option("--skip <number>", `skip`).option("--customer-id <value>", `Filter by customer ID`).option("--record-id-in <value>", `Filter by record ID (comma-separated for multiple)`).option("--timestamp-gte <value>", `Filter events with timestamp >= this ISO8601 date`).option("--timestamp-lte <value>", `Filter events with timestamp <= this ISO8601 date`).option("--order <value>", `Sort order for timestamp`).addHelpText("after", `
404
+ Examples:
405
+ hyperline events list --event-type api_call
406
+ hyperline events list --event-type api_call --customer-id cus_xyz789 --take 10`).action(async (opts) => {
407
+ const ctx = resource.parent?.opts()._ctx;
408
+ if (!ctx) {
409
+ process.stderr.write("Error: Not authenticated\n");
410
+ process.exit(1);
411
+ }
412
+ const args = {};
413
+ if (opts.eventType !== void 0)
414
+ args.event_type = opts.eventType;
415
+ if (opts.customerId !== void 0)
416
+ args.customer_id = opts.customerId;
417
+ if (opts.recordIdIn !== void 0)
418
+ args.record_id__in = opts.recordIdIn;
419
+ if (opts.timestampGte !== void 0)
420
+ args.timestamp_gte = opts.timestampGte;
421
+ if (opts.timestampLte !== void 0)
422
+ args.timestamp_lte = opts.timestampLte;
423
+ if (opts.order !== void 0)
424
+ args.order = opts.order;
425
+ if (opts.take !== void 0)
426
+ args.take = Number(opts.take);
427
+ if (opts.skip !== void 0)
428
+ args.skip = Number(opts.skip);
429
+ await ctx.execute({
430
+ method: "GET",
431
+ path: "/v1/events",
432
+ args,
433
+ queryParamKeys: [
434
+ "event_type",
435
+ "customer_id",
436
+ "record_id__in",
437
+ "timestamp_gte",
438
+ "timestamp_lte",
439
+ "order",
440
+ "take",
441
+ "skip"
442
+ ],
443
+ baseUrlOverride: resolveIngestBaseUrl(ctx.baseUrl)
444
+ });
445
+ });
446
+ resource.command("send").description(`Send a single billable event.`).requiredOption("--customer-id <value>", `Customer ID or external ID`).requiredOption("--event-type <value>", `Event type`).requiredOption("--timestamp <value>", `ISO8601 timestamp`).requiredOption("--record <value>", `Event record as JSON (must include "id" key)`).option("--with-price-calculation", `Whether to calculate prices for the event`).addHelpText("after", `
447
+ Examples:
448
+ hyperline events send --customer-id cus_xyz --event-type api_call --timestamp 2024-01-15T10:00:00Z --record '{"id":"evt_1","duration":32}'
449
+ hyperline events send --customer-id cus_xyz --event-type api_call --timestamp 2024-01-15T10:00:00Z --record '{"id":"evt_1"}' --with-price-calculation`).action(async (opts) => {
450
+ const ctx = resource.parent?.opts()._ctx;
451
+ if (!ctx) {
452
+ process.stderr.write("Error: Not authenticated\n");
453
+ process.exit(1);
454
+ }
455
+ let record;
456
+ try {
457
+ record = JSON.parse(opts.record);
458
+ } catch {
459
+ process.stderr.write(`Error: --record must be valid JSON (e.g. '{"id":"evt_1"}')
460
+ `);
461
+ process.exit(1);
462
+ }
463
+ const body = {
464
+ customer_id: opts.customerId,
465
+ event_type: opts.eventType,
466
+ timestamp: opts.timestamp,
467
+ record
468
+ };
469
+ const args = {};
470
+ if (opts.withPriceCalculation !== void 0)
471
+ args.with_price_calculation = true;
472
+ await ctx.execute({
473
+ method: "POST",
474
+ path: "/v1/events",
475
+ args,
476
+ queryParamKeys: ["with_price_calculation"],
477
+ body,
478
+ baseUrlOverride: resolveIngestBaseUrl(ctx.baseUrl)
479
+ });
480
+ });
481
+ resource.command("send-batch").description(`Send multiple billable events in batch (max 5000 per request). All events must have the same event_type.`).requiredOption("--events <value>", `JSON array of events, each with customer_id, event_type, timestamp, record`).addHelpText("after", `
482
+ Examples:
483
+ hyperline events send-batch --events '[{"customer_id":"cus_xyz","event_type":"api_call","timestamp":"2024-01-15T10:00:00Z","record":{"id":"evt_1"}},{"customer_id":"cus_xyz","event_type":"api_call","timestamp":"2024-01-15T10:01:00Z","record":{"id":"evt_2"}}]'`).action(async (opts) => {
484
+ const ctx = resource.parent?.opts()._ctx;
485
+ if (!ctx) {
486
+ process.stderr.write("Error: Not authenticated\n");
487
+ process.exit(1);
488
+ }
489
+ let events;
490
+ try {
491
+ events = JSON.parse(opts.events);
492
+ } catch {
493
+ process.stderr.write("Error: --events must be valid JSON array\n");
494
+ process.exit(1);
495
+ }
496
+ if (!Array.isArray(events)) {
497
+ process.stderr.write("Error: --events must be a JSON array\n");
498
+ process.exit(1);
499
+ }
500
+ await ctx.execute({
501
+ method: "POST",
502
+ path: "/v1/events/batch",
503
+ args: {},
504
+ body: events,
505
+ baseUrlOverride: resolveIngestBaseUrl(ctx.baseUrl)
506
+ });
507
+ });
508
+ resource.command("delete").description(`Delete billable events by record IDs, customer ID, or all events.`).option("--matching <value>", `Matching strategy: record_ids, customer_id, or all`).option("--record-ids <value>", `Comma-separated list of record IDs (when matching=record_ids)`).option("--customer-id <value>", `Customer ID (when matching=customer_id)`).addHelpText("after", `
509
+ Examples:
510
+ hyperline events delete --matching record_ids --record-ids evt_1,evt_2
511
+ hyperline events delete --matching customer_id --customer-id cus_xyz
512
+ hyperline events delete --matching all`).action(async (opts) => {
513
+ const ctx = resource.parent?.opts()._ctx;
514
+ if (!ctx) {
515
+ process.stderr.write("Error: Not authenticated\n");
516
+ process.exit(1);
517
+ }
518
+ const matching = opts.matching;
519
+ if (!matching || !["record_ids", "customer_id", "all"].includes(matching)) {
520
+ process.stderr.write("Error: --matching must be one of: record_ids, customer_id, all\n");
521
+ process.exit(1);
522
+ }
523
+ let body;
524
+ if (matching === "record_ids") {
525
+ if (!opts.recordIds) {
526
+ process.stderr.write("Error: --record-ids is required when matching=record_ids\n");
527
+ process.exit(1);
528
+ }
529
+ body = {
530
+ matching: "record_ids",
531
+ record_ids: opts.recordIds.split(",")
532
+ };
533
+ } else if (matching === "customer_id") {
534
+ if (!opts.customerId) {
535
+ process.stderr.write("Error: --customer-id is required when matching=customer_id\n");
536
+ process.exit(1);
537
+ }
538
+ body = { matching: "customer_id", customer_id: opts.customerId };
539
+ } else {
540
+ const confirmed = await confirmPrompt("Are you sure you want to delete ALL events? (y/N) ");
541
+ if (!confirmed) {
542
+ process.stdout.write("Aborted.\n");
543
+ return;
544
+ }
545
+ body = { matching: "all" };
546
+ }
547
+ await ctx.execute({
548
+ method: "DELETE",
549
+ path: "/v1/events",
550
+ args: {},
551
+ body,
552
+ baseUrlOverride: resolveIngestBaseUrl(ctx.baseUrl)
553
+ });
554
+ });
555
+ resource.command("calculate-prices").description(`Ingest a billable event and calculate its prices. After first ingestion, returns cached prices.`).requiredOption("--customer-id <value>", `Customer ID or external ID`).requiredOption("--event-type <value>", `Event type`).requiredOption("--timestamp <value>", `ISO8601 timestamp`).requiredOption("--record <value>", `Event record as JSON (must include "id" key)`).option("--product-id <value>", `Hyperline product ID`).option("--subscription-id <value>", `Hyperline subscription ID`).option("--include-tax", `Include amounts with tax`).addHelpText("after", `
556
+ Examples:
557
+ hyperline events calculate-prices --customer-id cus_xyz --event-type api_call --timestamp 2024-01-15T10:00:00Z --record '{"id":"evt_1"}'
558
+ hyperline events calculate-prices --customer-id cus_xyz --event-type api_call --timestamp 2024-01-15T10:00:00Z --record '{"id":"evt_1"}' --product-id itm_abc --include-tax`).action(async (opts) => {
559
+ const ctx = resource.parent?.opts()._ctx;
560
+ if (!ctx) {
561
+ process.stderr.write("Error: Not authenticated\n");
562
+ process.exit(1);
563
+ }
564
+ let record;
565
+ try {
566
+ record = JSON.parse(opts.record);
567
+ } catch {
568
+ process.stderr.write(`Error: --record must be valid JSON (e.g. '{"id":"evt_1"}')
569
+ `);
570
+ process.exit(1);
571
+ }
572
+ const body = {
573
+ customer_id: opts.customerId,
574
+ event_type: opts.eventType,
575
+ timestamp: opts.timestamp,
576
+ record
577
+ };
578
+ const args = {};
579
+ if (opts.productId !== void 0)
580
+ args.product_id = opts.productId;
581
+ if (opts.subscriptionId !== void 0)
582
+ args.subscription_id = opts.subscriptionId;
583
+ if (opts.includeTax !== void 0)
584
+ args.include_tax = true;
585
+ await ctx.execute({
586
+ method: "POST",
587
+ path: "/v1/events/prices",
588
+ args,
589
+ queryParamKeys: ["product_id", "subscription_id", "include_tax"],
590
+ body,
591
+ baseUrlOverride: resolveIngestBaseUrl(ctx.baseUrl)
592
+ });
593
+ });
594
+ resource.command("simulate-prices").description(`Simulate prices for a billable event without ingesting it.`).requiredOption("--event-type <value>", `Event type`).requiredOption("--record <value>", `Event record as JSON (must include "id" key)`).option("--customer-id <value>", `Customer ID or external ID`).option("--timestamp <value>", `ISO8601 timestamp`).option("--product-id <value>", `Hyperline product ID`).option("--subscription-id <value>", `Hyperline subscription ID`).option("--include-tax", `Include amounts with tax`).addHelpText("after", `
595
+ Examples:
596
+ hyperline events simulate-prices --event-type api_call --record '{"id":"evt_1","duration":32}'
597
+ hyperline events simulate-prices --event-type api_call --record '{"id":"evt_1"}' --product-id itm_abc --include-tax`).action(async (opts) => {
598
+ const ctx = resource.parent?.opts()._ctx;
599
+ if (!ctx) {
600
+ process.stderr.write("Error: Not authenticated\n");
601
+ process.exit(1);
602
+ }
603
+ let record;
604
+ try {
605
+ record = JSON.parse(opts.record);
606
+ } catch {
607
+ process.stderr.write(`Error: --record must be valid JSON (e.g. '{"id":"evt_1"}')
608
+ `);
609
+ process.exit(1);
610
+ }
611
+ const body = {
612
+ event_type: opts.eventType,
613
+ record
614
+ };
615
+ if (opts.customerId !== void 0)
616
+ body.customer_id = opts.customerId;
617
+ if (opts.timestamp !== void 0)
618
+ body.timestamp = opts.timestamp;
619
+ const args = {};
620
+ if (opts.productId !== void 0)
621
+ args.product_id = opts.productId;
622
+ if (opts.subscriptionId !== void 0)
623
+ args.subscription_id = opts.subscriptionId;
624
+ if (opts.includeTax !== void 0)
625
+ args.include_tax = true;
626
+ await ctx.execute({
627
+ method: "POST",
628
+ path: "/v1/events/simulate-prices",
629
+ args,
630
+ queryParamKeys: ["product_id", "subscription_id", "include_tax"],
631
+ body,
632
+ baseUrlOverride: resolveIngestBaseUrl(ctx.baseUrl)
633
+ });
634
+ });
635
+ resource.command("get-prices").description(`Get previous price calculation results by calculation ID or record ID.`).option("--record-id <value>", `Record ID to look up`).option("--calculation-id <value>", `Calculation ID to look up`).addHelpText("after", `
636
+ Examples:
637
+ hyperline events get-prices --record-id D32NAA8
638
+ hyperline events get-prices --calculation-id cal_1234567890`).action(async (opts) => {
639
+ const ctx = resource.parent?.opts()._ctx;
640
+ if (!ctx) {
641
+ process.stderr.write("Error: Not authenticated\n");
642
+ process.exit(1);
643
+ }
644
+ if (!opts.recordId && !opts.calculationId) {
645
+ process.stderr.write("Error: at least one of --record-id or --calculation-id is required\n");
646
+ process.exit(1);
647
+ }
648
+ const args = {};
649
+ if (opts.recordId !== void 0)
650
+ args.record_id = opts.recordId;
651
+ if (opts.calculationId !== void 0)
652
+ args.calculation_id = opts.calculationId;
653
+ await ctx.execute({
654
+ method: "GET",
655
+ path: "/v1/events/prices",
656
+ args,
657
+ queryParamKeys: ["record_id", "calculation_id"],
658
+ baseUrlOverride: resolveIngestBaseUrl(ctx.baseUrl)
659
+ });
660
+ });
661
+ }
246
662
 
247
663
  // build/commands/generated/analytics.js
248
664
  function registerAnalyticsCommands(parent) {
@@ -354,21 +770,6 @@ Examples:
354
770
  });
355
771
  }
356
772
 
357
- // build/commands/confirm.js
358
- import * as readline from "node:readline";
359
- function confirmPrompt(message) {
360
- const rl = readline.createInterface({
361
- input: process.stdin,
362
- output: process.stderr
363
- });
364
- return new Promise((resolve) => {
365
- rl.question(message, (answer) => {
366
- rl.close();
367
- resolve(answer.toLowerCase() === "y");
368
- });
369
- });
370
- }
371
-
372
773
  // build/commands/generated/coupons.js
373
774
  function registerCouponsCommands(parent) {
374
775
  const resource = parent.command("coupons").description("Manage coupons");
@@ -7726,8 +8127,364 @@ var countriesAndCurrencies = (
7726
8127
  ]
7727
8128
  );
7728
8129
 
8130
+ // ../hyperline-monitoring/build/context/context.js
8131
+ import { AsyncLocalStorage } from "node:async_hooks";
8132
+ var executionContextStorage = new AsyncLocalStorage();
8133
+ function getExecutionContext() {
8134
+ return executionContextStorage.getStore();
8135
+ }
8136
+
8137
+ // ../hyperline-monitoring/build/context/correlationId.js
8138
+ import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
8139
+ var correlationIdStorage = new AsyncLocalStorage2();
8140
+ function getCorrelationId() {
8141
+ return correlationIdStorage.getStore();
8142
+ }
8143
+
8144
+ // ../hyperline-config/build/index.js
8145
+ import "dotenv/config";
8146
+ import * as stackTraceParser from "stacktrace-parser";
8147
+ import { ZodOptional as ZodOptional2, z as z2 } from "zod";
8148
+ function coerceBoolean() {
8149
+ return z2.any().refine((value) => ["true", "false"].includes(value), {
8150
+ message: "Expected boolean"
8151
+ }).transform((value) => (
8152
+ // biome-ignore lint/complexity/noUselessTernary: ignore
8153
+ value === "true" ? true : false
8154
+ ));
8155
+ }
8156
+ var types = {
8157
+ string: z2.coerce.string,
8158
+ number: z2.coerce.number,
8159
+ boolean: coerceBoolean,
8160
+ enum: z2.enum
8161
+ };
8162
+ function getConfig(schema, testValues) {
8163
+ const validator = z2.object(Object.fromEntries(Object.entries(schema).map(([key, zodType]) => {
8164
+ if (zodType instanceof ZodOptional2) {
8165
+ return [key, z2.string().optional()];
8166
+ }
8167
+ return [key, z2.string()];
8168
+ })));
8169
+ const processEnv = process.env;
8170
+ const isTestMode = processEnv.NODE_ENV === "test";
8171
+ const envVariables = {
8172
+ ...processEnv,
8173
+ ...isTestMode && testValues ? Object.fromEntries(Object.entries(testValues).map(([key, value]) => [key, String(value)])) : {}
8174
+ };
8175
+ const packageName = envVariables.npm_package_name;
8176
+ const parseProcessEnvResult = validator.safeParse(envVariables);
8177
+ if (!parseProcessEnvResult.success) {
8178
+ const parsedStackTrace = stackTraceParser.parse(parseProcessEnvResult.error.stack ?? "");
8179
+ const getConfigCallLine = parsedStackTrace.find((line) => {
8180
+ return !line.file?.includes("hyperline-config") && (line.file?.includes("apps/") || line.file?.includes("core/") || line.file?.includes("packages/"));
8181
+ });
8182
+ const callerFile = getConfigCallLine?.file;
8183
+ console.error(`Invalid environment variables for service \`${packageName}\`: \`${callerFile}\``);
8184
+ console.error(parseProcessEnvResult.error.format());
8185
+ process.exit(1);
8186
+ }
8187
+ const coercion = z2.object(schema);
8188
+ return coercion.parse(parseProcessEnvResult.data);
8189
+ }
8190
+
8191
+ // ../hyperline-monitoring/build/config.js
8192
+ var config = getConfig({
8193
+ // config
8194
+ APP_VERSION: types.string().optional(),
8195
+ LOGGER_CONSOLE_ENABLED: types.boolean().optional(),
8196
+ LOGGER_STDOUT_ENABLED: types.boolean().optional(),
8197
+ NODE_ENV: types.enum(["local", "test", "staging", "sandbox", "production"]),
8198
+ EVENT_LOOP_MONITORING_ENABLED: types.boolean().optional(),
8199
+ MEMORY_MONITORING_ENABLED: types.boolean().optional()
8200
+ // secrets
8201
+ }, {
8202
+ APP_VERSION: void 0,
8203
+ LOGGER_CONSOLE_ENABLED: false,
8204
+ LOGGER_STDOUT_ENABLED: false,
8205
+ EVENT_LOOP_MONITORING_ENABLED: false,
8206
+ MEMORY_MONITORING_ENABLED: false,
8207
+ NODE_ENV: "test"
8208
+ });
8209
+
8210
+ // ../hyperline-monitoring/build/logger/logger.js
8211
+ import * as util from "node:util";
8212
+ import prune2 from "json-prune";
8213
+ import * as winston from "winston";
8214
+
8215
+ // ../hyperline-monitoring/build/logger/formatting/format.js
8216
+ import prune from "json-prune";
8217
+ function jsonFormat(info) {
8218
+ const prunedInfo = JSON.parse(prune(info));
8219
+ for (const [key, value] of Object.entries(prunedInfo)) {
8220
+ info[key] = value;
8221
+ }
8222
+ return info;
8223
+ }
8224
+ function addMetadata({ getCorrelationId: getCorrelationId2, getExecutionContext: getExecutionContext2 }) {
8225
+ return (info) => {
8226
+ const correlationId = getCorrelationId2();
8227
+ const executionContext = getExecutionContext2();
8228
+ let traceContext;
8229
+ return {
8230
+ ...info,
8231
+ ...executionContext ?? {},
8232
+ ...traceContext ?? {},
8233
+ correlationId
8234
+ };
8235
+ };
8236
+ }
8237
+ function transformErrorEnrich(info, { depth }) {
8238
+ if (depth <= 0) {
8239
+ return info;
8240
+ }
8241
+ Object.entries(info).forEach(([key, value]) => {
8242
+ let newValue = value;
8243
+ if (newValue instanceof Error) {
8244
+ newValue = {
8245
+ ...newValue,
8246
+ // Copy error properties manually because they're not enumerable
8247
+ level: newValue.level,
8248
+ stack: newValue.stack,
8249
+ message: newValue.message,
8250
+ name: newValue.name
8251
+ };
8252
+ }
8253
+ if (newValue instanceof Object) {
8254
+ newValue = transformErrorEnrich(newValue, { depth: depth - 1 });
8255
+ }
8256
+ const isPropertyWritable = Object.getOwnPropertyDescriptor(info, key)?.writable ?? true;
8257
+ if (isPropertyWritable && newValue !== value) {
8258
+ info[key] = newValue;
8259
+ }
8260
+ });
8261
+ return info;
8262
+ }
8263
+ function transformPrune(info) {
8264
+ Object.entries(info).forEach(([key, value]) => {
8265
+ if (typeof value === "function") {
8266
+ return;
8267
+ }
8268
+ const newValue = value instanceof Object ? JSON.parse(prune(value, { depthDecr: 6 })) : value;
8269
+ const isPropertyWritable = Object.getOwnPropertyDescriptor(info, key)?.writable ?? true;
8270
+ if (isPropertyWritable && newValue !== value) {
8271
+ info[key] = newValue;
8272
+ }
8273
+ });
8274
+ return info;
8275
+ }
8276
+ function transformAxiosError(info) {
8277
+ Object.entries(info).forEach(([key, value]) => {
8278
+ if (typeof value === "object" && value?.name === "AxiosError") {
8279
+ info[key] = formatAxiosError(value);
8280
+ }
8281
+ });
8282
+ return info;
8283
+ }
8284
+ function formatAxiosError(error) {
8285
+ if (!isRecord(error) || error.name !== "AxiosError") {
8286
+ return error;
8287
+ }
8288
+ const request = isRecord(error.config) ? error.config : void 0;
8289
+ const response = isRecord(error.response) ? error.response : void 0;
8290
+ return {
8291
+ name: error.name,
8292
+ message: error.message,
8293
+ code: error.code,
8294
+ request: {
8295
+ method: request?.method,
8296
+ url: request?.url,
8297
+ baseURL: request?.baseURL,
8298
+ params: request?.params,
8299
+ headers: request?.headers,
8300
+ "axios-retry": request?.["axios-retry"]
8301
+ },
8302
+ response: {
8303
+ status: response?.status,
8304
+ statusText: response?.statusText,
8305
+ headers: response?.headers,
8306
+ data: response?.data
8307
+ }
8308
+ };
8309
+ }
8310
+ function isRecord(value) {
8311
+ return typeof value === "object" && value !== null && !Array.isArray(value);
8312
+ }
8313
+
8314
+ // ../hyperline-monitoring/build/logger/formatting/routePath.js
8315
+ function transformUrlIntoRoutePath({ params, originalUrl }) {
8316
+ let routePath = originalUrl;
8317
+ for (const [param, value] of Object.entries(params ?? {})) {
8318
+ const strValue = Array.isArray(value) ? value.join("/") : value;
8319
+ routePath = routePath.replace(strValue, `:${param}`);
8320
+ }
8321
+ return routePath.split("?")[0] ?? routePath;
8322
+ }
8323
+
8324
+ // ../hyperline-monitoring/build/logger/formatting/http.js
8325
+ function logHttpRequest(logger2, request, extra) {
8326
+ const { message, metadata } = transform(request);
8327
+ logger2.info(`HTTP REQ - ${message} ${extra?.postfix || ""}`, {
8328
+ ...metadata,
8329
+ ...extra?.metadata ?? {}
8330
+ });
8331
+ }
8332
+ function logHttpResponse(logger2, response, responseTime, extra) {
8333
+ const { request, statusCode, responseBody } = response;
8334
+ const { message, metadata } = transform(request);
8335
+ const readableResponseTime = responseTime ? getReadableTime(responseTime) : void 0;
8336
+ const responseMetadata = {
8337
+ statusCode,
8338
+ responseTime,
8339
+ responseBody
8340
+ };
8341
+ logger2.info(`HTTP RES - ${message} ${statusCode} ${readableResponseTime || ""} ${extra?.postfix || ""}`, {
8342
+ ...metadata,
8343
+ ...responseMetadata,
8344
+ ...extra?.metadata ?? {}
8345
+ });
8346
+ }
8347
+ function transform(request) {
8348
+ const method = request.method.toUpperCase();
8349
+ const message = `${method} ${request.originalUrl}`;
8350
+ const metadata = {};
8351
+ metadata.method = method;
8352
+ metadata.url = request.url;
8353
+ metadata.path = request.path;
8354
+ metadata.hostname = request.hostname;
8355
+ metadata.originalUrl = request.originalUrl;
8356
+ metadata.requestBody = request.body;
8357
+ metadata.routePath = transformUrlIntoRoutePath(request);
8358
+ metadata.apiKeyEnd = request.headers["authorization"]?.slice(-6);
8359
+ return { message, metadata };
8360
+ }
8361
+ function getReadableTime(time) {
8362
+ return time < 1e4 ? `${time}ms` : `${Math.round(time / 1e3)}s`;
8363
+ }
8364
+
8365
+ // ../hyperline-monitoring/build/logger/utils/network.js
8366
+ import * as os2 from "node:os";
8367
+ function getIpAddress() {
8368
+ const interfaces = Object.values(os2.networkInterfaces()).flat().filter((networkInterface) => {
8369
+ return networkInterface !== void 0;
8370
+ });
8371
+ const mainInterface = interfaces.find(({ family, internal }) => family === "IPv4" && internal === false);
8372
+ return mainInterface ? mainInterface.address : null;
8373
+ }
8374
+
8375
+ // ../hyperline-monitoring/build/logger/logger.js
8376
+ function buildLoggerFactory({ config: config2, context }) {
8377
+ const defaultMeta = {
8378
+ env: context.env,
8379
+ service: context.service,
8380
+ version: context.version,
8381
+ pid: process.pid,
8382
+ ppid: process.ppid,
8383
+ host: getIpAddress()
8384
+ };
8385
+ const transports2 = [];
8386
+ if (config2.enableConsoleTransport) {
8387
+ transports2.push(createTransportConsole());
8388
+ }
8389
+ if (config2.enableStdoutTransport) {
8390
+ transports2.push(createTransportStdout());
8391
+ }
8392
+ if (Object.values(config2).every((value) => !value)) {
8393
+ transports2.push(createTransportSilent());
8394
+ }
8395
+ for (const transport of transports2) {
8396
+ transport.on("error", (error) => {
8397
+ console.error(`Unable to log to transport=${transport.name}: ${error.message} ${JSON.stringify(error)}`);
8398
+ });
8399
+ }
8400
+ const internalLogger = winston.createLogger({
8401
+ transports: transports2,
8402
+ defaultMeta,
8403
+ format: winston.format.combine(winston.format.splat(), winston.format(addMetadata({ getCorrelationId, getExecutionContext }))(), winston.format(transformErrorEnrich)({ depth: 5 }), winston.format(transformPrune)(), winston.format(transformAxiosError)(), winston.format.timestamp()),
8404
+ exitOnError: false
8405
+ });
8406
+ function createLogger3({ serviceName }) {
8407
+ const logger2 = internalLogger.child({ subService: serviceName });
8408
+ return {
8409
+ debug: bindLogger(logger2, "debug"),
8410
+ info: bindLogger(logger2, "info"),
8411
+ warn: bindLogger(logger2, "warn"),
8412
+ error: bindLogger(logger2, "error"),
8413
+ on: logger2.on.bind(logger2),
8414
+ end: logger2.end.bind(logger2)
8415
+ };
8416
+ }
8417
+ return {
8418
+ createLogger: createLogger3
8419
+ };
8420
+ }
8421
+ function bindLogger(logger2, severity) {
8422
+ return (message, data) => {
8423
+ logger2[severity].bind(logger2)(message, preserveReservedKeys(data));
8424
+ };
8425
+ }
8426
+ function preserveReservedKeys(data) {
8427
+ if (!data)
8428
+ return;
8429
+ return Object.fromEntries(Object.entries(data).map(([key, value]) => {
8430
+ let finalKey = key;
8431
+ if (key === "status") {
8432
+ finalKey = "_status";
8433
+ } else if (key === "service") {
8434
+ finalKey = "_service";
8435
+ }
8436
+ return [finalKey, value];
8437
+ }));
8438
+ }
8439
+ var verboseLevels = ["warn", "error", "debug"];
8440
+ function createTransportConsole() {
8441
+ return new winston.transports.Console({
8442
+ level: "debug",
8443
+ handleExceptions: true,
8444
+ format: winston.format.combine(winston.format(jsonFormat)(), winston.format((info) => {
8445
+ const { level, message, ...others } = info;
8446
+ const parts = [message];
8447
+ if (Object.keys(others).length > 0 && verboseLevels.includes(level)) {
8448
+ const rawOthers = JSON.parse(prune2(others));
8449
+ parts.push(util.inspect(rawOthers, false, 4, true));
8450
+ }
8451
+ info.message = parts.filter((part) => !!part).join("\n");
8452
+ return info;
8453
+ })(), winston.format.colorize(), winston.format.printf(({ timestamp, level, message, service = "?" }) => {
8454
+ const result = `[${timestamp}] ${level} ${service}: ${message}`;
8455
+ return result.replace(/\\n/g, "\n");
8456
+ }))
8457
+ });
8458
+ }
8459
+ function createTransportStdout() {
8460
+ return new winston.transports.Console({
8461
+ level: "debug",
8462
+ handleExceptions: true,
8463
+ format: winston.format.combine(winston.format(jsonFormat)(), winston.format.timestamp(), winston.format.json())
8464
+ });
8465
+ }
8466
+ function createTransportSilent() {
8467
+ return new winston.transports.Console({
8468
+ silent: true
8469
+ });
8470
+ }
8471
+
8472
+ // ../hyperline-monitoring/build/logger/instance.js
8473
+ var loggerFactory = buildLoggerFactory({
8474
+ config: {
8475
+ enableConsoleTransport: config.LOGGER_CONSOLE_ENABLED ?? false,
8476
+ enableStdoutTransport: config.LOGGER_STDOUT_ENABLED ?? false
8477
+ },
8478
+ context: {
8479
+ env: config.NODE_ENV,
8480
+ service: "api",
8481
+ version: config.APP_VERSION
8482
+ }
8483
+ });
8484
+ var createLogger2 = loggerFactory.createLogger;
8485
+ var logger = loggerFactory.createLogger({ serviceName: "default" });
8486
+
7729
8487
  // ../hyperline-lib/build/utils/config/usStates.js
7730
- import { logger } from "@hyperline/monitoring";
7731
8488
  var usStates = [
7732
8489
  "AA",
7733
8490
  "AE",
@@ -7792,7 +8549,7 @@ var usStates = [
7792
8549
 
7793
8550
  // ../hyperline-lib/build/utils/dates.js
7794
8551
  import { toLocalTime, toUtc } from "@hyperline/shared";
7795
- import { add, addDays, addHours, addMinutes, addMonths, addWeeks, addYears, areIntervalsOverlapping, differenceInCalendarDays, differenceInCalendarYears, differenceInMilliseconds, differenceInMonths, differenceInWeeks, eachDayOfInterval, endOfDay, endOfMonth, endOfQuarter, endOfWeek, endOfYear, format, getHours, getISOWeek, getISOWeekYear, getMilliseconds, getMinutes, getSeconds, isBefore, isEqual, isSameDay, parse, setHours, setMilliseconds, setMinutes, setSeconds, startOfDay, startOfMonth, startOfQuarter, startOfWeek, startOfYear, sub } from "date-fns";
8552
+ import { add, addDays, addHours, addMinutes, addMonths, addWeeks, addYears, areIntervalsOverlapping, differenceInCalendarDays, differenceInCalendarYears, differenceInMilliseconds, differenceInMonths, differenceInWeeks, eachDayOfInterval, endOfDay, endOfMonth, endOfQuarter, endOfWeek, endOfYear, format as format2, getHours, getISOWeek, getISOWeekYear, getMilliseconds, getMinutes, getSeconds, isBefore, isEqual, isSameDay, parse as parse2, setHours, setMilliseconds, setMinutes, setSeconds, startOfDay, startOfMonth, startOfQuarter, startOfWeek, startOfYear, sub } from "date-fns";
7796
8553
 
7797
8554
  // ../hyperline-lib/build/utils/document.js
7798
8555
  import { toLocalTime as toLocalTime2 } from "@hyperline/shared";
@@ -7864,15 +8621,15 @@ var ErrorSchema = z.object({
7864
8621
  });
7865
8622
 
7866
8623
  // ../hyperline-lib/build/http/dto/pagination.js
7867
- import z2 from "zod";
8624
+ import z3 from "zod";
7868
8625
  var PublicPaginationParams = {
7869
- take: z2.coerce.number().nonnegative().max(100).optional().default(50),
7870
- skip: z2.coerce.number().nonnegative().optional().default(0)
8626
+ take: z3.coerce.number().nonnegative().max(100).optional().default(50),
8627
+ skip: z3.coerce.number().nonnegative().optional().default(0)
7871
8628
  };
7872
- var PublicPaginationSchema = z2.object(PublicPaginationParams);
8629
+ var PublicPaginationSchema = z3.object(PublicPaginationParams);
7873
8630
 
7874
8631
  // ../hyperline-lib/build/http/dto/sort.js
7875
- import z3 from "zod";
8632
+ import z4 from "zod";
7876
8633
 
7877
8634
  // ../hyperline-lib/build/http/dto/state.js
7878
8635
  var StateSchema = z.enum(usStates).openapi({
@@ -7886,12 +8643,356 @@ import { ZodError as ZodError2 } from "zod";
7886
8643
  // ../hyperline-lib/build/http/helpers/correlation.js
7887
8644
  import { validate as validateUuid } from "uuid";
7888
8645
 
8646
+ // ../hyperline-i18n/build/language.js
8647
+ import * as i18next from "i18next";
8648
+ import { z as z5 } from "zod";
8649
+
8650
+ // ../hyperline-i18n/build/config/languages.js
8651
+ var languages = [
8652
+ { id: "fr", name: "French", isoCode: "fr", locale: "fr-FR" },
8653
+ { id: "en", name: "English", isoCode: "en", locale: "en-US" },
8654
+ { id: "de", name: "German", isoCode: "de", locale: "de-DE" },
8655
+ { id: "it", name: "Italian", isoCode: "it", locale: "it-IT" },
8656
+ { id: "nl", name: "Dutch", isoCode: "nl", locale: "nl-NL" },
8657
+ { id: "es", name: "Spanish", isoCode: "es", locale: "es-ES" },
8658
+ { id: "pt", name: "Portuguese", isoCode: "pt", locale: "pt-PT" },
8659
+ { id: "pl", name: "Polish", isoCode: "pl", locale: "pl-PL" }
8660
+ ];
8661
+
8662
+ // ../hyperline-i18n/build/locales/de.js
8663
+ var de = {
8664
+ "accounting.revrec.creditLineDescription": "Umsatz realisieren \u2013 Zeitplan {{scheduleId}}, Zeitraum {{periodDate}}",
8665
+ "accounting.revrec.debitLineDescription": "Abgrenzungsposten reduzieren \u2013 Zeitplan {{scheduleId}}, Zeitraum {{periodDate}}",
8666
+ "accounting.revrec.discountCreditLineDescription": "Erl\xF6sminderung (Rabatt) erfassen \u2013 Zeitplan {{scheduleId}}, Zeitraum {{periodDate}}",
8667
+ "accounting.revrec.discountDebitLineDescription": "Abgegrenzten Rabatt reduzieren \u2013 Zeitplan {{scheduleId}}, Zeitraum {{periodDate}}",
8668
+ "accounting.revrec.entryDescription": "Umsatzrealisierung f\xFCr Zeitplan {{scheduleId}}, Zeitraum {{periodStart}} - {{periodEnd}}",
8669
+ "creditNotes.refundChargeName": "R\xFCckerstattung f\xFCr die Rechnung",
8670
+ "credits.bundleOf": "{{productName}} - Paket mit {{creditCount}} Guthaben",
8671
+ "credits.unitsOf": "{{productName}} - {{creditCount}} Guthaben",
8672
+ "einvoicing.paymentFromWallet": "Zahlung aus Guthaben",
8673
+ "einvoicing.paymentProcessed": "Zahlung verarbeitet",
8674
+ "einvoicing.paymentReceived": "Zahlung erhalten",
8675
+ "invoices.outstandingProduct.description": "Unbezahlter Betrag der Rechnung{{invoiceNumber}} vom {{date}}",
8676
+ "invoices.outstandingProduct.descriptionPeriod": "Unbezahlter Betrag der Rechnung{{invoiceNumber}} vom {{periodStart}} bis {{periodEnd}}",
8677
+ "invoices.outstandingProduct.name": "Offener Saldo",
8678
+ "invoices.prorata.paymentForItem": "Anteilig berechneter Betrag f\xFCr",
8679
+ "invoices.prorata.refundForItem": "Anteilig erstatteter Betrag f\xFCr",
8680
+ "subscriptions.closingChargeName": "Abschlussgeb\xFChr f\xFCr das Abonnement",
8681
+ "subscriptions.correction": "Vorperiodische Anpassung",
8682
+ "subscriptions.updates.addCoupon": "Gutschein hinzuf\xFCgen {{couponName}}",
8683
+ "subscriptions.updates.addProduct": "{{productName}} hinzuf\xFCgen",
8684
+ "subscriptions.updates.removeCoupon": "Gutschein entfernen {{couponName}}",
8685
+ "subscriptions.updates.removeProduct": "{{productName}} entfernen",
8686
+ "subscriptions.updates.unit": "Einheiten",
8687
+ "subscriptions.updates.updateCount": "Aktualisieren Sie {{productName}} ({{previousCount}} \u2192 {{newCount}} {{unit}})",
8688
+ "subscriptions.updates.updateCount.description.full.committed.invoiced": "Eine minimale zugesicherte Anzahl von {{committedCount}} wurde f\xFCr den gesamten Zeitraum angewendet.",
8689
+ "subscriptions.updates.updateCount.description.full.committed.not_invoiced": "Betrag von {{amount}} (mit einer minimal zugesicherten Anzahl von {{committedCount}}) f\xFCr den gesamten Zeitraum nicht in Rechnung gestellt",
8690
+ "subscriptions.updates.updateCount.description.full.not_committed.invoiced": "Diese Position wurde f\xFCr den gesamten Zeitraum in Rechnung gestellt",
8691
+ "subscriptions.updates.updateCount.description.full.not_committed.not_invoiced": "Betrag von {{amount}} f\xFCr den gesamten Zeitraum nicht in Rechnung gestellt",
8692
+ "subscriptions.updates.updateCount.description.prorata.committed.invoiced": "Eine minimale zugesicherte Anzahl von {{committedCount}} wurde angewendet.",
8693
+ "subscriptions.updates.updateCount.description.prorata.committed.not_invoiced": "Betrag von {{amount}} (mit einer minimal zugesicherten Anzahl von {{committedCount}}) f\xFCr den anteiligen Zeitraum nicht in Rechnung gestellt",
8694
+ "subscriptions.updates.updateCount.description.prorata.not_committed.invoiced": "Diese Position wurde f\xFCr den anteiligen Zeitraum in Rechnung gestellt",
8695
+ "subscriptions.updates.updateCount.description.prorata.not_committed.not_invoiced": "Betrag von {{amount}} f\xFCr den anteiligen Zeitraum nicht in Rechnung gestellt",
8696
+ "subscriptions.updates.updatePrices": "Preise f\xFCr {{productName}} aktualisieren"
8697
+ };
8698
+
8699
+ // ../hyperline-i18n/build/locales/en.js
8700
+ var en = {
8701
+ "creditNotes.refundChargeName": "Refund for invoice",
8702
+ "credits.bundleOf": "{{productName}} - Pack of {{creditCount}} credits",
8703
+ "credits.unitsOf": "{{productName}} - {{creditCount}} credits",
8704
+ "invoices.outstandingProduct.description": "Unpaid amount from the invoice{{invoiceNumber}} emitted on {{date}}",
8705
+ "invoices.outstandingProduct.descriptionPeriod": "Unpaid amount from the invoice{{invoiceNumber}} from {{periodStart}} to {{periodEnd}}",
8706
+ "invoices.outstandingProduct.name": "Outstanding balance",
8707
+ "invoices.prorata.paymentForItem": "Prorated payment for",
8708
+ "invoices.prorata.refundForItem": "Prorated refund for",
8709
+ "subscriptions.closingChargeName": "Closing fee for subscription",
8710
+ "subscriptions.correction": "Adjustment previous period",
8711
+ "subscriptions.updates.addCoupon": "Add coupon {{couponName}}",
8712
+ "subscriptions.updates.addProduct": "Add {{productName}}",
8713
+ "subscriptions.updates.removeCoupon": "Remove coupon {{couponName}}",
8714
+ "subscriptions.updates.removeProduct": "Remove {{productName}}",
8715
+ "subscriptions.updates.unit": "units",
8716
+ "subscriptions.updates.updatePrices": "Update prices for {{productName}}",
8717
+ "subscriptions.updates.updateCount": "Update {{productName}} count ({{previousCount}} \u2192 {{newCount}} {{unit}})",
8718
+ "subscriptions.updates.updateCount.description.prorata.committed.invoiced": "A minimum committed count of {{committedCount}} has been applied.",
8719
+ "subscriptions.updates.updateCount.description.prorata.committed.not_invoiced": "Amount of {{amount}} (with a minimum committed count of {{committedCount}}) not invoiced for the prorated period",
8720
+ "subscriptions.updates.updateCount.description.prorata.not_committed.invoiced": "This line has been invoiced for the prorated period",
8721
+ "subscriptions.updates.updateCount.description.prorata.not_committed.not_invoiced": "Amount of {{amount}} not invoiced for the prorated period",
8722
+ "subscriptions.updates.updateCount.description.full.committed.invoiced": "A minimum committed count of {{committedCount}} has been applied for the full period.",
8723
+ "subscriptions.updates.updateCount.description.full.committed.not_invoiced": "Amount of {{amount}} (with a minimum committed count of {{committedCount}}) not invoiced for the full period",
8724
+ "subscriptions.updates.updateCount.description.full.not_committed.invoiced": "This line has been invoiced for the full period",
8725
+ "subscriptions.updates.updateCount.description.full.not_committed.not_invoiced": "Amount of {{amount}} not invoiced for the full period",
8726
+ "accounting.revrec.entryDescription": "Revenue recognition for schedule {{scheduleId}}, period {{periodStart}} - {{periodEnd}}",
8727
+ "accounting.revrec.debitLineDescription": "Decrease deferred revenue \u2013 schedule {{scheduleId}}, period {{periodDate}}",
8728
+ "accounting.revrec.creditLineDescription": "Recognize revenue \u2013 schedule {{scheduleId}}, period {{periodDate}}",
8729
+ "accounting.revrec.discountDebitLineDescription": "Decrease deferred discount \u2013 schedule {{scheduleId}}, period {{periodDate}}",
8730
+ "accounting.revrec.discountCreditLineDescription": "Recognize contra-revenue (discount) \u2013 schedule {{scheduleId}}, period {{periodDate}}",
8731
+ "einvoicing.paymentProcessed": "Payment processed",
8732
+ "einvoicing.paymentReceived": "Payment received",
8733
+ "einvoicing.paymentFromWallet": "Payment from wallet"
8734
+ };
8735
+
8736
+ // ../hyperline-i18n/build/locales/es.js
8737
+ var es = {
8738
+ "accounting.revrec.creditLineDescription": "Reconocer ingresos \u2013 cronograma {{scheduleId}}, per\xEDodo {{periodDate}}",
8739
+ "accounting.revrec.debitLineDescription": "Disminuci\xF3n de ingresos diferidos \u2013 cronograma {{scheduleId}}, per\xEDodo {{periodDate}}",
8740
+ "accounting.revrec.discountCreditLineDescription": "Reconocer contra-ingresos (descuento) \u2013 cronograma {{scheduleId}}, per\xEDodo {{periodDate}}",
8741
+ "accounting.revrec.discountDebitLineDescription": "Disminuci\xF3n de descuento diferido \u2013 cronograma {{scheduleId}}, per\xEDodo {{periodDate}}",
8742
+ "accounting.revrec.entryDescription": "Reconocimiento de ingresos para el cronograma {{scheduleId}}, per\xEDodo {{periodStart}} - {{periodEnd}}",
8743
+ "creditNotes.refundChargeName": "Reembolso por factura",
8744
+ "credits.bundleOf": "{{productName}} - Paquete de {{creditCount}} cr\xE9ditos",
8745
+ "credits.unitsOf": "{{productName}} - {{creditCount}} cr\xE9ditos",
8746
+ "einvoicing.paymentFromWallet": "Pago desde el monedero",
8747
+ "einvoicing.paymentProcessed": "Pago procesado",
8748
+ "einvoicing.paymentReceived": "Pago recibido",
8749
+ "invoices.outstandingProduct.description": "Monto pendiente de la factura{{invoiceNumber}} emitida el {{date}}",
8750
+ "invoices.outstandingProduct.descriptionPeriod": "Monto pendiente de la factura{{invoiceNumber}} del {{periodStart}} al {{periodEnd}}",
8751
+ "invoices.outstandingProduct.name": "Saldo pendiente",
8752
+ "invoices.prorata.paymentForItem": "Pago prorrateado por",
8753
+ "invoices.prorata.refundForItem": "Reembolso prorrateado por",
8754
+ "subscriptions.closingChargeName": "Cargo por cierre de suscripci\xF3n",
8755
+ "subscriptions.correction": "Ajuste del periodo anterior",
8756
+ "subscriptions.updates.addCoupon": "A\xF1adir cup\xF3n {{couponName}}",
8757
+ "subscriptions.updates.addProduct": "A\xF1adir {{productName}}",
8758
+ "subscriptions.updates.removeCoupon": "Eliminar cup\xF3n {{couponName}}",
8759
+ "subscriptions.updates.removeProduct": "Eliminar {{productName}}",
8760
+ "subscriptions.updates.unit": "unidades",
8761
+ "subscriptions.updates.updateCount": "Actualizar {{productName}} ({{previousCount}} \u2192 {{newCount}} {{unit}})",
8762
+ "subscriptions.updates.updateCount.description.full.committed.invoiced": "Se ha aplicado un m\xEDnimo comprometido de {{committedCount}} para el per\xEDodo completo.",
8763
+ "subscriptions.updates.updateCount.description.full.committed.not_invoiced": "Importe de {{amount}} (con un m\xEDnimo comprometido de {{committedCount}}) no facturado para el per\xEDodo completo",
8764
+ "subscriptions.updates.updateCount.description.full.not_committed.invoiced": "Esta l\xEDnea ha sido facturada para el per\xEDodo completo",
8765
+ "subscriptions.updates.updateCount.description.full.not_committed.not_invoiced": "Importe de {{amount}} no facturado para el per\xEDodo completo",
8766
+ "subscriptions.updates.updateCount.description.prorata.committed.invoiced": "Se ha aplicado un m\xEDnimo comprometido de {{committedCount}}.",
8767
+ "subscriptions.updates.updateCount.description.prorata.committed.not_invoiced": "Importe de {{amount}} (con un m\xEDnimo comprometido de {{committedCount}}) no facturado para el per\xEDodo prorrateado",
8768
+ "subscriptions.updates.updateCount.description.prorata.not_committed.invoiced": "Esta l\xEDnea ha sido facturada para el per\xEDodo prorrateado",
8769
+ "subscriptions.updates.updateCount.description.prorata.not_committed.not_invoiced": "Importe de {{amount}} no facturado para el per\xEDodo prorrateado",
8770
+ "subscriptions.updates.updatePrices": "Actualizar precios para {{productName}}"
8771
+ };
8772
+
8773
+ // ../hyperline-i18n/build/locales/fr.js
8774
+ var fr = {
8775
+ "accounting.revrec.creditLineDescription": "Reconnaissance du chiffre d'affaires \u2013 \xE9ch\xE9ancier {{scheduleId}}, p\xE9riode {{periodDate}}",
8776
+ "accounting.revrec.debitLineDescription": "Diminution des produits constat\xE9s d'avance \u2013 \xE9ch\xE9ancier {{scheduleId}}, p\xE9riode {{periodDate}}",
8777
+ "accounting.revrec.discountCreditLineDescription": "Reconnaissance du contre-revenu (remise) \u2013 \xE9ch\xE9ancier {{scheduleId}}, p\xE9riode {{periodDate}}",
8778
+ "accounting.revrec.discountDebitLineDescription": "Diminution des remises diff\xE9r\xE9es \u2013 \xE9ch\xE9ancier {{scheduleId}}, p\xE9riode {{periodDate}}",
8779
+ "accounting.revrec.entryDescription": "Reconnaissance du chiffre d'affaires pour l'\xE9ch\xE9ancier {{scheduleId}}, p\xE9riode {{periodStart}} - {{periodEnd}}",
8780
+ "creditNotes.refundChargeName": "Remboursement pour facture",
8781
+ "credits.bundleOf": "{{productName}} - Pack de {{creditCount}} cr\xE9dits",
8782
+ "credits.unitsOf": "{{productName}} - {{creditCount}} cr\xE9dits",
8783
+ "einvoicing.paymentFromWallet": "Paiement depuis le portefeuille",
8784
+ "einvoicing.paymentProcessed": "Paiement effectu\xE9",
8785
+ "einvoicing.paymentReceived": "Paiement re\xE7u",
8786
+ "invoices.outstandingProduct.description": "Montant impay\xE9 de la facture{{invoiceNumber}} \xE9mise le {{date}}",
8787
+ "invoices.outstandingProduct.descriptionPeriod": "Montant impay\xE9 de la facture{{invoiceNumber}} du {{periodStart}} au {{periodEnd}}",
8788
+ "invoices.outstandingProduct.name": "Solde impay\xE9",
8789
+ "invoices.prorata.paymentForItem": "Paiement au prorata pour",
8790
+ "invoices.prorata.refundForItem": "Remboursement au prorata pour",
8791
+ "subscriptions.closingChargeName": "Frais de cl\xF4ture pour abonnement",
8792
+ "subscriptions.correction": "Ajustement p\xE9riode pr\xE9c\xE9dente",
8793
+ "subscriptions.updates.addCoupon": "Ajout du coupon {{couponName}}",
8794
+ "subscriptions.updates.addProduct": "Ajout {{productName}}",
8795
+ "subscriptions.updates.removeCoupon": "Retrait du coupon {{couponName}}",
8796
+ "subscriptions.updates.removeProduct": "Retrait {{productName}}",
8797
+ "subscriptions.updates.unit": "unit\xE9s",
8798
+ "subscriptions.updates.updateCount": "Mise \xE0 jour {{productName}} ({{previousCount}} \u2192 {{newCount}} {{unit}})",
8799
+ "subscriptions.updates.updateCount.description.full.committed.invoiced": "Un minimum engag\xE9 de {{committedCount}} a \xE9t\xE9 appliqu\xE9 pour la p\xE9riode compl\xE8te.",
8800
+ "subscriptions.updates.updateCount.description.full.committed.not_invoiced": "Montant de {{amount}} (avec un minimum engag\xE9 de {{committedCount}}) non factur\xE9 pour la p\xE9riode compl\xE8te",
8801
+ "subscriptions.updates.updateCount.description.full.not_committed.invoiced": "Cette ligne a \xE9t\xE9 factur\xE9e pour la p\xE9riode compl\xE8te",
8802
+ "subscriptions.updates.updateCount.description.full.not_committed.not_invoiced": "Montant de {{amount}} non factur\xE9 pour la p\xE9riode compl\xE8te",
8803
+ "subscriptions.updates.updateCount.description.prorata.committed.invoiced": "Un minimum engag\xE9 de {{committedCount}} a \xE9t\xE9 appliqu\xE9 pour la p\xE9riode proratis\xE9e.",
8804
+ "subscriptions.updates.updateCount.description.prorata.committed.not_invoiced": "Montant de {{amount}} (avec un minimum engag\xE9 de {{committedCount}}) non factur\xE9 pour la p\xE9riode proratis\xE9e",
8805
+ "subscriptions.updates.updateCount.description.prorata.not_committed.invoiced": "Cette ligne a \xE9t\xE9 factur\xE9e pour la p\xE9riode proratis\xE9e",
8806
+ "subscriptions.updates.updateCount.description.prorata.not_committed.not_invoiced": "Montant de {{amount}} non factur\xE9 pour la p\xE9riode proratis\xE9e",
8807
+ "subscriptions.updates.updatePrices": "Mise \xE0 jour des prix pour {{productName}}"
8808
+ };
8809
+
8810
+ // ../hyperline-i18n/build/locales/it.js
8811
+ var it = {
8812
+ "accounting.revrec.creditLineDescription": "Riconoscere i ricavi \u2013 programma {{scheduleId}}, periodo {{periodDate}}",
8813
+ "accounting.revrec.debitLineDescription": "Diminuzione dei ricavi differiti \u2013 programma {{scheduleId}}, periodo {{periodDate}}",
8814
+ "accounting.revrec.discountCreditLineDescription": "Riconoscere il contra-ricavo (sconto) \u2013 programma {{scheduleId}}, periodo {{periodDate}}",
8815
+ "accounting.revrec.discountDebitLineDescription": "Diminuzione dello sconto differito \u2013 programma {{scheduleId}}, periodo {{periodDate}}",
8816
+ "accounting.revrec.entryDescription": "Riconoscimento dei ricavi per il programma {{scheduleId}}, periodo {{periodStart}} - {{periodEnd}}",
8817
+ "creditNotes.refundChargeName": "Rimborso per fattura",
8818
+ "credits.bundleOf": "{{productName}} - Pacchetto di {{creditCount}} crediti",
8819
+ "credits.unitsOf": "{{productName}} - {{creditCount}} crediti",
8820
+ "einvoicing.paymentFromWallet": "Pagamento dal portafoglio",
8821
+ "einvoicing.paymentProcessed": "Pagamento elaborato",
8822
+ "einvoicing.paymentReceived": "Pagamento ricevuto",
8823
+ "invoices.outstandingProduct.description": "Importo insoluto della fattura{{invoiceNumber}} emessa il {{date}}",
8824
+ "invoices.outstandingProduct.descriptionPeriod": "Importo insoluto della fattura{{invoiceNumber}} dal {{periodStart}} al {{periodEnd}}",
8825
+ "invoices.outstandingProduct.name": "Saldo insoluto",
8826
+ "invoices.prorata.paymentForItem": "Pagamento proporzionale per",
8827
+ "invoices.prorata.refundForItem": "Rimborso proporzionale per",
8828
+ "subscriptions.closingChargeName": "Costo di chiusura per abbonamento",
8829
+ "subscriptions.correction": "Correzione periodo precedente",
8830
+ "subscriptions.updates.addCoupon": "Aggiungi coupon {{couponName}}",
8831
+ "subscriptions.updates.addProduct": "Aggiungi {{productName}}",
8832
+ "subscriptions.updates.removeCoupon": "Rimuovi coupon {{couponName}}",
8833
+ "subscriptions.updates.removeProduct": "Rimuovi {{productName}}",
8834
+ "subscriptions.updates.unit": "unit\xE0",
8835
+ "subscriptions.updates.updateCount": "Aggiorna {{productName}} ({{previousCount}} \u2192 {{newCount}} {{unit}})",
8836
+ "subscriptions.updates.updateCount.description.full.committed.invoiced": "\xC8 stato applicato un minimo impegnato di {{committedCount}} per l\u2019intero periodo.",
8837
+ "subscriptions.updates.updateCount.description.full.committed.not_invoiced": "Importo di {{amount}} (con un minimo impegnato di {{committedCount}}) non fatturato per l\u2019intero periodo",
8838
+ "subscriptions.updates.updateCount.description.full.not_committed.invoiced": "Questa voce \xE8 stata fatturata per l\u2019intero periodo",
8839
+ "subscriptions.updates.updateCount.description.full.not_committed.not_invoiced": "Importo di {{amount}} non fatturato per l\u2019intero periodo",
8840
+ "subscriptions.updates.updateCount.description.prorata.committed.invoiced": "\xC8 stato applicato un minimo impegnato di {{committedCount}}.",
8841
+ "subscriptions.updates.updateCount.description.prorata.committed.not_invoiced": "Importo di {{amount}} (con un minimo impegnato di {{committedCount}}) non fatturato per il periodo proporzionato",
8842
+ "subscriptions.updates.updateCount.description.prorata.not_committed.invoiced": "Questa voce \xE8 stata fatturata per il periodo proporzionato",
8843
+ "subscriptions.updates.updateCount.description.prorata.not_committed.not_invoiced": "Importo di {{amount}} non fatturato per il periodo proporzionato",
8844
+ "subscriptions.updates.updatePrices": "Aggiorna prezzi per {{productName}}"
8845
+ };
8846
+
8847
+ // ../hyperline-i18n/build/locales/nl.js
8848
+ var nl = {
8849
+ "accounting.revrec.creditLineDescription": "Omzet erkennen \u2013 schema {{scheduleId}}, periode {{periodDate}}",
8850
+ "accounting.revrec.debitLineDescription": "Uitgestelde omzet verlagen \u2013 schema {{scheduleId}}, periode {{periodDate}}",
8851
+ "accounting.revrec.discountCreditLineDescription": "Omzetvermindering (korting) erkennen \u2013 schema {{scheduleId}}, periode {{periodDate}}",
8852
+ "accounting.revrec.discountDebitLineDescription": "Uitgestelde korting verlagen \u2013 schema {{scheduleId}}, periode {{periodDate}}",
8853
+ "accounting.revrec.entryDescription": "Omzeterkenning voor schema {{scheduleId}}, periode {{periodStart}} - {{periodEnd}}",
8854
+ "creditNotes.refundChargeName": "Terugbetaling voor factuur",
8855
+ "credits.bundleOf": "{{productName}} - Bundel van {{creditCount}} credits",
8856
+ "credits.unitsOf": "{{productName}} - {{creditCount}} credits",
8857
+ "einvoicing.paymentFromWallet": "Betaling uit tegoed",
8858
+ "einvoicing.paymentProcessed": "Betaling verwerkt",
8859
+ "einvoicing.paymentReceived": "Betaling ontvangen",
8860
+ "invoices.outstandingProduct.description": "Onbetaald bedrag van de factuur{{invoiceNumber}} uitgegeven op {{date}}",
8861
+ "invoices.outstandingProduct.descriptionPeriod": "Onbetaald bedrag van de factuur{{invoiceNumber}} van {{periodStart}} tot {{periodEnd}}",
8862
+ "invoices.outstandingProduct.name": "Openstaand saldo",
8863
+ "invoices.prorata.paymentForItem": "Gedeeltelijke betaling voor",
8864
+ "invoices.prorata.refundForItem": "Gedeeltelijke terugbetaling voor",
8865
+ "subscriptions.closingChargeName": "Afsluitkosten voor abonnement",
8866
+ "subscriptions.correction": "Aanpassing vorige periode",
8867
+ "subscriptions.updates.addCoupon": "Coupon toevoegen {{couponName}}",
8868
+ "subscriptions.updates.addProduct": "{{productName}} toevoegen",
8869
+ "subscriptions.updates.removeCoupon": "Coupon verwijderen {{couponName}}",
8870
+ "subscriptions.updates.removeProduct": "{{productName}} verwijderen",
8871
+ "subscriptions.updates.unit": "eenheden",
8872
+ "subscriptions.updates.updateCount": "Bijwerken {{productName}} aantal ({{previousCount}} \u2192 {{newCount}} {{unit}})",
8873
+ "subscriptions.updates.updateCount.description.full.committed.invoiced": "Een minimaal toegezegd aantal van {{committedCount}} is toegepast voor de volledige periode.",
8874
+ "subscriptions.updates.updateCount.description.full.committed.not_invoiced": "Bedrag van {{amount}} (met een minimaal toegezegd aantal van {{committedCount}}) niet gefactureerd voor de volledige periode",
8875
+ "subscriptions.updates.updateCount.description.full.not_committed.invoiced": "Deze regel is gefactureerd voor de volledige periode",
8876
+ "subscriptions.updates.updateCount.description.full.not_committed.not_invoiced": "Bedrag van {{amount}} niet gefactureerd voor de volledige periode",
8877
+ "subscriptions.updates.updateCount.description.prorata.committed.invoiced": "Een minimaal toegezegd aantal van {{committedCount}} is toegepast.",
8878
+ "subscriptions.updates.updateCount.description.prorata.committed.not_invoiced": "Bedrag van {{amount}} (met een minimaal toegezegd aantal van {{committedCount}}) niet gefactureerd voor de geproportioneerde periode",
8879
+ "subscriptions.updates.updateCount.description.prorata.not_committed.invoiced": "Deze regel is gefactureerd voor de geproportioneerde periode",
8880
+ "subscriptions.updates.updateCount.description.prorata.not_committed.not_invoiced": "Bedrag van {{amount}} niet gefactureerd voor de geproportioneerde periode",
8881
+ "subscriptions.updates.updatePrices": "Prijzen bijwerken voor {{productName}}"
8882
+ };
8883
+
8884
+ // ../hyperline-i18n/build/locales/pl.js
8885
+ var pl = {
8886
+ "accounting.revrec.creditLineDescription": "Rozpoznanie przychodu \u2013 harmonogram {{scheduleId}}, okres {{periodDate}}",
8887
+ "accounting.revrec.debitLineDescription": "Zmniejszenie przychod\xF3w przysz\u0142ych okres\xF3w \u2013 harmonogram {{scheduleId}}, okres {{periodDate}}",
8888
+ "accounting.revrec.discountCreditLineDescription": "Rozpoznanie kontra-przychodu (rabat) \u2013 harmonogram {{scheduleId}}, okres {{periodDate}}",
8889
+ "accounting.revrec.discountDebitLineDescription": "Zmniejszenie odroczonego rabatu \u2013 harmonogram {{scheduleId}}, okres {{periodDate}}",
8890
+ "accounting.revrec.entryDescription": "Rozpoznanie przychodu dla harmonogramu {{scheduleId}}, okres {{periodStart}} - {{periodEnd}}",
8891
+ "creditNotes.refundChargeName": "Zwrot za faktur\u0119",
8892
+ "credits.bundleOf": "{{productName}} - Pakiet {{creditCount}} kredyt\xF3w",
8893
+ "credits.unitsOf": "{{productName}} - {{creditCount}} kredyt\xF3w",
8894
+ "einvoicing.paymentFromWallet": "P\u0142atno\u015B\u0107 z portfela",
8895
+ "einvoicing.paymentProcessed": "P\u0142atno\u015B\u0107 przetworzona",
8896
+ "einvoicing.paymentReceived": "P\u0142atno\u015B\u0107 otrzymana",
8897
+ "invoices.outstandingProduct.description": "Nieop\u0142acona kwota z faktury{{invoiceNumber}} wystawionej {{date}}",
8898
+ "invoices.outstandingProduct.descriptionPeriod": "Nieop\u0142acona kwota z faktury{{invoiceNumber}} od {{periodStart}} do {{periodEnd}}",
8899
+ "invoices.outstandingProduct.name": "Niezap\u0142acone saldo",
8900
+ "invoices.prorata.paymentForItem": "P\u0142atno\u015B\u0107 proporcjonalna za",
8901
+ "invoices.prorata.refundForItem": "Zwrot proporcjonalny za",
8902
+ "subscriptions.closingChargeName": "Op\u0142ata za zamkni\u0119cie subskrypcji",
8903
+ "subscriptions.correction": "Korekta poprzedniego okresu",
8904
+ "subscriptions.updates.addCoupon": "Dodaj kupon {{couponName}}",
8905
+ "subscriptions.updates.addProduct": "Dodaj {{productName}}",
8906
+ "subscriptions.updates.removeCoupon": "Usu\u0144 kupon {{couponName}}",
8907
+ "subscriptions.updates.removeProduct": "Usu\u0144 {{productName}}",
8908
+ "subscriptions.updates.unit": "jednostki",
8909
+ "subscriptions.updates.updateCount": "Aktualizuj {{productName}} liczba ({{previousCount}} \u2192 {{newCount}} {{unit}})",
8910
+ "subscriptions.updates.updateCount.description.full.committed.invoiced": "Zastosowano minimaln\u0105 zobowi\u0105zan\u0105 ilo\u015B\u0107 {{committedCount}} za pe\u0142ny okres.",
8911
+ "subscriptions.updates.updateCount.description.full.committed.not_invoiced": "Kwota {{amount}} (z minimaln\u0105 zobowi\u0105zan\u0105 ilo\u015Bci\u0105 {{committedCount}}) niefakturowana za pe\u0142ny okres",
8912
+ "subscriptions.updates.updateCount.description.full.not_committed.invoiced": "Ta pozycja zosta\u0142a zafakturowana za pe\u0142ny okres",
8913
+ "subscriptions.updates.updateCount.description.full.not_committed.not_invoiced": "Kwota {{amount}} niefakturowana za pe\u0142ny okres",
8914
+ "subscriptions.updates.updateCount.description.prorata.committed.invoiced": "Zastosowano minimaln\u0105 zobowi\u0105zan\u0105 ilo\u015B\u0107 {{committedCount}}.",
8915
+ "subscriptions.updates.updateCount.description.prorata.committed.not_invoiced": "Kwota {{amount}} (z minimaln\u0105 zobowi\u0105zan\u0105 ilo\u015Bci\u0105 {{committedCount}}) niefakturowana za okres proporcjonalny",
8916
+ "subscriptions.updates.updateCount.description.prorata.not_committed.invoiced": "Ta pozycja zosta\u0142a zafakturowana za okres proporcjonalny",
8917
+ "subscriptions.updates.updateCount.description.prorata.not_committed.not_invoiced": "Kwota {{amount}} niefakturowana za okres proporcjonalny",
8918
+ "subscriptions.updates.updatePrices": "Aktualizuj ceny dla {{productName}}"
8919
+ };
8920
+
8921
+ // ../hyperline-i18n/build/locales/pt.js
8922
+ var pt = {
8923
+ "accounting.revrec.creditLineDescription": "Reconhecer receita \u2013 cronograma {{scheduleId}}, per\xEDodo {{periodDate}}",
8924
+ "accounting.revrec.debitLineDescription": "Diminui\xE7\xE3o da receita diferida \u2013 cronograma {{scheduleId}}, per\xEDodo {{periodDate}}",
8925
+ "accounting.revrec.discountCreditLineDescription": "Reconhecer contra-receita (desconto) \u2013 cronograma {{scheduleId}}, per\xEDodo {{periodDate}}",
8926
+ "accounting.revrec.discountDebitLineDescription": "Diminui\xE7\xE3o do desconto diferido \u2013 cronograma {{scheduleId}}, per\xEDodo {{periodDate}}",
8927
+ "accounting.revrec.entryDescription": "Reconhecimento de receita para o cronograma {{scheduleId}}, per\xEDodo {{periodStart}} - {{periodEnd}}",
8928
+ "creditNotes.refundChargeName": "Reembolso pela fatura",
8929
+ "credits.bundleOf": "{{productName}} - Pacote de {{creditCount}} cr\xE9ditos",
8930
+ "credits.unitsOf": "{{productName}} - {{creditCount}} cr\xE9ditos",
8931
+ "einvoicing.paymentFromWallet": "Pagamento da carteira",
8932
+ "einvoicing.paymentProcessed": "Pagamento processado",
8933
+ "einvoicing.paymentReceived": "Pagamento recebido",
8934
+ "invoices.outstandingProduct.description": "Valor em aberto da fatura{{invoiceNumber}} emitida em {{date}}",
8935
+ "invoices.outstandingProduct.descriptionPeriod": "Valor em aberto da fatura{{invoiceNumber}} de {{periodStart}} a {{periodEnd}}",
8936
+ "invoices.outstandingProduct.name": "Saldo em aberto",
8937
+ "invoices.prorata.paymentForItem": "Pagamento proporcional por",
8938
+ "invoices.prorata.refundForItem": "Reembolso proporcional por",
8939
+ "subscriptions.closingChargeName": "Taxa de encerramento da assinatura",
8940
+ "subscriptions.correction": "Ajuste do per\xEDodo anterior",
8941
+ "subscriptions.updates.addCoupon": "Adicionar cupom {{couponName}}",
8942
+ "subscriptions.updates.addProduct": "Adicionar {{productName}}",
8943
+ "subscriptions.updates.removeCoupon": "Remover cupom {{couponName}}",
8944
+ "subscriptions.updates.removeProduct": "Remover {{productName}}",
8945
+ "subscriptions.updates.unit": "unidades",
8946
+ "subscriptions.updates.updateCount": "Atualizar {{productName}} quantidade ({{previousCount}} \u2192 {{newCount}} {{unit}})",
8947
+ "subscriptions.updates.updateCount.description.full.committed.invoiced": "Foi aplicado um m\xEDnimo comprometido de {{committedCount}} para o per\xEDodo completo.",
8948
+ "subscriptions.updates.updateCount.description.full.committed.not_invoiced": "Valor de {{amount}} (com um m\xEDnimo comprometido de {{committedCount}}) n\xE3o faturado para o per\xEDodo completo",
8949
+ "subscriptions.updates.updateCount.description.full.not_committed.invoiced": "Esta linha foi faturada para o per\xEDodo completo",
8950
+ "subscriptions.updates.updateCount.description.full.not_committed.not_invoiced": "Valor de {{amount}} n\xE3o faturado para o per\xEDodo completo",
8951
+ "subscriptions.updates.updateCount.description.prorata.committed.invoiced": "Foi aplicado um m\xEDnimo comprometido de {{committedCount}}.",
8952
+ "subscriptions.updates.updateCount.description.prorata.committed.not_invoiced": "Valor de {{amount}} (com um m\xEDnimo comprometido de {{committedCount}}) n\xE3o faturado para o per\xEDodo proporcional",
8953
+ "subscriptions.updates.updateCount.description.prorata.not_committed.invoiced": "Esta linha foi faturada para o per\xEDodo proporcional",
8954
+ "subscriptions.updates.updateCount.description.prorata.not_committed.not_invoiced": "Valor de {{amount}} n\xE3o faturado para o per\xEDodo proporcional",
8955
+ "subscriptions.updates.updatePrices": "Atualizar pre\xE7os para {{productName}}"
8956
+ };
8957
+
8958
+ // ../hyperline-i18n/build/language.js
8959
+ var LanguageSchema = z5.enum(languages.map((language) => language.isoCode));
8960
+ var translations = {
8961
+ en,
8962
+ fr,
8963
+ de,
8964
+ it,
8965
+ nl,
8966
+ es,
8967
+ pt,
8968
+ pl
8969
+ };
8970
+ i18next.init({
8971
+ fallbackLng: "en",
8972
+ keySeparator: false,
8973
+ resources: Object.fromEntries(Object.entries(translations).map(([isoCode, translation]) => [
8974
+ isoCode,
8975
+ { translation }
8976
+ // "translation" is used as namespace name
8977
+ ]))
8978
+ });
8979
+
8980
+ // ../hyperline-i18n/build/locale.js
8981
+ import { z as z6 } from "zod";
8982
+ var LocaleSchema = z6.string().refine((value) => {
8983
+ const [language, country] = value.split("-");
8984
+ return LanguageSchema.safeParse(language).success && z6.string().length(2).refine((value2) => value2 === value2.toUpperCase()).safeParse(country).success;
8985
+ }, { message: "Invalid locale format" });
8986
+
8987
+ // ../hyperline-i18n/build/timezone.js
8988
+ import { getTimezones } from "@hyperline/shared";
8989
+ import { z as z7 } from "zod";
8990
+ var TimezoneSchema = z7.enum(getTimezones().map((timezone) => timezone.name));
8991
+
7889
8992
  // ../hyperline-lib/build/http/helpers/request.js
7890
- import { isValidLanguage } from "@hyperline/i18n";
7891
- import { z as z4 } from "zod";
8993
+ import { z as z8 } from "zod";
7892
8994
 
7893
8995
  // ../hyperline-lib/build/http/middlewares/distributedRateLimiter.js
7894
- import { logger as logger2 } from "@hyperline/monitoring";
7895
8996
  import { RateLimiterRedis, RateLimiterRes } from "rate-limiter-flexible";
7896
8997
 
7897
8998
  // ../hyperline-lib/build/http/middlewares/httpErrorHandler.js
@@ -7901,7 +9002,6 @@ import { ZodError as ZodError3 } from "zod";
7901
9002
  // ../hyperline-lib/build/http/middlewares/idempotency.js
7902
9003
  import { createHash as createHash2 } from "node:crypto";
7903
9004
  import { isDeepStrictEqual } from "node:util";
7904
- import { logger as logger3 } from "@hyperline/monitoring";
7905
9005
  import { idempotency } from "express-idempotency";
7906
9006
 
7907
9007
  // ../hyperline-lib/build/http/middlewares/httpErrorHandler.js
@@ -7910,15 +9010,11 @@ var isProduction = ["production", "sandbox"].includes(
7910
9010
  process.env.NODE_ENV ?? "production"
7911
9011
  );
7912
9012
 
7913
- // ../hyperline-lib/build/http/helpers/clientIp.js
7914
- import { logger as logger4 } from "@hyperline/monitoring";
7915
-
7916
9013
  // ../hyperline-lib/build/httpClient/error.js
7917
9014
  import axios from "axios";
7918
9015
  var isAxiosError = axios.isAxiosError;
7919
9016
 
7920
9017
  // ../hyperline-lib/build/httpClient/httpClient.js
7921
- import { logHttpRequest, logHttpResponse } from "@hyperline/monitoring";
7922
9018
  import axios2 from "axios";
7923
9019
  import axiosRetry, { isNetworkOrIdempotentRequestError } from "axios-retry";
7924
9020
  import { AxiosError } from "axios";
@@ -7930,13 +9026,13 @@ var recommendedRetryConfig = {
7930
9026
  retryDelay: axiosRetry.exponentialDelay
7931
9027
  };
7932
9028
  function buildHttpClient(dependencies) {
7933
- const { logger: logger6, config, retry } = dependencies;
7934
- const client = axios2.create(config);
9029
+ const { logger: logger2, config: config2, retry } = dependencies;
9030
+ const client = axios2.create(config2);
7935
9031
  if (retry !== "none") {
7936
9032
  axiosRetry(client, {
7937
9033
  ...dependencies.retry === "custom" ? dependencies.retryConfig : dependencies.retry === "recommended" ? recommendedRetryConfig : {},
7938
9034
  onRetry(retryCount, error, requestConfig) {
7939
- logHttpRequest(logger6, toLogRequest(requestConfig), {
9035
+ logHttpRequest(logger2, toLogRequest(requestConfig), {
7940
9036
  postfix: `[EXTERNAL] (attempt ${retryCount})`,
7941
9037
  metadata: {
7942
9038
  // biome-ignore lint/correctness/useParseIntRadix: ignore
@@ -7948,7 +9044,7 @@ function buildHttpClient(dependencies) {
7948
9044
  });
7949
9045
  }
7950
9046
  client.interceptors.request.use((requestConfig) => {
7951
- logHttpRequest(logger6, toLogRequest(requestConfig), {
9047
+ logHttpRequest(logger2, toLogRequest(requestConfig), {
7952
9048
  postfix: "[EXTERNAL]"
7953
9049
  });
7954
9050
  requestConfig.metadata = { timeStart: /* @__PURE__ */ new Date() };
@@ -7960,14 +9056,14 @@ function buildHttpClient(dependencies) {
7960
9056
  const { config: responseConfig, status } = response;
7961
9057
  const timeStart = responseConfig.metadata.timeStart;
7962
9058
  const responseTime = timeStart ? Date.now() - timeStart : void 0;
7963
- logHttpResponse(logger6, { request: toLogRequest(responseConfig), statusCode: status }, responseTime);
9059
+ logHttpResponse(logger2, { request: toLogRequest(responseConfig), statusCode: status }, responseTime);
7964
9060
  return response;
7965
9061
  }, (error) => {
7966
9062
  if (error.response) {
7967
9063
  const { config: responseConfig, status } = error.response;
7968
9064
  const timeStart = responseConfig.metadata.timeStart;
7969
9065
  const responseTime = timeStart ? Date.now() - timeStart : void 0;
7970
- logHttpResponse(logger6, { request: toLogRequest(responseConfig), statusCode: status }, responseTime, { metadata: { error: error.message } });
9066
+ logHttpResponse(logger2, { request: toLogRequest(responseConfig), statusCode: status }, responseTime, { metadata: { error: error.message } });
7971
9067
  }
7972
9068
  return Promise.reject(error);
7973
9069
  });
@@ -7976,20 +9072,19 @@ function buildHttpClient(dependencies) {
7976
9072
  function isTooManyRequestsError(error) {
7977
9073
  return error.response?.status === 429;
7978
9074
  }
7979
- var toLogRequest = (config) => {
9075
+ var toLogRequest = (config2) => {
7980
9076
  return {
7981
- method: config.method ?? "",
7982
- url: config.url ?? "",
7983
- path: config.url ?? "",
7984
- hostname: config.baseURL ?? "",
7985
- originalUrl: `${config.baseURL}${config.url}`,
7986
- body: config.data,
9077
+ method: config2.method ?? "",
9078
+ url: config2.url ?? "",
9079
+ path: config2.url ?? "",
9080
+ hostname: config2.baseURL ?? "",
9081
+ originalUrl: `${config2.baseURL}${config2.url}`,
9082
+ body: config2.data,
7987
9083
  headers: {}
7988
9084
  };
7989
9085
  };
7990
9086
 
7991
9087
  // ../hyperline-lib/build/httpRouter/express.js
7992
- import { runWithExecutionContext } from "@hyperline/monitoring";
7993
9088
  import { OpenAPIRegistry as OpenAPIRegistry2, OpenApiGeneratorV31 } from "@asteasolutions/zod-to-openapi";
7994
9089
  import { Router as ExpressRouter } from "express";
7995
9090
  import multer2 from "multer";
@@ -8066,12 +9161,11 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8066
9161
  import { createHmac } from "node:crypto";
8067
9162
 
8068
9163
  // ../hyperline-mcp/build/session/sessionManager.js
8069
- import { logger as logger5 } from "@hyperline/monitoring";
8070
9164
  import { LRUCache } from "lru-cache";
8071
9165
 
8072
9166
  // build/output.js
8073
- function formatOutput({ data, format: format2 }) {
8074
- if (format2 === "json") {
9167
+ function formatOutput({ data, format: format3 }) {
9168
+ if (format3 === "json") {
8075
9169
  return JSON.stringify(data, null, 2);
8076
9170
  }
8077
9171
  return formatText(data);
@@ -8112,7 +9206,7 @@ ${formatText(value, indent + 2)}`;
8112
9206
  }
8113
9207
 
8114
9208
  // build/http.js
8115
- function createCLIContext({ apiKey, baseUrl, outputFormat, source }) {
9209
+ function createCLIContext({ apiKey, baseUrl, outputFormat, source, companyId }) {
8116
9210
  const noop = () => {
8117
9211
  };
8118
9212
  const httpClient = buildHttpClient({
@@ -8126,8 +9220,9 @@ function createCLIContext({ apiKey, baseUrl, outputFormat, source }) {
8126
9220
  }
8127
9221
  });
8128
9222
  return {
9223
+ baseUrl,
8129
9224
  outputFormat,
8130
- async execute({ method, path: path2, args, queryParamKeys = [], body }) {
9225
+ async execute({ method, path: path2, args, queryParamKeys = [], body, baseUrlOverride }) {
8131
9226
  const { url, params, data } = buildRequestConfig(path2, args, method, queryParamKeys);
8132
9227
  const requestData = body ?? data;
8133
9228
  const hasData = Array.isArray(requestData) ? requestData.length > 0 : requestData != null && Object.keys(requestData).length > 0;
@@ -8137,8 +9232,10 @@ function createCLIContext({ apiKey, baseUrl, outputFormat, source }) {
8137
9232
  url,
8138
9233
  params,
8139
9234
  data: hasData ? requestData : void 0,
9235
+ ...baseUrlOverride ? { baseURL: baseUrlOverride } : {},
8140
9236
  headers: {
8141
- "Hyperline-Source": source
9237
+ "Hyperline-Source": source,
9238
+ ...companyId ? { "Hyperline-CompanyId": companyId } : {}
8142
9239
  }
8143
9240
  });
8144
9241
  process.stdout.write(formatOutput({ data: response.data, format: outputFormat }));
@@ -8184,7 +9281,7 @@ function isAxiosError2(error) {
8184
9281
 
8185
9282
  // build/bin/hyperline.js
8186
9283
  var program = new Command();
8187
- program.name("hyperline").description("Agent-first CLI for the Hyperline API").version("0.1.0").option("--api-key <key>", "Hyperline API key (overrides HYPERLINE_API_KEY)").option("--base-url <url>", "API base URL (overrides HYPERLINE_API_URL)").option("--output <format>", "Output format: json or text", "text");
9284
+ program.name("hyperline").description("Agent-first CLI for the Hyperline API").version("0.1.0").option("--api-key <key>", "Hyperline API key (overrides HYPERLINE_API_KEY)").option("--base-url <url>", "API base URL (overrides HYPERLINE_API_URL)").option("--output <format>", "Output format: json or text", "text").option("--company-id <id>", "Company ID (overrides HYPERLINE_COMPANY_ID and stored selection)");
8188
9285
  program.command("login").description("Authenticate with Hyperline via browser").action(async () => {
8189
9286
  const options = program.opts();
8190
9287
  const baseUrl = await resolveBaseUrl({
@@ -8196,10 +9293,64 @@ program.command("logout").description("Clear stored credentials").action(async (
8196
9293
  await clearCredentials();
8197
9294
  process.stdout.write("Logged out.\n");
8198
9295
  });
9296
+ var companyCommand = program.command("company").description("Manage active company");
9297
+ companyCommand.command("select").description("Interactively select the active company").action(async () => {
9298
+ const options = program.opts();
9299
+ const baseUrl = await resolveBaseUrl({
9300
+ flagBaseUrl: options.baseUrl
9301
+ });
9302
+ const apiKey = resolveApiKey({
9303
+ flagApiKey: options.apiKey
9304
+ });
9305
+ const accessToken = apiKey ?? await resolveAccessToken();
9306
+ if (!accessToken) {
9307
+ process.stderr.write("Error: No authentication found. Run: hyperline login\n");
9308
+ process.exit(1);
9309
+ }
9310
+ await promptCompanySelection({ baseUrl, accessToken });
9311
+ });
9312
+ companyCommand.command("set <companyId>").description("Set the active company by ID (for scripts and agents)").action(async (companyId) => {
9313
+ await saveCompanyId({ companyId });
9314
+ process.stdout.write(`Company set to ${companyId}
9315
+ `);
9316
+ });
9317
+ companyCommand.command("list").description("List all accessible companies").action(async () => {
9318
+ const options = program.opts();
9319
+ const baseUrl = await resolveBaseUrl({
9320
+ flagBaseUrl: options.baseUrl
9321
+ });
9322
+ const apiKey = resolveApiKey({
9323
+ flagApiKey: options.apiKey
9324
+ });
9325
+ const accessToken = apiKey ?? await resolveAccessToken();
9326
+ if (!accessToken) {
9327
+ process.stderr.write("Error: No authentication found. Run: hyperline login\n");
9328
+ process.exit(1);
9329
+ }
9330
+ const companies = await fetchCompanies({ baseUrl, accessToken });
9331
+ const currentCompanyId = await resolveCompanyId({});
9332
+ for (const company of companies) {
9333
+ const marker = company.id === currentCompanyId ? " (active)" : "";
9334
+ process.stdout.write(`${company.name} ${company.id}${marker}
9335
+ `);
9336
+ }
9337
+ });
9338
+ companyCommand.command("current").description("Show the currently active company").action(async () => {
9339
+ const companyId = await resolveCompanyId({});
9340
+ if (companyId) {
9341
+ process.stdout.write(`${companyId}
9342
+ `);
9343
+ } else {
9344
+ process.stdout.write("No company selected. Run: hyperline company select\n");
9345
+ }
9346
+ });
8199
9347
  registerAllCommands(program);
9348
+ registerEventsCommands(program);
9349
+ var selfAuthCommands = /* @__PURE__ */ new Set(["login", "logout", "company"]);
8200
9350
  program.hook("preAction", async (thisCommand, actionCommand) => {
8201
9351
  const commandName = actionCommand.name();
8202
- if (commandName === "login" || commandName === "logout")
9352
+ const parentName = actionCommand.parent?.name();
9353
+ if (selfAuthCommands.has(commandName) || selfAuthCommands.has(parentName ?? ""))
8203
9354
  return;
8204
9355
  const options = program.opts();
8205
9356
  const outputFormat = options.output ?? "text";
@@ -8214,11 +9365,15 @@ program.hook("preAction", async (thisCommand, actionCommand) => {
8214
9365
  const baseUrl = await resolveBaseUrl({
8215
9366
  flagBaseUrl: options.baseUrl
8216
9367
  });
9368
+ const companyId = await resolveCompanyId({
9369
+ flagCompanyId: options.companyId
9370
+ });
8217
9371
  const ctx = createCLIContext({
8218
9372
  apiKey: token,
8219
9373
  baseUrl,
8220
9374
  outputFormat,
8221
- source: apiKey ? "cli" : "cli-oauth"
9375
+ source: "cli",
9376
+ companyId
8222
9377
  });
8223
9378
  thisCommand.setOptionValue("_ctx", ctx);
8224
9379
  });