@hyperline/cli 0.1.0-build.1.87e076a → 0.1.0-build.1.88c5b52
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 +1354 -122
- package/package.json +1 -4
|
@@ -33833,7 +33833,7 @@ var require_shared = __commonJS({
|
|
|
33833
33833
|
getNameForCurrency: () => getNameForCurrency,
|
|
33834
33834
|
getNaturalNumber: () => getNaturalNumber,
|
|
33835
33835
|
getSymbolForCurrency: () => getSymbolForCurrency,
|
|
33836
|
-
getTimezoneByName: () =>
|
|
33836
|
+
getTimezoneByName: () => getTimezoneByName2,
|
|
33837
33837
|
getTimezoneOffsetName: () => getTimezoneOffsetName,
|
|
33838
33838
|
getTimezones: () => getTimezones2,
|
|
33839
33839
|
getValidTimezonesNames: () => getValidTimezonesNames,
|
|
@@ -33850,7 +33850,7 @@ var require_shared = __commonJS({
|
|
|
33850
33850
|
subtract: () => subtract,
|
|
33851
33851
|
sum: () => sum2,
|
|
33852
33852
|
toLocalTime: () => toLocalTime3,
|
|
33853
|
-
toUtc: () =>
|
|
33853
|
+
toUtc: () => toUtc3,
|
|
33854
33854
|
useDebounce: () => useDebounce
|
|
33855
33855
|
});
|
|
33856
33856
|
module.exports = __toCommonJS(shared_exports);
|
|
@@ -34985,10 +34985,10 @@ var require_shared = __commonJS({
|
|
|
34985
34985
|
ZodId: () => ZodId,
|
|
34986
34986
|
ZodTranslationsSchemaFn: () => ZodTranslationsSchemaFn
|
|
34987
34987
|
});
|
|
34988
|
-
var
|
|
34988
|
+
var import_zod22 = require_lib();
|
|
34989
34989
|
var countryIds2 = ["all", ...countries.map(({ id }) => id)];
|
|
34990
|
-
var ZodId =
|
|
34991
|
-
var ZodTranslationsSchemaFn = (schema) =>
|
|
34990
|
+
var ZodId = import_zod22.z.enum(countryIds2);
|
|
34991
|
+
var ZodTranslationsSchemaFn = (schema) => import_zod22.z.record(import_zod22.z.string(), schema.optional());
|
|
34992
34992
|
var UsStates = [
|
|
34993
34993
|
{ id: "AA", name: "Armed Forces Americas" },
|
|
34994
34994
|
{ id: "AE", name: "Armed Forces Europe" },
|
|
@@ -36287,14 +36287,14 @@ var require_shared = __commonJS({
|
|
|
36287
36287
|
ZodNumberCurrencyPositiveValue: () => ZodNumberCurrencyPositiveValue,
|
|
36288
36288
|
ZodNumberCurrencyPositiveValueExcludingZero: () => ZodNumberCurrencyPositiveValueExcludingZero
|
|
36289
36289
|
});
|
|
36290
|
-
var
|
|
36291
|
-
var ZodCurrencyId =
|
|
36290
|
+
var import_zod23 = require_lib();
|
|
36291
|
+
var ZodCurrencyId = import_zod23.z.enum(
|
|
36292
36292
|
all_default.map(({ id }) => id)
|
|
36293
36293
|
);
|
|
36294
|
-
var ZodNumberCurrency =
|
|
36295
|
-
var ZodNumberCurrencyPositiveValue =
|
|
36296
|
-
var ZodNumberCurrencyPositiveValueExcludingZero =
|
|
36297
|
-
var ZodCurrencyMap =
|
|
36294
|
+
var ZodNumberCurrency = import_zod23.z.string().or(import_zod23.z.number().transform((number4) => number4)).transform((number4) => number4);
|
|
36295
|
+
var ZodNumberCurrencyPositiveValue = import_zod23.z.number().min(0).transform((number4) => number4).transform((number4) => number4);
|
|
36296
|
+
var ZodNumberCurrencyPositiveValueExcludingZero = import_zod23.z.number().gt(0).transform((number4) => number4).transform((number4) => number4);
|
|
36297
|
+
var ZodCurrencyMap = import_zod23.z.record(ZodNumberCurrency).refine(
|
|
36298
36298
|
(data) => Object.keys(data).every((key) => ZodCurrencyId.safeParse(key).success),
|
|
36299
36299
|
{
|
|
36300
36300
|
message: "Invalid currency key.",
|
|
@@ -36557,14 +36557,14 @@ var require_shared = __commonJS({
|
|
|
36557
36557
|
function getTimezones2() {
|
|
36558
36558
|
return timezones;
|
|
36559
36559
|
}
|
|
36560
|
-
function
|
|
36560
|
+
function getTimezoneByName2(tz) {
|
|
36561
36561
|
var _a2;
|
|
36562
36562
|
if (tz === "UTC") {
|
|
36563
36563
|
return timezones.find(({ name }) => name === "Etc/UTC");
|
|
36564
36564
|
}
|
|
36565
36565
|
return (_a2 = timezones.find(({ name }) => name === tz)) != null ? _a2 : timezones.find(({ group }) => group.includes(tz));
|
|
36566
36566
|
}
|
|
36567
|
-
function
|
|
36567
|
+
function toUtc3(date5, timezone) {
|
|
36568
36568
|
return (0, import_date_fns_tz.fromZonedTime)(date5, timezone);
|
|
36569
36569
|
}
|
|
36570
36570
|
function toLocalTime3(date5, localTimezone) {
|
|
@@ -36575,7 +36575,7 @@ var require_shared = __commonJS({
|
|
|
36575
36575
|
);
|
|
36576
36576
|
var constructDateFromTimezoneToLocal = (date5, timezone) => {
|
|
36577
36577
|
if (!timezone) return date5;
|
|
36578
|
-
const timezoneObj =
|
|
36578
|
+
const timezoneObj = getTimezoneByName2(timezone);
|
|
36579
36579
|
if (!timezoneObj) return date5;
|
|
36580
36580
|
const dateAtTimezone = new Date(
|
|
36581
36581
|
date5.getFullYear(),
|
|
@@ -39079,17 +39079,998 @@ Examples:
|
|
|
39079
39079
|
if (opts.paymentMethodTypes !== void 0)
|
|
39080
39080
|
args.payment_method_types = JSON.parse(opts.paymentMethodTypes);
|
|
39081
39081
|
await ctx.execute({
|
|
39082
|
-
method: "POST",
|
|
39083
|
-
path: "/v1/accounting/rules",
|
|
39082
|
+
method: "POST",
|
|
39083
|
+
path: "/v1/accounting/rules",
|
|
39084
|
+
args,
|
|
39085
|
+
queryParamKeys: []
|
|
39086
|
+
});
|
|
39087
|
+
});
|
|
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 (e.g. accounting_software, invoice_posted).`).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("--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
|
+
Examples:
|
|
39090
|
+
hyperline accounting-rules update --id <id>
|
|
39091
|
+
hyperline accounting-rules update --id <id> --name <name> --category <category>
|
|
39092
|
+
hyperline accounting-rules update --id <id> --output json`).action(async (opts) => {
|
|
39093
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39094
|
+
if (!ctx) {
|
|
39095
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39096
|
+
process.exit(1);
|
|
39097
|
+
}
|
|
39098
|
+
const args = {};
|
|
39099
|
+
if (opts.id !== void 0)
|
|
39100
|
+
args.id = opts.id;
|
|
39101
|
+
if (opts.name !== void 0)
|
|
39102
|
+
args.name = opts.name;
|
|
39103
|
+
if (opts.category !== void 0)
|
|
39104
|
+
args.category = opts.category;
|
|
39105
|
+
if (opts.intervalPeriod !== void 0)
|
|
39106
|
+
args.interval_period = opts.intervalPeriod;
|
|
39107
|
+
if (opts.revenueLedgerAccountId !== void 0)
|
|
39108
|
+
args.revenue_ledger_account_id = opts.revenueLedgerAccountId;
|
|
39109
|
+
if (opts.deferredRevenueLedgerAccountId !== void 0)
|
|
39110
|
+
args.deferred_revenue_ledger_account_id = opts.deferredRevenueLedgerAccountId;
|
|
39111
|
+
if (opts.deferredDiscountLedgerAccountId !== void 0)
|
|
39112
|
+
args.deferred_discount_ledger_account_id = opts.deferredDiscountLedgerAccountId;
|
|
39113
|
+
if (opts.contraRevenueLedgerAccountId !== void 0)
|
|
39114
|
+
args.contra_revenue_ledger_account_id = opts.contraRevenueLedgerAccountId;
|
|
39115
|
+
if (opts.discountLedgerAccountId !== void 0)
|
|
39116
|
+
args.discount_ledger_account_id = opts.discountLedgerAccountId;
|
|
39117
|
+
if (opts.arLedgerAccountId !== void 0)
|
|
39118
|
+
args.ar_ledger_account_id = opts.arLedgerAccountId;
|
|
39119
|
+
if (opts.cashLedgerAccountId !== void 0)
|
|
39120
|
+
args.cash_ledger_account_id = opts.cashLedgerAccountId;
|
|
39121
|
+
if (opts.paymentsClearingLedgerAccountId !== void 0)
|
|
39122
|
+
args.payments_clearing_ledger_account_id = opts.paymentsClearingLedgerAccountId;
|
|
39123
|
+
if (opts.outputTaxLedgerAccountId !== void 0)
|
|
39124
|
+
args.output_tax_ledger_account_id = opts.outputTaxLedgerAccountId;
|
|
39125
|
+
if (opts.uncollectibleDebitLedgerAccountId !== void 0)
|
|
39126
|
+
args.uncollectible_debit_ledger_account_id = opts.uncollectibleDebitLedgerAccountId;
|
|
39127
|
+
if (opts.customerCreditsLedgerAccountId !== void 0)
|
|
39128
|
+
args.customer_credits_ledger_account_id = opts.customerCreditsLedgerAccountId;
|
|
39129
|
+
if (opts.journalId !== void 0)
|
|
39130
|
+
args.journal_id = opts.journalId;
|
|
39131
|
+
if (opts.entityType !== void 0)
|
|
39132
|
+
args.entity_type = opts.entityType;
|
|
39133
|
+
if (opts.priority !== void 0)
|
|
39134
|
+
args.priority = Number(opts.priority);
|
|
39135
|
+
if (opts.intervalCount !== void 0)
|
|
39136
|
+
args.interval_count = Number(opts.intervalCount);
|
|
39137
|
+
if (opts.productIds !== void 0)
|
|
39138
|
+
args.product_ids = JSON.parse(opts.productIds);
|
|
39139
|
+
if (opts.productTypes !== void 0)
|
|
39140
|
+
args.product_types = JSON.parse(opts.productTypes);
|
|
39141
|
+
if (opts.customerIds !== void 0)
|
|
39142
|
+
args.customer_ids = JSON.parse(opts.customerIds);
|
|
39143
|
+
if (opts.currencies !== void 0)
|
|
39144
|
+
args.currencies = JSON.parse(opts.currencies);
|
|
39145
|
+
if (opts.countries !== void 0)
|
|
39146
|
+
args.countries = JSON.parse(opts.countries);
|
|
39147
|
+
if (opts.couponIds !== void 0)
|
|
39148
|
+
args.coupon_ids = JSON.parse(opts.couponIds);
|
|
39149
|
+
if (opts.clientProviderIds !== void 0)
|
|
39150
|
+
args.client_provider_ids = JSON.parse(opts.clientProviderIds);
|
|
39151
|
+
if (opts.paymentMethodTypes !== void 0)
|
|
39152
|
+
args.payment_method_types = JSON.parse(opts.paymentMethodTypes);
|
|
39153
|
+
await ctx.execute({
|
|
39154
|
+
method: "PUT",
|
|
39155
|
+
path: "/v1/accounting/rules/{id}",
|
|
39156
|
+
args,
|
|
39157
|
+
queryParamKeys: []
|
|
39158
|
+
});
|
|
39159
|
+
});
|
|
39160
|
+
resource.command("delete").description(`Soft-delete an accounting rule.`).requiredOption("--id <value>", `id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
39161
|
+
Examples:
|
|
39162
|
+
hyperline accounting-rules delete --id <id>
|
|
39163
|
+
hyperline accounting-rules delete --id <id> --output json`).action(async (opts) => {
|
|
39164
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39165
|
+
if (!ctx) {
|
|
39166
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39167
|
+
process.exit(1);
|
|
39168
|
+
}
|
|
39169
|
+
const args = {};
|
|
39170
|
+
if (opts.id !== void 0)
|
|
39171
|
+
args.id = opts.id;
|
|
39172
|
+
if (!opts.yes) {
|
|
39173
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39174
|
+
if (!confirmed) {
|
|
39175
|
+
process.stdout.write("Aborted.\n");
|
|
39176
|
+
return;
|
|
39177
|
+
}
|
|
39178
|
+
}
|
|
39179
|
+
await ctx.execute({
|
|
39180
|
+
method: "DELETE",
|
|
39181
|
+
path: "/v1/accounting/rules/{id}",
|
|
39182
|
+
args,
|
|
39183
|
+
queryParamKeys: []
|
|
39184
|
+
});
|
|
39185
|
+
});
|
|
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", `
|
|
39187
|
+
Examples:
|
|
39188
|
+
hyperline accounting-rules resolve --ledger-id <ledger_id> --category <category>
|
|
39189
|
+
hyperline accounting-rules resolve --ledger-id <ledger_id> --category <category> --product-id <product_id> --product-type <product_type>
|
|
39190
|
+
hyperline accounting-rules resolve --ledger-id <ledger_id> --category <category> --output json`).action(async (opts) => {
|
|
39191
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39192
|
+
if (!ctx) {
|
|
39193
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39194
|
+
process.exit(1);
|
|
39195
|
+
}
|
|
39196
|
+
const args = {};
|
|
39197
|
+
if (opts.ledgerId !== void 0)
|
|
39198
|
+
args.ledger_id = opts.ledgerId;
|
|
39199
|
+
if (opts.category !== void 0)
|
|
39200
|
+
args.category = opts.category;
|
|
39201
|
+
if (opts.productId !== void 0)
|
|
39202
|
+
args.product_id = opts.productId;
|
|
39203
|
+
if (opts.productType !== void 0)
|
|
39204
|
+
args.product_type = opts.productType;
|
|
39205
|
+
if (opts.currency !== void 0)
|
|
39206
|
+
args.currency = opts.currency;
|
|
39207
|
+
if (opts.country !== void 0)
|
|
39208
|
+
args.country = opts.country;
|
|
39209
|
+
if (opts.customerId !== void 0)
|
|
39210
|
+
args.customer_id = opts.customerId;
|
|
39211
|
+
if (opts.invoiceType !== void 0)
|
|
39212
|
+
args.invoice_type = opts.invoiceType;
|
|
39213
|
+
if (opts.intervalPeriod !== void 0)
|
|
39214
|
+
args.interval_period = opts.intervalPeriod;
|
|
39215
|
+
if (opts.intervalCount !== void 0)
|
|
39216
|
+
args.interval_count = Number(opts.intervalCount);
|
|
39217
|
+
await ctx.execute({
|
|
39218
|
+
method: "POST",
|
|
39219
|
+
path: "/v1/accounting/rules/resolve",
|
|
39220
|
+
args,
|
|
39221
|
+
queryParamKeys: []
|
|
39222
|
+
});
|
|
39223
|
+
});
|
|
39224
|
+
}
|
|
39225
|
+
|
|
39226
|
+
// build/commands/generated/agents.js
|
|
39227
|
+
function registerAgentsCommands(parent) {
|
|
39228
|
+
const resource = parent.command("agents").description("Manage agents");
|
|
39229
|
+
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.
|
|
39230
|
+
|
|
39231
|
+
- wallet: Charges a monetary wallet.
|
|
39232
|
+
- credits: Consumes a credit balance.
|
|
39233
|
+
- windows: Meters weighted units against rolling allowances.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
39234
|
+
Examples:
|
|
39235
|
+
hyperline agents list-agent-plans
|
|
39236
|
+
hyperline agents list-agent-plans --mode <mode> --take <take>`).action(async (opts) => {
|
|
39237
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39238
|
+
if (!ctx) {
|
|
39239
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39240
|
+
process.exit(1);
|
|
39241
|
+
}
|
|
39242
|
+
const args = {};
|
|
39243
|
+
if (opts.mode !== void 0)
|
|
39244
|
+
args.mode = opts.mode;
|
|
39245
|
+
if (opts.take !== void 0)
|
|
39246
|
+
args.take = Number(opts.take);
|
|
39247
|
+
if (opts.skip !== void 0)
|
|
39248
|
+
args.skip = Number(opts.skip);
|
|
39249
|
+
await ctx.execute({
|
|
39250
|
+
method: "GET",
|
|
39251
|
+
path: "/v1/agents/plans",
|
|
39252
|
+
args,
|
|
39253
|
+
queryParamKeys: ["mode", "take", "skip"]
|
|
39254
|
+
});
|
|
39255
|
+
});
|
|
39256
|
+
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.
|
|
39257
|
+
|
|
39258
|
+
- refuse: Rejects the call that crosses the boundary without deducting usage.
|
|
39259
|
+
- 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.
|
|
39260
|
+
|
|
39261
|
+
- calendar_month: Settles at the end of each UTC calendar month.`).requiredOption("--mode <value>", `Billing mode.
|
|
39262
|
+
|
|
39263
|
+
- wallet: Charges a monetary wallet.
|
|
39264
|
+
- credits: Consumes a credit balance.
|
|
39265
|
+
- windows: Meters weighted units against rolling allowances.`).addHelpText("after", `
|
|
39266
|
+
Examples:
|
|
39267
|
+
hyperline agents create-agent-plan --name <name> --mode <mode>
|
|
39268
|
+
hyperline agents create-agent-plan --name <name> --mode <mode> --rate-card-id <rate_card_id> --overage-mode <overage_mode>
|
|
39269
|
+
hyperline agents create-agent-plan --name <name> --mode <mode> --output json`).action(async (opts) => {
|
|
39270
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39271
|
+
if (!ctx) {
|
|
39272
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39273
|
+
process.exit(1);
|
|
39274
|
+
}
|
|
39275
|
+
const args = {};
|
|
39276
|
+
if (opts.name !== void 0)
|
|
39277
|
+
args.name = opts.name;
|
|
39278
|
+
if (opts.rateCardId !== void 0)
|
|
39279
|
+
args.rate_card_id = opts.rateCardId;
|
|
39280
|
+
if (opts.overageMode !== void 0)
|
|
39281
|
+
args.overage_mode = opts.overageMode;
|
|
39282
|
+
if (opts.markupPercent !== void 0)
|
|
39283
|
+
args.markup_percent = opts.markupPercent;
|
|
39284
|
+
if (opts.overageMarkupPercent !== void 0)
|
|
39285
|
+
args.overage_markup_percent = opts.overageMarkupPercent;
|
|
39286
|
+
if (opts.overageRateCardId !== void 0)
|
|
39287
|
+
args.overage_rate_card_id = opts.overageRateCardId;
|
|
39288
|
+
if (opts.perSeatCredits !== void 0)
|
|
39289
|
+
args.per_seat_credits = opts.perSeatCredits;
|
|
39290
|
+
if (opts.settlementSchedule !== void 0)
|
|
39291
|
+
args.settlement_schedule = opts.settlementSchedule;
|
|
39292
|
+
if (opts.mode !== void 0)
|
|
39293
|
+
args.mode = opts.mode;
|
|
39294
|
+
if (opts.settlementIntervalMinutes !== void 0)
|
|
39295
|
+
args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
|
|
39296
|
+
if (opts.grantRolloverEnabled !== void 0)
|
|
39297
|
+
args.grant_rollover_enabled = true;
|
|
39298
|
+
if (opts.windows !== void 0)
|
|
39299
|
+
args.windows = JSON.parse(opts.windows);
|
|
39300
|
+
await ctx.execute({
|
|
39301
|
+
method: "POST",
|
|
39302
|
+
path: "/v1/agents/plans",
|
|
39303
|
+
args,
|
|
39304
|
+
queryParamKeys: []
|
|
39305
|
+
});
|
|
39306
|
+
});
|
|
39307
|
+
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", `
|
|
39308
|
+
Examples:
|
|
39309
|
+
hyperline agents get-agent-plan --plan-id <plan_id>`).action(async (opts) => {
|
|
39310
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39311
|
+
if (!ctx) {
|
|
39312
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39313
|
+
process.exit(1);
|
|
39314
|
+
}
|
|
39315
|
+
const args = {};
|
|
39316
|
+
if (opts.planId !== void 0)
|
|
39317
|
+
args.plan_id = opts.planId;
|
|
39318
|
+
await ctx.execute({
|
|
39319
|
+
method: "GET",
|
|
39320
|
+
path: "/v1/agents/plans/{plan_id}",
|
|
39321
|
+
args,
|
|
39322
|
+
queryParamKeys: []
|
|
39323
|
+
});
|
|
39324
|
+
});
|
|
39325
|
+
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.
|
|
39326
|
+
|
|
39327
|
+
- refuse: Rejects the call that crosses the boundary without deducting usage.
|
|
39328
|
+
- 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.
|
|
39329
|
+
|
|
39330
|
+
- calendar_month: Settles at the end of each UTC calendar month.`).addHelpText("after", `
|
|
39331
|
+
Examples:
|
|
39332
|
+
hyperline agents replace-agent-plan --plan-id <plan_id> --name <name>
|
|
39333
|
+
hyperline agents replace-agent-plan --plan-id <plan_id> --name <name> --rate-card-id <rate_card_id> --overage-mode <overage_mode>
|
|
39334
|
+
hyperline agents replace-agent-plan --plan-id <plan_id> --name <name> --output json`).action(async (opts) => {
|
|
39335
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39336
|
+
if (!ctx) {
|
|
39337
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39338
|
+
process.exit(1);
|
|
39339
|
+
}
|
|
39340
|
+
const args = {};
|
|
39341
|
+
if (opts.planId !== void 0)
|
|
39342
|
+
args.plan_id = opts.planId;
|
|
39343
|
+
if (opts.name !== void 0)
|
|
39344
|
+
args.name = opts.name;
|
|
39345
|
+
if (opts.rateCardId !== void 0)
|
|
39346
|
+
args.rate_card_id = opts.rateCardId;
|
|
39347
|
+
if (opts.overageMode !== void 0)
|
|
39348
|
+
args.overage_mode = opts.overageMode;
|
|
39349
|
+
if (opts.markupPercent !== void 0)
|
|
39350
|
+
args.markup_percent = opts.markupPercent;
|
|
39351
|
+
if (opts.overageMarkupPercent !== void 0)
|
|
39352
|
+
args.overage_markup_percent = opts.overageMarkupPercent;
|
|
39353
|
+
if (opts.overageRateCardId !== void 0)
|
|
39354
|
+
args.overage_rate_card_id = opts.overageRateCardId;
|
|
39355
|
+
if (opts.perSeatCredits !== void 0)
|
|
39356
|
+
args.per_seat_credits = opts.perSeatCredits;
|
|
39357
|
+
if (opts.settlementSchedule !== void 0)
|
|
39358
|
+
args.settlement_schedule = opts.settlementSchedule;
|
|
39359
|
+
if (opts.settlementIntervalMinutes !== void 0)
|
|
39360
|
+
args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
|
|
39361
|
+
if (opts.grantRolloverEnabled !== void 0)
|
|
39362
|
+
args.grant_rollover_enabled = true;
|
|
39363
|
+
if (opts.windows !== void 0)
|
|
39364
|
+
args.windows = JSON.parse(opts.windows);
|
|
39365
|
+
await ctx.execute({
|
|
39366
|
+
method: "PUT",
|
|
39367
|
+
path: "/v1/agents/plans/{plan_id}",
|
|
39368
|
+
args,
|
|
39369
|
+
queryParamKeys: []
|
|
39370
|
+
});
|
|
39371
|
+
});
|
|
39372
|
+
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", `
|
|
39373
|
+
Examples:
|
|
39374
|
+
hyperline agents delete-agent-plan --plan-id <plan_id>
|
|
39375
|
+
hyperline agents delete-agent-plan --plan-id <plan_id> --output json`).action(async (opts) => {
|
|
39376
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39377
|
+
if (!ctx) {
|
|
39378
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39379
|
+
process.exit(1);
|
|
39380
|
+
}
|
|
39381
|
+
const args = {};
|
|
39382
|
+
if (opts.planId !== void 0)
|
|
39383
|
+
args.plan_id = opts.planId;
|
|
39384
|
+
if (!opts.yes) {
|
|
39385
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39386
|
+
if (!confirmed) {
|
|
39387
|
+
process.stdout.write("Aborted.\n");
|
|
39388
|
+
return;
|
|
39389
|
+
}
|
|
39390
|
+
}
|
|
39391
|
+
await ctx.execute({
|
|
39392
|
+
method: "DELETE",
|
|
39393
|
+
path: "/v1/agents/plans/{plan_id}",
|
|
39394
|
+
args,
|
|
39395
|
+
queryParamKeys: []
|
|
39396
|
+
});
|
|
39397
|
+
});
|
|
39398
|
+
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", `
|
|
39399
|
+
Examples:
|
|
39400
|
+
hyperline agents get-agent-default-plan`).action(async (_opts) => {
|
|
39401
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39402
|
+
if (!ctx) {
|
|
39403
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39404
|
+
process.exit(1);
|
|
39405
|
+
}
|
|
39406
|
+
const args = {};
|
|
39407
|
+
await ctx.execute({
|
|
39408
|
+
method: "GET",
|
|
39409
|
+
path: "/v1/agents/default-plan",
|
|
39410
|
+
args,
|
|
39411
|
+
queryParamKeys: []
|
|
39412
|
+
});
|
|
39413
|
+
});
|
|
39414
|
+
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", `
|
|
39415
|
+
Examples:
|
|
39416
|
+
hyperline agents set-agent-default-plan --plan-id <plan_id>
|
|
39417
|
+
hyperline agents set-agent-default-plan --plan-id <plan_id> --auto-apply
|
|
39418
|
+
hyperline agents set-agent-default-plan --plan-id <plan_id> --output json`).action(async (opts) => {
|
|
39419
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39420
|
+
if (!ctx) {
|
|
39421
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39422
|
+
process.exit(1);
|
|
39423
|
+
}
|
|
39424
|
+
const args = {};
|
|
39425
|
+
if (opts.planId !== void 0)
|
|
39426
|
+
args.plan_id = opts.planId;
|
|
39427
|
+
if (opts.autoApply !== void 0)
|
|
39428
|
+
args.auto_apply = true;
|
|
39429
|
+
await ctx.execute({
|
|
39430
|
+
method: "PUT",
|
|
39431
|
+
path: "/v1/agents/default-plan",
|
|
39432
|
+
args,
|
|
39433
|
+
queryParamKeys: []
|
|
39434
|
+
});
|
|
39435
|
+
});
|
|
39436
|
+
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", `
|
|
39437
|
+
Examples:
|
|
39438
|
+
hyperline agents clear-agent-default-plan
|
|
39439
|
+
hyperline agents clear-agent-default-plan --output json`).action(async (opts) => {
|
|
39440
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39441
|
+
if (!ctx) {
|
|
39442
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39443
|
+
process.exit(1);
|
|
39444
|
+
}
|
|
39445
|
+
const args = {};
|
|
39446
|
+
if (!opts.yes) {
|
|
39447
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39448
|
+
if (!confirmed) {
|
|
39449
|
+
process.stdout.write("Aborted.\n");
|
|
39450
|
+
return;
|
|
39451
|
+
}
|
|
39452
|
+
}
|
|
39453
|
+
await ctx.execute({
|
|
39454
|
+
method: "DELETE",
|
|
39455
|
+
path: "/v1/agents/default-plan",
|
|
39456
|
+
args,
|
|
39457
|
+
queryParamKeys: []
|
|
39458
|
+
});
|
|
39459
|
+
});
|
|
39460
|
+
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.
|
|
39461
|
+
|
|
39462
|
+
- credits: Credit counts.
|
|
39463
|
+
- units: Weighted rolling-allowance units.
|
|
39464
|
+
- 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", `
|
|
39465
|
+
Examples:
|
|
39466
|
+
hyperline agents list-agent-rate-cards
|
|
39467
|
+
hyperline agents list-agent-rate-cards --denomination <denomination> --currency <currency>`).action(async (opts) => {
|
|
39468
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39469
|
+
if (!ctx) {
|
|
39470
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39471
|
+
process.exit(1);
|
|
39472
|
+
}
|
|
39473
|
+
const args = {};
|
|
39474
|
+
if (opts.denomination !== void 0)
|
|
39475
|
+
args.denomination = opts.denomination;
|
|
39476
|
+
if (opts.currency !== void 0)
|
|
39477
|
+
args.currency = opts.currency;
|
|
39478
|
+
if (opts.search !== void 0)
|
|
39479
|
+
args.search = opts.search;
|
|
39480
|
+
if (opts.take !== void 0)
|
|
39481
|
+
args.take = Number(opts.take);
|
|
39482
|
+
if (opts.skip !== void 0)
|
|
39483
|
+
args.skip = Number(opts.skip);
|
|
39484
|
+
await ctx.execute({
|
|
39485
|
+
method: "GET",
|
|
39486
|
+
path: "/v1/agents/rate-cards",
|
|
39487
|
+
args,
|
|
39488
|
+
queryParamKeys: ["denomination", "currency", "search", "take", "skip"]
|
|
39489
|
+
});
|
|
39490
|
+
});
|
|
39491
|
+
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.
|
|
39492
|
+
|
|
39493
|
+
- credits: Credit counts.
|
|
39494
|
+
- units: Weighted rolling-allowance units.
|
|
39495
|
+
- 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", `
|
|
39496
|
+
Examples:
|
|
39497
|
+
hyperline agents create-agent-rate-card --name <name> --rows <rows> --denomination <denomination>
|
|
39498
|
+
hyperline agents create-agent-rate-card --name <name> --rows <rows> --denomination <denomination> --fallback-per-usd <fallback_per_usd> --currency <currency>
|
|
39499
|
+
hyperline agents create-agent-rate-card --name <name> --rows <rows> --denomination <denomination> --output json`).action(async (opts) => {
|
|
39500
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39501
|
+
if (!ctx) {
|
|
39502
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39503
|
+
process.exit(1);
|
|
39504
|
+
}
|
|
39505
|
+
const args = {};
|
|
39506
|
+
if (opts.name !== void 0)
|
|
39507
|
+
args.name = opts.name;
|
|
39508
|
+
if (opts.fallbackPerUsd !== void 0)
|
|
39509
|
+
args.fallback_per_usd = opts.fallbackPerUsd;
|
|
39510
|
+
if (opts.denomination !== void 0)
|
|
39511
|
+
args.denomination = opts.denomination;
|
|
39512
|
+
if (opts.currency !== void 0)
|
|
39513
|
+
args.currency = opts.currency;
|
|
39514
|
+
if (opts.rows !== void 0)
|
|
39515
|
+
args.rows = JSON.parse(opts.rows);
|
|
39516
|
+
await ctx.execute({
|
|
39517
|
+
method: "POST",
|
|
39518
|
+
path: "/v1/agents/rate-cards",
|
|
39519
|
+
args,
|
|
39520
|
+
queryParamKeys: []
|
|
39521
|
+
});
|
|
39522
|
+
});
|
|
39523
|
+
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", `
|
|
39524
|
+
Examples:
|
|
39525
|
+
hyperline agents get-agent-rate-card --rate-card-id <rate_card_id>`).action(async (opts) => {
|
|
39526
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39527
|
+
if (!ctx) {
|
|
39528
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39529
|
+
process.exit(1);
|
|
39530
|
+
}
|
|
39531
|
+
const args = {};
|
|
39532
|
+
if (opts.rateCardId !== void 0)
|
|
39533
|
+
args.rate_card_id = opts.rateCardId;
|
|
39534
|
+
await ctx.execute({
|
|
39535
|
+
method: "GET",
|
|
39536
|
+
path: "/v1/agents/rate-cards/{rate_card_id}",
|
|
39537
|
+
args,
|
|
39538
|
+
queryParamKeys: []
|
|
39539
|
+
});
|
|
39540
|
+
});
|
|
39541
|
+
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", `
|
|
39542
|
+
Examples:
|
|
39543
|
+
hyperline agents replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows>
|
|
39544
|
+
hyperline agents replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows> --fallback-per-usd <fallback_per_usd>
|
|
39545
|
+
hyperline agents replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows> --output json`).action(async (opts) => {
|
|
39546
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39547
|
+
if (!ctx) {
|
|
39548
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39549
|
+
process.exit(1);
|
|
39550
|
+
}
|
|
39551
|
+
const args = {};
|
|
39552
|
+
if (opts.rateCardId !== void 0)
|
|
39553
|
+
args.rate_card_id = opts.rateCardId;
|
|
39554
|
+
if (opts.name !== void 0)
|
|
39555
|
+
args.name = opts.name;
|
|
39556
|
+
if (opts.fallbackPerUsd !== void 0)
|
|
39557
|
+
args.fallback_per_usd = opts.fallbackPerUsd;
|
|
39558
|
+
if (opts.rows !== void 0)
|
|
39559
|
+
args.rows = JSON.parse(opts.rows);
|
|
39560
|
+
await ctx.execute({
|
|
39561
|
+
method: "PUT",
|
|
39562
|
+
path: "/v1/agents/rate-cards/{rate_card_id}",
|
|
39563
|
+
args,
|
|
39564
|
+
queryParamKeys: []
|
|
39565
|
+
});
|
|
39566
|
+
});
|
|
39567
|
+
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", `
|
|
39568
|
+
Examples:
|
|
39569
|
+
hyperline agents delete-agent-rate-card --rate-card-id <rate_card_id>
|
|
39570
|
+
hyperline agents delete-agent-rate-card --rate-card-id <rate_card_id> --output json`).action(async (opts) => {
|
|
39571
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39572
|
+
if (!ctx) {
|
|
39573
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39574
|
+
process.exit(1);
|
|
39575
|
+
}
|
|
39576
|
+
const args = {};
|
|
39577
|
+
if (opts.rateCardId !== void 0)
|
|
39578
|
+
args.rate_card_id = opts.rateCardId;
|
|
39579
|
+
if (!opts.yes) {
|
|
39580
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39581
|
+
if (!confirmed) {
|
|
39582
|
+
process.stdout.write("Aborted.\n");
|
|
39583
|
+
return;
|
|
39584
|
+
}
|
|
39585
|
+
}
|
|
39586
|
+
await ctx.execute({
|
|
39587
|
+
method: "DELETE",
|
|
39588
|
+
path: "/v1/agents/rate-cards/{rate_card_id}",
|
|
39589
|
+
args,
|
|
39590
|
+
queryParamKeys: []
|
|
39591
|
+
});
|
|
39592
|
+
});
|
|
39593
|
+
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", `
|
|
39594
|
+
Examples:
|
|
39595
|
+
hyperline agents list-agent-credit-products`).action(async (_opts) => {
|
|
39596
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39597
|
+
if (!ctx) {
|
|
39598
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39599
|
+
process.exit(1);
|
|
39600
|
+
}
|
|
39601
|
+
const args = {};
|
|
39602
|
+
await ctx.execute({
|
|
39603
|
+
method: "GET",
|
|
39604
|
+
path: "/v1/agents/credit-products",
|
|
39605
|
+
args,
|
|
39606
|
+
queryParamKeys: []
|
|
39607
|
+
});
|
|
39608
|
+
});
|
|
39609
|
+
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", `
|
|
39610
|
+
Examples:
|
|
39611
|
+
hyperline agents list-agent-cost-catalog
|
|
39612
|
+
hyperline agents list-agent-cost-catalog --enabled-only <enabled_only>`).action(async (opts) => {
|
|
39613
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39614
|
+
if (!ctx) {
|
|
39615
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39616
|
+
process.exit(1);
|
|
39617
|
+
}
|
|
39618
|
+
const args = {};
|
|
39619
|
+
if (opts.enabledOnly !== void 0)
|
|
39620
|
+
args.enabled_only = opts.enabledOnly;
|
|
39621
|
+
await ctx.execute({
|
|
39622
|
+
method: "GET",
|
|
39623
|
+
path: "/v1/agents/cost-catalog",
|
|
39624
|
+
args,
|
|
39625
|
+
queryParamKeys: ["enabled_only"]
|
|
39626
|
+
});
|
|
39627
|
+
});
|
|
39628
|
+
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", `
|
|
39629
|
+
Examples:
|
|
39630
|
+
hyperline agents create-agent-cost-catalog-item --provider <provider> --item <item> --dimensions <dimensions>
|
|
39631
|
+
hyperline agents create-agent-cost-catalog-item --provider <provider> --item <item> --dimensions <dimensions> --output json`).action(async (opts) => {
|
|
39632
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39633
|
+
if (!ctx) {
|
|
39634
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39635
|
+
process.exit(1);
|
|
39636
|
+
}
|
|
39637
|
+
const args = {};
|
|
39638
|
+
if (opts.provider !== void 0)
|
|
39639
|
+
args.provider = opts.provider;
|
|
39640
|
+
if (opts.item !== void 0)
|
|
39641
|
+
args.item = opts.item;
|
|
39642
|
+
if (opts.dimensions !== void 0)
|
|
39643
|
+
args.dimensions = JSON.parse(opts.dimensions);
|
|
39644
|
+
await ctx.execute({
|
|
39645
|
+
method: "POST",
|
|
39646
|
+
path: "/v1/agents/cost-catalog/items",
|
|
39647
|
+
args,
|
|
39648
|
+
queryParamKeys: []
|
|
39649
|
+
});
|
|
39650
|
+
});
|
|
39651
|
+
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", `
|
|
39652
|
+
Examples:
|
|
39653
|
+
hyperline agents delete-agent-cost-catalog-item --item-id <item_id>
|
|
39654
|
+
hyperline agents delete-agent-cost-catalog-item --item-id <item_id> --output json`).action(async (opts) => {
|
|
39655
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39656
|
+
if (!ctx) {
|
|
39657
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39658
|
+
process.exit(1);
|
|
39659
|
+
}
|
|
39660
|
+
const args = {};
|
|
39661
|
+
if (opts.itemId !== void 0)
|
|
39662
|
+
args.item_id = opts.itemId;
|
|
39663
|
+
if (!opts.yes) {
|
|
39664
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39665
|
+
if (!confirmed) {
|
|
39666
|
+
process.stdout.write("Aborted.\n");
|
|
39667
|
+
return;
|
|
39668
|
+
}
|
|
39669
|
+
}
|
|
39670
|
+
await ctx.execute({
|
|
39671
|
+
method: "DELETE",
|
|
39672
|
+
path: "/v1/agents/cost-catalog/items/{item_id}",
|
|
39673
|
+
args,
|
|
39674
|
+
queryParamKeys: []
|
|
39675
|
+
});
|
|
39676
|
+
});
|
|
39677
|
+
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", `
|
|
39678
|
+
Examples:
|
|
39679
|
+
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>
|
|
39680
|
+
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> --cached-input-per-m-tokens <cached_input_per_m_tokens> --cache-write-per-m-tokens <cache_write_per_m_tokens>
|
|
39681
|
+
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) => {
|
|
39682
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39683
|
+
if (!ctx) {
|
|
39684
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39685
|
+
process.exit(1);
|
|
39686
|
+
}
|
|
39687
|
+
const args = {};
|
|
39688
|
+
if (opts.provider !== void 0)
|
|
39689
|
+
args.provider = opts.provider;
|
|
39690
|
+
if (opts.model !== void 0)
|
|
39691
|
+
args.model = opts.model;
|
|
39692
|
+
if (opts.inputPerMTokens !== void 0)
|
|
39693
|
+
args.input_per_m_tokens = opts.inputPerMTokens;
|
|
39694
|
+
if (opts.outputPerMTokens !== void 0)
|
|
39695
|
+
args.output_per_m_tokens = opts.outputPerMTokens;
|
|
39696
|
+
if (opts.cachedInputPerMTokens !== void 0)
|
|
39697
|
+
args.cached_input_per_m_tokens = opts.cachedInputPerMTokens;
|
|
39698
|
+
if (opts.cacheWritePerMTokens !== void 0)
|
|
39699
|
+
args.cache_write_per_m_tokens = opts.cacheWritePerMTokens;
|
|
39700
|
+
if (opts.dimensions !== void 0)
|
|
39701
|
+
args.dimensions = JSON.parse(opts.dimensions);
|
|
39702
|
+
await ctx.execute({
|
|
39703
|
+
method: "PUT",
|
|
39704
|
+
path: "/v1/agents/cost-catalog/overrides",
|
|
39705
|
+
args,
|
|
39706
|
+
queryParamKeys: []
|
|
39707
|
+
});
|
|
39708
|
+
});
|
|
39709
|
+
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", `
|
|
39710
|
+
Examples:
|
|
39711
|
+
hyperline agents delete-agent-cost-catalog-override --override-id <override_id>
|
|
39712
|
+
hyperline agents delete-agent-cost-catalog-override --override-id <override_id> --output json`).action(async (opts) => {
|
|
39713
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39714
|
+
if (!ctx) {
|
|
39715
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39716
|
+
process.exit(1);
|
|
39717
|
+
}
|
|
39718
|
+
const args = {};
|
|
39719
|
+
if (opts.overrideId !== void 0)
|
|
39720
|
+
args.override_id = opts.overrideId;
|
|
39721
|
+
if (!opts.yes) {
|
|
39722
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39723
|
+
if (!confirmed) {
|
|
39724
|
+
process.stdout.write("Aborted.\n");
|
|
39725
|
+
return;
|
|
39726
|
+
}
|
|
39727
|
+
}
|
|
39728
|
+
await ctx.execute({
|
|
39729
|
+
method: "DELETE",
|
|
39730
|
+
path: "/v1/agents/cost-catalog/overrides/{override_id}",
|
|
39731
|
+
args,
|
|
39732
|
+
queryParamKeys: []
|
|
39733
|
+
});
|
|
39734
|
+
});
|
|
39735
|
+
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", `
|
|
39736
|
+
Examples:
|
|
39737
|
+
hyperline agents list-agent-customer-policies --customer-id <customer_id>`).action(async (opts) => {
|
|
39738
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39739
|
+
if (!ctx) {
|
|
39740
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39741
|
+
process.exit(1);
|
|
39742
|
+
}
|
|
39743
|
+
const args = {};
|
|
39744
|
+
if (opts.customerId !== void 0)
|
|
39745
|
+
args.customer_id = opts.customerId;
|
|
39746
|
+
await ctx.execute({
|
|
39747
|
+
method: "GET",
|
|
39748
|
+
path: "/v1/agents/customers/{customer_id}/policies",
|
|
39749
|
+
args,
|
|
39750
|
+
queryParamKeys: []
|
|
39751
|
+
});
|
|
39752
|
+
});
|
|
39753
|
+
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", `
|
|
39754
|
+
Examples:
|
|
39755
|
+
hyperline agents get-agent-customer-policy --customer-id <customer_id>
|
|
39756
|
+
hyperline agents get-agent-customer-policy --customer-id <customer_id> --agent <agent>`).action(async (opts) => {
|
|
39757
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39758
|
+
if (!ctx) {
|
|
39759
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39760
|
+
process.exit(1);
|
|
39761
|
+
}
|
|
39762
|
+
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
|
+
await ctx.execute({
|
|
39768
|
+
method: "GET",
|
|
39769
|
+
path: "/v1/agents/customers/{customer_id}/policy",
|
|
39770
|
+
args,
|
|
39771
|
+
queryParamKeys: ["agent"]
|
|
39772
|
+
});
|
|
39773
|
+
});
|
|
39774
|
+
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.
|
|
39775
|
+
|
|
39776
|
+
- wallet: Charges a monetary wallet.
|
|
39777
|
+
- credits: Consumes a credit balance.
|
|
39778
|
+
- 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.
|
|
39779
|
+
|
|
39780
|
+
- refuse: Rejects the call that crosses the boundary without deducting usage.
|
|
39781
|
+
- 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.
|
|
39782
|
+
|
|
39783
|
+
- 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", `
|
|
39784
|
+
Examples:
|
|
39785
|
+
hyperline agents upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked
|
|
39786
|
+
hyperline agents upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked --agent <agent> --wallet-id <wallet_id>
|
|
39787
|
+
hyperline agents upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked --output json`).action(async (opts) => {
|
|
39788
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39789
|
+
if (!ctx) {
|
|
39790
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39791
|
+
process.exit(1);
|
|
39792
|
+
}
|
|
39793
|
+
const args = {};
|
|
39794
|
+
if (opts.customerId !== void 0)
|
|
39795
|
+
args.customer_id = opts.customerId;
|
|
39796
|
+
if (opts.agent !== void 0)
|
|
39797
|
+
args.agent = opts.agent;
|
|
39798
|
+
if (opts.mode !== void 0)
|
|
39799
|
+
args.mode = opts.mode;
|
|
39800
|
+
if (opts.walletId !== void 0)
|
|
39801
|
+
args.wallet_id = opts.walletId;
|
|
39802
|
+
if (opts.creditProductId !== void 0)
|
|
39803
|
+
args.credit_product_id = opts.creditProductId;
|
|
39804
|
+
if (opts.markupPercent !== void 0)
|
|
39805
|
+
args.markup_percent = opts.markupPercent;
|
|
39806
|
+
if (opts.overageMode !== void 0)
|
|
39807
|
+
args.overage_mode = opts.overageMode;
|
|
39808
|
+
if (opts.overageMarkupPercent !== void 0)
|
|
39809
|
+
args.overage_markup_percent = opts.overageMarkupPercent;
|
|
39810
|
+
if (opts.overageRateCardId !== void 0)
|
|
39811
|
+
args.overage_rate_card_id = opts.overageRateCardId;
|
|
39812
|
+
if (opts.overageWalletId !== void 0)
|
|
39813
|
+
args.overage_wallet_id = opts.overageWalletId;
|
|
39814
|
+
if (opts.floor !== void 0)
|
|
39815
|
+
args.floor = opts.floor;
|
|
39816
|
+
if (opts.settlementSchedule !== void 0)
|
|
39817
|
+
args.settlement_schedule = opts.settlementSchedule;
|
|
39818
|
+
if (opts.rateCardId !== void 0)
|
|
39819
|
+
args.rate_card_id = opts.rateCardId;
|
|
39820
|
+
if (opts.planId !== void 0)
|
|
39821
|
+
args.plan_id = opts.planId;
|
|
39822
|
+
if (opts.settlementIntervalMinutes !== void 0)
|
|
39823
|
+
args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
|
|
39824
|
+
if (opts.blocked !== void 0)
|
|
39825
|
+
args.blocked = true;
|
|
39826
|
+
if (opts.creditRates !== void 0)
|
|
39827
|
+
args.credit_rates = JSON.parse(opts.creditRates);
|
|
39828
|
+
if (opts.windowRates !== void 0)
|
|
39829
|
+
args.window_rates = JSON.parse(opts.windowRates);
|
|
39830
|
+
await ctx.execute({
|
|
39831
|
+
method: "PUT",
|
|
39832
|
+
path: "/v1/agents/customers/{customer_id}/policy",
|
|
39833
|
+
args,
|
|
39834
|
+
queryParamKeys: ["agent"]
|
|
39835
|
+
});
|
|
39836
|
+
});
|
|
39837
|
+
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", `
|
|
39838
|
+
Examples:
|
|
39839
|
+
hyperline agents delete-agent-customer-policy --customer-id <customer_id>
|
|
39840
|
+
hyperline agents delete-agent-customer-policy --customer-id <customer_id> --agent <agent>
|
|
39841
|
+
hyperline agents delete-agent-customer-policy --customer-id <customer_id> --output json`).action(async (opts) => {
|
|
39842
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39843
|
+
if (!ctx) {
|
|
39844
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39845
|
+
process.exit(1);
|
|
39846
|
+
}
|
|
39847
|
+
const args = {};
|
|
39848
|
+
if (opts.customerId !== void 0)
|
|
39849
|
+
args.customer_id = opts.customerId;
|
|
39850
|
+
if (opts.agent !== void 0)
|
|
39851
|
+
args.agent = opts.agent;
|
|
39852
|
+
if (!opts.yes) {
|
|
39853
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39854
|
+
if (!confirmed) {
|
|
39855
|
+
process.stdout.write("Aborted.\n");
|
|
39856
|
+
return;
|
|
39857
|
+
}
|
|
39858
|
+
}
|
|
39859
|
+
await ctx.execute({
|
|
39860
|
+
method: "DELETE",
|
|
39861
|
+
path: "/v1/agents/customers/{customer_id}/policy",
|
|
39862
|
+
args,
|
|
39863
|
+
queryParamKeys: ["agent"]
|
|
39864
|
+
});
|
|
39865
|
+
});
|
|
39866
|
+
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", `
|
|
39867
|
+
Examples:
|
|
39868
|
+
hyperline agents apply-agent-default-plan --customer-id <customer_id>
|
|
39869
|
+
hyperline agents apply-agent-default-plan --customer-id <customer_id> --output json`).action(async (opts) => {
|
|
39870
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39871
|
+
if (!ctx) {
|
|
39872
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39873
|
+
process.exit(1);
|
|
39874
|
+
}
|
|
39875
|
+
const args = {};
|
|
39876
|
+
if (opts.customerId !== void 0)
|
|
39877
|
+
args.customer_id = opts.customerId;
|
|
39878
|
+
await ctx.execute({
|
|
39879
|
+
method: "POST",
|
|
39880
|
+
path: "/v1/agents/customers/{customer_id}/apply-default-plan",
|
|
39881
|
+
args,
|
|
39882
|
+
queryParamKeys: []
|
|
39883
|
+
});
|
|
39884
|
+
});
|
|
39885
|
+
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", `
|
|
39886
|
+
Examples:
|
|
39887
|
+
hyperline agents get-agent-customer-balance --customer-id <customer_id>
|
|
39888
|
+
hyperline agents get-agent-customer-balance --customer-id <customer_id> --agent <agent>`).action(async (opts) => {
|
|
39889
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39890
|
+
if (!ctx) {
|
|
39891
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39892
|
+
process.exit(1);
|
|
39893
|
+
}
|
|
39894
|
+
const args = {};
|
|
39895
|
+
if (opts.customerId !== void 0)
|
|
39896
|
+
args.customer_id = opts.customerId;
|
|
39897
|
+
if (opts.agent !== void 0)
|
|
39898
|
+
args.agent = opts.agent;
|
|
39899
|
+
await ctx.execute({
|
|
39900
|
+
method: "GET",
|
|
39901
|
+
path: "/v1/agents/customers/{customer_id}/balance",
|
|
39902
|
+
args,
|
|
39903
|
+
queryParamKeys: ["agent"]
|
|
39904
|
+
});
|
|
39905
|
+
});
|
|
39906
|
+
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", `
|
|
39907
|
+
Examples:
|
|
39908
|
+
hyperline agents reset-agent-customer-windows --customer-id <customer_id>
|
|
39909
|
+
hyperline agents reset-agent-customer-windows --customer-id <customer_id> --agent <agent>
|
|
39910
|
+
hyperline agents reset-agent-customer-windows --customer-id <customer_id> --output json`).action(async (opts) => {
|
|
39911
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39912
|
+
if (!ctx) {
|
|
39913
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39914
|
+
process.exit(1);
|
|
39915
|
+
}
|
|
39916
|
+
const args = {};
|
|
39917
|
+
if (opts.customerId !== void 0)
|
|
39918
|
+
args.customer_id = opts.customerId;
|
|
39919
|
+
if (opts.agent !== void 0)
|
|
39920
|
+
args.agent = opts.agent;
|
|
39921
|
+
await ctx.execute({
|
|
39922
|
+
method: "POST",
|
|
39923
|
+
path: "/v1/agents/customers/{customer_id}/windows/reset",
|
|
39924
|
+
args,
|
|
39925
|
+
queryParamKeys: ["agent"]
|
|
39926
|
+
});
|
|
39927
|
+
});
|
|
39928
|
+
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", `
|
|
39929
|
+
Examples:
|
|
39930
|
+
hyperline agents list-agent-customer-consumption --customer-id <customer_id>
|
|
39931
|
+
hyperline agents list-agent-customer-consumption --customer-id <customer_id> --agent <agent> --overage <overage>`).action(async (opts) => {
|
|
39932
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39933
|
+
if (!ctx) {
|
|
39934
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39935
|
+
process.exit(1);
|
|
39936
|
+
}
|
|
39937
|
+
const args = {};
|
|
39938
|
+
if (opts.customerId !== void 0)
|
|
39939
|
+
args.customer_id = opts.customerId;
|
|
39940
|
+
if (opts.agent !== void 0)
|
|
39941
|
+
args.agent = opts.agent;
|
|
39942
|
+
if (opts.overage !== void 0)
|
|
39943
|
+
args.overage = opts.overage;
|
|
39944
|
+
if (opts.from !== void 0)
|
|
39945
|
+
args.from = opts.from;
|
|
39946
|
+
if (opts.to !== void 0)
|
|
39947
|
+
args.to = opts.to;
|
|
39948
|
+
if (opts.take !== void 0)
|
|
39949
|
+
args.take = Number(opts.take);
|
|
39950
|
+
if (opts.skip !== void 0)
|
|
39951
|
+
args.skip = Number(opts.skip);
|
|
39952
|
+
await ctx.execute({
|
|
39953
|
+
method: "GET",
|
|
39954
|
+
path: "/v1/agents/customers/{customer_id}/consumption",
|
|
39955
|
+
args,
|
|
39956
|
+
queryParamKeys: ["agent", "overage", "from", "to", "take", "skip"]
|
|
39957
|
+
});
|
|
39958
|
+
});
|
|
39959
|
+
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", `
|
|
39960
|
+
Examples:
|
|
39961
|
+
hyperline agents get-agent-customer-overview --customer-id <customer_id>`).action(async (opts) => {
|
|
39962
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39963
|
+
if (!ctx) {
|
|
39964
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39965
|
+
process.exit(1);
|
|
39966
|
+
}
|
|
39967
|
+
const args = {};
|
|
39968
|
+
if (opts.customerId !== void 0)
|
|
39969
|
+
args.customer_id = opts.customerId;
|
|
39970
|
+
await ctx.execute({
|
|
39971
|
+
method: "GET",
|
|
39972
|
+
path: "/v1/agents/customers/{customer_id}/overview",
|
|
39973
|
+
args,
|
|
39974
|
+
queryParamKeys: []
|
|
39975
|
+
});
|
|
39976
|
+
});
|
|
39977
|
+
}
|
|
39978
|
+
|
|
39979
|
+
// build/commands/generated/aggregators.js
|
|
39980
|
+
function registerAggregatorsCommands(parent) {
|
|
39981
|
+
const resource = parent.command("aggregators").description("Manage aggregators");
|
|
39982
|
+
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", `
|
|
39983
|
+
Examples:
|
|
39984
|
+
hyperline aggregators list
|
|
39985
|
+
hyperline aggregators list --take <take>`).action(async (opts) => {
|
|
39986
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
39987
|
+
if (!ctx) {
|
|
39988
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
39989
|
+
process.exit(1);
|
|
39990
|
+
}
|
|
39991
|
+
const args = {};
|
|
39992
|
+
if (opts.take !== void 0)
|
|
39993
|
+
args.take = Number(opts.take);
|
|
39994
|
+
if (opts.skip !== void 0)
|
|
39995
|
+
args.skip = Number(opts.skip);
|
|
39996
|
+
await ctx.execute({
|
|
39997
|
+
method: "GET",
|
|
39998
|
+
path: "/v1/aggregators",
|
|
39999
|
+
args,
|
|
40000
|
+
queryParamKeys: ["take", "skip"]
|
|
40001
|
+
});
|
|
40002
|
+
});
|
|
40003
|
+
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", `
|
|
40004
|
+
Examples:
|
|
40005
|
+
hyperline aggregators create --entity <entity> --operation <operation>
|
|
40006
|
+
hyperline aggregators create --entity <entity> --operation <operation> --type <type> --where <where>
|
|
40007
|
+
hyperline aggregators create --entity <entity> --operation <operation> --output json`).action(async (opts) => {
|
|
40008
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40009
|
+
if (!ctx) {
|
|
40010
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40011
|
+
process.exit(1);
|
|
40012
|
+
}
|
|
40013
|
+
const args = {};
|
|
40014
|
+
if (opts.entity !== void 0)
|
|
40015
|
+
args.entity = opts.entity;
|
|
40016
|
+
if (opts.type !== void 0)
|
|
40017
|
+
args.type = opts.type;
|
|
40018
|
+
if (opts.name !== void 0)
|
|
40019
|
+
args.name = opts.name;
|
|
40020
|
+
if (opts.description !== void 0)
|
|
40021
|
+
args.description = opts.description;
|
|
40022
|
+
if (opts.customEventName !== void 0)
|
|
40023
|
+
args.custom_event_name = opts.customEventName;
|
|
40024
|
+
if (opts.unitName !== void 0)
|
|
40025
|
+
args.unit_name = opts.unitName;
|
|
40026
|
+
if (opts.defaultIntervalPeriod !== void 0)
|
|
40027
|
+
args.default_interval_period = opts.defaultIntervalPeriod;
|
|
40028
|
+
if (opts.operation !== void 0)
|
|
40029
|
+
args.operation = opts.operation;
|
|
40030
|
+
if (opts.property !== void 0)
|
|
40031
|
+
args.property = opts.property;
|
|
40032
|
+
if (opts.defaultIntervalCount !== void 0)
|
|
40033
|
+
args.default_interval_count = Number(opts.defaultIntervalCount);
|
|
40034
|
+
if (opts.allowNegativeValues !== void 0)
|
|
40035
|
+
args.allow_negative_values = true;
|
|
40036
|
+
if (opts.aggregateOnCustomersEnabled !== void 0)
|
|
40037
|
+
args.aggregate_on_customers_enabled = true;
|
|
40038
|
+
if (opts.where !== void 0)
|
|
40039
|
+
args.where = JSON.parse(opts.where);
|
|
40040
|
+
if (opts.exposedEventKeys !== void 0)
|
|
40041
|
+
args.exposed_event_keys = JSON.parse(opts.exposedEventKeys);
|
|
40042
|
+
if (opts.thresholds !== void 0)
|
|
40043
|
+
args.thresholds = JSON.parse(opts.thresholds);
|
|
40044
|
+
await ctx.execute({
|
|
40045
|
+
method: "POST",
|
|
40046
|
+
path: "/v1/aggregators",
|
|
40047
|
+
args,
|
|
40048
|
+
queryParamKeys: []
|
|
40049
|
+
});
|
|
40050
|
+
});
|
|
40051
|
+
resource.command("get").description(`Retrieve a specific aggregator by ID.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
|
|
40052
|
+
Examples:
|
|
40053
|
+
hyperline aggregators get --id <id>`).action(async (opts) => {
|
|
40054
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40055
|
+
if (!ctx) {
|
|
40056
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40057
|
+
process.exit(1);
|
|
40058
|
+
}
|
|
40059
|
+
const args = {};
|
|
40060
|
+
if (opts.id !== void 0)
|
|
40061
|
+
args.id = opts.id;
|
|
40062
|
+
await ctx.execute({
|
|
40063
|
+
method: "GET",
|
|
40064
|
+
path: "/v1/aggregators/{id}",
|
|
39084
40065
|
args,
|
|
39085
40066
|
queryParamKeys: []
|
|
39086
40067
|
});
|
|
39087
40068
|
});
|
|
39088
|
-
resource.command("update").description(`Update an existing
|
|
40069
|
+
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", `
|
|
39089
40070
|
Examples:
|
|
39090
|
-
hyperline
|
|
39091
|
-
hyperline
|
|
39092
|
-
hyperline
|
|
40071
|
+
hyperline aggregators update --id <id>
|
|
40072
|
+
hyperline aggregators update --id <id> --entity <entity> --type <type>
|
|
40073
|
+
hyperline aggregators update --id <id> --output json`).action(async (opts) => {
|
|
39093
40074
|
const ctx = resource.parent?.opts()._ctx;
|
|
39094
40075
|
if (!ctx) {
|
|
39095
40076
|
process.stderr.write("Error: Not authenticated\n");
|
|
@@ -39098,69 +40079,47 @@ Examples:
|
|
|
39098
40079
|
const args = {};
|
|
39099
40080
|
if (opts.id !== void 0)
|
|
39100
40081
|
args.id = opts.id;
|
|
40082
|
+
if (opts.entity !== void 0)
|
|
40083
|
+
args.entity = opts.entity;
|
|
40084
|
+
if (opts.type !== void 0)
|
|
40085
|
+
args.type = opts.type;
|
|
39101
40086
|
if (opts.name !== void 0)
|
|
39102
40087
|
args.name = opts.name;
|
|
39103
|
-
if (opts.
|
|
39104
|
-
args.
|
|
39105
|
-
if (opts.
|
|
39106
|
-
args.
|
|
39107
|
-
if (opts.
|
|
39108
|
-
args.
|
|
39109
|
-
if (opts.
|
|
39110
|
-
args.
|
|
39111
|
-
if (opts.
|
|
39112
|
-
args.
|
|
39113
|
-
if (opts.
|
|
39114
|
-
args.
|
|
39115
|
-
if (opts.
|
|
39116
|
-
args.
|
|
39117
|
-
if (opts.
|
|
39118
|
-
args.
|
|
39119
|
-
if (opts.
|
|
39120
|
-
args.
|
|
39121
|
-
if (opts.
|
|
39122
|
-
args.
|
|
39123
|
-
if (opts.
|
|
39124
|
-
args.
|
|
39125
|
-
if (opts.
|
|
39126
|
-
args.
|
|
39127
|
-
if (opts.customerCreditsLedgerAccountId !== void 0)
|
|
39128
|
-
args.customer_credits_ledger_account_id = opts.customerCreditsLedgerAccountId;
|
|
39129
|
-
if (opts.journalId !== void 0)
|
|
39130
|
-
args.journal_id = opts.journalId;
|
|
39131
|
-
if (opts.entityType !== void 0)
|
|
39132
|
-
args.entity_type = opts.entityType;
|
|
39133
|
-
if (opts.priority !== void 0)
|
|
39134
|
-
args.priority = Number(opts.priority);
|
|
39135
|
-
if (opts.intervalCount !== void 0)
|
|
39136
|
-
args.interval_count = Number(opts.intervalCount);
|
|
39137
|
-
if (opts.productIds !== void 0)
|
|
39138
|
-
args.product_ids = JSON.parse(opts.productIds);
|
|
39139
|
-
if (opts.productTypes !== void 0)
|
|
39140
|
-
args.product_types = JSON.parse(opts.productTypes);
|
|
39141
|
-
if (opts.customerIds !== void 0)
|
|
39142
|
-
args.customer_ids = JSON.parse(opts.customerIds);
|
|
39143
|
-
if (opts.currencies !== void 0)
|
|
39144
|
-
args.currencies = JSON.parse(opts.currencies);
|
|
39145
|
-
if (opts.countries !== void 0)
|
|
39146
|
-
args.countries = JSON.parse(opts.countries);
|
|
39147
|
-
if (opts.couponIds !== void 0)
|
|
39148
|
-
args.coupon_ids = JSON.parse(opts.couponIds);
|
|
39149
|
-
if (opts.clientProviderIds !== void 0)
|
|
39150
|
-
args.client_provider_ids = JSON.parse(opts.clientProviderIds);
|
|
39151
|
-
if (opts.paymentMethodTypes !== void 0)
|
|
39152
|
-
args.payment_method_types = JSON.parse(opts.paymentMethodTypes);
|
|
40088
|
+
if (opts.description !== void 0)
|
|
40089
|
+
args.description = opts.description;
|
|
40090
|
+
if (opts.customEventName !== void 0)
|
|
40091
|
+
args.custom_event_name = opts.customEventName;
|
|
40092
|
+
if (opts.unitName !== void 0)
|
|
40093
|
+
args.unit_name = opts.unitName;
|
|
40094
|
+
if (opts.defaultIntervalPeriod !== void 0)
|
|
40095
|
+
args.default_interval_period = opts.defaultIntervalPeriod;
|
|
40096
|
+
if (opts.operation !== void 0)
|
|
40097
|
+
args.operation = opts.operation;
|
|
40098
|
+
if (opts.property !== void 0)
|
|
40099
|
+
args.property = opts.property;
|
|
40100
|
+
if (opts.defaultIntervalCount !== void 0)
|
|
40101
|
+
args.default_interval_count = Number(opts.defaultIntervalCount);
|
|
40102
|
+
if (opts.allowNegativeValues !== void 0)
|
|
40103
|
+
args.allow_negative_values = true;
|
|
40104
|
+
if (opts.aggregateOnCustomersEnabled !== void 0)
|
|
40105
|
+
args.aggregate_on_customers_enabled = true;
|
|
40106
|
+
if (opts.where !== void 0)
|
|
40107
|
+
args.where = JSON.parse(opts.where);
|
|
40108
|
+
if (opts.exposedEventKeys !== void 0)
|
|
40109
|
+
args.exposed_event_keys = JSON.parse(opts.exposedEventKeys);
|
|
40110
|
+
if (opts.thresholds !== void 0)
|
|
40111
|
+
args.thresholds = JSON.parse(opts.thresholds);
|
|
39153
40112
|
await ctx.execute({
|
|
39154
40113
|
method: "PUT",
|
|
39155
|
-
path: "/v1/
|
|
40114
|
+
path: "/v1/aggregators/{id}",
|
|
39156
40115
|
args,
|
|
39157
40116
|
queryParamKeys: []
|
|
39158
40117
|
});
|
|
39159
40118
|
});
|
|
39160
|
-
resource.command("delete").description(`
|
|
40119
|
+
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", `
|
|
39161
40120
|
Examples:
|
|
39162
|
-
hyperline
|
|
39163
|
-
hyperline
|
|
40121
|
+
hyperline aggregators delete --id <id>
|
|
40122
|
+
hyperline aggregators delete --id <id> --output json`).action(async (opts) => {
|
|
39164
40123
|
const ctx = resource.parent?.opts()._ctx;
|
|
39165
40124
|
if (!ctx) {
|
|
39166
40125
|
process.stderr.write("Error: Not authenticated\n");
|
|
@@ -39178,49 +40137,136 @@ Examples:
|
|
|
39178
40137
|
}
|
|
39179
40138
|
await ctx.execute({
|
|
39180
40139
|
method: "DELETE",
|
|
39181
|
-
path: "/v1/
|
|
40140
|
+
path: "/v1/aggregators/{id}",
|
|
39182
40141
|
args,
|
|
39183
40142
|
queryParamKeys: []
|
|
39184
40143
|
});
|
|
39185
40144
|
});
|
|
39186
|
-
|
|
40145
|
+
}
|
|
40146
|
+
|
|
40147
|
+
// build/commands/generated/aggregators-usage.js
|
|
40148
|
+
function registerAggregators_UsageCommands(parent) {
|
|
40149
|
+
const resource = parent.command("aggregators-usage").description("Manage aggregators > usage");
|
|
40150
|
+
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", `
|
|
39187
40151
|
Examples:
|
|
39188
|
-
hyperline
|
|
39189
|
-
hyperline accounting-rules resolve --ledger-id <ledger_id> --category <category> --product-id <product_id> --product-type <product_type>
|
|
39190
|
-
hyperline accounting-rules resolve --ledger-id <ledger_id> --category <category> --output json`).action(async (opts) => {
|
|
40152
|
+
hyperline aggregators-usage get-aggregator-usage --id <id>`).action(async (opts) => {
|
|
39191
40153
|
const ctx = resource.parent?.opts()._ctx;
|
|
39192
40154
|
if (!ctx) {
|
|
39193
40155
|
process.stderr.write("Error: Not authenticated\n");
|
|
39194
40156
|
process.exit(1);
|
|
39195
40157
|
}
|
|
39196
40158
|
const args = {};
|
|
39197
|
-
if (opts.
|
|
39198
|
-
args.
|
|
39199
|
-
if (opts.category !== void 0)
|
|
39200
|
-
args.category = opts.category;
|
|
39201
|
-
if (opts.productId !== void 0)
|
|
39202
|
-
args.product_id = opts.productId;
|
|
39203
|
-
if (opts.productType !== void 0)
|
|
39204
|
-
args.product_type = opts.productType;
|
|
39205
|
-
if (opts.currency !== void 0)
|
|
39206
|
-
args.currency = opts.currency;
|
|
39207
|
-
if (opts.country !== void 0)
|
|
39208
|
-
args.country = opts.country;
|
|
39209
|
-
if (opts.customerId !== void 0)
|
|
39210
|
-
args.customer_id = opts.customerId;
|
|
39211
|
-
if (opts.invoiceType !== void 0)
|
|
39212
|
-
args.invoice_type = opts.invoiceType;
|
|
39213
|
-
if (opts.intervalPeriod !== void 0)
|
|
39214
|
-
args.interval_period = opts.intervalPeriod;
|
|
39215
|
-
if (opts.intervalCount !== void 0)
|
|
39216
|
-
args.interval_count = Number(opts.intervalCount);
|
|
40159
|
+
if (opts.id !== void 0)
|
|
40160
|
+
args.id = opts.id;
|
|
39217
40161
|
await ctx.execute({
|
|
39218
|
-
method: "
|
|
39219
|
-
path: "/v1/
|
|
40162
|
+
method: "GET",
|
|
40163
|
+
path: "/v1/aggregators/{id}/usage",
|
|
39220
40164
|
args,
|
|
39221
40165
|
queryParamKeys: []
|
|
39222
40166
|
});
|
|
39223
40167
|
});
|
|
40168
|
+
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", `
|
|
40169
|
+
Examples:
|
|
40170
|
+
hyperline aggregators-usage get-aggregator-usage-timeseries --id <id>
|
|
40171
|
+
hyperline aggregators-usage get-aggregator-usage-timeseries --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
40172
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40173
|
+
if (!ctx) {
|
|
40174
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40175
|
+
process.exit(1);
|
|
40176
|
+
}
|
|
40177
|
+
const args = {};
|
|
40178
|
+
if (opts.id !== void 0)
|
|
40179
|
+
args.id = opts.id;
|
|
40180
|
+
if (opts.startDate !== void 0)
|
|
40181
|
+
args.start_date = opts.startDate;
|
|
40182
|
+
if (opts.endDate !== void 0)
|
|
40183
|
+
args.end_date = opts.endDate;
|
|
40184
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
40185
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
40186
|
+
if (opts.groupBy !== void 0)
|
|
40187
|
+
args.group_by = opts.groupBy;
|
|
40188
|
+
await ctx.execute({
|
|
40189
|
+
method: "GET",
|
|
40190
|
+
path: "/v1/aggregators/{id}/usage/timeseries",
|
|
40191
|
+
args,
|
|
40192
|
+
queryParamKeys: [
|
|
40193
|
+
"start_date",
|
|
40194
|
+
"end_date",
|
|
40195
|
+
"aggregator_filter_id",
|
|
40196
|
+
"group_by"
|
|
40197
|
+
]
|
|
40198
|
+
});
|
|
40199
|
+
});
|
|
40200
|
+
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", `
|
|
40201
|
+
Examples:
|
|
40202
|
+
hyperline aggregators-usage get-aggregator-usage-group-by-customer --id <id>
|
|
40203
|
+
hyperline aggregators-usage get-aggregator-usage-group-by-customer --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
40204
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40205
|
+
if (!ctx) {
|
|
40206
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40207
|
+
process.exit(1);
|
|
40208
|
+
}
|
|
40209
|
+
const args = {};
|
|
40210
|
+
if (opts.id !== void 0)
|
|
40211
|
+
args.id = opts.id;
|
|
40212
|
+
if (opts.startDate !== void 0)
|
|
40213
|
+
args.start_date = opts.startDate;
|
|
40214
|
+
if (opts.endDate !== void 0)
|
|
40215
|
+
args.end_date = opts.endDate;
|
|
40216
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
40217
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
40218
|
+
if (opts.take !== void 0)
|
|
40219
|
+
args.take = Number(opts.take);
|
|
40220
|
+
if (opts.skip !== void 0)
|
|
40221
|
+
args.skip = Number(opts.skip);
|
|
40222
|
+
await ctx.execute({
|
|
40223
|
+
method: "GET",
|
|
40224
|
+
path: "/v1/aggregators/{id}/usage/group-by-customer",
|
|
40225
|
+
args,
|
|
40226
|
+
queryParamKeys: [
|
|
40227
|
+
"start_date",
|
|
40228
|
+
"end_date",
|
|
40229
|
+
"aggregator_filter_id",
|
|
40230
|
+
"take",
|
|
40231
|
+
"skip"
|
|
40232
|
+
]
|
|
40233
|
+
});
|
|
40234
|
+
});
|
|
40235
|
+
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", `
|
|
40236
|
+
Examples:
|
|
40237
|
+
hyperline aggregators-usage get-aggregator-usage-events --id <id>
|
|
40238
|
+
hyperline aggregators-usage get-aggregator-usage-events --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
40239
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40240
|
+
if (!ctx) {
|
|
40241
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40242
|
+
process.exit(1);
|
|
40243
|
+
}
|
|
40244
|
+
const args = {};
|
|
40245
|
+
if (opts.id !== void 0)
|
|
40246
|
+
args.id = opts.id;
|
|
40247
|
+
if (opts.startDate !== void 0)
|
|
40248
|
+
args.start_date = opts.startDate;
|
|
40249
|
+
if (opts.endDate !== void 0)
|
|
40250
|
+
args.end_date = opts.endDate;
|
|
40251
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
40252
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
40253
|
+
if (opts.take !== void 0)
|
|
40254
|
+
args.take = Number(opts.take);
|
|
40255
|
+
if (opts.skip !== void 0)
|
|
40256
|
+
args.skip = Number(opts.skip);
|
|
40257
|
+
await ctx.execute({
|
|
40258
|
+
method: "GET",
|
|
40259
|
+
path: "/v1/aggregators/{id}/usage/events",
|
|
40260
|
+
args,
|
|
40261
|
+
queryParamKeys: [
|
|
40262
|
+
"start_date",
|
|
40263
|
+
"end_date",
|
|
40264
|
+
"aggregator_filter_id",
|
|
40265
|
+
"take",
|
|
40266
|
+
"skip"
|
|
40267
|
+
]
|
|
40268
|
+
});
|
|
40269
|
+
});
|
|
39224
40270
|
}
|
|
39225
40271
|
|
|
39226
40272
|
// build/commands/generated/analytics.js
|
|
@@ -39382,7 +40428,7 @@ Examples:
|
|
|
39382
40428
|
queryParamKeys: ["take", "skip"]
|
|
39383
40429
|
});
|
|
39384
40430
|
});
|
|
39385
|
-
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", `
|
|
40431
|
+
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", `
|
|
39386
40432
|
Examples:
|
|
39387
40433
|
hyperline coupons create --name <name> --type <type>
|
|
39388
40434
|
hyperline coupons create --name <name> --type <type> --description <description> --expiration-date <expiration_date>
|
|
@@ -39415,6 +40461,8 @@ Examples:
|
|
|
39415
40461
|
args.product_ids = JSON.parse(opts.productIds);
|
|
39416
40462
|
if (opts.duration !== void 0)
|
|
39417
40463
|
args.duration = JSON.parse(opts.duration);
|
|
40464
|
+
if (opts.properties !== void 0)
|
|
40465
|
+
args.properties = JSON.parse(opts.properties);
|
|
39418
40466
|
await ctx.execute({
|
|
39419
40467
|
method: "POST",
|
|
39420
40468
|
path: "/v1/coupons",
|
|
@@ -39440,7 +40488,7 @@ Examples:
|
|
|
39440
40488
|
queryParamKeys: []
|
|
39441
40489
|
});
|
|
39442
40490
|
});
|
|
39443
|
-
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", `
|
|
40491
|
+
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", `
|
|
39444
40492
|
Examples:
|
|
39445
40493
|
hyperline coupons update --id <id> --name <name> --type <type>
|
|
39446
40494
|
hyperline coupons update --id <id> --name <name> --type <type> --description <description> --expiration-date <expiration_date>
|
|
@@ -39475,6 +40523,8 @@ Examples:
|
|
|
39475
40523
|
args.product_ids = JSON.parse(opts.productIds);
|
|
39476
40524
|
if (opts.duration !== void 0)
|
|
39477
40525
|
args.duration = JSON.parse(opts.duration);
|
|
40526
|
+
if (opts.properties !== void 0)
|
|
40527
|
+
args.properties = JSON.parse(opts.properties);
|
|
39478
40528
|
await ctx.execute({
|
|
39479
40529
|
method: "PUT",
|
|
39480
40530
|
path: "/v1/coupons/{id}",
|
|
@@ -39706,7 +40756,7 @@ Examples:
|
|
|
39706
40756
|
queryParamKeys: []
|
|
39707
40757
|
});
|
|
39708
40758
|
});
|
|
39709
|
-
resource.command("create-custom-property").description(`Create a new custom property definition with a name, type (
|
|
40759
|
+
resource.command("create-custom-property").description(`Create a new custom property definition with a name, type (text, number, boolean, date, select, multi_select), and optional default value.`).requiredOption("--name <value>", `name`).requiredOption("--type <value>", `type`).requiredOption("--slug <value>", `slug`).requiredOption("--entities <json>", `entities`).option("--api-only", `api_only`).option("--required", `required`).option("--authorized-values <json>", `authorized_values`).option("--default-value <json>", `Value set on entities created without an explicit value for this custom property. On existing entities without a value, it also satisfies \`required\`. Must match the custom property type, and one of \`authorized_values\` for \`select\` and \`multi_select\` types. Dates are ISO 8601 strings. Null means no default value.`).addHelpText("after", `
|
|
39710
40760
|
Examples:
|
|
39711
40761
|
hyperline custom-properties create-custom-property --name <name> --type <type> --slug <slug> --entities <entities>
|
|
39712
40762
|
hyperline custom-properties create-custom-property --name <name> --type <type> --slug <slug> --entities <entities> --api-only --required
|
|
@@ -39731,6 +40781,8 @@ Examples:
|
|
|
39731
40781
|
args.entities = JSON.parse(opts.entities);
|
|
39732
40782
|
if (opts.authorizedValues !== void 0)
|
|
39733
40783
|
args.authorized_values = JSON.parse(opts.authorizedValues);
|
|
40784
|
+
if (opts.defaultValue !== void 0)
|
|
40785
|
+
args.default_value = JSON.parse(opts.defaultValue);
|
|
39734
40786
|
await ctx.execute({
|
|
39735
40787
|
method: "POST",
|
|
39736
40788
|
path: "/v1/custom-properties",
|
|
@@ -39738,7 +40790,7 @@ Examples:
|
|
|
39738
40790
|
queryParamKeys: []
|
|
39739
40791
|
});
|
|
39740
40792
|
});
|
|
39741
|
-
resource.command("update-custom-property").description(`Update an existing custom property definition by ID.`).requiredOption("--id <value>", `id parameter`).requiredOption("--name <value>", `name`).requiredOption("--type <value>", `type`).requiredOption("--slug <value>", `slug`).requiredOption("--entities <json>", `entities`).option("--api-only", `api_only`).option("--required", `required`).option("--authorized-values <json>", `authorized_values`).addHelpText("after", `
|
|
40793
|
+
resource.command("update-custom-property").description(`Update an existing custom property definition by ID.`).requiredOption("--id <value>", `id parameter`).requiredOption("--name <value>", `name`).requiredOption("--type <value>", `type`).requiredOption("--slug <value>", `slug`).requiredOption("--entities <json>", `entities`).option("--api-only", `api_only`).option("--required", `required`).option("--authorized-values <json>", `authorized_values`).option("--default-value <json>", `Value set on entities created without an explicit value for this custom property. On existing entities without a value, it also satisfies \`required\`. Must match the custom property type, and one of \`authorized_values\` for \`select\` and \`multi_select\` types. Dates are ISO 8601 strings. Null means no default value.`).addHelpText("after", `
|
|
39742
40794
|
Examples:
|
|
39743
40795
|
hyperline custom-properties update-custom-property --id <id> --name <name> --type <type> --slug <slug> --entities <entities>
|
|
39744
40796
|
hyperline custom-properties update-custom-property --id <id> --name <name> --type <type> --slug <slug> --entities <entities> --api-only --required
|
|
@@ -39765,6 +40817,8 @@ Examples:
|
|
|
39765
40817
|
args.entities = JSON.parse(opts.entities);
|
|
39766
40818
|
if (opts.authorizedValues !== void 0)
|
|
39767
40819
|
args.authorized_values = JSON.parse(opts.authorizedValues);
|
|
40820
|
+
if (opts.defaultValue !== void 0)
|
|
40821
|
+
args.default_value = JSON.parse(opts.defaultValue);
|
|
39768
40822
|
await ctx.execute({
|
|
39769
40823
|
method: "PUT",
|
|
39770
40824
|
path: "/v1/custom-properties/{id}",
|
|
@@ -40122,7 +41176,7 @@ Customer type.
|
|
|
40122
41176
|
|
|
40123
41177
|
- \`taxable\`: Taxes are automatically determined for the customer.
|
|
40124
41178
|
- \`exempt\`: The customer is exempt from tax.
|
|
40125
|
-
`).option("--registration-number <value>", `Customer registration number.`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
41179
|
+
`).option("--registration-number <value>", `Customer registration number.`).option("--einvoicing-code <value>", `Customer electronic invoicing code, used to route their e-invoices to the relevant platform (e.g. Chorus Pro routing code or Peppol identifier).`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
40126
41180
|
How customer invoices are issued from the parent organisation.
|
|
40127
41181
|
|
|
40128
41182
|
- \`none\`: Invoices will keep being issued from this customer.
|
|
@@ -40151,6 +41205,8 @@ Examples:
|
|
|
40151
41205
|
args.taxability = opts.taxability;
|
|
40152
41206
|
if (opts.registrationNumber !== void 0)
|
|
40153
41207
|
args.registration_number = opts.registrationNumber;
|
|
41208
|
+
if (opts.einvoicingCode !== void 0)
|
|
41209
|
+
args.einvoicing_code = opts.einvoicingCode;
|
|
40154
41210
|
if (opts.externalId !== void 0)
|
|
40155
41211
|
args.external_id = opts.externalId;
|
|
40156
41212
|
if (opts.domain !== void 0)
|
|
@@ -40257,7 +41313,7 @@ Customer type.
|
|
|
40257
41313
|
|
|
40258
41314
|
- \`taxable\`: Taxes are automatically determined for the customer.
|
|
40259
41315
|
- \`exempt\`: The customer is exempt from tax.
|
|
40260
|
-
`).option("--registration-number <value>", `Customer registration number.`).option("--is-government-affiliated", `Indicates if the customer is affiliated with a government entity.`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--payment-method-id <value>", `ID of the default payment method of the customer. Only applies to card and direct debit.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
41316
|
+
`).option("--registration-number <value>", `Customer registration number.`).option("--is-government-affiliated", `Indicates if the customer is affiliated with a government entity.`).option("--einvoicing-code <value>", `Customer electronic invoicing code, used to route their e-invoices to the relevant platform (e.g. Chorus Pro routing code or Peppol identifier).`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--payment-method-id <value>", `ID of the default payment method of the customer. Only applies to card and direct debit.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
40261
41317
|
How customer invoices are issued from the parent organisation.
|
|
40262
41318
|
|
|
40263
41319
|
- \`none\`: Invoices will keep being issued from this customer.
|
|
@@ -40288,6 +41344,8 @@ Examples:
|
|
|
40288
41344
|
args.taxability = opts.taxability;
|
|
40289
41345
|
if (opts.registrationNumber !== void 0)
|
|
40290
41346
|
args.registration_number = opts.registrationNumber;
|
|
41347
|
+
if (opts.einvoicingCode !== void 0)
|
|
41348
|
+
args.einvoicing_code = opts.einvoicingCode;
|
|
40291
41349
|
if (opts.externalId !== void 0)
|
|
40292
41350
|
args.external_id = opts.externalId;
|
|
40293
41351
|
if (opts.domain !== void 0)
|
|
@@ -40541,7 +41599,7 @@ Examples:
|
|
|
40541
41599
|
queryParamKeys: []
|
|
40542
41600
|
});
|
|
40543
41601
|
});
|
|
40544
|
-
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).`).
|
|
41602
|
+
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", `
|
|
40545
41603
|
Examples:
|
|
40546
41604
|
hyperline customers-address create-customer-address --customer-id <customerId> --type <type>
|
|
40547
41605
|
hyperline customers-address create-customer-address --customer-id <customerId> --type <type> --name <name> --line1 <line1>
|
|
@@ -40554,6 +41612,8 @@ Examples:
|
|
|
40554
41612
|
const args = {};
|
|
40555
41613
|
if (opts.customerId !== void 0)
|
|
40556
41614
|
args.customerId = opts.customerId;
|
|
41615
|
+
if (opts.type !== void 0)
|
|
41616
|
+
args.type = opts.type;
|
|
40557
41617
|
if (opts.name !== void 0)
|
|
40558
41618
|
args.name = opts.name;
|
|
40559
41619
|
if (opts.line1 !== void 0)
|
|
@@ -40568,8 +41628,8 @@ Examples:
|
|
|
40568
41628
|
args.state = opts.state;
|
|
40569
41629
|
if (opts.country !== void 0)
|
|
40570
41630
|
args.country = opts.country;
|
|
40571
|
-
if (opts.
|
|
40572
|
-
args.
|
|
41631
|
+
if (opts.taxId !== void 0)
|
|
41632
|
+
args.tax_id = opts.taxId;
|
|
40573
41633
|
await ctx.execute({
|
|
40574
41634
|
method: "POST",
|
|
40575
41635
|
path: "/v1/customers/{customerId}/addresses",
|
|
@@ -40577,7 +41637,7 @@ Examples:
|
|
|
40577
41637
|
queryParamKeys: []
|
|
40578
41638
|
});
|
|
40579
41639
|
});
|
|
40580
|
-
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", `
|
|
41640
|
+
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", `
|
|
40581
41641
|
Examples:
|
|
40582
41642
|
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId>
|
|
40583
41643
|
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId> --name <name> --line1 <line1>
|
|
@@ -40606,6 +41666,8 @@ Examples:
|
|
|
40606
41666
|
args.state = opts.state;
|
|
40607
41667
|
if (opts.country !== void 0)
|
|
40608
41668
|
args.country = opts.country;
|
|
41669
|
+
if (opts.taxId !== void 0)
|
|
41670
|
+
args.tax_id = opts.taxId;
|
|
40609
41671
|
await ctx.execute({
|
|
40610
41672
|
method: "PATCH",
|
|
40611
41673
|
path: "/v1/customers/{customerId}/addresses/{addressId}",
|
|
@@ -40788,7 +41850,7 @@ Examples:
|
|
|
40788
41850
|
queryParamKeys: []
|
|
40789
41851
|
});
|
|
40790
41852
|
});
|
|
40791
|
-
resource.command("list-customer-credit-transactions").description(`List all transactions (
|
|
41853
|
+
resource.command("list-customer-credit-transactions").description(`List all transactions (topups, usages, expirations) for a specific credit product. Paginated with take/skip and optional filters.`).requiredOption("--id <value>", `id parameter`).requiredOption("--product-id <value>", `productId parameter`).option("--take <number>", `take`).option("--skip <number>", `skip`).option("--type <value>", `type`).option("--invoice-id <value>", `invoice_id`).option("--created-at <value>", `created_at`).addHelpText("after", `
|
|
40792
41854
|
Examples:
|
|
40793
41855
|
hyperline customers-credits list-customer-credit-transactions --id <id> --product-id <productId>
|
|
40794
41856
|
hyperline customers-credits list-customer-credit-transactions --id <id> --product-id <productId> --take <take> --type <type>`).action(async (opts) => {
|
|
@@ -41181,6 +42243,130 @@ Examples:
|
|
|
41181
42243
|
});
|
|
41182
42244
|
}
|
|
41183
42245
|
|
|
42246
|
+
// build/commands/generated/customers-usage.js
|
|
42247
|
+
function registerCustomers_UsageCommands(parent) {
|
|
42248
|
+
const resource = parent.command("customers-usage").description("Manage customers > usage");
|
|
42249
|
+
resource.command("list-customer-usage").description(`List one usage row per aggregator for a single customer over a period (total + event count per aggregator).`).requiredOption("--id <value>", `id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).addHelpText("after", `
|
|
42250
|
+
Examples:
|
|
42251
|
+
hyperline customers-usage list-customer-usage --id <id>
|
|
42252
|
+
hyperline customers-usage list-customer-usage --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42253
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42254
|
+
if (!ctx) {
|
|
42255
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42256
|
+
process.exit(1);
|
|
42257
|
+
}
|
|
42258
|
+
const args = {};
|
|
42259
|
+
if (opts.id !== void 0)
|
|
42260
|
+
args.id = opts.id;
|
|
42261
|
+
if (opts.startDate !== void 0)
|
|
42262
|
+
args.start_date = opts.startDate;
|
|
42263
|
+
if (opts.endDate !== void 0)
|
|
42264
|
+
args.end_date = opts.endDate;
|
|
42265
|
+
await ctx.execute({
|
|
42266
|
+
method: "GET",
|
|
42267
|
+
path: "/v1/customers/{id}/usage",
|
|
42268
|
+
args,
|
|
42269
|
+
queryParamKeys: ["start_date", "end_date"]
|
|
42270
|
+
});
|
|
42271
|
+
});
|
|
42272
|
+
resource.command("get-customer-usage").description(`Get the usage of a customer for a specific aggregator over a period.`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).addHelpText("after", `
|
|
42273
|
+
Examples:
|
|
42274
|
+
hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id>
|
|
42275
|
+
hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42276
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42277
|
+
if (!ctx) {
|
|
42278
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42279
|
+
process.exit(1);
|
|
42280
|
+
}
|
|
42281
|
+
const args = {};
|
|
42282
|
+
if (opts.id !== void 0)
|
|
42283
|
+
args.id = opts.id;
|
|
42284
|
+
if (opts.aggregatorId !== void 0)
|
|
42285
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42286
|
+
if (opts.startDate !== void 0)
|
|
42287
|
+
args.start_date = opts.startDate;
|
|
42288
|
+
if (opts.endDate !== void 0)
|
|
42289
|
+
args.end_date = opts.endDate;
|
|
42290
|
+
await ctx.execute({
|
|
42291
|
+
method: "GET",
|
|
42292
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}",
|
|
42293
|
+
args,
|
|
42294
|
+
queryParamKeys: ["start_date", "end_date"]
|
|
42295
|
+
});
|
|
42296
|
+
});
|
|
42297
|
+
resource.command("get-customer-usage-timeseries").description(`Get per-bucket usage for a customer + aggregator (month/day/hour).`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--group-by <value>", `Bucket size for the timeseries.`).addHelpText("after", `
|
|
42298
|
+
Examples:
|
|
42299
|
+
hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id>
|
|
42300
|
+
hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42301
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42302
|
+
if (!ctx) {
|
|
42303
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42304
|
+
process.exit(1);
|
|
42305
|
+
}
|
|
42306
|
+
const args = {};
|
|
42307
|
+
if (opts.id !== void 0)
|
|
42308
|
+
args.id = opts.id;
|
|
42309
|
+
if (opts.aggregatorId !== void 0)
|
|
42310
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42311
|
+
if (opts.startDate !== void 0)
|
|
42312
|
+
args.start_date = opts.startDate;
|
|
42313
|
+
if (opts.endDate !== void 0)
|
|
42314
|
+
args.end_date = opts.endDate;
|
|
42315
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
42316
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
42317
|
+
if (opts.groupBy !== void 0)
|
|
42318
|
+
args.group_by = opts.groupBy;
|
|
42319
|
+
await ctx.execute({
|
|
42320
|
+
method: "GET",
|
|
42321
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}/timeseries",
|
|
42322
|
+
args,
|
|
42323
|
+
queryParamKeys: [
|
|
42324
|
+
"start_date",
|
|
42325
|
+
"end_date",
|
|
42326
|
+
"aggregator_filter_id",
|
|
42327
|
+
"group_by"
|
|
42328
|
+
]
|
|
42329
|
+
});
|
|
42330
|
+
});
|
|
42331
|
+
resource.command("get-customer-usage-events").description(`List raw billable events for a customer + aggregator over a period. Paginated with take/skip.`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
42332
|
+
Examples:
|
|
42333
|
+
hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id>
|
|
42334
|
+
hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42335
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42336
|
+
if (!ctx) {
|
|
42337
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42338
|
+
process.exit(1);
|
|
42339
|
+
}
|
|
42340
|
+
const args = {};
|
|
42341
|
+
if (opts.id !== void 0)
|
|
42342
|
+
args.id = opts.id;
|
|
42343
|
+
if (opts.aggregatorId !== void 0)
|
|
42344
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42345
|
+
if (opts.startDate !== void 0)
|
|
42346
|
+
args.start_date = opts.startDate;
|
|
42347
|
+
if (opts.endDate !== void 0)
|
|
42348
|
+
args.end_date = opts.endDate;
|
|
42349
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
42350
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
42351
|
+
if (opts.take !== void 0)
|
|
42352
|
+
args.take = Number(opts.take);
|
|
42353
|
+
if (opts.skip !== void 0)
|
|
42354
|
+
args.skip = Number(opts.skip);
|
|
42355
|
+
await ctx.execute({
|
|
42356
|
+
method: "GET",
|
|
42357
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}/events",
|
|
42358
|
+
args,
|
|
42359
|
+
queryParamKeys: [
|
|
42360
|
+
"start_date",
|
|
42361
|
+
"end_date",
|
|
42362
|
+
"aggregator_filter_id",
|
|
42363
|
+
"take",
|
|
42364
|
+
"skip"
|
|
42365
|
+
]
|
|
42366
|
+
});
|
|
42367
|
+
});
|
|
42368
|
+
}
|
|
42369
|
+
|
|
41184
42370
|
// build/commands/generated/exports.js
|
|
41185
42371
|
function registerExportsCommands(parent) {
|
|
41186
42372
|
const resource = parent.command("exports").description("Manage exports");
|
|
@@ -42950,7 +44136,7 @@ How the periodic credit allowance is granted for partial billing periods.
|
|
|
42950
44136
|
|
|
42951
44137
|
- \`prorated\` (default): the granted credits are prorated to the elapsed period.
|
|
42952
44138
|
- \`full_allowance\`: the full allowance is always granted (the invoice remains prorated).
|
|
42953
|
-
`).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", `
|
|
44139
|
+
`).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", `
|
|
42954
44140
|
Examples:
|
|
42955
44141
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations>
|
|
42956
44142
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations> --description <description> --description-display-interval-dates
|
|
@@ -42975,6 +44161,8 @@ Examples:
|
|
|
42975
44161
|
args.unit_name = opts.unitName;
|
|
42976
44162
|
if (opts.creditsGrantMode !== void 0)
|
|
42977
44163
|
args.credits_grant_mode = opts.creditsGrantMode;
|
|
44164
|
+
if (opts.creditsBalanceAutoCreationEnabled !== void 0)
|
|
44165
|
+
args.credits_balance_auto_creation_enabled = opts.creditsBalanceAutoCreationEnabled;
|
|
42978
44166
|
if (opts.displayMode !== void 0)
|
|
42979
44167
|
args.display_mode = opts.displayMode;
|
|
42980
44168
|
if (opts.lowCreditsThreshold !== void 0)
|
|
@@ -43149,7 +44337,7 @@ Quote status.
|
|
|
43149
44337
|
- \`all\`: Display all pricing tiers.
|
|
43150
44338
|
- \`matching\`: Only display the tiers used to compute the price based on quantity.
|
|
43151
44339
|
- \`none\`: Hide all pricing tiers.
|
|
43152
|
-
`).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("--
|
|
44340
|
+
`).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", `
|
|
43153
44341
|
Examples:
|
|
43154
44342
|
hyperline quotes create --customer-id <customer_id>
|
|
43155
44343
|
hyperline quotes create --customer-id <customer_id> --status <status> --owner-email <owner_email>
|
|
@@ -43192,8 +44380,8 @@ Examples:
|
|
|
43192
44380
|
args.display_first_invoice_amount = opts.displayFirstInvoiceAmount;
|
|
43193
44381
|
if (opts.displayDocumentsInPreview !== void 0)
|
|
43194
44382
|
args.display_documents_in_preview = opts.displayDocumentsInPreview;
|
|
43195
|
-
if (opts.
|
|
43196
|
-
args.
|
|
44383
|
+
if (opts.subscriptionUpdateDisplay !== void 0)
|
|
44384
|
+
args.subscription_update_display = opts.subscriptionUpdateDisplay;
|
|
43197
44385
|
if (opts.generateDraftInvoices !== void 0)
|
|
43198
44386
|
args.generate_draft_invoices = opts.generateDraftInvoices;
|
|
43199
44387
|
if (opts.templateId !== void 0)
|
|
@@ -43441,7 +44629,7 @@ Examples:
|
|
|
43441
44629
|
- \`all\`: Display all pricing tiers.
|
|
43442
44630
|
- \`matching\`: Only display the tiers used to compute the price based on quantity.
|
|
43443
44631
|
- \`none\`: Hide all pricing tiers.
|
|
43444
|
-
`).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("--
|
|
44632
|
+
`).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", `
|
|
43445
44633
|
Examples:
|
|
43446
44634
|
hyperline quotes update --id <id>
|
|
43447
44635
|
hyperline quotes update --id <id> --owner-email <owner_email> --catalog-version-id <catalog_version_id>
|
|
@@ -43480,8 +44668,8 @@ Examples:
|
|
|
43480
44668
|
args.display_first_invoice_amount = opts.displayFirstInvoiceAmount;
|
|
43481
44669
|
if (opts.displayDocumentsInPreview !== void 0)
|
|
43482
44670
|
args.display_documents_in_preview = opts.displayDocumentsInPreview;
|
|
43483
|
-
if (opts.
|
|
43484
|
-
args.
|
|
44671
|
+
if (opts.subscriptionUpdateDisplay !== void 0)
|
|
44672
|
+
args.subscription_update_display = opts.subscriptionUpdateDisplay;
|
|
43485
44673
|
if (opts.generateDraftInvoices !== void 0)
|
|
43486
44674
|
args.generate_draft_invoices = opts.generateDraftInvoices;
|
|
43487
44675
|
if (opts.crmOpportunityId !== void 0)
|
|
@@ -44041,7 +45229,7 @@ Strategy used to activate the subscription.
|
|
|
44041
45229
|
- \`manually\`: The subscription requires activation through a manual action.
|
|
44042
45230
|
- \`checkout\`: The subscription will be activated once the checkout is completed, but only if the start date is in the past. Otherwise, activation will occur later on the specified start date.
|
|
44043
45231
|
- \`quote\`: The subscription will be activated depending on the configuration and the signature of the related quote.
|
|
44044
|
-
`).option("--products <json>", `Products that make up the subscription.`).option("--coupons <json>", `coupons`).option("--name <value>", `Subscription custom name.`).option("--purchase-order <value>", `Reference to the purchase order.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity attached to the subscription. If not defined, fallback to customer's invoicing entity.`).option("--crm-opportunity-id <value>", `ID of the related opportunity/deal in the connected CRM.`).option("--minimum-invoice-fee <number>", `Minimum fee applied to each invoice outside of one time payments.`).option("--contract-terms <json>", `Contract terms linked to the subscription.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancellation-strategy <value>", `
|
|
45232
|
+
`).option("--products <json>", `Products that make up the subscription.`).option("--coupons <json>", `coupons`).option("--name <value>", `Subscription custom name.`).option("--purchase-order <value>", `Reference to the purchase order.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity attached to the subscription. If not defined, fallback to customer's invoicing entity.`).option("--crm-opportunity-id <value>", `ID of the related opportunity/deal in the connected CRM.`).option("--minimum-invoice-fee <number>", `Minimum fee applied to each invoice outside of one time payments.`).option("--contract-terms <json>", `Contract terms linked to the subscription.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--shipping-address-id <value>", `Active shipping address ID belonging to the subscription customer. Omit to use the customer shipping destination: billing address or default shipping address.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancellation-strategy <value>", `
|
|
44045
45233
|
Strategy used to cancel the subscription. If not specified \`do_nothing\` is used.
|
|
44046
45234
|
|
|
44047
45235
|
- \`charge_prorata\`: Will charge the customer the unpaid amount for the prorated period up to the end of the current period.
|
|
@@ -44093,6 +45281,8 @@ Examples:
|
|
|
44093
45281
|
args.starts_at = opts.startsAt;
|
|
44094
45282
|
if (opts.initialBillingAt !== void 0)
|
|
44095
45283
|
args.initial_billing_at = opts.initialBillingAt;
|
|
45284
|
+
if (opts.shippingAddressId !== void 0)
|
|
45285
|
+
args.shipping_address_id = opts.shippingAddressId;
|
|
44096
45286
|
if (opts.displayShippingDetails !== void 0)
|
|
44097
45287
|
args.display_shipping_details = opts.displayShippingDetails;
|
|
44098
45288
|
if (opts.cancelAt !== void 0)
|
|
@@ -44403,7 +45593,7 @@ Defines when invoices are generated relative to the billing period.
|
|
|
44403
45593
|
|
|
44404
45594
|
- \`period_start\`: Invoices are generated at the start of the billing period.
|
|
44405
45595
|
- \`period_end\`: Invoices are generated at the end of the billing period.
|
|
44406
|
-
`).option("--estimated-arr <number>", `Estimated Annual Recurring Revenue generated by the subscription.`).option("--contract-value <number>", `Contract value of the subscription. This value is overridable by the user.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `A list of key value with the slug of the custom property as the key and the custom property value as value.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--phases <json>", `Array of subscription phases. Existing pending phases will be replaced by the ones in the array.`).option("--contract-terms <json>", `Contract terms to update.`).addHelpText("after", `
|
|
45596
|
+
`).option("--estimated-arr <number>", `Estimated Annual Recurring Revenue generated by the subscription.`).option("--contract-value <number>", `Contract value of the subscription. This value is overridable by the user.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `A list of key value with the slug of the custom property as the key and the custom property value as value.`).option("--shipping-address-id <value>", `Active shipping address ID belonging to the subscription customer. Null uses the customer shipping destination: billing address or default shipping address.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--phases <json>", `Array of subscription phases. Existing pending phases will be replaced by the ones in the array.`).option("--contract-terms <json>", `Contract terms to update.`).addHelpText("after", `
|
|
44407
45597
|
Examples:
|
|
44408
45598
|
hyperline subscriptions update --id <id>
|
|
44409
45599
|
hyperline subscriptions update --id <id> --name <name> --purchase-order <purchase_order>
|
|
@@ -44444,6 +45634,8 @@ Examples:
|
|
|
44444
45634
|
args.initial_billing_at = opts.initialBillingAt;
|
|
44445
45635
|
if (opts.cancelAt !== void 0)
|
|
44446
45636
|
args.cancel_at = opts.cancelAt;
|
|
45637
|
+
if (opts.shippingAddressId !== void 0)
|
|
45638
|
+
args.shipping_address_id = opts.shippingAddressId;
|
|
44447
45639
|
if (opts.displayShippingDetails !== void 0)
|
|
44448
45640
|
args.display_shipping_details = opts.displayShippingDetails;
|
|
44449
45641
|
if (opts.minimumInvoiceFee !== void 0)
|
|
@@ -45549,7 +46741,10 @@ function registerAllCommands(program2) {
|
|
|
45549
46741
|
registerAccounting_ReportsCommands(program2);
|
|
45550
46742
|
registerAccounting_Revenue_RecognitionCommands(program2);
|
|
45551
46743
|
registerAccounting_RulesCommands(program2);
|
|
46744
|
+
registerAgentsCommands(program2);
|
|
45552
46745
|
registerCustom_PropertiesCommands(program2);
|
|
46746
|
+
registerAggregatorsCommands(program2);
|
|
46747
|
+
registerAggregators_UsageCommands(program2);
|
|
45553
46748
|
registerAnalyticsCommands(program2);
|
|
45554
46749
|
registerBank_AccountsCommands(program2);
|
|
45555
46750
|
registerCompaniesCommands(program2);
|
|
@@ -45560,6 +46755,7 @@ function registerAllCommands(program2) {
|
|
|
45560
46755
|
registerCustomers_AddressCommands(program2);
|
|
45561
46756
|
registerCustomers_ShippingCommands(program2);
|
|
45562
46757
|
registerCustomersCommands(program2);
|
|
46758
|
+
registerCustomers_UsageCommands(program2);
|
|
45563
46759
|
registerOrganisationsCommands(program2);
|
|
45564
46760
|
registerCustomers_SegmentsCommands(program2);
|
|
45565
46761
|
registerExportsCommands(program2);
|
|
@@ -61519,12 +62715,41 @@ var DateTimeSchema = external_exports.iso.datetime({
|
|
|
61519
62715
|
example: "2024-12-20T16:04:11Z"
|
|
61520
62716
|
});
|
|
61521
62717
|
|
|
62718
|
+
// ../hyperline-lib/build/http/dto/decimal.js
|
|
62719
|
+
var DecimalStringSchema = external_exports.string().regex(/^-?\d+(\.\d+)?(e[+-]?\d+)?$/i).openapi({
|
|
62720
|
+
description: "Exact decimal string. Interpret the unit using the field description and denomination.",
|
|
62721
|
+
example: "0.0021"
|
|
62722
|
+
});
|
|
62723
|
+
var NonNegativeDecimalStringSchema = external_exports.string().regex(/^\d+(\.\d+)?$/).max(40).openapi({
|
|
62724
|
+
description: "Non-negative exact decimal string, at most 40 characters.",
|
|
62725
|
+
example: "0.0021"
|
|
62726
|
+
});
|
|
62727
|
+
|
|
61522
62728
|
// ../hyperline-lib/build/http/dto/domain.js
|
|
61523
62729
|
var DomainSchema = external_exports.string().trim().toLowerCase().regex(/^(?!:\/\/)(?=.{1,253}$)(?!-)([a-z0-9-]{1,63}\.)+[a-z]{2,63}$/, "Invalid domain").openapi({
|
|
61524
62730
|
description: "Domain name.",
|
|
61525
62731
|
example: "acme.com"
|
|
61526
62732
|
});
|
|
61527
62733
|
|
|
62734
|
+
// ../hyperline-lib/build/http/dto/emailStatus.js
|
|
62735
|
+
var EmailStatusSchema = external_exports.enum([
|
|
62736
|
+
"sent",
|
|
62737
|
+
"delivered",
|
|
62738
|
+
"opened",
|
|
62739
|
+
"clicked",
|
|
62740
|
+
"spammed",
|
|
62741
|
+
"bounced",
|
|
62742
|
+
"queued",
|
|
62743
|
+
"drafted",
|
|
62744
|
+
"attempted",
|
|
62745
|
+
"failed",
|
|
62746
|
+
"undeliverable",
|
|
62747
|
+
"converted",
|
|
62748
|
+
"suppressed",
|
|
62749
|
+
"unsubscribed",
|
|
62750
|
+
"dropped"
|
|
62751
|
+
]);
|
|
62752
|
+
|
|
61528
62753
|
// ../hyperline-lib/build/http/dto/error.js
|
|
61529
62754
|
var ErrorSchema = external_exports.object({
|
|
61530
62755
|
message: external_exports.string()
|
|
@@ -64656,6 +65881,8 @@ var usStates = [
|
|
|
64656
65881
|
|
|
64657
65882
|
// ../hyperline-lib/build/utils/dates.js
|
|
64658
65883
|
var import_shared2 = __toESM(require_shared(), 1);
|
|
65884
|
+
var PERIOD_BOUND_DRIFT_TOLERANCE_MS = 2 * 60 * 1e3;
|
|
65885
|
+
var DST_SHIFT_MS = 60 * 60 * 1e3;
|
|
64659
65886
|
|
|
64660
65887
|
// ../hyperline-lib/build/utils/document.js
|
|
64661
65888
|
var import_shared3 = __toESM(require_shared(), 1);
|
|
@@ -64667,6 +65894,11 @@ import * as https from "node:https";
|
|
|
64667
65894
|
import { createHash as createHash2 } from "node:crypto";
|
|
64668
65895
|
import { deepEqual } from "fast-equals";
|
|
64669
65896
|
|
|
65897
|
+
// ../hyperline-lib/build/utils/realignDatesToTimezone.js
|
|
65898
|
+
var import_shared4 = __toESM(require_shared(), 1);
|
|
65899
|
+
var MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1e3;
|
|
65900
|
+
var LAST_MILLISECOND_OF_DAY = MILLISECONDS_PER_DAY - 1;
|
|
65901
|
+
|
|
64670
65902
|
// ../hyperline-lib/build/utils/api/filterBuilder.js
|
|
64671
65903
|
var baseAuthorizedOperators = ["not", "isNull", "isNotNull"];
|
|
64672
65904
|
var booleanAuthorizedOperators = [
|
|
@@ -64733,7 +65965,7 @@ var isAxiosError = axios.isAxiosError;
|
|
|
64733
65965
|
|
|
64734
65966
|
// ../hyperline-lib/build/httpClient/httpClient.js
|
|
64735
65967
|
import axios2 from "axios";
|
|
64736
|
-
import axiosRetry, { isNetworkOrIdempotentRequestError } from "axios-retry";
|
|
65968
|
+
import axiosRetry, { isNetworkOrIdempotentRequestError, retryAfter } from "axios-retry";
|
|
64737
65969
|
import { AxiosError } from "axios";
|
|
64738
65970
|
var recommendedRetryConfig = {
|
|
64739
65971
|
retries: 3,
|