@hyperline/cli 0.1.0-build.1.f2d77c6 → 0.1.0-build.1.f3a8945
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 +1866 -195
- package/package.json +1 -4
|
@@ -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);
|
|
@@ -34985,10 +34985,10 @@ var require_shared = __commonJS({
|
|
|
34985
34985
|
ZodId: () => ZodId,
|
|
34986
34986
|
ZodTranslationsSchemaFn: () => ZodTranslationsSchemaFn
|
|
34987
34987
|
});
|
|
34988
|
-
var
|
|
34988
|
+
var import_zod22 = require_lib();
|
|
34989
34989
|
var countryIds2 = ["all", ...countries.map(({ id }) => id)];
|
|
34990
|
-
var ZodId =
|
|
34991
|
-
var ZodTranslationsSchemaFn = (schema) =>
|
|
34990
|
+
var ZodId = import_zod22.z.enum(countryIds2);
|
|
34991
|
+
var ZodTranslationsSchemaFn = (schema) => import_zod22.z.record(import_zod22.z.string(), schema.optional());
|
|
34992
34992
|
var UsStates = [
|
|
34993
34993
|
{ id: "AA", name: "Armed Forces Americas" },
|
|
34994
34994
|
{ id: "AE", name: "Armed Forces Europe" },
|
|
@@ -36287,14 +36287,14 @@ var require_shared = __commonJS({
|
|
|
36287
36287
|
ZodNumberCurrencyPositiveValue: () => ZodNumberCurrencyPositiveValue,
|
|
36288
36288
|
ZodNumberCurrencyPositiveValueExcludingZero: () => ZodNumberCurrencyPositiveValueExcludingZero
|
|
36289
36289
|
});
|
|
36290
|
-
var
|
|
36291
|
-
var ZodCurrencyId =
|
|
36290
|
+
var import_zod23 = require_lib();
|
|
36291
|
+
var ZodCurrencyId = import_zod23.z.enum(
|
|
36292
36292
|
all_default.map(({ id }) => id)
|
|
36293
36293
|
);
|
|
36294
|
-
var ZodNumberCurrency =
|
|
36295
|
-
var ZodNumberCurrencyPositiveValue =
|
|
36296
|
-
var ZodNumberCurrencyPositiveValueExcludingZero =
|
|
36297
|
-
var ZodCurrencyMap =
|
|
36294
|
+
var ZodNumberCurrency = import_zod23.z.string().or(import_zod23.z.number().transform((number4) => number4)).transform((number4) => number4);
|
|
36295
|
+
var ZodNumberCurrencyPositiveValue = import_zod23.z.number().min(0).transform((number4) => number4).transform((number4) => number4);
|
|
36296
|
+
var ZodNumberCurrencyPositiveValueExcludingZero = import_zod23.z.number().gt(0).transform((number4) => number4).transform((number4) => number4);
|
|
36297
|
+
var ZodCurrencyMap = import_zod23.z.record(ZodNumberCurrency).refine(
|
|
36298
36298
|
(data) => Object.keys(data).every((key) => ZodCurrencyId.safeParse(key).success),
|
|
36299
36299
|
{
|
|
36300
36300
|
message: "Invalid currency key.",
|
|
@@ -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(),
|
|
@@ -38941,7 +38941,7 @@ Examples:
|
|
|
38941
38941
|
]
|
|
38942
38942
|
});
|
|
38943
38943
|
});
|
|
38944
|
-
resource.command("get-accounting-rule-tree").description(`Retrieve accounting rules organized as a filter tree.`).option("--ledger-id <value>", `Ledger identifier.`).option("--invoicing-entity-id <value>", `Optional invoicing entity identifier.`).option("--max-depth <number>", `Maximum tree depth to return.`).option("--search <value>", `Search by rule identifier or category.`).addHelpText("after", `
|
|
38944
|
+
resource.command("get-accounting-rule-tree").description(`Retrieve accounting rules organized as a filter tree. Accounting software sync rules are excluded.`).option("--ledger-id <value>", `Ledger identifier.`).option("--invoicing-entity-id <value>", `Optional invoicing entity identifier.`).option("--max-depth <number>", `Maximum tree depth to return.`).option("--search <value>", `Search by rule identifier or category.`).addHelpText("after", `
|
|
38945
38945
|
Examples:
|
|
38946
38946
|
hyperline accounting-rules get-accounting-rule-tree
|
|
38947
38947
|
hyperline accounting-rules get-accounting-rule-tree --ledger-id <ledger_id> --invoicing-entity-id <invoicing_entity_id>`).action(async (opts) => {
|
|
@@ -39013,7 +39013,7 @@ Examples:
|
|
|
39013
39013
|
queryParamKeys: []
|
|
39014
39014
|
});
|
|
39015
39015
|
});
|
|
39016
|
-
resource.command("create").description(`Create a new accounting rule for account code routing or journal posting.`).option("--ledger-id <value>", `Identifier of the ledger this rule belongs to.`).option("--name <value>", `Optional user-defined name for the rule.`).requiredOption("--category <value>", `Rule category (e.g. accounting_software, invoice_posted).`).requiredOption("--priority <number>", `Override order. Higher priority wins when multiple rules match.`).option("--product-ids <json>", `Product IDs to match. Empty means match all.`).option("--product-types <json>", `Product types to match. Allowed values: flat_fee, dynamic, seat, credit. Empty means match all.`).option("--customer-ids <json>", `Customer IDs for customer-specific overrides.`).option("--currencies <json>", `Currency codes to match (e.g. EUR, USD).`).option("--countries <json>", `Country codes for jurisdiction-based overrides.`).option("--coupon-ids <json>", `Coupon IDs to match. Empty means match all.`).option("--client-provider-ids <json>", `Client provider IDs to match. Empty means match all.`).option("--payment-method-types <json>", `Payment method types to match. Empty means match all.`).option("--interval-period <value>", `Billing interval period filter (month, year, etc.).`).option("--interval-count <number>", `Billing interval count filter.`).option("--revenue-ledger-account-id <value>", `Revenue ledger account ID used for invoice line revenue routing.`).option("--deferred-revenue-ledger-account-id <value>", `Deferred revenue ledger account ID used before revenue is recognized.`).option("--deferred-discount-ledger-account-id <value>", `Deferred discount ledger account ID used before discounts are recognized.`).option("--contra-revenue-ledger-account-id <value>", `Contra revenue ledger account ID used for amounts that reduce revenue.`).option("--discount-ledger-account-id <value>", `Discount ledger account ID used for recognized discounts.`).option("--ar-ledger-account-id <value>", `Accounts receivable ledger account ID used for invoice posting.`).option("--cash-ledger-account-id <value>", `Cash ledger account ID used for payment settlement.`).option("--payments-clearing-ledger-account-id <value>", `Payments clearing ledger account ID used while payments settle.`).option("--output-tax-ledger-account-id <value>", `Output tax ledger account ID used for tax liability.`).option("--uncollectible-debit-ledger-account-id <value>", `Ledger account ID debited when an invoice becomes uncollectible. Use an asset account for doubtful-receivable reclassification or an expense account for direct write-off.`).option("--customer-credits-ledger-account-id <value>", `Customer credits ledger account ID used for credit balances.`).option("--journal-id <value>", `Journal ID used to route entries in the accounting provider.`).option("--entity-type <value>", `Entity type the rule applies to.`).addHelpText("after", `
|
|
39016
|
+
resource.command("create").description(`Create a new accounting rule for account code routing or journal posting.`).option("--ledger-id <value>", `Identifier of the ledger this rule belongs to.`).option("--name <value>", `Optional user-defined name for the rule.`).requiredOption("--category <value>", `Rule category (e.g. accounting_software, invoice_posted).`).requiredOption("--priority <number>", `Override order. Higher priority wins when multiple rules match.`).option("--product-ids <json>", `Product IDs to match. Empty means match all.`).option("--product-types <json>", `Product types to match. Allowed values: flat_fee, dynamic, seat, credit. Empty means match all.`).option("--customer-ids <json>", `Customer IDs for customer-specific overrides.`).option("--currencies <json>", `Currency codes to match (e.g. EUR, USD).`).option("--countries <json>", `Country codes for jurisdiction-based overrides.`).option("--coupon-ids <json>", `Coupon IDs to match. Empty means match all.`).option("--client-provider-ids <json>", `Client provider IDs to match. Empty means match all.`).option("--payment-method-types <json>", `Payment method types to match. Empty means match all.`).option("--interval-period <value>", `Billing interval period filter (month, year, etc.).`).option("--interval-count <number>", `Billing interval count filter.`).option("--custom-property-filters <json>", `Invoice custom property filters. A rule matches only when every entry matches (AND across entries), and an entry matches when the invoice value is one of its \`values\` (any-of). Matching is strict: an invoice without a value for the property never matches. Each entry adds 10 to the \`suggested_priority\` returned by the rule defaults endpoint. Allowed on invoice_posted, invoice_settled, revenue_recognition, credit_note_created and accounting_software (invoice side) rules. An invoice_settled rule with filters cannot set \`payments_clearing_ledger_account_id\`, as PSP payouts are booked without the invoice. Empty means match all.`).option("--revenue-ledger-account-id <value>", `Revenue ledger account ID used for invoice line revenue routing.`).option("--deferred-revenue-ledger-account-id <value>", `Deferred revenue ledger account ID used before revenue is recognized.`).option("--deferred-discount-ledger-account-id <value>", `Deferred discount ledger account ID used before discounts are recognized.`).option("--contra-revenue-ledger-account-id <value>", `Contra revenue ledger account ID used for amounts that reduce revenue.`).option("--discount-ledger-account-id <value>", `Discount ledger account ID used for recognized discounts.`).option("--ar-ledger-account-id <value>", `Accounts receivable ledger account ID used for invoice posting.`).option("--cash-ledger-account-id <value>", `Cash ledger account ID used for payment settlement.`).option("--payments-clearing-ledger-account-id <value>", `Payments clearing ledger account ID used while payments settle.`).option("--output-tax-ledger-account-id <value>", `Output tax ledger account ID used for tax liability.`).option("--uncollectible-debit-ledger-account-id <value>", `Ledger account ID debited when an invoice becomes uncollectible. Use an asset account for doubtful-receivable reclassification or an expense account for direct write-off.`).option("--customer-credits-ledger-account-id <value>", `Customer credits ledger account ID used for credit balances.`).option("--journal-id <value>", `Journal ID used to route entries in the accounting provider.`).option("--entity-type <value>", `Entity type the rule applies to.`).addHelpText("after", `
|
|
39017
39017
|
Examples:
|
|
39018
39018
|
hyperline accounting-rules create --category <category> --priority <priority>
|
|
39019
39019
|
hyperline accounting-rules create --category <category> --priority <priority> --ledger-id <ledger_id> --name <name>
|
|
@@ -39078,6 +39078,8 @@ Examples:
|
|
|
39078
39078
|
args.client_provider_ids = JSON.parse(opts.clientProviderIds);
|
|
39079
39079
|
if (opts.paymentMethodTypes !== void 0)
|
|
39080
39080
|
args.payment_method_types = JSON.parse(opts.paymentMethodTypes);
|
|
39081
|
+
if (opts.customPropertyFilters !== void 0)
|
|
39082
|
+
args.custom_property_filters = JSON.parse(opts.customPropertyFilters);
|
|
39081
39083
|
await ctx.execute({
|
|
39082
39084
|
method: "POST",
|
|
39083
39085
|
path: "/v1/accounting/rules",
|
|
@@ -39085,7 +39087,7 @@ Examples:
|
|
|
39085
39087
|
queryParamKeys: []
|
|
39086
39088
|
});
|
|
39087
39089
|
});
|
|
39088
|
-
resource.command("update").description(`Update an existing accounting rule.`).requiredOption("--id <value>", `id parameter`).option("--name <value>", `Optional user-defined name for the rule.`).option("--category <value>", `Rule category
|
|
39090
|
+
resource.command("update").description(`Update an existing accounting rule.`).requiredOption("--id <value>", `id parameter`).option("--name <value>", `Optional user-defined name for the rule.`).option("--category <value>", `Rule category. Cannot be changed after creation, must match the current category when sent.`).option("--priority <number>", `Override order. Higher priority wins when multiple rules match.`).option("--product-ids <json>", `Product IDs to match. Empty means match all.`).option("--product-types <json>", `Product types to match. Allowed values: flat_fee, dynamic, seat, credit. Empty means match all.`).option("--customer-ids <json>", `Customer IDs for customer-specific overrides.`).option("--currencies <json>", `Currency codes to match (e.g. EUR, USD).`).option("--countries <json>", `Country codes for jurisdiction-based overrides.`).option("--coupon-ids <json>", `Coupon IDs to match. Empty means match all.`).option("--client-provider-ids <json>", `Client provider IDs to match. Empty means match all.`).option("--payment-method-types <json>", `Payment method types to match. Empty means match all.`).option("--interval-period <value>", `Billing interval period filter (month, year, etc.).`).option("--interval-count <number>", `Billing interval count filter.`).option("--custom-property-filters <json>", `Invoice custom property filters. A rule matches only when every entry matches (AND across entries), and an entry matches when the invoice value is one of its \`values\` (any-of). Matching is strict: an invoice without a value for the property never matches. Each entry adds 10 to the \`suggested_priority\` returned by the rule defaults endpoint. Allowed on invoice_posted, invoice_settled, revenue_recognition, credit_note_created and accounting_software (invoice side) rules. An invoice_settled rule with filters cannot set \`payments_clearing_ledger_account_id\`, as PSP payouts are booked without the invoice. Empty means match all.`).option("--revenue-ledger-account-id <value>", `Revenue ledger account ID used for invoice line revenue routing.`).option("--deferred-revenue-ledger-account-id <value>", `Deferred revenue ledger account ID used before revenue is recognized.`).option("--deferred-discount-ledger-account-id <value>", `Deferred discount ledger account ID used before discounts are recognized.`).option("--contra-revenue-ledger-account-id <value>", `Contra revenue ledger account ID used for amounts that reduce revenue.`).option("--discount-ledger-account-id <value>", `Discount ledger account ID used for recognized discounts.`).option("--ar-ledger-account-id <value>", `Accounts receivable ledger account ID used for invoice posting.`).option("--cash-ledger-account-id <value>", `Cash ledger account ID used for payment settlement.`).option("--payments-clearing-ledger-account-id <value>", `Payments clearing ledger account ID used while payments settle.`).option("--output-tax-ledger-account-id <value>", `Output tax ledger account ID used for tax liability.`).option("--uncollectible-debit-ledger-account-id <value>", `Ledger account ID debited when an invoice becomes uncollectible. Use an asset account for doubtful-receivable reclassification or an expense account for direct write-off.`).option("--customer-credits-ledger-account-id <value>", `Customer credits ledger account ID used for credit balances.`).option("--journal-id <value>", `Journal ID used to route entries in the accounting provider.`).option("--entity-type <value>", `Entity type the rule applies to.`).addHelpText("after", `
|
|
39089
39091
|
Examples:
|
|
39090
39092
|
hyperline accounting-rules update --id <id>
|
|
39091
39093
|
hyperline accounting-rules update --id <id> --name <name> --category <category>
|
|
@@ -39150,6 +39152,8 @@ Examples:
|
|
|
39150
39152
|
args.client_provider_ids = JSON.parse(opts.clientProviderIds);
|
|
39151
39153
|
if (opts.paymentMethodTypes !== void 0)
|
|
39152
39154
|
args.payment_method_types = JSON.parse(opts.paymentMethodTypes);
|
|
39155
|
+
if (opts.customPropertyFilters !== void 0)
|
|
39156
|
+
args.custom_property_filters = JSON.parse(opts.customPropertyFilters);
|
|
39153
39157
|
await ctx.execute({
|
|
39154
39158
|
method: "PUT",
|
|
39155
39159
|
path: "/v1/accounting/rules/{id}",
|
|
@@ -39183,7 +39187,7 @@ Examples:
|
|
|
39183
39187
|
queryParamKeys: []
|
|
39184
39188
|
});
|
|
39185
39189
|
});
|
|
39186
|
-
resource.command("resolve").description(`Preview which account codes would be resolved for a given context.`).requiredOption("--ledger-id <value>", `Identifier of the ledger this rule belongs to.`).requiredOption("--category <value>", `Rule category (e.g. accounting_software, invoice_posted).`).option("--product-id <value>", `Product ID to resolve against.`).option("--product-type <value>", `Product type to resolve against.`).option("--currency <value>", `Currency code to resolve against.`).option("--country <value>", `Country code to resolve against.`).option("--customer-id <value>", `Customer ID to resolve against.`).option("--invoice-type <value>", `Invoice kind to resolve against. Accepts \`invoice\` or \`document\`; any other invoice kind is matched as \`invoice\`.`).option("--interval-period <value>", `Billing interval period filter (month, year, etc.).`).option("--interval-count <number>", `Billing interval count filter.`).addHelpText("after", `
|
|
39190
|
+
resource.command("resolve").description(`Preview which account codes would be resolved for a given context.`).requiredOption("--ledger-id <value>", `Identifier of the ledger this rule belongs to.`).requiredOption("--category <value>", `Rule category (e.g. accounting_software, invoice_posted).`).option("--product-id <value>", `Product ID to resolve against.`).option("--product-type <value>", `Product type to resolve against.`).option("--currency <value>", `Currency code to resolve against.`).option("--country <value>", `Country code to resolve against.`).option("--customer-id <value>", `Customer ID to resolve against.`).option("--invoice-type <value>", `Invoice kind to resolve against. Accepts \`invoice\` or \`document\`; any other invoice kind is matched as \`invoice\`.`).option("--interval-period <value>", `Billing interval period filter (month, year, etc.).`).option("--interval-count <number>", `Billing interval count filter.`).option("--custom-properties <json>", `Invoice custom property values to resolve against, keyed by custom property slug. Unknown slugs and null values are ignored. Rules with custom property filters never match without them.`).addHelpText("after", `
|
|
39187
39191
|
Examples:
|
|
39188
39192
|
hyperline accounting-rules resolve --ledger-id <ledger_id> --category <category>
|
|
39189
39193
|
hyperline accounting-rules resolve --ledger-id <ledger_id> --category <category> --product-id <product_id> --product-type <product_type>
|
|
@@ -39214,6 +39218,8 @@ Examples:
|
|
|
39214
39218
|
args.interval_period = opts.intervalPeriod;
|
|
39215
39219
|
if (opts.intervalCount !== void 0)
|
|
39216
39220
|
args.interval_count = Number(opts.intervalCount);
|
|
39221
|
+
if (opts.customProperties !== void 0)
|
|
39222
|
+
args.custom_properties = JSON.parse(opts.customProperties);
|
|
39217
39223
|
await ctx.execute({
|
|
39218
39224
|
method: "POST",
|
|
39219
39225
|
path: "/v1/accounting/rules/resolve",
|
|
@@ -39223,57 +39229,81 @@ Examples:
|
|
|
39223
39229
|
});
|
|
39224
39230
|
}
|
|
39225
39231
|
|
|
39226
|
-
// build/commands/generated/
|
|
39227
|
-
function
|
|
39228
|
-
const resource = parent.command("
|
|
39229
|
-
resource.command("
|
|
39232
|
+
// build/commands/generated/aggregators.js
|
|
39233
|
+
function registerAggregatorsCommands(parent) {
|
|
39234
|
+
const resource = parent.command("aggregators").description("Manage aggregators");
|
|
39235
|
+
resource.command("list").description(`List all aggregators with pagination. Aggregators define how billable events are counted or summed to compute usage.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
39230
39236
|
Examples:
|
|
39231
|
-
hyperline
|
|
39232
|
-
hyperline
|
|
39237
|
+
hyperline aggregators list
|
|
39238
|
+
hyperline aggregators list --take <take>`).action(async (opts) => {
|
|
39233
39239
|
const ctx = resource.parent?.opts()._ctx;
|
|
39234
39240
|
if (!ctx) {
|
|
39235
39241
|
process.stderr.write("Error: Not authenticated\n");
|
|
39236
39242
|
process.exit(1);
|
|
39237
39243
|
}
|
|
39238
39244
|
const args = {};
|
|
39239
|
-
if (opts.
|
|
39240
|
-
args.
|
|
39245
|
+
if (opts.take !== void 0)
|
|
39246
|
+
args.take = Number(opts.take);
|
|
39247
|
+
if (opts.skip !== void 0)
|
|
39248
|
+
args.skip = Number(opts.skip);
|
|
39241
39249
|
await ctx.execute({
|
|
39242
39250
|
method: "GET",
|
|
39243
|
-
path: "/v1/
|
|
39251
|
+
path: "/v1/aggregators",
|
|
39244
39252
|
args,
|
|
39245
|
-
queryParamKeys: ["
|
|
39253
|
+
queryParamKeys: ["take", "skip"]
|
|
39246
39254
|
});
|
|
39247
39255
|
});
|
|
39248
|
-
|
|
39249
|
-
|
|
39250
|
-
// build/commands/generated/bank-accounts.js
|
|
39251
|
-
function registerBank_AccountsCommands(parent) {
|
|
39252
|
-
const resource = parent.command("bank-accounts").description("Manage bank accounts");
|
|
39253
|
-
resource.command("list").description(`List all bank accounts configured on the account. Returns paginated results with take/skip.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
39256
|
+
resource.command("create").description(`Create a new aggregator that counts or sums billable events. Aggregators can then be linked to products via aggregator_id.`).requiredOption("--entity <value>", `The billable event entity to aggregate.`).option("--type <value>", `The type of aggregator.`).option("--where <json>", `Filter conditions for the aggregation.`).option("--name <value>", `Name of the aggregator.`).option("--description <value>", `Description of the aggregator.`).option("--allow-negative-values", `Whether the aggregator can produce negative values.`).option("--aggregate-on-customers-enabled", `Whether the aggregator should aggregate on customers.`).option("--custom-event-name <value>", `Custom event name for the aggregator.`).option("--exposed-event-keys <json>", `Event keys exposed by the aggregator.`).option("--unit-name <value>", `Display name of the unit being measured (e.g. 'user', 'request'). Used as fallback for products attached to this aggregator.`).option("--default-interval-count <number>", `Default interval count for usage periods.`).option("--default-interval-period <value>", `Default interval period for usage periods.`).option("--thresholds <json>", `Thresholds for the aggregator.`).requiredOption("--operation <value>", `The aggregation operation to perform.`).option("--property <value>", `The property to sum.`).addHelpText("after", `
|
|
39254
39257
|
Examples:
|
|
39255
|
-
hyperline
|
|
39256
|
-
hyperline
|
|
39258
|
+
hyperline aggregators create --entity <entity> --operation <operation>
|
|
39259
|
+
hyperline aggregators create --entity <entity> --operation <operation> --type <type> --where <where>
|
|
39260
|
+
hyperline aggregators create --entity <entity> --operation <operation> --output json`).action(async (opts) => {
|
|
39257
39261
|
const ctx = resource.parent?.opts()._ctx;
|
|
39258
39262
|
if (!ctx) {
|
|
39259
39263
|
process.stderr.write("Error: Not authenticated\n");
|
|
39260
39264
|
process.exit(1);
|
|
39261
39265
|
}
|
|
39262
39266
|
const args = {};
|
|
39263
|
-
if (opts.
|
|
39264
|
-
args.
|
|
39265
|
-
if (opts.
|
|
39266
|
-
args.
|
|
39267
|
+
if (opts.entity !== void 0)
|
|
39268
|
+
args.entity = opts.entity;
|
|
39269
|
+
if (opts.type !== void 0)
|
|
39270
|
+
args.type = opts.type;
|
|
39271
|
+
if (opts.name !== void 0)
|
|
39272
|
+
args.name = opts.name;
|
|
39273
|
+
if (opts.description !== void 0)
|
|
39274
|
+
args.description = opts.description;
|
|
39275
|
+
if (opts.customEventName !== void 0)
|
|
39276
|
+
args.custom_event_name = opts.customEventName;
|
|
39277
|
+
if (opts.unitName !== void 0)
|
|
39278
|
+
args.unit_name = opts.unitName;
|
|
39279
|
+
if (opts.defaultIntervalPeriod !== void 0)
|
|
39280
|
+
args.default_interval_period = opts.defaultIntervalPeriod;
|
|
39281
|
+
if (opts.operation !== void 0)
|
|
39282
|
+
args.operation = opts.operation;
|
|
39283
|
+
if (opts.property !== void 0)
|
|
39284
|
+
args.property = opts.property;
|
|
39285
|
+
if (opts.defaultIntervalCount !== void 0)
|
|
39286
|
+
args.default_interval_count = Number(opts.defaultIntervalCount);
|
|
39287
|
+
if (opts.allowNegativeValues !== void 0)
|
|
39288
|
+
args.allow_negative_values = true;
|
|
39289
|
+
if (opts.aggregateOnCustomersEnabled !== void 0)
|
|
39290
|
+
args.aggregate_on_customers_enabled = true;
|
|
39291
|
+
if (opts.where !== void 0)
|
|
39292
|
+
args.where = JSON.parse(opts.where);
|
|
39293
|
+
if (opts.exposedEventKeys !== void 0)
|
|
39294
|
+
args.exposed_event_keys = JSON.parse(opts.exposedEventKeys);
|
|
39295
|
+
if (opts.thresholds !== void 0)
|
|
39296
|
+
args.thresholds = JSON.parse(opts.thresholds);
|
|
39267
39297
|
await ctx.execute({
|
|
39268
|
-
method: "
|
|
39269
|
-
path: "/v1/
|
|
39298
|
+
method: "POST",
|
|
39299
|
+
path: "/v1/aggregators",
|
|
39270
39300
|
args,
|
|
39271
|
-
queryParamKeys: [
|
|
39301
|
+
queryParamKeys: []
|
|
39272
39302
|
});
|
|
39273
39303
|
});
|
|
39274
|
-
resource.command("get").description(`Retrieve a specific
|
|
39304
|
+
resource.command("get").description(`Retrieve a specific aggregator by ID.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
|
|
39275
39305
|
Examples:
|
|
39276
|
-
hyperline
|
|
39306
|
+
hyperline aggregators get --id <id>`).action(async (opts) => {
|
|
39277
39307
|
const ctx = resource.parent?.opts()._ctx;
|
|
39278
39308
|
if (!ctx) {
|
|
39279
39309
|
process.stderr.write("Error: Not authenticated\n");
|
|
@@ -39284,15 +39314,16 @@ Examples:
|
|
|
39284
39314
|
args.id = opts.id;
|
|
39285
39315
|
await ctx.execute({
|
|
39286
39316
|
method: "GET",
|
|
39287
|
-
path: "/v1/
|
|
39317
|
+
path: "/v1/aggregators/{id}",
|
|
39288
39318
|
args,
|
|
39289
39319
|
queryParamKeys: []
|
|
39290
39320
|
});
|
|
39291
39321
|
});
|
|
39292
|
-
resource.command("
|
|
39322
|
+
resource.command("update").description(`Update an existing aggregator's configuration.`).requiredOption("--id <value>", `id parameter`).option("--entity <value>", `The billable event entity to aggregate.`).option("--type <value>", `The type of aggregator.`).option("--where <json>", `Filter conditions for the aggregation.`).option("--name <value>", `Name of the aggregator.`).option("--description <value>", `Description of the aggregator.`).option("--allow-negative-values", `Whether the aggregator can produce negative values.`).option("--aggregate-on-customers-enabled", `Whether the aggregator should aggregate on customers.`).option("--custom-event-name <value>", `Custom event name for the aggregator.`).option("--exposed-event-keys <json>", `Event keys exposed by the aggregator.`).option("--unit-name <value>", `Display name of the unit being measured (e.g. 'user', 'request'). Used as fallback for products attached to this aggregator.`).option("--default-interval-count <number>", `Default interval count for usage periods.`).option("--default-interval-period <value>", `Default interval period for usage periods.`).option("--thresholds <json>", `Thresholds for the aggregator. Replaces existing thresholds.`).option("--operation <value>", `The aggregation operation to perform.`).option("--property <value>", `The property to sum. Required when operation is 'sum'.`).addHelpText("after", `
|
|
39293
39323
|
Examples:
|
|
39294
|
-
hyperline
|
|
39295
|
-
hyperline
|
|
39324
|
+
hyperline aggregators update --id <id>
|
|
39325
|
+
hyperline aggregators update --id <id> --entity <entity> --type <type>
|
|
39326
|
+
hyperline aggregators update --id <id> --output json`).action(async (opts) => {
|
|
39296
39327
|
const ctx = resource.parent?.opts()._ctx;
|
|
39297
39328
|
if (!ctx) {
|
|
39298
39329
|
process.stderr.write("Error: Not authenticated\n");
|
|
@@ -39301,92 +39332,240 @@ Examples:
|
|
|
39301
39332
|
const args = {};
|
|
39302
39333
|
if (opts.id !== void 0)
|
|
39303
39334
|
args.id = opts.id;
|
|
39304
|
-
if (opts.
|
|
39305
|
-
args.
|
|
39306
|
-
if (opts.
|
|
39307
|
-
args.
|
|
39308
|
-
if (opts.
|
|
39309
|
-
args.
|
|
39335
|
+
if (opts.entity !== void 0)
|
|
39336
|
+
args.entity = opts.entity;
|
|
39337
|
+
if (opts.type !== void 0)
|
|
39338
|
+
args.type = opts.type;
|
|
39339
|
+
if (opts.name !== void 0)
|
|
39340
|
+
args.name = opts.name;
|
|
39341
|
+
if (opts.description !== void 0)
|
|
39342
|
+
args.description = opts.description;
|
|
39343
|
+
if (opts.customEventName !== void 0)
|
|
39344
|
+
args.custom_event_name = opts.customEventName;
|
|
39345
|
+
if (opts.unitName !== void 0)
|
|
39346
|
+
args.unit_name = opts.unitName;
|
|
39347
|
+
if (opts.defaultIntervalPeriod !== void 0)
|
|
39348
|
+
args.default_interval_period = opts.defaultIntervalPeriod;
|
|
39349
|
+
if (opts.operation !== void 0)
|
|
39350
|
+
args.operation = opts.operation;
|
|
39351
|
+
if (opts.property !== void 0)
|
|
39352
|
+
args.property = opts.property;
|
|
39353
|
+
if (opts.defaultIntervalCount !== void 0)
|
|
39354
|
+
args.default_interval_count = Number(opts.defaultIntervalCount);
|
|
39355
|
+
if (opts.allowNegativeValues !== void 0)
|
|
39356
|
+
args.allow_negative_values = true;
|
|
39357
|
+
if (opts.aggregateOnCustomersEnabled !== void 0)
|
|
39358
|
+
args.aggregate_on_customers_enabled = true;
|
|
39359
|
+
if (opts.where !== void 0)
|
|
39360
|
+
args.where = JSON.parse(opts.where);
|
|
39361
|
+
if (opts.exposedEventKeys !== void 0)
|
|
39362
|
+
args.exposed_event_keys = JSON.parse(opts.exposedEventKeys);
|
|
39363
|
+
if (opts.thresholds !== void 0)
|
|
39364
|
+
args.thresholds = JSON.parse(opts.thresholds);
|
|
39310
39365
|
await ctx.execute({
|
|
39311
|
-
method: "
|
|
39312
|
-
path: "/v1/
|
|
39366
|
+
method: "PUT",
|
|
39367
|
+
path: "/v1/aggregators/{id}",
|
|
39313
39368
|
args,
|
|
39314
|
-
queryParamKeys: [
|
|
39369
|
+
queryParamKeys: []
|
|
39370
|
+
});
|
|
39371
|
+
});
|
|
39372
|
+
resource.command("delete").description(`Delete an aggregator by ID. Will fail if the aggregator is linked to a product.`).requiredOption("--id <value>", `id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
39373
|
+
Examples:
|
|
39374
|
+
hyperline aggregators delete --id <id>
|
|
39375
|
+
hyperline aggregators delete --id <id> --output json`).action(async (opts) => {
|
|
39376
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39377
|
+
if (!ctx) {
|
|
39378
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39379
|
+
process.exit(1);
|
|
39380
|
+
}
|
|
39381
|
+
const args = {};
|
|
39382
|
+
if (opts.id !== void 0)
|
|
39383
|
+
args.id = opts.id;
|
|
39384
|
+
if (!opts.yes) {
|
|
39385
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39386
|
+
if (!confirmed) {
|
|
39387
|
+
process.stdout.write("Aborted.\n");
|
|
39388
|
+
return;
|
|
39389
|
+
}
|
|
39390
|
+
}
|
|
39391
|
+
await ctx.execute({
|
|
39392
|
+
method: "DELETE",
|
|
39393
|
+
path: "/v1/aggregators/{id}",
|
|
39394
|
+
args,
|
|
39395
|
+
queryParamKeys: []
|
|
39315
39396
|
});
|
|
39316
39397
|
});
|
|
39317
39398
|
}
|
|
39318
39399
|
|
|
39319
|
-
// build/commands/generated/
|
|
39320
|
-
function
|
|
39321
|
-
const resource = parent.command("
|
|
39322
|
-
resource.command("
|
|
39400
|
+
// build/commands/generated/aggregators-usage.js
|
|
39401
|
+
function registerAggregators_UsageCommands(parent) {
|
|
39402
|
+
const resource = parent.command("aggregators-usage").description("Manage aggregators > usage");
|
|
39403
|
+
resource.command("get-aggregator-usage").description(`Retrieve a usage row for an aggregator. Use the timeseries, group-by-customer or events endpoints to query metering data.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
|
|
39323
39404
|
Examples:
|
|
39324
|
-
hyperline
|
|
39405
|
+
hyperline aggregators-usage get-aggregator-usage --id <id>`).action(async (opts) => {
|
|
39325
39406
|
const ctx = resource.parent?.opts()._ctx;
|
|
39326
39407
|
if (!ctx) {
|
|
39327
39408
|
process.stderr.write("Error: Not authenticated\n");
|
|
39328
39409
|
process.exit(1);
|
|
39329
39410
|
}
|
|
39330
39411
|
const args = {};
|
|
39412
|
+
if (opts.id !== void 0)
|
|
39413
|
+
args.id = opts.id;
|
|
39331
39414
|
await ctx.execute({
|
|
39332
39415
|
method: "GET",
|
|
39333
|
-
path: "/v1/
|
|
39416
|
+
path: "/v1/aggregators/{id}/usage",
|
|
39334
39417
|
args,
|
|
39335
39418
|
queryParamKeys: []
|
|
39336
39419
|
});
|
|
39337
39420
|
});
|
|
39338
|
-
resource.command("
|
|
39421
|
+
resource.command("get-aggregator-usage-timeseries").description(`Get client-wide usage for an aggregator bucketed by month/day/hour over a period.`).requiredOption("--id <value>", `id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--group-by <value>", `Bucket size for the timeseries.`).addHelpText("after", `
|
|
39339
39422
|
Examples:
|
|
39340
|
-
hyperline
|
|
39341
|
-
hyperline
|
|
39423
|
+
hyperline aggregators-usage get-aggregator-usage-timeseries --id <id>
|
|
39424
|
+
hyperline aggregators-usage get-aggregator-usage-timeseries --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
39342
39425
|
const ctx = resource.parent?.opts()._ctx;
|
|
39343
39426
|
if (!ctx) {
|
|
39344
39427
|
process.stderr.write("Error: Not authenticated\n");
|
|
39345
39428
|
process.exit(1);
|
|
39346
39429
|
}
|
|
39347
39430
|
const args = {};
|
|
39348
|
-
if (opts.
|
|
39349
|
-
args.
|
|
39350
|
-
if (opts.
|
|
39351
|
-
args.
|
|
39431
|
+
if (opts.id !== void 0)
|
|
39432
|
+
args.id = opts.id;
|
|
39433
|
+
if (opts.startDate !== void 0)
|
|
39434
|
+
args.start_date = opts.startDate;
|
|
39435
|
+
if (opts.endDate !== void 0)
|
|
39436
|
+
args.end_date = opts.endDate;
|
|
39437
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
39438
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
39439
|
+
if (opts.groupBy !== void 0)
|
|
39440
|
+
args.group_by = opts.groupBy;
|
|
39352
39441
|
await ctx.execute({
|
|
39353
|
-
method: "
|
|
39354
|
-
path: "/v1/
|
|
39442
|
+
method: "GET",
|
|
39443
|
+
path: "/v1/aggregators/{id}/usage/timeseries",
|
|
39355
39444
|
args,
|
|
39356
|
-
queryParamKeys: [
|
|
39445
|
+
queryParamKeys: [
|
|
39446
|
+
"start_date",
|
|
39447
|
+
"end_date",
|
|
39448
|
+
"aggregator_filter_id",
|
|
39449
|
+
"group_by"
|
|
39450
|
+
]
|
|
39451
|
+
});
|
|
39452
|
+
});
|
|
39453
|
+
resource.command("get-aggregator-usage-group-by-customer").description(`Per-customer total usage for an aggregator over a period, ranked by total. Paginated with take/skip.`).requiredOption("--id <value>", `id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
39454
|
+
Examples:
|
|
39455
|
+
hyperline aggregators-usage get-aggregator-usage-group-by-customer --id <id>
|
|
39456
|
+
hyperline aggregators-usage get-aggregator-usage-group-by-customer --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
39457
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39458
|
+
if (!ctx) {
|
|
39459
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39460
|
+
process.exit(1);
|
|
39461
|
+
}
|
|
39462
|
+
const args = {};
|
|
39463
|
+
if (opts.id !== void 0)
|
|
39464
|
+
args.id = opts.id;
|
|
39465
|
+
if (opts.startDate !== void 0)
|
|
39466
|
+
args.start_date = opts.startDate;
|
|
39467
|
+
if (opts.endDate !== void 0)
|
|
39468
|
+
args.end_date = opts.endDate;
|
|
39469
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
39470
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
39471
|
+
if (opts.take !== void 0)
|
|
39472
|
+
args.take = Number(opts.take);
|
|
39473
|
+
if (opts.skip !== void 0)
|
|
39474
|
+
args.skip = Number(opts.skip);
|
|
39475
|
+
await ctx.execute({
|
|
39476
|
+
method: "GET",
|
|
39477
|
+
path: "/v1/aggregators/{id}/usage/group-by-customer",
|
|
39478
|
+
args,
|
|
39479
|
+
queryParamKeys: [
|
|
39480
|
+
"start_date",
|
|
39481
|
+
"end_date",
|
|
39482
|
+
"aggregator_filter_id",
|
|
39483
|
+
"take",
|
|
39484
|
+
"skip"
|
|
39485
|
+
]
|
|
39486
|
+
});
|
|
39487
|
+
});
|
|
39488
|
+
resource.command("get-aggregator-usage-events").description(`List raw billable events for an aggregator across every customer of the client. Paginated with take/skip.`).requiredOption("--id <value>", `id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
39489
|
+
Examples:
|
|
39490
|
+
hyperline aggregators-usage get-aggregator-usage-events --id <id>
|
|
39491
|
+
hyperline aggregators-usage get-aggregator-usage-events --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
39492
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39493
|
+
if (!ctx) {
|
|
39494
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39495
|
+
process.exit(1);
|
|
39496
|
+
}
|
|
39497
|
+
const args = {};
|
|
39498
|
+
if (opts.id !== void 0)
|
|
39499
|
+
args.id = opts.id;
|
|
39500
|
+
if (opts.startDate !== void 0)
|
|
39501
|
+
args.start_date = opts.startDate;
|
|
39502
|
+
if (opts.endDate !== void 0)
|
|
39503
|
+
args.end_date = opts.endDate;
|
|
39504
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
39505
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
39506
|
+
if (opts.take !== void 0)
|
|
39507
|
+
args.take = Number(opts.take);
|
|
39508
|
+
if (opts.skip !== void 0)
|
|
39509
|
+
args.skip = Number(opts.skip);
|
|
39510
|
+
await ctx.execute({
|
|
39511
|
+
method: "GET",
|
|
39512
|
+
path: "/v1/aggregators/{id}/usage/events",
|
|
39513
|
+
args,
|
|
39514
|
+
queryParamKeys: [
|
|
39515
|
+
"start_date",
|
|
39516
|
+
"end_date",
|
|
39517
|
+
"aggregator_filter_id",
|
|
39518
|
+
"take",
|
|
39519
|
+
"skip"
|
|
39520
|
+
]
|
|
39357
39521
|
});
|
|
39358
39522
|
});
|
|
39359
39523
|
}
|
|
39360
39524
|
|
|
39361
|
-
// build/commands/generated/
|
|
39362
|
-
function
|
|
39363
|
-
const resource = parent.command("
|
|
39364
|
-
resource.command("list").description(`List
|
|
39525
|
+
// build/commands/generated/ai-billing.js
|
|
39526
|
+
function registerAi_BillingCommands(parent) {
|
|
39527
|
+
const resource = parent.command("ai-billing").description("Manage ai billing");
|
|
39528
|
+
resource.command("list-agent-plans").description(`List AI agent billing plans: workspace-level offers carrying a billing mode (wallet/credits/windows), rate card, allowance windows, markups and per-seat credit grants. Filter by mode; paginated with take/skip.`).option("--mode <value>", `Billing mode.
|
|
39529
|
+
|
|
39530
|
+
- wallet: Charges a monetary wallet.
|
|
39531
|
+
- credits: Consumes a credit balance.
|
|
39532
|
+
- windows: Meters weighted units against rolling allowances.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
39365
39533
|
Examples:
|
|
39366
|
-
hyperline
|
|
39367
|
-
hyperline
|
|
39534
|
+
hyperline ai-billing list-agent-plans
|
|
39535
|
+
hyperline ai-billing list-agent-plans --mode <mode> --take <take>`).action(async (opts) => {
|
|
39368
39536
|
const ctx = resource.parent?.opts()._ctx;
|
|
39369
39537
|
if (!ctx) {
|
|
39370
39538
|
process.stderr.write("Error: Not authenticated\n");
|
|
39371
39539
|
process.exit(1);
|
|
39372
39540
|
}
|
|
39373
39541
|
const args = {};
|
|
39542
|
+
if (opts.mode !== void 0)
|
|
39543
|
+
args.mode = opts.mode;
|
|
39374
39544
|
if (opts.take !== void 0)
|
|
39375
39545
|
args.take = Number(opts.take);
|
|
39376
39546
|
if (opts.skip !== void 0)
|
|
39377
39547
|
args.skip = Number(opts.skip);
|
|
39378
39548
|
await ctx.execute({
|
|
39379
39549
|
method: "GET",
|
|
39380
|
-
path: "/v1/
|
|
39550
|
+
path: "/v1/ai-billing/plans",
|
|
39381
39551
|
args,
|
|
39382
|
-
queryParamKeys: ["take", "skip"]
|
|
39552
|
+
queryParamKeys: ["mode", "take", "skip"]
|
|
39383
39553
|
});
|
|
39384
39554
|
});
|
|
39385
|
-
resource.command("create").description(`Create
|
|
39555
|
+
resource.command("create-agent-plan").description(`Create an AI agent billing plan: name, billing mode (wallet/credits/windows), rate card reference, allowance windows, markups, per-seat credit grants and overage stance. Past-limit usage is priced EITHER by overage_markup_percent over the base rates OR by overage_rate_card_id, a currency rate card whose own rates are the overage price \u2014 never both. Metered overage mints the plan's invoice container.`).requiredOption("--name <value>", `Human-readable resource name.`).option("--rate-card-id <value>", `Rate card reference. On policy writes, omission preserves the current reference and null detaches it; on plan replacement omission clears it.`).option("--overage-mode <value>", `Behavior when credits or an allowance are exhausted. Policy values may inherit the attached plan.
|
|
39556
|
+
|
|
39557
|
+
- refuse: Rejects the call that crosses the boundary without deducting usage.
|
|
39558
|
+
- metered: Prices the whole call as monetary overage, using the overage card or USD provider cost plus markup.`).option("--markup-percent <value>", `Percentage added to resolved cost. Null on writes means no override; an attached plan may supply the value.`).option("--overage-markup-percent <value>", `Percentage added to provider cost for overage. Mutually exclusive with overage_rate_card_id.`).option("--overage-rate-card-id <value>", `Currency rate card used to price overage directly. Null means provider cost plus the resolved overage markup.`).option("--windows <json>", `Rolling allowances. Required for windows plans; each window meters every call. A plan replacement replaces the entire array.`).option("--per-seat-credits <value>", `Credits granted per seat per billing period. Null grants no credits.`).option("--grant-rollover-enabled", `Whether granted credits survive renewal. Purchased credits always roll over.`).option("--settlement-interval-minutes <number>", `Settlement interval in minutes. Null means no interval override. Mutually exclusive with settlement_schedule.`).option("--settlement-schedule <value>", `Calendar settlement schedule. Null clears the override; mutually exclusive with settlement_interval_minutes.
|
|
39559
|
+
|
|
39560
|
+
- calendar_month: Settles at the end of each UTC calendar month.`).requiredOption("--mode <value>", `Billing mode.
|
|
39561
|
+
|
|
39562
|
+
- wallet: Charges a monetary wallet.
|
|
39563
|
+
- credits: Consumes a credit balance.
|
|
39564
|
+
- windows: Meters weighted units against rolling allowances.`).addHelpText("after", `
|
|
39386
39565
|
Examples:
|
|
39387
|
-
hyperline
|
|
39388
|
-
hyperline
|
|
39389
|
-
hyperline
|
|
39566
|
+
hyperline ai-billing create-agent-plan --name <name> --mode <mode>
|
|
39567
|
+
hyperline ai-billing create-agent-plan --name <name> --mode <mode> --rate-card-id <rate_card_id> --overage-mode <overage_mode>
|
|
39568
|
+
hyperline ai-billing create-agent-plan --name <name> --mode <mode> --output json`).action(async (opts) => {
|
|
39390
39569
|
const ctx = resource.parent?.opts()._ctx;
|
|
39391
39570
|
if (!ctx) {
|
|
39392
39571
|
process.stderr.write("Error: Not authenticated\n");
|
|
@@ -39395,105 +39574,112 @@ Examples:
|
|
|
39395
39574
|
const args = {};
|
|
39396
39575
|
if (opts.name !== void 0)
|
|
39397
39576
|
args.name = opts.name;
|
|
39398
|
-
if (opts.
|
|
39399
|
-
args.
|
|
39400
|
-
if (opts.
|
|
39401
|
-
args.
|
|
39402
|
-
if (opts.
|
|
39403
|
-
args.
|
|
39404
|
-
if (opts.
|
|
39405
|
-
args.
|
|
39406
|
-
if (opts.
|
|
39407
|
-
args.
|
|
39408
|
-
if (opts.
|
|
39409
|
-
args.
|
|
39410
|
-
if (opts.
|
|
39411
|
-
args.
|
|
39412
|
-
if (opts.
|
|
39413
|
-
args.
|
|
39414
|
-
if (opts.
|
|
39415
|
-
args.
|
|
39416
|
-
if (opts.
|
|
39417
|
-
args.
|
|
39577
|
+
if (opts.rateCardId !== void 0)
|
|
39578
|
+
args.rate_card_id = opts.rateCardId;
|
|
39579
|
+
if (opts.overageMode !== void 0)
|
|
39580
|
+
args.overage_mode = opts.overageMode;
|
|
39581
|
+
if (opts.markupPercent !== void 0)
|
|
39582
|
+
args.markup_percent = opts.markupPercent;
|
|
39583
|
+
if (opts.overageMarkupPercent !== void 0)
|
|
39584
|
+
args.overage_markup_percent = opts.overageMarkupPercent;
|
|
39585
|
+
if (opts.overageRateCardId !== void 0)
|
|
39586
|
+
args.overage_rate_card_id = opts.overageRateCardId;
|
|
39587
|
+
if (opts.perSeatCredits !== void 0)
|
|
39588
|
+
args.per_seat_credits = opts.perSeatCredits;
|
|
39589
|
+
if (opts.settlementSchedule !== void 0)
|
|
39590
|
+
args.settlement_schedule = opts.settlementSchedule;
|
|
39591
|
+
if (opts.mode !== void 0)
|
|
39592
|
+
args.mode = opts.mode;
|
|
39593
|
+
if (opts.settlementIntervalMinutes !== void 0)
|
|
39594
|
+
args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
|
|
39595
|
+
if (opts.grantRolloverEnabled !== void 0)
|
|
39596
|
+
args.grant_rollover_enabled = true;
|
|
39597
|
+
if (opts.windows !== void 0)
|
|
39598
|
+
args.windows = JSON.parse(opts.windows);
|
|
39418
39599
|
await ctx.execute({
|
|
39419
39600
|
method: "POST",
|
|
39420
|
-
path: "/v1/
|
|
39601
|
+
path: "/v1/ai-billing/plans",
|
|
39421
39602
|
args,
|
|
39422
39603
|
queryParamKeys: []
|
|
39423
39604
|
});
|
|
39424
39605
|
});
|
|
39425
|
-
resource.command("get").description(`
|
|
39606
|
+
resource.command("get-agent-plan").description(`Get one AI agent billing plan by id, with its embedded rate card, window definitions, markups, per-seat grants and minted catalog object ids.`).requiredOption("--plan-id <value>", `plan_id parameter`).addHelpText("after", `
|
|
39426
39607
|
Examples:
|
|
39427
|
-
hyperline
|
|
39608
|
+
hyperline ai-billing get-agent-plan --plan-id <plan_id>`).action(async (opts) => {
|
|
39428
39609
|
const ctx = resource.parent?.opts()._ctx;
|
|
39429
39610
|
if (!ctx) {
|
|
39430
39611
|
process.stderr.write("Error: Not authenticated\n");
|
|
39431
39612
|
process.exit(1);
|
|
39432
39613
|
}
|
|
39433
39614
|
const args = {};
|
|
39434
|
-
if (opts.
|
|
39435
|
-
args.
|
|
39615
|
+
if (opts.planId !== void 0)
|
|
39616
|
+
args.plan_id = opts.planId;
|
|
39436
39617
|
await ctx.execute({
|
|
39437
39618
|
method: "GET",
|
|
39438
|
-
path: "/v1/
|
|
39619
|
+
path: "/v1/ai-billing/plans/{plan_id}",
|
|
39439
39620
|
args,
|
|
39440
39621
|
queryParamKeys: []
|
|
39441
39622
|
});
|
|
39442
39623
|
});
|
|
39443
|
-
resource.command("
|
|
39624
|
+
resource.command("replace-agent-plan").description(`Replace an AI agent billing plan (whole-row semantics). Changes take effect on the next call for every customer on the plan; mode is immutable. Overage is priced by overage_markup_percent or by overage_rate_card_id, never both.`).requiredOption("--plan-id <value>", `plan_id parameter`).requiredOption("--name <value>", `Human-readable resource name.`).option("--rate-card-id <value>", `Rate card reference. On policy writes, omission preserves the current reference and null detaches it; on plan replacement omission clears it.`).option("--overage-mode <value>", `Behavior when credits or an allowance are exhausted. Policy values may inherit the attached plan.
|
|
39625
|
+
|
|
39626
|
+
- refuse: Rejects the call that crosses the boundary without deducting usage.
|
|
39627
|
+
- metered: Prices the whole call as monetary overage, using the overage card or USD provider cost plus markup.`).option("--markup-percent <value>", `Percentage added to resolved cost. Null on writes means no override; an attached plan may supply the value.`).option("--overage-markup-percent <value>", `Percentage added to provider cost for overage. Mutually exclusive with overage_rate_card_id.`).option("--overage-rate-card-id <value>", `Currency rate card used to price overage directly. Null means provider cost plus the resolved overage markup.`).option("--windows <json>", `Rolling allowances. Required for windows plans; each window meters every call. A plan replacement replaces the entire array.`).option("--per-seat-credits <value>", `Credits granted per seat per billing period. Null grants no credits.`).option("--grant-rollover-enabled", `Whether granted credits survive renewal. Purchased credits always roll over.`).option("--settlement-interval-minutes <number>", `Settlement interval in minutes. Null means no interval override. Mutually exclusive with settlement_schedule.`).option("--settlement-schedule <value>", `Calendar settlement schedule. Null clears the override; mutually exclusive with settlement_interval_minutes.
|
|
39628
|
+
|
|
39629
|
+
- calendar_month: Settles at the end of each UTC calendar month.`).addHelpText("after", `
|
|
39444
39630
|
Examples:
|
|
39445
|
-
hyperline
|
|
39446
|
-
hyperline
|
|
39447
|
-
hyperline
|
|
39631
|
+
hyperline ai-billing replace-agent-plan --plan-id <plan_id> --name <name>
|
|
39632
|
+
hyperline ai-billing replace-agent-plan --plan-id <plan_id> --name <name> --rate-card-id <rate_card_id> --overage-mode <overage_mode>
|
|
39633
|
+
hyperline ai-billing replace-agent-plan --plan-id <plan_id> --name <name> --output json`).action(async (opts) => {
|
|
39448
39634
|
const ctx = resource.parent?.opts()._ctx;
|
|
39449
39635
|
if (!ctx) {
|
|
39450
39636
|
process.stderr.write("Error: Not authenticated\n");
|
|
39451
39637
|
process.exit(1);
|
|
39452
39638
|
}
|
|
39453
39639
|
const args = {};
|
|
39454
|
-
if (opts.
|
|
39455
|
-
args.
|
|
39640
|
+
if (opts.planId !== void 0)
|
|
39641
|
+
args.plan_id = opts.planId;
|
|
39456
39642
|
if (opts.name !== void 0)
|
|
39457
39643
|
args.name = opts.name;
|
|
39458
|
-
if (opts.
|
|
39459
|
-
args.
|
|
39460
|
-
if (opts.
|
|
39461
|
-
args.
|
|
39462
|
-
if (opts.
|
|
39463
|
-
args.
|
|
39464
|
-
if (opts.
|
|
39465
|
-
args.
|
|
39466
|
-
if (opts.
|
|
39467
|
-
args.
|
|
39468
|
-
if (opts.
|
|
39469
|
-
args.
|
|
39470
|
-
if (opts.
|
|
39471
|
-
args.
|
|
39472
|
-
if (opts.
|
|
39473
|
-
args.
|
|
39474
|
-
if (opts.
|
|
39475
|
-
args.
|
|
39476
|
-
if (opts.
|
|
39477
|
-
args.
|
|
39644
|
+
if (opts.rateCardId !== void 0)
|
|
39645
|
+
args.rate_card_id = opts.rateCardId;
|
|
39646
|
+
if (opts.overageMode !== void 0)
|
|
39647
|
+
args.overage_mode = opts.overageMode;
|
|
39648
|
+
if (opts.markupPercent !== void 0)
|
|
39649
|
+
args.markup_percent = opts.markupPercent;
|
|
39650
|
+
if (opts.overageMarkupPercent !== void 0)
|
|
39651
|
+
args.overage_markup_percent = opts.overageMarkupPercent;
|
|
39652
|
+
if (opts.overageRateCardId !== void 0)
|
|
39653
|
+
args.overage_rate_card_id = opts.overageRateCardId;
|
|
39654
|
+
if (opts.perSeatCredits !== void 0)
|
|
39655
|
+
args.per_seat_credits = opts.perSeatCredits;
|
|
39656
|
+
if (opts.settlementSchedule !== void 0)
|
|
39657
|
+
args.settlement_schedule = opts.settlementSchedule;
|
|
39658
|
+
if (opts.settlementIntervalMinutes !== void 0)
|
|
39659
|
+
args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
|
|
39660
|
+
if (opts.grantRolloverEnabled !== void 0)
|
|
39661
|
+
args.grant_rollover_enabled = true;
|
|
39662
|
+
if (opts.windows !== void 0)
|
|
39663
|
+
args.windows = JSON.parse(opts.windows);
|
|
39478
39664
|
await ctx.execute({
|
|
39479
39665
|
method: "PUT",
|
|
39480
|
-
path: "/v1/
|
|
39666
|
+
path: "/v1/ai-billing/plans/{plan_id}",
|
|
39481
39667
|
args,
|
|
39482
39668
|
queryParamKeys: []
|
|
39483
39669
|
});
|
|
39484
39670
|
});
|
|
39485
|
-
resource.command("delete").description(`
|
|
39671
|
+
resource.command("delete-agent-plan").description(`Delete an AI agent billing plan. Refused (409, plan_in_use) while any customer is still attached to it.`).requiredOption("--plan-id <value>", `plan_id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
39486
39672
|
Examples:
|
|
39487
|
-
hyperline
|
|
39488
|
-
hyperline
|
|
39673
|
+
hyperline ai-billing delete-agent-plan --plan-id <plan_id>
|
|
39674
|
+
hyperline ai-billing delete-agent-plan --plan-id <plan_id> --output json`).action(async (opts) => {
|
|
39489
39675
|
const ctx = resource.parent?.opts()._ctx;
|
|
39490
39676
|
if (!ctx) {
|
|
39491
39677
|
process.stderr.write("Error: Not authenticated\n");
|
|
39492
39678
|
process.exit(1);
|
|
39493
39679
|
}
|
|
39494
39680
|
const args = {};
|
|
39495
|
-
if (opts.
|
|
39496
|
-
args.
|
|
39681
|
+
if (opts.planId !== void 0)
|
|
39682
|
+
args.plan_id = opts.planId;
|
|
39497
39683
|
if (!opts.yes) {
|
|
39498
39684
|
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39499
39685
|
if (!confirmed) {
|
|
@@ -39503,35 +39689,905 @@ Examples:
|
|
|
39503
39689
|
}
|
|
39504
39690
|
await ctx.execute({
|
|
39505
39691
|
method: "DELETE",
|
|
39506
|
-
path: "/v1/
|
|
39692
|
+
path: "/v1/ai-billing/plans/{plan_id}",
|
|
39507
39693
|
args,
|
|
39508
39694
|
queryParamKeys: []
|
|
39509
39695
|
});
|
|
39510
39696
|
});
|
|
39511
|
-
|
|
39512
|
-
|
|
39513
|
-
// build/commands/generated/coupons-promotion-codes.js
|
|
39514
|
-
function registerCoupons_Promotion_CodesCommands(parent) {
|
|
39515
|
-
const resource = parent.command("coupons-promotion-codes").description("Manage coupons > promotion codes");
|
|
39516
|
-
resource.command("list-promotion-codes").description(`List promotion codes with optional filter by coupon_id. Promotion codes are shareable codes that reference a coupon. Paginated with take/skip.`).option("--take <number>", `take`).option("--skip <number>", `skip`).option("--coupon-id <value>", `coupon_id`).option("--coupon-id.not <value>", `coupon_id__not`).option("--coupon-id.is-null <value>", `coupon_id__isNull`).option("--coupon-id.is-not-null <value>", `coupon_id__isNotNull`).option("--coupon-id.equals <value>", `coupon_id__equals`).option("--coupon-id.contains <value>", `coupon_id__contains`).option("--coupon-id.starts-with <value>", `coupon_id__startsWith`).option("--coupon-id.end-with <value>", `coupon_id__endWith`).addHelpText("after", `
|
|
39697
|
+
resource.command("get-agent-default-plan").description(`Get the workspace's default AI agent billing plan marker (plan id and auto_apply flag). 404 when none is set.`).addHelpText("after", `
|
|
39517
39698
|
Examples:
|
|
39518
|
-
hyperline
|
|
39519
|
-
hyperline coupons-promotion-codes list-promotion-codes --take <take> --coupon-id <coupon_id>`).action(async (opts) => {
|
|
39699
|
+
hyperline ai-billing get-agent-default-plan`).action(async (_opts) => {
|
|
39520
39700
|
const ctx = resource.parent?.opts()._ctx;
|
|
39521
39701
|
if (!ctx) {
|
|
39522
39702
|
process.stderr.write("Error: Not authenticated\n");
|
|
39523
39703
|
process.exit(1);
|
|
39524
39704
|
}
|
|
39525
39705
|
const args = {};
|
|
39526
|
-
|
|
39527
|
-
|
|
39528
|
-
|
|
39529
|
-
args
|
|
39530
|
-
|
|
39531
|
-
|
|
39532
|
-
|
|
39533
|
-
|
|
39534
|
-
|
|
39706
|
+
await ctx.execute({
|
|
39707
|
+
method: "GET",
|
|
39708
|
+
path: "/v1/ai-billing/default-plan",
|
|
39709
|
+
args,
|
|
39710
|
+
queryParamKeys: []
|
|
39711
|
+
});
|
|
39712
|
+
});
|
|
39713
|
+
resource.command("set-agent-default-plan").description(`Mark one plan as the workspace's default AI agent billing plan (body: plan_id, optional auto_apply). Replaces the previous marker; 404 when the plan is not this workspace's.`).requiredOption("--plan-id <value>", `Billing plan reference. On policy writes, omission preserves the current plan and null detaches it.`).option("--auto-apply", `Whether eligible newly ingested customers receive the default plan automatically.`).addHelpText("after", `
|
|
39714
|
+
Examples:
|
|
39715
|
+
hyperline ai-billing set-agent-default-plan --plan-id <plan_id>
|
|
39716
|
+
hyperline ai-billing set-agent-default-plan --plan-id <plan_id> --auto-apply
|
|
39717
|
+
hyperline ai-billing set-agent-default-plan --plan-id <plan_id> --output json`).action(async (opts) => {
|
|
39718
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39719
|
+
if (!ctx) {
|
|
39720
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39721
|
+
process.exit(1);
|
|
39722
|
+
}
|
|
39723
|
+
const args = {};
|
|
39724
|
+
if (opts.planId !== void 0)
|
|
39725
|
+
args.plan_id = opts.planId;
|
|
39726
|
+
if (opts.autoApply !== void 0)
|
|
39727
|
+
args.auto_apply = true;
|
|
39728
|
+
await ctx.execute({
|
|
39729
|
+
method: "PUT",
|
|
39730
|
+
path: "/v1/ai-billing/default-plan",
|
|
39731
|
+
args,
|
|
39732
|
+
queryParamKeys: []
|
|
39733
|
+
});
|
|
39734
|
+
});
|
|
39735
|
+
resource.command("clear-agent-default-plan").description(`Clear the workspace's default AI agent billing plan marker. The plan itself is untouched. 404 when none is set.`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
39736
|
+
Examples:
|
|
39737
|
+
hyperline ai-billing clear-agent-default-plan
|
|
39738
|
+
hyperline ai-billing clear-agent-default-plan --output json`).action(async (opts) => {
|
|
39739
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39740
|
+
if (!ctx) {
|
|
39741
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39742
|
+
process.exit(1);
|
|
39743
|
+
}
|
|
39744
|
+
const args = {};
|
|
39745
|
+
if (!opts.yes) {
|
|
39746
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39747
|
+
if (!confirmed) {
|
|
39748
|
+
process.stdout.write("Aborted.\n");
|
|
39749
|
+
return;
|
|
39750
|
+
}
|
|
39751
|
+
}
|
|
39752
|
+
await ctx.execute({
|
|
39753
|
+
method: "DELETE",
|
|
39754
|
+
path: "/v1/ai-billing/default-plan",
|
|
39755
|
+
args,
|
|
39756
|
+
queryParamKeys: []
|
|
39757
|
+
});
|
|
39758
|
+
});
|
|
39759
|
+
resource.command("list-agent-rate-cards").description(`List AI rate cards: named pricing row sets in credits, window units or currency. Shows what plans/policies/products depend on each. Filter by denomination, currency or name search; paginated with take/skip.`).option("--denomination <value>", `Unit in which rate-card prices are expressed.
|
|
39760
|
+
|
|
39761
|
+
- credits: Credit counts.
|
|
39762
|
+
- units: Weighted rolling-allowance units.
|
|
39763
|
+
- currency: Major units of the specified currency.`).option("--currency <value>", `Currency code. See [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes).`).option("--search <value>", `search`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
39764
|
+
Examples:
|
|
39765
|
+
hyperline ai-billing list-agent-rate-cards
|
|
39766
|
+
hyperline ai-billing list-agent-rate-cards --denomination <denomination> --currency <currency>`).action(async (opts) => {
|
|
39767
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39768
|
+
if (!ctx) {
|
|
39769
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39770
|
+
process.exit(1);
|
|
39771
|
+
}
|
|
39772
|
+
const args = {};
|
|
39773
|
+
if (opts.denomination !== void 0)
|
|
39774
|
+
args.denomination = opts.denomination;
|
|
39775
|
+
if (opts.currency !== void 0)
|
|
39776
|
+
args.currency = opts.currency;
|
|
39777
|
+
if (opts.search !== void 0)
|
|
39778
|
+
args.search = opts.search;
|
|
39779
|
+
if (opts.take !== void 0)
|
|
39780
|
+
args.take = Number(opts.take);
|
|
39781
|
+
if (opts.skip !== void 0)
|
|
39782
|
+
args.skip = Number(opts.skip);
|
|
39783
|
+
await ctx.execute({
|
|
39784
|
+
method: "GET",
|
|
39785
|
+
path: "/v1/ai-billing/rate-cards",
|
|
39786
|
+
args,
|
|
39787
|
+
queryParamKeys: ["denomination", "currency", "search", "take", "skip"]
|
|
39788
|
+
});
|
|
39789
|
+
});
|
|
39790
|
+
resource.command("create-agent-rate-card").description(`Create an AI rate card with llm rows (per-1M input/output token rates) and item rows (per-unit rates), a denomination (credits/units/currency) and an optional USD fallback conversion.`).requiredOption("--name <value>", `Human-readable resource name.`).option("--fallback-per-usd <value>", `Credits, allowance units, or major currency units per USD of provider cost. Null leaves unmatched usage unpriced.`).requiredOption("--rows <json>", `All pricing rows on the card; replacement replaces the complete list.`).requiredOption("--denomination <value>", `Unit in which rate-card prices are expressed.
|
|
39791
|
+
|
|
39792
|
+
- credits: Credit counts.
|
|
39793
|
+
- units: Weighted rolling-allowance units.
|
|
39794
|
+
- currency: Major units of the specified currency.`).option("--currency <value>", `ISO 4217 currency code for monetary values. Null for counts or historical amounts without recorded currency.`).addHelpText("after", `
|
|
39795
|
+
Examples:
|
|
39796
|
+
hyperline ai-billing create-agent-rate-card --name <name> --rows <rows> --denomination <denomination>
|
|
39797
|
+
hyperline ai-billing create-agent-rate-card --name <name> --rows <rows> --denomination <denomination> --fallback-per-usd <fallback_per_usd> --currency <currency>
|
|
39798
|
+
hyperline ai-billing create-agent-rate-card --name <name> --rows <rows> --denomination <denomination> --output json`).action(async (opts) => {
|
|
39799
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39800
|
+
if (!ctx) {
|
|
39801
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39802
|
+
process.exit(1);
|
|
39803
|
+
}
|
|
39804
|
+
const args = {};
|
|
39805
|
+
if (opts.name !== void 0)
|
|
39806
|
+
args.name = opts.name;
|
|
39807
|
+
if (opts.fallbackPerUsd !== void 0)
|
|
39808
|
+
args.fallback_per_usd = opts.fallbackPerUsd;
|
|
39809
|
+
if (opts.denomination !== void 0)
|
|
39810
|
+
args.denomination = opts.denomination;
|
|
39811
|
+
if (opts.currency !== void 0)
|
|
39812
|
+
args.currency = opts.currency;
|
|
39813
|
+
if (opts.rows !== void 0)
|
|
39814
|
+
args.rows = JSON.parse(opts.rows);
|
|
39815
|
+
await ctx.execute({
|
|
39816
|
+
method: "POST",
|
|
39817
|
+
path: "/v1/ai-billing/rate-cards",
|
|
39818
|
+
args,
|
|
39819
|
+
queryParamKeys: []
|
|
39820
|
+
});
|
|
39821
|
+
});
|
|
39822
|
+
resource.command("get-agent-rate-card").description(`Get one AI rate card by id with all its pricing rows and usage counts (plans, policies, credit product).`).requiredOption("--rate-card-id <value>", `rate_card_id parameter`).addHelpText("after", `
|
|
39823
|
+
Examples:
|
|
39824
|
+
hyperline ai-billing get-agent-rate-card --rate-card-id <rate_card_id>`).action(async (opts) => {
|
|
39825
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39826
|
+
if (!ctx) {
|
|
39827
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39828
|
+
process.exit(1);
|
|
39829
|
+
}
|
|
39830
|
+
const args = {};
|
|
39831
|
+
if (opts.rateCardId !== void 0)
|
|
39832
|
+
args.rate_card_id = opts.rateCardId;
|
|
39833
|
+
await ctx.execute({
|
|
39834
|
+
method: "GET",
|
|
39835
|
+
path: "/v1/ai-billing/rate-cards/{rate_card_id}",
|
|
39836
|
+
args,
|
|
39837
|
+
queryParamKeys: []
|
|
39838
|
+
});
|
|
39839
|
+
});
|
|
39840
|
+
resource.command("replace-agent-rate-card").description(`Replace an AI rate card's rows, name, description and USD fallback (whole-card semantics). Denomination and currency are immutable.`).requiredOption("--rate-card-id <value>", `rate_card_id parameter`).requiredOption("--name <value>", `Human-readable resource name.`).option("--fallback-per-usd <value>", `Credits, allowance units, or major currency units per USD of provider cost. Null leaves unmatched usage unpriced.`).requiredOption("--rows <json>", `All pricing rows on the card; replacement replaces the complete list.`).addHelpText("after", `
|
|
39841
|
+
Examples:
|
|
39842
|
+
hyperline ai-billing replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows>
|
|
39843
|
+
hyperline ai-billing replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows> --fallback-per-usd <fallback_per_usd>
|
|
39844
|
+
hyperline ai-billing replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows> --output json`).action(async (opts) => {
|
|
39845
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39846
|
+
if (!ctx) {
|
|
39847
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39848
|
+
process.exit(1);
|
|
39849
|
+
}
|
|
39850
|
+
const args = {};
|
|
39851
|
+
if (opts.rateCardId !== void 0)
|
|
39852
|
+
args.rate_card_id = opts.rateCardId;
|
|
39853
|
+
if (opts.name !== void 0)
|
|
39854
|
+
args.name = opts.name;
|
|
39855
|
+
if (opts.fallbackPerUsd !== void 0)
|
|
39856
|
+
args.fallback_per_usd = opts.fallbackPerUsd;
|
|
39857
|
+
if (opts.rows !== void 0)
|
|
39858
|
+
args.rows = JSON.parse(opts.rows);
|
|
39859
|
+
await ctx.execute({
|
|
39860
|
+
method: "PUT",
|
|
39861
|
+
path: "/v1/ai-billing/rate-cards/{rate_card_id}",
|
|
39862
|
+
args,
|
|
39863
|
+
queryParamKeys: []
|
|
39864
|
+
});
|
|
39865
|
+
});
|
|
39866
|
+
resource.command("delete-agent-rate-card").description(`Delete an AI rate card. Refused (409, rate_card_in_use) while any plan, credit product or customer policy still uses it.`).requiredOption("--rate-card-id <value>", `rate_card_id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
39867
|
+
Examples:
|
|
39868
|
+
hyperline ai-billing delete-agent-rate-card --rate-card-id <rate_card_id>
|
|
39869
|
+
hyperline ai-billing delete-agent-rate-card --rate-card-id <rate_card_id> --output json`).action(async (opts) => {
|
|
39870
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39871
|
+
if (!ctx) {
|
|
39872
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39873
|
+
process.exit(1);
|
|
39874
|
+
}
|
|
39875
|
+
const args = {};
|
|
39876
|
+
if (opts.rateCardId !== void 0)
|
|
39877
|
+
args.rate_card_id = opts.rateCardId;
|
|
39878
|
+
if (!opts.yes) {
|
|
39879
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39880
|
+
if (!confirmed) {
|
|
39881
|
+
process.stdout.write("Aborted.\n");
|
|
39882
|
+
return;
|
|
39883
|
+
}
|
|
39884
|
+
}
|
|
39885
|
+
await ctx.execute({
|
|
39886
|
+
method: "DELETE",
|
|
39887
|
+
path: "/v1/ai-billing/rate-cards/{rate_card_id}",
|
|
39888
|
+
args,
|
|
39889
|
+
queryParamKeys: []
|
|
39890
|
+
});
|
|
39891
|
+
});
|
|
39892
|
+
resource.command("list-agent-credit-products").description(`List the credit products AI agent usage can draw down, with their purchasable packs and default rate cards. Customer pot balances live on the customer credits endpoints.`).addHelpText("after", `
|
|
39893
|
+
Examples:
|
|
39894
|
+
hyperline ai-billing list-agent-credit-products`).action(async (_opts) => {
|
|
39895
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39896
|
+
if (!ctx) {
|
|
39897
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39898
|
+
process.exit(1);
|
|
39899
|
+
}
|
|
39900
|
+
const args = {};
|
|
39901
|
+
await ctx.execute({
|
|
39902
|
+
method: "GET",
|
|
39903
|
+
path: "/v1/ai-billing/credit-products",
|
|
39904
|
+
args,
|
|
39905
|
+
queryParamKeys: []
|
|
39906
|
+
});
|
|
39907
|
+
});
|
|
39908
|
+
resource.command("list-agent-cost-catalog").description(`List the AI cost catalog: registry model prices merged with this workspace's negotiated overrides, its own custom cost items (source custom), and the unpriced pairs its telemetry has carried (source unlisted). Rates are USD decimal strings. Pass enabled_only=true for just the enabled catalog.`).option("--enabled-only <value>", `enabled_only`).addHelpText("after", `
|
|
39909
|
+
Examples:
|
|
39910
|
+
hyperline ai-billing list-agent-cost-catalog
|
|
39911
|
+
hyperline ai-billing list-agent-cost-catalog --enabled-only <enabled_only>`).action(async (opts) => {
|
|
39912
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39913
|
+
if (!ctx) {
|
|
39914
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39915
|
+
process.exit(1);
|
|
39916
|
+
}
|
|
39917
|
+
const args = {};
|
|
39918
|
+
if (opts.enabledOnly !== void 0)
|
|
39919
|
+
args.enabled_only = opts.enabledOnly;
|
|
39920
|
+
await ctx.execute({
|
|
39921
|
+
method: "GET",
|
|
39922
|
+
path: "/v1/ai-billing/cost-catalog",
|
|
39923
|
+
args,
|
|
39924
|
+
queryParamKeys: ["enabled_only"]
|
|
39925
|
+
});
|
|
39926
|
+
});
|
|
39927
|
+
resource.command("create-agent-cost-catalog-item").description(`Create a custom AI cost item so a non-LLM vendor call is priced instead of landing unpriced at $0. provider/item must match hyperline.cost({ vendor, item }) verbatim and each dimensions[].key must match the unit the SDK sends. Re-creating an existing open item returns it unchanged (200); a pair the global registry already prices is refused \u2014 use the overrides endpoint for that.`).requiredOption("--provider <value>", `AI model provider, or the vendor of a custom cost item. This is not an integration connection.`).requiredOption("--item <value>", `Custom item name matching the usage payload.`).requiredOption("--dimensions <json>", `Additional billable dimensions; each key matches a usage_extra key and rates use the owning card's units or USD for cost-catalog dimensions.`).addHelpText("after", `
|
|
39928
|
+
Examples:
|
|
39929
|
+
hyperline ai-billing create-agent-cost-catalog-item --provider <provider> --item <item> --dimensions <dimensions>
|
|
39930
|
+
hyperline ai-billing create-agent-cost-catalog-item --provider <provider> --item <item> --dimensions <dimensions> --output json`).action(async (opts) => {
|
|
39931
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39932
|
+
if (!ctx) {
|
|
39933
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39934
|
+
process.exit(1);
|
|
39935
|
+
}
|
|
39936
|
+
const args = {};
|
|
39937
|
+
if (opts.provider !== void 0)
|
|
39938
|
+
args.provider = opts.provider;
|
|
39939
|
+
if (opts.item !== void 0)
|
|
39940
|
+
args.item = opts.item;
|
|
39941
|
+
if (opts.dimensions !== void 0)
|
|
39942
|
+
args.dimensions = JSON.parse(opts.dimensions);
|
|
39943
|
+
await ctx.execute({
|
|
39944
|
+
method: "POST",
|
|
39945
|
+
path: "/v1/ai-billing/cost-catalog/items",
|
|
39946
|
+
args,
|
|
39947
|
+
queryParamKeys: []
|
|
39948
|
+
});
|
|
39949
|
+
});
|
|
39950
|
+
resource.command("delete-agent-cost-catalog-item").description(`Close a custom AI cost item by its custom_item_id. History is kept; new calls on that pair go back to unpriced. An override id passed here is a 404.`).requiredOption("--item-id <value>", `item_id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
39951
|
+
Examples:
|
|
39952
|
+
hyperline ai-billing delete-agent-cost-catalog-item --item-id <item_id>
|
|
39953
|
+
hyperline ai-billing delete-agent-cost-catalog-item --item-id <item_id> --output json`).action(async (opts) => {
|
|
39954
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39955
|
+
if (!ctx) {
|
|
39956
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39957
|
+
process.exit(1);
|
|
39958
|
+
}
|
|
39959
|
+
const args = {};
|
|
39960
|
+
if (opts.itemId !== void 0)
|
|
39961
|
+
args.item_id = opts.itemId;
|
|
39962
|
+
if (!opts.yes) {
|
|
39963
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39964
|
+
if (!confirmed) {
|
|
39965
|
+
process.stdout.write("Aborted.\n");
|
|
39966
|
+
return;
|
|
39967
|
+
}
|
|
39968
|
+
}
|
|
39969
|
+
await ctx.execute({
|
|
39970
|
+
method: "DELETE",
|
|
39971
|
+
path: "/v1/ai-billing/cost-catalog/items/{item_id}",
|
|
39972
|
+
args,
|
|
39973
|
+
queryParamKeys: []
|
|
39974
|
+
});
|
|
39975
|
+
});
|
|
39976
|
+
resource.command("upsert-agent-cost-catalog-override").description(`Set this workspace's negotiated price for a registry AI model (input/output/cached/cache-write USD per 1M tokens, plus optional dimensions). Replaces any open override immediately; historical calls keep their original rate. A pair the registry does not know is refused \u2014 create a custom cost item instead.`).requiredOption("--provider <value>", `AI model provider, or the vendor of a custom cost item. This is not an integration connection.`).requiredOption("--model <value>", `Model identifier, or custom item identifier. Null on wildcard pricing rows.`).requiredOption("--input-per-m-tokens <value>", `Provider cost in USD per million input tokens, as an exact decimal string.`).requiredOption("--output-per-m-tokens <value>", `Provider cost in USD per million output tokens, as an exact decimal string.`).option("--cached-input-per-m-tokens <value>", `Provider cost in USD per million cached input tokens, as an exact decimal string.`).option("--cache-write-per-m-tokens <value>", `Provider cost in USD per million cache write tokens, as an exact decimal string.`).option("--dimensions <json>", `Additional billable dimensions; each key matches a usage_extra key and rates use the owning card's units or USD for cost-catalog dimensions.`).addHelpText("after", `
|
|
39977
|
+
Examples:
|
|
39978
|
+
hyperline ai-billing upsert-agent-cost-catalog-override --provider <provider> --model <model> --input-per-m-tokens <input_per_m_tokens> --output-per-m-tokens <output_per_m_tokens>
|
|
39979
|
+
hyperline ai-billing upsert-agent-cost-catalog-override --provider <provider> --model <model> --input-per-m-tokens <input_per_m_tokens> --output-per-m-tokens <output_per_m_tokens> --cached-input-per-m-tokens <cached_input_per_m_tokens> --cache-write-per-m-tokens <cache_write_per_m_tokens>
|
|
39980
|
+
hyperline ai-billing upsert-agent-cost-catalog-override --provider <provider> --model <model> --input-per-m-tokens <input_per_m_tokens> --output-per-m-tokens <output_per_m_tokens> --output json`).action(async (opts) => {
|
|
39981
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39982
|
+
if (!ctx) {
|
|
39983
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39984
|
+
process.exit(1);
|
|
39985
|
+
}
|
|
39986
|
+
const args = {};
|
|
39987
|
+
if (opts.provider !== void 0)
|
|
39988
|
+
args.provider = opts.provider;
|
|
39989
|
+
if (opts.model !== void 0)
|
|
39990
|
+
args.model = opts.model;
|
|
39991
|
+
if (opts.inputPerMTokens !== void 0)
|
|
39992
|
+
args.input_per_m_tokens = opts.inputPerMTokens;
|
|
39993
|
+
if (opts.outputPerMTokens !== void 0)
|
|
39994
|
+
args.output_per_m_tokens = opts.outputPerMTokens;
|
|
39995
|
+
if (opts.cachedInputPerMTokens !== void 0)
|
|
39996
|
+
args.cached_input_per_m_tokens = opts.cachedInputPerMTokens;
|
|
39997
|
+
if (opts.cacheWritePerMTokens !== void 0)
|
|
39998
|
+
args.cache_write_per_m_tokens = opts.cacheWritePerMTokens;
|
|
39999
|
+
if (opts.dimensions !== void 0)
|
|
40000
|
+
args.dimensions = JSON.parse(opts.dimensions);
|
|
40001
|
+
await ctx.execute({
|
|
40002
|
+
method: "PUT",
|
|
40003
|
+
path: "/v1/ai-billing/cost-catalog/overrides",
|
|
40004
|
+
args,
|
|
40005
|
+
queryParamKeys: []
|
|
40006
|
+
});
|
|
40007
|
+
});
|
|
40008
|
+
resource.command("delete-agent-cost-catalog-override").description(`Close this workspace's negotiated price override by its override.id; pricing falls back to the global registry rate. A custom cost item id passed here is a 404.`).requiredOption("--override-id <value>", `override_id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
40009
|
+
Examples:
|
|
40010
|
+
hyperline ai-billing delete-agent-cost-catalog-override --override-id <override_id>
|
|
40011
|
+
hyperline ai-billing delete-agent-cost-catalog-override --override-id <override_id> --output json`).action(async (opts) => {
|
|
40012
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40013
|
+
if (!ctx) {
|
|
40014
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40015
|
+
process.exit(1);
|
|
40016
|
+
}
|
|
40017
|
+
const args = {};
|
|
40018
|
+
if (opts.overrideId !== void 0)
|
|
40019
|
+
args.override_id = opts.overrideId;
|
|
40020
|
+
if (!opts.yes) {
|
|
40021
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
40022
|
+
if (!confirmed) {
|
|
40023
|
+
process.stdout.write("Aborted.\n");
|
|
40024
|
+
return;
|
|
40025
|
+
}
|
|
40026
|
+
}
|
|
40027
|
+
await ctx.execute({
|
|
40028
|
+
method: "DELETE",
|
|
40029
|
+
path: "/v1/ai-billing/cost-catalog/overrides/{override_id}",
|
|
40030
|
+
args,
|
|
40031
|
+
queryParamKeys: []
|
|
40032
|
+
});
|
|
40033
|
+
});
|
|
40034
|
+
resource.command("list-agent-customer-policies").description(`List all AI billing policies (scopes) for one customer: the default shared pool plus per-agent overrides. Accepts Hyperline or external customer ids.`).requiredOption("--customer-id <value>", `customer_id parameter`).addHelpText("after", `
|
|
40035
|
+
Examples:
|
|
40036
|
+
hyperline ai-billing list-agent-customer-policies --customer-id <customer_id>`).action(async (opts) => {
|
|
40037
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40038
|
+
if (!ctx) {
|
|
40039
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40040
|
+
process.exit(1);
|
|
40041
|
+
}
|
|
40042
|
+
const args = {};
|
|
40043
|
+
if (opts.customerId !== void 0)
|
|
40044
|
+
args.customer_id = opts.customerId;
|
|
40045
|
+
await ctx.execute({
|
|
40046
|
+
method: "GET",
|
|
40047
|
+
path: "/v1/ai-billing/customers/{customer_id}/policies",
|
|
40048
|
+
args,
|
|
40049
|
+
queryParamKeys: []
|
|
40050
|
+
});
|
|
40051
|
+
});
|
|
40052
|
+
resource.command("get-agent-customer-policy").description(`Get one customer's AI billing policy \u2014 the default shared pool, or one agent's own scope via the agent query param.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `Agent scope identifier. Null on scoped results denotes the customer's shared pool.`).addHelpText("after", `
|
|
40053
|
+
Examples:
|
|
40054
|
+
hyperline ai-billing get-agent-customer-policy --customer-id <customer_id>
|
|
40055
|
+
hyperline ai-billing get-agent-customer-policy --customer-id <customer_id> --agent <agent>`).action(async (opts) => {
|
|
40056
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40057
|
+
if (!ctx) {
|
|
40058
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40059
|
+
process.exit(1);
|
|
40060
|
+
}
|
|
40061
|
+
const args = {};
|
|
40062
|
+
if (opts.customerId !== void 0)
|
|
40063
|
+
args.customer_id = opts.customerId;
|
|
40064
|
+
if (opts.agent !== void 0)
|
|
40065
|
+
args.agent = opts.agent;
|
|
40066
|
+
await ctx.execute({
|
|
40067
|
+
method: "GET",
|
|
40068
|
+
path: "/v1/ai-billing/customers/{customer_id}/policy",
|
|
40069
|
+
args,
|
|
40070
|
+
queryParamKeys: ["agent"]
|
|
40071
|
+
});
|
|
40072
|
+
});
|
|
40073
|
+
resource.command("upsert-agent-customer-policy").description(`Create or replace one customer's AI billing policy (whole-row). Pass plan_id to attach the customer to a billing plan \u2014 this also attaches the plan's overage invoice container to their subscription. Past-limit usage is priced by overage_markup_percent over the base rates, or by overage_rate_card_id (a currency rate card whose rates ARE the overage price) \u2014 never both. Wallet/credit pots are auto-opened empty.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `Agent scope identifier. Null on scoped results denotes the customer's shared pool.`).requiredOption("--mode <value>", `Billing mode.
|
|
40074
|
+
|
|
40075
|
+
- wallet: Charges a monetary wallet.
|
|
40076
|
+
- credits: Consumes a credit balance.
|
|
40077
|
+
- windows: Meters weighted units against rolling allowances.`).option("--wallet-id <value>", `Customer wallet identifier. Omit on wallet policy writes to provision or reuse the customer's wallet.`).option("--credit-product-id <value>", `Public credit product identifier whose balance this policy consumes.`).option("--markup-percent <value>", `Percentage added to resolved cost. Null on writes means no override; an attached plan may supply the value.`).option("--overage-mode <value>", `Behavior when credits or an allowance are exhausted. Policy values may inherit the attached plan.
|
|
40078
|
+
|
|
40079
|
+
- refuse: Rejects the call that crosses the boundary without deducting usage.
|
|
40080
|
+
- metered: Prices the whole call as monetary overage, using the overage card or USD provider cost plus markup.`).option("--overage-markup-percent <value>", `Percentage added to provider cost for overage. Mutually exclusive with overage_rate_card_id.`).option("--overage-rate-card-id <value>", `Currency rate card used to price overage directly. Null means provider cost plus the resolved overage markup.`).option("--overage-wallet-id <value>", `Wallet charged for overage. Null bills overage in arrears.`).option("--floor <value>", `Minimum available balance a spend check requires, in the policy's denomination.`).option("--settlement-interval-minutes <number>", `Settlement interval in minutes. Null means no interval override. Mutually exclusive with settlement_schedule.`).option("--settlement-schedule <value>", `Calendar settlement schedule. Null clears the override; mutually exclusive with settlement_interval_minutes.
|
|
40081
|
+
|
|
40082
|
+
- calendar_month: Settles at the end of each UTC calendar month.`).option("--credit-rates <json>", `Inline credit pricing. Mutually exclusive with rate_card_id. Omitted rates may be supplied by a plan or product default.`).option("--window-rates <json>", `Window definitions and optional inline unit rates. An attached plan may supply omitted definitions; rate_card_id may supply unit rates.`).option("--rate-card-id <value>", `Rate card reference. On policy writes, omission preserves the current reference and null detaches it; on plan replacement omission clears it.`).option("--plan-id <value>", `Billing plan reference. On policy writes, omission preserves the current plan and null detaches it.`).requiredOption("--blocked", `Whether spending is disabled for this billing scope.`).addHelpText("after", `
|
|
40083
|
+
Examples:
|
|
40084
|
+
hyperline ai-billing upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked
|
|
40085
|
+
hyperline ai-billing upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked --agent <agent> --wallet-id <wallet_id>
|
|
40086
|
+
hyperline ai-billing upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked --output json`).action(async (opts) => {
|
|
40087
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40088
|
+
if (!ctx) {
|
|
40089
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40090
|
+
process.exit(1);
|
|
40091
|
+
}
|
|
40092
|
+
const args = {};
|
|
40093
|
+
if (opts.customerId !== void 0)
|
|
40094
|
+
args.customer_id = opts.customerId;
|
|
40095
|
+
if (opts.agent !== void 0)
|
|
40096
|
+
args.agent = opts.agent;
|
|
40097
|
+
if (opts.mode !== void 0)
|
|
40098
|
+
args.mode = opts.mode;
|
|
40099
|
+
if (opts.walletId !== void 0)
|
|
40100
|
+
args.wallet_id = opts.walletId;
|
|
40101
|
+
if (opts.creditProductId !== void 0)
|
|
40102
|
+
args.credit_product_id = opts.creditProductId;
|
|
40103
|
+
if (opts.markupPercent !== void 0)
|
|
40104
|
+
args.markup_percent = opts.markupPercent;
|
|
40105
|
+
if (opts.overageMode !== void 0)
|
|
40106
|
+
args.overage_mode = opts.overageMode;
|
|
40107
|
+
if (opts.overageMarkupPercent !== void 0)
|
|
40108
|
+
args.overage_markup_percent = opts.overageMarkupPercent;
|
|
40109
|
+
if (opts.overageRateCardId !== void 0)
|
|
40110
|
+
args.overage_rate_card_id = opts.overageRateCardId;
|
|
40111
|
+
if (opts.overageWalletId !== void 0)
|
|
40112
|
+
args.overage_wallet_id = opts.overageWalletId;
|
|
40113
|
+
if (opts.floor !== void 0)
|
|
40114
|
+
args.floor = opts.floor;
|
|
40115
|
+
if (opts.settlementSchedule !== void 0)
|
|
40116
|
+
args.settlement_schedule = opts.settlementSchedule;
|
|
40117
|
+
if (opts.rateCardId !== void 0)
|
|
40118
|
+
args.rate_card_id = opts.rateCardId;
|
|
40119
|
+
if (opts.planId !== void 0)
|
|
40120
|
+
args.plan_id = opts.planId;
|
|
40121
|
+
if (opts.settlementIntervalMinutes !== void 0)
|
|
40122
|
+
args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
|
|
40123
|
+
if (opts.blocked !== void 0)
|
|
40124
|
+
args.blocked = true;
|
|
40125
|
+
if (opts.creditRates !== void 0)
|
|
40126
|
+
args.credit_rates = JSON.parse(opts.creditRates);
|
|
40127
|
+
if (opts.windowRates !== void 0)
|
|
40128
|
+
args.window_rates = JSON.parse(opts.windowRates);
|
|
40129
|
+
await ctx.execute({
|
|
40130
|
+
method: "PUT",
|
|
40131
|
+
path: "/v1/ai-billing/customers/{customer_id}/policy",
|
|
40132
|
+
args,
|
|
40133
|
+
queryParamKeys: ["agent"]
|
|
40134
|
+
});
|
|
40135
|
+
});
|
|
40136
|
+
resource.command("delete-agent-customer-policy").description(`Delete one customer's AI billing policy scope. Refused (409) while it owes unsettled consumption or while agent overrides still depend on it.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `Agent scope identifier. Null on scoped results denotes the customer's shared pool.`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
40137
|
+
Examples:
|
|
40138
|
+
hyperline ai-billing delete-agent-customer-policy --customer-id <customer_id>
|
|
40139
|
+
hyperline ai-billing delete-agent-customer-policy --customer-id <customer_id> --agent <agent>
|
|
40140
|
+
hyperline ai-billing delete-agent-customer-policy --customer-id <customer_id> --output json`).action(async (opts) => {
|
|
40141
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40142
|
+
if (!ctx) {
|
|
40143
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40144
|
+
process.exit(1);
|
|
40145
|
+
}
|
|
40146
|
+
const args = {};
|
|
40147
|
+
if (opts.customerId !== void 0)
|
|
40148
|
+
args.customer_id = opts.customerId;
|
|
40149
|
+
if (opts.agent !== void 0)
|
|
40150
|
+
args.agent = opts.agent;
|
|
40151
|
+
if (!opts.yes) {
|
|
40152
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
40153
|
+
if (!confirmed) {
|
|
40154
|
+
process.stdout.write("Aborted.\n");
|
|
40155
|
+
return;
|
|
40156
|
+
}
|
|
40157
|
+
}
|
|
40158
|
+
await ctx.execute({
|
|
40159
|
+
method: "DELETE",
|
|
40160
|
+
path: "/v1/ai-billing/customers/{customer_id}/policy",
|
|
40161
|
+
args,
|
|
40162
|
+
queryParamKeys: ["agent"]
|
|
40163
|
+
});
|
|
40164
|
+
});
|
|
40165
|
+
resource.command("apply-agent-default-plan").description(`Apply the workspace's default AI agent billing plan to one customer (by id or external id). Idempotent; refuses (409) if the customer already has a different billing policy, 404 when no default plan is set.`).requiredOption("--customer-id <value>", `customer_id parameter`).addHelpText("after", `
|
|
40166
|
+
Examples:
|
|
40167
|
+
hyperline ai-billing apply-agent-default-plan --customer-id <customer_id>
|
|
40168
|
+
hyperline ai-billing apply-agent-default-plan --customer-id <customer_id> --output json`).action(async (opts) => {
|
|
40169
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40170
|
+
if (!ctx) {
|
|
40171
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40172
|
+
process.exit(1);
|
|
40173
|
+
}
|
|
40174
|
+
const args = {};
|
|
40175
|
+
if (opts.customerId !== void 0)
|
|
40176
|
+
args.customer_id = opts.customerId;
|
|
40177
|
+
await ctx.execute({
|
|
40178
|
+
method: "POST",
|
|
40179
|
+
path: "/v1/ai-billing/customers/{customer_id}/apply-default-plan",
|
|
40180
|
+
args,
|
|
40181
|
+
queryParamKeys: []
|
|
40182
|
+
});
|
|
40183
|
+
});
|
|
40184
|
+
resource.command("get-agent-customer-balance").description(`Get one customer's live AI balance, shaped by their billing mode: wallet shadow balance, credit pot, or rolling window meters with reset times. Includes per-agent scopes and overage state.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `Agent scope identifier. Null on scoped results denotes the customer's shared pool.`).addHelpText("after", `
|
|
40185
|
+
Examples:
|
|
40186
|
+
hyperline ai-billing get-agent-customer-balance --customer-id <customer_id>
|
|
40187
|
+
hyperline ai-billing get-agent-customer-balance --customer-id <customer_id> --agent <agent>`).action(async (opts) => {
|
|
40188
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40189
|
+
if (!ctx) {
|
|
40190
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40191
|
+
process.exit(1);
|
|
40192
|
+
}
|
|
40193
|
+
const args = {};
|
|
40194
|
+
if (opts.customerId !== void 0)
|
|
40195
|
+
args.customer_id = opts.customerId;
|
|
40196
|
+
if (opts.agent !== void 0)
|
|
40197
|
+
args.agent = opts.agent;
|
|
40198
|
+
await ctx.execute({
|
|
40199
|
+
method: "GET",
|
|
40200
|
+
path: "/v1/ai-billing/customers/{customer_id}/balance",
|
|
40201
|
+
args,
|
|
40202
|
+
queryParamKeys: ["agent"]
|
|
40203
|
+
});
|
|
40204
|
+
});
|
|
40205
|
+
resource.command("reset-agent-customer-windows").description(`Reset one customer's open AI allowance windows so their next call starts a fresh full allowance. Windows-mode scopes only.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `Agent scope identifier. Null on scoped results denotes the customer's shared pool.`).addHelpText("after", `
|
|
40206
|
+
Examples:
|
|
40207
|
+
hyperline ai-billing reset-agent-customer-windows --customer-id <customer_id>
|
|
40208
|
+
hyperline ai-billing reset-agent-customer-windows --customer-id <customer_id> --agent <agent>
|
|
40209
|
+
hyperline ai-billing reset-agent-customer-windows --customer-id <customer_id> --output json`).action(async (opts) => {
|
|
40210
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40211
|
+
if (!ctx) {
|
|
40212
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40213
|
+
process.exit(1);
|
|
40214
|
+
}
|
|
40215
|
+
const args = {};
|
|
40216
|
+
if (opts.customerId !== void 0)
|
|
40217
|
+
args.customer_id = opts.customerId;
|
|
40218
|
+
if (opts.agent !== void 0)
|
|
40219
|
+
args.agent = opts.agent;
|
|
40220
|
+
await ctx.execute({
|
|
40221
|
+
method: "POST",
|
|
40222
|
+
path: "/v1/ai-billing/customers/{customer_id}/windows/reset",
|
|
40223
|
+
args,
|
|
40224
|
+
queryParamKeys: ["agent"]
|
|
40225
|
+
});
|
|
40226
|
+
});
|
|
40227
|
+
resource.command("list-agent-customer-consumption").description(`List one customer's AI consumption ledger entries, newest first, with amounts, denominations and overage flags. Filter by agent scope, overage, and from/to time range; paginated with take/skip.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `Agent slug. An empty string selects the shared pool; omission includes all scopes.`).option("--overage <value>", `Filter by overage status. Omit to include both ordinary and overage entries.`).option("--from <value>", `UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--to <value>", `UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
40228
|
+
Examples:
|
|
40229
|
+
hyperline ai-billing list-agent-customer-consumption --customer-id <customer_id>
|
|
40230
|
+
hyperline ai-billing list-agent-customer-consumption --customer-id <customer_id> --agent <agent> --overage <overage>`).action(async (opts) => {
|
|
40231
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40232
|
+
if (!ctx) {
|
|
40233
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40234
|
+
process.exit(1);
|
|
40235
|
+
}
|
|
40236
|
+
const args = {};
|
|
40237
|
+
if (opts.customerId !== void 0)
|
|
40238
|
+
args.customer_id = opts.customerId;
|
|
40239
|
+
if (opts.agent !== void 0)
|
|
40240
|
+
args.agent = opts.agent;
|
|
40241
|
+
if (opts.overage !== void 0)
|
|
40242
|
+
args.overage = opts.overage;
|
|
40243
|
+
if (opts.from !== void 0)
|
|
40244
|
+
args.from = opts.from;
|
|
40245
|
+
if (opts.to !== void 0)
|
|
40246
|
+
args.to = opts.to;
|
|
40247
|
+
if (opts.take !== void 0)
|
|
40248
|
+
args.take = Number(opts.take);
|
|
40249
|
+
if (opts.skip !== void 0)
|
|
40250
|
+
args.skip = Number(opts.skip);
|
|
40251
|
+
await ctx.execute({
|
|
40252
|
+
method: "GET",
|
|
40253
|
+
path: "/v1/ai-billing/customers/{customer_id}/consumption",
|
|
40254
|
+
args,
|
|
40255
|
+
queryParamKeys: ["agent", "overage", "from", "to", "take", "skip"]
|
|
40256
|
+
});
|
|
40257
|
+
});
|
|
40258
|
+
resource.command("get-agent-customer-overview").description(`Get one customer's full AI billing overview: default policy, per-agent scopes, balances and billed consumption totals in one read.`).requiredOption("--customer-id <value>", `customer_id parameter`).addHelpText("after", `
|
|
40259
|
+
Examples:
|
|
40260
|
+
hyperline ai-billing get-agent-customer-overview --customer-id <customer_id>`).action(async (opts) => {
|
|
40261
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40262
|
+
if (!ctx) {
|
|
40263
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40264
|
+
process.exit(1);
|
|
40265
|
+
}
|
|
40266
|
+
const args = {};
|
|
40267
|
+
if (opts.customerId !== void 0)
|
|
40268
|
+
args.customer_id = opts.customerId;
|
|
40269
|
+
await ctx.execute({
|
|
40270
|
+
method: "GET",
|
|
40271
|
+
path: "/v1/ai-billing/customers/{customer_id}/overview",
|
|
40272
|
+
args,
|
|
40273
|
+
queryParamKeys: []
|
|
40274
|
+
});
|
|
40275
|
+
});
|
|
40276
|
+
}
|
|
40277
|
+
|
|
40278
|
+
// build/commands/generated/analytics.js
|
|
40279
|
+
function registerAnalyticsCommands(parent) {
|
|
40280
|
+
const resource = parent.command("analytics").description("Manage analytics");
|
|
40281
|
+
resource.command("get").description(`Retrieve pre-computed account analytics including ARR, MRR, revenues, churn rate, and other key billing metrics. Optionally filter by invoicing_entity_id. Use this to get a high-level financial overview.`).option("--invoicing-entity-id <value>", `Invoicing Entity ID to filter analytics`).addHelpText("after", `
|
|
40282
|
+
Examples:
|
|
40283
|
+
hyperline analytics get
|
|
40284
|
+
hyperline analytics get --invoicing-entity-id <invoicing_entity_id>`).action(async (opts) => {
|
|
40285
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40286
|
+
if (!ctx) {
|
|
40287
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40288
|
+
process.exit(1);
|
|
40289
|
+
}
|
|
40290
|
+
const args = {};
|
|
40291
|
+
if (opts.invoicingEntityId !== void 0)
|
|
40292
|
+
args.invoicing_entity_id = opts.invoicingEntityId;
|
|
40293
|
+
await ctx.execute({
|
|
40294
|
+
method: "GET",
|
|
40295
|
+
path: "/v1/analytics",
|
|
40296
|
+
args,
|
|
40297
|
+
queryParamKeys: ["invoicing_entity_id"]
|
|
40298
|
+
});
|
|
40299
|
+
});
|
|
40300
|
+
}
|
|
40301
|
+
|
|
40302
|
+
// build/commands/generated/bank-accounts.js
|
|
40303
|
+
function registerBank_AccountsCommands(parent) {
|
|
40304
|
+
const resource = parent.command("bank-accounts").description("Manage bank accounts");
|
|
40305
|
+
resource.command("list").description(`List all bank accounts configured on the account. Returns paginated results with take/skip.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
40306
|
+
Examples:
|
|
40307
|
+
hyperline bank-accounts list
|
|
40308
|
+
hyperline bank-accounts list --take <take>`).action(async (opts) => {
|
|
40309
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40310
|
+
if (!ctx) {
|
|
40311
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40312
|
+
process.exit(1);
|
|
40313
|
+
}
|
|
40314
|
+
const args = {};
|
|
40315
|
+
if (opts.take !== void 0)
|
|
40316
|
+
args.take = Number(opts.take);
|
|
40317
|
+
if (opts.skip !== void 0)
|
|
40318
|
+
args.skip = Number(opts.skip);
|
|
40319
|
+
await ctx.execute({
|
|
40320
|
+
method: "GET",
|
|
40321
|
+
path: "/v1/bank-accounts",
|
|
40322
|
+
args,
|
|
40323
|
+
queryParamKeys: ["take", "skip"]
|
|
40324
|
+
});
|
|
40325
|
+
});
|
|
40326
|
+
resource.command("get").description(`Retrieve a specific bank account by its ID. Returns masked bank account details, account type, balance, and currency.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
|
|
40327
|
+
Examples:
|
|
40328
|
+
hyperline bank-accounts get --id <id>`).action(async (opts) => {
|
|
40329
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40330
|
+
if (!ctx) {
|
|
40331
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40332
|
+
process.exit(1);
|
|
40333
|
+
}
|
|
40334
|
+
const args = {};
|
|
40335
|
+
if (opts.id !== void 0)
|
|
40336
|
+
args.id = opts.id;
|
|
40337
|
+
await ctx.execute({
|
|
40338
|
+
method: "GET",
|
|
40339
|
+
path: "/v1/bank-accounts/{id}",
|
|
40340
|
+
args,
|
|
40341
|
+
queryParamKeys: []
|
|
40342
|
+
});
|
|
40343
|
+
});
|
|
40344
|
+
resource.command("list-bank-account-transactions").description(`List open banking transactions for a specific bank account. Paginated with limit/cursor.`).requiredOption("--id <value>", `id parameter`).option("--limit <number>", `Maximum number of items to return (1-100).`).option("--cursor <value>", `Opaque cursor returned in the previous response's \`next_cursor\`. Omit to fetch the first page.`).option("--include-total <value>", `Set to \`true\` to include \`total\` in the response.`).addHelpText("after", `
|
|
40345
|
+
Examples:
|
|
40346
|
+
hyperline bank-accounts list-bank-account-transactions --id <id>
|
|
40347
|
+
hyperline bank-accounts list-bank-account-transactions --id <id> --limit <limit> --cursor <cursor>`).action(async (opts) => {
|
|
40348
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40349
|
+
if (!ctx) {
|
|
40350
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40351
|
+
process.exit(1);
|
|
40352
|
+
}
|
|
40353
|
+
const args = {};
|
|
40354
|
+
if (opts.id !== void 0)
|
|
40355
|
+
args.id = opts.id;
|
|
40356
|
+
if (opts.cursor !== void 0)
|
|
40357
|
+
args.cursor = opts.cursor;
|
|
40358
|
+
if (opts.includeTotal !== void 0)
|
|
40359
|
+
args.include_total = opts.includeTotal;
|
|
40360
|
+
if (opts.limit !== void 0)
|
|
40361
|
+
args.limit = Number(opts.limit);
|
|
40362
|
+
await ctx.execute({
|
|
40363
|
+
method: "GET",
|
|
40364
|
+
path: "/v1/bank-accounts/{id}/transactions",
|
|
40365
|
+
args,
|
|
40366
|
+
queryParamKeys: ["limit", "cursor", "include_total"]
|
|
40367
|
+
});
|
|
40368
|
+
});
|
|
40369
|
+
}
|
|
40370
|
+
|
|
40371
|
+
// build/commands/generated/companies.js
|
|
40372
|
+
function registerCompaniesCommands(parent) {
|
|
40373
|
+
const resource = parent.command("companies").description("Manage companies");
|
|
40374
|
+
resource.command("list").description(`List all companies accessible to the current authentication token. A company represents an organizational unit.`).addHelpText("after", `
|
|
40375
|
+
Examples:
|
|
40376
|
+
hyperline companies list`).action(async (_opts) => {
|
|
40377
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40378
|
+
if (!ctx) {
|
|
40379
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40380
|
+
process.exit(1);
|
|
40381
|
+
}
|
|
40382
|
+
const args = {};
|
|
40383
|
+
await ctx.execute({
|
|
40384
|
+
method: "GET",
|
|
40385
|
+
path: "/v1/companies",
|
|
40386
|
+
args,
|
|
40387
|
+
queryParamKeys: []
|
|
40388
|
+
});
|
|
40389
|
+
});
|
|
40390
|
+
resource.command("create-company").description(`Create a company with an approved account owner. Company creation must be enabled.`).requiredOption("--name <value>", `Company name.`).requiredOption("--address <json>", `Address of the default invoicing entity`).addHelpText("after", `
|
|
40391
|
+
Examples:
|
|
40392
|
+
hyperline companies create-company --name <name> --address <address>
|
|
40393
|
+
hyperline companies create-company --name <name> --address <address> --output json`).action(async (opts) => {
|
|
40394
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40395
|
+
if (!ctx) {
|
|
40396
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40397
|
+
process.exit(1);
|
|
40398
|
+
}
|
|
40399
|
+
const args = {};
|
|
40400
|
+
if (opts.name !== void 0)
|
|
40401
|
+
args.name = opts.name;
|
|
40402
|
+
if (opts.address !== void 0)
|
|
40403
|
+
args.address = JSON.parse(opts.address);
|
|
40404
|
+
await ctx.execute({
|
|
40405
|
+
method: "POST",
|
|
40406
|
+
path: "/v1/companies",
|
|
40407
|
+
args,
|
|
40408
|
+
queryParamKeys: []
|
|
40409
|
+
});
|
|
40410
|
+
});
|
|
40411
|
+
}
|
|
40412
|
+
|
|
40413
|
+
// build/commands/generated/coupons.js
|
|
40414
|
+
function registerCouponsCommands(parent) {
|
|
40415
|
+
const resource = parent.command("coupons").description("Manage coupons");
|
|
40416
|
+
resource.command("list").description(`List all coupons with pagination (take/skip). Coupons define discount rules (percentage or fixed amount) that can be applied to subscriptions or invoices.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
40417
|
+
Examples:
|
|
40418
|
+
hyperline coupons list
|
|
40419
|
+
hyperline coupons list --take <take>`).action(async (opts) => {
|
|
40420
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40421
|
+
if (!ctx) {
|
|
40422
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40423
|
+
process.exit(1);
|
|
40424
|
+
}
|
|
40425
|
+
const args = {};
|
|
40426
|
+
if (opts.take !== void 0)
|
|
40427
|
+
args.take = Number(opts.take);
|
|
40428
|
+
if (opts.skip !== void 0)
|
|
40429
|
+
args.skip = Number(opts.skip);
|
|
40430
|
+
await ctx.execute({
|
|
40431
|
+
method: "GET",
|
|
40432
|
+
path: "/v1/coupons",
|
|
40433
|
+
args,
|
|
40434
|
+
queryParamKeys: ["take", "skip"]
|
|
40435
|
+
});
|
|
40436
|
+
});
|
|
40437
|
+
resource.command("create").description(`Create a new coupon with discount rules. Supports percentage or fixed amount discounts, duration limits, and redemption restrictions.`).requiredOption("--name <value>", `Coupon name.`).option("--description <value>", `Coupon description.`).option("--expiration-date <value>", `Date corresponding to the expiration of the coupon.`).option("--redemption-limit <number>", `Maximum number of subscriptions to which a single coupon can be applied.`).option("--product-ids <json>", `List of product IDs the coupon can be applied to. If empty, the coupon can be applied to any product.`).option("--repeat <value>", `Default repeat behaviour applied when the coupon is attached to a subscription. Valid values: \`once\`, \`forever\`, \`duration\`. Can be overridden at attach time.`).option("--duration <json>", `Default duration applied when \`repeat\` is \`duration\`. Required when \`repeat\` is \`duration\`, must be null otherwise.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).requiredOption("--type <value>", `type`).option("--discount-amount <number>", `Amount to apply as a discount on the total amount (excluding taxes) of a subscription. Expressed in the currency's smallest unit.`).option("--currency <value>", `Currency code. See [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes).`).option("--discount-percent <number>", `Percentage to apply as a discount on the amount (excluding taxes) of a product.`).addHelpText("after", `
|
|
40438
|
+
Examples:
|
|
40439
|
+
hyperline coupons create --name <name> --type <type>
|
|
40440
|
+
hyperline coupons create --name <name> --type <type> --description <description> --expiration-date <expiration_date>
|
|
40441
|
+
hyperline coupons create --name <name> --type <type> --output json`).action(async (opts) => {
|
|
40442
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40443
|
+
if (!ctx) {
|
|
40444
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40445
|
+
process.exit(1);
|
|
40446
|
+
}
|
|
40447
|
+
const args = {};
|
|
40448
|
+
if (opts.name !== void 0)
|
|
40449
|
+
args.name = opts.name;
|
|
40450
|
+
if (opts.description !== void 0)
|
|
40451
|
+
args.description = opts.description;
|
|
40452
|
+
if (opts.expirationDate !== void 0)
|
|
40453
|
+
args.expiration_date = opts.expirationDate;
|
|
40454
|
+
if (opts.repeat !== void 0)
|
|
40455
|
+
args.repeat = opts.repeat;
|
|
40456
|
+
if (opts.type !== void 0)
|
|
40457
|
+
args.type = opts.type;
|
|
40458
|
+
if (opts.currency !== void 0)
|
|
40459
|
+
args.currency = opts.currency;
|
|
40460
|
+
if (opts.redemptionLimit !== void 0)
|
|
40461
|
+
args.redemption_limit = Number(opts.redemptionLimit);
|
|
40462
|
+
if (opts.discountAmount !== void 0)
|
|
40463
|
+
args.discount_amount = Number(opts.discountAmount);
|
|
40464
|
+
if (opts.discountPercent !== void 0)
|
|
40465
|
+
args.discount_percent = Number(opts.discountPercent);
|
|
40466
|
+
if (opts.productIds !== void 0)
|
|
40467
|
+
args.product_ids = JSON.parse(opts.productIds);
|
|
40468
|
+
if (opts.duration !== void 0)
|
|
40469
|
+
args.duration = JSON.parse(opts.duration);
|
|
40470
|
+
if (opts.properties !== void 0)
|
|
40471
|
+
args.properties = JSON.parse(opts.properties);
|
|
40472
|
+
await ctx.execute({
|
|
40473
|
+
method: "POST",
|
|
40474
|
+
path: "/v1/coupons",
|
|
40475
|
+
args,
|
|
40476
|
+
queryParamKeys: []
|
|
40477
|
+
});
|
|
40478
|
+
});
|
|
40479
|
+
resource.command("get").description(`Retrieve a specific coupon by ID including its discount configuration, redemption count, and deletion status.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
|
|
40480
|
+
Examples:
|
|
40481
|
+
hyperline coupons get --id <id>`).action(async (opts) => {
|
|
40482
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40483
|
+
if (!ctx) {
|
|
40484
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40485
|
+
process.exit(1);
|
|
40486
|
+
}
|
|
40487
|
+
const args = {};
|
|
40488
|
+
if (opts.id !== void 0)
|
|
40489
|
+
args.id = opts.id;
|
|
40490
|
+
await ctx.execute({
|
|
40491
|
+
method: "GET",
|
|
40492
|
+
path: "/v1/coupons/{id}",
|
|
40493
|
+
args,
|
|
40494
|
+
queryParamKeys: []
|
|
40495
|
+
});
|
|
40496
|
+
});
|
|
40497
|
+
resource.command("update").description(`Update an existing coupon's name, discount rules, or restrictions.`).requiredOption("--id <value>", `id parameter`).requiredOption("--name <value>", `Coupon name.`).option("--description <value>", `Coupon description.`).option("--expiration-date <value>", `Date corresponding to the expiration of the coupon.`).option("--redemption-limit <number>", `Maximum number of subscriptions to which a single coupon can be applied.`).option("--product-ids <json>", `List of product IDs the coupon can be applied to. If empty, the coupon can be applied to any product.`).option("--repeat <value>", `Default repeat behaviour applied when the coupon is attached to a subscription. Valid values: \`once\`, \`forever\`, \`duration\`. Can be overridden at attach time.`).option("--duration <json>", `Default duration applied when \`repeat\` is \`duration\`. Required when \`repeat\` is \`duration\`, must be null otherwise.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).requiredOption("--type <value>", `type`).option("--discount-amount <number>", `Amount to apply as a discount on the total amount (excluding taxes) of a subscription. Expressed in the currency's smallest unit.`).option("--currency <value>", `Currency code. See [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes).`).option("--discount-percent <number>", `Percentage to apply as a discount on the amount (excluding taxes) of a product.`).addHelpText("after", `
|
|
40498
|
+
Examples:
|
|
40499
|
+
hyperline coupons update --id <id> --name <name> --type <type>
|
|
40500
|
+
hyperline coupons update --id <id> --name <name> --type <type> --description <description> --expiration-date <expiration_date>
|
|
40501
|
+
hyperline coupons update --id <id> --name <name> --type <type> --output json`).action(async (opts) => {
|
|
40502
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40503
|
+
if (!ctx) {
|
|
40504
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40505
|
+
process.exit(1);
|
|
40506
|
+
}
|
|
40507
|
+
const args = {};
|
|
40508
|
+
if (opts.id !== void 0)
|
|
40509
|
+
args.id = opts.id;
|
|
40510
|
+
if (opts.name !== void 0)
|
|
40511
|
+
args.name = opts.name;
|
|
40512
|
+
if (opts.description !== void 0)
|
|
40513
|
+
args.description = opts.description;
|
|
40514
|
+
if (opts.expirationDate !== void 0)
|
|
40515
|
+
args.expiration_date = opts.expirationDate;
|
|
40516
|
+
if (opts.repeat !== void 0)
|
|
40517
|
+
args.repeat = opts.repeat;
|
|
40518
|
+
if (opts.type !== void 0)
|
|
40519
|
+
args.type = opts.type;
|
|
40520
|
+
if (opts.currency !== void 0)
|
|
40521
|
+
args.currency = opts.currency;
|
|
40522
|
+
if (opts.redemptionLimit !== void 0)
|
|
40523
|
+
args.redemption_limit = Number(opts.redemptionLimit);
|
|
40524
|
+
if (opts.discountAmount !== void 0)
|
|
40525
|
+
args.discount_amount = Number(opts.discountAmount);
|
|
40526
|
+
if (opts.discountPercent !== void 0)
|
|
40527
|
+
args.discount_percent = Number(opts.discountPercent);
|
|
40528
|
+
if (opts.productIds !== void 0)
|
|
40529
|
+
args.product_ids = JSON.parse(opts.productIds);
|
|
40530
|
+
if (opts.duration !== void 0)
|
|
40531
|
+
args.duration = JSON.parse(opts.duration);
|
|
40532
|
+
if (opts.properties !== void 0)
|
|
40533
|
+
args.properties = JSON.parse(opts.properties);
|
|
40534
|
+
await ctx.execute({
|
|
40535
|
+
method: "PUT",
|
|
40536
|
+
path: "/v1/coupons/{id}",
|
|
40537
|
+
args,
|
|
40538
|
+
queryParamKeys: []
|
|
40539
|
+
});
|
|
40540
|
+
});
|
|
40541
|
+
resource.command("delete").description(`Permanently delete a coupon by ID. This cannot be undone.`).requiredOption("--id <value>", `id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
40542
|
+
Examples:
|
|
40543
|
+
hyperline coupons delete --id <id>
|
|
40544
|
+
hyperline coupons delete --id <id> --output json`).action(async (opts) => {
|
|
40545
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40546
|
+
if (!ctx) {
|
|
40547
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40548
|
+
process.exit(1);
|
|
40549
|
+
}
|
|
40550
|
+
const args = {};
|
|
40551
|
+
if (opts.id !== void 0)
|
|
40552
|
+
args.id = opts.id;
|
|
40553
|
+
if (!opts.yes) {
|
|
40554
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
40555
|
+
if (!confirmed) {
|
|
40556
|
+
process.stdout.write("Aborted.\n");
|
|
40557
|
+
return;
|
|
40558
|
+
}
|
|
40559
|
+
}
|
|
40560
|
+
await ctx.execute({
|
|
40561
|
+
method: "DELETE",
|
|
40562
|
+
path: "/v1/coupons/{id}",
|
|
40563
|
+
args,
|
|
40564
|
+
queryParamKeys: []
|
|
40565
|
+
});
|
|
40566
|
+
});
|
|
40567
|
+
}
|
|
40568
|
+
|
|
40569
|
+
// build/commands/generated/coupons-promotion-codes.js
|
|
40570
|
+
function registerCoupons_Promotion_CodesCommands(parent) {
|
|
40571
|
+
const resource = parent.command("coupons-promotion-codes").description("Manage coupons > promotion codes");
|
|
40572
|
+
resource.command("list-promotion-codes").description(`List promotion codes with optional filter by coupon_id. Promotion codes are shareable codes that reference a coupon. Paginated with take/skip.`).option("--take <number>", `take`).option("--skip <number>", `skip`).option("--coupon-id <value>", `coupon_id`).option("--coupon-id.not <value>", `coupon_id__not`).option("--coupon-id.is-null <value>", `coupon_id__isNull`).option("--coupon-id.is-not-null <value>", `coupon_id__isNotNull`).option("--coupon-id.equals <value>", `coupon_id__equals`).option("--coupon-id.contains <value>", `coupon_id__contains`).option("--coupon-id.starts-with <value>", `coupon_id__startsWith`).option("--coupon-id.end-with <value>", `coupon_id__endWith`).addHelpText("after", `
|
|
40573
|
+
Examples:
|
|
40574
|
+
hyperline coupons-promotion-codes list-promotion-codes
|
|
40575
|
+
hyperline coupons-promotion-codes list-promotion-codes --take <take> --coupon-id <coupon_id>`).action(async (opts) => {
|
|
40576
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40577
|
+
if (!ctx) {
|
|
40578
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40579
|
+
process.exit(1);
|
|
40580
|
+
}
|
|
40581
|
+
const args = {};
|
|
40582
|
+
if (opts.couponId !== void 0)
|
|
40583
|
+
args.coupon_id = opts.couponId;
|
|
40584
|
+
if (opts["couponId.not"] !== void 0)
|
|
40585
|
+
args.coupon_id__not = opts["couponId.not"];
|
|
40586
|
+
if (opts["couponId.isNull"] !== void 0)
|
|
40587
|
+
args.coupon_id__isNull = opts["couponId.isNull"];
|
|
40588
|
+
if (opts["couponId.isNotNull"] !== void 0)
|
|
40589
|
+
args.coupon_id__isNotNull = opts["couponId.isNotNull"];
|
|
40590
|
+
if (opts["couponId.equals"] !== void 0)
|
|
39535
40591
|
args.coupon_id__equals = opts["couponId.equals"];
|
|
39536
40592
|
if (opts["couponId.contains"] !== void 0)
|
|
39537
40593
|
args.coupon_id__contains = opts["couponId.contains"];
|
|
@@ -39706,7 +40762,7 @@ Examples:
|
|
|
39706
40762
|
queryParamKeys: []
|
|
39707
40763
|
});
|
|
39708
40764
|
});
|
|
39709
|
-
resource.command("create-custom-property").description(`Create a new custom property definition with a name, type (
|
|
40765
|
+
resource.command("create-custom-property").description(`Create a new custom property definition with a name, type (text, email, 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. Email defaults must be valid email addresses. Null means no default value.`).addHelpText("after", `
|
|
39710
40766
|
Examples:
|
|
39711
40767
|
hyperline custom-properties create-custom-property --name <name> --type <type> --slug <slug> --entities <entities>
|
|
39712
40768
|
hyperline custom-properties create-custom-property --name <name> --type <type> --slug <slug> --entities <entities> --api-only --required
|
|
@@ -39731,6 +40787,8 @@ Examples:
|
|
|
39731
40787
|
args.entities = JSON.parse(opts.entities);
|
|
39732
40788
|
if (opts.authorizedValues !== void 0)
|
|
39733
40789
|
args.authorized_values = JSON.parse(opts.authorizedValues);
|
|
40790
|
+
if (opts.defaultValue !== void 0)
|
|
40791
|
+
args.default_value = JSON.parse(opts.defaultValue);
|
|
39734
40792
|
await ctx.execute({
|
|
39735
40793
|
method: "POST",
|
|
39736
40794
|
path: "/v1/custom-properties",
|
|
@@ -39738,7 +40796,7 @@ Examples:
|
|
|
39738
40796
|
queryParamKeys: []
|
|
39739
40797
|
});
|
|
39740
40798
|
});
|
|
39741
|
-
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", `
|
|
40799
|
+
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. Email defaults must be valid email addresses. Null means no default value.`).addHelpText("after", `
|
|
39742
40800
|
Examples:
|
|
39743
40801
|
hyperline custom-properties update-custom-property --id <id> --name <name> --type <type> --slug <slug> --entities <entities>
|
|
39744
40802
|
hyperline custom-properties update-custom-property --id <id> --name <name> --type <type> --slug <slug> --entities <entities> --api-only --required
|
|
@@ -39765,6 +40823,8 @@ Examples:
|
|
|
39765
40823
|
args.entities = JSON.parse(opts.entities);
|
|
39766
40824
|
if (opts.authorizedValues !== void 0)
|
|
39767
40825
|
args.authorized_values = JSON.parse(opts.authorizedValues);
|
|
40826
|
+
if (opts.defaultValue !== void 0)
|
|
40827
|
+
args.default_value = JSON.parse(opts.defaultValue);
|
|
39768
40828
|
await ctx.execute({
|
|
39769
40829
|
method: "PUT",
|
|
39770
40830
|
path: "/v1/custom-properties/{id}",
|
|
@@ -40122,7 +41182,7 @@ Customer type.
|
|
|
40122
41182
|
|
|
40123
41183
|
- \`taxable\`: Taxes are automatically determined for the customer.
|
|
40124
41184
|
- \`exempt\`: The customer is exempt from tax.
|
|
40125
|
-
`).option("--registration-number <value>", `Customer registration number.`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
41185
|
+
`).option("--registration-number <value>", `Customer registration number.`).option("--einvoicing-code <value>", `Customer electronic invoicing code, used to route their e-invoices to the relevant platform (e.g. Chorus Pro routing code or Peppol identifier).`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
40126
41186
|
How customer invoices are issued from the parent organisation.
|
|
40127
41187
|
|
|
40128
41188
|
- \`none\`: Invoices will keep being issued from this customer.
|
|
@@ -40151,6 +41211,8 @@ Examples:
|
|
|
40151
41211
|
args.taxability = opts.taxability;
|
|
40152
41212
|
if (opts.registrationNumber !== void 0)
|
|
40153
41213
|
args.registration_number = opts.registrationNumber;
|
|
41214
|
+
if (opts.einvoicingCode !== void 0)
|
|
41215
|
+
args.einvoicing_code = opts.einvoicingCode;
|
|
40154
41216
|
if (opts.externalId !== void 0)
|
|
40155
41217
|
args.external_id = opts.externalId;
|
|
40156
41218
|
if (opts.domain !== void 0)
|
|
@@ -40257,7 +41319,7 @@ Customer type.
|
|
|
40257
41319
|
|
|
40258
41320
|
- \`taxable\`: Taxes are automatically determined for the customer.
|
|
40259
41321
|
- \`exempt\`: The customer is exempt from tax.
|
|
40260
|
-
`).option("--registration-number <value>", `Customer registration number.`).option("--is-government-affiliated", `Indicates if the customer is affiliated with a government entity.`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--payment-method-id <value>", `ID of the default payment method of the customer. Only applies to card and direct debit.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
41322
|
+
`).option("--registration-number <value>", `Customer registration number.`).option("--is-government-affiliated", `Indicates if the customer is affiliated with a government entity.`).option("--einvoicing-code <value>", `Customer electronic invoicing code, used to route their e-invoices to the relevant platform (e.g. Chorus Pro routing code or Peppol identifier).`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--payment-method-id <value>", `ID of the default payment method of the customer. Only applies to card and direct debit.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
40261
41323
|
How customer invoices are issued from the parent organisation.
|
|
40262
41324
|
|
|
40263
41325
|
- \`none\`: Invoices will keep being issued from this customer.
|
|
@@ -40288,6 +41350,8 @@ Examples:
|
|
|
40288
41350
|
args.taxability = opts.taxability;
|
|
40289
41351
|
if (opts.registrationNumber !== void 0)
|
|
40290
41352
|
args.registration_number = opts.registrationNumber;
|
|
41353
|
+
if (opts.einvoicingCode !== void 0)
|
|
41354
|
+
args.einvoicing_code = opts.einvoicingCode;
|
|
40291
41355
|
if (opts.externalId !== void 0)
|
|
40292
41356
|
args.external_id = opts.externalId;
|
|
40293
41357
|
if (opts.domain !== void 0)
|
|
@@ -40497,25 +41561,152 @@ Examples:
|
|
|
40497
41561
|
]
|
|
40498
41562
|
});
|
|
40499
41563
|
});
|
|
40500
|
-
resource.command("get-customer-valuation").description(`Compute aggregated valuation metrics for a customer across all active subscriptions, grouped by currency. Returns contract value, recurring contract value, and ARR for each subscription and aggregated totals. Optionally pass granularity (year/quarter/month) for period breakdown.`).requiredOption("--id <value>", `id parameter`).option("--granularity <value>", `Period granularity for the breakdown. When provided, contract value and recurring contract value include a \`by_period\` array.`).addHelpText("after", `
|
|
41564
|
+
resource.command("get-customer-valuation").description(`Compute aggregated valuation metrics for a customer across all active subscriptions, grouped by currency. Returns contract value, recurring contract value, and ARR for each subscription and aggregated totals. Optionally pass granularity (year/quarter/month) for period breakdown.`).requiredOption("--id <value>", `id parameter`).option("--granularity <value>", `Period granularity for the breakdown. When provided, contract value and recurring contract value include a \`by_period\` array.`).addHelpText("after", `
|
|
41565
|
+
Examples:
|
|
41566
|
+
hyperline customers get-customer-valuation --id <id>
|
|
41567
|
+
hyperline customers get-customer-valuation --id <id> --granularity <granularity>`).action(async (opts) => {
|
|
41568
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41569
|
+
if (!ctx) {
|
|
41570
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41571
|
+
process.exit(1);
|
|
41572
|
+
}
|
|
41573
|
+
const args = {};
|
|
41574
|
+
if (opts.id !== void 0)
|
|
41575
|
+
args.id = opts.id;
|
|
41576
|
+
if (opts.granularity !== void 0)
|
|
41577
|
+
args.granularity = opts.granularity;
|
|
41578
|
+
await ctx.execute({
|
|
41579
|
+
method: "GET",
|
|
41580
|
+
path: "/v1/customers/{id}/valuation",
|
|
41581
|
+
args,
|
|
41582
|
+
queryParamKeys: ["granularity"]
|
|
41583
|
+
});
|
|
41584
|
+
});
|
|
41585
|
+
}
|
|
41586
|
+
|
|
41587
|
+
// build/commands/generated/customers-address.js
|
|
41588
|
+
function registerCustomers_AddressCommands(parent) {
|
|
41589
|
+
const resource = parent.command("customers-address").description("Manage customers > address");
|
|
41590
|
+
resource.command("list-customer-addresses").description(`List active addresses: at most one billing address and multiple shipping addresses per customer.`).requiredOption("--customer-id <value>", `customerId parameter`).addHelpText("after", `
|
|
41591
|
+
Examples:
|
|
41592
|
+
hyperline customers-address list-customer-addresses --customer-id <customerId>`).action(async (opts) => {
|
|
41593
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41594
|
+
if (!ctx) {
|
|
41595
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41596
|
+
process.exit(1);
|
|
41597
|
+
}
|
|
41598
|
+
const args = {};
|
|
41599
|
+
if (opts.customerId !== void 0)
|
|
41600
|
+
args.customerId = opts.customerId;
|
|
41601
|
+
await ctx.execute({
|
|
41602
|
+
method: "GET",
|
|
41603
|
+
path: "/v1/customers/{customerId}/addresses",
|
|
41604
|
+
args,
|
|
41605
|
+
queryParamKeys: []
|
|
41606
|
+
});
|
|
41607
|
+
});
|
|
41608
|
+
resource.command("create-customer-address").description(`Create a shipping address with type shipping; billing creation is rejected because a customer can have at most one billing address, managed through the customer endpoint.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--type <value>", `Only shipping addresses can be created here. A customer has at most one active billing address, managed through the customer or by updating its address ID.`).option("--name <value>", `Address name.`).option("--line1 <value>", `Address first line.`).option("--line2 <value>", `Address second line (optional).`).option("--city <value>", `Address city.`).option("--zip <value>", `Address ZIP code.`).option("--state <value>", `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).`).option("--country <value>", `Two-letter country code in ISO format. See [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).`).option("--tax-id <value>", `Tax ID override for a shipping address. Null or blank inherits the customer's tax ID; omission on update preserves the override. Billing addresses cannot have an override.`).addHelpText("after", `
|
|
41609
|
+
Examples:
|
|
41610
|
+
hyperline customers-address create-customer-address --customer-id <customerId> --type <type>
|
|
41611
|
+
hyperline customers-address create-customer-address --customer-id <customerId> --type <type> --name <name> --line1 <line1>
|
|
41612
|
+
hyperline customers-address create-customer-address --customer-id <customerId> --type <type> --output json`).action(async (opts) => {
|
|
41613
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41614
|
+
if (!ctx) {
|
|
41615
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41616
|
+
process.exit(1);
|
|
41617
|
+
}
|
|
41618
|
+
const args = {};
|
|
41619
|
+
if (opts.customerId !== void 0)
|
|
41620
|
+
args.customerId = opts.customerId;
|
|
41621
|
+
if (opts.type !== void 0)
|
|
41622
|
+
args.type = opts.type;
|
|
41623
|
+
if (opts.name !== void 0)
|
|
41624
|
+
args.name = opts.name;
|
|
41625
|
+
if (opts.line1 !== void 0)
|
|
41626
|
+
args.line1 = opts.line1;
|
|
41627
|
+
if (opts.line2 !== void 0)
|
|
41628
|
+
args.line2 = opts.line2;
|
|
41629
|
+
if (opts.city !== void 0)
|
|
41630
|
+
args.city = opts.city;
|
|
41631
|
+
if (opts.zip !== void 0)
|
|
41632
|
+
args.zip = opts.zip;
|
|
41633
|
+
if (opts.state !== void 0)
|
|
41634
|
+
args.state = opts.state;
|
|
41635
|
+
if (opts.country !== void 0)
|
|
41636
|
+
args.country = opts.country;
|
|
41637
|
+
if (opts.taxId !== void 0)
|
|
41638
|
+
args.tax_id = opts.taxId;
|
|
41639
|
+
await ctx.execute({
|
|
41640
|
+
method: "POST",
|
|
41641
|
+
path: "/v1/customers/{customerId}/addresses",
|
|
41642
|
+
args,
|
|
41643
|
+
queryParamKeys: []
|
|
41644
|
+
});
|
|
41645
|
+
});
|
|
41646
|
+
resource.command("update-customer-address").description(`Update a billing or shipping address by ID; billing changes also update the customer billing-address projection.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--address-id <value>", `addressId parameter`).option("--name <value>", `Address name.`).option("--line1 <value>", `Address first line.`).option("--line2 <value>", `Address second line (optional).`).option("--city <value>", `Address city.`).option("--zip <value>", `Address ZIP code.`).option("--state <value>", `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).`).option("--country <value>", `Two-letter country code in ISO format. See [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).`).option("--tax-id <value>", `Tax ID override for a shipping address. Null or blank inherits the customer's tax ID; omission on update preserves the override. Billing addresses cannot have an override.`).addHelpText("after", `
|
|
41647
|
+
Examples:
|
|
41648
|
+
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId>
|
|
41649
|
+
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId> --name <name> --line1 <line1>
|
|
41650
|
+
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId> --output json`).action(async (opts) => {
|
|
41651
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41652
|
+
if (!ctx) {
|
|
41653
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41654
|
+
process.exit(1);
|
|
41655
|
+
}
|
|
41656
|
+
const args = {};
|
|
41657
|
+
if (opts.customerId !== void 0)
|
|
41658
|
+
args.customerId = opts.customerId;
|
|
41659
|
+
if (opts.addressId !== void 0)
|
|
41660
|
+
args.addressId = opts.addressId;
|
|
41661
|
+
if (opts.name !== void 0)
|
|
41662
|
+
args.name = opts.name;
|
|
41663
|
+
if (opts.line1 !== void 0)
|
|
41664
|
+
args.line1 = opts.line1;
|
|
41665
|
+
if (opts.line2 !== void 0)
|
|
41666
|
+
args.line2 = opts.line2;
|
|
41667
|
+
if (opts.city !== void 0)
|
|
41668
|
+
args.city = opts.city;
|
|
41669
|
+
if (opts.zip !== void 0)
|
|
41670
|
+
args.zip = opts.zip;
|
|
41671
|
+
if (opts.state !== void 0)
|
|
41672
|
+
args.state = opts.state;
|
|
41673
|
+
if (opts.country !== void 0)
|
|
41674
|
+
args.country = opts.country;
|
|
41675
|
+
if (opts.taxId !== void 0)
|
|
41676
|
+
args.tax_id = opts.taxId;
|
|
41677
|
+
await ctx.execute({
|
|
41678
|
+
method: "PATCH",
|
|
41679
|
+
path: "/v1/customers/{customerId}/addresses/{addressId}",
|
|
41680
|
+
args,
|
|
41681
|
+
queryParamKeys: []
|
|
41682
|
+
});
|
|
41683
|
+
});
|
|
41684
|
+
resource.command("delete-customer-address").description(`Delete an address. To delete the default shipping address, first select another shipping address or use the billing address.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--address-id <value>", `addressId parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
40501
41685
|
Examples:
|
|
40502
|
-
hyperline customers
|
|
40503
|
-
hyperline customers
|
|
41686
|
+
hyperline customers-address delete-customer-address --customer-id <customerId> --address-id <addressId>
|
|
41687
|
+
hyperline customers-address delete-customer-address --customer-id <customerId> --address-id <addressId> --output json`).action(async (opts) => {
|
|
40504
41688
|
const ctx = resource.parent?.opts()._ctx;
|
|
40505
41689
|
if (!ctx) {
|
|
40506
41690
|
process.stderr.write("Error: Not authenticated\n");
|
|
40507
41691
|
process.exit(1);
|
|
40508
41692
|
}
|
|
40509
41693
|
const args = {};
|
|
40510
|
-
if (opts.
|
|
40511
|
-
args.
|
|
40512
|
-
if (opts.
|
|
40513
|
-
args.
|
|
41694
|
+
if (opts.customerId !== void 0)
|
|
41695
|
+
args.customerId = opts.customerId;
|
|
41696
|
+
if (opts.addressId !== void 0)
|
|
41697
|
+
args.addressId = opts.addressId;
|
|
41698
|
+
if (!opts.yes) {
|
|
41699
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
41700
|
+
if (!confirmed) {
|
|
41701
|
+
process.stdout.write("Aborted.\n");
|
|
41702
|
+
return;
|
|
41703
|
+
}
|
|
41704
|
+
}
|
|
40514
41705
|
await ctx.execute({
|
|
40515
|
-
method: "
|
|
40516
|
-
path: "/v1/customers/{
|
|
41706
|
+
method: "DELETE",
|
|
41707
|
+
path: "/v1/customers/{customerId}/addresses/{addressId}",
|
|
40517
41708
|
args,
|
|
40518
|
-
queryParamKeys: [
|
|
41709
|
+
queryParamKeys: []
|
|
40519
41710
|
});
|
|
40520
41711
|
});
|
|
40521
41712
|
}
|
|
@@ -40665,7 +41856,7 @@ Examples:
|
|
|
40665
41856
|
queryParamKeys: []
|
|
40666
41857
|
});
|
|
40667
41858
|
});
|
|
40668
|
-
resource.command("list-customer-credit-transactions").description(`List all transactions (
|
|
41859
|
+
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", `
|
|
40669
41860
|
Examples:
|
|
40670
41861
|
hyperline customers-credits list-customer-credit-transactions --id <id> --product-id <productId>
|
|
40671
41862
|
hyperline customers-credits list-customer-credit-transactions --id <id> --product-id <productId> --take <take> --type <type>`).action(async (opts) => {
|
|
@@ -40836,6 +42027,54 @@ Examples:
|
|
|
40836
42027
|
queryParamKeys: []
|
|
40837
42028
|
});
|
|
40838
42029
|
});
|
|
42030
|
+
resource.command("get-customer-credit-portal-settings").description(`Get whether a customer can top up a credit product from the customer portal, at which price, and which prices can be selected.`).requiredOption("--id <value>", `id parameter`).requiredOption("--product-id <value>", `productId parameter`).addHelpText("after", `
|
|
42031
|
+
Examples:
|
|
42032
|
+
hyperline customers-credits get-customer-credit-portal-settings --id <id> --product-id <productId>`).action(async (opts) => {
|
|
42033
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42034
|
+
if (!ctx) {
|
|
42035
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42036
|
+
process.exit(1);
|
|
42037
|
+
}
|
|
42038
|
+
const args = {};
|
|
42039
|
+
if (opts.id !== void 0)
|
|
42040
|
+
args.id = opts.id;
|
|
42041
|
+
if (opts.productId !== void 0)
|
|
42042
|
+
args.productId = opts.productId;
|
|
42043
|
+
await ctx.execute({
|
|
42044
|
+
method: "GET",
|
|
42045
|
+
path: "/v1/customers/{id}/credits/{productId}/portal-settings",
|
|
42046
|
+
args,
|
|
42047
|
+
queryParamKeys: []
|
|
42048
|
+
});
|
|
42049
|
+
});
|
|
42050
|
+
resource.command("update-customer-credit-portal-settings").description(`Enable or disable customer portal credit top-ups for a customer and credit product, with the price configuration (or a custom price) the customer pays.`).requiredOption("--id <value>", `id parameter`).requiredOption("--product-id <value>", `productId parameter`).requiredOption("--enabled", `Whether the customer can buy this credit product from the customer portal. Enabling requires a price: \`price_configuration_id\`, \`custom_price_configuration\`, or the price already set. Disabling clears the price and removes the customer's own price.`).option("--price-configuration-id <value>", `ID of one of the credit product's price configurations, in the customer's price book and currency, of type \`bundle\`, \`volume\` or \`bulk\`. Mutually exclusive with \`custom_price_configuration\`.`).option("--custom-price-configuration <json>", `A price of the customer's own, in the customer's currency, replacing any previous one. Same shape as a credit product price configuration. Mutually exclusive with \`price_configuration_id\`.`).addHelpText("after", `
|
|
42051
|
+
Examples:
|
|
42052
|
+
hyperline customers-credits update-customer-credit-portal-settings --id <id> --product-id <productId> --enabled
|
|
42053
|
+
hyperline customers-credits update-customer-credit-portal-settings --id <id> --product-id <productId> --enabled --price-configuration-id <price_configuration_id> --custom-price-configuration <custom_price_configuration>
|
|
42054
|
+
hyperline customers-credits update-customer-credit-portal-settings --id <id> --product-id <productId> --enabled --output json`).action(async (opts) => {
|
|
42055
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42056
|
+
if (!ctx) {
|
|
42057
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42058
|
+
process.exit(1);
|
|
42059
|
+
}
|
|
42060
|
+
const args = {};
|
|
42061
|
+
if (opts.id !== void 0)
|
|
42062
|
+
args.id = opts.id;
|
|
42063
|
+
if (opts.productId !== void 0)
|
|
42064
|
+
args.productId = opts.productId;
|
|
42065
|
+
if (opts.priceConfigurationId !== void 0)
|
|
42066
|
+
args.price_configuration_id = opts.priceConfigurationId;
|
|
42067
|
+
if (opts.enabled !== void 0)
|
|
42068
|
+
args.enabled = true;
|
|
42069
|
+
if (opts.customPriceConfiguration !== void 0)
|
|
42070
|
+
args.custom_price_configuration = JSON.parse(opts.customPriceConfiguration);
|
|
42071
|
+
await ctx.execute({
|
|
42072
|
+
method: "PUT",
|
|
42073
|
+
path: "/v1/customers/{id}/credits/{productId}/portal-settings",
|
|
42074
|
+
args,
|
|
42075
|
+
queryParamKeys: []
|
|
42076
|
+
});
|
|
42077
|
+
});
|
|
40839
42078
|
}
|
|
40840
42079
|
|
|
40841
42080
|
// build/commands/generated/customers-payment-methods.js
|
|
@@ -41011,6 +42250,177 @@ Examples:
|
|
|
41011
42250
|
});
|
|
41012
42251
|
}
|
|
41013
42252
|
|
|
42253
|
+
// build/commands/generated/customers-shipping.js
|
|
42254
|
+
function registerCustomers_ShippingCommands(parent) {
|
|
42255
|
+
const resource = parent.command("customers-shipping").description("Manage customers > shipping");
|
|
42256
|
+
resource.command("get-customer-shipping-destination").description(`Get the billing or shipping destination and its resolved address object, or null if no address exists.`).requiredOption("--customer-id <value>", `customerId parameter`).addHelpText("after", `
|
|
42257
|
+
Examples:
|
|
42258
|
+
hyperline customers-shipping get-customer-shipping-destination --customer-id <customerId>`).action(async (opts) => {
|
|
42259
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42260
|
+
if (!ctx) {
|
|
42261
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42262
|
+
process.exit(1);
|
|
42263
|
+
}
|
|
42264
|
+
const args = {};
|
|
42265
|
+
if (opts.customerId !== void 0)
|
|
42266
|
+
args.customerId = opts.customerId;
|
|
42267
|
+
await ctx.execute({
|
|
42268
|
+
method: "GET",
|
|
42269
|
+
path: "/v1/customers/{customerId}/shipping",
|
|
42270
|
+
args,
|
|
42271
|
+
queryParamKeys: []
|
|
42272
|
+
});
|
|
42273
|
+
});
|
|
42274
|
+
resource.command("set-customer-shipping-destination").description(`Select a saved shipping address or use the billing address.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--destination <value>", `Whether shipping uses the billing address or a saved shipping address.`).option("--address-id <value>", `Active shipping address ID belonging to this customer. Uses the customer's default shipping address when omitted. A shipping address must exist.`).addHelpText("after", `
|
|
42275
|
+
Examples:
|
|
42276
|
+
hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination>
|
|
42277
|
+
hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination> --address-id <address_id>
|
|
42278
|
+
hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination> --output json`).action(async (opts) => {
|
|
42279
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42280
|
+
if (!ctx) {
|
|
42281
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42282
|
+
process.exit(1);
|
|
42283
|
+
}
|
|
42284
|
+
const args = {};
|
|
42285
|
+
if (opts.customerId !== void 0)
|
|
42286
|
+
args.customerId = opts.customerId;
|
|
42287
|
+
if (opts.destination !== void 0)
|
|
42288
|
+
args.destination = opts.destination;
|
|
42289
|
+
if (opts.addressId !== void 0)
|
|
42290
|
+
args.address_id = opts.addressId;
|
|
42291
|
+
await ctx.execute({
|
|
42292
|
+
method: "PUT",
|
|
42293
|
+
path: "/v1/customers/{customerId}/shipping",
|
|
42294
|
+
args,
|
|
42295
|
+
queryParamKeys: []
|
|
42296
|
+
});
|
|
42297
|
+
});
|
|
42298
|
+
}
|
|
42299
|
+
|
|
42300
|
+
// build/commands/generated/customers-usage.js
|
|
42301
|
+
function registerCustomers_UsageCommands(parent) {
|
|
42302
|
+
const resource = parent.command("customers-usage").description("Manage customers > usage");
|
|
42303
|
+
resource.command("list-customer-usage").description(`List one usage row per aggregator for a single customer over a period (total + event count per aggregator).`).requiredOption("--id <value>", `id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).addHelpText("after", `
|
|
42304
|
+
Examples:
|
|
42305
|
+
hyperline customers-usage list-customer-usage --id <id>
|
|
42306
|
+
hyperline customers-usage list-customer-usage --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42307
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42308
|
+
if (!ctx) {
|
|
42309
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42310
|
+
process.exit(1);
|
|
42311
|
+
}
|
|
42312
|
+
const args = {};
|
|
42313
|
+
if (opts.id !== void 0)
|
|
42314
|
+
args.id = opts.id;
|
|
42315
|
+
if (opts.startDate !== void 0)
|
|
42316
|
+
args.start_date = opts.startDate;
|
|
42317
|
+
if (opts.endDate !== void 0)
|
|
42318
|
+
args.end_date = opts.endDate;
|
|
42319
|
+
await ctx.execute({
|
|
42320
|
+
method: "GET",
|
|
42321
|
+
path: "/v1/customers/{id}/usage",
|
|
42322
|
+
args,
|
|
42323
|
+
queryParamKeys: ["start_date", "end_date"]
|
|
42324
|
+
});
|
|
42325
|
+
});
|
|
42326
|
+
resource.command("get-customer-usage").description(`Get the usage of a customer for a specific aggregator over a period.`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).addHelpText("after", `
|
|
42327
|
+
Examples:
|
|
42328
|
+
hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id>
|
|
42329
|
+
hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42330
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42331
|
+
if (!ctx) {
|
|
42332
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42333
|
+
process.exit(1);
|
|
42334
|
+
}
|
|
42335
|
+
const args = {};
|
|
42336
|
+
if (opts.id !== void 0)
|
|
42337
|
+
args.id = opts.id;
|
|
42338
|
+
if (opts.aggregatorId !== void 0)
|
|
42339
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42340
|
+
if (opts.startDate !== void 0)
|
|
42341
|
+
args.start_date = opts.startDate;
|
|
42342
|
+
if (opts.endDate !== void 0)
|
|
42343
|
+
args.end_date = opts.endDate;
|
|
42344
|
+
await ctx.execute({
|
|
42345
|
+
method: "GET",
|
|
42346
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}",
|
|
42347
|
+
args,
|
|
42348
|
+
queryParamKeys: ["start_date", "end_date"]
|
|
42349
|
+
});
|
|
42350
|
+
});
|
|
42351
|
+
resource.command("get-customer-usage-timeseries").description(`Get per-bucket usage for a customer + aggregator (month/day/hour).`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--group-by <value>", `Bucket size for the timeseries.`).addHelpText("after", `
|
|
42352
|
+
Examples:
|
|
42353
|
+
hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id>
|
|
42354
|
+
hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42355
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42356
|
+
if (!ctx) {
|
|
42357
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42358
|
+
process.exit(1);
|
|
42359
|
+
}
|
|
42360
|
+
const args = {};
|
|
42361
|
+
if (opts.id !== void 0)
|
|
42362
|
+
args.id = opts.id;
|
|
42363
|
+
if (opts.aggregatorId !== void 0)
|
|
42364
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42365
|
+
if (opts.startDate !== void 0)
|
|
42366
|
+
args.start_date = opts.startDate;
|
|
42367
|
+
if (opts.endDate !== void 0)
|
|
42368
|
+
args.end_date = opts.endDate;
|
|
42369
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
42370
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
42371
|
+
if (opts.groupBy !== void 0)
|
|
42372
|
+
args.group_by = opts.groupBy;
|
|
42373
|
+
await ctx.execute({
|
|
42374
|
+
method: "GET",
|
|
42375
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}/timeseries",
|
|
42376
|
+
args,
|
|
42377
|
+
queryParamKeys: [
|
|
42378
|
+
"start_date",
|
|
42379
|
+
"end_date",
|
|
42380
|
+
"aggregator_filter_id",
|
|
42381
|
+
"group_by"
|
|
42382
|
+
]
|
|
42383
|
+
});
|
|
42384
|
+
});
|
|
42385
|
+
resource.command("get-customer-usage-events").description(`List raw billable events for a customer + aggregator over a period. Paginated with take/skip.`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
42386
|
+
Examples:
|
|
42387
|
+
hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id>
|
|
42388
|
+
hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42389
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42390
|
+
if (!ctx) {
|
|
42391
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42392
|
+
process.exit(1);
|
|
42393
|
+
}
|
|
42394
|
+
const args = {};
|
|
42395
|
+
if (opts.id !== void 0)
|
|
42396
|
+
args.id = opts.id;
|
|
42397
|
+
if (opts.aggregatorId !== void 0)
|
|
42398
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42399
|
+
if (opts.startDate !== void 0)
|
|
42400
|
+
args.start_date = opts.startDate;
|
|
42401
|
+
if (opts.endDate !== void 0)
|
|
42402
|
+
args.end_date = opts.endDate;
|
|
42403
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
42404
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
42405
|
+
if (opts.take !== void 0)
|
|
42406
|
+
args.take = Number(opts.take);
|
|
42407
|
+
if (opts.skip !== void 0)
|
|
42408
|
+
args.skip = Number(opts.skip);
|
|
42409
|
+
await ctx.execute({
|
|
42410
|
+
method: "GET",
|
|
42411
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}/events",
|
|
42412
|
+
args,
|
|
42413
|
+
queryParamKeys: [
|
|
42414
|
+
"start_date",
|
|
42415
|
+
"end_date",
|
|
42416
|
+
"aggregator_filter_id",
|
|
42417
|
+
"take",
|
|
42418
|
+
"skip"
|
|
42419
|
+
]
|
|
42420
|
+
});
|
|
42421
|
+
});
|
|
42422
|
+
}
|
|
42423
|
+
|
|
41014
42424
|
// build/commands/generated/exports.js
|
|
41015
42425
|
function registerExportsCommands(parent) {
|
|
41016
42426
|
const resource = parent.command("exports").description("Manage exports");
|
|
@@ -41620,7 +43030,7 @@ Payment method strategy used to charge the invoice. Only applies to \`to_pay\` s
|
|
|
41620
43030
|
|
|
41621
43031
|
- \`current\`: Use the current default payment method of the customer.
|
|
41622
43032
|
- \`external\`: Manage the payment of the invoice outside of Hyperline.
|
|
41623
|
-
`).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", `
|
|
43033
|
+
`).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", `
|
|
41624
43034
|
Examples:
|
|
41625
43035
|
hyperline invoices create-invoice --customer-id <customer_id> --line-items <line_items>
|
|
41626
43036
|
hyperline invoices create-invoice --customer-id <customer_id> --line-items <line_items> --currency <currency> --status <status>
|
|
@@ -41671,6 +43081,8 @@ Examples:
|
|
|
41671
43081
|
args.due_at = opts.dueAt;
|
|
41672
43082
|
if (opts.settledAt !== void 0)
|
|
41673
43083
|
args.settled_at = opts.settledAt;
|
|
43084
|
+
if (opts.issuingMethod !== void 0)
|
|
43085
|
+
args.issuing_method = opts.issuingMethod;
|
|
41674
43086
|
if (opts.properties !== void 0)
|
|
41675
43087
|
args.properties = JSON.parse(opts.properties);
|
|
41676
43088
|
if (opts.customProperties !== void 0)
|
|
@@ -41860,7 +43272,7 @@ Examples:
|
|
|
41860
43272
|
|
|
41861
43273
|
- \`auto\`: Tax is automatically computed and applied.
|
|
41862
43274
|
- \`not_eligible\`: Tax collection is disabled for the invoice.
|
|
41863
|
-
`).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", `
|
|
43275
|
+
`).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", `
|
|
41864
43276
|
Examples:
|
|
41865
43277
|
hyperline invoices update --id <id>
|
|
41866
43278
|
hyperline invoices update --id <id> --type <type> --document-name <document_name>
|
|
@@ -41889,6 +43301,10 @@ Examples:
|
|
|
41889
43301
|
args.footer = opts.footer;
|
|
41890
43302
|
if (opts.taxScheme !== void 0)
|
|
41891
43303
|
args.tax_scheme = opts.taxScheme;
|
|
43304
|
+
if (opts.issuingMethod !== void 0)
|
|
43305
|
+
args.issuing_method = opts.issuingMethod;
|
|
43306
|
+
if (opts.emittedAt !== void 0)
|
|
43307
|
+
args.emitted_at = opts.emittedAt;
|
|
41892
43308
|
if (opts.paymentMethodType !== void 0)
|
|
41893
43309
|
args.payment_method_type = opts.paymentMethodType;
|
|
41894
43310
|
if (opts.paymentMethodId !== void 0)
|
|
@@ -42582,6 +43998,44 @@ Examples:
|
|
|
42582
43998
|
queryParamKeys: []
|
|
42583
43999
|
});
|
|
42584
44000
|
});
|
|
44001
|
+
resource.command("create").description(`Create a new price configuration on an existing product. Specify the product_id, pricing type (fee, volume, bulk, packaged, bps, bundle), currency, billing interval, and price tiers. Supports metering_filter for dynamic products.`).requiredOption("--currency <value>", `Currency code. See [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes).`).option("--countries <json>", `Countries this price configuration is eligible in. Omit or send \`null\` to make it eligible in every country. An empty array restricts it to customers that have no country set.`).option("--price-book-id <value>", `ID of the price book to which this price configuration belongs to. If null, the price configuration belongs to the default price book.`).requiredOption("--billing-interval <json>", `Billing interval on which the price configuration is eligible.`).option("--commitment-interval <json>", `Commitment interval on which the price configuration is eligible.`).requiredOption("--type <value>", `type`).requiredOption("--prices <json>", `Price tiers of the price configuration. If fixed amount, only one price is available.`).requiredOption("--product-id <value>", `ID of the product to add the price configuration to.`).option("--metering-filter <json>", `Filter to scope which billable events are eligible for this price configuration.`).option("--allow-on-portal", `allow_on_portal`).addHelpText("after", `
|
|
44002
|
+
Examples:
|
|
44003
|
+
hyperline price-configurations create --currency <currency> --billing-interval <billing_interval> --type <type> --prices <prices> --product-id <product_id>
|
|
44004
|
+
hyperline price-configurations create --currency <currency> --billing-interval <billing_interval> --type <type> --prices <prices> --product-id <product_id> --countries <countries> --price-book-id <price_book_id>
|
|
44005
|
+
hyperline price-configurations create --currency <currency> --billing-interval <billing_interval> --type <type> --prices <prices> --product-id <product_id> --output json`).action(async (opts) => {
|
|
44006
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
44007
|
+
if (!ctx) {
|
|
44008
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
44009
|
+
process.exit(1);
|
|
44010
|
+
}
|
|
44011
|
+
const args = {};
|
|
44012
|
+
if (opts.currency !== void 0)
|
|
44013
|
+
args.currency = opts.currency;
|
|
44014
|
+
if (opts.priceBookId !== void 0)
|
|
44015
|
+
args.price_book_id = opts.priceBookId;
|
|
44016
|
+
if (opts.type !== void 0)
|
|
44017
|
+
args.type = opts.type;
|
|
44018
|
+
if (opts.productId !== void 0)
|
|
44019
|
+
args.product_id = opts.productId;
|
|
44020
|
+
if (opts.allowOnPortal !== void 0)
|
|
44021
|
+
args.allow_on_portal = true;
|
|
44022
|
+
if (opts.countries !== void 0)
|
|
44023
|
+
args.countries = JSON.parse(opts.countries);
|
|
44024
|
+
if (opts.billingInterval !== void 0)
|
|
44025
|
+
args.billing_interval = JSON.parse(opts.billingInterval);
|
|
44026
|
+
if (opts.commitmentInterval !== void 0)
|
|
44027
|
+
args.commitment_interval = JSON.parse(opts.commitmentInterval);
|
|
44028
|
+
if (opts.prices !== void 0)
|
|
44029
|
+
args.prices = JSON.parse(opts.prices);
|
|
44030
|
+
if (opts.meteringFilter !== void 0)
|
|
44031
|
+
args.metering_filter = JSON.parse(opts.meteringFilter);
|
|
44032
|
+
await ctx.execute({
|
|
44033
|
+
method: "POST",
|
|
44034
|
+
path: "/v1/price-configurations",
|
|
44035
|
+
args,
|
|
44036
|
+
queryParamKeys: []
|
|
44037
|
+
});
|
|
44038
|
+
});
|
|
42585
44039
|
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", `
|
|
42586
44040
|
Examples:
|
|
42587
44041
|
hyperline price-configurations update-prices --id <id>
|
|
@@ -42780,7 +44234,7 @@ How the periodic credit allowance is granted for partial billing periods.
|
|
|
42780
44234
|
|
|
42781
44235
|
- \`prorated\` (default): the granted credits are prorated to the elapsed period.
|
|
42782
44236
|
- \`full_allowance\`: the full allowance is always granted (the invoice remains prorated).
|
|
42783
|
-
`).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", `
|
|
44237
|
+
`).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", `
|
|
42784
44238
|
Examples:
|
|
42785
44239
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations>
|
|
42786
44240
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations> --description <description> --description-display-interval-dates
|
|
@@ -42805,6 +44259,8 @@ Examples:
|
|
|
42805
44259
|
args.unit_name = opts.unitName;
|
|
42806
44260
|
if (opts.creditsGrantMode !== void 0)
|
|
42807
44261
|
args.credits_grant_mode = opts.creditsGrantMode;
|
|
44262
|
+
if (opts.creditsBalanceAutoCreationEnabled !== void 0)
|
|
44263
|
+
args.credits_balance_auto_creation_enabled = opts.creditsBalanceAutoCreationEnabled;
|
|
42808
44264
|
if (opts.displayMode !== void 0)
|
|
42809
44265
|
args.display_mode = opts.displayMode;
|
|
42810
44266
|
if (opts.lowCreditsThreshold !== void 0)
|
|
@@ -42979,7 +44435,7 @@ Quote status.
|
|
|
42979
44435
|
- \`all\`: Display all pricing tiers.
|
|
42980
44436
|
- \`matching\`: Only display the tiers used to compute the price based on quantity.
|
|
42981
44437
|
- \`none\`: Hide all pricing tiers.
|
|
42982
|
-
`).option("--display-phase-value <value>", `Display per-phase value breakdown on the quote.`).option("--display-first-invoice-amount <value>", `Display the first invoice amount on the quote.`).option("--display-documents-in-preview <value>", `Display attached documents in the quote preview.`).option("--
|
|
44438
|
+
`).option("--display-phase-value <value>", `Display per-phase value breakdown on the quote.`).option("--display-first-invoice-amount <value>", `Display the first invoice amount on the quote.`).option("--display-documents-in-preview <value>", `Display attached documents in the quote preview.`).option("--subscription-update-display <value>", `Sections displayed on subscription update quotes: quote_update_details, subscription_details, or both. Takes precedence over display_subscription_on_update.`).option("--generate-draft-invoices <value>", `When \`true\`, the invoice issued after signature stays in \`draft\` status instead of being emitted for payment. Use this when you want to review the final invoice manually before sending it. Defaults to \`false\`.`).option("--template-id <value>", `ID of the quote template. If not specified, a subscription configuration or an \`invoice\` payload must be defined.`).option("--expires-at <value>", `Quote expiration date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--subscription <json>", `Subscription configuration constituting the quote.`).option("--invoice <json>", `Invoice configuration constituting the one-off quote. When provided, a draft invoice is created and linked to the quote. Cannot be combined with \`subscription\` or \`template_id\`.`).addHelpText("after", `
|
|
42983
44439
|
Examples:
|
|
42984
44440
|
hyperline quotes create --customer-id <customer_id>
|
|
42985
44441
|
hyperline quotes create --customer-id <customer_id> --status <status> --owner-email <owner_email>
|
|
@@ -43022,8 +44478,8 @@ Examples:
|
|
|
43022
44478
|
args.display_first_invoice_amount = opts.displayFirstInvoiceAmount;
|
|
43023
44479
|
if (opts.displayDocumentsInPreview !== void 0)
|
|
43024
44480
|
args.display_documents_in_preview = opts.displayDocumentsInPreview;
|
|
43025
|
-
if (opts.
|
|
43026
|
-
args.
|
|
44481
|
+
if (opts.subscriptionUpdateDisplay !== void 0)
|
|
44482
|
+
args.subscription_update_display = opts.subscriptionUpdateDisplay;
|
|
43027
44483
|
if (opts.generateDraftInvoices !== void 0)
|
|
43028
44484
|
args.generate_draft_invoices = opts.generateDraftInvoices;
|
|
43029
44485
|
if (opts.templateId !== void 0)
|
|
@@ -43271,7 +44727,7 @@ Examples:
|
|
|
43271
44727
|
- \`all\`: Display all pricing tiers.
|
|
43272
44728
|
- \`matching\`: Only display the tiers used to compute the price based on quantity.
|
|
43273
44729
|
- \`none\`: Hide all pricing tiers.
|
|
43274
|
-
`).option("--display-phase-value <value>", `Display per-phase value breakdown on the quote.`).option("--display-first-invoice-amount <value>", `Display the first invoice amount on the quote.`).option("--display-documents-in-preview <value>", `Display attached documents in the quote preview.`).option("--
|
|
44730
|
+
`).option("--display-phase-value <value>", `Display per-phase value breakdown on the quote.`).option("--display-first-invoice-amount <value>", `Display the first invoice amount on the quote.`).option("--display-documents-in-preview <value>", `Display attached documents in the quote preview.`).option("--subscription-update-display <value>", `Sections displayed on subscription update quotes: quote_update_details, subscription_details, or both. Takes precedence over display_subscription_on_update.`).option("--generate-draft-invoices <value>", `When \`true\`, the invoice issued after signature stays in \`draft\` status instead of being emitted for payment. Use this when you want to review the final invoice manually before sending it. Defaults to \`false\`.`).option("--crm-opportunity-id <value>", `ID of the related opportunity/deal in the connected CRM.`).option("--expires-at <value>", `Quote expiration date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Set to \`null\` to clear the expiration.`).option("--subscription <json>", `Subscription configuration constituting the quote. When provided on a draft quote, it creates or replaces the draft subscription attached to the quote.`).option("--invoice <json>", `Invoice configuration constituting the one-off quote. When provided on a draft one-off quote, it deletes the previous draft invoice and creates a fresh one linked to the quote. \`invoice.invoicing_entity_id\` is ignored on update \u2014 the quote's existing invoicing entity is reused.`).addHelpText("after", `
|
|
43275
44731
|
Examples:
|
|
43276
44732
|
hyperline quotes update --id <id>
|
|
43277
44733
|
hyperline quotes update --id <id> --owner-email <owner_email> --catalog-version-id <catalog_version_id>
|
|
@@ -43310,8 +44766,8 @@ Examples:
|
|
|
43310
44766
|
args.display_first_invoice_amount = opts.displayFirstInvoiceAmount;
|
|
43311
44767
|
if (opts.displayDocumentsInPreview !== void 0)
|
|
43312
44768
|
args.display_documents_in_preview = opts.displayDocumentsInPreview;
|
|
43313
|
-
if (opts.
|
|
43314
|
-
args.
|
|
44769
|
+
if (opts.subscriptionUpdateDisplay !== void 0)
|
|
44770
|
+
args.subscription_update_display = opts.subscriptionUpdateDisplay;
|
|
43315
44771
|
if (opts.generateDraftInvoices !== void 0)
|
|
43316
44772
|
args.generate_draft_invoices = opts.generateDraftInvoices;
|
|
43317
44773
|
if (opts.crmOpportunityId !== void 0)
|
|
@@ -43335,6 +44791,25 @@ Examples:
|
|
|
43335
44791
|
queryParamKeys: []
|
|
43336
44792
|
});
|
|
43337
44793
|
});
|
|
44794
|
+
resource.command("duplicate").description(`Create a draft duplicate of an existing quote, including its linked invoice or subscription configuration.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
|
|
44795
|
+
Examples:
|
|
44796
|
+
hyperline quotes duplicate --id <id>
|
|
44797
|
+
hyperline quotes duplicate --id <id> --output json`).action(async (opts) => {
|
|
44798
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
44799
|
+
if (!ctx) {
|
|
44800
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
44801
|
+
process.exit(1);
|
|
44802
|
+
}
|
|
44803
|
+
const args = {};
|
|
44804
|
+
if (opts.id !== void 0)
|
|
44805
|
+
args.id = opts.id;
|
|
44806
|
+
await ctx.execute({
|
|
44807
|
+
method: "POST",
|
|
44808
|
+
path: "/v1/quotes/{id}/duplicate",
|
|
44809
|
+
args,
|
|
44810
|
+
queryParamKeys: []
|
|
44811
|
+
});
|
|
44812
|
+
});
|
|
43338
44813
|
resource.command("download").description(`Download the PDF of a quote. Supports locale parameter for localization.`).requiredOption("--id <value>", `id parameter`).option("--locale <value>", `Locale as a supported language code and an uppercase ISO 3166-1 alpha-2 country code, separated by a hyphen.`).addHelpText("after", `
|
|
43339
44814
|
Examples:
|
|
43340
44815
|
hyperline quotes download --id <id>
|
|
@@ -43747,7 +45222,7 @@ Examples:
|
|
|
43747
45222
|
queryParamKeys: []
|
|
43748
45223
|
});
|
|
43749
45224
|
});
|
|
43750
|
-
resource.command("pause").description(`Pause a subscription. Billing stops while paused. Optionally specify a reactivate_at date for automatic resumption. If the subscription is already paused, updates (or clears) its reactivation date.`).requiredOption("--id <value>", `id parameter`).option("--reactivate-at <value>", `Date when the subscription will be automatically reactivated.
|
|
45225
|
+
resource.command("pause").description(`Pause a subscription. Billing stops while paused. Optionally specify a reactivate_at date for automatic resumption. If the subscription is already paused, updates (or clears) its reactivation date.`).requiredOption("--id <value>", `id parameter`).option("--reactivate-at <value>", `Date when the subscription will be automatically reactivated. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. A date on or before the pause date resumes it at the next scheduled run.`).addHelpText("after", `
|
|
43751
45226
|
Examples:
|
|
43752
45227
|
hyperline subscriptions pause --id <id>
|
|
43753
45228
|
hyperline subscriptions pause --id <id> --reactivate-at <reactivate_at>
|
|
@@ -43788,9 +45263,10 @@ Examples:
|
|
|
43788
45263
|
queryParamKeys: []
|
|
43789
45264
|
});
|
|
43790
45265
|
});
|
|
43791
|
-
resource.command("reactivate").description(`Resume a paused subscription,
|
|
45266
|
+
resource.command("reactivate").description(`Resume a paused subscription. Optionally pass reactivate_at (may be in the past, after the pause date; a future date schedules it) and invoicing_mode to control how the paused gap is invoiced.`).requiredOption("--id <value>", `id parameter`).option("--reactivate-at <value>", `Date the subscription resumes from. May be in the past (after the pause date). Defaults to now. A future date schedules the reactivation.`).option("--invoicing-mode <value>", `How the paused/cancelled gap is invoiced when the subscription resumes. \`charge_full_period\`: bill the frozen periods as if never paused. \`prorate_remaining_period\`: skip the gap and bill the prorated remainder from the resume date. \`resume_at_next_cycle\` (default): skip the gap with no catch-up invoice.`).addHelpText("after", `
|
|
43792
45267
|
Examples:
|
|
43793
45268
|
hyperline subscriptions reactivate --id <id>
|
|
45269
|
+
hyperline subscriptions reactivate --id <id> --reactivate-at <reactivate_at> --invoicing-mode <invoicing_mode>
|
|
43794
45270
|
hyperline subscriptions reactivate --id <id> --output json`).action(async (opts) => {
|
|
43795
45271
|
const ctx = resource.parent?.opts()._ctx;
|
|
43796
45272
|
if (!ctx) {
|
|
@@ -43800,6 +45276,10 @@ Examples:
|
|
|
43800
45276
|
const args = {};
|
|
43801
45277
|
if (opts.id !== void 0)
|
|
43802
45278
|
args.id = opts.id;
|
|
45279
|
+
if (opts.reactivateAt !== void 0)
|
|
45280
|
+
args.reactivate_at = opts.reactivateAt;
|
|
45281
|
+
if (opts.invoicingMode !== void 0)
|
|
45282
|
+
args.invoicing_mode = opts.invoicingMode;
|
|
43803
45283
|
await ctx.execute({
|
|
43804
45284
|
method: "POST",
|
|
43805
45285
|
path: "/v1/subscriptions/{id}/reactivate",
|
|
@@ -43871,7 +45351,7 @@ Strategy used to activate the subscription.
|
|
|
43871
45351
|
- \`manually\`: The subscription requires activation through a manual action.
|
|
43872
45352
|
- \`checkout\`: The subscription will be activated once the checkout is completed, but only if the start date is in the past. Otherwise, activation will occur later on the specified start date.
|
|
43873
45353
|
- \`quote\`: The subscription will be activated depending on the configuration and the signature of the related quote.
|
|
43874
|
-
`).option("--products <json>", `Products that make up the subscription.`).option("--coupons <json>", `coupons`).option("--name <value>", `Subscription custom name.`).option("--purchase-order <value>", `Reference to the purchase order.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity attached to the subscription. If not defined, fallback to customer's invoicing entity.`).option("--crm-opportunity-id <value>", `ID of the related opportunity/deal in the connected CRM.`).option("--minimum-invoice-fee <number>", `Minimum fee applied to each invoice outside of one time payments.`).option("--contract-terms <json>", `Contract terms linked to the subscription.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancellation-strategy <value>", `
|
|
45354
|
+
`).option("--products <json>", `Products that make up the subscription.`).option("--coupons <json>", `coupons`).option("--name <value>", `Subscription custom name.`).option("--purchase-order <value>", `Reference to the purchase order.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity attached to the subscription. If not defined, fallback to customer's invoicing entity.`).option("--crm-opportunity-id <value>", `ID of the related opportunity/deal in the connected CRM.`).option("--minimum-invoice-fee <number>", `Minimum fee applied to each invoice outside of one time payments.`).option("--contract-terms <json>", `Contract terms linked to the subscription.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--shipping-address-id <value>", `Active shipping address ID belonging to the subscription customer. Omit to use the customer shipping destination: billing address or default shipping address.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancellation-strategy <value>", `
|
|
43875
45355
|
Strategy used to cancel the subscription. If not specified \`do_nothing\` is used.
|
|
43876
45356
|
|
|
43877
45357
|
- \`charge_prorata\`: Will charge the customer the unpaid amount for the prorated period up to the end of the current period.
|
|
@@ -43923,6 +45403,8 @@ Examples:
|
|
|
43923
45403
|
args.starts_at = opts.startsAt;
|
|
43924
45404
|
if (opts.initialBillingAt !== void 0)
|
|
43925
45405
|
args.initial_billing_at = opts.initialBillingAt;
|
|
45406
|
+
if (opts.shippingAddressId !== void 0)
|
|
45407
|
+
args.shipping_address_id = opts.shippingAddressId;
|
|
43926
45408
|
if (opts.displayShippingDetails !== void 0)
|
|
43927
45409
|
args.display_shipping_details = opts.displayShippingDetails;
|
|
43928
45410
|
if (opts.cancelAt !== void 0)
|
|
@@ -44233,7 +45715,7 @@ Defines when invoices are generated relative to the billing period.
|
|
|
44233
45715
|
|
|
44234
45716
|
- \`period_start\`: Invoices are generated at the start of the billing period.
|
|
44235
45717
|
- \`period_end\`: Invoices are generated at the end of the billing period.
|
|
44236
|
-
`).option("--estimated-arr <number>", `Estimated Annual Recurring Revenue generated by the subscription.`).option("--contract-value <number>", `Contract value of the subscription. This value is overridable by the user.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `A list of key value with the slug of the custom property as the key and the custom property value as value.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--phases <json>", `Array of subscription phases. Existing pending phases will be replaced by the ones in the array.`).option("--contract-terms <json>", `Contract terms to update.`).addHelpText("after", `
|
|
45718
|
+
`).option("--estimated-arr <number>", `Estimated Annual Recurring Revenue generated by the subscription.`).option("--contract-value <number>", `Contract value of the subscription. This value is overridable by the user.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `A list of key value with the slug of the custom property as the key and the custom property value as value.`).option("--shipping-address-id <value>", `Active shipping address ID belonging to the subscription customer. Null uses the customer shipping destination: billing address or default shipping address.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--phases <json>", `Array of subscription phases. Existing pending phases will be replaced by the ones in the array.`).option("--contract-terms <json>", `Contract terms to update.`).addHelpText("after", `
|
|
44237
45719
|
Examples:
|
|
44238
45720
|
hyperline subscriptions update --id <id>
|
|
44239
45721
|
hyperline subscriptions update --id <id> --name <name> --purchase-order <purchase_order>
|
|
@@ -44274,6 +45756,8 @@ Examples:
|
|
|
44274
45756
|
args.initial_billing_at = opts.initialBillingAt;
|
|
44275
45757
|
if (opts.cancelAt !== void 0)
|
|
44276
45758
|
args.cancel_at = opts.cancelAt;
|
|
45759
|
+
if (opts.shippingAddressId !== void 0)
|
|
45760
|
+
args.shipping_address_id = opts.shippingAddressId;
|
|
44277
45761
|
if (opts.displayShippingDetails !== void 0)
|
|
44278
45762
|
args.display_shipping_details = opts.displayShippingDetails;
|
|
44279
45763
|
if (opts.minimumInvoiceFee !== void 0)
|
|
@@ -45380,6 +46864,9 @@ function registerAllCommands(program2) {
|
|
|
45380
46864
|
registerAccounting_Revenue_RecognitionCommands(program2);
|
|
45381
46865
|
registerAccounting_RulesCommands(program2);
|
|
45382
46866
|
registerCustom_PropertiesCommands(program2);
|
|
46867
|
+
registerAggregatorsCommands(program2);
|
|
46868
|
+
registerAggregators_UsageCommands(program2);
|
|
46869
|
+
registerAi_BillingCommands(program2);
|
|
45383
46870
|
registerAnalyticsCommands(program2);
|
|
45384
46871
|
registerBank_AccountsCommands(program2);
|
|
45385
46872
|
registerCompaniesCommands(program2);
|
|
@@ -45387,7 +46874,10 @@ function registerAllCommands(program2) {
|
|
|
45387
46874
|
registerCoupons_Promotion_CodesCommands(program2);
|
|
45388
46875
|
registerCustomers_CreditsCommands(program2);
|
|
45389
46876
|
registerCustomers_Payment_MethodsCommands(program2);
|
|
46877
|
+
registerCustomers_AddressCommands(program2);
|
|
46878
|
+
registerCustomers_ShippingCommands(program2);
|
|
45390
46879
|
registerCustomersCommands(program2);
|
|
46880
|
+
registerCustomers_UsageCommands(program2);
|
|
45391
46881
|
registerOrganisationsCommands(program2);
|
|
45392
46882
|
registerCustomers_SegmentsCommands(program2);
|
|
45393
46883
|
registerExportsCommands(program2);
|
|
@@ -61347,12 +62837,41 @@ var DateTimeSchema = external_exports.iso.datetime({
|
|
|
61347
62837
|
example: "2024-12-20T16:04:11Z"
|
|
61348
62838
|
});
|
|
61349
62839
|
|
|
62840
|
+
// ../hyperline-lib/build/http/dto/decimal.js
|
|
62841
|
+
var DecimalStringSchema = external_exports.string().regex(/^-?\d+(\.\d+)?(e[+-]?\d+)?$/i).openapi({
|
|
62842
|
+
description: "Exact decimal string. Interpret the unit using the field description and denomination.",
|
|
62843
|
+
example: "0.0021"
|
|
62844
|
+
});
|
|
62845
|
+
var NonNegativeDecimalStringSchema = external_exports.string().regex(/^\d+(\.\d+)?$/).max(40).openapi({
|
|
62846
|
+
description: "Non-negative exact decimal string, at most 40 characters.",
|
|
62847
|
+
example: "0.0021"
|
|
62848
|
+
});
|
|
62849
|
+
|
|
61350
62850
|
// ../hyperline-lib/build/http/dto/domain.js
|
|
61351
62851
|
var DomainSchema = external_exports.string().trim().toLowerCase().regex(/^(?!:\/\/)(?=.{1,253}$)(?!-)([a-z0-9-]{1,63}\.)+[a-z]{2,63}$/, "Invalid domain").openapi({
|
|
61352
62852
|
description: "Domain name.",
|
|
61353
62853
|
example: "acme.com"
|
|
61354
62854
|
});
|
|
61355
62855
|
|
|
62856
|
+
// ../hyperline-lib/build/http/dto/emailStatus.js
|
|
62857
|
+
var EmailStatusSchema = external_exports.enum([
|
|
62858
|
+
"sent",
|
|
62859
|
+
"delivered",
|
|
62860
|
+
"opened",
|
|
62861
|
+
"clicked",
|
|
62862
|
+
"spammed",
|
|
62863
|
+
"bounced",
|
|
62864
|
+
"queued",
|
|
62865
|
+
"drafted",
|
|
62866
|
+
"attempted",
|
|
62867
|
+
"failed",
|
|
62868
|
+
"undeliverable",
|
|
62869
|
+
"converted",
|
|
62870
|
+
"suppressed",
|
|
62871
|
+
"unsubscribed",
|
|
62872
|
+
"dropped"
|
|
62873
|
+
]);
|
|
62874
|
+
|
|
61356
62875
|
// ../hyperline-lib/build/http/dto/error.js
|
|
61357
62876
|
var ErrorSchema = external_exports.object({
|
|
61358
62877
|
message: external_exports.string()
|
|
@@ -64484,6 +66003,8 @@ var usStates = [
|
|
|
64484
66003
|
|
|
64485
66004
|
// ../hyperline-lib/build/utils/dates.js
|
|
64486
66005
|
var import_shared2 = __toESM(require_shared(), 1);
|
|
66006
|
+
var PERIOD_BOUND_DRIFT_TOLERANCE_MS = 2 * 60 * 1e3;
|
|
66007
|
+
var DST_SHIFT_MS = 60 * 60 * 1e3;
|
|
64487
66008
|
|
|
64488
66009
|
// ../hyperline-lib/build/utils/document.js
|
|
64489
66010
|
var import_shared3 = __toESM(require_shared(), 1);
|
|
@@ -64495,6 +66016,11 @@ import * as https from "node:https";
|
|
|
64495
66016
|
import { createHash as createHash2 } from "node:crypto";
|
|
64496
66017
|
import { deepEqual } from "fast-equals";
|
|
64497
66018
|
|
|
66019
|
+
// ../hyperline-lib/build/utils/realignDatesToTimezone.js
|
|
66020
|
+
var import_shared4 = __toESM(require_shared(), 1);
|
|
66021
|
+
var MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1e3;
|
|
66022
|
+
var LAST_MILLISECOND_OF_DAY = MILLISECONDS_PER_DAY - 1;
|
|
66023
|
+
|
|
64498
66024
|
// ../hyperline-lib/build/utils/api/filterBuilder.js
|
|
64499
66025
|
var baseAuthorizedOperators = ["not", "isNull", "isNotNull"];
|
|
64500
66026
|
var booleanAuthorizedOperators = [
|
|
@@ -64561,7 +66087,151 @@ var isAxiosError = axios.isAxiosError;
|
|
|
64561
66087
|
|
|
64562
66088
|
// ../hyperline-lib/build/httpClient/httpClient.js
|
|
64563
66089
|
import axios2 from "axios";
|
|
64564
|
-
import axiosRetry, { isNetworkOrIdempotentRequestError } from "axios-retry";
|
|
66090
|
+
import axiosRetry, { isNetworkOrIdempotentRequestError, retryAfter } from "axios-retry";
|
|
66091
|
+
|
|
66092
|
+
// ../hyperline-lib/build/httpClient/logRedaction.js
|
|
66093
|
+
var REDACTED_KEY_NAMES = /* @__PURE__ */ new Set([
|
|
66094
|
+
"accesstoken",
|
|
66095
|
+
"apikey",
|
|
66096
|
+
"apitoken",
|
|
66097
|
+
"assertion",
|
|
66098
|
+
"authtoken",
|
|
66099
|
+
"clientassertion",
|
|
66100
|
+
"codeverifier",
|
|
66101
|
+
"credentials",
|
|
66102
|
+
"idtoken",
|
|
66103
|
+
"privatekey",
|
|
66104
|
+
"refreshtoken",
|
|
66105
|
+
"sessiontoken",
|
|
66106
|
+
"token"
|
|
66107
|
+
]);
|
|
66108
|
+
var REDACTED_KEY_SUFFIX_PATTERN = /(secret|password)$/;
|
|
66109
|
+
var REDACTED_KEY_CANDIDATE_PATTERN = /token|key|secret|password|assertion|verifier|credentials/i;
|
|
66110
|
+
var REDACTED_VALUE = "<redacted>";
|
|
66111
|
+
var MAX_REDACTION_DEPTH = 10;
|
|
66112
|
+
var MAX_PARSED_STRING_LENGTH = 16384;
|
|
66113
|
+
var MAX_VISITED_NODES = 1e3;
|
|
66114
|
+
var MAX_CONTAINER_ENTRIES = MAX_VISITED_NODES;
|
|
66115
|
+
function redactLogBody({ body }) {
|
|
66116
|
+
return redactValue({
|
|
66117
|
+
value: body,
|
|
66118
|
+
depth: MAX_REDACTION_DEPTH,
|
|
66119
|
+
budget: { remainingNodes: MAX_VISITED_NODES }
|
|
66120
|
+
});
|
|
66121
|
+
}
|
|
66122
|
+
function redactLogUrl({ url: url2 }) {
|
|
66123
|
+
const queryIndex = url2.indexOf("?");
|
|
66124
|
+
if (queryIndex === -1 || url2.length > MAX_PARSED_STRING_LENGTH) {
|
|
66125
|
+
return url2;
|
|
66126
|
+
}
|
|
66127
|
+
const redactedQuery = redactFormEncoded({ text: url2.slice(queryIndex + 1) });
|
|
66128
|
+
return redactedQuery === void 0 ? url2 : `${url2.slice(0, queryIndex)}?${redactedQuery}`;
|
|
66129
|
+
}
|
|
66130
|
+
function redactValue({ value, depth, budget }) {
|
|
66131
|
+
if (depth <= 0 || budget.remainingNodes <= 0) {
|
|
66132
|
+
return value;
|
|
66133
|
+
}
|
|
66134
|
+
budget.remainingNodes -= 1;
|
|
66135
|
+
if (typeof value === "string") {
|
|
66136
|
+
return redactString({ text: value, budget });
|
|
66137
|
+
}
|
|
66138
|
+
if (value instanceof URLSearchParams) {
|
|
66139
|
+
return redactFormEncoded({ text: value.toString() }) ?? value;
|
|
66140
|
+
}
|
|
66141
|
+
if (Array.isArray(value)) {
|
|
66142
|
+
return redactArray({ items: value, depth, budget });
|
|
66143
|
+
}
|
|
66144
|
+
if (isPlainObject2(value)) {
|
|
66145
|
+
return redactObject({ record: value, depth, budget });
|
|
66146
|
+
}
|
|
66147
|
+
return value;
|
|
66148
|
+
}
|
|
66149
|
+
function redactArray({ items, depth, budget }) {
|
|
66150
|
+
if (items.length > MAX_CONTAINER_ENTRIES) {
|
|
66151
|
+
return items;
|
|
66152
|
+
}
|
|
66153
|
+
let redactedItems;
|
|
66154
|
+
for (const [index, item] of items.entries()) {
|
|
66155
|
+
if (budget.remainingNodes <= 0) {
|
|
66156
|
+
break;
|
|
66157
|
+
}
|
|
66158
|
+
const redactedItem = redactValue({ value: item, depth: depth - 1, budget });
|
|
66159
|
+
if (redactedItem !== item) {
|
|
66160
|
+
redactedItems ??= [...items];
|
|
66161
|
+
redactedItems[index] = redactedItem;
|
|
66162
|
+
}
|
|
66163
|
+
}
|
|
66164
|
+
return redactedItems ?? items;
|
|
66165
|
+
}
|
|
66166
|
+
function redactObject({ record: record2, depth, budget }) {
|
|
66167
|
+
const redactedEntries = /* @__PURE__ */ new Map();
|
|
66168
|
+
let entryCount = 0;
|
|
66169
|
+
for (const key in record2) {
|
|
66170
|
+
if (!Object.hasOwn(record2, key)) {
|
|
66171
|
+
continue;
|
|
66172
|
+
}
|
|
66173
|
+
entryCount += 1;
|
|
66174
|
+
if (entryCount > MAX_CONTAINER_ENTRIES) {
|
|
66175
|
+
return record2;
|
|
66176
|
+
}
|
|
66177
|
+
if (budget.remainingNodes <= 0) {
|
|
66178
|
+
break;
|
|
66179
|
+
}
|
|
66180
|
+
const nestedValue = record2[key];
|
|
66181
|
+
const redactedNestedValue = isRedactedKey({ key }) && nestedValue != null ? REDACTED_VALUE : redactValue({ value: nestedValue, depth: depth - 1, budget });
|
|
66182
|
+
if (redactedNestedValue !== nestedValue) {
|
|
66183
|
+
redactedEntries.set(key, redactedNestedValue);
|
|
66184
|
+
}
|
|
66185
|
+
}
|
|
66186
|
+
return redactedEntries.size === 0 ? record2 : { ...record2, ...Object.fromEntries(redactedEntries) };
|
|
66187
|
+
}
|
|
66188
|
+
function redactString({ text, budget }) {
|
|
66189
|
+
if (text.length > MAX_PARSED_STRING_LENGTH) {
|
|
66190
|
+
return text;
|
|
66191
|
+
}
|
|
66192
|
+
const trimmedText = text.trim();
|
|
66193
|
+
if (trimmedText.startsWith("{") || trimmedText.startsWith("[")) {
|
|
66194
|
+
try {
|
|
66195
|
+
const parsedValue = JSON.parse(trimmedText);
|
|
66196
|
+
const redactedValue = redactValue({
|
|
66197
|
+
value: parsedValue,
|
|
66198
|
+
depth: MAX_REDACTION_DEPTH,
|
|
66199
|
+
budget
|
|
66200
|
+
});
|
|
66201
|
+
return redactedValue === parsedValue ? text : JSON.stringify(redactedValue);
|
|
66202
|
+
} catch {
|
|
66203
|
+
return text;
|
|
66204
|
+
}
|
|
66205
|
+
}
|
|
66206
|
+
return redactFormEncoded({ text }) ?? text;
|
|
66207
|
+
}
|
|
66208
|
+
function redactFormEncoded({ text }) {
|
|
66209
|
+
if (!text.includes("=") || !REDACTED_KEY_CANDIDATE_PATTERN.test(text)) {
|
|
66210
|
+
return void 0;
|
|
66211
|
+
}
|
|
66212
|
+
const params = new URLSearchParams(text);
|
|
66213
|
+
let hasRedactedParam = false;
|
|
66214
|
+
for (const key of new Set(params.keys())) {
|
|
66215
|
+
if (isRedactedKey({ key })) {
|
|
66216
|
+
params.set(key, REDACTED_VALUE);
|
|
66217
|
+
hasRedactedParam = true;
|
|
66218
|
+
}
|
|
66219
|
+
}
|
|
66220
|
+
return hasRedactedParam ? params.toString() : void 0;
|
|
66221
|
+
}
|
|
66222
|
+
function isRedactedKey({ key }) {
|
|
66223
|
+
const normalizedKey = key.toLowerCase().replace(/[_-]/g, "");
|
|
66224
|
+
return REDACTED_KEY_NAMES.has(normalizedKey) || REDACTED_KEY_SUFFIX_PATTERN.test(normalizedKey);
|
|
66225
|
+
}
|
|
66226
|
+
function isPlainObject2(value) {
|
|
66227
|
+
if (typeof value !== "object" || value === null) {
|
|
66228
|
+
return false;
|
|
66229
|
+
}
|
|
66230
|
+
const prototype = Object.getPrototypeOf(value);
|
|
66231
|
+
return prototype === Object.prototype || prototype === null;
|
|
66232
|
+
}
|
|
66233
|
+
|
|
66234
|
+
// ../hyperline-lib/build/httpClient/httpClient.js
|
|
64565
66235
|
import { AxiosError } from "axios";
|
|
64566
66236
|
var recommendedRetryConfig = {
|
|
64567
66237
|
retries: 3,
|
|
@@ -64629,13 +66299,14 @@ function isTooManyRequestsError(error48) {
|
|
|
64629
66299
|
return error48.response?.status === 429;
|
|
64630
66300
|
}
|
|
64631
66301
|
var toLogRequest = (config4) => {
|
|
66302
|
+
const url2 = redactLogUrl({ url: config4.url ?? "" });
|
|
64632
66303
|
return {
|
|
64633
66304
|
method: config4.method ?? "",
|
|
64634
|
-
url:
|
|
64635
|
-
path:
|
|
66305
|
+
url: url2,
|
|
66306
|
+
path: url2,
|
|
64636
66307
|
hostname: config4.baseURL ?? "",
|
|
64637
|
-
originalUrl: `${config4.baseURL ?? ""}${
|
|
64638
|
-
body: config4.data,
|
|
66308
|
+
originalUrl: `${config4.baseURL ?? ""}${url2}`,
|
|
66309
|
+
body: redactLogBody({ body: config4.data }),
|
|
64639
66310
|
headers: {}
|
|
64640
66311
|
};
|
|
64641
66312
|
};
|