@varde-flyt/vfac 0.10.0 → 0.11.0

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.
Files changed (3) hide show
  1. package/README.md +45 -7
  2. package/dist/vfac.mjs +16 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -91,13 +91,14 @@ identifier in a manifest that is yours: a resource key is 3–63 characters of
91
91
  lowercase letters, digits and hyphens, starting with a letter and ending with a
92
92
  letter or digit.
93
93
 
94
- **A key is claimed for good, and a delete does not release it.** The record of a
95
- deleted resource keeps its key, so a manifest that named it can never apply again
96
- `vfac plan` answers `GONE` and a replacement needs a different key. That is
97
- worth knowing before the delete rather than after it, because after it there is
98
- nothing to undo; `vfac lifecycle delete` says the same thing at the prompt. If
99
- what you want is to stop the service and keep the option of bringing it back,
100
- `vfac lifecycle suspend` is the reversible one.
94
+ **A live resource holds its key, and a finished delete releases it.** The key
95
+ stays claimed while the teardown runs, so nothing can take the name before the
96
+ original is gone. Once the delete completes the name is free and the same
97
+ manifest applies again as a `CREATE`, building a NEW resource with nothing in
98
+ it. Reuse is not a restore, which is worth knowing before the delete rather than
99
+ after it: the apply succeeds, so nothing will stop you. `vfac lifecycle delete`
100
+ says the same thing at the prompt. If what you want is to stop the service and
101
+ keep its data, `vfac lifecycle suspend` is the reversible one.
101
102
 
102
103
  ## Reading a setting from another resource
103
104
 
@@ -193,6 +194,43 @@ credential the connection delivers never appears in your manifest, in a plan, or
193
194
  in any `vfac` output — the providing service issues it and the platform stores
194
195
  it.
195
196
 
197
+ ## For an agent or a pipeline
198
+
199
+ Every command takes `--output json`, and it is the same data rather than a
200
+ prettier subset — the human format of `vfac product show` prints a readable
201
+ selection on purpose, and the JSON carries the whole Product contract.
202
+
203
+ ```sh
204
+ vfac product show <productId> --output json
205
+ vfac plan -f resource.yaml --output json
206
+ vfac get product-instance <productInstanceId> --output json
207
+ vfac get product-instances --output json
208
+ ```
209
+
210
+ **Decide from the action, not from the exit code.** A plan that REFUSES still
211
+ exits 0: a plan reporting `UPGRADE_REQUIRED` did what it was asked, and the
212
+ answer is "not like this". A job that reads only the exit code treats that as
213
+ success and applies nothing.
214
+
215
+ ```sh
216
+ ACTION="$(vfac plan -f resource.yaml --output json | jq -r .action)"
217
+ ```
218
+
219
+ **And a non-zero exit is a real failure.** The code is not decoration: a
220
+ `NO_CHANGE` against a resource that is not actually serving exits 1, with
221
+ `--output json` as without it, because "nothing needed applying" and "it works"
222
+ are different answers. Read the action for what the plan MEANS and the exit code
223
+ for whether anything is WRONG — neither substitutes for the other.
224
+
225
+ The envelopes are stable at the top level:
226
+
227
+ | Command | Answers with |
228
+ | --- | --- |
229
+ | `vfac get product-instance <id> --output json` | `resource` and `lifecycle` — `status`, `outputs` and `conditions` are under `resource` |
230
+ | `vfac get product-instances --output json` | `productInstances` and `nextCursor` |
231
+
232
+ `vfac guide` is authoritative for what is inside them.
233
+
196
234
  ## Running it again
197
235
 
198
236
  **Send no secret.** A pipeline re-applies the same manifest on every push:
package/dist/vfac.mjs CHANGED
@@ -16804,9 +16804,16 @@ var MANIFEST_ACTIONS = [
16804
16804
  /** The key names a resource and the document matches it. A pipeline that runs
16805
16805
  * on every push and changes nothing reports this, and it is SUCCESS. */
16806
16806
  "NO_CHANGE",
16807
- /** The key names a resource that was DELETED. Its own verb, because both
16807
+ /** `adopt` points at a resource that was DELETED. Its own verb, because both
16808
16808
  * alternatives are wrong: `NO_CHANGE` would call a missing resource fine, and
16809
- * `CREATE` cannot be honoured while the tombstone holds the key. */
16809
+ * `CREATE` would silently ignore the `adopt` the caller asked for.
16810
+ *
16811
+ * IT USED TO COVER A SECOND, COMMONER CASE: a manifest whose `metadata.key`
16812
+ * named a deleted resource, back when a key was claimed for ever. A completed
16813
+ * delete now releases the key, so that manifest is planned as a `CREATE` and
16814
+ * the verb narrowed to the one case a caller reaches by naming a `pri_…` by
16815
+ * hand. Kept in the vocabulary rather than removed: it is still produced, and
16816
+ * a Control Plane that still answers it must still be understood. */
16810
16817
  "GONE",
16811
16818
  /** The document pins a different release. Done through `:upgrade`, which has
16812
16819
  * the Definition's own capability check, its own version resolution and its
@@ -18437,8 +18444,9 @@ Run \`vfac get product-instance pri_\u2026\` to see which ones this credential m
18437
18444
  if (command === "delete" && !parsed.booleans.has("yes")) {
18438
18445
  process.stderr.write(
18439
18446
  `delete removes ${instanceId} and everything it is serving. This cannot be undone.
18440
- If it was deployed from a manifest, its \`metadata.key\` stays claimed: a replacement
18441
- needs a different key, and re-applying the same file will answer GONE.
18447
+ If it was deployed from a manifest, its \`metadata.key\` is held until this delete
18448
+ FINISHES, then released. Applying the same file afterwards creates a new, empty
18449
+ resource under that key. It does not bring this one back.
18442
18450
  Re-run with --yes to confirm: vfac lifecycle delete ${instanceId} --yes
18443
18451
  Or suspend it instead, which stops it and keeps it: \`vfac lifecycle suspend\`.
18444
18452
  `
@@ -18597,7 +18605,10 @@ Authentication
18597
18605
 
18598
18606
  Exit codes
18599
18607
  0 done \u2014 including "no change", which is what a pipeline that changes nothing
18600
- should report
18608
+ should report, AND including a plan that refuses. plan answers what would
18609
+ happen; "it would be refused" is an answer, so it exits 0. Read the action,
18610
+ not the code: vfac plan -f resource.yaml --output json, then branch on
18611
+ .action
18601
18612
  1 refused, the request was wrong, or the resource matches your manifest and is
18602
18613
  NOT serving. "Nothing needed applying" is not the same as "it works", and a
18603
18614
  NO_CHANGE that could be a false green is the case this one exists for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varde-flyt/vfac",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Deploy and manage Varde Flyt Products from a manifest.",
5
5
  "repository": {
6
6
  "type": "git",