@hyperline/cli 0.1.0-build.1.69d7fa9 → 0.1.0-build.1.6a6eb49

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.
@@ -40908,6 +40908,130 @@ Examples:
40908
40908
  });
40909
40909
  }
40910
40910
 
40911
+ // build/commands/generated/contracts-clauses.js
40912
+ function registerContracts_ClausesCommands(parent) {
40913
+ const resource = parent.command("contracts-clauses").description("Manage contracts > clauses");
40914
+ resource.command("list-contract-clauses").description(`List the contract clauses of the contract library, with their texts and translations. Use the returned IDs in \`contract_clause_ids\` when creating a quote. Paginated with take/skip.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
40915
+ Examples:
40916
+ hyperline contracts-clauses list-contract-clauses
40917
+ hyperline contracts-clauses list-contract-clauses --take <take>`).action(async (opts) => {
40918
+ const ctx = resource.parent?.opts()._ctx;
40919
+ if (!ctx) {
40920
+ process.stderr.write("Error: Not authenticated\n");
40921
+ process.exit(1);
40922
+ }
40923
+ const args = {};
40924
+ if (opts.take !== void 0)
40925
+ args.take = Number(opts.take);
40926
+ if (opts.skip !== void 0)
40927
+ args.skip = Number(opts.skip);
40928
+ await ctx.execute({
40929
+ method: "GET",
40930
+ path: "/v1/contracts/clauses",
40931
+ args,
40932
+ queryParamKeys: ["take", "skip"]
40933
+ });
40934
+ });
40935
+ resource.command("create-contract-clause").description(`Create a contract clause in the contract library, with a default text and optional translations keyed by language code.`).requiredOption("--name <value>", `Name of the contract clause, displayed in the contract library.`).requiredOption("--text <value>", `Default text of the clause, used when no translation exists for the customer language. Plain text, line breaks are preserved.`).option("--translations <json>", `Translations of the clause, keyed by language code. The translation matching the customer language is used instead of \`text\`.`).option("--invoicing-entity-ids <json>", `IDs of the invoicing entities for which the clause is available when building a quote.`).addHelpText("after", `
40936
+ Examples:
40937
+ hyperline contracts-clauses create-contract-clause --name <name> --text <text>
40938
+ hyperline contracts-clauses create-contract-clause --name <name> --text <text> --translations <translations> --invoicing-entity-ids <invoicing_entity_ids>
40939
+ hyperline contracts-clauses create-contract-clause --name <name> --text <text> --output json`).action(async (opts) => {
40940
+ const ctx = resource.parent?.opts()._ctx;
40941
+ if (!ctx) {
40942
+ process.stderr.write("Error: Not authenticated\n");
40943
+ process.exit(1);
40944
+ }
40945
+ const args = {};
40946
+ if (opts.name !== void 0)
40947
+ args.name = opts.name;
40948
+ if (opts.text !== void 0)
40949
+ args.text = opts.text;
40950
+ if (opts.translations !== void 0)
40951
+ args.translations = JSON.parse(opts.translations);
40952
+ if (opts.invoicingEntityIds !== void 0)
40953
+ args.invoicing_entity_ids = JSON.parse(opts.invoicingEntityIds);
40954
+ await ctx.execute({
40955
+ method: "POST",
40956
+ path: "/v1/contracts/clauses",
40957
+ args,
40958
+ queryParamKeys: []
40959
+ });
40960
+ });
40961
+ resource.command("get-contract-clause").description(`Retrieve a contract clause by ID.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
40962
+ Examples:
40963
+ hyperline contracts-clauses get-contract-clause --id <id>`).action(async (opts) => {
40964
+ const ctx = resource.parent?.opts()._ctx;
40965
+ if (!ctx) {
40966
+ process.stderr.write("Error: Not authenticated\n");
40967
+ process.exit(1);
40968
+ }
40969
+ const args = {};
40970
+ if (opts.id !== void 0)
40971
+ args.id = opts.id;
40972
+ await ctx.execute({
40973
+ method: "GET",
40974
+ path: "/v1/contracts/clauses/{id}",
40975
+ args,
40976
+ queryParamKeys: []
40977
+ });
40978
+ });
40979
+ resource.command("update-contract-clause").description(`Update the name, text, translations or invoicing entities of a contract clause. Sending \`translations\` replaces all existing translations.`).requiredOption("--id <value>", `id parameter`).option("--name <value>", `Name of the contract clause, displayed in the contract library.`).option("--text <value>", `Default text of the clause, used when no translation exists for the customer language. Plain text, line breaks are preserved.`).option("--translations <json>", `Translations of the clause, keyed by language code. Replaces all existing translations: omitted languages are removed.`).option("--invoicing-entity-ids <json>", `IDs of the invoicing entities for which the clause is available when building a quote.`).addHelpText("after", `
40980
+ Examples:
40981
+ hyperline contracts-clauses update-contract-clause --id <id>
40982
+ hyperline contracts-clauses update-contract-clause --id <id> --name <name> --text <text>
40983
+ hyperline contracts-clauses update-contract-clause --id <id> --output json`).action(async (opts) => {
40984
+ const ctx = resource.parent?.opts()._ctx;
40985
+ if (!ctx) {
40986
+ process.stderr.write("Error: Not authenticated\n");
40987
+ process.exit(1);
40988
+ }
40989
+ const args = {};
40990
+ if (opts.id !== void 0)
40991
+ args.id = opts.id;
40992
+ if (opts.name !== void 0)
40993
+ args.name = opts.name;
40994
+ if (opts.text !== void 0)
40995
+ args.text = opts.text;
40996
+ if (opts.translations !== void 0)
40997
+ args.translations = JSON.parse(opts.translations);
40998
+ if (opts.invoicingEntityIds !== void 0)
40999
+ args.invoicing_entity_ids = JSON.parse(opts.invoicingEntityIds);
41000
+ await ctx.execute({
41001
+ method: "PUT",
41002
+ path: "/v1/contracts/clauses/{id}",
41003
+ args,
41004
+ queryParamKeys: []
41005
+ });
41006
+ });
41007
+ resource.command("delete-contract-clause").description(`Delete a contract clause from the contract library. Existing quotes keep their copy of the clause.`).requiredOption("--id <value>", `id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
41008
+ Examples:
41009
+ hyperline contracts-clauses delete-contract-clause --id <id>
41010
+ hyperline contracts-clauses delete-contract-clause --id <id> --output json`).action(async (opts) => {
41011
+ const ctx = resource.parent?.opts()._ctx;
41012
+ if (!ctx) {
41013
+ process.stderr.write("Error: Not authenticated\n");
41014
+ process.exit(1);
41015
+ }
41016
+ const args = {};
41017
+ if (opts.id !== void 0)
41018
+ args.id = opts.id;
41019
+ if (!opts.yes) {
41020
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
41021
+ if (!confirmed) {
41022
+ process.stdout.write("Aborted.\n");
41023
+ return;
41024
+ }
41025
+ }
41026
+ await ctx.execute({
41027
+ method: "DELETE",
41028
+ path: "/v1/contracts/clauses/{id}",
41029
+ args,
41030
+ queryParamKeys: []
41031
+ });
41032
+ });
41033
+ }
41034
+
40911
41035
  // build/commands/generated/coupons.js
40912
41036
  function registerCouponsCommands(parent) {
40913
41037
  const resource = parent.command("coupons").description("Manage coupons");
@@ -47727,6 +47851,7 @@ function registerAllCommands(program2) {
47727
47851
  registerBank_AccountsCommands(program2);
47728
47852
  registerCatalogCommands(program2);
47729
47853
  registerCompaniesCommands(program2);
47854
+ registerContracts_ClausesCommands(program2);
47730
47855
  registerCouponsCommands(program2);
47731
47856
  registerCoupons_Promotion_CodesCommands(program2);
47732
47857
  registerCustomers_CreditsCommands(program2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperline/cli",
3
- "version": "0.1.0-build.1.69d7fa9",
3
+ "version": "0.1.0-build.1.6a6eb49",
4
4
  "description": "Agent-first CLI for Hyperline API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",