@hyperline/cli 0.1.0-build.1.ad8ef5e → 0.1.0-build.1.aeb38db
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 +31 -12
- package/package.json +1 -1
|
@@ -33833,7 +33833,7 @@ var require_shared = __commonJS({
|
|
|
33833
33833
|
getNameForCurrency: () => getNameForCurrency,
|
|
33834
33834
|
getNaturalNumber: () => getNaturalNumber,
|
|
33835
33835
|
getSymbolForCurrency: () => getSymbolForCurrency,
|
|
33836
|
-
getTimezoneByName: () =>
|
|
33836
|
+
getTimezoneByName: () => getTimezoneByName2,
|
|
33837
33837
|
getTimezoneOffsetName: () => getTimezoneOffsetName,
|
|
33838
33838
|
getTimezones: () => getTimezones2,
|
|
33839
33839
|
getValidTimezonesNames: () => getValidTimezonesNames,
|
|
@@ -33850,7 +33850,7 @@ var require_shared = __commonJS({
|
|
|
33850
33850
|
subtract: () => subtract,
|
|
33851
33851
|
sum: () => sum2,
|
|
33852
33852
|
toLocalTime: () => toLocalTime3,
|
|
33853
|
-
toUtc: () =>
|
|
33853
|
+
toUtc: () => toUtc3,
|
|
33854
33854
|
useDebounce: () => useDebounce
|
|
33855
33855
|
});
|
|
33856
33856
|
module.exports = __toCommonJS(shared_exports);
|
|
@@ -36557,14 +36557,14 @@ var require_shared = __commonJS({
|
|
|
36557
36557
|
function getTimezones2() {
|
|
36558
36558
|
return timezones;
|
|
36559
36559
|
}
|
|
36560
|
-
function
|
|
36560
|
+
function getTimezoneByName2(tz) {
|
|
36561
36561
|
var _a2;
|
|
36562
36562
|
if (tz === "UTC") {
|
|
36563
36563
|
return timezones.find(({ name }) => name === "Etc/UTC");
|
|
36564
36564
|
}
|
|
36565
36565
|
return (_a2 = timezones.find(({ name }) => name === tz)) != null ? _a2 : timezones.find(({ group }) => group.includes(tz));
|
|
36566
36566
|
}
|
|
36567
|
-
function
|
|
36567
|
+
function toUtc3(date5, timezone) {
|
|
36568
36568
|
return (0, import_date_fns_tz.fromZonedTime)(date5, timezone);
|
|
36569
36569
|
}
|
|
36570
36570
|
function toLocalTime3(date5, localTimezone) {
|
|
@@ -36575,7 +36575,7 @@ var require_shared = __commonJS({
|
|
|
36575
36575
|
);
|
|
36576
36576
|
var constructDateFromTimezoneToLocal = (date5, timezone) => {
|
|
36577
36577
|
if (!timezone) return date5;
|
|
36578
|
-
const timezoneObj =
|
|
36578
|
+
const timezoneObj = getTimezoneByName2(timezone);
|
|
36579
36579
|
if (!timezoneObj) return date5;
|
|
36580
36580
|
const dateAtTimezone = new Date(
|
|
36581
36581
|
date5.getFullYear(),
|
|
@@ -40756,7 +40756,7 @@ Examples:
|
|
|
40756
40756
|
queryParamKeys: []
|
|
40757
40757
|
});
|
|
40758
40758
|
});
|
|
40759
|
-
resource.command("create-custom-property").description(`Create a new custom property definition with a name, type (
|
|
40759
|
+
resource.command("create-custom-property").description(`Create a new custom property definition with a name, type (text, number, boolean, date, select, multi_select), and optional default value.`).requiredOption("--name <value>", `name`).requiredOption("--type <value>", `type`).requiredOption("--slug <value>", `slug`).requiredOption("--entities <json>", `entities`).option("--api-only", `api_only`).option("--required", `required`).option("--authorized-values <json>", `authorized_values`).option("--default-value <json>", `Value set on entities created without an explicit value for this custom property. On existing entities without a value, it also satisfies \`required\`. Must match the custom property type, and one of \`authorized_values\` for \`select\` and \`multi_select\` types. Dates are ISO 8601 strings. Null means no default value.`).addHelpText("after", `
|
|
40760
40760
|
Examples:
|
|
40761
40761
|
hyperline custom-properties create-custom-property --name <name> --type <type> --slug <slug> --entities <entities>
|
|
40762
40762
|
hyperline custom-properties create-custom-property --name <name> --type <type> --slug <slug> --entities <entities> --api-only --required
|
|
@@ -40781,6 +40781,8 @@ Examples:
|
|
|
40781
40781
|
args.entities = JSON.parse(opts.entities);
|
|
40782
40782
|
if (opts.authorizedValues !== void 0)
|
|
40783
40783
|
args.authorized_values = JSON.parse(opts.authorizedValues);
|
|
40784
|
+
if (opts.defaultValue !== void 0)
|
|
40785
|
+
args.default_value = JSON.parse(opts.defaultValue);
|
|
40784
40786
|
await ctx.execute({
|
|
40785
40787
|
method: "POST",
|
|
40786
40788
|
path: "/v1/custom-properties",
|
|
@@ -40788,7 +40790,7 @@ Examples:
|
|
|
40788
40790
|
queryParamKeys: []
|
|
40789
40791
|
});
|
|
40790
40792
|
});
|
|
40791
|
-
resource.command("update-custom-property").description(`Update an existing custom property definition by ID.`).requiredOption("--id <value>", `id parameter`).requiredOption("--name <value>", `name`).requiredOption("--type <value>", `type`).requiredOption("--slug <value>", `slug`).requiredOption("--entities <json>", `entities`).option("--api-only", `api_only`).option("--required", `required`).option("--authorized-values <json>", `authorized_values`).addHelpText("after", `
|
|
40793
|
+
resource.command("update-custom-property").description(`Update an existing custom property definition by ID.`).requiredOption("--id <value>", `id parameter`).requiredOption("--name <value>", `name`).requiredOption("--type <value>", `type`).requiredOption("--slug <value>", `slug`).requiredOption("--entities <json>", `entities`).option("--api-only", `api_only`).option("--required", `required`).option("--authorized-values <json>", `authorized_values`).option("--default-value <json>", `Value set on entities created without an explicit value for this custom property. On existing entities without a value, it also satisfies \`required\`. Must match the custom property type, and one of \`authorized_values\` for \`select\` and \`multi_select\` types. Dates are ISO 8601 strings. Null means no default value.`).addHelpText("after", `
|
|
40792
40794
|
Examples:
|
|
40793
40795
|
hyperline custom-properties update-custom-property --id <id> --name <name> --type <type> --slug <slug> --entities <entities>
|
|
40794
40796
|
hyperline custom-properties update-custom-property --id <id> --name <name> --type <type> --slug <slug> --entities <entities> --api-only --required
|
|
@@ -40815,6 +40817,8 @@ Examples:
|
|
|
40815
40817
|
args.entities = JSON.parse(opts.entities);
|
|
40816
40818
|
if (opts.authorizedValues !== void 0)
|
|
40817
40819
|
args.authorized_values = JSON.parse(opts.authorizedValues);
|
|
40820
|
+
if (opts.defaultValue !== void 0)
|
|
40821
|
+
args.default_value = JSON.parse(opts.defaultValue);
|
|
40818
40822
|
await ctx.execute({
|
|
40819
40823
|
method: "PUT",
|
|
40820
40824
|
path: "/v1/custom-properties/{id}",
|
|
@@ -41846,7 +41850,7 @@ Examples:
|
|
|
41846
41850
|
queryParamKeys: []
|
|
41847
41851
|
});
|
|
41848
41852
|
});
|
|
41849
|
-
resource.command("list-customer-credit-transactions").description(`List all transactions (
|
|
41853
|
+
resource.command("list-customer-credit-transactions").description(`List all transactions (topups, usages, expirations) for a specific credit product. Paginated with take/skip and optional filters.`).requiredOption("--id <value>", `id parameter`).requiredOption("--product-id <value>", `productId parameter`).option("--take <number>", `take`).option("--skip <number>", `skip`).option("--type <value>", `type`).option("--invoice-id <value>", `invoice_id`).option("--created-at <value>", `created_at`).addHelpText("after", `
|
|
41850
41854
|
Examples:
|
|
41851
41855
|
hyperline customers-credits list-customer-credit-transactions --id <id> --product-id <productId>
|
|
41852
41856
|
hyperline customers-credits list-customer-credit-transactions --id <id> --product-id <productId> --take <take> --type <type>`).action(async (opts) => {
|
|
@@ -42972,7 +42976,7 @@ Payment method strategy used to charge the invoice. Only applies to \`to_pay\` s
|
|
|
42972
42976
|
|
|
42973
42977
|
- \`current\`: Use the current default payment method of the customer.
|
|
42974
42978
|
- \`external\`: Manage the payment of the invoice outside of Hyperline.
|
|
42975
|
-
`).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 <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `Values for custom properties defined for the \`invoice\` entity, keyed by slug.`).option("--additional-display-fields <json>", `Ordered additional fields displayed on the invoice PDF. Invoice and customer custom properties are referenced by slug.`).requiredOption("--line-items <json>", `line_items`).option("--transactions <json>", `transactions`).option("--coupons <json>", `coupons`).addHelpText("after", `
|
|
42979
|
+
`).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("--issuing-method <value>", `Set to \`scheduled\` to finalize the draft invoice automatically on its issue date (\`emitted_at\`), resolved to the start of that day in the customer timezone. Requires \`status\` to be \`draft\` and an issue date after today. Default to \`manual\`.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `Values for custom properties defined for the \`invoice\` entity, keyed by slug.`).option("--additional-display-fields <json>", `Ordered additional fields displayed on the invoice PDF. Invoice and customer custom properties are referenced by slug.`).requiredOption("--line-items <json>", `line_items`).option("--transactions <json>", `transactions`).option("--coupons <json>", `coupons`).addHelpText("after", `
|
|
42976
42980
|
Examples:
|
|
42977
42981
|
hyperline invoices create-invoice --customer-id <customer_id> --line-items <line_items>
|
|
42978
42982
|
hyperline invoices create-invoice --customer-id <customer_id> --line-items <line_items> --currency <currency> --status <status>
|
|
@@ -43023,6 +43027,8 @@ Examples:
|
|
|
43023
43027
|
args.due_at = opts.dueAt;
|
|
43024
43028
|
if (opts.settledAt !== void 0)
|
|
43025
43029
|
args.settled_at = opts.settledAt;
|
|
43030
|
+
if (opts.issuingMethod !== void 0)
|
|
43031
|
+
args.issuing_method = opts.issuingMethod;
|
|
43026
43032
|
if (opts.properties !== void 0)
|
|
43027
43033
|
args.properties = JSON.parse(opts.properties);
|
|
43028
43034
|
if (opts.customProperties !== void 0)
|
|
@@ -43212,7 +43218,7 @@ Examples:
|
|
|
43212
43218
|
|
|
43213
43219
|
- \`auto\`: Tax is automatically computed and applied.
|
|
43214
43220
|
- \`not_eligible\`: Tax collection is disabled for the invoice.
|
|
43215
|
-
`).option("--line-items <json>", `line_items`).option("--coupons <json>", `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("--subscription-id <value>", `ID of the subscription related to the invoice.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `Values for custom properties defined for the \`invoice\` entity, keyed by slug.`).option("--additional-display-fields <json>", `Ordered additional fields displayed on the invoice PDF. Invoice and customer custom properties are referenced by slug.`).option("--customer <json>", `Override customer details on the invoice. Only allowed for draft or grace period invoices.`).addHelpText("after", `
|
|
43221
|
+
`).option("--issuing-method <value>", `Set to \`scheduled\` to finalize the draft invoice automatically on its issue date (\`emitted_at\`), in the invoice timezone. The issue date must be after today. Set to \`manual\` to unschedule the invoice.`).option("--emitted-at <value>", `Issue date of the draft invoice. For a scheduled invoice, the day on which it is automatically finalized.`).option("--line-items <json>", `line_items`).option("--coupons <json>", `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("--subscription-id <value>", `ID of the subscription related to the invoice.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `Values for custom properties defined for the \`invoice\` entity, keyed by slug.`).option("--additional-display-fields <json>", `Ordered additional fields displayed on the invoice PDF. Invoice and customer custom properties are referenced by slug.`).option("--customer <json>", `Override customer details on the invoice. Only allowed for draft or grace period invoices.`).addHelpText("after", `
|
|
43216
43222
|
Examples:
|
|
43217
43223
|
hyperline invoices update --id <id>
|
|
43218
43224
|
hyperline invoices update --id <id> --type <type> --document-name <document_name>
|
|
@@ -43241,6 +43247,10 @@ Examples:
|
|
|
43241
43247
|
args.footer = opts.footer;
|
|
43242
43248
|
if (opts.taxScheme !== void 0)
|
|
43243
43249
|
args.tax_scheme = opts.taxScheme;
|
|
43250
|
+
if (opts.issuingMethod !== void 0)
|
|
43251
|
+
args.issuing_method = opts.issuingMethod;
|
|
43252
|
+
if (opts.emittedAt !== void 0)
|
|
43253
|
+
args.emitted_at = opts.emittedAt;
|
|
43244
43254
|
if (opts.paymentMethodType !== void 0)
|
|
43245
43255
|
args.payment_method_type = opts.paymentMethodType;
|
|
43246
43256
|
if (opts.paymentMethodId !== void 0)
|
|
@@ -44132,7 +44142,7 @@ How the periodic credit allowance is granted for partial billing periods.
|
|
|
44132
44142
|
|
|
44133
44143
|
- \`prorated\` (default): the granted credits are prorated to the elapsed period.
|
|
44134
44144
|
- \`full_allowance\`: the full allowance is always granted (the invoice remains prorated).
|
|
44135
|
-
`).option("--credits-balance-auto-creation-enabled <value>", `Default for the \`credits_balance_auto_creation_enabled\` setting of subscription products using this credit product: whether the customer credit balance is created as soon as the product is added to a subscription. \`true\` when unset. A subscription product can override it.`).option("--display-mode <value>", `How bundle items are displayed on invoices.`).option("--exclusive-items-enabled", `When true, only one item in the bundle can be active at a time.`).option("--bundle-items <json>", `Products included in this bundle. Percentages must sum to 100.`).addHelpText("after", `
|
|
44145
|
+
`).option("--credits-balance-auto-creation-enabled <value>", `Default for the \`credits_balance_auto_creation_enabled\` setting of subscription products using this credit product: whether the customer credit balance is created as soon as the product is added to a subscription. \`true\` when unset. A subscription product can override it.`).option("--portal-top-up-auto-activation-enabled <value>", `Whether portal top-ups are enabled for the customer when a credit balance of this product is created for them, from a subscription or manually. Portal top-ups must also be enabled in the hosted pages settings to show on the portal. \`false\` when unset.`).option("--display-mode <value>", `How bundle items are displayed on invoices.`).option("--exclusive-items-enabled", `When true, only one item in the bundle can be active at a time.`).option("--bundle-items <json>", `Products included in this bundle. Percentages must sum to 100.`).addHelpText("after", `
|
|
44136
44146
|
Examples:
|
|
44137
44147
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations>
|
|
44138
44148
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations> --description <description> --description-display-interval-dates
|
|
@@ -44159,6 +44169,8 @@ Examples:
|
|
|
44159
44169
|
args.credits_grant_mode = opts.creditsGrantMode;
|
|
44160
44170
|
if (opts.creditsBalanceAutoCreationEnabled !== void 0)
|
|
44161
44171
|
args.credits_balance_auto_creation_enabled = opts.creditsBalanceAutoCreationEnabled;
|
|
44172
|
+
if (opts.portalTopUpAutoActivationEnabled !== void 0)
|
|
44173
|
+
args.portal_top_up_auto_activation_enabled = opts.portalTopUpAutoActivationEnabled;
|
|
44162
44174
|
if (opts.displayMode !== void 0)
|
|
44163
44175
|
args.display_mode = opts.displayMode;
|
|
44164
44176
|
if (opts.lowCreditsThreshold !== void 0)
|
|
@@ -65877,6 +65889,8 @@ var usStates = [
|
|
|
65877
65889
|
|
|
65878
65890
|
// ../hyperline-lib/build/utils/dates.js
|
|
65879
65891
|
var import_shared2 = __toESM(require_shared(), 1);
|
|
65892
|
+
var PERIOD_BOUND_DRIFT_TOLERANCE_MS = 2 * 60 * 1e3;
|
|
65893
|
+
var DST_SHIFT_MS = 60 * 60 * 1e3;
|
|
65880
65894
|
|
|
65881
65895
|
// ../hyperline-lib/build/utils/document.js
|
|
65882
65896
|
var import_shared3 = __toESM(require_shared(), 1);
|
|
@@ -65888,6 +65902,11 @@ import * as https from "node:https";
|
|
|
65888
65902
|
import { createHash as createHash2 } from "node:crypto";
|
|
65889
65903
|
import { deepEqual } from "fast-equals";
|
|
65890
65904
|
|
|
65905
|
+
// ../hyperline-lib/build/utils/realignDatesToTimezone.js
|
|
65906
|
+
var import_shared4 = __toESM(require_shared(), 1);
|
|
65907
|
+
var MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1e3;
|
|
65908
|
+
var LAST_MILLISECOND_OF_DAY = MILLISECONDS_PER_DAY - 1;
|
|
65909
|
+
|
|
65891
65910
|
// ../hyperline-lib/build/utils/api/filterBuilder.js
|
|
65892
65911
|
var baseAuthorizedOperators = ["not", "isNull", "isNotNull"];
|
|
65893
65912
|
var booleanAuthorizedOperators = [
|
|
@@ -65954,7 +65973,7 @@ var isAxiosError = axios.isAxiosError;
|
|
|
65954
65973
|
|
|
65955
65974
|
// ../hyperline-lib/build/httpClient/httpClient.js
|
|
65956
65975
|
import axios2 from "axios";
|
|
65957
|
-
import axiosRetry, { isNetworkOrIdempotentRequestError } from "axios-retry";
|
|
65976
|
+
import axiosRetry, { isNetworkOrIdempotentRequestError, retryAfter } from "axios-retry";
|
|
65958
65977
|
import { AxiosError } from "axios";
|
|
65959
65978
|
var recommendedRetryConfig = {
|
|
65960
65979
|
retries: 3,
|