@hyperline/cli 0.1.0-build.1.ad78020 → 0.1.0-build.1.ad8ef5e
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 +1611 -355
- package/package.json +1 -4
|
@@ -34985,10 +34985,10 @@ var require_shared = __commonJS({
|
|
|
34985
34985
|
ZodId: () => ZodId,
|
|
34986
34986
|
ZodTranslationsSchemaFn: () => ZodTranslationsSchemaFn
|
|
34987
34987
|
});
|
|
34988
|
-
var
|
|
34988
|
+
var import_zod22 = require_lib();
|
|
34989
34989
|
var countryIds2 = ["all", ...countries.map(({ id }) => id)];
|
|
34990
|
-
var ZodId =
|
|
34991
|
-
var ZodTranslationsSchemaFn = (schema) =>
|
|
34990
|
+
var ZodId = import_zod22.z.enum(countryIds2);
|
|
34991
|
+
var ZodTranslationsSchemaFn = (schema) => import_zod22.z.record(import_zod22.z.string(), schema.optional());
|
|
34992
34992
|
var UsStates = [
|
|
34993
34993
|
{ id: "AA", name: "Armed Forces Americas" },
|
|
34994
34994
|
{ id: "AE", name: "Armed Forces Europe" },
|
|
@@ -36287,14 +36287,14 @@ var require_shared = __commonJS({
|
|
|
36287
36287
|
ZodNumberCurrencyPositiveValue: () => ZodNumberCurrencyPositiveValue,
|
|
36288
36288
|
ZodNumberCurrencyPositiveValueExcludingZero: () => ZodNumberCurrencyPositiveValueExcludingZero
|
|
36289
36289
|
});
|
|
36290
|
-
var
|
|
36291
|
-
var ZodCurrencyId =
|
|
36290
|
+
var import_zod23 = require_lib();
|
|
36291
|
+
var ZodCurrencyId = import_zod23.z.enum(
|
|
36292
36292
|
all_default.map(({ id }) => id)
|
|
36293
36293
|
);
|
|
36294
|
-
var ZodNumberCurrency =
|
|
36295
|
-
var ZodNumberCurrencyPositiveValue =
|
|
36296
|
-
var ZodNumberCurrencyPositiveValueExcludingZero =
|
|
36297
|
-
var ZodCurrencyMap =
|
|
36294
|
+
var ZodNumberCurrency = import_zod23.z.string().or(import_zod23.z.number().transform((number4) => number4)).transform((number4) => number4);
|
|
36295
|
+
var ZodNumberCurrencyPositiveValue = import_zod23.z.number().min(0).transform((number4) => number4).transform((number4) => number4);
|
|
36296
|
+
var ZodNumberCurrencyPositiveValueExcludingZero = import_zod23.z.number().gt(0).transform((number4) => number4).transform((number4) => number4);
|
|
36297
|
+
var ZodCurrencyMap = import_zod23.z.record(ZodNumberCurrency).refine(
|
|
36298
36298
|
(data) => Object.keys(data).every((key) => ZodCurrencyId.safeParse(key).success),
|
|
36299
36299
|
{
|
|
36300
36300
|
message: "Invalid currency key.",
|
|
@@ -39223,105 +39223,181 @@ Examples:
|
|
|
39223
39223
|
});
|
|
39224
39224
|
}
|
|
39225
39225
|
|
|
39226
|
-
// build/commands/generated/
|
|
39227
|
-
function
|
|
39228
|
-
const resource = parent.command("
|
|
39229
|
-
resource.command("
|
|
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", `
|
|
39230
39234
|
Examples:
|
|
39231
|
-
hyperline
|
|
39232
|
-
hyperline
|
|
39235
|
+
hyperline agents list-agent-plans
|
|
39236
|
+
hyperline agents list-agent-plans --mode <mode> --take <take>`).action(async (opts) => {
|
|
39233
39237
|
const ctx = resource.parent?.opts()._ctx;
|
|
39234
39238
|
if (!ctx) {
|
|
39235
39239
|
process.stderr.write("Error: Not authenticated\n");
|
|
39236
39240
|
process.exit(1);
|
|
39237
39241
|
}
|
|
39238
39242
|
const args = {};
|
|
39239
|
-
if (opts.
|
|
39240
|
-
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);
|
|
39241
39249
|
await ctx.execute({
|
|
39242
39250
|
method: "GET",
|
|
39243
|
-
path: "/v1/
|
|
39251
|
+
path: "/v1/agents/plans",
|
|
39244
39252
|
args,
|
|
39245
|
-
queryParamKeys: ["
|
|
39253
|
+
queryParamKeys: ["mode", "take", "skip"]
|
|
39246
39254
|
});
|
|
39247
39255
|
});
|
|
39248
|
-
|
|
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.
|
|
39249
39257
|
|
|
39250
|
-
|
|
39251
|
-
|
|
39252
|
-
|
|
39253
|
-
|
|
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", `
|
|
39254
39266
|
Examples:
|
|
39255
|
-
hyperline
|
|
39256
|
-
hyperline
|
|
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) => {
|
|
39257
39270
|
const ctx = resource.parent?.opts()._ctx;
|
|
39258
39271
|
if (!ctx) {
|
|
39259
39272
|
process.stderr.write("Error: Not authenticated\n");
|
|
39260
39273
|
process.exit(1);
|
|
39261
39274
|
}
|
|
39262
39275
|
const args = {};
|
|
39263
|
-
if (opts.
|
|
39264
|
-
args.
|
|
39265
|
-
if (opts.
|
|
39266
|
-
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);
|
|
39267
39300
|
await ctx.execute({
|
|
39268
|
-
method: "
|
|
39269
|
-
path: "/v1/
|
|
39301
|
+
method: "POST",
|
|
39302
|
+
path: "/v1/agents/plans",
|
|
39270
39303
|
args,
|
|
39271
|
-
queryParamKeys: [
|
|
39304
|
+
queryParamKeys: []
|
|
39272
39305
|
});
|
|
39273
39306
|
});
|
|
39274
|
-
resource.command("get").description(`
|
|
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", `
|
|
39275
39308
|
Examples:
|
|
39276
|
-
hyperline
|
|
39309
|
+
hyperline agents get-agent-plan --plan-id <plan_id>`).action(async (opts) => {
|
|
39277
39310
|
const ctx = resource.parent?.opts()._ctx;
|
|
39278
39311
|
if (!ctx) {
|
|
39279
39312
|
process.stderr.write("Error: Not authenticated\n");
|
|
39280
39313
|
process.exit(1);
|
|
39281
39314
|
}
|
|
39282
39315
|
const args = {};
|
|
39283
|
-
if (opts.
|
|
39284
|
-
args.
|
|
39316
|
+
if (opts.planId !== void 0)
|
|
39317
|
+
args.plan_id = opts.planId;
|
|
39285
39318
|
await ctx.execute({
|
|
39286
39319
|
method: "GET",
|
|
39287
|
-
path: "/v1/
|
|
39320
|
+
path: "/v1/agents/plans/{plan_id}",
|
|
39288
39321
|
args,
|
|
39289
39322
|
queryParamKeys: []
|
|
39290
39323
|
});
|
|
39291
39324
|
});
|
|
39292
|
-
resource.command("
|
|
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", `
|
|
39293
39331
|
Examples:
|
|
39294
|
-
hyperline
|
|
39295
|
-
hyperline
|
|
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) => {
|
|
39296
39335
|
const ctx = resource.parent?.opts()._ctx;
|
|
39297
39336
|
if (!ctx) {
|
|
39298
39337
|
process.stderr.write("Error: Not authenticated\n");
|
|
39299
39338
|
process.exit(1);
|
|
39300
39339
|
}
|
|
39301
39340
|
const args = {};
|
|
39302
|
-
if (opts.
|
|
39303
|
-
args.
|
|
39304
|
-
if (opts.
|
|
39305
|
-
args.
|
|
39306
|
-
if (opts.
|
|
39307
|
-
args.
|
|
39308
|
-
if (opts.
|
|
39309
|
-
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);
|
|
39310
39365
|
await ctx.execute({
|
|
39311
|
-
method: "
|
|
39312
|
-
path: "/v1/
|
|
39366
|
+
method: "PUT",
|
|
39367
|
+
path: "/v1/agents/plans/{plan_id}",
|
|
39313
39368
|
args,
|
|
39314
|
-
queryParamKeys: [
|
|
39369
|
+
queryParamKeys: []
|
|
39315
39370
|
});
|
|
39316
39371
|
});
|
|
39317
|
-
|
|
39318
|
-
|
|
39319
|
-
// build/commands/generated/companies.js
|
|
39320
|
-
function registerCompaniesCommands(parent) {
|
|
39321
|
-
const resource = parent.command("companies").description("Manage companies");
|
|
39322
|
-
resource.command("list").description(`List all companies accessible to the current authentication token. A company represents an organizational unit.`).addHelpText("after", `
|
|
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", `
|
|
39323
39373
|
Examples:
|
|
39324
|
-
hyperline
|
|
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) => {
|
|
39325
39401
|
const ctx = resource.parent?.opts()._ctx;
|
|
39326
39402
|
if (!ctx) {
|
|
39327
39403
|
process.stderr.write("Error: Not authenticated\n");
|
|
@@ -39330,63 +39406,97 @@ Examples:
|
|
|
39330
39406
|
const args = {};
|
|
39331
39407
|
await ctx.execute({
|
|
39332
39408
|
method: "GET",
|
|
39333
|
-
path: "/v1/
|
|
39409
|
+
path: "/v1/agents/default-plan",
|
|
39334
39410
|
args,
|
|
39335
39411
|
queryParamKeys: []
|
|
39336
39412
|
});
|
|
39337
39413
|
});
|
|
39338
|
-
resource.command("
|
|
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", `
|
|
39339
39415
|
Examples:
|
|
39340
|
-
hyperline
|
|
39341
|
-
hyperline
|
|
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) => {
|
|
39342
39419
|
const ctx = resource.parent?.opts()._ctx;
|
|
39343
39420
|
if (!ctx) {
|
|
39344
39421
|
process.stderr.write("Error: Not authenticated\n");
|
|
39345
39422
|
process.exit(1);
|
|
39346
39423
|
}
|
|
39347
39424
|
const args = {};
|
|
39348
|
-
if (opts.
|
|
39349
|
-
args.
|
|
39350
|
-
if (opts.
|
|
39351
|
-
args.
|
|
39425
|
+
if (opts.planId !== void 0)
|
|
39426
|
+
args.plan_id = opts.planId;
|
|
39427
|
+
if (opts.autoApply !== void 0)
|
|
39428
|
+
args.auto_apply = true;
|
|
39352
39429
|
await ctx.execute({
|
|
39353
|
-
method: "
|
|
39354
|
-
path: "/v1/
|
|
39430
|
+
method: "PUT",
|
|
39431
|
+
path: "/v1/agents/default-plan",
|
|
39355
39432
|
args,
|
|
39356
39433
|
queryParamKeys: []
|
|
39357
39434
|
});
|
|
39358
39435
|
});
|
|
39359
|
-
|
|
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.
|
|
39360
39461
|
|
|
39361
|
-
|
|
39362
|
-
|
|
39363
|
-
|
|
39364
|
-
resource.command("list").description(`List all coupons with pagination (take/skip). Coupons define discount rules (percentage or fixed amount) that can be applied to subscriptions or invoices.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
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", `
|
|
39365
39465
|
Examples:
|
|
39366
|
-
hyperline
|
|
39367
|
-
hyperline
|
|
39466
|
+
hyperline agents list-agent-rate-cards
|
|
39467
|
+
hyperline agents list-agent-rate-cards --denomination <denomination> --currency <currency>`).action(async (opts) => {
|
|
39368
39468
|
const ctx = resource.parent?.opts()._ctx;
|
|
39369
39469
|
if (!ctx) {
|
|
39370
39470
|
process.stderr.write("Error: Not authenticated\n");
|
|
39371
39471
|
process.exit(1);
|
|
39372
39472
|
}
|
|
39373
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;
|
|
39374
39480
|
if (opts.take !== void 0)
|
|
39375
39481
|
args.take = Number(opts.take);
|
|
39376
39482
|
if (opts.skip !== void 0)
|
|
39377
39483
|
args.skip = Number(opts.skip);
|
|
39378
39484
|
await ctx.execute({
|
|
39379
39485
|
method: "GET",
|
|
39380
|
-
path: "/v1/
|
|
39486
|
+
path: "/v1/agents/rate-cards",
|
|
39381
39487
|
args,
|
|
39382
|
-
queryParamKeys: ["take", "skip"]
|
|
39488
|
+
queryParamKeys: ["denomination", "currency", "search", "take", "skip"]
|
|
39383
39489
|
});
|
|
39384
39490
|
});
|
|
39385
|
-
resource.command("create").description(`Create
|
|
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", `
|
|
39386
39496
|
Examples:
|
|
39387
|
-
hyperline
|
|
39388
|
-
hyperline
|
|
39389
|
-
hyperline
|
|
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) => {
|
|
39390
39500
|
const ctx = resource.parent?.opts()._ctx;
|
|
39391
39501
|
if (!ctx) {
|
|
39392
39502
|
process.stderr.write("Error: Not authenticated\n");
|
|
@@ -39395,105 +39505,77 @@ Examples:
|
|
|
39395
39505
|
const args = {};
|
|
39396
39506
|
if (opts.name !== void 0)
|
|
39397
39507
|
args.name = opts.name;
|
|
39398
|
-
if (opts.
|
|
39399
|
-
args.
|
|
39400
|
-
if (opts.
|
|
39401
|
-
args.
|
|
39402
|
-
if (opts.repeat !== void 0)
|
|
39403
|
-
args.repeat = opts.repeat;
|
|
39404
|
-
if (opts.type !== void 0)
|
|
39405
|
-
args.type = opts.type;
|
|
39508
|
+
if (opts.fallbackPerUsd !== void 0)
|
|
39509
|
+
args.fallback_per_usd = opts.fallbackPerUsd;
|
|
39510
|
+
if (opts.denomination !== void 0)
|
|
39511
|
+
args.denomination = opts.denomination;
|
|
39406
39512
|
if (opts.currency !== void 0)
|
|
39407
39513
|
args.currency = opts.currency;
|
|
39408
|
-
if (opts.
|
|
39409
|
-
args.
|
|
39410
|
-
if (opts.discountAmount !== void 0)
|
|
39411
|
-
args.discount_amount = Number(opts.discountAmount);
|
|
39412
|
-
if (opts.discountPercent !== void 0)
|
|
39413
|
-
args.discount_percent = Number(opts.discountPercent);
|
|
39414
|
-
if (opts.productIds !== void 0)
|
|
39415
|
-
args.product_ids = JSON.parse(opts.productIds);
|
|
39416
|
-
if (opts.duration !== void 0)
|
|
39417
|
-
args.duration = JSON.parse(opts.duration);
|
|
39514
|
+
if (opts.rows !== void 0)
|
|
39515
|
+
args.rows = JSON.parse(opts.rows);
|
|
39418
39516
|
await ctx.execute({
|
|
39419
39517
|
method: "POST",
|
|
39420
|
-
path: "/v1/
|
|
39518
|
+
path: "/v1/agents/rate-cards",
|
|
39421
39519
|
args,
|
|
39422
39520
|
queryParamKeys: []
|
|
39423
39521
|
});
|
|
39424
39522
|
});
|
|
39425
|
-
resource.command("get").description(`
|
|
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", `
|
|
39426
39524
|
Examples:
|
|
39427
|
-
hyperline
|
|
39525
|
+
hyperline agents get-agent-rate-card --rate-card-id <rate_card_id>`).action(async (opts) => {
|
|
39428
39526
|
const ctx = resource.parent?.opts()._ctx;
|
|
39429
39527
|
if (!ctx) {
|
|
39430
39528
|
process.stderr.write("Error: Not authenticated\n");
|
|
39431
39529
|
process.exit(1);
|
|
39432
39530
|
}
|
|
39433
39531
|
const args = {};
|
|
39434
|
-
if (opts.
|
|
39435
|
-
args.
|
|
39532
|
+
if (opts.rateCardId !== void 0)
|
|
39533
|
+
args.rate_card_id = opts.rateCardId;
|
|
39436
39534
|
await ctx.execute({
|
|
39437
39535
|
method: "GET",
|
|
39438
|
-
path: "/v1/
|
|
39536
|
+
path: "/v1/agents/rate-cards/{rate_card_id}",
|
|
39439
39537
|
args,
|
|
39440
39538
|
queryParamKeys: []
|
|
39441
39539
|
});
|
|
39442
39540
|
});
|
|
39443
|
-
resource.command("
|
|
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", `
|
|
39444
39542
|
Examples:
|
|
39445
|
-
hyperline
|
|
39446
|
-
hyperline
|
|
39447
|
-
hyperline
|
|
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) => {
|
|
39448
39546
|
const ctx = resource.parent?.opts()._ctx;
|
|
39449
39547
|
if (!ctx) {
|
|
39450
39548
|
process.stderr.write("Error: Not authenticated\n");
|
|
39451
39549
|
process.exit(1);
|
|
39452
39550
|
}
|
|
39453
39551
|
const args = {};
|
|
39454
|
-
if (opts.
|
|
39455
|
-
args.
|
|
39552
|
+
if (opts.rateCardId !== void 0)
|
|
39553
|
+
args.rate_card_id = opts.rateCardId;
|
|
39456
39554
|
if (opts.name !== void 0)
|
|
39457
39555
|
args.name = opts.name;
|
|
39458
|
-
if (opts.
|
|
39459
|
-
args.
|
|
39460
|
-
if (opts.
|
|
39461
|
-
args.
|
|
39462
|
-
if (opts.repeat !== void 0)
|
|
39463
|
-
args.repeat = opts.repeat;
|
|
39464
|
-
if (opts.type !== void 0)
|
|
39465
|
-
args.type = opts.type;
|
|
39466
|
-
if (opts.currency !== void 0)
|
|
39467
|
-
args.currency = opts.currency;
|
|
39468
|
-
if (opts.redemptionLimit !== void 0)
|
|
39469
|
-
args.redemption_limit = Number(opts.redemptionLimit);
|
|
39470
|
-
if (opts.discountAmount !== void 0)
|
|
39471
|
-
args.discount_amount = Number(opts.discountAmount);
|
|
39472
|
-
if (opts.discountPercent !== void 0)
|
|
39473
|
-
args.discount_percent = Number(opts.discountPercent);
|
|
39474
|
-
if (opts.productIds !== void 0)
|
|
39475
|
-
args.product_ids = JSON.parse(opts.productIds);
|
|
39476
|
-
if (opts.duration !== void 0)
|
|
39477
|
-
args.duration = JSON.parse(opts.duration);
|
|
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);
|
|
39478
39560
|
await ctx.execute({
|
|
39479
39561
|
method: "PUT",
|
|
39480
|
-
path: "/v1/
|
|
39562
|
+
path: "/v1/agents/rate-cards/{rate_card_id}",
|
|
39481
39563
|
args,
|
|
39482
39564
|
queryParamKeys: []
|
|
39483
39565
|
});
|
|
39484
39566
|
});
|
|
39485
|
-
resource.command("delete").description(`
|
|
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", `
|
|
39486
39568
|
Examples:
|
|
39487
|
-
hyperline
|
|
39488
|
-
hyperline
|
|
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) => {
|
|
39489
39571
|
const ctx = resource.parent?.opts()._ctx;
|
|
39490
39572
|
if (!ctx) {
|
|
39491
39573
|
process.stderr.write("Error: Not authenticated\n");
|
|
39492
39574
|
process.exit(1);
|
|
39493
39575
|
}
|
|
39494
39576
|
const args = {};
|
|
39495
|
-
if (opts.
|
|
39496
|
-
args.
|
|
39577
|
+
if (opts.rateCardId !== void 0)
|
|
39578
|
+
args.rate_card_id = opts.rateCardId;
|
|
39497
39579
|
if (!opts.yes) {
|
|
39498
39580
|
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
39499
39581
|
if (!confirmed) {
|
|
@@ -39503,96 +39585,1064 @@ Examples:
|
|
|
39503
39585
|
}
|
|
39504
39586
|
await ctx.execute({
|
|
39505
39587
|
method: "DELETE",
|
|
39506
|
-
path: "/v1/
|
|
39588
|
+
path: "/v1/agents/rate-cards/{rate_card_id}",
|
|
39507
39589
|
args,
|
|
39508
39590
|
queryParamKeys: []
|
|
39509
39591
|
});
|
|
39510
39592
|
});
|
|
39511
|
-
|
|
39512
|
-
|
|
39513
|
-
// build/commands/generated/coupons-promotion-codes.js
|
|
39514
|
-
function registerCoupons_Promotion_CodesCommands(parent) {
|
|
39515
|
-
const resource = parent.command("coupons-promotion-codes").description("Manage coupons > promotion codes");
|
|
39516
|
-
resource.command("list-promotion-codes").description(`List promotion codes with optional filter by coupon_id. Promotion codes are shareable codes that reference a coupon. Paginated with take/skip.`).option("--take <number>", `take`).option("--skip <number>", `skip`).option("--coupon-id <value>", `coupon_id`).option("--coupon-id.not <value>", `coupon_id__not`).option("--coupon-id.is-null <value>", `coupon_id__isNull`).option("--coupon-id.is-not-null <value>", `coupon_id__isNotNull`).option("--coupon-id.equals <value>", `coupon_id__equals`).option("--coupon-id.contains <value>", `coupon_id__contains`).option("--coupon-id.starts-with <value>", `coupon_id__startsWith`).option("--coupon-id.end-with <value>", `coupon_id__endWith`).addHelpText("after", `
|
|
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", `
|
|
39517
39594
|
Examples:
|
|
39518
|
-
hyperline
|
|
39519
|
-
hyperline coupons-promotion-codes list-promotion-codes --take <take> --coupon-id <coupon_id>`).action(async (opts) => {
|
|
39595
|
+
hyperline agents list-agent-credit-products`).action(async (_opts) => {
|
|
39520
39596
|
const ctx = resource.parent?.opts()._ctx;
|
|
39521
39597
|
if (!ctx) {
|
|
39522
39598
|
process.stderr.write("Error: Not authenticated\n");
|
|
39523
39599
|
process.exit(1);
|
|
39524
39600
|
}
|
|
39525
39601
|
const args = {};
|
|
39526
|
-
if (opts.couponId !== void 0)
|
|
39527
|
-
args.coupon_id = opts.couponId;
|
|
39528
|
-
if (opts["couponId.not"] !== void 0)
|
|
39529
|
-
args.coupon_id__not = opts["couponId.not"];
|
|
39530
|
-
if (opts["couponId.isNull"] !== void 0)
|
|
39531
|
-
args.coupon_id__isNull = opts["couponId.isNull"];
|
|
39532
|
-
if (opts["couponId.isNotNull"] !== void 0)
|
|
39533
|
-
args.coupon_id__isNotNull = opts["couponId.isNotNull"];
|
|
39534
|
-
if (opts["couponId.equals"] !== void 0)
|
|
39535
|
-
args.coupon_id__equals = opts["couponId.equals"];
|
|
39536
|
-
if (opts["couponId.contains"] !== void 0)
|
|
39537
|
-
args.coupon_id__contains = opts["couponId.contains"];
|
|
39538
|
-
if (opts["couponId.startsWith"] !== void 0)
|
|
39539
|
-
args.coupon_id__startsWith = opts["couponId.startsWith"];
|
|
39540
|
-
if (opts["couponId.endWith"] !== void 0)
|
|
39541
|
-
args.coupon_id__endWith = opts["couponId.endWith"];
|
|
39542
|
-
if (opts.take !== void 0)
|
|
39543
|
-
args.take = Number(opts.take);
|
|
39544
|
-
if (opts.skip !== void 0)
|
|
39545
|
-
args.skip = Number(opts.skip);
|
|
39546
39602
|
await ctx.execute({
|
|
39547
39603
|
method: "GET",
|
|
39548
|
-
path: "/v1/
|
|
39604
|
+
path: "/v1/agents/credit-products",
|
|
39549
39605
|
args,
|
|
39550
|
-
queryParamKeys: [
|
|
39551
|
-
"take",
|
|
39552
|
-
"skip",
|
|
39553
|
-
"coupon_id",
|
|
39554
|
-
"coupon_id__not",
|
|
39555
|
-
"coupon_id__isNull",
|
|
39556
|
-
"coupon_id__isNotNull",
|
|
39557
|
-
"coupon_id__equals",
|
|
39558
|
-
"coupon_id__contains",
|
|
39559
|
-
"coupon_id__startsWith",
|
|
39560
|
-
"coupon_id__endWith"
|
|
39561
|
-
]
|
|
39606
|
+
queryParamKeys: []
|
|
39562
39607
|
});
|
|
39563
39608
|
});
|
|
39564
|
-
resource.command("
|
|
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", `
|
|
39565
39610
|
Examples:
|
|
39566
|
-
hyperline
|
|
39611
|
+
hyperline agents list-agent-cost-catalog
|
|
39612
|
+
hyperline agents list-agent-cost-catalog --enabled-only <enabled_only>`).action(async (opts) => {
|
|
39567
39613
|
const ctx = resource.parent?.opts()._ctx;
|
|
39568
39614
|
if (!ctx) {
|
|
39569
39615
|
process.stderr.write("Error: Not authenticated\n");
|
|
39570
39616
|
process.exit(1);
|
|
39571
39617
|
}
|
|
39572
39618
|
const args = {};
|
|
39573
|
-
if (opts.
|
|
39574
|
-
args.
|
|
39619
|
+
if (opts.enabledOnly !== void 0)
|
|
39620
|
+
args.enabled_only = opts.enabledOnly;
|
|
39575
39621
|
await ctx.execute({
|
|
39576
39622
|
method: "GET",
|
|
39577
|
-
path: "/v1/
|
|
39623
|
+
path: "/v1/agents/cost-catalog",
|
|
39578
39624
|
args,
|
|
39579
|
-
queryParamKeys: []
|
|
39625
|
+
queryParamKeys: ["enabled_only"]
|
|
39580
39626
|
});
|
|
39581
39627
|
});
|
|
39582
|
-
resource.command("create-
|
|
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", `
|
|
39583
39629
|
Examples:
|
|
39584
|
-
hyperline
|
|
39585
|
-
hyperline
|
|
39586
|
-
hyperline coupons-promotion-codes create-promotion-code --code <code> --coupon-id <coupon_id> --output json`).action(async (opts) => {
|
|
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) => {
|
|
39587
39632
|
const ctx = resource.parent?.opts()._ctx;
|
|
39588
39633
|
if (!ctx) {
|
|
39589
39634
|
process.stderr.write("Error: Not authenticated\n");
|
|
39590
39635
|
process.exit(1);
|
|
39591
39636
|
}
|
|
39592
39637
|
const args = {};
|
|
39593
|
-
if (opts.
|
|
39594
|
-
args.
|
|
39595
|
-
if (opts.
|
|
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
|
+
|
|
40272
|
+
// build/commands/generated/analytics.js
|
|
40273
|
+
function registerAnalyticsCommands(parent) {
|
|
40274
|
+
const resource = parent.command("analytics").description("Manage analytics");
|
|
40275
|
+
resource.command("get").description(`Retrieve pre-computed account analytics including ARR, MRR, revenues, churn rate, and other key billing metrics. Optionally filter by invoicing_entity_id. Use this to get a high-level financial overview.`).option("--invoicing-entity-id <value>", `Invoicing Entity ID to filter analytics`).addHelpText("after", `
|
|
40276
|
+
Examples:
|
|
40277
|
+
hyperline analytics get
|
|
40278
|
+
hyperline analytics get --invoicing-entity-id <invoicing_entity_id>`).action(async (opts) => {
|
|
40279
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40280
|
+
if (!ctx) {
|
|
40281
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40282
|
+
process.exit(1);
|
|
40283
|
+
}
|
|
40284
|
+
const args = {};
|
|
40285
|
+
if (opts.invoicingEntityId !== void 0)
|
|
40286
|
+
args.invoicing_entity_id = opts.invoicingEntityId;
|
|
40287
|
+
await ctx.execute({
|
|
40288
|
+
method: "GET",
|
|
40289
|
+
path: "/v1/analytics",
|
|
40290
|
+
args,
|
|
40291
|
+
queryParamKeys: ["invoicing_entity_id"]
|
|
40292
|
+
});
|
|
40293
|
+
});
|
|
40294
|
+
}
|
|
40295
|
+
|
|
40296
|
+
// build/commands/generated/bank-accounts.js
|
|
40297
|
+
function registerBank_AccountsCommands(parent) {
|
|
40298
|
+
const resource = parent.command("bank-accounts").description("Manage bank accounts");
|
|
40299
|
+
resource.command("list").description(`List all bank accounts configured on the account. Returns paginated results with take/skip.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
40300
|
+
Examples:
|
|
40301
|
+
hyperline bank-accounts list
|
|
40302
|
+
hyperline bank-accounts list --take <take>`).action(async (opts) => {
|
|
40303
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40304
|
+
if (!ctx) {
|
|
40305
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40306
|
+
process.exit(1);
|
|
40307
|
+
}
|
|
40308
|
+
const args = {};
|
|
40309
|
+
if (opts.take !== void 0)
|
|
40310
|
+
args.take = Number(opts.take);
|
|
40311
|
+
if (opts.skip !== void 0)
|
|
40312
|
+
args.skip = Number(opts.skip);
|
|
40313
|
+
await ctx.execute({
|
|
40314
|
+
method: "GET",
|
|
40315
|
+
path: "/v1/bank-accounts",
|
|
40316
|
+
args,
|
|
40317
|
+
queryParamKeys: ["take", "skip"]
|
|
40318
|
+
});
|
|
40319
|
+
});
|
|
40320
|
+
resource.command("get").description(`Retrieve a specific bank account by its ID. Returns masked bank account details, account type, balance, and currency.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
|
|
40321
|
+
Examples:
|
|
40322
|
+
hyperline bank-accounts get --id <id>`).action(async (opts) => {
|
|
40323
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40324
|
+
if (!ctx) {
|
|
40325
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40326
|
+
process.exit(1);
|
|
40327
|
+
}
|
|
40328
|
+
const args = {};
|
|
40329
|
+
if (opts.id !== void 0)
|
|
40330
|
+
args.id = opts.id;
|
|
40331
|
+
await ctx.execute({
|
|
40332
|
+
method: "GET",
|
|
40333
|
+
path: "/v1/bank-accounts/{id}",
|
|
40334
|
+
args,
|
|
40335
|
+
queryParamKeys: []
|
|
40336
|
+
});
|
|
40337
|
+
});
|
|
40338
|
+
resource.command("list-bank-account-transactions").description(`List open banking transactions for a specific bank account. Paginated with limit/cursor.`).requiredOption("--id <value>", `id parameter`).option("--limit <number>", `Maximum number of items to return (1-100).`).option("--cursor <value>", `Opaque cursor returned in the previous response's \`next_cursor\`. Omit to fetch the first page.`).option("--include-total <value>", `Set to \`true\` to include \`total\` in the response.`).addHelpText("after", `
|
|
40339
|
+
Examples:
|
|
40340
|
+
hyperline bank-accounts list-bank-account-transactions --id <id>
|
|
40341
|
+
hyperline bank-accounts list-bank-account-transactions --id <id> --limit <limit> --cursor <cursor>`).action(async (opts) => {
|
|
40342
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40343
|
+
if (!ctx) {
|
|
40344
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40345
|
+
process.exit(1);
|
|
40346
|
+
}
|
|
40347
|
+
const args = {};
|
|
40348
|
+
if (opts.id !== void 0)
|
|
40349
|
+
args.id = opts.id;
|
|
40350
|
+
if (opts.cursor !== void 0)
|
|
40351
|
+
args.cursor = opts.cursor;
|
|
40352
|
+
if (opts.includeTotal !== void 0)
|
|
40353
|
+
args.include_total = opts.includeTotal;
|
|
40354
|
+
if (opts.limit !== void 0)
|
|
40355
|
+
args.limit = Number(opts.limit);
|
|
40356
|
+
await ctx.execute({
|
|
40357
|
+
method: "GET",
|
|
40358
|
+
path: "/v1/bank-accounts/{id}/transactions",
|
|
40359
|
+
args,
|
|
40360
|
+
queryParamKeys: ["limit", "cursor", "include_total"]
|
|
40361
|
+
});
|
|
40362
|
+
});
|
|
40363
|
+
}
|
|
40364
|
+
|
|
40365
|
+
// build/commands/generated/companies.js
|
|
40366
|
+
function registerCompaniesCommands(parent) {
|
|
40367
|
+
const resource = parent.command("companies").description("Manage companies");
|
|
40368
|
+
resource.command("list").description(`List all companies accessible to the current authentication token. A company represents an organizational unit.`).addHelpText("after", `
|
|
40369
|
+
Examples:
|
|
40370
|
+
hyperline companies list`).action(async (_opts) => {
|
|
40371
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40372
|
+
if (!ctx) {
|
|
40373
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40374
|
+
process.exit(1);
|
|
40375
|
+
}
|
|
40376
|
+
const args = {};
|
|
40377
|
+
await ctx.execute({
|
|
40378
|
+
method: "GET",
|
|
40379
|
+
path: "/v1/companies",
|
|
40380
|
+
args,
|
|
40381
|
+
queryParamKeys: []
|
|
40382
|
+
});
|
|
40383
|
+
});
|
|
40384
|
+
resource.command("create-company").description(`Create a company with an approved account owner. Company creation must be enabled.`).requiredOption("--name <value>", `Company name.`).requiredOption("--address <json>", `Address of the default invoicing entity`).addHelpText("after", `
|
|
40385
|
+
Examples:
|
|
40386
|
+
hyperline companies create-company --name <name> --address <address>
|
|
40387
|
+
hyperline companies create-company --name <name> --address <address> --output json`).action(async (opts) => {
|
|
40388
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40389
|
+
if (!ctx) {
|
|
40390
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40391
|
+
process.exit(1);
|
|
40392
|
+
}
|
|
40393
|
+
const args = {};
|
|
40394
|
+
if (opts.name !== void 0)
|
|
40395
|
+
args.name = opts.name;
|
|
40396
|
+
if (opts.address !== void 0)
|
|
40397
|
+
args.address = JSON.parse(opts.address);
|
|
40398
|
+
await ctx.execute({
|
|
40399
|
+
method: "POST",
|
|
40400
|
+
path: "/v1/companies",
|
|
40401
|
+
args,
|
|
40402
|
+
queryParamKeys: []
|
|
40403
|
+
});
|
|
40404
|
+
});
|
|
40405
|
+
}
|
|
40406
|
+
|
|
40407
|
+
// build/commands/generated/coupons.js
|
|
40408
|
+
function registerCouponsCommands(parent) {
|
|
40409
|
+
const resource = parent.command("coupons").description("Manage coupons");
|
|
40410
|
+
resource.command("list").description(`List all coupons with pagination (take/skip). Coupons define discount rules (percentage or fixed amount) that can be applied to subscriptions or invoices.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
40411
|
+
Examples:
|
|
40412
|
+
hyperline coupons list
|
|
40413
|
+
hyperline coupons list --take <take>`).action(async (opts) => {
|
|
40414
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40415
|
+
if (!ctx) {
|
|
40416
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40417
|
+
process.exit(1);
|
|
40418
|
+
}
|
|
40419
|
+
const args = {};
|
|
40420
|
+
if (opts.take !== void 0)
|
|
40421
|
+
args.take = Number(opts.take);
|
|
40422
|
+
if (opts.skip !== void 0)
|
|
40423
|
+
args.skip = Number(opts.skip);
|
|
40424
|
+
await ctx.execute({
|
|
40425
|
+
method: "GET",
|
|
40426
|
+
path: "/v1/coupons",
|
|
40427
|
+
args,
|
|
40428
|
+
queryParamKeys: ["take", "skip"]
|
|
40429
|
+
});
|
|
40430
|
+
});
|
|
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", `
|
|
40432
|
+
Examples:
|
|
40433
|
+
hyperline coupons create --name <name> --type <type>
|
|
40434
|
+
hyperline coupons create --name <name> --type <type> --description <description> --expiration-date <expiration_date>
|
|
40435
|
+
hyperline coupons create --name <name> --type <type> --output json`).action(async (opts) => {
|
|
40436
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40437
|
+
if (!ctx) {
|
|
40438
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40439
|
+
process.exit(1);
|
|
40440
|
+
}
|
|
40441
|
+
const args = {};
|
|
40442
|
+
if (opts.name !== void 0)
|
|
40443
|
+
args.name = opts.name;
|
|
40444
|
+
if (opts.description !== void 0)
|
|
40445
|
+
args.description = opts.description;
|
|
40446
|
+
if (opts.expirationDate !== void 0)
|
|
40447
|
+
args.expiration_date = opts.expirationDate;
|
|
40448
|
+
if (opts.repeat !== void 0)
|
|
40449
|
+
args.repeat = opts.repeat;
|
|
40450
|
+
if (opts.type !== void 0)
|
|
40451
|
+
args.type = opts.type;
|
|
40452
|
+
if (opts.currency !== void 0)
|
|
40453
|
+
args.currency = opts.currency;
|
|
40454
|
+
if (opts.redemptionLimit !== void 0)
|
|
40455
|
+
args.redemption_limit = Number(opts.redemptionLimit);
|
|
40456
|
+
if (opts.discountAmount !== void 0)
|
|
40457
|
+
args.discount_amount = Number(opts.discountAmount);
|
|
40458
|
+
if (opts.discountPercent !== void 0)
|
|
40459
|
+
args.discount_percent = Number(opts.discountPercent);
|
|
40460
|
+
if (opts.productIds !== void 0)
|
|
40461
|
+
args.product_ids = JSON.parse(opts.productIds);
|
|
40462
|
+
if (opts.duration !== void 0)
|
|
40463
|
+
args.duration = JSON.parse(opts.duration);
|
|
40464
|
+
if (opts.properties !== void 0)
|
|
40465
|
+
args.properties = JSON.parse(opts.properties);
|
|
40466
|
+
await ctx.execute({
|
|
40467
|
+
method: "POST",
|
|
40468
|
+
path: "/v1/coupons",
|
|
40469
|
+
args,
|
|
40470
|
+
queryParamKeys: []
|
|
40471
|
+
});
|
|
40472
|
+
});
|
|
40473
|
+
resource.command("get").description(`Retrieve a specific coupon by ID including its discount configuration, redemption count, and deletion status.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
|
|
40474
|
+
Examples:
|
|
40475
|
+
hyperline coupons get --id <id>`).action(async (opts) => {
|
|
40476
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40477
|
+
if (!ctx) {
|
|
40478
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40479
|
+
process.exit(1);
|
|
40480
|
+
}
|
|
40481
|
+
const args = {};
|
|
40482
|
+
if (opts.id !== void 0)
|
|
40483
|
+
args.id = opts.id;
|
|
40484
|
+
await ctx.execute({
|
|
40485
|
+
method: "GET",
|
|
40486
|
+
path: "/v1/coupons/{id}",
|
|
40487
|
+
args,
|
|
40488
|
+
queryParamKeys: []
|
|
40489
|
+
});
|
|
40490
|
+
});
|
|
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", `
|
|
40492
|
+
Examples:
|
|
40493
|
+
hyperline coupons update --id <id> --name <name> --type <type>
|
|
40494
|
+
hyperline coupons update --id <id> --name <name> --type <type> --description <description> --expiration-date <expiration_date>
|
|
40495
|
+
hyperline coupons update --id <id> --name <name> --type <type> --output json`).action(async (opts) => {
|
|
40496
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40497
|
+
if (!ctx) {
|
|
40498
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40499
|
+
process.exit(1);
|
|
40500
|
+
}
|
|
40501
|
+
const args = {};
|
|
40502
|
+
if (opts.id !== void 0)
|
|
40503
|
+
args.id = opts.id;
|
|
40504
|
+
if (opts.name !== void 0)
|
|
40505
|
+
args.name = opts.name;
|
|
40506
|
+
if (opts.description !== void 0)
|
|
40507
|
+
args.description = opts.description;
|
|
40508
|
+
if (opts.expirationDate !== void 0)
|
|
40509
|
+
args.expiration_date = opts.expirationDate;
|
|
40510
|
+
if (opts.repeat !== void 0)
|
|
40511
|
+
args.repeat = opts.repeat;
|
|
40512
|
+
if (opts.type !== void 0)
|
|
40513
|
+
args.type = opts.type;
|
|
40514
|
+
if (opts.currency !== void 0)
|
|
40515
|
+
args.currency = opts.currency;
|
|
40516
|
+
if (opts.redemptionLimit !== void 0)
|
|
40517
|
+
args.redemption_limit = Number(opts.redemptionLimit);
|
|
40518
|
+
if (opts.discountAmount !== void 0)
|
|
40519
|
+
args.discount_amount = Number(opts.discountAmount);
|
|
40520
|
+
if (opts.discountPercent !== void 0)
|
|
40521
|
+
args.discount_percent = Number(opts.discountPercent);
|
|
40522
|
+
if (opts.productIds !== void 0)
|
|
40523
|
+
args.product_ids = JSON.parse(opts.productIds);
|
|
40524
|
+
if (opts.duration !== void 0)
|
|
40525
|
+
args.duration = JSON.parse(opts.duration);
|
|
40526
|
+
if (opts.properties !== void 0)
|
|
40527
|
+
args.properties = JSON.parse(opts.properties);
|
|
40528
|
+
await ctx.execute({
|
|
40529
|
+
method: "PUT",
|
|
40530
|
+
path: "/v1/coupons/{id}",
|
|
40531
|
+
args,
|
|
40532
|
+
queryParamKeys: []
|
|
40533
|
+
});
|
|
40534
|
+
});
|
|
40535
|
+
resource.command("delete").description(`Permanently delete a coupon by ID. This cannot be undone.`).requiredOption("--id <value>", `id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
|
|
40536
|
+
Examples:
|
|
40537
|
+
hyperline coupons delete --id <id>
|
|
40538
|
+
hyperline coupons delete --id <id> --output json`).action(async (opts) => {
|
|
40539
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40540
|
+
if (!ctx) {
|
|
40541
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40542
|
+
process.exit(1);
|
|
40543
|
+
}
|
|
40544
|
+
const args = {};
|
|
40545
|
+
if (opts.id !== void 0)
|
|
40546
|
+
args.id = opts.id;
|
|
40547
|
+
if (!opts.yes) {
|
|
40548
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
40549
|
+
if (!confirmed) {
|
|
40550
|
+
process.stdout.write("Aborted.\n");
|
|
40551
|
+
return;
|
|
40552
|
+
}
|
|
40553
|
+
}
|
|
40554
|
+
await ctx.execute({
|
|
40555
|
+
method: "DELETE",
|
|
40556
|
+
path: "/v1/coupons/{id}",
|
|
40557
|
+
args,
|
|
40558
|
+
queryParamKeys: []
|
|
40559
|
+
});
|
|
40560
|
+
});
|
|
40561
|
+
}
|
|
40562
|
+
|
|
40563
|
+
// build/commands/generated/coupons-promotion-codes.js
|
|
40564
|
+
function registerCoupons_Promotion_CodesCommands(parent) {
|
|
40565
|
+
const resource = parent.command("coupons-promotion-codes").description("Manage coupons > promotion codes");
|
|
40566
|
+
resource.command("list-promotion-codes").description(`List promotion codes with optional filter by coupon_id. Promotion codes are shareable codes that reference a coupon. Paginated with take/skip.`).option("--take <number>", `take`).option("--skip <number>", `skip`).option("--coupon-id <value>", `coupon_id`).option("--coupon-id.not <value>", `coupon_id__not`).option("--coupon-id.is-null <value>", `coupon_id__isNull`).option("--coupon-id.is-not-null <value>", `coupon_id__isNotNull`).option("--coupon-id.equals <value>", `coupon_id__equals`).option("--coupon-id.contains <value>", `coupon_id__contains`).option("--coupon-id.starts-with <value>", `coupon_id__startsWith`).option("--coupon-id.end-with <value>", `coupon_id__endWith`).addHelpText("after", `
|
|
40567
|
+
Examples:
|
|
40568
|
+
hyperline coupons-promotion-codes list-promotion-codes
|
|
40569
|
+
hyperline coupons-promotion-codes list-promotion-codes --take <take> --coupon-id <coupon_id>`).action(async (opts) => {
|
|
40570
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40571
|
+
if (!ctx) {
|
|
40572
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40573
|
+
process.exit(1);
|
|
40574
|
+
}
|
|
40575
|
+
const args = {};
|
|
40576
|
+
if (opts.couponId !== void 0)
|
|
40577
|
+
args.coupon_id = opts.couponId;
|
|
40578
|
+
if (opts["couponId.not"] !== void 0)
|
|
40579
|
+
args.coupon_id__not = opts["couponId.not"];
|
|
40580
|
+
if (opts["couponId.isNull"] !== void 0)
|
|
40581
|
+
args.coupon_id__isNull = opts["couponId.isNull"];
|
|
40582
|
+
if (opts["couponId.isNotNull"] !== void 0)
|
|
40583
|
+
args.coupon_id__isNotNull = opts["couponId.isNotNull"];
|
|
40584
|
+
if (opts["couponId.equals"] !== void 0)
|
|
40585
|
+
args.coupon_id__equals = opts["couponId.equals"];
|
|
40586
|
+
if (opts["couponId.contains"] !== void 0)
|
|
40587
|
+
args.coupon_id__contains = opts["couponId.contains"];
|
|
40588
|
+
if (opts["couponId.startsWith"] !== void 0)
|
|
40589
|
+
args.coupon_id__startsWith = opts["couponId.startsWith"];
|
|
40590
|
+
if (opts["couponId.endWith"] !== void 0)
|
|
40591
|
+
args.coupon_id__endWith = opts["couponId.endWith"];
|
|
40592
|
+
if (opts.take !== void 0)
|
|
40593
|
+
args.take = Number(opts.take);
|
|
40594
|
+
if (opts.skip !== void 0)
|
|
40595
|
+
args.skip = Number(opts.skip);
|
|
40596
|
+
await ctx.execute({
|
|
40597
|
+
method: "GET",
|
|
40598
|
+
path: "/v1/promotion-codes",
|
|
40599
|
+
args,
|
|
40600
|
+
queryParamKeys: [
|
|
40601
|
+
"take",
|
|
40602
|
+
"skip",
|
|
40603
|
+
"coupon_id",
|
|
40604
|
+
"coupon_id__not",
|
|
40605
|
+
"coupon_id__isNull",
|
|
40606
|
+
"coupon_id__isNotNull",
|
|
40607
|
+
"coupon_id__equals",
|
|
40608
|
+
"coupon_id__contains",
|
|
40609
|
+
"coupon_id__startsWith",
|
|
40610
|
+
"coupon_id__endWith"
|
|
40611
|
+
]
|
|
40612
|
+
});
|
|
40613
|
+
});
|
|
40614
|
+
resource.command("get-promotion-code").description(`Retrieve a specific promotion code by ID with its linked coupon details.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
|
|
40615
|
+
Examples:
|
|
40616
|
+
hyperline coupons-promotion-codes get-promotion-code --id <id>`).action(async (opts) => {
|
|
40617
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40618
|
+
if (!ctx) {
|
|
40619
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40620
|
+
process.exit(1);
|
|
40621
|
+
}
|
|
40622
|
+
const args = {};
|
|
40623
|
+
if (opts.id !== void 0)
|
|
40624
|
+
args.id = opts.id;
|
|
40625
|
+
await ctx.execute({
|
|
40626
|
+
method: "GET",
|
|
40627
|
+
path: "/v1/promotion-codes/{id}",
|
|
40628
|
+
args,
|
|
40629
|
+
queryParamKeys: []
|
|
40630
|
+
});
|
|
40631
|
+
});
|
|
40632
|
+
resource.command("create-promotion-code").description(`Create a new promotion code linked to an existing coupon. The code can be shared with customers for self-service discount application.`).requiredOption("--code <value>", `Promotion code.`).requiredOption("--coupon-id <value>", `Coupon ID.`).option("--customer-id <value>", `If a \`customer_id\` is set, this promotion code will only be available to this customer.`).option("--plan-id <value>", `If a \`plan_id\` is set, this promotion code will only be available for subscriptions with this plan ID.`).option("--product-id <value>", `If a \`product_id\` is set, this promotion code will only be available for subscriptions with this product ID.`).option("--expires-at <value>", `Date and time when the promotion code expires.`).option("--max-redemptions <number>", `Maximum number of redemptions for the promotion code. Independent from coupon's max redemptions.`).option("--current-redemptions <number>", `Current number of redemptions for the promotion code.`).option("--duration-count <number>", `Duration count applied to the subscription for the promotion code. 0 or null for \`once\``).option("--duration-period <value>", `Duration period applied to the subscription for the promotion code for the promotion code. Valid values are \`once\`, \`days\`, \`weeks\`, \`months\`, \`years\``).option("--only-for-first-time-order", `Whether the promotion code is only for first time orders. Defaults to \`false\``).addHelpText("after", `
|
|
40633
|
+
Examples:
|
|
40634
|
+
hyperline coupons-promotion-codes create-promotion-code --code <code> --coupon-id <coupon_id>
|
|
40635
|
+
hyperline coupons-promotion-codes create-promotion-code --code <code> --coupon-id <coupon_id> --customer-id <customer_id> --plan-id <plan_id>
|
|
40636
|
+
hyperline coupons-promotion-codes create-promotion-code --code <code> --coupon-id <coupon_id> --output json`).action(async (opts) => {
|
|
40637
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
40638
|
+
if (!ctx) {
|
|
40639
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
40640
|
+
process.exit(1);
|
|
40641
|
+
}
|
|
40642
|
+
const args = {};
|
|
40643
|
+
if (opts.code !== void 0)
|
|
40644
|
+
args.code = opts.code;
|
|
40645
|
+
if (opts.couponId !== void 0)
|
|
39596
40646
|
args.coupon_id = opts.couponId;
|
|
39597
40647
|
if (opts.customerId !== void 0)
|
|
39598
40648
|
args.customer_id = opts.customerId;
|
|
@@ -39764,147 +40814,26 @@ Examples:
|
|
|
39764
40814
|
if (opts.entities !== void 0)
|
|
39765
40815
|
args.entities = JSON.parse(opts.entities);
|
|
39766
40816
|
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;
|
|
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
|
|
@@ -40259,7 +41172,7 @@ Customer type.
|
|
|
40259
41172
|
|
|
40260
41173
|
- \`taxable\`: Taxes are automatically determined for the customer.
|
|
40261
41174
|
- \`exempt\`: The customer is exempt from tax.
|
|
40262
|
-
`).option("--registration-number <value>", `Customer registration number.`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
41175
|
+
`).option("--registration-number <value>", `Customer registration number.`).option("--einvoicing-code <value>", `Customer electronic invoicing code, used to route their e-invoices to the relevant platform (e.g. Chorus Pro routing code or Peppol identifier).`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
40263
41176
|
How customer invoices are issued from the parent organisation.
|
|
40264
41177
|
|
|
40265
41178
|
- \`none\`: Invoices will keep being issued from this customer.
|
|
@@ -40288,6 +41201,8 @@ Examples:
|
|
|
40288
41201
|
args.taxability = opts.taxability;
|
|
40289
41202
|
if (opts.registrationNumber !== void 0)
|
|
40290
41203
|
args.registration_number = opts.registrationNumber;
|
|
41204
|
+
if (opts.einvoicingCode !== void 0)
|
|
41205
|
+
args.einvoicing_code = opts.einvoicingCode;
|
|
40291
41206
|
if (opts.externalId !== void 0)
|
|
40292
41207
|
args.external_id = opts.externalId;
|
|
40293
41208
|
if (opts.domain !== void 0)
|
|
@@ -40394,7 +41309,7 @@ Customer type.
|
|
|
40394
41309
|
|
|
40395
41310
|
- \`taxable\`: Taxes are automatically determined for the customer.
|
|
40396
41311
|
- \`exempt\`: The customer is exempt from tax.
|
|
40397
|
-
`).option("--registration-number <value>", `Customer registration number.`).option("--is-government-affiliated", `Indicates if the customer is affiliated with a government entity.`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--payment-method-id <value>", `ID of the default payment method of the customer. Only applies to card and direct debit.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
41312
|
+
`).option("--registration-number <value>", `Customer registration number.`).option("--is-government-affiliated", `Indicates if the customer is affiliated with a government entity.`).option("--einvoicing-code <value>", `Customer electronic invoicing code, used to route their e-invoices to the relevant platform (e.g. Chorus Pro routing code or Peppol identifier).`).option("--external-id <value>", `ID of the customer in your system. This helps matching your customer with the one on Hyperline.`).option("--domain <value>", `Customer domain. If not defined, it is inferred from the billing email.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity this customer will be attached to.`).option("--billing-address <json>", `Customer billing address.`).option("--shipping-address <json>", `Customer shipping address.`).option("--billing-email <value>", `Email to which all communications will be sent.`).option("--invoice-emails <json>", `Emails to which invoices will be sent (e.g. payer, finance team, accounting firm). If not defined, invoices will be sent to the \`billing_email\`; otherwise, they won't be sent to the \`billing_email\`.`).option("--language <value>", `Language used for invoices, emails, and hosted pages.`).option("--timezone <value>", `Customer timezone.`).option("--available-payment-methods <json>", `List of payment methods you allow your customer to pay with. You customer will be able to select one of them in their portal page and those will be the default options when creating a checkout session.`).option("--payment-method-type <value>", `Default payment method type used to pay subscriptions and one-off invoices.`).option("--payment-method-id <value>", `ID of the default payment method of the customer. Only applies to card and direct debit.`).option("--bank-account <json>", `Custom bank account for the customer. If not defined and customer paying by bank transfer, the bank accounts configured in your account settings will be used.`).option("--custom-payment-delay <number>", `Custom payment terms in days. If not defined, the default one defined on the related invoicing entity will be used.`).option("--custom-payment-initiation-delay <number>", `Custom initiation delay in days before triggering payment. If not defined, the default one defined on the related invoicing entity will be used.`).option("--organisation-id <value>", `Parent organization ID to which the client is attached.`).option("--organisation-invoicing <value>", `
|
|
40398
41313
|
How customer invoices are issued from the parent organisation.
|
|
40399
41314
|
|
|
40400
41315
|
- \`none\`: Invoices will keep being issued from this customer.
|
|
@@ -40425,6 +41340,8 @@ Examples:
|
|
|
40425
41340
|
args.taxability = opts.taxability;
|
|
40426
41341
|
if (opts.registrationNumber !== void 0)
|
|
40427
41342
|
args.registration_number = opts.registrationNumber;
|
|
41343
|
+
if (opts.einvoicingCode !== void 0)
|
|
41344
|
+
args.einvoicing_code = opts.einvoicingCode;
|
|
40428
41345
|
if (opts.externalId !== void 0)
|
|
40429
41346
|
args.external_id = opts.externalId;
|
|
40430
41347
|
if (opts.domain !== void 0)
|
|
@@ -40657,6 +41574,133 @@ Examples:
|
|
|
40657
41574
|
});
|
|
40658
41575
|
}
|
|
40659
41576
|
|
|
41577
|
+
// build/commands/generated/customers-address.js
|
|
41578
|
+
function registerCustomers_AddressCommands(parent) {
|
|
41579
|
+
const resource = parent.command("customers-address").description("Manage customers > address");
|
|
41580
|
+
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", `
|
|
41581
|
+
Examples:
|
|
41582
|
+
hyperline customers-address list-customer-addresses --customer-id <customerId>`).action(async (opts) => {
|
|
41583
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41584
|
+
if (!ctx) {
|
|
41585
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41586
|
+
process.exit(1);
|
|
41587
|
+
}
|
|
41588
|
+
const args = {};
|
|
41589
|
+
if (opts.customerId !== void 0)
|
|
41590
|
+
args.customerId = opts.customerId;
|
|
41591
|
+
await ctx.execute({
|
|
41592
|
+
method: "GET",
|
|
41593
|
+
path: "/v1/customers/{customerId}/addresses",
|
|
41594
|
+
args,
|
|
41595
|
+
queryParamKeys: []
|
|
41596
|
+
});
|
|
41597
|
+
});
|
|
41598
|
+
resource.command("create-customer-address").description(`Create a shipping address with type shipping; billing creation is rejected because a customer can have at most one billing address, managed through the customer endpoint.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--type <value>", `Only shipping addresses can be created here. A customer has at most one active billing address, managed through the customer or by updating its address ID.`).option("--name <value>", `Address name.`).option("--line1 <value>", `Address first line.`).option("--line2 <value>", `Address second line (optional).`).option("--city <value>", `Address city.`).option("--zip <value>", `Address ZIP code.`).option("--state <value>", `Only for US country. Second part of subdivision code in ISO format. See [ISO 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US).`).option("--country <value>", `Two-letter country code in ISO format. See [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).`).option("--tax-id <value>", `Tax ID override for a shipping address. Null or blank inherits the customer's tax ID; omission on update preserves the override. Billing addresses cannot have an override.`).addHelpText("after", `
|
|
41599
|
+
Examples:
|
|
41600
|
+
hyperline customers-address create-customer-address --customer-id <customerId> --type <type>
|
|
41601
|
+
hyperline customers-address create-customer-address --customer-id <customerId> --type <type> --name <name> --line1 <line1>
|
|
41602
|
+
hyperline customers-address create-customer-address --customer-id <customerId> --type <type> --output json`).action(async (opts) => {
|
|
41603
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41604
|
+
if (!ctx) {
|
|
41605
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41606
|
+
process.exit(1);
|
|
41607
|
+
}
|
|
41608
|
+
const args = {};
|
|
41609
|
+
if (opts.customerId !== void 0)
|
|
41610
|
+
args.customerId = opts.customerId;
|
|
41611
|
+
if (opts.type !== void 0)
|
|
41612
|
+
args.type = opts.type;
|
|
41613
|
+
if (opts.name !== void 0)
|
|
41614
|
+
args.name = opts.name;
|
|
41615
|
+
if (opts.line1 !== void 0)
|
|
41616
|
+
args.line1 = opts.line1;
|
|
41617
|
+
if (opts.line2 !== void 0)
|
|
41618
|
+
args.line2 = opts.line2;
|
|
41619
|
+
if (opts.city !== void 0)
|
|
41620
|
+
args.city = opts.city;
|
|
41621
|
+
if (opts.zip !== void 0)
|
|
41622
|
+
args.zip = opts.zip;
|
|
41623
|
+
if (opts.state !== void 0)
|
|
41624
|
+
args.state = opts.state;
|
|
41625
|
+
if (opts.country !== void 0)
|
|
41626
|
+
args.country = opts.country;
|
|
41627
|
+
if (opts.taxId !== void 0)
|
|
41628
|
+
args.tax_id = opts.taxId;
|
|
41629
|
+
await ctx.execute({
|
|
41630
|
+
method: "POST",
|
|
41631
|
+
path: "/v1/customers/{customerId}/addresses",
|
|
41632
|
+
args,
|
|
41633
|
+
queryParamKeys: []
|
|
41634
|
+
});
|
|
41635
|
+
});
|
|
41636
|
+
resource.command("update-customer-address").description(`Update a billing or shipping address by ID; billing changes also update the customer billing-address projection.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--address-id <value>", `addressId parameter`).option("--name <value>", `Address name.`).option("--line1 <value>", `Address first line.`).option("--line2 <value>", `Address second line (optional).`).option("--city <value>", `Address city.`).option("--zip <value>", `Address ZIP code.`).option("--state <value>", `Only for US country. Second part of subdivision code in ISO format. See [ISO 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US).`).option("--country <value>", `Two-letter country code in ISO format. See [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).`).option("--tax-id <value>", `Tax ID override for a shipping address. Null or blank inherits the customer's tax ID; omission on update preserves the override. Billing addresses cannot have an override.`).addHelpText("after", `
|
|
41637
|
+
Examples:
|
|
41638
|
+
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId>
|
|
41639
|
+
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId> --name <name> --line1 <line1>
|
|
41640
|
+
hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId> --output json`).action(async (opts) => {
|
|
41641
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41642
|
+
if (!ctx) {
|
|
41643
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41644
|
+
process.exit(1);
|
|
41645
|
+
}
|
|
41646
|
+
const args = {};
|
|
41647
|
+
if (opts.customerId !== void 0)
|
|
41648
|
+
args.customerId = opts.customerId;
|
|
41649
|
+
if (opts.addressId !== void 0)
|
|
41650
|
+
args.addressId = opts.addressId;
|
|
41651
|
+
if (opts.name !== void 0)
|
|
41652
|
+
args.name = opts.name;
|
|
41653
|
+
if (opts.line1 !== void 0)
|
|
41654
|
+
args.line1 = opts.line1;
|
|
41655
|
+
if (opts.line2 !== void 0)
|
|
41656
|
+
args.line2 = opts.line2;
|
|
41657
|
+
if (opts.city !== void 0)
|
|
41658
|
+
args.city = opts.city;
|
|
41659
|
+
if (opts.zip !== void 0)
|
|
41660
|
+
args.zip = opts.zip;
|
|
41661
|
+
if (opts.state !== void 0)
|
|
41662
|
+
args.state = opts.state;
|
|
41663
|
+
if (opts.country !== void 0)
|
|
41664
|
+
args.country = opts.country;
|
|
41665
|
+
if (opts.taxId !== void 0)
|
|
41666
|
+
args.tax_id = opts.taxId;
|
|
41667
|
+
await ctx.execute({
|
|
41668
|
+
method: "PATCH",
|
|
41669
|
+
path: "/v1/customers/{customerId}/addresses/{addressId}",
|
|
41670
|
+
args,
|
|
41671
|
+
queryParamKeys: []
|
|
41672
|
+
});
|
|
41673
|
+
});
|
|
41674
|
+
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", `
|
|
41675
|
+
Examples:
|
|
41676
|
+
hyperline customers-address delete-customer-address --customer-id <customerId> --address-id <addressId>
|
|
41677
|
+
hyperline customers-address delete-customer-address --customer-id <customerId> --address-id <addressId> --output json`).action(async (opts) => {
|
|
41678
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
41679
|
+
if (!ctx) {
|
|
41680
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
41681
|
+
process.exit(1);
|
|
41682
|
+
}
|
|
41683
|
+
const args = {};
|
|
41684
|
+
if (opts.customerId !== void 0)
|
|
41685
|
+
args.customerId = opts.customerId;
|
|
41686
|
+
if (opts.addressId !== void 0)
|
|
41687
|
+
args.addressId = opts.addressId;
|
|
41688
|
+
if (!opts.yes) {
|
|
41689
|
+
const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
|
|
41690
|
+
if (!confirmed) {
|
|
41691
|
+
process.stdout.write("Aborted.\n");
|
|
41692
|
+
return;
|
|
41693
|
+
}
|
|
41694
|
+
}
|
|
41695
|
+
await ctx.execute({
|
|
41696
|
+
method: "DELETE",
|
|
41697
|
+
path: "/v1/customers/{customerId}/addresses/{addressId}",
|
|
41698
|
+
args,
|
|
41699
|
+
queryParamKeys: []
|
|
41700
|
+
});
|
|
41701
|
+
});
|
|
41702
|
+
}
|
|
41703
|
+
|
|
40660
41704
|
// build/commands/generated/customers-credits.js
|
|
40661
41705
|
function registerCustomers_CreditsCommands(parent) {
|
|
40662
41706
|
const resource = parent.command("customers-credits").description("Manage customers > credits");
|
|
@@ -41148,6 +42192,177 @@ Examples:
|
|
|
41148
42192
|
});
|
|
41149
42193
|
}
|
|
41150
42194
|
|
|
42195
|
+
// build/commands/generated/customers-shipping.js
|
|
42196
|
+
function registerCustomers_ShippingCommands(parent) {
|
|
42197
|
+
const resource = parent.command("customers-shipping").description("Manage customers > shipping");
|
|
42198
|
+
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", `
|
|
42199
|
+
Examples:
|
|
42200
|
+
hyperline customers-shipping get-customer-shipping-destination --customer-id <customerId>`).action(async (opts) => {
|
|
42201
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42202
|
+
if (!ctx) {
|
|
42203
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42204
|
+
process.exit(1);
|
|
42205
|
+
}
|
|
42206
|
+
const args = {};
|
|
42207
|
+
if (opts.customerId !== void 0)
|
|
42208
|
+
args.customerId = opts.customerId;
|
|
42209
|
+
await ctx.execute({
|
|
42210
|
+
method: "GET",
|
|
42211
|
+
path: "/v1/customers/{customerId}/shipping",
|
|
42212
|
+
args,
|
|
42213
|
+
queryParamKeys: []
|
|
42214
|
+
});
|
|
42215
|
+
});
|
|
42216
|
+
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", `
|
|
42217
|
+
Examples:
|
|
42218
|
+
hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination>
|
|
42219
|
+
hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination> --address-id <address_id>
|
|
42220
|
+
hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination> --output json`).action(async (opts) => {
|
|
42221
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42222
|
+
if (!ctx) {
|
|
42223
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42224
|
+
process.exit(1);
|
|
42225
|
+
}
|
|
42226
|
+
const args = {};
|
|
42227
|
+
if (opts.customerId !== void 0)
|
|
42228
|
+
args.customerId = opts.customerId;
|
|
42229
|
+
if (opts.destination !== void 0)
|
|
42230
|
+
args.destination = opts.destination;
|
|
42231
|
+
if (opts.addressId !== void 0)
|
|
42232
|
+
args.address_id = opts.addressId;
|
|
42233
|
+
await ctx.execute({
|
|
42234
|
+
method: "PUT",
|
|
42235
|
+
path: "/v1/customers/{customerId}/shipping",
|
|
42236
|
+
args,
|
|
42237
|
+
queryParamKeys: []
|
|
42238
|
+
});
|
|
42239
|
+
});
|
|
42240
|
+
}
|
|
42241
|
+
|
|
42242
|
+
// build/commands/generated/customers-usage.js
|
|
42243
|
+
function registerCustomers_UsageCommands(parent) {
|
|
42244
|
+
const resource = parent.command("customers-usage").description("Manage customers > usage");
|
|
42245
|
+
resource.command("list-customer-usage").description(`List one usage row per aggregator for a single customer over a period (total + event count per aggregator).`).requiredOption("--id <value>", `id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).addHelpText("after", `
|
|
42246
|
+
Examples:
|
|
42247
|
+
hyperline customers-usage list-customer-usage --id <id>
|
|
42248
|
+
hyperline customers-usage list-customer-usage --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42249
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42250
|
+
if (!ctx) {
|
|
42251
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42252
|
+
process.exit(1);
|
|
42253
|
+
}
|
|
42254
|
+
const args = {};
|
|
42255
|
+
if (opts.id !== void 0)
|
|
42256
|
+
args.id = opts.id;
|
|
42257
|
+
if (opts.startDate !== void 0)
|
|
42258
|
+
args.start_date = opts.startDate;
|
|
42259
|
+
if (opts.endDate !== void 0)
|
|
42260
|
+
args.end_date = opts.endDate;
|
|
42261
|
+
await ctx.execute({
|
|
42262
|
+
method: "GET",
|
|
42263
|
+
path: "/v1/customers/{id}/usage",
|
|
42264
|
+
args,
|
|
42265
|
+
queryParamKeys: ["start_date", "end_date"]
|
|
42266
|
+
});
|
|
42267
|
+
});
|
|
42268
|
+
resource.command("get-customer-usage").description(`Get the usage of a customer for a specific aggregator over a period.`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).addHelpText("after", `
|
|
42269
|
+
Examples:
|
|
42270
|
+
hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id>
|
|
42271
|
+
hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42272
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42273
|
+
if (!ctx) {
|
|
42274
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42275
|
+
process.exit(1);
|
|
42276
|
+
}
|
|
42277
|
+
const args = {};
|
|
42278
|
+
if (opts.id !== void 0)
|
|
42279
|
+
args.id = opts.id;
|
|
42280
|
+
if (opts.aggregatorId !== void 0)
|
|
42281
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42282
|
+
if (opts.startDate !== void 0)
|
|
42283
|
+
args.start_date = opts.startDate;
|
|
42284
|
+
if (opts.endDate !== void 0)
|
|
42285
|
+
args.end_date = opts.endDate;
|
|
42286
|
+
await ctx.execute({
|
|
42287
|
+
method: "GET",
|
|
42288
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}",
|
|
42289
|
+
args,
|
|
42290
|
+
queryParamKeys: ["start_date", "end_date"]
|
|
42291
|
+
});
|
|
42292
|
+
});
|
|
42293
|
+
resource.command("get-customer-usage-timeseries").description(`Get per-bucket usage for a customer + aggregator (month/day/hour).`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--group-by <value>", `Bucket size for the timeseries.`).addHelpText("after", `
|
|
42294
|
+
Examples:
|
|
42295
|
+
hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id>
|
|
42296
|
+
hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42297
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42298
|
+
if (!ctx) {
|
|
42299
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42300
|
+
process.exit(1);
|
|
42301
|
+
}
|
|
42302
|
+
const args = {};
|
|
42303
|
+
if (opts.id !== void 0)
|
|
42304
|
+
args.id = opts.id;
|
|
42305
|
+
if (opts.aggregatorId !== void 0)
|
|
42306
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42307
|
+
if (opts.startDate !== void 0)
|
|
42308
|
+
args.start_date = opts.startDate;
|
|
42309
|
+
if (opts.endDate !== void 0)
|
|
42310
|
+
args.end_date = opts.endDate;
|
|
42311
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
42312
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
42313
|
+
if (opts.groupBy !== void 0)
|
|
42314
|
+
args.group_by = opts.groupBy;
|
|
42315
|
+
await ctx.execute({
|
|
42316
|
+
method: "GET",
|
|
42317
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}/timeseries",
|
|
42318
|
+
args,
|
|
42319
|
+
queryParamKeys: [
|
|
42320
|
+
"start_date",
|
|
42321
|
+
"end_date",
|
|
42322
|
+
"aggregator_filter_id",
|
|
42323
|
+
"group_by"
|
|
42324
|
+
]
|
|
42325
|
+
});
|
|
42326
|
+
});
|
|
42327
|
+
resource.command("get-customer-usage-events").description(`List raw billable events for a customer + aggregator over a period. Paginated with take/skip.`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
|
|
42328
|
+
Examples:
|
|
42329
|
+
hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id>
|
|
42330
|
+
hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
|
|
42331
|
+
const ctx = resource.parent?.opts()._ctx;
|
|
42332
|
+
if (!ctx) {
|
|
42333
|
+
process.stderr.write("Error: Not authenticated\n");
|
|
42334
|
+
process.exit(1);
|
|
42335
|
+
}
|
|
42336
|
+
const args = {};
|
|
42337
|
+
if (opts.id !== void 0)
|
|
42338
|
+
args.id = opts.id;
|
|
42339
|
+
if (opts.aggregatorId !== void 0)
|
|
42340
|
+
args.aggregator_id = opts.aggregatorId;
|
|
42341
|
+
if (opts.startDate !== void 0)
|
|
42342
|
+
args.start_date = opts.startDate;
|
|
42343
|
+
if (opts.endDate !== void 0)
|
|
42344
|
+
args.end_date = opts.endDate;
|
|
42345
|
+
if (opts.aggregatorFilterId !== void 0)
|
|
42346
|
+
args.aggregator_filter_id = opts.aggregatorFilterId;
|
|
42347
|
+
if (opts.take !== void 0)
|
|
42348
|
+
args.take = Number(opts.take);
|
|
42349
|
+
if (opts.skip !== void 0)
|
|
42350
|
+
args.skip = Number(opts.skip);
|
|
42351
|
+
await ctx.execute({
|
|
42352
|
+
method: "GET",
|
|
42353
|
+
path: "/v1/customers/{id}/usage/{aggregator_id}/events",
|
|
42354
|
+
args,
|
|
42355
|
+
queryParamKeys: [
|
|
42356
|
+
"start_date",
|
|
42357
|
+
"end_date",
|
|
42358
|
+
"aggregator_filter_id",
|
|
42359
|
+
"take",
|
|
42360
|
+
"skip"
|
|
42361
|
+
]
|
|
42362
|
+
});
|
|
42363
|
+
});
|
|
42364
|
+
}
|
|
42365
|
+
|
|
41151
42366
|
// build/commands/generated/exports.js
|
|
41152
42367
|
function registerExportsCommands(parent) {
|
|
41153
42368
|
const resource = parent.command("exports").description("Manage exports");
|
|
@@ -42917,7 +44132,7 @@ How the periodic credit allowance is granted for partial billing periods.
|
|
|
42917
44132
|
|
|
42918
44133
|
- \`prorated\` (default): the granted credits are prorated to the elapsed period.
|
|
42919
44134
|
- \`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", `
|
|
44135
|
+
`).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
44136
|
Examples:
|
|
42922
44137
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations>
|
|
42923
44138
|
hyperline products create --name <name> --type <type> --price-configurations <price_configurations> --description <description> --description-display-interval-dates
|
|
@@ -42942,6 +44157,8 @@ Examples:
|
|
|
42942
44157
|
args.unit_name = opts.unitName;
|
|
42943
44158
|
if (opts.creditsGrantMode !== void 0)
|
|
42944
44159
|
args.credits_grant_mode = opts.creditsGrantMode;
|
|
44160
|
+
if (opts.creditsBalanceAutoCreationEnabled !== void 0)
|
|
44161
|
+
args.credits_balance_auto_creation_enabled = opts.creditsBalanceAutoCreationEnabled;
|
|
42945
44162
|
if (opts.displayMode !== void 0)
|
|
42946
44163
|
args.display_mode = opts.displayMode;
|
|
42947
44164
|
if (opts.lowCreditsThreshold !== void 0)
|
|
@@ -43116,7 +44333,7 @@ Quote status.
|
|
|
43116
44333
|
- \`all\`: Display all pricing tiers.
|
|
43117
44334
|
- \`matching\`: Only display the tiers used to compute the price based on quantity.
|
|
43118
44335
|
- \`none\`: Hide all pricing tiers.
|
|
43119
|
-
`).option("--display-phase-value <value>", `Display per-phase value breakdown on the quote.`).option("--display-first-invoice-amount <value>", `Display the first invoice amount on the quote.`).option("--display-documents-in-preview <value>", `Display attached documents in the quote preview.`).option("--
|
|
44336
|
+
`).option("--display-phase-value <value>", `Display per-phase value breakdown on the quote.`).option("--display-first-invoice-amount <value>", `Display the first invoice amount on the quote.`).option("--display-documents-in-preview <value>", `Display attached documents in the quote preview.`).option("--subscription-update-display <value>", `Sections displayed on subscription update quotes: quote_update_details, subscription_details, or both. Takes precedence over display_subscription_on_update.`).option("--generate-draft-invoices <value>", `When \`true\`, the invoice issued after signature stays in \`draft\` status instead of being emitted for payment. Use this when you want to review the final invoice manually before sending it. Defaults to \`false\`.`).option("--template-id <value>", `ID of the quote template. If not specified, a subscription configuration or an \`invoice\` payload must be defined.`).option("--expires-at <value>", `Quote expiration date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--subscription <json>", `Subscription configuration constituting the quote.`).option("--invoice <json>", `Invoice configuration constituting the one-off quote. When provided, a draft invoice is created and linked to the quote. Cannot be combined with \`subscription\` or \`template_id\`.`).addHelpText("after", `
|
|
43120
44337
|
Examples:
|
|
43121
44338
|
hyperline quotes create --customer-id <customer_id>
|
|
43122
44339
|
hyperline quotes create --customer-id <customer_id> --status <status> --owner-email <owner_email>
|
|
@@ -43159,8 +44376,8 @@ Examples:
|
|
|
43159
44376
|
args.display_first_invoice_amount = opts.displayFirstInvoiceAmount;
|
|
43160
44377
|
if (opts.displayDocumentsInPreview !== void 0)
|
|
43161
44378
|
args.display_documents_in_preview = opts.displayDocumentsInPreview;
|
|
43162
|
-
if (opts.
|
|
43163
|
-
args.
|
|
44379
|
+
if (opts.subscriptionUpdateDisplay !== void 0)
|
|
44380
|
+
args.subscription_update_display = opts.subscriptionUpdateDisplay;
|
|
43164
44381
|
if (opts.generateDraftInvoices !== void 0)
|
|
43165
44382
|
args.generate_draft_invoices = opts.generateDraftInvoices;
|
|
43166
44383
|
if (opts.templateId !== void 0)
|
|
@@ -43408,7 +44625,7 @@ Examples:
|
|
|
43408
44625
|
- \`all\`: Display all pricing tiers.
|
|
43409
44626
|
- \`matching\`: Only display the tiers used to compute the price based on quantity.
|
|
43410
44627
|
- \`none\`: Hide all pricing tiers.
|
|
43411
|
-
`).option("--display-phase-value <value>", `Display per-phase value breakdown on the quote.`).option("--display-first-invoice-amount <value>", `Display the first invoice amount on the quote.`).option("--display-documents-in-preview <value>", `Display attached documents in the quote preview.`).option("--
|
|
44628
|
+
`).option("--display-phase-value <value>", `Display per-phase value breakdown on the quote.`).option("--display-first-invoice-amount <value>", `Display the first invoice amount on the quote.`).option("--display-documents-in-preview <value>", `Display attached documents in the quote preview.`).option("--subscription-update-display <value>", `Sections displayed on subscription update quotes: quote_update_details, subscription_details, or both. Takes precedence over display_subscription_on_update.`).option("--generate-draft-invoices <value>", `When \`true\`, the invoice issued after signature stays in \`draft\` status instead of being emitted for payment. Use this when you want to review the final invoice manually before sending it. Defaults to \`false\`.`).option("--crm-opportunity-id <value>", `ID of the related opportunity/deal in the connected CRM.`).option("--expires-at <value>", `Quote expiration date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Set to \`null\` to clear the expiration.`).option("--subscription <json>", `Subscription configuration constituting the quote. When provided on a draft quote, it creates or replaces the draft subscription attached to the quote.`).option("--invoice <json>", `Invoice configuration constituting the one-off quote. When provided on a draft one-off quote, it deletes the previous draft invoice and creates a fresh one linked to the quote. \`invoice.invoicing_entity_id\` is ignored on update \u2014 the quote's existing invoicing entity is reused.`).addHelpText("after", `
|
|
43412
44629
|
Examples:
|
|
43413
44630
|
hyperline quotes update --id <id>
|
|
43414
44631
|
hyperline quotes update --id <id> --owner-email <owner_email> --catalog-version-id <catalog_version_id>
|
|
@@ -43447,8 +44664,8 @@ Examples:
|
|
|
43447
44664
|
args.display_first_invoice_amount = opts.displayFirstInvoiceAmount;
|
|
43448
44665
|
if (opts.displayDocumentsInPreview !== void 0)
|
|
43449
44666
|
args.display_documents_in_preview = opts.displayDocumentsInPreview;
|
|
43450
|
-
if (opts.
|
|
43451
|
-
args.
|
|
44667
|
+
if (opts.subscriptionUpdateDisplay !== void 0)
|
|
44668
|
+
args.subscription_update_display = opts.subscriptionUpdateDisplay;
|
|
43452
44669
|
if (opts.generateDraftInvoices !== void 0)
|
|
43453
44670
|
args.generate_draft_invoices = opts.generateDraftInvoices;
|
|
43454
44671
|
if (opts.crmOpportunityId !== void 0)
|
|
@@ -44008,7 +45225,7 @@ Strategy used to activate the subscription.
|
|
|
44008
45225
|
- \`manually\`: The subscription requires activation through a manual action.
|
|
44009
45226
|
- \`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
45227
|
- \`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>", `
|
|
45228
|
+
`).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
45229
|
Strategy used to cancel the subscription. If not specified \`do_nothing\` is used.
|
|
44013
45230
|
|
|
44014
45231
|
- \`charge_prorata\`: Will charge the customer the unpaid amount for the prorated period up to the end of the current period.
|
|
@@ -44060,6 +45277,8 @@ Examples:
|
|
|
44060
45277
|
args.starts_at = opts.startsAt;
|
|
44061
45278
|
if (opts.initialBillingAt !== void 0)
|
|
44062
45279
|
args.initial_billing_at = opts.initialBillingAt;
|
|
45280
|
+
if (opts.shippingAddressId !== void 0)
|
|
45281
|
+
args.shipping_address_id = opts.shippingAddressId;
|
|
44063
45282
|
if (opts.displayShippingDetails !== void 0)
|
|
44064
45283
|
args.display_shipping_details = opts.displayShippingDetails;
|
|
44065
45284
|
if (opts.cancelAt !== void 0)
|
|
@@ -44370,7 +45589,7 @@ Defines when invoices are generated relative to the billing period.
|
|
|
44370
45589
|
|
|
44371
45590
|
- \`period_start\`: Invoices are generated at the start of the billing period.
|
|
44372
45591
|
- \`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", `
|
|
45592
|
+
`).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
45593
|
Examples:
|
|
44375
45594
|
hyperline subscriptions update --id <id>
|
|
44376
45595
|
hyperline subscriptions update --id <id> --name <name> --purchase-order <purchase_order>
|
|
@@ -44411,6 +45630,8 @@ Examples:
|
|
|
44411
45630
|
args.initial_billing_at = opts.initialBillingAt;
|
|
44412
45631
|
if (opts.cancelAt !== void 0)
|
|
44413
45632
|
args.cancel_at = opts.cancelAt;
|
|
45633
|
+
if (opts.shippingAddressId !== void 0)
|
|
45634
|
+
args.shipping_address_id = opts.shippingAddressId;
|
|
44414
45635
|
if (opts.displayShippingDetails !== void 0)
|
|
44415
45636
|
args.display_shipping_details = opts.displayShippingDetails;
|
|
44416
45637
|
if (opts.minimumInvoiceFee !== void 0)
|
|
@@ -45516,7 +46737,10 @@ function registerAllCommands(program2) {
|
|
|
45516
46737
|
registerAccounting_ReportsCommands(program2);
|
|
45517
46738
|
registerAccounting_Revenue_RecognitionCommands(program2);
|
|
45518
46739
|
registerAccounting_RulesCommands(program2);
|
|
46740
|
+
registerAgentsCommands(program2);
|
|
45519
46741
|
registerCustom_PropertiesCommands(program2);
|
|
46742
|
+
registerAggregatorsCommands(program2);
|
|
46743
|
+
registerAggregators_UsageCommands(program2);
|
|
45520
46744
|
registerAnalyticsCommands(program2);
|
|
45521
46745
|
registerBank_AccountsCommands(program2);
|
|
45522
46746
|
registerCompaniesCommands(program2);
|
|
@@ -45524,7 +46748,10 @@ function registerAllCommands(program2) {
|
|
|
45524
46748
|
registerCoupons_Promotion_CodesCommands(program2);
|
|
45525
46749
|
registerCustomers_CreditsCommands(program2);
|
|
45526
46750
|
registerCustomers_Payment_MethodsCommands(program2);
|
|
46751
|
+
registerCustomers_AddressCommands(program2);
|
|
46752
|
+
registerCustomers_ShippingCommands(program2);
|
|
45527
46753
|
registerCustomersCommands(program2);
|
|
46754
|
+
registerCustomers_UsageCommands(program2);
|
|
45528
46755
|
registerOrganisationsCommands(program2);
|
|
45529
46756
|
registerCustomers_SegmentsCommands(program2);
|
|
45530
46757
|
registerExportsCommands(program2);
|
|
@@ -61484,12 +62711,41 @@ var DateTimeSchema = external_exports.iso.datetime({
|
|
|
61484
62711
|
example: "2024-12-20T16:04:11Z"
|
|
61485
62712
|
});
|
|
61486
62713
|
|
|
62714
|
+
// ../hyperline-lib/build/http/dto/decimal.js
|
|
62715
|
+
var DecimalStringSchema = external_exports.string().regex(/^-?\d+(\.\d+)?(e[+-]?\d+)?$/i).openapi({
|
|
62716
|
+
description: "Exact decimal string. Interpret the unit using the field description and denomination.",
|
|
62717
|
+
example: "0.0021"
|
|
62718
|
+
});
|
|
62719
|
+
var NonNegativeDecimalStringSchema = external_exports.string().regex(/^\d+(\.\d+)?$/).max(40).openapi({
|
|
62720
|
+
description: "Non-negative exact decimal string, at most 40 characters.",
|
|
62721
|
+
example: "0.0021"
|
|
62722
|
+
});
|
|
62723
|
+
|
|
61487
62724
|
// ../hyperline-lib/build/http/dto/domain.js
|
|
61488
62725
|
var DomainSchema = external_exports.string().trim().toLowerCase().regex(/^(?!:\/\/)(?=.{1,253}$)(?!-)([a-z0-9-]{1,63}\.)+[a-z]{2,63}$/, "Invalid domain").openapi({
|
|
61489
62726
|
description: "Domain name.",
|
|
61490
62727
|
example: "acme.com"
|
|
61491
62728
|
});
|
|
61492
62729
|
|
|
62730
|
+
// ../hyperline-lib/build/http/dto/emailStatus.js
|
|
62731
|
+
var EmailStatusSchema = external_exports.enum([
|
|
62732
|
+
"sent",
|
|
62733
|
+
"delivered",
|
|
62734
|
+
"opened",
|
|
62735
|
+
"clicked",
|
|
62736
|
+
"spammed",
|
|
62737
|
+
"bounced",
|
|
62738
|
+
"queued",
|
|
62739
|
+
"drafted",
|
|
62740
|
+
"attempted",
|
|
62741
|
+
"failed",
|
|
62742
|
+
"undeliverable",
|
|
62743
|
+
"converted",
|
|
62744
|
+
"suppressed",
|
|
62745
|
+
"unsubscribed",
|
|
62746
|
+
"dropped"
|
|
62747
|
+
]);
|
|
62748
|
+
|
|
61493
62749
|
// ../hyperline-lib/build/http/dto/error.js
|
|
61494
62750
|
var ErrorSchema = external_exports.object({
|
|
61495
62751
|
message: external_exports.string()
|