@hyperline/cli 0.1.0-build.1.2600806 → 0.1.0-build.1.26970f8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/hyperline-main.js +529 -455
- package/package.json +1 -1
|
@@ -40278,7 +40278,7 @@ Payment method strategy used to charge the invoice. Only applies to \`to_pay\` s
|
|
|
40278
40278
|
|
|
40279
40279
|
- \`current\`: Use the current default payment method of the customer.
|
|
40280
40280
|
- \`external\`: Manage the payment of the invoice outside of Hyperline.
|
|
40281
|
-
`).option("--payment-method-id <value>", `ID of the default payment method used to pay the invoice. Transactions related to the invoice may use different payment methods.`).option("--bank-account-id <value>", `ID of the bank account displayed on the invoice. Transactions related to the invoice may use different bank accounts.`).option("--subscription-id <value>", `ID of the subscription related to the invoice.`).option("--emitted-at <value>", `Issue date of the invoice.`).option("--due-at <value>", `Due date of the invoice. Computed from the issue date and the payment delay configured in your settings.`).option("--settled-at <value>", `Date the invoice was fully paid.`).option("--properties <value>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <value>", `Values for custom properties defined for the \`invoice\` entity, keyed by slug.`).requiredOption("--line-items <value>", `line_items`).option("--transactions <value>", `transactions`).option("--coupons <value>", `coupons`).addHelpText("after", `
|
|
40281
|
+
`).option("--payment-method-id <value>", `ID of the default payment method used to pay the invoice. Transactions related to the invoice may use different payment methods.`).option("--bank-account-id <value>", `ID of the bank account displayed on the invoice. Transactions related to the invoice may use different bank accounts.`).option("--subscription-id <value>", `ID of the subscription related to the invoice.`).option("--emitted-at <value>", `Issue date of the invoice.`).option("--due-at <value>", `Due date of the invoice. Computed from the issue date and the payment delay configured in your settings.`).option("--settled-at <value>", `Date the invoice was fully paid.`).option("--properties <value>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <value>", `Values for custom properties defined for the \`invoice\` entity, keyed by slug.`).option("--additional-display-fields <value>", `Ordered additional fields displayed on the invoice PDF. Custom properties are referenced by slug.`).requiredOption("--line-items <value>", `line_items`).option("--transactions <value>", `transactions`).option("--coupons <value>", `coupons`).addHelpText("after", `
|
|
40282
40282
|
Examples:
|
|
40283
40283
|
hyperline invoices create-invoice --customer-id <customer_id> --line-items <line_items>
|
|
40284
40284
|
hyperline invoices create-invoice --customer-id <customer_id> --line-items <line_items> --currency <currency> --status <status>
|
|
@@ -40333,6 +40333,8 @@ Examples:
|
|
|
40333
40333
|
args.properties = opts.properties;
|
|
40334
40334
|
if (opts.customProperties !== void 0)
|
|
40335
40335
|
args.custom_properties = opts.customProperties;
|
|
40336
|
+
if (opts.additionalDisplayFields !== void 0)
|
|
40337
|
+
args.additional_display_fields = opts.additionalDisplayFields;
|
|
40336
40338
|
if (opts.lineItems !== void 0)
|
|
40337
40339
|
args.line_items = opts.lineItems;
|
|
40338
40340
|
if (opts.transactions !== void 0)
|
|
@@ -40514,7 +40516,7 @@ Examples:
|
|
|
40514
40516
|
|
|
40515
40517
|
- \`auto\`: Tax is automatically computed and applied.
|
|
40516
40518
|
- \`not_eligible\`: Tax collection is disabled for the invoice.
|
|
40517
|
-
`).option("--line-items <value>", `line_items`).option("--coupons <value>", `coupons`).option("--payment-method-type <value>", `payment_method_type`).option("--payment-method-id <value>", `ID of the default payment method used to pay the invoice. Transactions related to the invoice may use different payment methods.`).option("--bank-account-id <value>", `ID of the bank account displayed on the invoice. Transactions related to the invoice may use different bank accounts.`).option("--properties <value>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <value>", `Values for custom properties defined for the \`invoice\` entity, keyed by slug.`).option("--customer <value>", `Override customer details on the invoice. Only allowed for draft or grace period invoices.`).addHelpText("after", `
|
|
40519
|
+
`).option("--line-items <value>", `line_items`).option("--coupons <value>", `coupons`).option("--payment-method-type <value>", `payment_method_type`).option("--payment-method-id <value>", `ID of the default payment method used to pay the invoice. Transactions related to the invoice may use different payment methods.`).option("--bank-account-id <value>", `ID of the bank account displayed on the invoice. Transactions related to the invoice may use different bank accounts.`).option("--properties <value>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <value>", `Values for custom properties defined for the \`invoice\` entity, keyed by slug.`).option("--additional-display-fields <value>", `Ordered additional fields displayed on the invoice PDF. Custom properties are referenced by slug.`).option("--customer <value>", `Override customer details on the invoice. Only allowed for draft or grace period invoices.`).addHelpText("after", `
|
|
40518
40520
|
Examples:
|
|
40519
40521
|
hyperline invoices update --id <id>
|
|
40520
40522
|
hyperline invoices update --id <id> --type <type> --document-name <document_name>
|
|
@@ -40557,6 +40559,8 @@ Examples:
|
|
|
40557
40559
|
args.properties = opts.properties;
|
|
40558
40560
|
if (opts.customProperties !== void 0)
|
|
40559
40561
|
args.custom_properties = opts.customProperties;
|
|
40562
|
+
if (opts.additionalDisplayFields !== void 0)
|
|
40563
|
+
args.additional_display_fields = opts.additionalDisplayFields;
|
|
40560
40564
|
if (opts.customer !== void 0)
|
|
40561
40565
|
args.customer = opts.customer;
|
|
40562
40566
|
await ctx.execute({
|
|
@@ -40749,7 +40753,7 @@ Examples:
|
|
|
40749
40753
|
queryParamKeys: []
|
|
40750
40754
|
});
|
|
40751
40755
|
});
|
|
40752
|
-
resource.command("create-invoicing-entity").description(`Create a new invoicing entity with company details, address, and tax configuration. Used as the sender on invoices.`).option("--is-default", `Flag to indicate if this is the default invoicing entity. If true, it will switch the other existing invoicing entities to non-default.`).requiredOption("--name <value>", `The name of the invoicing entity.`).option("--trade-name <value>", `The trade name of the invoicing entity.`).option("--timezone <value>", `The timezone the invoicing entity operates in.`).option("--language <value>", `The default language of the invoicing entity.`).option("--registration-number <value>", `The registration number of the invoicing entity.`).option("--tax-id <value>", `The tax identification number of the invoicing entity.`).option("--billing-email <value>", `The billing email address for the invoicing entity.`).option("--address-line1 <value>", `The first line of the address for the invoicing entity.`).option("--address-line2 <value>", `The second line of the address for the invoicing entity.`).option("--zip-code <value>", `The postal code for the invoicing entity's address.`).option("--state <value>", `The state or province of the invoicing entity.`).option("--city <value>", `The city of the invoicing entity.`).requiredOption("--country <value>", `The country in which the invoicing entity is registered.`).requiredOption("--currency <value>", `The currency code that the invoicing entity operates in.`).requiredOption("--accounting-currency <value>", `The currency used for accounting purposes.`).option("--invoice-number-pattern <value>", `The pattern used for generating invoice numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--credit-note-number-pattern <value>", `The pattern used for generating credit note numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--document-number-pattern <value>", `The pattern used for generating document numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--next-invoice-number <number>", `The next invoice number to be used.`).option("--next-credit-note-number <number>", `The next credit note number to be used.`).option("--next-document-number <number>", `The next document number to be used.`).option("--default-payment-delay <number>", `The default payment term in days.`).option("--invoice-grace-period-duration <number>", `The grace period duration in days.`).option("--invoice-payment-initiation-delay <number>", `The payment initiation delay in days for the invoices.`).option("--document-payment-initiation-delay <number>", `The payment initiation delay in days for the custom documents.`).option("--invoice-late-fees <value>", `The late fees applicable to the invoices.`).option("--invoice-footer <value>", `The footer text to be used in invoices.`).option("--document-footer <value>", `The footer text to be used in documents. If not specified, the invoice footer will be used.`).option("--quote-footer <value>", `The footer text to be used in quotes.`).option("--logo-url <value>", `URL of the logo to be used in invoices.`).option("--favicon-url <value>", `URL of the logo to be used as favicon.`).option("--brand-color <value>", `Brand color to be used in invoices (hexadecimal color code).`).option("--forced-customer-type <value>", `Forces all customers created under this invoicing entity to have this type. Set to null to allow users to choose.`).option("--credit-note-wallet-refund-enabled", `When enabled, credit note refunds default to the customer's wallet for invoices under this invoicing entity. The default applies only when \`refund_method\` is omitted on \`POST /v1/invoices/{id}/credit-notes\`; an explicit \`refund_method\` always wins. Requires wallets to be enabled at the workspace level.`).addHelpText("after", `
|
|
40756
|
+
resource.command("create-invoicing-entity").description(`Create a new invoicing entity with company details, address, and tax configuration. Used as the sender on invoices.`).option("--is-default", `Flag to indicate if this is the default invoicing entity. If true, it will switch the other existing invoicing entities to non-default.`).requiredOption("--name <value>", `The name of the invoicing entity.`).option("--trade-name <value>", `The trade name of the invoicing entity.`).option("--timezone <value>", `The timezone the invoicing entity operates in.`).option("--language <value>", `The default language of the invoicing entity.`).option("--registration-number <value>", `The registration number of the invoicing entity.`).option("--tax-id <value>", `The tax identification number of the invoicing entity.`).option("--billing-email <value>", `The billing email address for the invoicing entity.`).option("--address-line1 <value>", `The first line of the address for the invoicing entity.`).option("--address-line2 <value>", `The second line of the address for the invoicing entity.`).option("--zip-code <value>", `The postal code for the invoicing entity's address.`).option("--state <value>", `The state or province of the invoicing entity.`).option("--city <value>", `The city of the invoicing entity.`).requiredOption("--country <value>", `The country in which the invoicing entity is registered.`).requiredOption("--currency <value>", `The currency code that the invoicing entity operates in.`).requiredOption("--accounting-currency <value>", `The currency used for accounting purposes.`).option("--invoice-number-pattern <value>", `The pattern used for generating invoice numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--credit-note-number-pattern <value>", `The pattern used for generating credit note numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--document-number-pattern <value>", `The pattern used for generating document numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--next-invoice-number <number>", `The next invoice number to be used.`).option("--next-credit-note-number <number>", `The next credit note number to be used.`).option("--next-document-number <number>", `The next document number to be used.`).option("--default-payment-delay <number>", `The default payment term in days.`).option("--invoice-grace-period-duration <number>", `The grace period duration in days.`).option("--invoice-payment-initiation-delay <number>", `The payment initiation delay in days for the invoices.`).option("--document-payment-initiation-delay <number>", `The payment initiation delay in days for the custom documents.`).option("--invoice-late-fees <value>", `The late fees applicable to the invoices.`).option("--invoice-footer <value>", `The footer text to be used in invoices.`).option("--document-footer <value>", `The footer text to be used in documents. If not specified, the invoice footer will be used.`).option("--quote-footer <value>", `The footer text to be used in quotes.`).option("--logo-url <value>", `URL of the logo to be used in invoices.`).option("--favicon-url <value>", `URL of the logo to be used as favicon.`).option("--brand-color <value>", `Brand color to be used in invoices (hexadecimal color code).`).option("--forced-customer-type <value>", `Forces all customers created under this invoicing entity to have this type. Set to null to allow users to choose.`).option("--credit-note-wallet-refund-enabled", `When enabled, credit note refunds default to the customer's wallet for invoices under this invoicing entity. The default applies only when \`refund_method\` is omitted on \`POST /v1/invoices/{id}/credit-notes\`; an explicit \`refund_method\` always wins. Requires wallets to be enabled at the workspace level.`).option("--standalone-credit-note-creation-enabled", `Whether credit notes without an original invoice can be created under this invoicing entity.`).addHelpText("after", `
|
|
40753
40757
|
Examples:
|
|
40754
40758
|
hyperline invoicing-entities create-invoicing-entity --name <name> --country <country> --currency <currency> --accounting-currency <accounting_currency>
|
|
40755
40759
|
hyperline invoicing-entities create-invoicing-entity --name <name> --country <country> --currency <currency> --accounting-currency <accounting_currency> --is-default --trade-name <trade_name>
|
|
@@ -40830,6 +40834,8 @@ Examples:
|
|
|
40830
40834
|
args.is_default = true;
|
|
40831
40835
|
if (opts.creditNoteWalletRefundEnabled !== void 0)
|
|
40832
40836
|
args.credit_note_wallet_refund_enabled = true;
|
|
40837
|
+
if (opts.standaloneCreditNoteCreationEnabled !== void 0)
|
|
40838
|
+
args.standalone_credit_note_creation_enabled = true;
|
|
40833
40839
|
await ctx.execute({
|
|
40834
40840
|
method: "POST",
|
|
40835
40841
|
path: "/v1/invoicing-entities",
|
|
@@ -40837,7 +40843,7 @@ Examples:
|
|
|
40837
40843
|
queryParamKeys: []
|
|
40838
40844
|
});
|
|
40839
40845
|
});
|
|
40840
|
-
resource.command("update-invoicing-entity").description(`Update an existing invoicing entity's details (address, tax ID, branding, etc.).`).requiredOption("--id <value>", `id parameter`).option("--name <value>", `The name of the invoicing entity.`).option("--registration-number <value>", `The registration number of the invoicing entity.`).option("--tax-id <value>", `The tax identification number of the invoicing entity.`).option("--billing-email <value>", `The billing email address for the invoicing entity.`).option("--timezone <value>", `The timezone the invoicing entity operates in.`).option("--language <value>", `The default language of the invoicing entity.`).option("--is-default", `Flag to indicate if this is the default invoicing entity. If true, it will switch the other existing invoicing entities to non-default.`).option("--address-line1 <value>", `The first line of the address for the invoicing entity.`).option("--address-line2 <value>", `The second line of the address for the invoicing entity.`).option("--zip-code <value>", `The postal code for the invoicing entity's address.`).option("--state <value>", `The state or province of the invoicing entity.`).option("--city <value>", `The city of the invoicing entity.`).option("--country <value>", `The country in which the invoicing entity is registered.`).option("--currency <value>", `The currency code that the invoicing entity operates in.`).option("--accounting-currency <value>", `The currency used for accounting purposes.`).option("--invoice-number-pattern <value>", `The pattern used for generating invoice numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--credit-note-number-pattern <value>", `The pattern used for generating credit note numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--document-number-pattern <value>", `The pattern used for generating document numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--default-payment-delay <number>", `The default payment term in days.`).option("--invoice-grace-period-duration <number>", `The grace period duration in days.`).option("--invoice-payment-initiation-delay <number>", `The payment initiation delay in days for the invoices.`).option("--document-payment-initiation-delay <number>", `The payment initiation delay in days for the custom documents.`).option("--invoice-late-fees <value>", `The late fees applicable to the invoices.`).option("--invoice-footer <value>", `The footer text to be used in invoices.`).option("--document-footer <value>", `The footer text to be used in documents. If not specified, the invoice footer will be used.`).option("--logo-url <value>", `URL of the logo to be used in invoices.`).option("--favicon-url <value>", `URL of the logo to be used as favicon.`).option("--brand-color <value>", `Brand color to be used in invoices (hexadecimal color code).`).option("--forced-customer-type <value>", `Forces all customers created under this invoicing entity to have this type. Set to null to allow users to choose.`).option("--credit-note-wallet-refund-enabled", `When enabled, credit note refunds default to the customer's wallet for invoices under this invoicing entity. The default applies only when \`refund_method\` is omitted on \`POST /v1/invoices/{id}/credit-notes\`; an explicit \`refund_method\` always wins. Requires wallets to be enabled at the workspace level.`).addHelpText("after", `
|
|
40846
|
+
resource.command("update-invoicing-entity").description(`Update an existing invoicing entity's details (address, tax ID, branding, etc.).`).requiredOption("--id <value>", `id parameter`).option("--name <value>", `The name of the invoicing entity.`).option("--registration-number <value>", `The registration number of the invoicing entity.`).option("--tax-id <value>", `The tax identification number of the invoicing entity.`).option("--billing-email <value>", `The billing email address for the invoicing entity.`).option("--timezone <value>", `The timezone the invoicing entity operates in.`).option("--language <value>", `The default language of the invoicing entity.`).option("--is-default", `Flag to indicate if this is the default invoicing entity. If true, it will switch the other existing invoicing entities to non-default.`).option("--address-line1 <value>", `The first line of the address for the invoicing entity.`).option("--address-line2 <value>", `The second line of the address for the invoicing entity.`).option("--zip-code <value>", `The postal code for the invoicing entity's address.`).option("--state <value>", `The state or province of the invoicing entity.`).option("--city <value>", `The city of the invoicing entity.`).option("--country <value>", `The country in which the invoicing entity is registered.`).option("--currency <value>", `The currency code that the invoicing entity operates in.`).option("--accounting-currency <value>", `The currency used for accounting purposes.`).option("--invoice-number-pattern <value>", `The pattern used for generating invoice numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--credit-note-number-pattern <value>", `The pattern used for generating credit note numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--document-number-pattern <value>", `The pattern used for generating document numbers. Available dynamic elements: number {number} (mandatory), year {YYYY}, month {MM} and day {DD}.`).option("--default-payment-delay <number>", `The default payment term in days.`).option("--invoice-grace-period-duration <number>", `The grace period duration in days.`).option("--invoice-payment-initiation-delay <number>", `The payment initiation delay in days for the invoices.`).option("--document-payment-initiation-delay <number>", `The payment initiation delay in days for the custom documents.`).option("--invoice-late-fees <value>", `The late fees applicable to the invoices.`).option("--invoice-footer <value>", `The footer text to be used in invoices.`).option("--document-footer <value>", `The footer text to be used in documents. If not specified, the invoice footer will be used.`).option("--logo-url <value>", `URL of the logo to be used in invoices.`).option("--favicon-url <value>", `URL of the logo to be used as favicon.`).option("--brand-color <value>", `Brand color to be used in invoices (hexadecimal color code).`).option("--forced-customer-type <value>", `Forces all customers created under this invoicing entity to have this type. Set to null to allow users to choose.`).option("--credit-note-wallet-refund-enabled", `When enabled, credit note refunds default to the customer's wallet for invoices under this invoicing entity. The default applies only when \`refund_method\` is omitted on \`POST /v1/invoices/{id}/credit-notes\`; an explicit \`refund_method\` always wins. Requires wallets to be enabled at the workspace level.`).option("--standalone-credit-note-creation-enabled", `Whether credit notes without an original invoice can be created under this invoicing entity.`).addHelpText("after", `
|
|
40841
40847
|
Examples:
|
|
40842
40848
|
hyperline invoicing-entities update-invoicing-entity --id <id>
|
|
40843
40849
|
hyperline invoicing-entities update-invoicing-entity --id <id> --name <name> --registration-number <registration_number>
|
|
@@ -40910,6 +40916,8 @@ Examples:
|
|
|
40910
40916
|
args.is_default = true;
|
|
40911
40917
|
if (opts.creditNoteWalletRefundEnabled !== void 0)
|
|
40912
40918
|
args.credit_note_wallet_refund_enabled = true;
|
|
40919
|
+
if (opts.standaloneCreditNoteCreationEnabled !== void 0)
|
|
40920
|
+
args.standalone_credit_note_creation_enabled = true;
|
|
40913
40921
|
await ctx.execute({
|
|
40914
40922
|
method: "PUT",
|
|
40915
40923
|
path: "/v1/invoicing-entities/{id}",
|
|
@@ -41125,6 +41133,24 @@ Examples:
|
|
|
41125
41133
|
]
|
|
41126
41134
|
});
|
|
41127
41135
|
});
|
|
41136
|
+
resource.command("get").description(`Retrieve a price configuration by ID, including its prices and external integration references.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
|
|
41137
|
+
Examples:
|
|
41138
|
+
hyperline price-configurations get --id <id>`).action(async (opts) => {
|
|
41139
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41140
|
+
if (!ctx) {
|
|
41141
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41142
|
+
process.exit(1);
|
|
41143
|
+
}
|
|
41144
|
+
const args = {};
|
|
41145
|
+
if (opts.id !== void 0)
|
|
41146
|
+
args.id = opts.id;
|
|
41147
|
+
await ctx.execute({
|
|
41148
|
+
method: "GET",
|
|
41149
|
+
path: "/v1/price-configurations/{id}",
|
|
41150
|
+
args,
|
|
41151
|
+
queryParamKeys: []
|
|
41152
|
+
});
|
|
41153
|
+
});
|
|
41128
41154
|
resource.command("update-prices").description(`Update the prices of an existing price configuration by ID. Allows changing tier thresholds, unit prices, and flat fees.`).requiredOption("--id <value>", `id parameter`).option("--stdin", `Read JSON array input from stdin`).addHelpText("after", `
|
|
41129
41155
|
Examples:
|
|
41130
41156
|
hyperline price-configurations update-prices --id <id>
|
|
@@ -43150,7 +43176,7 @@ Examples:
|
|
|
43150
43176
|
]
|
|
43151
43177
|
});
|
|
43152
43178
|
});
|
|
43153
|
-
resource.command("create-subscription-transition").description(`Create a transition from one subscription to another, configured from a subscription, plan, or template. Can be applied immediately or scheduled.`).requiredOption("--source-subscription-id <value>", `The ID of the subscription to transition from`).option("--name <value>", `An optional name for the transition`).option("--calculation-method <value>", `The calculation method to use for the transition. 'do_not_charge' will not generate any transition invoice. 'pro_rata' will generate a prorated invoice for the remaining period. '
|
|
43179
|
+
resource.command("create-subscription-transition").description(`Create a transition from one subscription to another, configured from a subscription, plan, or template. Can be applied immediately or scheduled.`).requiredOption("--source-subscription-id <value>", `The ID of the subscription to transition from`).option("--name <value>", `An optional name for the transition`).option("--calculation-method <value>", `The calculation method to use for the transition. 'do_not_charge' will not generate any transition invoice. 'pro_rata' will generate a prorated invoice for the remaining period. 'pro_rata_separate_documents' issues a credit note for the current period (the amount invoiced when 'last_renewal', otherwise a prorated cancellation credit) and a separate invoice for the new configuration.`).option("--billing-cycle-transition-method <value>", `The billing cycle transition method to use. 'keep_current_billing_cycle' (the default) keeps the current billing cycle dates; the request is rejected when the phases share no product billing periodicity, as the cycle cannot then be preserved \u2014 use 'align_to_new_billing_cycle' in that case. 'align_to_new_billing_cycle' aligns the billing cycle to the transition date.`).requiredOption("--application-schedule <value>", `When the transition should be applied: 'immediately', 'scheduled' for a specific date, or 'last_renewal' to apply it retroactively to the start of the current billing period (refunding what was already invoiced for that period and re-charging the new configuration). Past dates within the current billing period are supported and will be applied immediately.`).option("--transition-date <value>", `The date at which the transition should occur. Only applicable if the application schedule is 'scheduled'. Can be a past date within the current billing period. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).requiredOption("--target-subscription <value>", `The configuration of the subscription to transition to`).addHelpText("after", `
|
|
43154
43180
|
Examples:
|
|
43155
43181
|
hyperline subscriptions-transitions create-subscription-transition --source-subscription-id <source_subscription_id> --application-schedule <application_schedule> --target-subscription <target_subscription>
|
|
43156
43182
|
hyperline subscriptions-transitions create-subscription-transition --source-subscription-id <source_subscription_id> --application-schedule <application_schedule> --target-subscription <target_subscription> --name <name> --calculation-method <calculation_method>
|
|
@@ -57654,398 +57680,18 @@ var AmountSchema = external_exports.number().openapi({
|
|
|
57654
57680
|
description: `Monetary amount. ${amountDescription}`
|
|
57655
57681
|
});
|
|
57656
57682
|
|
|
57657
|
-
// ../hyperline-
|
|
57658
|
-
|
|
57659
|
-
|
|
57660
|
-
|
|
57661
|
-
|
|
57662
|
-
|
|
57663
|
-
|
|
57664
|
-
|
|
57665
|
-
|
|
57666
|
-
|
|
57667
|
-
|
|
57668
|
-
|
|
57669
|
-
}
|
|
57670
|
-
|
|
57671
|
-
// ../hyperline-config/build/index.js
|
|
57672
|
-
import "dotenv/config";
|
|
57673
|
-
import * as stackTraceParser from "stacktrace-parser";
|
|
57674
|
-
function coerceBoolean() {
|
|
57675
|
-
return external_exports.any().refine((value) => ["true", "false"].includes(value), {
|
|
57676
|
-
message: "Expected boolean"
|
|
57677
|
-
}).transform((value) => (
|
|
57678
|
-
// biome-ignore lint/complexity/noUselessTernary: ignore
|
|
57679
|
-
value === "true" ? true : false
|
|
57680
|
-
));
|
|
57681
|
-
}
|
|
57682
|
-
var types = {
|
|
57683
|
-
string: external_exports.coerce.string,
|
|
57684
|
-
number: external_exports.coerce.number,
|
|
57685
|
-
boolean: coerceBoolean,
|
|
57686
|
-
enum: external_exports.enum
|
|
57687
|
-
};
|
|
57688
|
-
function getConfig(schema, testValues) {
|
|
57689
|
-
const validator = external_exports.object(Object.fromEntries(Object.entries(schema).map(([key, zodType]) => {
|
|
57690
|
-
if (zodType instanceof ZodOptional) {
|
|
57691
|
-
return [key, external_exports.string().optional()];
|
|
57692
|
-
}
|
|
57693
|
-
return [key, external_exports.string()];
|
|
57694
|
-
})));
|
|
57695
|
-
const processEnv = process.env;
|
|
57696
|
-
const isTestMode = processEnv.NODE_ENV === "test";
|
|
57697
|
-
const envVariables = {
|
|
57698
|
-
...processEnv,
|
|
57699
|
-
...isTestMode && testValues ? Object.fromEntries(Object.entries(testValues).map(([key, value]) => [key, String(value)])) : {}
|
|
57700
|
-
};
|
|
57701
|
-
const packageName = envVariables.npm_package_name;
|
|
57702
|
-
const parseProcessEnvResult = validator.safeParse(envVariables);
|
|
57703
|
-
if (!parseProcessEnvResult.success) {
|
|
57704
|
-
const parsedStackTrace = stackTraceParser.parse(parseProcessEnvResult.error.stack ?? "");
|
|
57705
|
-
const getConfigCallLine = parsedStackTrace.find((line) => {
|
|
57706
|
-
return !line.file?.includes("hyperline-config") && (line.file?.includes("apps/") || line.file?.includes("core/") || line.file?.includes("packages/"));
|
|
57707
|
-
});
|
|
57708
|
-
const callerFile = getConfigCallLine?.file;
|
|
57709
|
-
console.error(`Invalid environment variables for service \`${packageName}\`: \`${callerFile}\``);
|
|
57710
|
-
console.error(parseProcessEnvResult.error.format());
|
|
57711
|
-
process.exit(1);
|
|
57712
|
-
}
|
|
57713
|
-
const coercion = external_exports.object(schema);
|
|
57714
|
-
return coercion.parse(parseProcessEnvResult.data);
|
|
57715
|
-
}
|
|
57716
|
-
|
|
57717
|
-
// ../hyperline-monitoring/build/config.js
|
|
57718
|
-
var config2 = getConfig({
|
|
57719
|
-
// config
|
|
57720
|
-
APP_VERSION: types.string().optional(),
|
|
57721
|
-
DD_SERVICE: types.string().optional(),
|
|
57722
|
-
LOGGER_CONSOLE_ENABLED: types.boolean().optional(),
|
|
57723
|
-
LOGGER_STDOUT_ENABLED: types.boolean().optional(),
|
|
57724
|
-
NODE_ENV: types.enum(["local", "test", "staging", "sandbox", "production"]),
|
|
57725
|
-
EVENT_LOOP_MONITORING_ENABLED: types.boolean().optional(),
|
|
57726
|
-
MEMORY_MONITORING_ENABLED: types.boolean().optional(),
|
|
57727
|
-
MEMORY_MONITORING_INTERVAL_MS: types.number().optional()
|
|
57728
|
-
// secrets
|
|
57729
|
-
}, {
|
|
57730
|
-
APP_VERSION: void 0,
|
|
57731
|
-
DD_SERVICE: void 0,
|
|
57732
|
-
LOGGER_CONSOLE_ENABLED: false,
|
|
57733
|
-
LOGGER_STDOUT_ENABLED: false,
|
|
57734
|
-
EVENT_LOOP_MONITORING_ENABLED: false,
|
|
57735
|
-
MEMORY_MONITORING_ENABLED: false,
|
|
57736
|
-
MEMORY_MONITORING_INTERVAL_MS: 3e4,
|
|
57737
|
-
NODE_ENV: "test"
|
|
57738
|
-
});
|
|
57739
|
-
|
|
57740
|
-
// ../hyperline-monitoring/build/logger/logger.js
|
|
57741
|
-
import * as util from "node:util";
|
|
57742
|
-
import prune2 from "json-prune";
|
|
57743
|
-
import * as winston from "winston";
|
|
57744
|
-
|
|
57745
|
-
// ../hyperline-monitoring/build/logger/formatting/format.js
|
|
57746
|
-
import prune from "json-prune";
|
|
57747
|
-
var REDACTED_HEADER_KEY_PATTERN = /authorization|authenticate|cookie|secret|token|credential|signature|jwt|api[_-]?key|access[_-]?token|refresh[_-]?token|private[_-]?key/i;
|
|
57748
|
-
function jsonFormat(info) {
|
|
57749
|
-
const prunedInfo = JSON.parse(prune(info));
|
|
57750
|
-
for (const [key, value] of Object.entries(prunedInfo)) {
|
|
57751
|
-
info[key] = value;
|
|
57752
|
-
}
|
|
57753
|
-
return info;
|
|
57754
|
-
}
|
|
57755
|
-
function addMetadata({ getCorrelationId: getCorrelationId2, getExecutionContext: getExecutionContext2 }) {
|
|
57756
|
-
return (info) => {
|
|
57757
|
-
const correlationId = getCorrelationId2();
|
|
57758
|
-
const executionContext = getExecutionContext2();
|
|
57759
|
-
let traceContext;
|
|
57760
|
-
return {
|
|
57761
|
-
...info,
|
|
57762
|
-
...executionContext ?? {},
|
|
57763
|
-
...traceContext ?? {},
|
|
57764
|
-
correlationId
|
|
57765
|
-
};
|
|
57766
|
-
};
|
|
57767
|
-
}
|
|
57768
|
-
function transformErrorEnrich(info, { depth }) {
|
|
57769
|
-
if (depth <= 0) {
|
|
57770
|
-
return info;
|
|
57771
|
-
}
|
|
57772
|
-
Object.entries(info).forEach(([key, value]) => {
|
|
57773
|
-
let newValue = value;
|
|
57774
|
-
if (newValue instanceof Error) {
|
|
57775
|
-
newValue = {
|
|
57776
|
-
...newValue,
|
|
57777
|
-
// Copy error properties manually because they're not enumerable
|
|
57778
|
-
level: newValue.level,
|
|
57779
|
-
stack: newValue.stack,
|
|
57780
|
-
message: newValue.message,
|
|
57781
|
-
name: newValue.name
|
|
57782
|
-
};
|
|
57783
|
-
}
|
|
57784
|
-
if (newValue instanceof Object) {
|
|
57785
|
-
newValue = transformErrorEnrich(newValue, { depth: depth - 1 });
|
|
57786
|
-
}
|
|
57787
|
-
const isPropertyWritable = Object.getOwnPropertyDescriptor(info, key)?.writable ?? true;
|
|
57788
|
-
if (isPropertyWritable && newValue !== value) {
|
|
57789
|
-
info[key] = newValue;
|
|
57790
|
-
}
|
|
57791
|
-
});
|
|
57792
|
-
return info;
|
|
57793
|
-
}
|
|
57794
|
-
function transformPrune(info) {
|
|
57795
|
-
Object.entries(info).forEach(([key, value]) => {
|
|
57796
|
-
if (typeof value === "function") {
|
|
57797
|
-
return;
|
|
57798
|
-
}
|
|
57799
|
-
const newValue = value instanceof Object ? JSON.parse(prune(value, { depthDecr: 6 })) : value;
|
|
57800
|
-
const isPropertyWritable = Object.getOwnPropertyDescriptor(info, key)?.writable ?? true;
|
|
57801
|
-
if (isPropertyWritable && newValue !== value) {
|
|
57802
|
-
info[key] = newValue;
|
|
57803
|
-
}
|
|
57804
|
-
});
|
|
57805
|
-
return info;
|
|
57806
|
-
}
|
|
57807
|
-
function transformAxiosError(info) {
|
|
57808
|
-
Object.entries(info).forEach(([key, value]) => {
|
|
57809
|
-
if (typeof value === "object" && value?.name === "AxiosError") {
|
|
57810
|
-
info[key] = formatAxiosError(value);
|
|
57811
|
-
}
|
|
57812
|
-
});
|
|
57813
|
-
return info;
|
|
57814
|
-
}
|
|
57815
|
-
function formatAxiosError(error48) {
|
|
57816
|
-
if (!isRecord(error48) || error48.name !== "AxiosError") {
|
|
57817
|
-
return error48;
|
|
57818
|
-
}
|
|
57819
|
-
const request = isRecord(error48.config) ? error48.config : void 0;
|
|
57820
|
-
const response = isRecord(error48.response) ? error48.response : void 0;
|
|
57821
|
-
return {
|
|
57822
|
-
name: error48.name,
|
|
57823
|
-
message: error48.message,
|
|
57824
|
-
code: error48.code,
|
|
57825
|
-
request: {
|
|
57826
|
-
method: request?.method,
|
|
57827
|
-
url: request?.url,
|
|
57828
|
-
baseURL: request?.baseURL,
|
|
57829
|
-
params: request?.params,
|
|
57830
|
-
headers: redactHeaders({ headers: request?.headers }),
|
|
57831
|
-
"axios-retry": request?.["axios-retry"]
|
|
57832
|
-
},
|
|
57833
|
-
response: {
|
|
57834
|
-
status: response?.status,
|
|
57835
|
-
statusText: response?.statusText,
|
|
57836
|
-
headers: redactHeaders({ headers: response?.headers }),
|
|
57837
|
-
data: response?.data
|
|
57838
|
-
}
|
|
57839
|
-
};
|
|
57840
|
-
}
|
|
57841
|
-
function redactHeaders({ headers }) {
|
|
57842
|
-
if (!isRecord(headers)) {
|
|
57843
|
-
return headers;
|
|
57844
|
-
}
|
|
57845
|
-
return Object.fromEntries(Object.entries(headers).map(([headerKey, headerValue]) => [
|
|
57846
|
-
headerKey,
|
|
57847
|
-
REDACTED_HEADER_KEY_PATTERN.test(headerKey) ? "<redacted>" : headerValue
|
|
57848
|
-
]));
|
|
57849
|
-
}
|
|
57850
|
-
function isRecord(value) {
|
|
57851
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
57852
|
-
}
|
|
57853
|
-
|
|
57854
|
-
// ../hyperline-monitoring/build/logger/formatting/routePath.js
|
|
57855
|
-
function transformUrlIntoRoutePath({ params, originalUrl }) {
|
|
57856
|
-
let routePath = originalUrl;
|
|
57857
|
-
for (const [param, value] of Object.entries(params ?? {})) {
|
|
57858
|
-
const strValue = Array.isArray(value) ? value.join("/") : value;
|
|
57859
|
-
routePath = routePath.replace(strValue, `:${param}`);
|
|
57860
|
-
}
|
|
57861
|
-
return routePath.split("?")[0] ?? routePath;
|
|
57862
|
-
}
|
|
57863
|
-
|
|
57864
|
-
// ../hyperline-monitoring/build/logger/formatting/http.js
|
|
57865
|
-
function logHttpRequest(logger2, request, extra) {
|
|
57866
|
-
const { message, metadata } = transform2(request);
|
|
57867
|
-
logger2.info(`HTTP REQ - ${message} ${extra?.postfix || ""}`, {
|
|
57868
|
-
...metadata,
|
|
57869
|
-
...extra?.metadata ?? {}
|
|
57870
|
-
});
|
|
57871
|
-
}
|
|
57872
|
-
function logHttpResponse(logger2, response, responseTime, extra) {
|
|
57873
|
-
const { request, statusCode, responseBody, responseHeaders } = response;
|
|
57874
|
-
const { message, metadata } = transform2(request);
|
|
57875
|
-
const readableResponseTime = responseTime ? getReadableTime(responseTime) : void 0;
|
|
57876
|
-
const responseMetadata = {
|
|
57877
|
-
statusCode,
|
|
57878
|
-
responseTime,
|
|
57879
|
-
responseBody,
|
|
57880
|
-
// Redacted so secrets (authorization/cookie/token/…) never reach the logs
|
|
57881
|
-
// while diagnostic headers (e.g. rate-limit headers on a 429) stay visible.
|
|
57882
|
-
responseHeaders: responseHeaders === void 0 ? void 0 : redactHeaders({ headers: responseHeaders })
|
|
57883
|
-
};
|
|
57884
|
-
logger2.info(`HTTP RES - ${message} ${statusCode} ${readableResponseTime || ""} ${extra?.postfix || ""}`, {
|
|
57885
|
-
...metadata,
|
|
57886
|
-
...responseMetadata,
|
|
57887
|
-
...extra?.metadata ?? {}
|
|
57888
|
-
});
|
|
57889
|
-
}
|
|
57890
|
-
function transform2(request) {
|
|
57891
|
-
const method = request.method.toUpperCase();
|
|
57892
|
-
const message = `${method} ${request.originalUrl}`;
|
|
57893
|
-
const metadata = {};
|
|
57894
|
-
metadata.method = method;
|
|
57895
|
-
metadata.url = request.url;
|
|
57896
|
-
metadata.path = request.path;
|
|
57897
|
-
metadata.hostname = request.hostname;
|
|
57898
|
-
metadata.originalUrl = request.originalUrl;
|
|
57899
|
-
metadata.requestBody = request.body;
|
|
57900
|
-
metadata.routePath = transformUrlIntoRoutePath(request);
|
|
57901
|
-
metadata.apiKeyEnd = request.headers["authorization"]?.slice(-6);
|
|
57902
|
-
return { message, metadata };
|
|
57903
|
-
}
|
|
57904
|
-
function getReadableTime(time3) {
|
|
57905
|
-
return time3 < 1e4 ? `${time3}ms` : `${Math.round(time3 / 1e3)}s`;
|
|
57906
|
-
}
|
|
57907
|
-
|
|
57908
|
-
// ../hyperline-monitoring/build/logger/utils/network.js
|
|
57909
|
-
import * as os2 from "node:os";
|
|
57910
|
-
function getIpAddress() {
|
|
57911
|
-
const interfaces = Object.values(os2.networkInterfaces()).flat().filter((networkInterface) => {
|
|
57912
|
-
return networkInterface !== void 0;
|
|
57913
|
-
});
|
|
57914
|
-
const mainInterface = interfaces.find(({ family, internal }) => family === "IPv4" && internal === false);
|
|
57915
|
-
return mainInterface ? mainInterface.address : null;
|
|
57916
|
-
}
|
|
57917
|
-
|
|
57918
|
-
// ../hyperline-monitoring/build/logger/logger.js
|
|
57919
|
-
function buildLoggerFactory({ config: config4, context }) {
|
|
57920
|
-
const defaultMeta = {
|
|
57921
|
-
env: context.env,
|
|
57922
|
-
service: context.service,
|
|
57923
|
-
version: context.version,
|
|
57924
|
-
pid: process.pid,
|
|
57925
|
-
ppid: process.ppid,
|
|
57926
|
-
host: getIpAddress()
|
|
57927
|
-
};
|
|
57928
|
-
const transports2 = [];
|
|
57929
|
-
if (config4.enableConsoleTransport) {
|
|
57930
|
-
transports2.push(createTransportConsole());
|
|
57931
|
-
}
|
|
57932
|
-
if (config4.enableStdoutTransport) {
|
|
57933
|
-
transports2.push(createTransportStdout());
|
|
57934
|
-
}
|
|
57935
|
-
if (Object.values(config4).every((value) => !value)) {
|
|
57936
|
-
transports2.push(createTransportSilent());
|
|
57937
|
-
}
|
|
57938
|
-
for (const transport of transports2) {
|
|
57939
|
-
transport.on("error", (error48) => {
|
|
57940
|
-
console.error(`Unable to log to transport=${transport.name}: ${error48.message} ${JSON.stringify(error48)}`);
|
|
57941
|
-
});
|
|
57942
|
-
}
|
|
57943
|
-
const internalLogger = winston.createLogger({
|
|
57944
|
-
transports: transports2,
|
|
57945
|
-
defaultMeta,
|
|
57946
|
-
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()),
|
|
57947
|
-
exitOnError: false
|
|
57948
|
-
});
|
|
57949
|
-
function createLogger3({ serviceName }) {
|
|
57950
|
-
const logger2 = internalLogger.child({ subService: serviceName });
|
|
57951
|
-
return {
|
|
57952
|
-
debug: bindLogger(logger2, "debug"),
|
|
57953
|
-
info: bindLogger(logger2, "info"),
|
|
57954
|
-
warn: bindLogger(logger2, "warn"),
|
|
57955
|
-
error: bindLogger(logger2, "error"),
|
|
57956
|
-
on: logger2.on.bind(logger2),
|
|
57957
|
-
end: logger2.end.bind(logger2)
|
|
57958
|
-
};
|
|
57959
|
-
}
|
|
57960
|
-
return {
|
|
57961
|
-
createLogger: createLogger3
|
|
57962
|
-
};
|
|
57963
|
-
}
|
|
57964
|
-
function bindLogger(logger2, severity) {
|
|
57965
|
-
return (message, data) => {
|
|
57966
|
-
logger2[severity].bind(logger2)(message, preserveReservedKeys(data));
|
|
57967
|
-
};
|
|
57968
|
-
}
|
|
57969
|
-
function preserveReservedKeys(data) {
|
|
57970
|
-
if (!data)
|
|
57971
|
-
return;
|
|
57972
|
-
return Object.fromEntries(Object.entries(data).map(([key, value]) => {
|
|
57973
|
-
let finalKey = key;
|
|
57974
|
-
if (key === "status") {
|
|
57975
|
-
finalKey = "_status";
|
|
57976
|
-
} else if (key === "service") {
|
|
57977
|
-
finalKey = "_service";
|
|
57978
|
-
}
|
|
57979
|
-
return [finalKey, value];
|
|
57980
|
-
}));
|
|
57981
|
-
}
|
|
57982
|
-
var verboseLevels = ["warn", "error", "debug"];
|
|
57983
|
-
function createTransportConsole() {
|
|
57984
|
-
return new winston.transports.Console({
|
|
57985
|
-
level: "debug",
|
|
57986
|
-
handleExceptions: true,
|
|
57987
|
-
format: winston.format.combine(winston.format(jsonFormat)(), winston.format((info) => {
|
|
57988
|
-
const { level, message, ...others } = info;
|
|
57989
|
-
const parts = [message];
|
|
57990
|
-
if (Object.keys(others).length > 0 && verboseLevels.includes(level)) {
|
|
57991
|
-
const rawOthers = JSON.parse(prune2(others));
|
|
57992
|
-
parts.push(util.inspect(rawOthers, false, 4, true));
|
|
57993
|
-
}
|
|
57994
|
-
info.message = parts.filter((part) => !!part).join("\n");
|
|
57995
|
-
return info;
|
|
57996
|
-
})(), winston.format.colorize(), winston.format.printf(({ timestamp, level, message, service = "?" }) => {
|
|
57997
|
-
const result = `[${timestamp}] ${level} ${service}: ${message}`;
|
|
57998
|
-
return result.replace(/\\n/g, "\n");
|
|
57999
|
-
}))
|
|
58000
|
-
});
|
|
58001
|
-
}
|
|
58002
|
-
function createTransportStdout() {
|
|
58003
|
-
return new winston.transports.Console({
|
|
58004
|
-
level: "debug",
|
|
58005
|
-
handleExceptions: true,
|
|
58006
|
-
format: winston.format.combine(winston.format(jsonFormat)(), winston.format.timestamp(), winston.format.json())
|
|
58007
|
-
});
|
|
58008
|
-
}
|
|
58009
|
-
function createTransportSilent() {
|
|
58010
|
-
return new winston.transports.Console({
|
|
58011
|
-
silent: true
|
|
58012
|
-
});
|
|
58013
|
-
}
|
|
58014
|
-
|
|
58015
|
-
// ../hyperline-monitoring/build/logger/instance.js
|
|
58016
|
-
var loggerFactory = buildLoggerFactory({
|
|
58017
|
-
config: {
|
|
58018
|
-
enableConsoleTransport: config2.LOGGER_CONSOLE_ENABLED ?? false,
|
|
58019
|
-
enableStdoutTransport: config2.LOGGER_STDOUT_ENABLED ?? false
|
|
58020
|
-
},
|
|
58021
|
-
context: {
|
|
58022
|
-
env: config2.NODE_ENV,
|
|
58023
|
-
service: config2.DD_SERVICE ?? "api",
|
|
58024
|
-
version: config2.APP_VERSION
|
|
58025
|
-
}
|
|
58026
|
-
});
|
|
58027
|
-
var createLogger2 = loggerFactory.createLogger;
|
|
58028
|
-
var logger = loggerFactory.createLogger({ serviceName: "default" });
|
|
58029
|
-
|
|
58030
|
-
// ../hyperline-monitoring/build/tracing/tracing.js
|
|
58031
|
-
import tracer from "dd-trace";
|
|
58032
|
-
|
|
58033
|
-
// ../hyperline-lib/build/utils/aws.js
|
|
58034
|
-
import { GetBucketLocationCommand, S3Client } from "@aws-sdk/client-s3";
|
|
58035
|
-
import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
58036
|
-
|
|
58037
|
-
// ../hyperline-lib/build/utils/config/countries.js
|
|
58038
|
-
var countriesAndCurrencies = (
|
|
58039
|
-
// 20221115164054
|
|
58040
|
-
// https://gist.githubusercontent.com/tiagodealmeida/0b97ccf117252d742dddf098bc6cc58a/raw/f621703926fc13be4f618fb4a058d0454177cceb/countries.json
|
|
58041
|
-
[
|
|
58042
|
-
{
|
|
58043
|
-
countryCode: "AD",
|
|
58044
|
-
countryName: "Andorra",
|
|
58045
|
-
currencyCode: "EUR",
|
|
58046
|
-
population: "84000",
|
|
58047
|
-
capital: "Andorra la Vella",
|
|
58048
|
-
continentName: "Europe"
|
|
57683
|
+
// ../hyperline-lib/build/utils/config/countries.js
|
|
57684
|
+
var countriesAndCurrencies = (
|
|
57685
|
+
// 20221115164054
|
|
57686
|
+
// https://gist.githubusercontent.com/tiagodealmeida/0b97ccf117252d742dddf098bc6cc58a/raw/f621703926fc13be4f618fb4a058d0454177cceb/countries.json
|
|
57687
|
+
[
|
|
57688
|
+
{
|
|
57689
|
+
countryCode: "AD",
|
|
57690
|
+
countryName: "Andorra",
|
|
57691
|
+
currencyCode: "EUR",
|
|
57692
|
+
population: "84000",
|
|
57693
|
+
capital: "Andorra la Vella",
|
|
57694
|
+
continentName: "Europe"
|
|
58049
57695
|
},
|
|
58050
57696
|
{
|
|
58051
57697
|
countryCode: "AE",
|
|
@@ -60079,8 +59725,492 @@ var countriesAndCurrencies = (
|
|
|
60079
59725
|
capital: "Harare",
|
|
60080
59726
|
continentName: "Africa"
|
|
60081
59727
|
}
|
|
60082
|
-
]
|
|
60083
|
-
);
|
|
59728
|
+
]
|
|
59729
|
+
);
|
|
59730
|
+
var countryCodesInTable = new Set(countriesAndCurrencies.map(({ countryCode }) => countryCode));
|
|
59731
|
+
function isCountryCodeInTable(countryCode) {
|
|
59732
|
+
return countryCodesInTable.has(countryCode);
|
|
59733
|
+
}
|
|
59734
|
+
function foldCountryName(countryName) {
|
|
59735
|
+
return countryName.normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "").toLowerCase();
|
|
59736
|
+
}
|
|
59737
|
+
function getCountryCodeFromName(countryName) {
|
|
59738
|
+
return countriesAndCurrencies.find((c) => foldCountryName(c.countryName) === foldCountryName(countryName))?.countryCode;
|
|
59739
|
+
}
|
|
59740
|
+
|
|
59741
|
+
// ../hyperline-lib/build/utils/countries.js
|
|
59742
|
+
function isValidCountryCode(countryCode) {
|
|
59743
|
+
return isCountryCodeInTable(countryCode);
|
|
59744
|
+
}
|
|
59745
|
+
var NON_ISO_COUNTRY_CODE_ALIASES = /* @__PURE__ */ new Map([
|
|
59746
|
+
["XI", "GB"],
|
|
59747
|
+
["UK", "GB"],
|
|
59748
|
+
["USA", "US"],
|
|
59749
|
+
["FRA", "FR"]
|
|
59750
|
+
]);
|
|
59751
|
+
var COUNTRY_NAME_ALIASES = /* @__PURE__ */ new Map([
|
|
59752
|
+
["czech republic", "CZ"],
|
|
59753
|
+
["cote d'ivoire", "CI"]
|
|
59754
|
+
]);
|
|
59755
|
+
function normalizeProviderCountry({ country }) {
|
|
59756
|
+
const trimmedCountry = country?.trim();
|
|
59757
|
+
if (!trimmedCountry) {
|
|
59758
|
+
return null;
|
|
59759
|
+
}
|
|
59760
|
+
const upperCasedCountry = trimmedCountry.toUpperCase();
|
|
59761
|
+
const aliasedCountryCode = NON_ISO_COUNTRY_CODE_ALIASES.get(upperCasedCountry) ?? upperCasedCountry;
|
|
59762
|
+
if (isValidCountryCode(aliasedCountryCode)) {
|
|
59763
|
+
return aliasedCountryCode;
|
|
59764
|
+
}
|
|
59765
|
+
return getCountryCodeFromName(trimmedCountry) ?? COUNTRY_NAME_ALIASES.get(foldCountryName(trimmedCountry)) ?? null;
|
|
59766
|
+
}
|
|
59767
|
+
|
|
59768
|
+
// ../hyperline-lib/build/http/dto/country.js
|
|
59769
|
+
var countryCodes = countriesAndCurrencies.map(({ countryCode }) => countryCode);
|
|
59770
|
+
var CountrySchema = external_exports.enum(countryCodes).openapi({
|
|
59771
|
+
description: "Two-letter country code in ISO format. See [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).",
|
|
59772
|
+
example: "FR"
|
|
59773
|
+
});
|
|
59774
|
+
var NormalizedCountrySchema = external_exports.preprocess((value) => typeof value === "string" ? normalizeProviderCountry({ country: value }) : value, CountrySchema.nullable());
|
|
59775
|
+
|
|
59776
|
+
// ../hyperline-lib/build/http/dto/currency.js
|
|
59777
|
+
var currencyCodes = Array.from(new Set(countriesAndCurrencies.map(({ currencyCode }) => currencyCode).filter((currencyCode) => Boolean(currencyCode))));
|
|
59778
|
+
var CurrencySchema = external_exports.enum(currencyCodes).openapi({
|
|
59779
|
+
description: "Currency code. See [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes).",
|
|
59780
|
+
example: "EUR"
|
|
59781
|
+
});
|
|
59782
|
+
|
|
59783
|
+
// ../hyperline-lib/build/http/dto/dateTime.js
|
|
59784
|
+
var dateTimeDescription = "UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.";
|
|
59785
|
+
var DateTimeSchema = external_exports.iso.datetime({
|
|
59786
|
+
offset: false
|
|
59787
|
+
// only UTC date time
|
|
59788
|
+
}).openapi({
|
|
59789
|
+
description: dateTimeDescription,
|
|
59790
|
+
example: "2024-12-20T16:04:11Z"
|
|
59791
|
+
});
|
|
59792
|
+
|
|
59793
|
+
// ../hyperline-lib/build/http/dto/domain.js
|
|
59794
|
+
var DomainSchema = external_exports.string().trim().toLowerCase().regex(/^(?!:\/\/)(?=.{1,253}$)(?!-)([a-z0-9-]{1,63}\.)+[a-z]{2,63}$/, "Invalid domain").openapi({
|
|
59795
|
+
description: "Domain name.",
|
|
59796
|
+
example: "acme.com"
|
|
59797
|
+
});
|
|
59798
|
+
|
|
59799
|
+
// ../hyperline-lib/build/http/dto/error.js
|
|
59800
|
+
var ErrorSchema = external_exports.object({
|
|
59801
|
+
message: external_exports.string()
|
|
59802
|
+
});
|
|
59803
|
+
|
|
59804
|
+
// ../hyperline-lib/build/http/dto/pagination.js
|
|
59805
|
+
var PublicPaginationParams = {
|
|
59806
|
+
take: zod_default.coerce.number().nonnegative().max(100).optional().default(50),
|
|
59807
|
+
skip: zod_default.coerce.number().nonnegative().optional().default(0)
|
|
59808
|
+
};
|
|
59809
|
+
var PublicPaginationSchema = zod_default.object(PublicPaginationParams);
|
|
59810
|
+
var PublicCursorPaginationParams = {
|
|
59811
|
+
limit: zod_default.coerce.number().positive().max(100).optional().default(50).openapi({
|
|
59812
|
+
description: "Maximum number of items to return (1-100).",
|
|
59813
|
+
example: 50
|
|
59814
|
+
}),
|
|
59815
|
+
cursor: zod_default.string().optional().openapi({
|
|
59816
|
+
description: "Opaque cursor returned in the previous response's `next_cursor`. Omit to fetch the first page."
|
|
59817
|
+
}),
|
|
59818
|
+
include_total: BooleanSchema.optional().default(false).openapi({
|
|
59819
|
+
description: "Set to `true` to include `total` in the response.",
|
|
59820
|
+
example: false
|
|
59821
|
+
})
|
|
59822
|
+
};
|
|
59823
|
+
var PublicCursorPaginationSchema = zod_default.object(PublicCursorPaginationParams);
|
|
59824
|
+
|
|
59825
|
+
// ../hyperline-monitoring/build/context/context.js
|
|
59826
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
59827
|
+
var executionContextStorage = new AsyncLocalStorage();
|
|
59828
|
+
function getExecutionContext() {
|
|
59829
|
+
return executionContextStorage.getStore();
|
|
59830
|
+
}
|
|
59831
|
+
|
|
59832
|
+
// ../hyperline-monitoring/build/context/correlationId.js
|
|
59833
|
+
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
59834
|
+
var correlationIdStorage = new AsyncLocalStorage2();
|
|
59835
|
+
function getCorrelationId() {
|
|
59836
|
+
return correlationIdStorage.getStore();
|
|
59837
|
+
}
|
|
59838
|
+
|
|
59839
|
+
// ../hyperline-config/build/index.js
|
|
59840
|
+
import "dotenv/config";
|
|
59841
|
+
import * as stackTraceParser from "stacktrace-parser";
|
|
59842
|
+
function coerceBoolean() {
|
|
59843
|
+
return external_exports.any().refine((value) => ["true", "false"].includes(value), {
|
|
59844
|
+
message: "Expected boolean"
|
|
59845
|
+
}).transform((value) => (
|
|
59846
|
+
// biome-ignore lint/complexity/noUselessTernary: ignore
|
|
59847
|
+
value === "true" ? true : false
|
|
59848
|
+
));
|
|
59849
|
+
}
|
|
59850
|
+
var types = {
|
|
59851
|
+
string: external_exports.coerce.string,
|
|
59852
|
+
number: external_exports.coerce.number,
|
|
59853
|
+
boolean: coerceBoolean,
|
|
59854
|
+
enum: external_exports.enum
|
|
59855
|
+
};
|
|
59856
|
+
function getConfig(schema, testValues) {
|
|
59857
|
+
const validator = external_exports.object(Object.fromEntries(Object.entries(schema).map(([key, zodType]) => {
|
|
59858
|
+
if (zodType instanceof ZodOptional) {
|
|
59859
|
+
return [key, external_exports.string().optional()];
|
|
59860
|
+
}
|
|
59861
|
+
return [key, external_exports.string()];
|
|
59862
|
+
})));
|
|
59863
|
+
const processEnv = process.env;
|
|
59864
|
+
const isTestMode = processEnv.NODE_ENV === "test";
|
|
59865
|
+
const envVariables = {
|
|
59866
|
+
...processEnv,
|
|
59867
|
+
...isTestMode && testValues ? Object.fromEntries(Object.entries(testValues).map(([key, value]) => [key, String(value)])) : {}
|
|
59868
|
+
};
|
|
59869
|
+
const packageName = envVariables.npm_package_name;
|
|
59870
|
+
const parseProcessEnvResult = validator.safeParse(envVariables);
|
|
59871
|
+
if (!parseProcessEnvResult.success) {
|
|
59872
|
+
const parsedStackTrace = stackTraceParser.parse(parseProcessEnvResult.error.stack ?? "");
|
|
59873
|
+
const getConfigCallLine = parsedStackTrace.find((line) => {
|
|
59874
|
+
return !line.file?.includes("hyperline-config") && (line.file?.includes("apps/") || line.file?.includes("core/") || line.file?.includes("packages/"));
|
|
59875
|
+
});
|
|
59876
|
+
const callerFile = getConfigCallLine?.file;
|
|
59877
|
+
console.error(`Invalid environment variables for service \`${packageName}\`: \`${callerFile}\``);
|
|
59878
|
+
console.error(parseProcessEnvResult.error.format());
|
|
59879
|
+
process.exit(1);
|
|
59880
|
+
}
|
|
59881
|
+
const coercion = external_exports.object(schema);
|
|
59882
|
+
return coercion.parse(parseProcessEnvResult.data);
|
|
59883
|
+
}
|
|
59884
|
+
|
|
59885
|
+
// ../hyperline-monitoring/build/config.js
|
|
59886
|
+
var config2 = getConfig({
|
|
59887
|
+
// config
|
|
59888
|
+
APP_VERSION: types.string().optional(),
|
|
59889
|
+
// Deployment environment for log tagging, when it cannot be read off
|
|
59890
|
+
// NODE_ENV. Set only by the PDF render worker pools, which must run with
|
|
59891
|
+
// NODE_ENV="production" to get the production React build regardless of which
|
|
59892
|
+
// environment the pod is actually in (see core/invoicing/services/pdf/index.ts).
|
|
59893
|
+
// Unset everywhere else, so the NODE_ENV fallback keeps current behaviour.
|
|
59894
|
+
APP_ENV: types.string().optional(),
|
|
59895
|
+
DD_SERVICE: types.string().optional(),
|
|
59896
|
+
LOGGER_CONSOLE_ENABLED: types.boolean().optional(),
|
|
59897
|
+
LOGGER_STDOUT_ENABLED: types.boolean().optional(),
|
|
59898
|
+
NODE_ENV: types.enum(["local", "test", "staging", "sandbox", "production"]),
|
|
59899
|
+
EVENT_LOOP_MONITORING_ENABLED: types.boolean().optional(),
|
|
59900
|
+
MEMORY_MONITORING_ENABLED: types.boolean().optional(),
|
|
59901
|
+
MEMORY_MONITORING_INTERVAL_MS: types.number().optional()
|
|
59902
|
+
// secrets
|
|
59903
|
+
}, {
|
|
59904
|
+
APP_VERSION: void 0,
|
|
59905
|
+
APP_ENV: void 0,
|
|
59906
|
+
DD_SERVICE: void 0,
|
|
59907
|
+
LOGGER_CONSOLE_ENABLED: false,
|
|
59908
|
+
LOGGER_STDOUT_ENABLED: false,
|
|
59909
|
+
EVENT_LOOP_MONITORING_ENABLED: false,
|
|
59910
|
+
MEMORY_MONITORING_ENABLED: false,
|
|
59911
|
+
MEMORY_MONITORING_INTERVAL_MS: 3e4,
|
|
59912
|
+
NODE_ENV: "test"
|
|
59913
|
+
});
|
|
59914
|
+
|
|
59915
|
+
// ../hyperline-monitoring/build/logger/logger.js
|
|
59916
|
+
import * as util from "node:util";
|
|
59917
|
+
import prune2 from "json-prune";
|
|
59918
|
+
import * as winston from "winston";
|
|
59919
|
+
|
|
59920
|
+
// ../hyperline-monitoring/build/logger/formatting/format.js
|
|
59921
|
+
import prune from "json-prune";
|
|
59922
|
+
var REDACTED_HEADER_KEY_PATTERN = /authorization|authenticate|cookie|secret|token|credential|signature|jwt|api[_-]?key|access[_-]?token|refresh[_-]?token|private[_-]?key/i;
|
|
59923
|
+
function jsonFormat(info) {
|
|
59924
|
+
const prunedInfo = JSON.parse(prune(info));
|
|
59925
|
+
for (const [key, value] of Object.entries(prunedInfo)) {
|
|
59926
|
+
info[key] = value;
|
|
59927
|
+
}
|
|
59928
|
+
return info;
|
|
59929
|
+
}
|
|
59930
|
+
function addMetadata({ getCorrelationId: getCorrelationId2, getExecutionContext: getExecutionContext2 }) {
|
|
59931
|
+
return (info) => {
|
|
59932
|
+
const correlationId = getCorrelationId2();
|
|
59933
|
+
const executionContext = getExecutionContext2();
|
|
59934
|
+
let traceContext;
|
|
59935
|
+
return {
|
|
59936
|
+
...info,
|
|
59937
|
+
...executionContext ?? {},
|
|
59938
|
+
...traceContext ?? {},
|
|
59939
|
+
correlationId
|
|
59940
|
+
};
|
|
59941
|
+
};
|
|
59942
|
+
}
|
|
59943
|
+
function transformErrorEnrich(info, { depth }) {
|
|
59944
|
+
if (depth <= 0) {
|
|
59945
|
+
return info;
|
|
59946
|
+
}
|
|
59947
|
+
Object.entries(info).forEach(([key, value]) => {
|
|
59948
|
+
let newValue = value;
|
|
59949
|
+
if (newValue instanceof Error) {
|
|
59950
|
+
newValue = {
|
|
59951
|
+
...newValue,
|
|
59952
|
+
// Copy error properties manually because they're not enumerable
|
|
59953
|
+
level: newValue.level,
|
|
59954
|
+
stack: newValue.stack,
|
|
59955
|
+
message: newValue.message,
|
|
59956
|
+
name: newValue.name
|
|
59957
|
+
};
|
|
59958
|
+
}
|
|
59959
|
+
if (newValue instanceof Object) {
|
|
59960
|
+
newValue = transformErrorEnrich(newValue, { depth: depth - 1 });
|
|
59961
|
+
}
|
|
59962
|
+
const isPropertyWritable = Object.getOwnPropertyDescriptor(info, key)?.writable ?? true;
|
|
59963
|
+
if (isPropertyWritable && newValue !== value) {
|
|
59964
|
+
info[key] = newValue;
|
|
59965
|
+
}
|
|
59966
|
+
});
|
|
59967
|
+
return info;
|
|
59968
|
+
}
|
|
59969
|
+
function transformPrune(info) {
|
|
59970
|
+
Object.entries(info).forEach(([key, value]) => {
|
|
59971
|
+
if (typeof value === "function") {
|
|
59972
|
+
return;
|
|
59973
|
+
}
|
|
59974
|
+
const newValue = value instanceof Object ? JSON.parse(prune(value, { depthDecr: 6 })) : value;
|
|
59975
|
+
const isPropertyWritable = Object.getOwnPropertyDescriptor(info, key)?.writable ?? true;
|
|
59976
|
+
if (isPropertyWritable && newValue !== value) {
|
|
59977
|
+
info[key] = newValue;
|
|
59978
|
+
}
|
|
59979
|
+
});
|
|
59980
|
+
return info;
|
|
59981
|
+
}
|
|
59982
|
+
function transformAxiosError(info) {
|
|
59983
|
+
Object.entries(info).forEach(([key, value]) => {
|
|
59984
|
+
if (typeof value === "object" && value?.name === "AxiosError") {
|
|
59985
|
+
info[key] = formatAxiosError(value);
|
|
59986
|
+
}
|
|
59987
|
+
});
|
|
59988
|
+
return info;
|
|
59989
|
+
}
|
|
59990
|
+
function formatAxiosError(error48) {
|
|
59991
|
+
if (!isRecord(error48) || error48.name !== "AxiosError") {
|
|
59992
|
+
return error48;
|
|
59993
|
+
}
|
|
59994
|
+
const request = isRecord(error48.config) ? error48.config : void 0;
|
|
59995
|
+
const response = isRecord(error48.response) ? error48.response : void 0;
|
|
59996
|
+
return {
|
|
59997
|
+
name: error48.name,
|
|
59998
|
+
message: error48.message,
|
|
59999
|
+
code: error48.code,
|
|
60000
|
+
request: {
|
|
60001
|
+
method: request?.method,
|
|
60002
|
+
url: request?.url,
|
|
60003
|
+
baseURL: request?.baseURL,
|
|
60004
|
+
params: request?.params,
|
|
60005
|
+
headers: redactHeaders({ headers: request?.headers }),
|
|
60006
|
+
"axios-retry": request?.["axios-retry"]
|
|
60007
|
+
},
|
|
60008
|
+
response: {
|
|
60009
|
+
status: response?.status,
|
|
60010
|
+
statusText: response?.statusText,
|
|
60011
|
+
headers: redactHeaders({ headers: response?.headers }),
|
|
60012
|
+
data: response?.data
|
|
60013
|
+
}
|
|
60014
|
+
};
|
|
60015
|
+
}
|
|
60016
|
+
function redactHeaders({ headers }) {
|
|
60017
|
+
if (!isRecord(headers)) {
|
|
60018
|
+
return headers;
|
|
60019
|
+
}
|
|
60020
|
+
return Object.fromEntries(Object.entries(headers).map(([headerKey, headerValue]) => [
|
|
60021
|
+
headerKey,
|
|
60022
|
+
REDACTED_HEADER_KEY_PATTERN.test(headerKey) ? "<redacted>" : headerValue
|
|
60023
|
+
]));
|
|
60024
|
+
}
|
|
60025
|
+
function isRecord(value) {
|
|
60026
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
60027
|
+
}
|
|
60028
|
+
|
|
60029
|
+
// ../hyperline-monitoring/build/logger/formatting/routePath.js
|
|
60030
|
+
function transformUrlIntoRoutePath({ params, originalUrl }) {
|
|
60031
|
+
let routePath = originalUrl;
|
|
60032
|
+
for (const [param, value] of Object.entries(params ?? {})) {
|
|
60033
|
+
const strValue = Array.isArray(value) ? value.join("/") : value;
|
|
60034
|
+
routePath = routePath.replace(strValue, `:${param}`);
|
|
60035
|
+
}
|
|
60036
|
+
return routePath.split("?")[0] ?? routePath;
|
|
60037
|
+
}
|
|
60038
|
+
|
|
60039
|
+
// ../hyperline-monitoring/build/logger/formatting/http.js
|
|
60040
|
+
function logHttpRequest(logger2, request, extra) {
|
|
60041
|
+
const { message, metadata } = transform2(request);
|
|
60042
|
+
logger2.info(`HTTP REQ - ${message} ${extra?.postfix || ""}`, {
|
|
60043
|
+
...metadata,
|
|
60044
|
+
...extra?.metadata ?? {}
|
|
60045
|
+
});
|
|
60046
|
+
}
|
|
60047
|
+
function logHttpResponse(logger2, response, responseTime, extra) {
|
|
60048
|
+
const { request, statusCode, responseBody, responseHeaders } = response;
|
|
60049
|
+
const { message, metadata } = transform2(request);
|
|
60050
|
+
const readableResponseTime = responseTime ? getReadableTime(responseTime) : void 0;
|
|
60051
|
+
const responseMetadata = {
|
|
60052
|
+
statusCode,
|
|
60053
|
+
responseTime,
|
|
60054
|
+
responseBody,
|
|
60055
|
+
// Redacted so secrets (authorization/cookie/token/…) never reach the logs
|
|
60056
|
+
// while diagnostic headers (e.g. rate-limit headers on a 429) stay visible.
|
|
60057
|
+
responseHeaders: responseHeaders === void 0 ? void 0 : redactHeaders({ headers: responseHeaders })
|
|
60058
|
+
};
|
|
60059
|
+
logger2.info(`HTTP RES - ${message} ${statusCode} ${readableResponseTime || ""} ${extra?.postfix || ""}`, {
|
|
60060
|
+
...metadata,
|
|
60061
|
+
...responseMetadata,
|
|
60062
|
+
...extra?.metadata ?? {}
|
|
60063
|
+
});
|
|
60064
|
+
}
|
|
60065
|
+
function transform2(request) {
|
|
60066
|
+
const method = request.method.toUpperCase();
|
|
60067
|
+
const message = `${method} ${request.originalUrl}`;
|
|
60068
|
+
const metadata = {};
|
|
60069
|
+
metadata.method = method;
|
|
60070
|
+
metadata.url = request.url;
|
|
60071
|
+
metadata.path = request.path;
|
|
60072
|
+
metadata.hostname = request.hostname;
|
|
60073
|
+
metadata.originalUrl = request.originalUrl;
|
|
60074
|
+
metadata.requestBody = request.body;
|
|
60075
|
+
metadata.routePath = transformUrlIntoRoutePath(request);
|
|
60076
|
+
metadata.apiKeyEnd = request.headers["authorization"]?.slice(-6);
|
|
60077
|
+
return { message, metadata };
|
|
60078
|
+
}
|
|
60079
|
+
function getReadableTime(time3) {
|
|
60080
|
+
return time3 < 1e4 ? `${time3}ms` : `${Math.round(time3 / 1e3)}s`;
|
|
60081
|
+
}
|
|
60082
|
+
|
|
60083
|
+
// ../hyperline-monitoring/build/logger/utils/network.js
|
|
60084
|
+
import * as os2 from "node:os";
|
|
60085
|
+
function getIpAddress() {
|
|
60086
|
+
const interfaces = Object.values(os2.networkInterfaces()).flat().filter((networkInterface) => {
|
|
60087
|
+
return networkInterface !== void 0;
|
|
60088
|
+
});
|
|
60089
|
+
const mainInterface = interfaces.find(({ family, internal }) => family === "IPv4" && internal === false);
|
|
60090
|
+
return mainInterface ? mainInterface.address : null;
|
|
60091
|
+
}
|
|
60092
|
+
|
|
60093
|
+
// ../hyperline-monitoring/build/logger/logger.js
|
|
60094
|
+
function buildLoggerFactory({ config: config4, context }) {
|
|
60095
|
+
const defaultMeta = {
|
|
60096
|
+
env: context.env,
|
|
60097
|
+
service: context.service,
|
|
60098
|
+
version: context.version,
|
|
60099
|
+
pid: process.pid,
|
|
60100
|
+
ppid: process.ppid,
|
|
60101
|
+
host: getIpAddress()
|
|
60102
|
+
};
|
|
60103
|
+
const transports2 = [];
|
|
60104
|
+
if (config4.enableConsoleTransport) {
|
|
60105
|
+
transports2.push(createTransportConsole());
|
|
60106
|
+
}
|
|
60107
|
+
if (config4.enableStdoutTransport) {
|
|
60108
|
+
transports2.push(createTransportStdout());
|
|
60109
|
+
}
|
|
60110
|
+
if (Object.values(config4).every((value) => !value)) {
|
|
60111
|
+
transports2.push(createTransportSilent());
|
|
60112
|
+
}
|
|
60113
|
+
for (const transport of transports2) {
|
|
60114
|
+
transport.on("error", (error48) => {
|
|
60115
|
+
console.error(`Unable to log to transport=${transport.name}: ${error48.message} ${JSON.stringify(error48)}`);
|
|
60116
|
+
});
|
|
60117
|
+
}
|
|
60118
|
+
const internalLogger = winston.createLogger({
|
|
60119
|
+
transports: transports2,
|
|
60120
|
+
defaultMeta,
|
|
60121
|
+
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()),
|
|
60122
|
+
exitOnError: false
|
|
60123
|
+
});
|
|
60124
|
+
function createLogger3({ serviceName }) {
|
|
60125
|
+
const logger2 = internalLogger.child({ subService: serviceName });
|
|
60126
|
+
return {
|
|
60127
|
+
debug: bindLogger(logger2, "debug"),
|
|
60128
|
+
info: bindLogger(logger2, "info"),
|
|
60129
|
+
warn: bindLogger(logger2, "warn"),
|
|
60130
|
+
error: bindLogger(logger2, "error"),
|
|
60131
|
+
on: logger2.on.bind(logger2),
|
|
60132
|
+
end: logger2.end.bind(logger2)
|
|
60133
|
+
};
|
|
60134
|
+
}
|
|
60135
|
+
return {
|
|
60136
|
+
createLogger: createLogger3
|
|
60137
|
+
};
|
|
60138
|
+
}
|
|
60139
|
+
function bindLogger(logger2, severity) {
|
|
60140
|
+
return (message, data) => {
|
|
60141
|
+
logger2[severity].bind(logger2)(message, preserveReservedKeys(data));
|
|
60142
|
+
};
|
|
60143
|
+
}
|
|
60144
|
+
function preserveReservedKeys(data) {
|
|
60145
|
+
if (!data)
|
|
60146
|
+
return;
|
|
60147
|
+
return Object.fromEntries(Object.entries(data).map(([key, value]) => {
|
|
60148
|
+
let finalKey = key;
|
|
60149
|
+
if (key === "status") {
|
|
60150
|
+
finalKey = "_status";
|
|
60151
|
+
} else if (key === "service") {
|
|
60152
|
+
finalKey = "_service";
|
|
60153
|
+
}
|
|
60154
|
+
return [finalKey, value];
|
|
60155
|
+
}));
|
|
60156
|
+
}
|
|
60157
|
+
var verboseLevels = ["warn", "error", "debug"];
|
|
60158
|
+
function createTransportConsole() {
|
|
60159
|
+
return new winston.transports.Console({
|
|
60160
|
+
level: "debug",
|
|
60161
|
+
handleExceptions: true,
|
|
60162
|
+
format: winston.format.combine(winston.format(jsonFormat)(), winston.format((info) => {
|
|
60163
|
+
const { level, message, ...others } = info;
|
|
60164
|
+
const parts = [message];
|
|
60165
|
+
if (Object.keys(others).length > 0 && verboseLevels.includes(level)) {
|
|
60166
|
+
const rawOthers = JSON.parse(prune2(others));
|
|
60167
|
+
parts.push(util.inspect(rawOthers, false, 4, true));
|
|
60168
|
+
}
|
|
60169
|
+
info.message = parts.filter((part) => !!part).join("\n");
|
|
60170
|
+
return info;
|
|
60171
|
+
})(), winston.format.colorize(), winston.format.printf(({ timestamp, level, message, service = "?" }) => {
|
|
60172
|
+
const result = `[${timestamp}] ${level} ${service}: ${message}`;
|
|
60173
|
+
return result.replace(/\\n/g, "\n");
|
|
60174
|
+
}))
|
|
60175
|
+
});
|
|
60176
|
+
}
|
|
60177
|
+
function createTransportStdout() {
|
|
60178
|
+
return new winston.transports.Console({
|
|
60179
|
+
level: "debug",
|
|
60180
|
+
handleExceptions: true,
|
|
60181
|
+
format: winston.format.combine(winston.format(jsonFormat)(), winston.format.timestamp(), winston.format.json())
|
|
60182
|
+
});
|
|
60183
|
+
}
|
|
60184
|
+
function createTransportSilent() {
|
|
60185
|
+
return new winston.transports.Console({
|
|
60186
|
+
silent: true
|
|
60187
|
+
});
|
|
60188
|
+
}
|
|
60189
|
+
|
|
60190
|
+
// ../hyperline-monitoring/build/logger/instance.js
|
|
60191
|
+
var loggerFactory = buildLoggerFactory({
|
|
60192
|
+
config: {
|
|
60193
|
+
enableConsoleTransport: config2.LOGGER_CONSOLE_ENABLED ?? false,
|
|
60194
|
+
enableStdoutTransport: config2.LOGGER_STDOUT_ENABLED ?? false
|
|
60195
|
+
},
|
|
60196
|
+
context: {
|
|
60197
|
+
// APP_ENV wins where NODE_ENV is not the real environment — today only the PDF
|
|
60198
|
+
// render workers, which force NODE_ENV="production" for the React build.
|
|
60199
|
+
// Unset elsewhere, so this is a no-op fallback for every other process.
|
|
60200
|
+
env: config2.APP_ENV ?? config2.NODE_ENV,
|
|
60201
|
+
service: config2.DD_SERVICE ?? "api",
|
|
60202
|
+
version: config2.APP_VERSION
|
|
60203
|
+
}
|
|
60204
|
+
});
|
|
60205
|
+
var createLogger2 = loggerFactory.createLogger;
|
|
60206
|
+
var logger = loggerFactory.createLogger({ serviceName: "default" });
|
|
60207
|
+
|
|
60208
|
+
// ../hyperline-monitoring/build/tracing/tracing.js
|
|
60209
|
+
import tracer from "dd-trace";
|
|
60210
|
+
|
|
60211
|
+
// ../hyperline-lib/build/utils/aws.js
|
|
60212
|
+
import { GetBucketLocationCommand, S3Client } from "@aws-sdk/client-s3";
|
|
60213
|
+
import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
60084
60214
|
|
|
60085
60215
|
// ../../node_modules/decimal.js/decimal.mjs
|
|
60086
60216
|
var EXP_LIMIT = 9e15;
|
|
@@ -62364,62 +62494,6 @@ var authorizedOperators = [
|
|
|
62364
62494
|
...mapAuthorizedOperators
|
|
62365
62495
|
];
|
|
62366
62496
|
|
|
62367
|
-
// ../hyperline-lib/build/http/dto/country.js
|
|
62368
|
-
var countryCodes = countriesAndCurrencies.map(({ countryCode }) => countryCode);
|
|
62369
|
-
var CountrySchema = external_exports.enum(countryCodes).openapi({
|
|
62370
|
-
description: "Two-letter country code in ISO format. See [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).",
|
|
62371
|
-
example: "FR"
|
|
62372
|
-
});
|
|
62373
|
-
|
|
62374
|
-
// ../hyperline-lib/build/http/dto/currency.js
|
|
62375
|
-
var currencyCodes = Array.from(new Set(countriesAndCurrencies.map(({ currencyCode }) => currencyCode).filter((currencyCode) => Boolean(currencyCode))));
|
|
62376
|
-
var CurrencySchema = external_exports.enum(currencyCodes).openapi({
|
|
62377
|
-
description: "Currency code. See [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes).",
|
|
62378
|
-
example: "EUR"
|
|
62379
|
-
});
|
|
62380
|
-
|
|
62381
|
-
// ../hyperline-lib/build/http/dto/dateTime.js
|
|
62382
|
-
var dateTimeDescription = "UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.";
|
|
62383
|
-
var DateTimeSchema = external_exports.iso.datetime({
|
|
62384
|
-
offset: false
|
|
62385
|
-
// only UTC date time
|
|
62386
|
-
}).openapi({
|
|
62387
|
-
description: dateTimeDescription,
|
|
62388
|
-
example: "2024-12-20T16:04:11Z"
|
|
62389
|
-
});
|
|
62390
|
-
|
|
62391
|
-
// ../hyperline-lib/build/http/dto/domain.js
|
|
62392
|
-
var DomainSchema = external_exports.string().trim().toLowerCase().regex(/^(?!:\/\/)(?=.{1,253}$)(?!-)([a-z0-9-]{1,63}\.)+[a-z]{2,63}$/, "Invalid domain").openapi({
|
|
62393
|
-
description: "Domain name.",
|
|
62394
|
-
example: "acme.com"
|
|
62395
|
-
});
|
|
62396
|
-
|
|
62397
|
-
// ../hyperline-lib/build/http/dto/error.js
|
|
62398
|
-
var ErrorSchema = external_exports.object({
|
|
62399
|
-
message: external_exports.string()
|
|
62400
|
-
});
|
|
62401
|
-
|
|
62402
|
-
// ../hyperline-lib/build/http/dto/pagination.js
|
|
62403
|
-
var PublicPaginationParams = {
|
|
62404
|
-
take: zod_default.coerce.number().nonnegative().max(100).optional().default(50),
|
|
62405
|
-
skip: zod_default.coerce.number().nonnegative().optional().default(0)
|
|
62406
|
-
};
|
|
62407
|
-
var PublicPaginationSchema = zod_default.object(PublicPaginationParams);
|
|
62408
|
-
var PublicCursorPaginationParams = {
|
|
62409
|
-
limit: zod_default.coerce.number().positive().max(100).optional().default(50).openapi({
|
|
62410
|
-
description: "Maximum number of items to return (1-100).",
|
|
62411
|
-
example: 50
|
|
62412
|
-
}),
|
|
62413
|
-
cursor: zod_default.string().optional().openapi({
|
|
62414
|
-
description: "Opaque cursor returned in the previous response's `next_cursor`. Omit to fetch the first page."
|
|
62415
|
-
}),
|
|
62416
|
-
include_total: BooleanSchema.optional().default(false).openapi({
|
|
62417
|
-
description: "Set to `true` to include `total` in the response.",
|
|
62418
|
-
example: false
|
|
62419
|
-
})
|
|
62420
|
-
};
|
|
62421
|
-
var PublicCursorPaginationSchema = zod_default.object(PublicCursorPaginationParams);
|
|
62422
|
-
|
|
62423
62497
|
// ../hyperline-lib/build/http/dto/state.js
|
|
62424
62498
|
var StateSchema = external_exports.enum(usStates).openapi({
|
|
62425
62499
|
description: "Only for US country. Second part of subdivision code in ISO format. See [ISO 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US).",
|