@hyperline/cli 0.1.0-build.1.fcdc056 → 0.1.0-build.1.fd30faa
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 +1325 -110
- package/package.json +1 -4
|
@@ -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.",
|
|
@@ -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}",
|
|
@@ -40122,7 +41172,7 @@ Customer type.
|
|
|
40122
41172
|
|
|
40123
41173
|
- \`taxable\`: Taxes are automatically determined for the customer.
|
|
40124
41174
|
- \`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>", `
|
|
41175
|
+
`).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
41176
|
How customer invoices are issued from the parent organisation.
|
|
40127
41177
|
|
|
40128
41178
|
- \`none\`: Invoices will keep being issued from this customer.
|
|
@@ -40151,6 +41201,8 @@ Examples:
|
|
|
40151
41201
|
args.taxability = opts.taxability;
|
|
40152
41202
|
if (opts.registrationNumber !== void 0)
|
|
40153
41203
|
args.registration_number = opts.registrationNumber;
|
|
41204
|
+
if (opts.einvoicingCode !== void 0)
|
|
41205
|
+
args.einvoicing_code = opts.einvoicingCode;
|
|
40154
41206
|
if (opts.externalId !== void 0)
|
|
40155
41207
|
args.external_id = opts.externalId;
|
|
40156
41208
|
if (opts.domain !== void 0)
|
|
@@ -40257,7 +41309,7 @@ Customer type.
|
|
|
40257
41309
|
|
|
40258
41310
|
- \`taxable\`: Taxes are automatically determined for the customer.
|
|
40259
41311
|
- \`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>", `
|
|
41312
|
+
`).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
41313
|
How customer invoices are issued from the parent organisation.
|
|
40262
41314
|
|
|
40263
41315
|
- \`none\`: Invoices will keep being issued from this customer.
|
|
@@ -40288,6 +41340,8 @@ Examples:
|
|
|
40288
41340
|
args.taxability = opts.taxability;
|
|
40289
41341
|
if (opts.registrationNumber !== void 0)
|
|
40290
41342
|
args.registration_number = opts.registrationNumber;
|
|
41343
|
+
if (opts.einvoicingCode !== void 0)
|
|
41344
|
+
args.einvoicing_code = opts.einvoicingCode;
|
|
40291
41345
|
if (opts.externalId !== void 0)
|
|
40292
41346
|
args.external_id = opts.externalId;
|
|
40293
41347
|
if (opts.domain !== void 0)
|
|
@@ -40541,7 +41595,7 @@ Examples:
|
|
|
40541
41595
|
queryParamKeys: []
|
|
40542
41596
|
});
|
|
40543
41597
|
});
|
|
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).`).
|
|
41598
|
+
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
41599
|
Examples:
|
|
40546
41600
|
hyperline customers-address create-customer-address --customer-id <customerId> --type <type>
|
|
40547
41601
|
hyperline customers-address create-customer-address --customer-id <customerId> --type <type> --name <name> --line1 <line1>
|
|
@@ -40554,6 +41608,8 @@ Examples:
|
|
|
40554
41608
|
const args = {};
|
|
40555
41609
|
if (opts.customerId !== void 0)
|
|
40556
41610
|
args.customerId = opts.customerId;
|
|
41611
|
+
if (opts.type !== void 0)
|
|
41612
|
+
args.type = opts.type;
|
|
40557
41613
|
if (opts.name !== void 0)
|
|
40558
41614
|
args.name = opts.name;
|
|
40559
41615
|
if (opts.line1 !== void 0)
|
|
@@ -40568,8 +41624,8 @@ Examples:
|
|
|
40568
41624
|
args.state = opts.state;
|
|
40569
41625
|
if (opts.country !== void 0)
|
|
40570
41626
|
args.country = opts.country;
|
|
40571
|
-
if (opts.
|
|
40572
|
-
args.
|
|
41627
|
+
if (opts.taxId !== void 0)
|
|
41628
|
+
args.tax_id = opts.taxId;
|
|
40573
41629
|
await ctx.execute({
|
|
40574
41630
|
method: "POST",
|
|
40575
41631
|
path: "/v1/customers/{customerId}/addresses",
|
|
@@ -40577,7 +41633,7 @@ Examples:
|
|
|
40577
41633
|
queryParamKeys: []
|
|
40578
41634
|
});
|
|
40579
41635
|
});
|
|
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", `
|
|
41636
|
+
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
41637
|
Examples:
|
|
40582
41638
|
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId>
|
|
40583
41639
|
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId> --name <name> --line1 <line1>
|
|
@@ -40606,6 +41662,8 @@ Examples:
|
|
|
40606
41662
|
args.state = opts.state;
|
|
40607
41663
|
if (opts.country !== void 0)
|
|
40608
41664
|
args.country = opts.country;
|
|
41665
|
+
if (opts.taxId !== void 0)
|
|
41666
|
+
args.tax_id = opts.taxId;
|
|
40609
41667
|
await ctx.execute({
|
|
40610
41668
|
method: "PATCH",
|
|
40611
41669
|
path: "/v1/customers/{customerId}/addresses/{addressId}",
|
|
@@ -41181,6 +42239,130 @@ Examples:
|
|
|
41181
42239
|
});
|
|
41182
42240
|
}
|
|
41183
42241
|
|
|
42242
|
+
// build/commands/generated/customers-usage.js
|
|
42243
|
+
function registerCustomers_UsageCommands(parent) {
|
|
42244
|
+
const resource = parent.command("customers-usage").description("Manage customers > usage");
|
|
42245
|
+
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", `
|
|
42246
|
+
Examples:
|
|
42247
|
+
hyperline customers-usage list-customer-usage --id <id>
|
|
42248
|
+
hyperline customers-usage list-customer-usage --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42249
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42250
|
+
if (!ctx) {
|
|
42251
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42252
|
+
process.exit(1);
|
|
42253
|
+
}
|
|
42254
|
+
const args = {};
|
|
42255
|
+
if (opts.id !== void 0)
|
|
42256
|
+
args.id = opts.id;
|
|
42257
|
+
if (opts.startDate !== void 0)
|
|
42258
|
+
args.start_date = opts.startDate;
|
|
42259
|
+
if (opts.endDate !== void 0)
|
|
42260
|
+
args.end_date = opts.endDate;
|
|
42261
|
+
await ctx.execute({
|
|
42262
|
+
method: "GET",
|
|
42263
|
+
path: "/v1/customers/{id}/usage",
|
|
42264
|
+
args,
|
|
42265
|
+
queryParamKeys: ["start_date", "end_date"]
|
|
42266
|
+
});
|
|
42267
|
+
});
|
|
42268
|
+
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", `
|
|
42269
|
+
Examples:
|
|
42270
|
+
hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id>
|
|
42271
|
+
hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42272
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42273
|
+
if (!ctx) {
|
|
42274
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42275
|
+
process.exit(1);
|
|
42276
|
+
}
|
|
42277
|
+
const args = {};
|
|
42278
|
+
if (opts.id !== void 0)
|
|
42279
|
+
args.id = opts.id;
|
|
42280
|
+
if (opts.aggregatorId !== void 0)
|
|
42281
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42282
|
+
if (opts.startDate !== void 0)
|
|
42283
|
+
args.start_date = opts.startDate;
|
|
42284
|
+
if (opts.endDate !== void 0)
|
|
42285
|
+
args.end_date = opts.endDate;
|
|
42286
|
+
await ctx.execute({
|
|
42287
|
+
method: "GET",
|
|
42288
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}",
|
|
42289
|
+
args,
|
|
42290
|
+
queryParamKeys: ["start_date", "end_date"]
|
|
42291
|
+
});
|
|
42292
|
+
});
|
|
42293
|
+
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", `
|
|
42294
|
+
Examples:
|
|
42295
|
+
hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id>
|
|
42296
|
+
hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42297
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42298
|
+
if (!ctx) {
|
|
42299
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42300
|
+
process.exit(1);
|
|
42301
|
+
}
|
|
42302
|
+
const args = {};
|
|
42303
|
+
if (opts.id !== void 0)
|
|
42304
|
+
args.id = opts.id;
|
|
42305
|
+
if (opts.aggregatorId !== void 0)
|
|
42306
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42307
|
+
if (opts.startDate !== void 0)
|
|
42308
|
+
args.start_date = opts.startDate;
|
|
42309
|
+
if (opts.endDate !== void 0)
|
|
42310
|
+
args.end_date = opts.endDate;
|
|
42311
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
42312
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
42313
|
+
if (opts.groupBy !== void 0)
|
|
42314
|
+
args.group_by = opts.groupBy;
|
|
42315
|
+
await ctx.execute({
|
|
42316
|
+
method: "GET",
|
|
42317
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}/timeseries",
|
|
42318
|
+
args,
|
|
42319
|
+
queryParamKeys: [
|
|
42320
|
+
"start_date",
|
|
42321
|
+
"end_date",
|
|
42322
|
+
"aggregator_filter_id",
|
|
42323
|
+
"group_by"
|
|
42324
|
+
]
|
|
42325
|
+
});
|
|
42326
|
+
});
|
|
42327
|
+
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", `
|
|
42328
|
+
Examples:
|
|
42329
|
+
hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id>
|
|
42330
|
+
hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42331
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42332
|
+
if (!ctx) {
|
|
42333
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42334
|
+
process.exit(1);
|
|
42335
|
+
}
|
|
42336
|
+
const args = {};
|
|
42337
|
+
if (opts.id !== void 0)
|
|
42338
|
+
args.id = opts.id;
|
|
42339
|
+
if (opts.aggregatorId !== void 0)
|
|
42340
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42341
|
+
if (opts.startDate !== void 0)
|
|
42342
|
+
args.start_date = opts.startDate;
|
|
42343
|
+
if (opts.endDate !== void 0)
|
|
42344
|
+
args.end_date = opts.endDate;
|
|
42345
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
42346
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
42347
|
+
if (opts.take !== void 0)
|
|
42348
|
+
args.take = Number(opts.take);
|
|
42349
|
+
if (opts.skip !== void 0)
|
|
42350
|
+
args.skip = Number(opts.skip);
|
|
42351
|
+
await ctx.execute({
|
|
42352
|
+
method: "GET",
|
|
42353
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}/events",
|
|
42354
|
+
args,
|
|
42355
|
+
queryParamKeys: [
|
|
42356
|
+
"start_date",
|
|
42357
|
+
"end_date",
|
|
42358
|
+
"aggregator_filter_id",
|
|
42359
|
+
"take",
|
|
42360
|
+
"skip"
|
|
42361
|
+
]
|
|
42362
|
+
});
|
|
42363
|
+
});
|
|
42364
|
+
}
|
|
42365
|
+
|
|
41184
42366
|
// build/commands/generated/exports.js
|
|
41185
42367
|
function registerExportsCommands(parent) {
|
|
41186
42368
|
const resource = parent.command("exports").description("Manage exports");
|
|
@@ -43151,7 +44333,7 @@ Quote status.
|
|
|
43151
44333
|
- \`all\`: Display all pricing tiers.
|
|
43152
44334
|
- \`matching\`: Only display the tiers used to compute the price based on quantity.
|
|
43153
44335
|
- \`none\`: Hide all pricing tiers.
|
|
43154
|
-
`).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("--
|
|
44336
|
+
`).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", `
|
|
43155
44337
|
Examples:
|
|
43156
44338
|
hyperline quotes create --customer-id <customer_id>
|
|
43157
44339
|
hyperline quotes create --customer-id <customer_id> --status <status> --owner-email <owner_email>
|
|
@@ -43194,8 +44376,8 @@ Examples:
|
|
|
43194
44376
|
args.display_first_invoice_amount = opts.displayFirstInvoiceAmount;
|
|
43195
44377
|
if (opts.displayDocumentsInPreview !== void 0)
|
|
43196
44378
|
args.display_documents_in_preview = opts.displayDocumentsInPreview;
|
|
43197
|
-
if (opts.
|
|
43198
|
-
args.
|
|
44379
|
+
if (opts.subscriptionUpdateDisplay !== void 0)
|
|
44380
|
+
args.subscription_update_display = opts.subscriptionUpdateDisplay;
|
|
43199
44381
|
if (opts.generateDraftInvoices !== void 0)
|
|
43200
44382
|
args.generate_draft_invoices = opts.generateDraftInvoices;
|
|
43201
44383
|
if (opts.templateId !== void 0)
|
|
@@ -43443,7 +44625,7 @@ Examples:
|
|
|
43443
44625
|
- \`all\`: Display all pricing tiers.
|
|
43444
44626
|
- \`matching\`: Only display the tiers used to compute the price based on quantity.
|
|
43445
44627
|
- \`none\`: Hide all pricing tiers.
|
|
43446
|
-
`).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("--
|
|
44628
|
+
`).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", `
|
|
43447
44629
|
Examples:
|
|
43448
44630
|
hyperline quotes update --id <id>
|
|
43449
44631
|
hyperline quotes update --id <id> --owner-email <owner_email> --catalog-version-id <catalog_version_id>
|
|
@@ -43482,8 +44664,8 @@ Examples:
|
|
|
43482
44664
|
args.display_first_invoice_amount = opts.displayFirstInvoiceAmount;
|
|
43483
44665
|
if (opts.displayDocumentsInPreview !== void 0)
|
|
43484
44666
|
args.display_documents_in_preview = opts.displayDocumentsInPreview;
|
|
43485
|
-
if (opts.
|
|
43486
|
-
args.
|
|
44667
|
+
if (opts.subscriptionUpdateDisplay !== void 0)
|
|
44668
|
+
args.subscription_update_display = opts.subscriptionUpdateDisplay;
|
|
43487
44669
|
if (opts.generateDraftInvoices !== void 0)
|
|
43488
44670
|
args.generate_draft_invoices = opts.generateDraftInvoices;
|
|
43489
44671
|
if (opts.crmOpportunityId !== void 0)
|
|
@@ -45555,7 +46737,10 @@ function registerAllCommands(program2) {
|
|
|
45555
46737
|
registerAccounting_ReportsCommands(program2);
|
|
45556
46738
|
registerAccounting_Revenue_RecognitionCommands(program2);
|
|
45557
46739
|
registerAccounting_RulesCommands(program2);
|
|
46740
|
+
registerAgentsCommands(program2);
|
|
45558
46741
|
registerCustom_PropertiesCommands(program2);
|
|
46742
|
+
registerAggregatorsCommands(program2);
|
|
46743
|
+
registerAggregators_UsageCommands(program2);
|
|
45559
46744
|
registerAnalyticsCommands(program2);
|
|
45560
46745
|
registerBank_AccountsCommands(program2);
|
|
45561
46746
|
registerCompaniesCommands(program2);
|
|
@@ -45566,6 +46751,7 @@ function registerAllCommands(program2) {
|
|
|
45566
46751
|
registerCustomers_AddressCommands(program2);
|
|
45567
46752
|
registerCustomers_ShippingCommands(program2);
|
|
45568
46753
|
registerCustomersCommands(program2);
|
|
46754
|
+
registerCustomers_UsageCommands(program2);
|
|
45569
46755
|
registerOrganisationsCommands(program2);
|
|
45570
46756
|
registerCustomers_SegmentsCommands(program2);
|
|
45571
46757
|
registerExportsCommands(program2);
|
|
@@ -61525,12 +62711,41 @@ var DateTimeSchema = external_exports.iso.datetime({
|
|
|
61525
62711
|
example: "2024-12-20T16:04:11Z"
|
|
61526
62712
|
});
|
|
61527
62713
|
|
|
62714
|
+
// ../hyperline-lib/build/http/dto/decimal.js
|
|
62715
|
+
var DecimalStringSchema = external_exports.string().regex(/^-?\d+(\.\d+)?(e[+-]?\d+)?$/i).openapi({
|
|
62716
|
+
description: "Exact decimal string. Interpret the unit using the field description and denomination.",
|
|
62717
|
+
example: "0.0021"
|
|
62718
|
+
});
|
|
62719
|
+
var NonNegativeDecimalStringSchema = external_exports.string().regex(/^\d+(\.\d+)?$/).max(40).openapi({
|
|
62720
|
+
description: "Non-negative exact decimal string, at most 40 characters.",
|
|
62721
|
+
example: "0.0021"
|
|
62722
|
+
});
|
|
62723
|
+
|
|
61528
62724
|
// ../hyperline-lib/build/http/dto/domain.js
|
|
61529
62725
|
var DomainSchema = external_exports.string().trim().toLowerCase().regex(/^(?!:\/\/)(?=.{1,253}$)(?!-)([a-z0-9-]{1,63}\.)+[a-z]{2,63}$/, "Invalid domain").openapi({
|
|
61530
62726
|
description: "Domain name.",
|
|
61531
62727
|
example: "acme.com"
|
|
61532
62728
|
});
|
|
61533
62729
|
|
|
62730
|
+
// ../hyperline-lib/build/http/dto/emailStatus.js
|
|
62731
|
+
var EmailStatusSchema = external_exports.enum([
|
|
62732
|
+
"sent",
|
|
62733
|
+
"delivered",
|
|
62734
|
+
"opened",
|
|
62735
|
+
"clicked",
|
|
62736
|
+
"spammed",
|
|
62737
|
+
"bounced",
|
|
62738
|
+
"queued",
|
|
62739
|
+
"drafted",
|
|
62740
|
+
"attempted",
|
|
62741
|
+
"failed",
|
|
62742
|
+
"undeliverable",
|
|
62743
|
+
"converted",
|
|
62744
|
+
"suppressed",
|
|
62745
|
+
"unsubscribed",
|
|
62746
|
+
"dropped"
|
|
62747
|
+
]);
|
|
62748
|
+
|
|
61534
62749
|
// ../hyperline-lib/build/http/dto/error.js
|
|
61535
62750
|
var ErrorSchema = external_exports.object({
|
|
61536
62751
|
message: external_exports.string()
|