@hyperline/cli 0.1.0-build.1.ed8c065 → 0.1.0-build.1.edf4831
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 +693 -574
- package/package.json +1 -1
|
@@ -33833,7 +33833,7 @@ var require_shared = __commonJS({
|
|
|
33833
33833
|
getNameForCurrency: () => getNameForCurrency,
|
|
33834
33834
|
getNaturalNumber: () => getNaturalNumber,
|
|
33835
33835
|
getSymbolForCurrency: () => getSymbolForCurrency,
|
|
33836
|
-
getTimezoneByName: () =>
|
|
33836
|
+
getTimezoneByName: () => getTimezoneByName2,
|
|
33837
33837
|
getTimezoneOffsetName: () => getTimezoneOffsetName,
|
|
33838
33838
|
getTimezones: () => getTimezones2,
|
|
33839
33839
|
getValidTimezonesNames: () => getValidTimezonesNames,
|
|
@@ -33850,7 +33850,7 @@ var require_shared = __commonJS({
|
|
|
33850
33850
|
subtract: () => subtract,
|
|
33851
33851
|
sum: () => sum2,
|
|
33852
33852
|
toLocalTime: () => toLocalTime3,
|
|
33853
|
-
toUtc: () =>
|
|
33853
|
+
toUtc: () => toUtc3,
|
|
33854
33854
|
useDebounce: () => useDebounce
|
|
33855
33855
|
});
|
|
33856
33856
|
module.exports = __toCommonJS(shared_exports);
|
|
@@ -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,146 +39229,158 @@ Examples:
|
|
|
39223
39229
|
});
|
|
39224
39230
|
}
|
|
39225
39231
|
|
|
39226
|
-
// build/commands/generated/
|
|
39227
|
-
function
|
|
39228
|
-
const resource = parent.command("
|
|
39229
|
-
resource.command("list
|
|
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.mode !== void 0)
|
|
39240
|
-
args.mode = opts.mode;
|
|
39241
39245
|
if (opts.take !== void 0)
|
|
39242
39246
|
args.take = Number(opts.take);
|
|
39243
39247
|
if (opts.skip !== void 0)
|
|
39244
39248
|
args.skip = Number(opts.skip);
|
|
39245
39249
|
await ctx.execute({
|
|
39246
39250
|
method: "GET",
|
|
39247
|
-
path: "/v1/
|
|
39251
|
+
path: "/v1/aggregators",
|
|
39248
39252
|
args,
|
|
39249
|
-
queryParamKeys: ["
|
|
39253
|
+
queryParamKeys: ["take", "skip"]
|
|
39250
39254
|
});
|
|
39251
39255
|
});
|
|
39252
|
-
resource.command("create
|
|
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", `
|
|
39253
39257
|
Examples:
|
|
39254
|
-
hyperline
|
|
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 = {};
|
|
39267
|
+
if (opts.entity !== void 0)
|
|
39268
|
+
args.entity = opts.entity;
|
|
39269
|
+
if (opts.type !== void 0)
|
|
39270
|
+
args.type = opts.type;
|
|
39263
39271
|
if (opts.name !== void 0)
|
|
39264
39272
|
args.name = opts.name;
|
|
39265
|
-
if (opts.
|
|
39266
|
-
args.
|
|
39267
|
-
if (opts.
|
|
39268
|
-
args.
|
|
39269
|
-
if (opts.
|
|
39270
|
-
args.
|
|
39271
|
-
if (opts.
|
|
39272
|
-
args.
|
|
39273
|
-
if (opts.
|
|
39274
|
-
args.
|
|
39275
|
-
if (opts.
|
|
39276
|
-
args.
|
|
39277
|
-
if (opts.
|
|
39278
|
-
args.
|
|
39279
|
-
if (opts.
|
|
39280
|
-
args.
|
|
39281
|
-
if (opts.
|
|
39282
|
-
args.
|
|
39283
|
-
if (opts.
|
|
39284
|
-
args.
|
|
39285
|
-
if (opts.
|
|
39286
|
-
args.
|
|
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);
|
|
39287
39297
|
await ctx.execute({
|
|
39288
39298
|
method: "POST",
|
|
39289
|
-
path: "/v1/
|
|
39299
|
+
path: "/v1/aggregators",
|
|
39290
39300
|
args,
|
|
39291
39301
|
queryParamKeys: []
|
|
39292
39302
|
});
|
|
39293
39303
|
});
|
|
39294
|
-
resource.command("get
|
|
39304
|
+
resource.command("get").description(`Retrieve a specific aggregator by ID.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
|
|
39295
39305
|
Examples:
|
|
39296
|
-
hyperline
|
|
39306
|
+
hyperline aggregators get --id <id>`).action(async (opts) => {
|
|
39297
39307
|
const ctx = resource.parent?.opts()._ctx;
|
|
39298
39308
|
if (!ctx) {
|
|
39299
39309
|
process.stderr.write("Error: Not authenticated\n");
|
|
39300
39310
|
process.exit(1);
|
|
39301
39311
|
}
|
|
39302
39312
|
const args = {};
|
|
39303
|
-
if (opts.
|
|
39304
|
-
args.
|
|
39313
|
+
if (opts.id !== void 0)
|
|
39314
|
+
args.id = opts.id;
|
|
39305
39315
|
await ctx.execute({
|
|
39306
39316
|
method: "GET",
|
|
39307
|
-
path: "/v1/
|
|
39317
|
+
path: "/v1/aggregators/{id}",
|
|
39308
39318
|
args,
|
|
39309
39319
|
queryParamKeys: []
|
|
39310
39320
|
});
|
|
39311
39321
|
});
|
|
39312
|
-
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", `
|
|
39313
39323
|
Examples:
|
|
39314
|
-
hyperline
|
|
39315
|
-
hyperline
|
|
39316
|
-
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) => {
|
|
39317
39327
|
const ctx = resource.parent?.opts()._ctx;
|
|
39318
39328
|
if (!ctx) {
|
|
39319
39329
|
process.stderr.write("Error: Not authenticated\n");
|
|
39320
39330
|
process.exit(1);
|
|
39321
39331
|
}
|
|
39322
39332
|
const args = {};
|
|
39323
|
-
if (opts.
|
|
39324
|
-
args.
|
|
39333
|
+
if (opts.id !== void 0)
|
|
39334
|
+
args.id = opts.id;
|
|
39335
|
+
if (opts.entity !== void 0)
|
|
39336
|
+
args.entity = opts.entity;
|
|
39337
|
+
if (opts.type !== void 0)
|
|
39338
|
+
args.type = opts.type;
|
|
39325
39339
|
if (opts.name !== void 0)
|
|
39326
39340
|
args.name = opts.name;
|
|
39327
|
-
if (opts.
|
|
39328
|
-
args.
|
|
39329
|
-
if (opts.
|
|
39330
|
-
args.
|
|
39331
|
-
if (opts.
|
|
39332
|
-
args.
|
|
39333
|
-
if (opts.
|
|
39334
|
-
args.
|
|
39335
|
-
if (opts.
|
|
39336
|
-
args.
|
|
39337
|
-
if (opts.
|
|
39338
|
-
args.
|
|
39339
|
-
if (opts.
|
|
39340
|
-
args.
|
|
39341
|
-
if (opts.
|
|
39342
|
-
args.
|
|
39343
|
-
if (opts.
|
|
39344
|
-
args.
|
|
39345
|
-
if (opts.
|
|
39346
|
-
args.
|
|
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);
|
|
39347
39365
|
await ctx.execute({
|
|
39348
39366
|
method: "PUT",
|
|
39349
|
-
path: "/v1/
|
|
39367
|
+
path: "/v1/aggregators/{id}",
|
|
39350
39368
|
args,
|
|
39351
39369
|
queryParamKeys: []
|
|
39352
39370
|
});
|
|
39353
39371
|
});
|
|
39354
|
-
resource.command("delete
|
|
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", `
|
|
39355
39373
|
Examples:
|
|
39356
|
-
hyperline
|
|
39357
|
-
hyperline
|
|
39374
|
+
hyperline aggregators delete --id <id>
|
|
39375
|
+
hyperline aggregators delete --id <id> --output json`).action(async (opts) => {
|
|
39358
39376
|
const ctx = resource.parent?.opts()._ctx;
|
|
39359
39377
|
if (!ctx) {
|
|
39360
39378
|
process.stderr.write("Error: Not authenticated\n");
|
|
39361
39379
|
process.exit(1);
|
|
39362
39380
|
}
|
|
39363
39381
|
const args = {};
|
|
39364
|
-
if (opts.
|
|
39365
|
-
args.
|
|
39382
|
+
if (opts.id !== void 0)
|
|
39383
|
+
args.id = opts.id;
|
|
39366
39384
|
if (!opts.yes) {
|
|
39367
39385
|
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39368
39386
|
if (!confirmed) {
|
|
@@ -39372,272 +39390,358 @@ Examples:
|
|
|
39372
39390
|
}
|
|
39373
39391
|
await ctx.execute({
|
|
39374
39392
|
method: "DELETE",
|
|
39375
|
-
path: "/v1/
|
|
39393
|
+
path: "/v1/aggregators/{id}",
|
|
39376
39394
|
args,
|
|
39377
39395
|
queryParamKeys: []
|
|
39378
39396
|
});
|
|
39379
39397
|
});
|
|
39380
|
-
|
|
39398
|
+
}
|
|
39399
|
+
|
|
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", `
|
|
39381
39404
|
Examples:
|
|
39382
|
-
hyperline
|
|
39405
|
+
hyperline aggregators-usage get-aggregator-usage --id <id>`).action(async (opts) => {
|
|
39383
39406
|
const ctx = resource.parent?.opts()._ctx;
|
|
39384
39407
|
if (!ctx) {
|
|
39385
39408
|
process.stderr.write("Error: Not authenticated\n");
|
|
39386
39409
|
process.exit(1);
|
|
39387
39410
|
}
|
|
39388
39411
|
const args = {};
|
|
39412
|
+
if (opts.id !== void 0)
|
|
39413
|
+
args.id = opts.id;
|
|
39389
39414
|
await ctx.execute({
|
|
39390
39415
|
method: "GET",
|
|
39391
|
-
path: "/v1/
|
|
39416
|
+
path: "/v1/aggregators/{id}/usage",
|
|
39392
39417
|
args,
|
|
39393
39418
|
queryParamKeys: []
|
|
39394
39419
|
});
|
|
39395
39420
|
});
|
|
39396
|
-
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", `
|
|
39397
39422
|
Examples:
|
|
39398
|
-
hyperline
|
|
39399
|
-
hyperline
|
|
39400
|
-
hyperline agents set-agent-default-plan --plan-id <plan_id> --output json`).action(async (opts) => {
|
|
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) => {
|
|
39401
39425
|
const ctx = resource.parent?.opts()._ctx;
|
|
39402
39426
|
if (!ctx) {
|
|
39403
39427
|
process.stderr.write("Error: Not authenticated\n");
|
|
39404
39428
|
process.exit(1);
|
|
39405
39429
|
}
|
|
39406
39430
|
const args = {};
|
|
39407
|
-
if (opts.
|
|
39408
|
-
args.
|
|
39409
|
-
if (opts.
|
|
39410
|
-
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;
|
|
39411
39441
|
await ctx.execute({
|
|
39412
|
-
method: "
|
|
39413
|
-
path: "/v1/
|
|
39442
|
+
method: "GET",
|
|
39443
|
+
path: "/v1/aggregators/{id}/usage/timeseries",
|
|
39414
39444
|
args,
|
|
39415
|
-
queryParamKeys: [
|
|
39445
|
+
queryParamKeys: [
|
|
39446
|
+
"start_date",
|
|
39447
|
+
"end_date",
|
|
39448
|
+
"aggregator_filter_id",
|
|
39449
|
+
"group_by"
|
|
39450
|
+
]
|
|
39416
39451
|
});
|
|
39417
39452
|
});
|
|
39418
|
-
resource.command("
|
|
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", `
|
|
39419
39454
|
Examples:
|
|
39420
|
-
hyperline
|
|
39421
|
-
hyperline
|
|
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) => {
|
|
39422
39457
|
const ctx = resource.parent?.opts()._ctx;
|
|
39423
39458
|
if (!ctx) {
|
|
39424
39459
|
process.stderr.write("Error: Not authenticated\n");
|
|
39425
39460
|
process.exit(1);
|
|
39426
39461
|
}
|
|
39427
39462
|
const args = {};
|
|
39428
|
-
if (
|
|
39429
|
-
|
|
39430
|
-
|
|
39431
|
-
|
|
39432
|
-
|
|
39433
|
-
|
|
39434
|
-
|
|
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);
|
|
39435
39475
|
await ctx.execute({
|
|
39436
|
-
method: "
|
|
39437
|
-
path: "/v1/
|
|
39476
|
+
method: "GET",
|
|
39477
|
+
path: "/v1/aggregators/{id}/usage/group-by-customer",
|
|
39438
39478
|
args,
|
|
39439
|
-
queryParamKeys: [
|
|
39479
|
+
queryParamKeys: [
|
|
39480
|
+
"start_date",
|
|
39481
|
+
"end_date",
|
|
39482
|
+
"aggregator_filter_id",
|
|
39483
|
+
"take",
|
|
39484
|
+
"skip"
|
|
39485
|
+
]
|
|
39440
39486
|
});
|
|
39441
39487
|
});
|
|
39442
|
-
resource.command("
|
|
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", `
|
|
39443
39489
|
Examples:
|
|
39444
|
-
hyperline
|
|
39445
|
-
hyperline
|
|
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) => {
|
|
39446
39492
|
const ctx = resource.parent?.opts()._ctx;
|
|
39447
39493
|
if (!ctx) {
|
|
39448
39494
|
process.stderr.write("Error: Not authenticated\n");
|
|
39449
39495
|
process.exit(1);
|
|
39450
39496
|
}
|
|
39451
39497
|
const args = {};
|
|
39452
|
-
if (opts.
|
|
39453
|
-
args.
|
|
39454
|
-
if (opts.
|
|
39455
|
-
args.
|
|
39456
|
-
if (opts.
|
|
39457
|
-
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;
|
|
39458
39506
|
if (opts.take !== void 0)
|
|
39459
39507
|
args.take = Number(opts.take);
|
|
39460
39508
|
if (opts.skip !== void 0)
|
|
39461
39509
|
args.skip = Number(opts.skip);
|
|
39462
39510
|
await ctx.execute({
|
|
39463
39511
|
method: "GET",
|
|
39464
|
-
path: "/v1/
|
|
39512
|
+
path: "/v1/aggregators/{id}/usage/events",
|
|
39465
39513
|
args,
|
|
39466
|
-
queryParamKeys: [
|
|
39514
|
+
queryParamKeys: [
|
|
39515
|
+
"start_date",
|
|
39516
|
+
"end_date",
|
|
39517
|
+
"aggregator_filter_id",
|
|
39518
|
+
"take",
|
|
39519
|
+
"skip"
|
|
39520
|
+
]
|
|
39467
39521
|
});
|
|
39468
39522
|
});
|
|
39469
|
-
|
|
39523
|
+
}
|
|
39524
|
+
|
|
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", `
|
|
39470
39533
|
Examples:
|
|
39471
|
-
hyperline
|
|
39472
|
-
hyperline
|
|
39473
|
-
hyperline agents create-agent-rate-card --name <name> --rows <rows> --denomination <denomination> --output json`).action(async (opts) => {
|
|
39534
|
+
hyperline ai-billing list-agent-plans
|
|
39535
|
+
hyperline ai-billing list-agent-plans --mode <mode> --take <take>`).action(async (opts) => {
|
|
39474
39536
|
const ctx = resource.parent?.opts()._ctx;
|
|
39475
39537
|
if (!ctx) {
|
|
39476
39538
|
process.stderr.write("Error: Not authenticated\n");
|
|
39477
39539
|
process.exit(1);
|
|
39478
39540
|
}
|
|
39479
39541
|
const args = {};
|
|
39480
|
-
if (opts.
|
|
39481
|
-
args.
|
|
39482
|
-
if (opts.
|
|
39483
|
-
args.
|
|
39484
|
-
if (opts.
|
|
39485
|
-
args.
|
|
39486
|
-
if (opts.denomination !== void 0)
|
|
39487
|
-
args.denomination = opts.denomination;
|
|
39488
|
-
if (opts.currency !== void 0)
|
|
39489
|
-
args.currency = opts.currency;
|
|
39490
|
-
if (opts.rows !== void 0)
|
|
39491
|
-
args.rows = JSON.parse(opts.rows);
|
|
39542
|
+
if (opts.mode !== void 0)
|
|
39543
|
+
args.mode = opts.mode;
|
|
39544
|
+
if (opts.take !== void 0)
|
|
39545
|
+
args.take = Number(opts.take);
|
|
39546
|
+
if (opts.skip !== void 0)
|
|
39547
|
+
args.skip = Number(opts.skip);
|
|
39492
39548
|
await ctx.execute({
|
|
39493
|
-
method: "
|
|
39494
|
-
path: "/v1/
|
|
39549
|
+
method: "GET",
|
|
39550
|
+
path: "/v1/ai-billing/plans",
|
|
39495
39551
|
args,
|
|
39496
|
-
queryParamKeys: []
|
|
39552
|
+
queryParamKeys: ["mode", "take", "skip"]
|
|
39497
39553
|
});
|
|
39498
39554
|
});
|
|
39499
|
-
resource.command("
|
|
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", `
|
|
39500
39565
|
Examples:
|
|
39501
|
-
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) => {
|
|
39502
39569
|
const ctx = resource.parent?.opts()._ctx;
|
|
39503
39570
|
if (!ctx) {
|
|
39504
39571
|
process.stderr.write("Error: Not authenticated\n");
|
|
39505
39572
|
process.exit(1);
|
|
39506
39573
|
}
|
|
39507
39574
|
const args = {};
|
|
39575
|
+
if (opts.name !== void 0)
|
|
39576
|
+
args.name = opts.name;
|
|
39508
39577
|
if (opts.rateCardId !== void 0)
|
|
39509
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);
|
|
39510
39599
|
await ctx.execute({
|
|
39511
|
-
method: "
|
|
39512
|
-
path: "/v1/
|
|
39600
|
+
method: "POST",
|
|
39601
|
+
path: "/v1/ai-billing/plans",
|
|
39513
39602
|
args,
|
|
39514
39603
|
queryParamKeys: []
|
|
39515
39604
|
});
|
|
39516
39605
|
});
|
|
39517
|
-
resource.command("
|
|
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", `
|
|
39518
39607
|
Examples:
|
|
39519
|
-
hyperline
|
|
39520
|
-
hyperline agents replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows> --description <description> --fallback-per-usd <fallback_per_usd>
|
|
39521
|
-
hyperline agents replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows> --output json`).action(async (opts) => {
|
|
39608
|
+
hyperline ai-billing get-agent-plan --plan-id <plan_id>`).action(async (opts) => {
|
|
39522
39609
|
const ctx = resource.parent?.opts()._ctx;
|
|
39523
39610
|
if (!ctx) {
|
|
39524
39611
|
process.stderr.write("Error: Not authenticated\n");
|
|
39525
39612
|
process.exit(1);
|
|
39526
39613
|
}
|
|
39527
39614
|
const args = {};
|
|
39528
|
-
if (opts.
|
|
39529
|
-
args.
|
|
39530
|
-
if (opts.name !== void 0)
|
|
39531
|
-
args.name = opts.name;
|
|
39532
|
-
if (opts.description !== void 0)
|
|
39533
|
-
args.description = opts.description;
|
|
39534
|
-
if (opts.fallbackPerUsd !== void 0)
|
|
39535
|
-
args.fallback_per_usd = opts.fallbackPerUsd;
|
|
39536
|
-
if (opts.rows !== void 0)
|
|
39537
|
-
args.rows = JSON.parse(opts.rows);
|
|
39615
|
+
if (opts.planId !== void 0)
|
|
39616
|
+
args.plan_id = opts.planId;
|
|
39538
39617
|
await ctx.execute({
|
|
39539
|
-
method: "
|
|
39540
|
-
path: "/v1/
|
|
39618
|
+
method: "GET",
|
|
39619
|
+
path: "/v1/ai-billing/plans/{plan_id}",
|
|
39541
39620
|
args,
|
|
39542
39621
|
queryParamKeys: []
|
|
39543
39622
|
});
|
|
39544
39623
|
});
|
|
39545
|
-
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", `
|
|
39546
39630
|
Examples:
|
|
39547
|
-
hyperline
|
|
39548
|
-
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) => {
|
|
39549
39634
|
const ctx = resource.parent?.opts()._ctx;
|
|
39550
39635
|
if (!ctx) {
|
|
39551
39636
|
process.stderr.write("Error: Not authenticated\n");
|
|
39552
39637
|
process.exit(1);
|
|
39553
39638
|
}
|
|
39554
39639
|
const args = {};
|
|
39640
|
+
if (opts.planId !== void 0)
|
|
39641
|
+
args.plan_id = opts.planId;
|
|
39642
|
+
if (opts.name !== void 0)
|
|
39643
|
+
args.name = opts.name;
|
|
39555
39644
|
if (opts.rateCardId !== void 0)
|
|
39556
39645
|
args.rate_card_id = opts.rateCardId;
|
|
39557
|
-
if (
|
|
39558
|
-
|
|
39559
|
-
|
|
39560
|
-
|
|
39561
|
-
|
|
39562
|
-
|
|
39563
|
-
|
|
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);
|
|
39564
39664
|
await ctx.execute({
|
|
39565
|
-
method: "
|
|
39566
|
-
path: "/v1/
|
|
39665
|
+
method: "PUT",
|
|
39666
|
+
path: "/v1/ai-billing/plans/{plan_id}",
|
|
39567
39667
|
args,
|
|
39568
39668
|
queryParamKeys: []
|
|
39569
39669
|
});
|
|
39570
39670
|
});
|
|
39571
|
-
resource.command("
|
|
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", `
|
|
39572
39672
|
Examples:
|
|
39573
|
-
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) => {
|
|
39574
39675
|
const ctx = resource.parent?.opts()._ctx;
|
|
39575
39676
|
if (!ctx) {
|
|
39576
39677
|
process.stderr.write("Error: Not authenticated\n");
|
|
39577
39678
|
process.exit(1);
|
|
39578
39679
|
}
|
|
39579
39680
|
const args = {};
|
|
39681
|
+
if (opts.planId !== void 0)
|
|
39682
|
+
args.plan_id = opts.planId;
|
|
39683
|
+
if (!opts.yes) {
|
|
39684
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39685
|
+
if (!confirmed) {
|
|
39686
|
+
process.stdout.write("Aborted.\n");
|
|
39687
|
+
return;
|
|
39688
|
+
}
|
|
39689
|
+
}
|
|
39580
39690
|
await ctx.execute({
|
|
39581
|
-
method: "
|
|
39582
|
-
path: "/v1/
|
|
39691
|
+
method: "DELETE",
|
|
39692
|
+
path: "/v1/ai-billing/plans/{plan_id}",
|
|
39583
39693
|
args,
|
|
39584
39694
|
queryParamKeys: []
|
|
39585
39695
|
});
|
|
39586
39696
|
});
|
|
39587
|
-
resource.command("
|
|
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", `
|
|
39588
39698
|
Examples:
|
|
39589
|
-
hyperline
|
|
39590
|
-
hyperline agents list-agent-cost-catalog --enabled-only <enabled_only>`).action(async (opts) => {
|
|
39699
|
+
hyperline ai-billing get-agent-default-plan`).action(async (_opts) => {
|
|
39591
39700
|
const ctx = resource.parent?.opts()._ctx;
|
|
39592
39701
|
if (!ctx) {
|
|
39593
39702
|
process.stderr.write("Error: Not authenticated\n");
|
|
39594
39703
|
process.exit(1);
|
|
39595
39704
|
}
|
|
39596
39705
|
const args = {};
|
|
39597
|
-
if (opts.enabledOnly !== void 0)
|
|
39598
|
-
args.enabled_only = opts.enabledOnly;
|
|
39599
39706
|
await ctx.execute({
|
|
39600
39707
|
method: "GET",
|
|
39601
|
-
path: "/v1/
|
|
39708
|
+
path: "/v1/ai-billing/default-plan",
|
|
39602
39709
|
args,
|
|
39603
|
-
queryParamKeys: [
|
|
39710
|
+
queryParamKeys: []
|
|
39604
39711
|
});
|
|
39605
39712
|
});
|
|
39606
|
-
resource.command("
|
|
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", `
|
|
39607
39714
|
Examples:
|
|
39608
|
-
hyperline
|
|
39609
|
-
hyperline
|
|
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) => {
|
|
39610
39718
|
const ctx = resource.parent?.opts()._ctx;
|
|
39611
39719
|
if (!ctx) {
|
|
39612
39720
|
process.stderr.write("Error: Not authenticated\n");
|
|
39613
39721
|
process.exit(1);
|
|
39614
39722
|
}
|
|
39615
39723
|
const args = {};
|
|
39616
|
-
if (opts.
|
|
39617
|
-
args.
|
|
39618
|
-
if (opts.
|
|
39619
|
-
args.
|
|
39620
|
-
if (opts.dimensions !== void 0)
|
|
39621
|
-
args.dimensions = JSON.parse(opts.dimensions);
|
|
39724
|
+
if (opts.planId !== void 0)
|
|
39725
|
+
args.plan_id = opts.planId;
|
|
39726
|
+
if (opts.autoApply !== void 0)
|
|
39727
|
+
args.auto_apply = true;
|
|
39622
39728
|
await ctx.execute({
|
|
39623
|
-
method: "
|
|
39624
|
-
path: "/v1/
|
|
39729
|
+
method: "PUT",
|
|
39730
|
+
path: "/v1/ai-billing/default-plan",
|
|
39625
39731
|
args,
|
|
39626
39732
|
queryParamKeys: []
|
|
39627
39733
|
});
|
|
39628
39734
|
});
|
|
39629
|
-
resource.command("
|
|
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", `
|
|
39630
39736
|
Examples:
|
|
39631
|
-
hyperline
|
|
39632
|
-
hyperline
|
|
39737
|
+
hyperline ai-billing clear-agent-default-plan
|
|
39738
|
+
hyperline ai-billing clear-agent-default-plan --output json`).action(async (opts) => {
|
|
39633
39739
|
const ctx = resource.parent?.opts()._ctx;
|
|
39634
39740
|
if (!ctx) {
|
|
39635
39741
|
process.stderr.write("Error: Not authenticated\n");
|
|
39636
39742
|
process.exit(1);
|
|
39637
39743
|
}
|
|
39638
39744
|
const args = {};
|
|
39639
|
-
if (opts.itemId !== void 0)
|
|
39640
|
-
args.item_id = opts.itemId;
|
|
39641
39745
|
if (!opts.yes) {
|
|
39642
39746
|
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39643
39747
|
if (!confirmed) {
|
|
@@ -39647,179 +39751,130 @@ Examples:
|
|
|
39647
39751
|
}
|
|
39648
39752
|
await ctx.execute({
|
|
39649
39753
|
method: "DELETE",
|
|
39650
|
-
path: "/v1/
|
|
39754
|
+
path: "/v1/ai-billing/default-plan",
|
|
39651
39755
|
args,
|
|
39652
39756
|
queryParamKeys: []
|
|
39653
39757
|
});
|
|
39654
39758
|
});
|
|
39655
|
-
resource.command("
|
|
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", `
|
|
39656
39764
|
Examples:
|
|
39657
|
-
hyperline
|
|
39658
|
-
hyperline
|
|
39659
|
-
hyperline agents 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) => {
|
|
39765
|
+
hyperline ai-billing list-agent-rate-cards
|
|
39766
|
+
hyperline ai-billing list-agent-rate-cards --denomination <denomination> --currency <currency>`).action(async (opts) => {
|
|
39660
39767
|
const ctx = resource.parent?.opts()._ctx;
|
|
39661
39768
|
if (!ctx) {
|
|
39662
39769
|
process.stderr.write("Error: Not authenticated\n");
|
|
39663
39770
|
process.exit(1);
|
|
39664
39771
|
}
|
|
39665
39772
|
const args = {};
|
|
39666
|
-
if (opts.
|
|
39667
|
-
args.
|
|
39668
|
-
if (opts.
|
|
39669
|
-
args.
|
|
39670
|
-
if (opts.
|
|
39671
|
-
args.
|
|
39672
|
-
if (opts.
|
|
39673
|
-
args.
|
|
39674
|
-
if (opts.
|
|
39675
|
-
args.
|
|
39676
|
-
if (opts.cacheWritePerMTokens !== void 0)
|
|
39677
|
-
args.cache_write_per_m_tokens = opts.cacheWritePerMTokens;
|
|
39678
|
-
if (opts.dimensions !== void 0)
|
|
39679
|
-
args.dimensions = JSON.parse(opts.dimensions);
|
|
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);
|
|
39680
39783
|
await ctx.execute({
|
|
39681
|
-
method: "
|
|
39682
|
-
path: "/v1/
|
|
39784
|
+
method: "GET",
|
|
39785
|
+
path: "/v1/ai-billing/rate-cards",
|
|
39683
39786
|
args,
|
|
39684
|
-
queryParamKeys: []
|
|
39787
|
+
queryParamKeys: ["denomination", "currency", "search", "take", "skip"]
|
|
39685
39788
|
});
|
|
39686
39789
|
});
|
|
39687
|
-
resource.command("
|
|
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", `
|
|
39688
39795
|
Examples:
|
|
39689
|
-
hyperline
|
|
39690
|
-
hyperline
|
|
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) => {
|
|
39691
39799
|
const ctx = resource.parent?.opts()._ctx;
|
|
39692
39800
|
if (!ctx) {
|
|
39693
39801
|
process.stderr.write("Error: Not authenticated\n");
|
|
39694
39802
|
process.exit(1);
|
|
39695
39803
|
}
|
|
39696
39804
|
const args = {};
|
|
39697
|
-
if (opts.
|
|
39698
|
-
args.
|
|
39699
|
-
if (
|
|
39700
|
-
|
|
39701
|
-
|
|
39702
|
-
|
|
39703
|
-
|
|
39704
|
-
|
|
39705
|
-
|
|
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);
|
|
39706
39815
|
await ctx.execute({
|
|
39707
|
-
method: "
|
|
39708
|
-
path: "/v1/
|
|
39816
|
+
method: "POST",
|
|
39817
|
+
path: "/v1/ai-billing/rate-cards",
|
|
39709
39818
|
args,
|
|
39710
39819
|
queryParamKeys: []
|
|
39711
39820
|
});
|
|
39712
39821
|
});
|
|
39713
|
-
resource.command("
|
|
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", `
|
|
39714
39823
|
Examples:
|
|
39715
|
-
hyperline
|
|
39824
|
+
hyperline ai-billing get-agent-rate-card --rate-card-id <rate_card_id>`).action(async (opts) => {
|
|
39716
39825
|
const ctx = resource.parent?.opts()._ctx;
|
|
39717
39826
|
if (!ctx) {
|
|
39718
39827
|
process.stderr.write("Error: Not authenticated\n");
|
|
39719
39828
|
process.exit(1);
|
|
39720
39829
|
}
|
|
39721
39830
|
const args = {};
|
|
39722
|
-
if (opts.
|
|
39723
|
-
args.
|
|
39831
|
+
if (opts.rateCardId !== void 0)
|
|
39832
|
+
args.rate_card_id = opts.rateCardId;
|
|
39724
39833
|
await ctx.execute({
|
|
39725
39834
|
method: "GET",
|
|
39726
|
-
path: "/v1/
|
|
39835
|
+
path: "/v1/ai-billing/rate-cards/{rate_card_id}",
|
|
39727
39836
|
args,
|
|
39728
39837
|
queryParamKeys: []
|
|
39729
39838
|
});
|
|
39730
39839
|
});
|
|
39731
|
-
resource.command("
|
|
39732
|
-
Examples:
|
|
39733
|
-
hyperline agents get-agent-customer-policy --customer-id <customer_id>
|
|
39734
|
-
hyperline agents get-agent-customer-policy --customer-id <customer_id> --agent <agent>`).action(async (opts) => {
|
|
39735
|
-
const ctx = resource.parent?.opts()._ctx;
|
|
39736
|
-
if (!ctx) {
|
|
39737
|
-
process.stderr.write("Error: Not authenticated\n");
|
|
39738
|
-
process.exit(1);
|
|
39739
|
-
}
|
|
39740
|
-
const args = {};
|
|
39741
|
-
if (opts.customerId !== void 0)
|
|
39742
|
-
args.customer_id = opts.customerId;
|
|
39743
|
-
if (opts.agent !== void 0)
|
|
39744
|
-
args.agent = opts.agent;
|
|
39745
|
-
await ctx.execute({
|
|
39746
|
-
method: "GET",
|
|
39747
|
-
path: "/v1/agents/customers/{customer_id}/policy",
|
|
39748
|
-
args,
|
|
39749
|
-
queryParamKeys: ["agent"]
|
|
39750
|
-
});
|
|
39751
|
-
});
|
|
39752
|
-
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`).option("--internal-description <value>", `internal_description`).requiredOption("--mode <value>", `mode`).option("--wallet-id <value>", `wallet_id`).option("--credit-product-id <value>", `credit_product_id`).option("--markup-percent <value>", `markup_percent`).option("--overage-mode <value>", `overage_mode`).option("--overage-markup-percent <value>", `overage_markup_percent`).option("--overage-rate-card-id <value>", `overage_rate_card_id`).option("--overage-wallet-id <value>", `overage_wallet_id`).option("--floor <value>", `floor`).option("--settlement-interval-minutes <number>", `settlement_interval_minutes`).option("--settlement-schedule <value>", `settlement_schedule`).option("--credit-rates <json>", `credit_rates`).option("--window-rates <json>", `window_rates`).option("--rate-card-id <value>", `rate_card_id`).option("--plan-id <value>", `plan_id`).requiredOption("--blocked", `blocked`).addHelpText("after", `
|
|
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", `
|
|
39753
39841
|
Examples:
|
|
39754
|
-
hyperline
|
|
39755
|
-
hyperline
|
|
39756
|
-
hyperline
|
|
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) => {
|
|
39757
39845
|
const ctx = resource.parent?.opts()._ctx;
|
|
39758
39846
|
if (!ctx) {
|
|
39759
39847
|
process.stderr.write("Error: Not authenticated\n");
|
|
39760
39848
|
process.exit(1);
|
|
39761
39849
|
}
|
|
39762
39850
|
const args = {};
|
|
39763
|
-
if (opts.customerId !== void 0)
|
|
39764
|
-
args.customer_id = opts.customerId;
|
|
39765
|
-
if (opts.agent !== void 0)
|
|
39766
|
-
args.agent = opts.agent;
|
|
39767
|
-
if (opts.internalDescription !== void 0)
|
|
39768
|
-
args.internal_description = opts.internalDescription;
|
|
39769
|
-
if (opts.mode !== void 0)
|
|
39770
|
-
args.mode = opts.mode;
|
|
39771
|
-
if (opts.walletId !== void 0)
|
|
39772
|
-
args.wallet_id = opts.walletId;
|
|
39773
|
-
if (opts.creditProductId !== void 0)
|
|
39774
|
-
args.credit_product_id = opts.creditProductId;
|
|
39775
|
-
if (opts.markupPercent !== void 0)
|
|
39776
|
-
args.markup_percent = opts.markupPercent;
|
|
39777
|
-
if (opts.overageMode !== void 0)
|
|
39778
|
-
args.overage_mode = opts.overageMode;
|
|
39779
|
-
if (opts.overageMarkupPercent !== void 0)
|
|
39780
|
-
args.overage_markup_percent = opts.overageMarkupPercent;
|
|
39781
|
-
if (opts.overageRateCardId !== void 0)
|
|
39782
|
-
args.overage_rate_card_id = opts.overageRateCardId;
|
|
39783
|
-
if (opts.overageWalletId !== void 0)
|
|
39784
|
-
args.overage_wallet_id = opts.overageWalletId;
|
|
39785
|
-
if (opts.floor !== void 0)
|
|
39786
|
-
args.floor = opts.floor;
|
|
39787
|
-
if (opts.settlementSchedule !== void 0)
|
|
39788
|
-
args.settlement_schedule = opts.settlementSchedule;
|
|
39789
39851
|
if (opts.rateCardId !== void 0)
|
|
39790
39852
|
args.rate_card_id = opts.rateCardId;
|
|
39791
|
-
if (opts.
|
|
39792
|
-
args.
|
|
39793
|
-
if (opts.
|
|
39794
|
-
args.
|
|
39795
|
-
if (opts.
|
|
39796
|
-
args.
|
|
39797
|
-
if (opts.creditRates !== void 0)
|
|
39798
|
-
args.credit_rates = JSON.parse(opts.creditRates);
|
|
39799
|
-
if (opts.windowRates !== void 0)
|
|
39800
|
-
args.window_rates = JSON.parse(opts.windowRates);
|
|
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);
|
|
39801
39859
|
await ctx.execute({
|
|
39802
39860
|
method: "PUT",
|
|
39803
|
-
path: "/v1/
|
|
39861
|
+
path: "/v1/ai-billing/rate-cards/{rate_card_id}",
|
|
39804
39862
|
args,
|
|
39805
|
-
queryParamKeys: [
|
|
39863
|
+
queryParamKeys: []
|
|
39806
39864
|
});
|
|
39807
39865
|
});
|
|
39808
|
-
resource.command("delete-agent-
|
|
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", `
|
|
39809
39867
|
Examples:
|
|
39810
|
-
hyperline
|
|
39811
|
-
hyperline
|
|
39812
|
-
hyperline agents delete-agent-customer-policy --customer-id <customer_id> --output json`).action(async (opts) => {
|
|
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) => {
|
|
39813
39870
|
const ctx = resource.parent?.opts()._ctx;
|
|
39814
39871
|
if (!ctx) {
|
|
39815
39872
|
process.stderr.write("Error: Not authenticated\n");
|
|
39816
39873
|
process.exit(1);
|
|
39817
39874
|
}
|
|
39818
39875
|
const args = {};
|
|
39819
|
-
if (opts.
|
|
39820
|
-
args.
|
|
39821
|
-
if (opts.agent !== void 0)
|
|
39822
|
-
args.agent = opts.agent;
|
|
39876
|
+
if (opts.rateCardId !== void 0)
|
|
39877
|
+
args.rate_card_id = opts.rateCardId;
|
|
39823
39878
|
if (!opts.yes) {
|
|
39824
39879
|
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39825
39880
|
if (!confirmed) {
|
|
@@ -39829,276 +39884,270 @@ Examples:
|
|
|
39829
39884
|
}
|
|
39830
39885
|
await ctx.execute({
|
|
39831
39886
|
method: "DELETE",
|
|
39832
|
-
path: "/v1/
|
|
39887
|
+
path: "/v1/ai-billing/rate-cards/{rate_card_id}",
|
|
39833
39888
|
args,
|
|
39834
|
-
queryParamKeys: [
|
|
39889
|
+
queryParamKeys: []
|
|
39835
39890
|
});
|
|
39836
39891
|
});
|
|
39837
|
-
resource.command("
|
|
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", `
|
|
39838
39893
|
Examples:
|
|
39839
|
-
hyperline
|
|
39840
|
-
hyperline agents apply-agent-default-plan --customer-id <customer_id> --output json`).action(async (opts) => {
|
|
39894
|
+
hyperline ai-billing list-agent-credit-products`).action(async (_opts) => {
|
|
39841
39895
|
const ctx = resource.parent?.opts()._ctx;
|
|
39842
39896
|
if (!ctx) {
|
|
39843
39897
|
process.stderr.write("Error: Not authenticated\n");
|
|
39844
39898
|
process.exit(1);
|
|
39845
39899
|
}
|
|
39846
39900
|
const args = {};
|
|
39847
|
-
if (opts.customerId !== void 0)
|
|
39848
|
-
args.customer_id = opts.customerId;
|
|
39849
39901
|
await ctx.execute({
|
|
39850
|
-
method: "
|
|
39851
|
-
path: "/v1/
|
|
39902
|
+
method: "GET",
|
|
39903
|
+
path: "/v1/ai-billing/credit-products",
|
|
39852
39904
|
args,
|
|
39853
39905
|
queryParamKeys: []
|
|
39854
39906
|
});
|
|
39855
39907
|
});
|
|
39856
|
-
resource.command("
|
|
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", `
|
|
39857
39909
|
Examples:
|
|
39858
|
-
hyperline
|
|
39859
|
-
hyperline
|
|
39910
|
+
hyperline ai-billing list-agent-cost-catalog
|
|
39911
|
+
hyperline ai-billing list-agent-cost-catalog --enabled-only <enabled_only>`).action(async (opts) => {
|
|
39860
39912
|
const ctx = resource.parent?.opts()._ctx;
|
|
39861
39913
|
if (!ctx) {
|
|
39862
39914
|
process.stderr.write("Error: Not authenticated\n");
|
|
39863
39915
|
process.exit(1);
|
|
39864
39916
|
}
|
|
39865
39917
|
const args = {};
|
|
39866
|
-
if (opts.
|
|
39867
|
-
args.
|
|
39868
|
-
if (opts.agent !== void 0)
|
|
39869
|
-
args.agent = opts.agent;
|
|
39918
|
+
if (opts.enabledOnly !== void 0)
|
|
39919
|
+
args.enabled_only = opts.enabledOnly;
|
|
39870
39920
|
await ctx.execute({
|
|
39871
39921
|
method: "GET",
|
|
39872
|
-
path: "/v1/
|
|
39922
|
+
path: "/v1/ai-billing/cost-catalog",
|
|
39873
39923
|
args,
|
|
39874
|
-
queryParamKeys: ["
|
|
39924
|
+
queryParamKeys: ["enabled_only"]
|
|
39875
39925
|
});
|
|
39876
39926
|
});
|
|
39877
|
-
resource.command("
|
|
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", `
|
|
39878
39928
|
Examples:
|
|
39879
|
-
hyperline
|
|
39880
|
-
hyperline
|
|
39881
|
-
hyperline agents reset-agent-customer-windows --customer-id <customer_id> --output json`).action(async (opts) => {
|
|
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) => {
|
|
39882
39931
|
const ctx = resource.parent?.opts()._ctx;
|
|
39883
39932
|
if (!ctx) {
|
|
39884
39933
|
process.stderr.write("Error: Not authenticated\n");
|
|
39885
39934
|
process.exit(1);
|
|
39886
39935
|
}
|
|
39887
39936
|
const args = {};
|
|
39888
|
-
if (opts.
|
|
39889
|
-
args.
|
|
39890
|
-
if (opts.
|
|
39891
|
-
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);
|
|
39892
39943
|
await ctx.execute({
|
|
39893
39944
|
method: "POST",
|
|
39894
|
-
path: "/v1/
|
|
39945
|
+
path: "/v1/ai-billing/cost-catalog/items",
|
|
39895
39946
|
args,
|
|
39896
|
-
queryParamKeys: [
|
|
39947
|
+
queryParamKeys: []
|
|
39897
39948
|
});
|
|
39898
39949
|
});
|
|
39899
|
-
resource.command("
|
|
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", `
|
|
39900
39951
|
Examples:
|
|
39901
|
-
hyperline
|
|
39902
|
-
hyperline
|
|
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) => {
|
|
39903
39954
|
const ctx = resource.parent?.opts()._ctx;
|
|
39904
39955
|
if (!ctx) {
|
|
39905
39956
|
process.stderr.write("Error: Not authenticated\n");
|
|
39906
39957
|
process.exit(1);
|
|
39907
39958
|
}
|
|
39908
39959
|
const args = {};
|
|
39909
|
-
if (opts.
|
|
39910
|
-
args.
|
|
39911
|
-
if (opts.
|
|
39912
|
-
|
|
39913
|
-
|
|
39914
|
-
|
|
39915
|
-
|
|
39916
|
-
|
|
39917
|
-
|
|
39918
|
-
args.take = Number(opts.take);
|
|
39919
|
-
if (opts.skip !== void 0)
|
|
39920
|
-
args.skip = Number(opts.skip);
|
|
39921
|
-
if (opts.overage !== void 0)
|
|
39922
|
-
args.overage = true;
|
|
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
|
+
}
|
|
39923
39969
|
await ctx.execute({
|
|
39924
|
-
method: "
|
|
39925
|
-
path: "/v1/
|
|
39970
|
+
method: "DELETE",
|
|
39971
|
+
path: "/v1/ai-billing/cost-catalog/items/{item_id}",
|
|
39926
39972
|
args,
|
|
39927
|
-
queryParamKeys: [
|
|
39973
|
+
queryParamKeys: []
|
|
39928
39974
|
});
|
|
39929
39975
|
});
|
|
39930
|
-
resource.command("
|
|
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", `
|
|
39931
39977
|
Examples:
|
|
39932
|
-
hyperline
|
|
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) => {
|
|
39933
39981
|
const ctx = resource.parent?.opts()._ctx;
|
|
39934
39982
|
if (!ctx) {
|
|
39935
39983
|
process.stderr.write("Error: Not authenticated\n");
|
|
39936
39984
|
process.exit(1);
|
|
39937
39985
|
}
|
|
39938
39986
|
const args = {};
|
|
39939
|
-
if (opts.
|
|
39940
|
-
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);
|
|
39941
40001
|
await ctx.execute({
|
|
39942
|
-
method: "
|
|
39943
|
-
path: "/v1/
|
|
40002
|
+
method: "PUT",
|
|
40003
|
+
path: "/v1/ai-billing/cost-catalog/overrides",
|
|
39944
40004
|
args,
|
|
39945
40005
|
queryParamKeys: []
|
|
39946
40006
|
});
|
|
39947
40007
|
});
|
|
39948
|
-
|
|
39949
|
-
|
|
39950
|
-
// build/commands/generated/aggregators.js
|
|
39951
|
-
function registerAggregatorsCommands(parent) {
|
|
39952
|
-
const resource = parent.command("aggregators").description("Manage aggregators");
|
|
39953
|
-
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", `
|
|
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", `
|
|
39954
40009
|
Examples:
|
|
39955
|
-
hyperline
|
|
39956
|
-
hyperline
|
|
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) => {
|
|
39957
40012
|
const ctx = resource.parent?.opts()._ctx;
|
|
39958
40013
|
if (!ctx) {
|
|
39959
40014
|
process.stderr.write("Error: Not authenticated\n");
|
|
39960
40015
|
process.exit(1);
|
|
39961
40016
|
}
|
|
39962
40017
|
const args = {};
|
|
39963
|
-
if (opts.
|
|
39964
|
-
args.
|
|
39965
|
-
if (opts.
|
|
39966
|
-
|
|
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
|
+
}
|
|
39967
40027
|
await ctx.execute({
|
|
39968
|
-
method: "
|
|
39969
|
-
path: "/v1/
|
|
40028
|
+
method: "DELETE",
|
|
40029
|
+
path: "/v1/ai-billing/cost-catalog/overrides/{override_id}",
|
|
39970
40030
|
args,
|
|
39971
|
-
queryParamKeys: [
|
|
40031
|
+
queryParamKeys: []
|
|
39972
40032
|
});
|
|
39973
40033
|
});
|
|
39974
|
-
resource.command("
|
|
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", `
|
|
39975
40035
|
Examples:
|
|
39976
|
-
hyperline
|
|
39977
|
-
hyperline aggregators create --entity <entity> --operation <operation> --type <type> --where <where>
|
|
39978
|
-
hyperline aggregators create --entity <entity> --operation <operation> --output json`).action(async (opts) => {
|
|
40036
|
+
hyperline ai-billing list-agent-customer-policies --customer-id <customer_id>`).action(async (opts) => {
|
|
39979
40037
|
const ctx = resource.parent?.opts()._ctx;
|
|
39980
40038
|
if (!ctx) {
|
|
39981
40039
|
process.stderr.write("Error: Not authenticated\n");
|
|
39982
40040
|
process.exit(1);
|
|
39983
40041
|
}
|
|
39984
40042
|
const args = {};
|
|
39985
|
-
if (opts.
|
|
39986
|
-
args.
|
|
39987
|
-
if (opts.type !== void 0)
|
|
39988
|
-
args.type = opts.type;
|
|
39989
|
-
if (opts.name !== void 0)
|
|
39990
|
-
args.name = opts.name;
|
|
39991
|
-
if (opts.description !== void 0)
|
|
39992
|
-
args.description = opts.description;
|
|
39993
|
-
if (opts.customEventName !== void 0)
|
|
39994
|
-
args.custom_event_name = opts.customEventName;
|
|
39995
|
-
if (opts.unitName !== void 0)
|
|
39996
|
-
args.unit_name = opts.unitName;
|
|
39997
|
-
if (opts.defaultIntervalPeriod !== void 0)
|
|
39998
|
-
args.default_interval_period = opts.defaultIntervalPeriod;
|
|
39999
|
-
if (opts.operation !== void 0)
|
|
40000
|
-
args.operation = opts.operation;
|
|
40001
|
-
if (opts.property !== void 0)
|
|
40002
|
-
args.property = opts.property;
|
|
40003
|
-
if (opts.defaultIntervalCount !== void 0)
|
|
40004
|
-
args.default_interval_count = Number(opts.defaultIntervalCount);
|
|
40005
|
-
if (opts.allowNegativeValues !== void 0)
|
|
40006
|
-
args.allow_negative_values = true;
|
|
40007
|
-
if (opts.aggregateOnCustomersEnabled !== void 0)
|
|
40008
|
-
args.aggregate_on_customers_enabled = true;
|
|
40009
|
-
if (opts.where !== void 0)
|
|
40010
|
-
args.where = JSON.parse(opts.where);
|
|
40011
|
-
if (opts.exposedEventKeys !== void 0)
|
|
40012
|
-
args.exposed_event_keys = JSON.parse(opts.exposedEventKeys);
|
|
40013
|
-
if (opts.thresholds !== void 0)
|
|
40014
|
-
args.thresholds = JSON.parse(opts.thresholds);
|
|
40043
|
+
if (opts.customerId !== void 0)
|
|
40044
|
+
args.customer_id = opts.customerId;
|
|
40015
40045
|
await ctx.execute({
|
|
40016
|
-
method: "
|
|
40017
|
-
path: "/v1/
|
|
40046
|
+
method: "GET",
|
|
40047
|
+
path: "/v1/ai-billing/customers/{customer_id}/policies",
|
|
40018
40048
|
args,
|
|
40019
40049
|
queryParamKeys: []
|
|
40020
40050
|
});
|
|
40021
40051
|
});
|
|
40022
|
-
resource.command("get").description(`
|
|
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", `
|
|
40023
40053
|
Examples:
|
|
40024
|
-
hyperline
|
|
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) => {
|
|
40025
40056
|
const ctx = resource.parent?.opts()._ctx;
|
|
40026
40057
|
if (!ctx) {
|
|
40027
40058
|
process.stderr.write("Error: Not authenticated\n");
|
|
40028
40059
|
process.exit(1);
|
|
40029
40060
|
}
|
|
40030
40061
|
const args = {};
|
|
40031
|
-
if (opts.
|
|
40032
|
-
args.
|
|
40062
|
+
if (opts.customerId !== void 0)
|
|
40063
|
+
args.customer_id = opts.customerId;
|
|
40064
|
+
if (opts.agent !== void 0)
|
|
40065
|
+
args.agent = opts.agent;
|
|
40033
40066
|
await ctx.execute({
|
|
40034
40067
|
method: "GET",
|
|
40035
|
-
path: "/v1/
|
|
40068
|
+
path: "/v1/ai-billing/customers/{customer_id}/policy",
|
|
40036
40069
|
args,
|
|
40037
|
-
queryParamKeys: []
|
|
40070
|
+
queryParamKeys: ["agent"]
|
|
40038
40071
|
});
|
|
40039
40072
|
});
|
|
40040
|
-
resource.command("
|
|
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", `
|
|
40041
40083
|
Examples:
|
|
40042
|
-
hyperline
|
|
40043
|
-
hyperline
|
|
40044
|
-
hyperline
|
|
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) => {
|
|
40045
40087
|
const ctx = resource.parent?.opts()._ctx;
|
|
40046
40088
|
if (!ctx) {
|
|
40047
40089
|
process.stderr.write("Error: Not authenticated\n");
|
|
40048
40090
|
process.exit(1);
|
|
40049
40091
|
}
|
|
40050
40092
|
const args = {};
|
|
40051
|
-
if (opts.
|
|
40052
|
-
args.
|
|
40053
|
-
if (opts.
|
|
40054
|
-
args.
|
|
40055
|
-
if (opts.
|
|
40056
|
-
args.
|
|
40057
|
-
if (opts.
|
|
40058
|
-
args.
|
|
40059
|
-
if (opts.
|
|
40060
|
-
args.
|
|
40061
|
-
if (opts.
|
|
40062
|
-
args.
|
|
40063
|
-
if (opts.
|
|
40064
|
-
args.
|
|
40065
|
-
if (opts.
|
|
40066
|
-
args.
|
|
40067
|
-
if (opts.
|
|
40068
|
-
args.
|
|
40069
|
-
if (opts.
|
|
40070
|
-
args.
|
|
40071
|
-
if (opts.
|
|
40072
|
-
args.
|
|
40073
|
-
if (opts.
|
|
40074
|
-
args.
|
|
40075
|
-
if (opts.
|
|
40076
|
-
args.
|
|
40077
|
-
if (opts.
|
|
40078
|
-
args.
|
|
40079
|
-
if (opts.
|
|
40080
|
-
args.
|
|
40081
|
-
if (opts.
|
|
40082
|
-
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);
|
|
40083
40129
|
await ctx.execute({
|
|
40084
40130
|
method: "PUT",
|
|
40085
|
-
path: "/v1/
|
|
40131
|
+
path: "/v1/ai-billing/customers/{customer_id}/policy",
|
|
40086
40132
|
args,
|
|
40087
|
-
queryParamKeys: []
|
|
40133
|
+
queryParamKeys: ["agent"]
|
|
40088
40134
|
});
|
|
40089
40135
|
});
|
|
40090
|
-
resource.command("delete").description(`Delete
|
|
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", `
|
|
40091
40137
|
Examples:
|
|
40092
|
-
hyperline
|
|
40093
|
-
hyperline
|
|
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) => {
|
|
40094
40141
|
const ctx = resource.parent?.opts()._ctx;
|
|
40095
40142
|
if (!ctx) {
|
|
40096
40143
|
process.stderr.write("Error: Not authenticated\n");
|
|
40097
40144
|
process.exit(1);
|
|
40098
40145
|
}
|
|
40099
40146
|
const args = {};
|
|
40100
|
-
if (opts.
|
|
40101
|
-
args.
|
|
40147
|
+
if (opts.customerId !== void 0)
|
|
40148
|
+
args.customer_id = opts.customerId;
|
|
40149
|
+
if (opts.agent !== void 0)
|
|
40150
|
+
args.agent = opts.agent;
|
|
40102
40151
|
if (!opts.yes) {
|
|
40103
40152
|
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
40104
40153
|
if (!confirmed) {
|
|
@@ -40108,134 +40157,120 @@ Examples:
|
|
|
40108
40157
|
}
|
|
40109
40158
|
await ctx.execute({
|
|
40110
40159
|
method: "DELETE",
|
|
40111
|
-
path: "/v1/
|
|
40160
|
+
path: "/v1/ai-billing/customers/{customer_id}/policy",
|
|
40112
40161
|
args,
|
|
40113
|
-
queryParamKeys: []
|
|
40162
|
+
queryParamKeys: ["agent"]
|
|
40114
40163
|
});
|
|
40115
40164
|
});
|
|
40116
|
-
|
|
40117
|
-
|
|
40118
|
-
// build/commands/generated/aggregators-usage.js
|
|
40119
|
-
function registerAggregators_UsageCommands(parent) {
|
|
40120
|
-
const resource = parent.command("aggregators-usage").description("Manage aggregators > usage");
|
|
40121
|
-
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", `
|
|
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", `
|
|
40122
40166
|
Examples:
|
|
40123
|
-
hyperline
|
|
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) => {
|
|
40124
40169
|
const ctx = resource.parent?.opts()._ctx;
|
|
40125
40170
|
if (!ctx) {
|
|
40126
40171
|
process.stderr.write("Error: Not authenticated\n");
|
|
40127
40172
|
process.exit(1);
|
|
40128
40173
|
}
|
|
40129
40174
|
const args = {};
|
|
40130
|
-
if (opts.
|
|
40131
|
-
args.
|
|
40175
|
+
if (opts.customerId !== void 0)
|
|
40176
|
+
args.customer_id = opts.customerId;
|
|
40132
40177
|
await ctx.execute({
|
|
40133
|
-
method: "
|
|
40134
|
-
path: "/v1/
|
|
40178
|
+
method: "POST",
|
|
40179
|
+
path: "/v1/ai-billing/customers/{customer_id}/apply-default-plan",
|
|
40135
40180
|
args,
|
|
40136
40181
|
queryParamKeys: []
|
|
40137
40182
|
});
|
|
40138
40183
|
});
|
|
40139
|
-
resource.command("get-
|
|
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", `
|
|
40140
40185
|
Examples:
|
|
40141
|
-
hyperline
|
|
40142
|
-
hyperline
|
|
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) => {
|
|
40143
40188
|
const ctx = resource.parent?.opts()._ctx;
|
|
40144
40189
|
if (!ctx) {
|
|
40145
40190
|
process.stderr.write("Error: Not authenticated\n");
|
|
40146
40191
|
process.exit(1);
|
|
40147
40192
|
}
|
|
40148
40193
|
const args = {};
|
|
40149
|
-
if (opts.
|
|
40150
|
-
args.
|
|
40151
|
-
if (opts.
|
|
40152
|
-
args.
|
|
40153
|
-
if (opts.endDate !== void 0)
|
|
40154
|
-
args.end_date = opts.endDate;
|
|
40155
|
-
if (opts.aggregatorFilterId !== void 0)
|
|
40156
|
-
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
40157
|
-
if (opts.groupBy !== void 0)
|
|
40158
|
-
args.group_by = opts.groupBy;
|
|
40194
|
+
if (opts.customerId !== void 0)
|
|
40195
|
+
args.customer_id = opts.customerId;
|
|
40196
|
+
if (opts.agent !== void 0)
|
|
40197
|
+
args.agent = opts.agent;
|
|
40159
40198
|
await ctx.execute({
|
|
40160
40199
|
method: "GET",
|
|
40161
|
-
path: "/v1/
|
|
40200
|
+
path: "/v1/ai-billing/customers/{customer_id}/balance",
|
|
40162
40201
|
args,
|
|
40163
|
-
queryParamKeys: [
|
|
40164
|
-
"start_date",
|
|
40165
|
-
"end_date",
|
|
40166
|
-
"aggregator_filter_id",
|
|
40167
|
-
"group_by"
|
|
40168
|
-
]
|
|
40202
|
+
queryParamKeys: ["agent"]
|
|
40169
40203
|
});
|
|
40170
40204
|
});
|
|
40171
|
-
resource.command("
|
|
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", `
|
|
40172
40206
|
Examples:
|
|
40173
|
-
hyperline
|
|
40174
|
-
hyperline
|
|
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) => {
|
|
40175
40210
|
const ctx = resource.parent?.opts()._ctx;
|
|
40176
40211
|
if (!ctx) {
|
|
40177
40212
|
process.stderr.write("Error: Not authenticated\n");
|
|
40178
40213
|
process.exit(1);
|
|
40179
40214
|
}
|
|
40180
40215
|
const args = {};
|
|
40181
|
-
if (opts.
|
|
40182
|
-
args.
|
|
40183
|
-
if (opts.
|
|
40184
|
-
args.
|
|
40185
|
-
|
|
40186
|
-
|
|
40187
|
-
|
|
40188
|
-
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;
|
|
40189
40247
|
if (opts.take !== void 0)
|
|
40190
40248
|
args.take = Number(opts.take);
|
|
40191
40249
|
if (opts.skip !== void 0)
|
|
40192
40250
|
args.skip = Number(opts.skip);
|
|
40193
40251
|
await ctx.execute({
|
|
40194
40252
|
method: "GET",
|
|
40195
|
-
path: "/v1/
|
|
40253
|
+
path: "/v1/ai-billing/customers/{customer_id}/consumption",
|
|
40196
40254
|
args,
|
|
40197
|
-
queryParamKeys: [
|
|
40198
|
-
"start_date",
|
|
40199
|
-
"end_date",
|
|
40200
|
-
"aggregator_filter_id",
|
|
40201
|
-
"take",
|
|
40202
|
-
"skip"
|
|
40203
|
-
]
|
|
40255
|
+
queryParamKeys: ["agent", "overage", "from", "to", "take", "skip"]
|
|
40204
40256
|
});
|
|
40205
40257
|
});
|
|
40206
|
-
resource.command("get-
|
|
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", `
|
|
40207
40259
|
Examples:
|
|
40208
|
-
hyperline
|
|
40209
|
-
hyperline aggregators-usage get-aggregator-usage-events --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
40260
|
+
hyperline ai-billing get-agent-customer-overview --customer-id <customer_id>`).action(async (opts) => {
|
|
40210
40261
|
const ctx = resource.parent?.opts()._ctx;
|
|
40211
40262
|
if (!ctx) {
|
|
40212
40263
|
process.stderr.write("Error: Not authenticated\n");
|
|
40213
40264
|
process.exit(1);
|
|
40214
40265
|
}
|
|
40215
40266
|
const args = {};
|
|
40216
|
-
if (opts.
|
|
40217
|
-
args.
|
|
40218
|
-
if (opts.startDate !== void 0)
|
|
40219
|
-
args.start_date = opts.startDate;
|
|
40220
|
-
if (opts.endDate !== void 0)
|
|
40221
|
-
args.end_date = opts.endDate;
|
|
40222
|
-
if (opts.aggregatorFilterId !== void 0)
|
|
40223
|
-
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
40224
|
-
if (opts.take !== void 0)
|
|
40225
|
-
args.take = Number(opts.take);
|
|
40226
|
-
if (opts.skip !== void 0)
|
|
40227
|
-
args.skip = Number(opts.skip);
|
|
40267
|
+
if (opts.customerId !== void 0)
|
|
40268
|
+
args.customer_id = opts.customerId;
|
|
40228
40269
|
await ctx.execute({
|
|
40229
40270
|
method: "GET",
|
|
40230
|
-
path: "/v1/
|
|
40271
|
+
path: "/v1/ai-billing/customers/{customer_id}/overview",
|
|
40231
40272
|
args,
|
|
40232
|
-
queryParamKeys: [
|
|
40233
|
-
"start_date",
|
|
40234
|
-
"end_date",
|
|
40235
|
-
"aggregator_filter_id",
|
|
40236
|
-
"take",
|
|
40237
|
-
"skip"
|
|
40238
|
-
]
|
|
40273
|
+
queryParamKeys: []
|
|
40239
40274
|
});
|
|
40240
40275
|
});
|
|
40241
40276
|
}
|
|
@@ -40399,7 +40434,7 @@ Examples:
|
|
|
40399
40434
|
queryParamKeys: ["take", "skip"]
|
|
40400
40435
|
});
|
|
40401
40436
|
});
|
|
40402
|
-
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.`).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", `
|
|
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", `
|
|
40403
40438
|
Examples:
|
|
40404
40439
|
hyperline coupons create --name <name> --type <type>
|
|
40405
40440
|
hyperline coupons create --name <name> --type <type> --description <description> --expiration-date <expiration_date>
|
|
@@ -40432,6 +40467,8 @@ Examples:
|
|
|
40432
40467
|
args.product_ids = JSON.parse(opts.productIds);
|
|
40433
40468
|
if (opts.duration !== void 0)
|
|
40434
40469
|
args.duration = JSON.parse(opts.duration);
|
|
40470
|
+
if (opts.properties !== void 0)
|
|
40471
|
+
args.properties = JSON.parse(opts.properties);
|
|
40435
40472
|
await ctx.execute({
|
|
40436
40473
|
method: "POST",
|
|
40437
40474
|
path: "/v1/coupons",
|
|
@@ -40457,7 +40494,7 @@ Examples:
|
|
|
40457
40494
|
queryParamKeys: []
|
|
40458
40495
|
});
|
|
40459
40496
|
});
|
|
40460
|
-
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.`).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", `
|
|
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", `
|
|
40461
40498
|
Examples:
|
|
40462
40499
|
hyperline coupons update --id <id> --name <name> --type <type>
|
|
40463
40500
|
hyperline coupons update --id <id> --name <name> --type <type> --description <description> --expiration-date <expiration_date>
|
|
@@ -40492,6 +40529,8 @@ Examples:
|
|
|
40492
40529
|
args.product_ids = JSON.parse(opts.productIds);
|
|
40493
40530
|
if (opts.duration !== void 0)
|
|
40494
40531
|
args.duration = JSON.parse(opts.duration);
|
|
40532
|
+
if (opts.properties !== void 0)
|
|
40533
|
+
args.properties = JSON.parse(opts.properties);
|
|
40495
40534
|
await ctx.execute({
|
|
40496
40535
|
method: "PUT",
|
|
40497
40536
|
path: "/v1/coupons/{id}",
|
|
@@ -40723,7 +40762,7 @@ Examples:
|
|
|
40723
40762
|
queryParamKeys: []
|
|
40724
40763
|
});
|
|
40725
40764
|
});
|
|
40726
|
-
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", `
|
|
40727
40766
|
Examples:
|
|
40728
40767
|
hyperline custom-properties create-custom-property --name <name> --type <type> --slug <slug> --entities <entities>
|
|
40729
40768
|
hyperline custom-properties create-custom-property --name <name> --type <type> --slug <slug> --entities <entities> --api-only --required
|
|
@@ -40748,6 +40787,8 @@ Examples:
|
|
|
40748
40787
|
args.entities = JSON.parse(opts.entities);
|
|
40749
40788
|
if (opts.authorizedValues !== void 0)
|
|
40750
40789
|
args.authorized_values = JSON.parse(opts.authorizedValues);
|
|
40790
|
+
if (opts.defaultValue !== void 0)
|
|
40791
|
+
args.default_value = JSON.parse(opts.defaultValue);
|
|
40751
40792
|
await ctx.execute({
|
|
40752
40793
|
method: "POST",
|
|
40753
40794
|
path: "/v1/custom-properties",
|
|
@@ -40755,7 +40796,7 @@ Examples:
|
|
|
40755
40796
|
queryParamKeys: []
|
|
40756
40797
|
});
|
|
40757
40798
|
});
|
|
40758
|
-
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", `
|
|
40759
40800
|
Examples:
|
|
40760
40801
|
hyperline custom-properties update-custom-property --id <id> --name <name> --type <type> --slug <slug> --entities <entities>
|
|
40761
40802
|
hyperline custom-properties update-custom-property --id <id> --name <name> --type <type> --slug <slug> --entities <entities> --api-only --required
|
|
@@ -40782,6 +40823,8 @@ Examples:
|
|
|
40782
40823
|
args.entities = JSON.parse(opts.entities);
|
|
40783
40824
|
if (opts.authorizedValues !== void 0)
|
|
40784
40825
|
args.authorized_values = JSON.parse(opts.authorizedValues);
|
|
40826
|
+
if (opts.defaultValue !== void 0)
|
|
40827
|
+
args.default_value = JSON.parse(opts.defaultValue);
|
|
40785
40828
|
await ctx.execute({
|
|
40786
40829
|
method: "PUT",
|
|
40787
40830
|
path: "/v1/custom-properties/{id}",
|
|
@@ -41139,7 +41182,7 @@ Customer type.
|
|
|
41139
41182
|
|
|
41140
41183
|
- \`taxable\`: Taxes are automatically determined for the customer.
|
|
41141
41184
|
- \`exempt\`: The customer is exempt from tax.
|
|
41142
|
-
`).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>", `
|
|
41143
41186
|
How customer invoices are issued from the parent organisation.
|
|
41144
41187
|
|
|
41145
41188
|
- \`none\`: Invoices will keep being issued from this customer.
|
|
@@ -41168,6 +41211,8 @@ Examples:
|
|
|
41168
41211
|
args.taxability = opts.taxability;
|
|
41169
41212
|
if (opts.registrationNumber !== void 0)
|
|
41170
41213
|
args.registration_number = opts.registrationNumber;
|
|
41214
|
+
if (opts.einvoicingCode !== void 0)
|
|
41215
|
+
args.einvoicing_code = opts.einvoicingCode;
|
|
41171
41216
|
if (opts.externalId !== void 0)
|
|
41172
41217
|
args.external_id = opts.externalId;
|
|
41173
41218
|
if (opts.domain !== void 0)
|
|
@@ -41274,7 +41319,7 @@ Customer type.
|
|
|
41274
41319
|
|
|
41275
41320
|
- \`taxable\`: Taxes are automatically determined for the customer.
|
|
41276
41321
|
- \`exempt\`: The customer is exempt from tax.
|
|
41277
|
-
`).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>", `
|
|
41278
41323
|
How customer invoices are issued from the parent organisation.
|
|
41279
41324
|
|
|
41280
41325
|
- \`none\`: Invoices will keep being issued from this customer.
|
|
@@ -41305,6 +41350,8 @@ Examples:
|
|
|
41305
41350
|
args.taxability = opts.taxability;
|
|
41306
41351
|
if (opts.registrationNumber !== void 0)
|
|
41307
41352
|
args.registration_number = opts.registrationNumber;
|
|
41353
|
+
if (opts.einvoicingCode !== void 0)
|
|
41354
|
+
args.einvoicing_code = opts.einvoicingCode;
|
|
41308
41355
|
if (opts.externalId !== void 0)
|
|
41309
41356
|
args.external_id = opts.externalId;
|
|
41310
41357
|
if (opts.domain !== void 0)
|
|
@@ -41558,7 +41605,7 @@ Examples:
|
|
|
41558
41605
|
queryParamKeys: []
|
|
41559
41606
|
});
|
|
41560
41607
|
});
|
|
41561
|
-
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`).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).`).
|
|
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", `
|
|
41562
41609
|
Examples:
|
|
41563
41610
|
hyperline customers-address create-customer-address --customer-id <customerId> --type <type>
|
|
41564
41611
|
hyperline customers-address create-customer-address --customer-id <customerId> --type <type> --name <name> --line1 <line1>
|
|
@@ -41571,6 +41618,8 @@ Examples:
|
|
|
41571
41618
|
const args = {};
|
|
41572
41619
|
if (opts.customerId !== void 0)
|
|
41573
41620
|
args.customerId = opts.customerId;
|
|
41621
|
+
if (opts.type !== void 0)
|
|
41622
|
+
args.type = opts.type;
|
|
41574
41623
|
if (opts.name !== void 0)
|
|
41575
41624
|
args.name = opts.name;
|
|
41576
41625
|
if (opts.line1 !== void 0)
|
|
@@ -41585,8 +41634,8 @@ Examples:
|
|
|
41585
41634
|
args.state = opts.state;
|
|
41586
41635
|
if (opts.country !== void 0)
|
|
41587
41636
|
args.country = opts.country;
|
|
41588
|
-
if (opts.
|
|
41589
|
-
args.
|
|
41637
|
+
if (opts.taxId !== void 0)
|
|
41638
|
+
args.tax_id = opts.taxId;
|
|
41590
41639
|
await ctx.execute({
|
|
41591
41640
|
method: "POST",
|
|
41592
41641
|
path: "/v1/customers/{customerId}/addresses",
|
|
@@ -41594,7 +41643,7 @@ Examples:
|
|
|
41594
41643
|
queryParamKeys: []
|
|
41595
41644
|
});
|
|
41596
41645
|
});
|
|
41597
|
-
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).`).addHelpText("after", `
|
|
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", `
|
|
41598
41647
|
Examples:
|
|
41599
41648
|
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId>
|
|
41600
41649
|
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId> --name <name> --line1 <line1>
|
|
@@ -41623,6 +41672,8 @@ Examples:
|
|
|
41623
41672
|
args.state = opts.state;
|
|
41624
41673
|
if (opts.country !== void 0)
|
|
41625
41674
|
args.country = opts.country;
|
|
41675
|
+
if (opts.taxId !== void 0)
|
|
41676
|
+
args.tax_id = opts.taxId;
|
|
41626
41677
|
await ctx.execute({
|
|
41627
41678
|
method: "PATCH",
|
|
41628
41679
|
path: "/v1/customers/{customerId}/addresses/{addressId}",
|
|
@@ -41805,7 +41856,7 @@ Examples:
|
|
|
41805
41856
|
queryParamKeys: []
|
|
41806
41857
|
});
|
|
41807
41858
|
});
|
|
41808
|
-
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", `
|
|
41809
41860
|
Examples:
|
|
41810
41861
|
hyperline customers-credits list-customer-credit-transactions --id <id> --product-id <productId>
|
|
41811
41862
|
hyperline customers-credits list-customer-credit-transactions --id <id> --product-id <productId> --take <take> --type <type>`).action(async (opts) => {
|
|
@@ -42931,7 +42982,7 @@ Payment method strategy used to charge the invoice. Only applies to \`to_pay\` s
|
|
|
42931
42982
|
|
|
42932
42983
|
- \`current\`: Use the current default payment method of the customer.
|
|
42933
42984
|
- \`external\`: Manage the payment of the invoice outside of Hyperline.
|
|
42934
|
-
`).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", `
|
|
42985
|
+
`).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", `
|
|
42935
42986
|
Examples:
|
|
42936
42987
|
hyperline invoices create-invoice --customer-id <customer_id> --line-items <line_items>
|
|
42937
42988
|
hyperline invoices create-invoice --customer-id <customer_id> --line-items <line_items> --currency <currency> --status <status>
|
|
@@ -42982,6 +43033,8 @@ Examples:
|
|
|
42982
43033
|
args.due_at = opts.dueAt;
|
|
42983
43034
|
if (opts.settledAt !== void 0)
|
|
42984
43035
|
args.settled_at = opts.settledAt;
|
|
43036
|
+
if (opts.issuingMethod !== void 0)
|
|
43037
|
+
args.issuing_method = opts.issuingMethod;
|
|
42985
43038
|
if (opts.properties !== void 0)
|
|
42986
43039
|
args.properties = JSON.parse(opts.properties);
|
|
42987
43040
|
if (opts.customProperties !== void 0)
|
|
@@ -43171,7 +43224,7 @@ Examples:
|
|
|
43171
43224
|
|
|
43172
43225
|
- \`auto\`: Tax is automatically computed and applied.
|
|
43173
43226
|
- \`not_eligible\`: Tax collection is disabled for the invoice.
|
|
43174
|
-
`).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", `
|
|
43227
|
+
`).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", `
|
|
43175
43228
|
Examples:
|
|
43176
43229
|
hyperline invoices update --id <id>
|
|
43177
43230
|
hyperline invoices update --id <id> --type <type> --document-name <document_name>
|
|
@@ -43200,6 +43253,10 @@ Examples:
|
|
|
43200
43253
|
args.footer = opts.footer;
|
|
43201
43254
|
if (opts.taxScheme !== void 0)
|
|
43202
43255
|
args.tax_scheme = opts.taxScheme;
|
|
43256
|
+
if (opts.issuingMethod !== void 0)
|
|
43257
|
+
args.issuing_method = opts.issuingMethod;
|
|
43258
|
+
if (opts.emittedAt !== void 0)
|
|
43259
|
+
args.emitted_at = opts.emittedAt;
|
|
43203
43260
|
if (opts.paymentMethodType !== void 0)
|
|
43204
43261
|
args.payment_method_type = opts.paymentMethodType;
|
|
43205
43262
|
if (opts.paymentMethodId !== void 0)
|
|
@@ -44091,7 +44148,7 @@ How the periodic credit allowance is granted for partial billing periods.
|
|
|
44091
44148
|
|
|
44092
44149
|
- \`prorated\` (default): the granted credits are prorated to the elapsed period.
|
|
44093
44150
|
- \`full_allowance\`: the full allowance is always granted (the invoice remains prorated).
|
|
44094
|
-
`).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", `
|
|
44151
|
+
`).option("--credits-balance-auto-creation-enabled <value>", `Default for the \`credits_balance_auto_creation_enabled\` setting of subscription products using this credit product: whether the customer credit balance is created as soon as the product is added to a subscription. \`true\` when unset. A subscription product can override it.`).option("--portal-top-up-auto-activation-enabled <value>", `Whether portal top-ups are enabled for the customer when a credit balance of this product is created for them, from a subscription or manually. Portal top-ups must also be enabled in the hosted pages settings to show on the portal. \`false\` when unset.`).option("--display-mode <value>", `How bundle items are displayed on invoices.`).option("--exclusive-items-enabled", `When true, only one item in the bundle can be active at a time.`).option("--bundle-items <json>", `Products included in this bundle. Percentages must sum to 100.`).addHelpText("after", `
|
|
44095
44152
|
Examples:
|
|
44096
44153
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations>
|
|
44097
44154
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations> --description <description> --description-display-interval-dates
|
|
@@ -44118,6 +44175,8 @@ Examples:
|
|
|
44118
44175
|
args.credits_grant_mode = opts.creditsGrantMode;
|
|
44119
44176
|
if (opts.creditsBalanceAutoCreationEnabled !== void 0)
|
|
44120
44177
|
args.credits_balance_auto_creation_enabled = opts.creditsBalanceAutoCreationEnabled;
|
|
44178
|
+
if (opts.portalTopUpAutoActivationEnabled !== void 0)
|
|
44179
|
+
args.portal_top_up_auto_activation_enabled = opts.portalTopUpAutoActivationEnabled;
|
|
44121
44180
|
if (opts.displayMode !== void 0)
|
|
44122
44181
|
args.display_mode = opts.displayMode;
|
|
44123
44182
|
if (opts.lowCreditsThreshold !== void 0)
|
|
@@ -44292,7 +44351,7 @@ Quote status.
|
|
|
44292
44351
|
- \`all\`: Display all pricing tiers.
|
|
44293
44352
|
- \`matching\`: Only display the tiers used to compute the price based on quantity.
|
|
44294
44353
|
- \`none\`: Hide all pricing tiers.
|
|
44295
|
-
`).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("--
|
|
44354
|
+
`).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", `
|
|
44296
44355
|
Examples:
|
|
44297
44356
|
hyperline quotes create --customer-id <customer_id>
|
|
44298
44357
|
hyperline quotes create --customer-id <customer_id> --status <status> --owner-email <owner_email>
|
|
@@ -44335,8 +44394,8 @@ Examples:
|
|
|
44335
44394
|
args.display_first_invoice_amount = opts.displayFirstInvoiceAmount;
|
|
44336
44395
|
if (opts.displayDocumentsInPreview !== void 0)
|
|
44337
44396
|
args.display_documents_in_preview = opts.displayDocumentsInPreview;
|
|
44338
|
-
if (opts.
|
|
44339
|
-
args.
|
|
44397
|
+
if (opts.subscriptionUpdateDisplay !== void 0)
|
|
44398
|
+
args.subscription_update_display = opts.subscriptionUpdateDisplay;
|
|
44340
44399
|
if (opts.generateDraftInvoices !== void 0)
|
|
44341
44400
|
args.generate_draft_invoices = opts.generateDraftInvoices;
|
|
44342
44401
|
if (opts.templateId !== void 0)
|
|
@@ -44584,7 +44643,7 @@ Examples:
|
|
|
44584
44643
|
- \`all\`: Display all pricing tiers.
|
|
44585
44644
|
- \`matching\`: Only display the tiers used to compute the price based on quantity.
|
|
44586
44645
|
- \`none\`: Hide all pricing tiers.
|
|
44587
|
-
`).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("--
|
|
44646
|
+
`).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", `
|
|
44588
44647
|
Examples:
|
|
44589
44648
|
hyperline quotes update --id <id>
|
|
44590
44649
|
hyperline quotes update --id <id> --owner-email <owner_email> --catalog-version-id <catalog_version_id>
|
|
@@ -44623,8 +44682,8 @@ Examples:
|
|
|
44623
44682
|
args.display_first_invoice_amount = opts.displayFirstInvoiceAmount;
|
|
44624
44683
|
if (opts.displayDocumentsInPreview !== void 0)
|
|
44625
44684
|
args.display_documents_in_preview = opts.displayDocumentsInPreview;
|
|
44626
|
-
if (opts.
|
|
44627
|
-
args.
|
|
44685
|
+
if (opts.subscriptionUpdateDisplay !== void 0)
|
|
44686
|
+
args.subscription_update_display = opts.subscriptionUpdateDisplay;
|
|
44628
44687
|
if (opts.generateDraftInvoices !== void 0)
|
|
44629
44688
|
args.generate_draft_invoices = opts.generateDraftInvoices;
|
|
44630
44689
|
if (opts.crmOpportunityId !== void 0)
|
|
@@ -44648,6 +44707,25 @@ Examples:
|
|
|
44648
44707
|
queryParamKeys: []
|
|
44649
44708
|
});
|
|
44650
44709
|
});
|
|
44710
|
+
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", `
|
|
44711
|
+
Examples:
|
|
44712
|
+
hyperline quotes duplicate --id <id>
|
|
44713
|
+
hyperline quotes duplicate --id <id> --output json`).action(async (opts) => {
|
|
44714
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
44715
|
+
if (!ctx) {
|
|
44716
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
44717
|
+
process.exit(1);
|
|
44718
|
+
}
|
|
44719
|
+
const args = {};
|
|
44720
|
+
if (opts.id !== void 0)
|
|
44721
|
+
args.id = opts.id;
|
|
44722
|
+
await ctx.execute({
|
|
44723
|
+
method: "POST",
|
|
44724
|
+
path: "/v1/quotes/{id}/duplicate",
|
|
44725
|
+
args,
|
|
44726
|
+
queryParamKeys: []
|
|
44727
|
+
});
|
|
44728
|
+
});
|
|
44651
44729
|
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", `
|
|
44652
44730
|
Examples:
|
|
44653
44731
|
hyperline quotes download --id <id>
|
|
@@ -45060,7 +45138,7 @@ Examples:
|
|
|
45060
45138
|
queryParamKeys: []
|
|
45061
45139
|
});
|
|
45062
45140
|
});
|
|
45063
|
-
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.
|
|
45141
|
+
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", `
|
|
45064
45142
|
Examples:
|
|
45065
45143
|
hyperline subscriptions pause --id <id>
|
|
45066
45144
|
hyperline subscriptions pause --id <id> --reactivate-at <reactivate_at>
|
|
@@ -45101,9 +45179,10 @@ Examples:
|
|
|
45101
45179
|
queryParamKeys: []
|
|
45102
45180
|
});
|
|
45103
45181
|
});
|
|
45104
|
-
resource.command("reactivate").description(`Resume a paused subscription,
|
|
45182
|
+
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", `
|
|
45105
45183
|
Examples:
|
|
45106
45184
|
hyperline subscriptions reactivate --id <id>
|
|
45185
|
+
hyperline subscriptions reactivate --id <id> --reactivate-at <reactivate_at> --invoicing-mode <invoicing_mode>
|
|
45107
45186
|
hyperline subscriptions reactivate --id <id> --output json`).action(async (opts) => {
|
|
45108
45187
|
const ctx = resource.parent?.opts()._ctx;
|
|
45109
45188
|
if (!ctx) {
|
|
@@ -45113,6 +45192,10 @@ Examples:
|
|
|
45113
45192
|
const args = {};
|
|
45114
45193
|
if (opts.id !== void 0)
|
|
45115
45194
|
args.id = opts.id;
|
|
45195
|
+
if (opts.reactivateAt !== void 0)
|
|
45196
|
+
args.reactivate_at = opts.reactivateAt;
|
|
45197
|
+
if (opts.invoicingMode !== void 0)
|
|
45198
|
+
args.invoicing_mode = opts.invoicingMode;
|
|
45116
45199
|
await ctx.execute({
|
|
45117
45200
|
method: "POST",
|
|
45118
45201
|
path: "/v1/subscriptions/{id}/reactivate",
|
|
@@ -46696,10 +46779,10 @@ function registerAllCommands(program2) {
|
|
|
46696
46779
|
registerAccounting_ReportsCommands(program2);
|
|
46697
46780
|
registerAccounting_Revenue_RecognitionCommands(program2);
|
|
46698
46781
|
registerAccounting_RulesCommands(program2);
|
|
46699
|
-
registerAgentsCommands(program2);
|
|
46700
46782
|
registerCustom_PropertiesCommands(program2);
|
|
46701
46783
|
registerAggregatorsCommands(program2);
|
|
46702
46784
|
registerAggregators_UsageCommands(program2);
|
|
46785
|
+
registerAi_BillingCommands(program2);
|
|
46703
46786
|
registerAnalyticsCommands(program2);
|
|
46704
46787
|
registerBank_AccountsCommands(program2);
|
|
46705
46788
|
registerCompaniesCommands(program2);
|
|
@@ -62670,12 +62753,41 @@ var DateTimeSchema = external_exports.iso.datetime({
|
|
|
62670
62753
|
example: "2024-12-20T16:04:11Z"
|
|
62671
62754
|
});
|
|
62672
62755
|
|
|
62756
|
+
// ../hyperline-lib/build/http/dto/decimal.js
|
|
62757
|
+
var DecimalStringSchema = external_exports.string().regex(/^-?\d+(\.\d+)?(e[+-]?\d+)?$/i).openapi({
|
|
62758
|
+
description: "Exact decimal string. Interpret the unit using the field description and denomination.",
|
|
62759
|
+
example: "0.0021"
|
|
62760
|
+
});
|
|
62761
|
+
var NonNegativeDecimalStringSchema = external_exports.string().regex(/^\d+(\.\d+)?$/).max(40).openapi({
|
|
62762
|
+
description: "Non-negative exact decimal string, at most 40 characters.",
|
|
62763
|
+
example: "0.0021"
|
|
62764
|
+
});
|
|
62765
|
+
|
|
62673
62766
|
// ../hyperline-lib/build/http/dto/domain.js
|
|
62674
62767
|
var DomainSchema = external_exports.string().trim().toLowerCase().regex(/^(?!:\/\/)(?=.{1,253}$)(?!-)([a-z0-9-]{1,63}\.)+[a-z]{2,63}$/, "Invalid domain").openapi({
|
|
62675
62768
|
description: "Domain name.",
|
|
62676
62769
|
example: "acme.com"
|
|
62677
62770
|
});
|
|
62678
62771
|
|
|
62772
|
+
// ../hyperline-lib/build/http/dto/emailStatus.js
|
|
62773
|
+
var EmailStatusSchema = external_exports.enum([
|
|
62774
|
+
"sent",
|
|
62775
|
+
"delivered",
|
|
62776
|
+
"opened",
|
|
62777
|
+
"clicked",
|
|
62778
|
+
"spammed",
|
|
62779
|
+
"bounced",
|
|
62780
|
+
"queued",
|
|
62781
|
+
"drafted",
|
|
62782
|
+
"attempted",
|
|
62783
|
+
"failed",
|
|
62784
|
+
"undeliverable",
|
|
62785
|
+
"converted",
|
|
62786
|
+
"suppressed",
|
|
62787
|
+
"unsubscribed",
|
|
62788
|
+
"dropped"
|
|
62789
|
+
]);
|
|
62790
|
+
|
|
62679
62791
|
// ../hyperline-lib/build/http/dto/error.js
|
|
62680
62792
|
var ErrorSchema = external_exports.object({
|
|
62681
62793
|
message: external_exports.string()
|
|
@@ -65807,6 +65919,8 @@ var usStates = [
|
|
|
65807
65919
|
|
|
65808
65920
|
// ../hyperline-lib/build/utils/dates.js
|
|
65809
65921
|
var import_shared2 = __toESM(require_shared(), 1);
|
|
65922
|
+
var PERIOD_BOUND_DRIFT_TOLERANCE_MS = 2 * 60 * 1e3;
|
|
65923
|
+
var DST_SHIFT_MS = 60 * 60 * 1e3;
|
|
65810
65924
|
|
|
65811
65925
|
// ../hyperline-lib/build/utils/document.js
|
|
65812
65926
|
var import_shared3 = __toESM(require_shared(), 1);
|
|
@@ -65818,6 +65932,11 @@ import * as https from "node:https";
|
|
|
65818
65932
|
import { createHash as createHash2 } from "node:crypto";
|
|
65819
65933
|
import { deepEqual } from "fast-equals";
|
|
65820
65934
|
|
|
65935
|
+
// ../hyperline-lib/build/utils/realignDatesToTimezone.js
|
|
65936
|
+
var import_shared4 = __toESM(require_shared(), 1);
|
|
65937
|
+
var MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1e3;
|
|
65938
|
+
var LAST_MILLISECOND_OF_DAY = MILLISECONDS_PER_DAY - 1;
|
|
65939
|
+
|
|
65821
65940
|
// ../hyperline-lib/build/utils/api/filterBuilder.js
|
|
65822
65941
|
var baseAuthorizedOperators = ["not", "isNull", "isNotNull"];
|
|
65823
65942
|
var booleanAuthorizedOperators = [
|
|
@@ -65884,7 +66003,7 @@ var isAxiosError = axios.isAxiosError;
|
|
|
65884
66003
|
|
|
65885
66004
|
// ../hyperline-lib/build/httpClient/httpClient.js
|
|
65886
66005
|
import axios2 from "axios";
|
|
65887
|
-
import axiosRetry, { isNetworkOrIdempotentRequestError } from "axios-retry";
|
|
66006
|
+
import axiosRetry, { isNetworkOrIdempotentRequestError, retryAfter } from "axios-retry";
|
|
65888
66007
|
import { AxiosError } from "axios";
|
|
65889
66008
|
var recommendedRetryConfig = {
|
|
65890
66009
|
retries: 3,
|