@hardfin/cli 0.1.1-dev.62 → 0.1.1-dev.64

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/README.md CHANGED
@@ -51,27 +51,47 @@ and the shape of the last segment decide the verb.
51
51
 
52
52
  Everything an endpoint takes becomes a flag or an argument. No command asks for JSON.
53
53
 
54
- | The document says | You type |
55
- | ------------------------------ | ---------------------------------------------------------------------- |
56
- | A path parameter | a positional argument |
57
- | A query or body field | `--field-name`, in kebab case |
58
- | A field inside a nested object | `--address-city`, the path joined |
59
- | An array of values | the flag, repeated |
60
- | An array of objects | the flag, repeated, each carrying that element's fields as `key=value` |
61
- | A file upload | `--file <path>`, sent as multipart |
54
+ | The document says | You type |
55
+ | ------------------------------ | ----------------------------------------------------------------------- |
56
+ | A path parameter | a positional argument |
57
+ | A query or body field | `--field-name`, in kebab case |
58
+ | A field inside a nested object | `--address-city`, the path joined |
59
+ | An amount of money | `--sale-price-value` and `--sale-price-iso-code`, always given together |
60
+ | An array of values | the flag, repeated |
61
+ | An array of objects | the flag, repeated, each carrying that element's fields as `key=value` |
62
+ | An object inside such an array | a dotted key in that element, `unitPrice.amount=1500.00` |
63
+ | A list of text inside one | that key, once per value, `serials=SN-1,serials=SN-2` |
64
+ | A file upload | `--file <path>`, sent as multipart |
62
65
 
63
66
  ```sh
64
67
  hardfin asset ownership create ast_4f9xk2mq7plr8stz \
65
- --customer-id 0192f7d4-3b6a-7c1e-9f2d-5a8b4c6e7d73 --date 2026-09-23 --sale-price 1500.00
68
+ --customer-id 0192f7d4-3b6a-7c1e-9f2d-5a8b4c6e7d73 --date 2026-09-23 \
69
+ --sale-price-value 1500.00 --sale-price-iso-code USD
66
70
 
67
71
  hardfin asset move execute create \
68
72
  --move assetId=0192f7d4-3b6a-7c1e-9f2d-5a8b4c6e7d70,originId=0192f7d4-3b6a-7c1e-9f2d-5a8b4c6e7d71,destinationId=0192f7d4-3b6a-7c1e-9f2d-5a8b4c6e7d72,shipAt=2026-09-24T10:00:00Z
73
+
74
+ hardfin project create --name "Denver install" \
75
+ --line-item itemId=0192f7d4-3b6a-7c1e-9f2d-5a8b4c6e7d74,quantity=40,transactionType=SERVICE,unitPrice.amount=125.50,unitPrice.isoCode=USD
76
+
77
+ hardfin shipment ship shp_2wn8kq4lxp7rtz3m --ship-location-id 0192f7d4-3b6a-7c1e-9f2d-5a8b4c6e7d71 \
78
+ --shipped-at 2026-10-13T10:00:00Z \
79
+ --item itemId=0192f7d4-3b6a-7c1e-9f2d-5a8b4c6e7d74,quantity=2,serials=SN-000123,serials=SN-000124
69
80
  ```
70
81
 
82
+ A list of text inside an element, such as a shipment line's `serials`, is given by naming its
83
+ key once per value. An element field that holds anything larger, such as a line item's
84
+ `milestonePhases`, has no flag spelling. Send that request body with `--input`.
85
+
71
86
  A value is sent as the type the document names. `--useful-life 36` sends the number 36. A
72
- decimal such as `--salvage-value 1500.00` stays a string, which is how the API takes money
87
+ decimal such as `--salvage-value-value 1500.00` stays a string, which is how the API takes money
73
88
  without losing precision.
74
89
 
90
+ An amount of money always names its currency. `--salvage-value-value` is refused without
91
+ `--salvage-value-iso-code`, and the reverse, unless the `--input` body already holds the other.
92
+ Inside an element, `unitPrice.amount=` and `unitPrice.isoCode=` are given together the same way.
93
+ To clear an amount, send the object as null, such as `--salvage-value null`.
94
+
75
95
  Inside a `key=value` flag, `=` gives a value as you typed it and `:=` gives it as JSON.
76
96
 
77
97
  | You type | Is sent as |
@@ -230,6 +250,9 @@ Settle it in `surface-overrides.json`, keyed by `operationId`:
230
250
  }
231
251
  ```
232
252
 
253
+ An override also shortens an action on a record. `POST /shipment/{shipmentKey}/ship` generates
254
+ `shipment ship create`, and its override names it `shipment ship`.
255
+
233
256
  An override for an `operationId` the document no longer publishes fails the generator. That
234
257
  is deliberate, because a silently dropped override renames a command nobody meant to rename.
235
258
 
@@ -538,8 +561,9 @@ asking and ask before anything changes.
538
561
  | `hardfin://commands` | The command tree as JSON | Only when the agent reads it |
539
562
 
540
563
  The server asks the CLI's own parser what a call would run, and places the call by its
541
- method. A flag whose value is `--help`, or a `--method` given twice, is placed by what the
542
- command would do.
564
+ method. A flag whose value is `--help` is placed by what the command would do. A `--method`
565
+ given twice runs nothing, because the parser refuses a flag that takes one value when it is
566
+ given again.
543
567
 
544
568
  | A call is | When |
545
569
  | --------- | --------------------------------------------------------------------------- |
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="32c6ff44-5b5a-5c1d-a718-7808ccc648a2")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aacd0112-e361-5290-9a4f-2ad41bcf2520")}catch(e){}}();
4
4
  import module from "node:module";
5
5
  //#region src/cli.ts
6
6
  module.enableCompileCache?.();
@@ -14,7 +14,7 @@ process.on("unhandledRejection", (error) => void toCrash(error));
14
14
  try {
15
15
  const answer = await toQuickAnswer(process.argv.slice(2));
16
16
  if (answer === void 0) {
17
- const { toCli, toParseExitCode, wasReportAttempted } = await import("./program-JKHwms47.js");
17
+ const { toCli, toParseExitCode, wasReportAttempted } = await import("./program-Bok0tZ8p.js");
18
18
  try {
19
19
  await toCli().parseAsync(process.argv);
20
20
  } catch (error) {
@@ -33,7 +33,7 @@ async function toCrash(error) {
33
33
  isCrashing = true;
34
34
  const isJSON = process.argv.includes("--json") || !process.stdout.isTTY;
35
35
  try {
36
- const { toReported, writeCrash } = await import("./program-JKHwms47.js");
36
+ const { toReported, writeCrash } = await import("./program-Bok0tZ8p.js");
37
37
  writeCrash(error, isJSON);
38
38
  await toReported(error, isJSON, void 0, "fatal");
39
39
  } catch {
@@ -54,4 +54,4 @@ async function toQuickAnswer(args) {
54
54
  export {};
55
55
 
56
56
  //# sourceMappingURL=cli.js.map
57
- //# debugId=32c6ff44-5b5a-5c1d-a718-7808ccc648a2
57
+ //# debugId=aacd0112-e361-5290-9a4f-2ad41bcf2520