@hyperline/cli 0.1.0-build.1.ad78020 → 0.1.0-build.1.ae39ce9
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 +1394 -165
- 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_zod21 = require_lib();
|
|
34989
34989
|
var countryIds2 = ["all", ...countries.map(({ id }) => id)];
|
|
34990
|
-
var ZodId =
|
|
34991
|
-
var ZodTranslationsSchemaFn = (schema) =>
|
|
34990
|
+
var ZodId = import_zod21.z.enum(countryIds2);
|
|
34991
|
+
var ZodTranslationsSchemaFn = (schema) => import_zod21.z.record(import_zod21.z.string(), schema.optional());
|
|
34992
34992
|
var UsStates = [
|
|
34993
34993
|
{ id: "AA", name: "Armed Forces Americas" },
|
|
34994
34994
|
{ id: "AE", name: "Armed Forces Europe" },
|
|
@@ -39223,6 +39223,1052 @@ Examples:
|
|
|
39223
39223
|
});
|
|
39224
39224
|
}
|
|
39225
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}",
|
|
40065
|
+
args,
|
|
40066
|
+
queryParamKeys: []
|
|
40067
|
+
});
|
|
40068
|
+
});
|
|
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", `
|
|
40070
|
+
Examples:
|
|
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) => {
|
|
40074
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40075
|
+
if (!ctx) {
|
|
40076
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40077
|
+
process.exit(1);
|
|
40078
|
+
}
|
|
40079
|
+
const args = {};
|
|
40080
|
+
if (opts.id !== void 0)
|
|
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;
|
|
40086
|
+
if (opts.name !== void 0)
|
|
40087
|
+
args.name = opts.name;
|
|
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);
|
|
40112
|
+
await ctx.execute({
|
|
40113
|
+
method: "PUT",
|
|
40114
|
+
path: "/v1/aggregators/{id}",
|
|
40115
|
+
args,
|
|
40116
|
+
queryParamKeys: []
|
|
40117
|
+
});
|
|
40118
|
+
});
|
|
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", `
|
|
40120
|
+
Examples:
|
|
40121
|
+
hyperline aggregators delete --id <id>
|
|
40122
|
+
hyperline aggregators delete --id <id> --output json`).action(async (opts) => {
|
|
40123
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40124
|
+
if (!ctx) {
|
|
40125
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40126
|
+
process.exit(1);
|
|
40127
|
+
}
|
|
40128
|
+
const args = {};
|
|
40129
|
+
if (opts.id !== void 0)
|
|
40130
|
+
args.id = opts.id;
|
|
40131
|
+
if (!opts.yes) {
|
|
40132
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
40133
|
+
if (!confirmed) {
|
|
40134
|
+
process.stdout.write("Aborted.\n");
|
|
40135
|
+
return;
|
|
40136
|
+
}
|
|
40137
|
+
}
|
|
40138
|
+
await ctx.execute({
|
|
40139
|
+
method: "DELETE",
|
|
40140
|
+
path: "/v1/aggregators/{id}",
|
|
40141
|
+
args,
|
|
40142
|
+
queryParamKeys: []
|
|
40143
|
+
});
|
|
40144
|
+
});
|
|
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", `
|
|
40151
|
+
Examples:
|
|
40152
|
+
hyperline aggregators-usage get-aggregator-usage --id <id>`).action(async (opts) => {
|
|
40153
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40154
|
+
if (!ctx) {
|
|
40155
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40156
|
+
process.exit(1);
|
|
40157
|
+
}
|
|
40158
|
+
const args = {};
|
|
40159
|
+
if (opts.id !== void 0)
|
|
40160
|
+
args.id = opts.id;
|
|
40161
|
+
await ctx.execute({
|
|
40162
|
+
method: "GET",
|
|
40163
|
+
path: "/v1/aggregators/{id}/usage",
|
|
40164
|
+
args,
|
|
40165
|
+
queryParamKeys: []
|
|
40166
|
+
});
|
|
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
|
+
});
|
|
40270
|
+
}
|
|
40271
|
+
|
|
39226
40272
|
// build/commands/generated/analytics.js
|
|
39227
40273
|
function registerAnalyticsCommands(parent) {
|
|
39228
40274
|
const resource = parent.command("analytics").description("Manage analytics");
|
|
@@ -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}",
|
|
@@ -39758,153 +40808,32 @@ Examples:
|
|
|
39758
40808
|
if (opts.slug !== void 0)
|
|
39759
40809
|
args.slug = opts.slug;
|
|
39760
40810
|
if (opts.apiOnly !== void 0)
|
|
39761
|
-
args.api_only = true;
|
|
39762
|
-
if (opts.required !== void 0)
|
|
39763
|
-
args.required = true;
|
|
39764
|
-
if (opts.entities !== void 0)
|
|
39765
|
-
args.entities = JSON.parse(opts.entities);
|
|
39766
|
-
if (opts.authorizedValues !== void 0)
|
|
39767
|
-
args.authorized_values = JSON.parse(opts.authorizedValues);
|
|
39768
|
-
await ctx.execute({
|
|
39769
|
-
method: "PUT",
|
|
39770
|
-
path: "/v1/custom-properties/{id}",
|
|
39771
|
-
args,
|
|
39772
|
-
queryParamKeys: []
|
|
39773
|
-
});
|
|
39774
|
-
});
|
|
39775
|
-
resource.command("delete-custom-property").description(`Delete an existing custom property definition by ID. This removes the property from all entities.`).requiredOption("--id <value>", `id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
39776
|
-
Examples:
|
|
39777
|
-
hyperline custom-properties delete-custom-property --id <id>
|
|
39778
|
-
hyperline custom-properties delete-custom-property --id <id> --output json`).action(async (opts) => {
|
|
39779
|
-
const ctx = resource.parent?.opts()._ctx;
|
|
39780
|
-
if (!ctx) {
|
|
39781
|
-
process.stderr.write("Error: Not authenticated\n");
|
|
39782
|
-
process.exit(1);
|
|
39783
|
-
}
|
|
39784
|
-
const args = {};
|
|
39785
|
-
if (opts.id !== void 0)
|
|
39786
|
-
args.id = opts.id;
|
|
39787
|
-
if (!opts.yes) {
|
|
39788
|
-
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39789
|
-
if (!confirmed) {
|
|
39790
|
-
process.stdout.write("Aborted.\n");
|
|
39791
|
-
return;
|
|
39792
|
-
}
|
|
39793
|
-
}
|
|
39794
|
-
await ctx.execute({
|
|
39795
|
-
method: "DELETE",
|
|
39796
|
-
path: "/v1/custom-properties/{id}",
|
|
39797
|
-
args,
|
|
39798
|
-
queryParamKeys: []
|
|
39799
|
-
});
|
|
39800
|
-
});
|
|
39801
|
-
}
|
|
39802
|
-
|
|
39803
|
-
// build/commands/generated/customers.js
|
|
39804
|
-
function registerCustomersCommands(parent) {
|
|
39805
|
-
const resource = parent.command("customers").description("Manage customers");
|
|
39806
|
-
resource.command("list-customer-shipping-addresses").description(`List saved shipping addresses and identify the default.`).requiredOption("--customer-id <value>", `customerId parameter`).addHelpText("after", `
|
|
39807
|
-
Examples:
|
|
39808
|
-
hyperline customers list-customer-shipping-addresses --customer-id <customerId>`).action(async (opts) => {
|
|
39809
|
-
const ctx = resource.parent?.opts()._ctx;
|
|
39810
|
-
if (!ctx) {
|
|
39811
|
-
process.stderr.write("Error: Not authenticated\n");
|
|
39812
|
-
process.exit(1);
|
|
39813
|
-
}
|
|
39814
|
-
const args = {};
|
|
39815
|
-
if (opts.customerId !== void 0)
|
|
39816
|
-
args.customerId = opts.customerId;
|
|
39817
|
-
await ctx.execute({
|
|
39818
|
-
method: "GET",
|
|
39819
|
-
path: "/v1/customers/{customerId}/shipping-addresses",
|
|
39820
|
-
args,
|
|
39821
|
-
queryParamKeys: []
|
|
39822
|
-
});
|
|
39823
|
-
});
|
|
39824
|
-
resource.command("create-customer-shipping-address").description(`Save a shipping address without changing the selected shipping destination.`).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).`).addHelpText("after", `
|
|
39825
|
-
Examples:
|
|
39826
|
-
hyperline customers create-customer-shipping-address --customer-id <customerId>
|
|
39827
|
-
hyperline customers create-customer-shipping-address --customer-id <customerId> --name <name> --line1 <line1>
|
|
39828
|
-
hyperline customers create-customer-shipping-address --customer-id <customerId> --output json`).action(async (opts) => {
|
|
39829
|
-
const ctx = resource.parent?.opts()._ctx;
|
|
39830
|
-
if (!ctx) {
|
|
39831
|
-
process.stderr.write("Error: Not authenticated\n");
|
|
39832
|
-
process.exit(1);
|
|
39833
|
-
}
|
|
39834
|
-
const args = {};
|
|
39835
|
-
if (opts.customerId !== void 0)
|
|
39836
|
-
args.customerId = opts.customerId;
|
|
39837
|
-
if (opts.name !== void 0)
|
|
39838
|
-
args.name = opts.name;
|
|
39839
|
-
if (opts.line1 !== void 0)
|
|
39840
|
-
args.line1 = opts.line1;
|
|
39841
|
-
if (opts.line2 !== void 0)
|
|
39842
|
-
args.line2 = opts.line2;
|
|
39843
|
-
if (opts.city !== void 0)
|
|
39844
|
-
args.city = opts.city;
|
|
39845
|
-
if (opts.zip !== void 0)
|
|
39846
|
-
args.zip = opts.zip;
|
|
39847
|
-
if (opts.state !== void 0)
|
|
39848
|
-
args.state = opts.state;
|
|
39849
|
-
if (opts.country !== void 0)
|
|
39850
|
-
args.country = opts.country;
|
|
39851
|
-
await ctx.execute({
|
|
39852
|
-
method: "POST",
|
|
39853
|
-
path: "/v1/customers/{customerId}/shipping-addresses",
|
|
39854
|
-
args,
|
|
39855
|
-
queryParamKeys: []
|
|
39856
|
-
});
|
|
39857
|
-
});
|
|
39858
|
-
resource.command("update-customer-shipping-address").description(`Update one saved shipping address.`).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", `
|
|
39859
|
-
Examples:
|
|
39860
|
-
hyperline customers update-customer-shipping-address --customer-id <customerId> --address-id <addressId>
|
|
39861
|
-
hyperline customers update-customer-shipping-address --customer-id <customerId> --address-id <addressId> --name <name> --line1 <line1>
|
|
39862
|
-
hyperline customers update-customer-shipping-address --customer-id <customerId> --address-id <addressId> --output json`).action(async (opts) => {
|
|
39863
|
-
const ctx = resource.parent?.opts()._ctx;
|
|
39864
|
-
if (!ctx) {
|
|
39865
|
-
process.stderr.write("Error: Not authenticated\n");
|
|
39866
|
-
process.exit(1);
|
|
39867
|
-
}
|
|
39868
|
-
const args = {};
|
|
39869
|
-
if (opts.customerId !== void 0)
|
|
39870
|
-
args.customerId = opts.customerId;
|
|
39871
|
-
if (opts.addressId !== void 0)
|
|
39872
|
-
args.addressId = opts.addressId;
|
|
39873
|
-
if (opts.name !== void 0)
|
|
39874
|
-
args.name = opts.name;
|
|
39875
|
-
if (opts.line1 !== void 0)
|
|
39876
|
-
args.line1 = opts.line1;
|
|
39877
|
-
if (opts.line2 !== void 0)
|
|
39878
|
-
args.line2 = opts.line2;
|
|
39879
|
-
if (opts.city !== void 0)
|
|
39880
|
-
args.city = opts.city;
|
|
39881
|
-
if (opts.zip !== void 0)
|
|
39882
|
-
args.zip = opts.zip;
|
|
39883
|
-
if (opts.state !== void 0)
|
|
39884
|
-
args.state = opts.state;
|
|
39885
|
-
if (opts.country !== void 0)
|
|
39886
|
-
args.country = opts.country;
|
|
40811
|
+
args.api_only = true;
|
|
40812
|
+
if (opts.required !== void 0)
|
|
40813
|
+
args.required = true;
|
|
40814
|
+
if (opts.entities !== void 0)
|
|
40815
|
+
args.entities = JSON.parse(opts.entities);
|
|
40816
|
+
if (opts.authorizedValues !== void 0)
|
|
40817
|
+
args.authorized_values = JSON.parse(opts.authorizedValues);
|
|
39887
40818
|
await ctx.execute({
|
|
39888
|
-
method: "
|
|
39889
|
-
path: "/v1/
|
|
40819
|
+
method: "PUT",
|
|
40820
|
+
path: "/v1/custom-properties/{id}",
|
|
39890
40821
|
args,
|
|
39891
40822
|
queryParamKeys: []
|
|
39892
40823
|
});
|
|
39893
40824
|
});
|
|
39894
|
-
resource.command("delete-
|
|
40825
|
+
resource.command("delete-custom-property").description(`Delete an existing custom property definition by ID. This removes the property from all entities.`).requiredOption("--id <value>", `id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
39895
40826
|
Examples:
|
|
39896
|
-
hyperline
|
|
39897
|
-
hyperline
|
|
40827
|
+
hyperline custom-properties delete-custom-property --id <id>
|
|
40828
|
+
hyperline custom-properties delete-custom-property --id <id> --output json`).action(async (opts) => {
|
|
39898
40829
|
const ctx = resource.parent?.opts()._ctx;
|
|
39899
40830
|
if (!ctx) {
|
|
39900
40831
|
process.stderr.write("Error: Not authenticated\n");
|
|
39901
40832
|
process.exit(1);
|
|
39902
40833
|
}
|
|
39903
40834
|
const args = {};
|
|
39904
|
-
if (opts.
|
|
39905
|
-
args.
|
|
39906
|
-
if (opts.addressId !== void 0)
|
|
39907
|
-
args.addressId = opts.addressId;
|
|
40835
|
+
if (opts.id !== void 0)
|
|
40836
|
+
args.id = opts.id;
|
|
39908
40837
|
if (!opts.yes) {
|
|
39909
40838
|
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39910
40839
|
if (!confirmed) {
|
|
@@ -39914,32 +40843,16 @@ Examples:
|
|
|
39914
40843
|
}
|
|
39915
40844
|
await ctx.execute({
|
|
39916
40845
|
method: "DELETE",
|
|
39917
|
-
path: "/v1/
|
|
39918
|
-
args,
|
|
39919
|
-
queryParamKeys: []
|
|
39920
|
-
});
|
|
39921
|
-
});
|
|
39922
|
-
resource.command("set-customer-shipping-destination").description(`Select a saved shipping address or use the billing address.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--address-id <value>", `Saved shipping address ID, or null to use the billing address. Saved alternatives are preserved.`).addHelpText("after", `
|
|
39923
|
-
Examples:
|
|
39924
|
-
hyperline customers set-customer-shipping-destination --customer-id <customerId> --address-id <address_id>
|
|
39925
|
-
hyperline customers set-customer-shipping-destination --customer-id <customerId> --address-id <address_id> --output json`).action(async (opts) => {
|
|
39926
|
-
const ctx = resource.parent?.opts()._ctx;
|
|
39927
|
-
if (!ctx) {
|
|
39928
|
-
process.stderr.write("Error: Not authenticated\n");
|
|
39929
|
-
process.exit(1);
|
|
39930
|
-
}
|
|
39931
|
-
const args = {};
|
|
39932
|
-
if (opts.customerId !== void 0)
|
|
39933
|
-
args.customerId = opts.customerId;
|
|
39934
|
-
if (opts.addressId !== void 0)
|
|
39935
|
-
args.address_id = opts.addressId;
|
|
39936
|
-
await ctx.execute({
|
|
39937
|
-
method: "PUT",
|
|
39938
|
-
path: "/v1/customers/{customerId}/shipping-destination",
|
|
40846
|
+
path: "/v1/custom-properties/{id}",
|
|
39939
40847
|
args,
|
|
39940
40848
|
queryParamKeys: []
|
|
39941
40849
|
});
|
|
39942
40850
|
});
|
|
40851
|
+
}
|
|
40852
|
+
|
|
40853
|
+
// build/commands/generated/customers.js
|
|
40854
|
+
function registerCustomersCommands(parent) {
|
|
40855
|
+
const resource = parent.command("customers").description("Manage customers");
|
|
39943
40856
|
resource.command("list").description(`List customers with optional filters for name, type, status, currency, country, external_id, billing_email, search, tax_id, subscription_status, invoicing_entity_id, segment_id, custom_properties, payment_method_type, integration_entity_id, created_at, and updated_at. Sortable by created_at or updated_at. Paginated with limit/cursor.`).option("--limit <number>", `Maximum number of items to return (1-100).`).option("--cursor <value>", `Opaque cursor returned in the previous response's \`next_cursor\`. Omit to fetch the first page.`).option("--include-total <value>", `Set to \`true\` to include \`total\` in the response.`).option("--order <value>", `Sort direction.`).option("--sort <value>", `Field used to sort the results.`).option("--name <value>", `name`).option("--name.not <value>", `name__not`).option("--name.is-null <value>", `name__isNull`).option("--name.is-not-null <value>", `name__isNotNull`).option("--name.equals <value>", `name__equals`).option("--name.contains <value>", `name__contains`).option("--name.starts-with <value>", `name__startsWith`).option("--name.end-with <value>", `name__endWith`).option("--type <value>", `type`).option("--type.in <value>", `type__in`).option("--status <value>", `status`).option("--status.in <value>", `status__in`).option("--currency <value>", `currency`).option("--currency.not <value>", `currency__not`).option("--currency.is-null <value>", `currency__isNull`).option("--currency.is-not-null <value>", `currency__isNotNull`).option("--currency.equals <value>", `currency__equals`).option("--currency.contains <value>", `currency__contains`).option("--currency.starts-with <value>", `currency__startsWith`).option("--currency.end-with <value>", `currency__endWith`).option("--country <value>", `country`).option("--country.not <value>", `country__not`).option("--country.is-null <value>", `country__isNull`).option("--country.is-not-null <value>", `country__isNotNull`).option("--country.equals <value>", `country__equals`).option("--country.contains <value>", `country__contains`).option("--country.starts-with <value>", `country__startsWith`).option("--country.end-with <value>", `country__endWith`).option("--external-id <value>", `external_id`).option("--external-id.not <value>", `external_id__not`).option("--external-id.is-null <value>", `external_id__isNull`).option("--external-id.is-not-null <value>", `external_id__isNotNull`).option("--external-id.equals <value>", `external_id__equals`).option("--external-id.contains <value>", `external_id__contains`).option("--external-id.starts-with <value>", `external_id__startsWith`).option("--external-id.end-with <value>", `external_id__endWith`).option("--billing-email <value>", `billing_email`).option("--billing-email.not <value>", `billing_email__not`).option("--billing-email.is-null <value>", `billing_email__isNull`).option("--billing-email.is-not-null <value>", `billing_email__isNotNull`).option("--billing-email.equals <value>", `billing_email__equals`).option("--billing-email.contains <value>", `billing_email__contains`).option("--billing-email.starts-with <value>", `billing_email__startsWith`).option("--billing-email.end-with <value>", `billing_email__endWith`).option("--search <value>", `search`).option("--tax-id <value>", `tax_id`).option("--tax-id.not <value>", `tax_id__not`).option("--tax-id.is-null <value>", `tax_id__isNull`).option("--tax-id.is-not-null <value>", `tax_id__isNotNull`).option("--tax-id.equals <value>", `tax_id__equals`).option("--tax-id.contains <value>", `tax_id__contains`).option("--tax-id.starts-with <value>", `tax_id__startsWith`).option("--tax-id.end-with <value>", `tax_id__endWith`).option("--subscription-status <value>", `subscription_status`).option("--subscription-status.in <value>", `subscription_status__in`).option("--invoicing-entity-id <value>", `invoicing_entity_id`).option("--invoicing-entity-id.not <value>", `invoicing_entity_id__not`).option("--invoicing-entity-id.is-null <value>", `invoicing_entity_id__isNull`).option("--invoicing-entity-id.is-not-null <value>", `invoicing_entity_id__isNotNull`).option("--invoicing-entity-id.equals <value>", `invoicing_entity_id__equals`).option("--invoicing-entity-id.contains <value>", `invoicing_entity_id__contains`).option("--invoicing-entity-id.starts-with <value>", `invoicing_entity_id__startsWith`).option("--invoicing-entity-id.end-with <value>", `invoicing_entity_id__endWith`).option("--segment-id <value>", `segment_id`).option("--custom-properties <value>", `custom_properties`).option("--payment-method-type <value>", `payment_method_type`).option("--payment-method-type.in <value>", `payment_method_type__in`).option("--integration-entity-id <value>", `integration_entity_id`).option("--created-at <value>", `created_at`).option("--created-at.not <value>", `created_at__not`).option("--created-at.is-null <value>", `created_at__isNull`).option("--created-at.is-not-null <value>", `created_at__isNotNull`).option("--created-at.equals <value>", `created_at__equals`).option("--created-at.lt <value>", `created_at__lt`).option("--created-at.lte <value>", `created_at__lte`).option("--created-at.gt <value>", `created_at__gt`).option("--created-at.gte <value>", `created_at__gte`).option("--updated-at <value>", `updated_at`).option("--updated-at.not <value>", `updated_at__not`).option("--updated-at.is-null <value>", `updated_at__isNull`).option("--updated-at.is-not-null <value>", `updated_at__isNotNull`).option("--updated-at.equals <value>", `updated_at__equals`).option("--updated-at.lt <value>", `updated_at__lt`).option("--updated-at.lte <value>", `updated_at__lte`).option("--updated-at.gt <value>", `updated_at__gt`).option("--updated-at.gte <value>", `updated_at__gte`).addHelpText("after", `
|
|
39944
40857
|
Examples:
|
|
39945
40858
|
hyperline customers list
|
|
@@ -40657,6 +41570,129 @@ Examples:
|
|
|
40657
41570
|
});
|
|
40658
41571
|
}
|
|
40659
41572
|
|
|
41573
|
+
// build/commands/generated/customers-address.js
|
|
41574
|
+
function registerCustomers_AddressCommands(parent) {
|
|
41575
|
+
const resource = parent.command("customers-address").description("Manage customers > address");
|
|
41576
|
+
resource.command("list-customer-addresses").description(`List active addresses: at most one billing address and multiple shipping addresses per customer.`).requiredOption("--customer-id <value>", `customerId parameter`).addHelpText("after", `
|
|
41577
|
+
Examples:
|
|
41578
|
+
hyperline customers-address list-customer-addresses --customer-id <customerId>`).action(async (opts) => {
|
|
41579
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41580
|
+
if (!ctx) {
|
|
41581
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41582
|
+
process.exit(1);
|
|
41583
|
+
}
|
|
41584
|
+
const args = {};
|
|
41585
|
+
if (opts.customerId !== void 0)
|
|
41586
|
+
args.customerId = opts.customerId;
|
|
41587
|
+
await ctx.execute({
|
|
41588
|
+
method: "GET",
|
|
41589
|
+
path: "/v1/customers/{customerId}/addresses",
|
|
41590
|
+
args,
|
|
41591
|
+
queryParamKeys: []
|
|
41592
|
+
});
|
|
41593
|
+
});
|
|
41594
|
+
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).`).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.`).addHelpText("after", `
|
|
41595
|
+
Examples:
|
|
41596
|
+
hyperline customers-address create-customer-address --customer-id <customerId> --type <type>
|
|
41597
|
+
hyperline customers-address create-customer-address --customer-id <customerId> --type <type> --name <name> --line1 <line1>
|
|
41598
|
+
hyperline customers-address create-customer-address --customer-id <customerId> --type <type> --output json`).action(async (opts) => {
|
|
41599
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41600
|
+
if (!ctx) {
|
|
41601
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41602
|
+
process.exit(1);
|
|
41603
|
+
}
|
|
41604
|
+
const args = {};
|
|
41605
|
+
if (opts.customerId !== void 0)
|
|
41606
|
+
args.customerId = opts.customerId;
|
|
41607
|
+
if (opts.name !== void 0)
|
|
41608
|
+
args.name = opts.name;
|
|
41609
|
+
if (opts.line1 !== void 0)
|
|
41610
|
+
args.line1 = opts.line1;
|
|
41611
|
+
if (opts.line2 !== void 0)
|
|
41612
|
+
args.line2 = opts.line2;
|
|
41613
|
+
if (opts.city !== void 0)
|
|
41614
|
+
args.city = opts.city;
|
|
41615
|
+
if (opts.zip !== void 0)
|
|
41616
|
+
args.zip = opts.zip;
|
|
41617
|
+
if (opts.state !== void 0)
|
|
41618
|
+
args.state = opts.state;
|
|
41619
|
+
if (opts.country !== void 0)
|
|
41620
|
+
args.country = opts.country;
|
|
41621
|
+
if (opts.type !== void 0)
|
|
41622
|
+
args.type = opts.type;
|
|
41623
|
+
await ctx.execute({
|
|
41624
|
+
method: "POST",
|
|
41625
|
+
path: "/v1/customers/{customerId}/addresses",
|
|
41626
|
+
args,
|
|
41627
|
+
queryParamKeys: []
|
|
41628
|
+
});
|
|
41629
|
+
});
|
|
41630
|
+
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", `
|
|
41631
|
+
Examples:
|
|
41632
|
+
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId>
|
|
41633
|
+
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId> --name <name> --line1 <line1>
|
|
41634
|
+
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId> --output json`).action(async (opts) => {
|
|
41635
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41636
|
+
if (!ctx) {
|
|
41637
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41638
|
+
process.exit(1);
|
|
41639
|
+
}
|
|
41640
|
+
const args = {};
|
|
41641
|
+
if (opts.customerId !== void 0)
|
|
41642
|
+
args.customerId = opts.customerId;
|
|
41643
|
+
if (opts.addressId !== void 0)
|
|
41644
|
+
args.addressId = opts.addressId;
|
|
41645
|
+
if (opts.name !== void 0)
|
|
41646
|
+
args.name = opts.name;
|
|
41647
|
+
if (opts.line1 !== void 0)
|
|
41648
|
+
args.line1 = opts.line1;
|
|
41649
|
+
if (opts.line2 !== void 0)
|
|
41650
|
+
args.line2 = opts.line2;
|
|
41651
|
+
if (opts.city !== void 0)
|
|
41652
|
+
args.city = opts.city;
|
|
41653
|
+
if (opts.zip !== void 0)
|
|
41654
|
+
args.zip = opts.zip;
|
|
41655
|
+
if (opts.state !== void 0)
|
|
41656
|
+
args.state = opts.state;
|
|
41657
|
+
if (opts.country !== void 0)
|
|
41658
|
+
args.country = opts.country;
|
|
41659
|
+
await ctx.execute({
|
|
41660
|
+
method: "PATCH",
|
|
41661
|
+
path: "/v1/customers/{customerId}/addresses/{addressId}",
|
|
41662
|
+
args,
|
|
41663
|
+
queryParamKeys: []
|
|
41664
|
+
});
|
|
41665
|
+
});
|
|
41666
|
+
resource.command("delete-customer-address").description(`Delete an address. To delete the default shipping address, first select another shipping address or use the billing address.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--address-id <value>", `addressId parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
41667
|
+
Examples:
|
|
41668
|
+
hyperline customers-address delete-customer-address --customer-id <customerId> --address-id <addressId>
|
|
41669
|
+
hyperline customers-address delete-customer-address --customer-id <customerId> --address-id <addressId> --output json`).action(async (opts) => {
|
|
41670
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41671
|
+
if (!ctx) {
|
|
41672
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41673
|
+
process.exit(1);
|
|
41674
|
+
}
|
|
41675
|
+
const args = {};
|
|
41676
|
+
if (opts.customerId !== void 0)
|
|
41677
|
+
args.customerId = opts.customerId;
|
|
41678
|
+
if (opts.addressId !== void 0)
|
|
41679
|
+
args.addressId = opts.addressId;
|
|
41680
|
+
if (!opts.yes) {
|
|
41681
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
41682
|
+
if (!confirmed) {
|
|
41683
|
+
process.stdout.write("Aborted.\n");
|
|
41684
|
+
return;
|
|
41685
|
+
}
|
|
41686
|
+
}
|
|
41687
|
+
await ctx.execute({
|
|
41688
|
+
method: "DELETE",
|
|
41689
|
+
path: "/v1/customers/{customerId}/addresses/{addressId}",
|
|
41690
|
+
args,
|
|
41691
|
+
queryParamKeys: []
|
|
41692
|
+
});
|
|
41693
|
+
});
|
|
41694
|
+
}
|
|
41695
|
+
|
|
40660
41696
|
// build/commands/generated/customers-credits.js
|
|
40661
41697
|
function registerCustomers_CreditsCommands(parent) {
|
|
40662
41698
|
const resource = parent.command("customers-credits").description("Manage customers > credits");
|
|
@@ -41148,6 +42184,177 @@ Examples:
|
|
|
41148
42184
|
});
|
|
41149
42185
|
}
|
|
41150
42186
|
|
|
42187
|
+
// build/commands/generated/customers-shipping.js
|
|
42188
|
+
function registerCustomers_ShippingCommands(parent) {
|
|
42189
|
+
const resource = parent.command("customers-shipping").description("Manage customers > shipping");
|
|
42190
|
+
resource.command("get-customer-shipping-destination").description(`Get the billing or shipping destination and its resolved address object, or null if no address exists.`).requiredOption("--customer-id <value>", `customerId parameter`).addHelpText("after", `
|
|
42191
|
+
Examples:
|
|
42192
|
+
hyperline customers-shipping get-customer-shipping-destination --customer-id <customerId>`).action(async (opts) => {
|
|
42193
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42194
|
+
if (!ctx) {
|
|
42195
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42196
|
+
process.exit(1);
|
|
42197
|
+
}
|
|
42198
|
+
const args = {};
|
|
42199
|
+
if (opts.customerId !== void 0)
|
|
42200
|
+
args.customerId = opts.customerId;
|
|
42201
|
+
await ctx.execute({
|
|
42202
|
+
method: "GET",
|
|
42203
|
+
path: "/v1/customers/{customerId}/shipping",
|
|
42204
|
+
args,
|
|
42205
|
+
queryParamKeys: []
|
|
42206
|
+
});
|
|
42207
|
+
});
|
|
42208
|
+
resource.command("set-customer-shipping-destination").description(`Select a saved shipping address or use the billing address.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--destination <value>", `Whether shipping uses the billing address or a saved shipping address.`).option("--address-id <value>", `Active shipping address ID belonging to this customer. Uses the customer's default shipping address when omitted. A shipping address must exist.`).addHelpText("after", `
|
|
42209
|
+
Examples:
|
|
42210
|
+
hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination>
|
|
42211
|
+
hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination> --address-id <address_id>
|
|
42212
|
+
hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination> --output json`).action(async (opts) => {
|
|
42213
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42214
|
+
if (!ctx) {
|
|
42215
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42216
|
+
process.exit(1);
|
|
42217
|
+
}
|
|
42218
|
+
const args = {};
|
|
42219
|
+
if (opts.customerId !== void 0)
|
|
42220
|
+
args.customerId = opts.customerId;
|
|
42221
|
+
if (opts.destination !== void 0)
|
|
42222
|
+
args.destination = opts.destination;
|
|
42223
|
+
if (opts.addressId !== void 0)
|
|
42224
|
+
args.address_id = opts.addressId;
|
|
42225
|
+
await ctx.execute({
|
|
42226
|
+
method: "PUT",
|
|
42227
|
+
path: "/v1/customers/{customerId}/shipping",
|
|
42228
|
+
args,
|
|
42229
|
+
queryParamKeys: []
|
|
42230
|
+
});
|
|
42231
|
+
});
|
|
42232
|
+
}
|
|
42233
|
+
|
|
42234
|
+
// build/commands/generated/customers-usage.js
|
|
42235
|
+
function registerCustomers_UsageCommands(parent) {
|
|
42236
|
+
const resource = parent.command("customers-usage").description("Manage customers > usage");
|
|
42237
|
+
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", `
|
|
42238
|
+
Examples:
|
|
42239
|
+
hyperline customers-usage list-customer-usage --id <id>
|
|
42240
|
+
hyperline customers-usage list-customer-usage --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42241
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42242
|
+
if (!ctx) {
|
|
42243
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42244
|
+
process.exit(1);
|
|
42245
|
+
}
|
|
42246
|
+
const args = {};
|
|
42247
|
+
if (opts.id !== void 0)
|
|
42248
|
+
args.id = opts.id;
|
|
42249
|
+
if (opts.startDate !== void 0)
|
|
42250
|
+
args.start_date = opts.startDate;
|
|
42251
|
+
if (opts.endDate !== void 0)
|
|
42252
|
+
args.end_date = opts.endDate;
|
|
42253
|
+
await ctx.execute({
|
|
42254
|
+
method: "GET",
|
|
42255
|
+
path: "/v1/customers/{id}/usage",
|
|
42256
|
+
args,
|
|
42257
|
+
queryParamKeys: ["start_date", "end_date"]
|
|
42258
|
+
});
|
|
42259
|
+
});
|
|
42260
|
+
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", `
|
|
42261
|
+
Examples:
|
|
42262
|
+
hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id>
|
|
42263
|
+
hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42264
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42265
|
+
if (!ctx) {
|
|
42266
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42267
|
+
process.exit(1);
|
|
42268
|
+
}
|
|
42269
|
+
const args = {};
|
|
42270
|
+
if (opts.id !== void 0)
|
|
42271
|
+
args.id = opts.id;
|
|
42272
|
+
if (opts.aggregatorId !== void 0)
|
|
42273
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42274
|
+
if (opts.startDate !== void 0)
|
|
42275
|
+
args.start_date = opts.startDate;
|
|
42276
|
+
if (opts.endDate !== void 0)
|
|
42277
|
+
args.end_date = opts.endDate;
|
|
42278
|
+
await ctx.execute({
|
|
42279
|
+
method: "GET",
|
|
42280
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}",
|
|
42281
|
+
args,
|
|
42282
|
+
queryParamKeys: ["start_date", "end_date"]
|
|
42283
|
+
});
|
|
42284
|
+
});
|
|
42285
|
+
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", `
|
|
42286
|
+
Examples:
|
|
42287
|
+
hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id>
|
|
42288
|
+
hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42289
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42290
|
+
if (!ctx) {
|
|
42291
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42292
|
+
process.exit(1);
|
|
42293
|
+
}
|
|
42294
|
+
const args = {};
|
|
42295
|
+
if (opts.id !== void 0)
|
|
42296
|
+
args.id = opts.id;
|
|
42297
|
+
if (opts.aggregatorId !== void 0)
|
|
42298
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42299
|
+
if (opts.startDate !== void 0)
|
|
42300
|
+
args.start_date = opts.startDate;
|
|
42301
|
+
if (opts.endDate !== void 0)
|
|
42302
|
+
args.end_date = opts.endDate;
|
|
42303
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
42304
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
42305
|
+
if (opts.groupBy !== void 0)
|
|
42306
|
+
args.group_by = opts.groupBy;
|
|
42307
|
+
await ctx.execute({
|
|
42308
|
+
method: "GET",
|
|
42309
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}/timeseries",
|
|
42310
|
+
args,
|
|
42311
|
+
queryParamKeys: [
|
|
42312
|
+
"start_date",
|
|
42313
|
+
"end_date",
|
|
42314
|
+
"aggregator_filter_id",
|
|
42315
|
+
"group_by"
|
|
42316
|
+
]
|
|
42317
|
+
});
|
|
42318
|
+
});
|
|
42319
|
+
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", `
|
|
42320
|
+
Examples:
|
|
42321
|
+
hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id>
|
|
42322
|
+
hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42323
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42324
|
+
if (!ctx) {
|
|
42325
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42326
|
+
process.exit(1);
|
|
42327
|
+
}
|
|
42328
|
+
const args = {};
|
|
42329
|
+
if (opts.id !== void 0)
|
|
42330
|
+
args.id = opts.id;
|
|
42331
|
+
if (opts.aggregatorId !== void 0)
|
|
42332
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42333
|
+
if (opts.startDate !== void 0)
|
|
42334
|
+
args.start_date = opts.startDate;
|
|
42335
|
+
if (opts.endDate !== void 0)
|
|
42336
|
+
args.end_date = opts.endDate;
|
|
42337
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
42338
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
42339
|
+
if (opts.take !== void 0)
|
|
42340
|
+
args.take = Number(opts.take);
|
|
42341
|
+
if (opts.skip !== void 0)
|
|
42342
|
+
args.skip = Number(opts.skip);
|
|
42343
|
+
await ctx.execute({
|
|
42344
|
+
method: "GET",
|
|
42345
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}/events",
|
|
42346
|
+
args,
|
|
42347
|
+
queryParamKeys: [
|
|
42348
|
+
"start_date",
|
|
42349
|
+
"end_date",
|
|
42350
|
+
"aggregator_filter_id",
|
|
42351
|
+
"take",
|
|
42352
|
+
"skip"
|
|
42353
|
+
]
|
|
42354
|
+
});
|
|
42355
|
+
});
|
|
42356
|
+
}
|
|
42357
|
+
|
|
41151
42358
|
// build/commands/generated/exports.js
|
|
41152
42359
|
function registerExportsCommands(parent) {
|
|
41153
42360
|
const resource = parent.command("exports").description("Manage exports");
|
|
@@ -42917,7 +44124,7 @@ How the periodic credit allowance is granted for partial billing periods.
|
|
|
42917
44124
|
|
|
42918
44125
|
- \`prorated\` (default): the granted credits are prorated to the elapsed period.
|
|
42919
44126
|
- \`full_allowance\`: the full allowance is always granted (the invoice remains prorated).
|
|
42920
|
-
`).option("--display-mode <value>", `How bundle items are displayed on invoices.`).option("--exclusive-items-enabled", `When true, only one item in the bundle can be active at a time.`).option("--bundle-items <json>", `Products included in this bundle. Percentages must sum to 100.`).addHelpText("after", `
|
|
44127
|
+
`).option("--credits-balance-auto-creation-enabled <value>", `Default for the \`credits_balance_auto_creation_enabled\` setting of subscription products using this credit product: whether the customer credit balance is created as soon as the product is added to a subscription. \`true\` when unset. A subscription product can override it.`).option("--display-mode <value>", `How bundle items are displayed on invoices.`).option("--exclusive-items-enabled", `When true, only one item in the bundle can be active at a time.`).option("--bundle-items <json>", `Products included in this bundle. Percentages must sum to 100.`).addHelpText("after", `
|
|
42921
44128
|
Examples:
|
|
42922
44129
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations>
|
|
42923
44130
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations> --description <description> --description-display-interval-dates
|
|
@@ -42942,6 +44149,8 @@ Examples:
|
|
|
42942
44149
|
args.unit_name = opts.unitName;
|
|
42943
44150
|
if (opts.creditsGrantMode !== void 0)
|
|
42944
44151
|
args.credits_grant_mode = opts.creditsGrantMode;
|
|
44152
|
+
if (opts.creditsBalanceAutoCreationEnabled !== void 0)
|
|
44153
|
+
args.credits_balance_auto_creation_enabled = opts.creditsBalanceAutoCreationEnabled;
|
|
42945
44154
|
if (opts.displayMode !== void 0)
|
|
42946
44155
|
args.display_mode = opts.displayMode;
|
|
42947
44156
|
if (opts.lowCreditsThreshold !== void 0)
|
|
@@ -44008,7 +45217,7 @@ Strategy used to activate the subscription.
|
|
|
44008
45217
|
- \`manually\`: The subscription requires activation through a manual action.
|
|
44009
45218
|
- \`checkout\`: The subscription will be activated once the checkout is completed, but only if the start date is in the past. Otherwise, activation will occur later on the specified start date.
|
|
44010
45219
|
- \`quote\`: The subscription will be activated depending on the configuration and the signature of the related quote.
|
|
44011
|
-
`).option("--products <json>", `Products that make up the subscription.`).option("--coupons <json>", `coupons`).option("--name <value>", `Subscription custom name.`).option("--purchase-order <value>", `Reference to the purchase order.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity attached to the subscription. If not defined, fallback to customer's invoicing entity.`).option("--crm-opportunity-id <value>", `ID of the related opportunity/deal in the connected CRM.`).option("--minimum-invoice-fee <number>", `Minimum fee applied to each invoice outside of one time payments.`).option("--contract-terms <json>", `Contract terms linked to the subscription.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancellation-strategy <value>", `
|
|
45220
|
+
`).option("--products <json>", `Products that make up the subscription.`).option("--coupons <json>", `coupons`).option("--name <value>", `Subscription custom name.`).option("--purchase-order <value>", `Reference to the purchase order.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity attached to the subscription. If not defined, fallback to customer's invoicing entity.`).option("--crm-opportunity-id <value>", `ID of the related opportunity/deal in the connected CRM.`).option("--minimum-invoice-fee <number>", `Minimum fee applied to each invoice outside of one time payments.`).option("--contract-terms <json>", `Contract terms linked to the subscription.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--shipping-address-id <value>", `Active shipping address ID belonging to the subscription customer. Omit to use the customer shipping destination: billing address or default shipping address.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancellation-strategy <value>", `
|
|
44012
45221
|
Strategy used to cancel the subscription. If not specified \`do_nothing\` is used.
|
|
44013
45222
|
|
|
44014
45223
|
- \`charge_prorata\`: Will charge the customer the unpaid amount for the prorated period up to the end of the current period.
|
|
@@ -44060,6 +45269,8 @@ Examples:
|
|
|
44060
45269
|
args.starts_at = opts.startsAt;
|
|
44061
45270
|
if (opts.initialBillingAt !== void 0)
|
|
44062
45271
|
args.initial_billing_at = opts.initialBillingAt;
|
|
45272
|
+
if (opts.shippingAddressId !== void 0)
|
|
45273
|
+
args.shipping_address_id = opts.shippingAddressId;
|
|
44063
45274
|
if (opts.displayShippingDetails !== void 0)
|
|
44064
45275
|
args.display_shipping_details = opts.displayShippingDetails;
|
|
44065
45276
|
if (opts.cancelAt !== void 0)
|
|
@@ -44370,7 +45581,7 @@ Defines when invoices are generated relative to the billing period.
|
|
|
44370
45581
|
|
|
44371
45582
|
- \`period_start\`: Invoices are generated at the start of the billing period.
|
|
44372
45583
|
- \`period_end\`: Invoices are generated at the end of the billing period.
|
|
44373
|
-
`).option("--estimated-arr <number>", `Estimated Annual Recurring Revenue generated by the subscription.`).option("--contract-value <number>", `Contract value of the subscription. This value is overridable by the user.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `A list of key value with the slug of the custom property as the key and the custom property value as value.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--phases <json>", `Array of subscription phases. Existing pending phases will be replaced by the ones in the array.`).option("--contract-terms <json>", `Contract terms to update.`).addHelpText("after", `
|
|
45584
|
+
`).option("--estimated-arr <number>", `Estimated Annual Recurring Revenue generated by the subscription.`).option("--contract-value <number>", `Contract value of the subscription. This value is overridable by the user.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `A list of key value with the slug of the custom property as the key and the custom property value as value.`).option("--shipping-address-id <value>", `Active shipping address ID belonging to the subscription customer. Null uses the customer shipping destination: billing address or default shipping address.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--phases <json>", `Array of subscription phases. Existing pending phases will be replaced by the ones in the array.`).option("--contract-terms <json>", `Contract terms to update.`).addHelpText("after", `
|
|
44374
45585
|
Examples:
|
|
44375
45586
|
hyperline subscriptions update --id <id>
|
|
44376
45587
|
hyperline subscriptions update --id <id> --name <name> --purchase-order <purchase_order>
|
|
@@ -44411,6 +45622,8 @@ Examples:
|
|
|
44411
45622
|
args.initial_billing_at = opts.initialBillingAt;
|
|
44412
45623
|
if (opts.cancelAt !== void 0)
|
|
44413
45624
|
args.cancel_at = opts.cancelAt;
|
|
45625
|
+
if (opts.shippingAddressId !== void 0)
|
|
45626
|
+
args.shipping_address_id = opts.shippingAddressId;
|
|
44414
45627
|
if (opts.displayShippingDetails !== void 0)
|
|
44415
45628
|
args.display_shipping_details = opts.displayShippingDetails;
|
|
44416
45629
|
if (opts.minimumInvoiceFee !== void 0)
|
|
@@ -45516,7 +46729,10 @@ function registerAllCommands(program2) {
|
|
|
45516
46729
|
registerAccounting_ReportsCommands(program2);
|
|
45517
46730
|
registerAccounting_Revenue_RecognitionCommands(program2);
|
|
45518
46731
|
registerAccounting_RulesCommands(program2);
|
|
46732
|
+
registerAgentsCommands(program2);
|
|
45519
46733
|
registerCustom_PropertiesCommands(program2);
|
|
46734
|
+
registerAggregatorsCommands(program2);
|
|
46735
|
+
registerAggregators_UsageCommands(program2);
|
|
45520
46736
|
registerAnalyticsCommands(program2);
|
|
45521
46737
|
registerBank_AccountsCommands(program2);
|
|
45522
46738
|
registerCompaniesCommands(program2);
|
|
@@ -45524,7 +46740,10 @@ function registerAllCommands(program2) {
|
|
|
45524
46740
|
registerCoupons_Promotion_CodesCommands(program2);
|
|
45525
46741
|
registerCustomers_CreditsCommands(program2);
|
|
45526
46742
|
registerCustomers_Payment_MethodsCommands(program2);
|
|
46743
|
+
registerCustomers_AddressCommands(program2);
|
|
46744
|
+
registerCustomers_ShippingCommands(program2);
|
|
45527
46745
|
registerCustomersCommands(program2);
|
|
46746
|
+
registerCustomers_UsageCommands(program2);
|
|
45528
46747
|
registerOrganisationsCommands(program2);
|
|
45529
46748
|
registerCustomers_SegmentsCommands(program2);
|
|
45530
46749
|
registerExportsCommands(program2);
|
|
@@ -61484,6 +62703,16 @@ var DateTimeSchema = external_exports.iso.datetime({
|
|
|
61484
62703
|
example: "2024-12-20T16:04:11Z"
|
|
61485
62704
|
});
|
|
61486
62705
|
|
|
62706
|
+
// ../hyperline-lib/build/http/dto/decimal.js
|
|
62707
|
+
var DecimalStringSchema = external_exports.string().regex(/^-?\d+(\.\d+)?(e[+-]?\d+)?$/i).openapi({
|
|
62708
|
+
description: "Exact decimal string. Interpret the unit using the field description and denomination.",
|
|
62709
|
+
example: "0.0021"
|
|
62710
|
+
});
|
|
62711
|
+
var NonNegativeDecimalStringSchema = external_exports.string().regex(/^\d+(\.\d+)?$/).max(40).openapi({
|
|
62712
|
+
description: "Non-negative exact decimal string, at most 40 characters.",
|
|
62713
|
+
example: "0.0021"
|
|
62714
|
+
});
|
|
62715
|
+
|
|
61487
62716
|
// ../hyperline-lib/build/http/dto/domain.js
|
|
61488
62717
|
var DomainSchema = external_exports.string().trim().toLowerCase().regex(/^(?!:\/\/)(?=.{1,253}$)(?!-)([a-z0-9-]{1,63}\.)+[a-z]{2,63}$/, "Invalid domain").openapi({
|
|
61489
62718
|
description: "Domain name.",
|