creght-cli 0.7.4 → 0.7.6

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
@@ -410,19 +410,12 @@ creght content update --site_id=<project_id>/<site_id> --collection=blogs --id=<
410
410
  creght content delete --site_id=<project_id>/<site_id> --collection=blogs --id=<content_id>
411
411
  ```
412
412
 
413
- `--data` can point to either a plain CMS content body or a full content object. A plain content body may include a business field named `body`. The CLI treats JSON as a full content object only when it includes wrapper fields such as `id`, `slug`, `content_app_id`, `json_schema`, `status`, `sort`, or `tags`.
414
-
415
- If your business JSON has a top-level `slug`, do not pass it as plain body JSON because `slug` is a content wrapper field. Either pass the slug as a flag and omit it from `--data`:
416
-
417
- ```bash
418
- creght content create --site_id=<project_id>/<site_id> --collection=prompts --data=./content-body.json --slug=typography-v02
419
- ```
420
-
421
- Or use a full content object and put business fields under `body`:
413
+ `--data` must be a full content object whose business fields sit under an object-valued `body` key. This is the only accepted format a bare body is rejected with a format error, because guessing between the two shapes silently dropped fields whenever the body itself contained a name like `tags`, `slug`, or `sort`.
422
414
 
423
415
  ```json
424
416
  {
425
417
  "slug": "typography-v02",
418
+ "sort": 15,
426
419
  "body": {
427
420
  "title": "Typography V.02",
428
421
  "description": "100vh",
@@ -431,6 +424,19 @@ Or use a full content object and put business fields under `body`:
431
424
  }
432
425
  ```
433
426
 
427
+ Top-level `slug` and `sort` are optional; the `--slug` / `--sort` flags override the file only when actually passed:
428
+
429
+ ```bash
430
+ creght content create --site_id=<project_id>/<site_id> --collection=prompts --data=./content.json --slug=typography-v02
431
+ creght content update --site_id=<project_id>/<site_id> --collection=prompts --id=<content_id> --sort=15
432
+ ```
433
+
434
+ `update` applies a partial update, so `--data` is optional there — pass `--slug` / `--sort` alone to rename or reorder without re-submitting the body, as in the command above. `create` still requires `--data`.
435
+
436
+ `sort` controls the order editors see in the CMS list, bigger first. Omitting it lets `create` append the entry last and leaves `update`'s current value alone. Use `content update --sort` to reorder; deleting and recreating an entry changes its id, and site versions do not snapshot CMS content, so that cannot be undone.
437
+
438
+ One asymmetry worth knowing: the platform reads a zero `sort` on **create** as "auto-assign, append last", so a literal `0` cannot be created — `create --sort=0` appends. `update --sort=0` does store a real 0.
439
+
434
440
  ## Manage Forms
435
441
 
436
442
  List, create, update, and delete forms:
@@ -484,7 +490,11 @@ creght table record delete --site_id=<project_id>/<site_id> --table=appointments
484
490
  ```
485
491
 
486
492
  `record update` sends a patch body to the backend. Existing fields are merged,
487
- and a `null` field value removes that field.
493
+ and a `null` field value removes that field. Both `create` and `update` accept
494
+ `--sort=<n>`; omitting the flag leaves `sort` out of the request instead of
495
+ zeroing it. Unlike content, a record's `sort` cannot be set to `0` — the platform
496
+ ignores a zero sort on record update, so `--sort=0` is rejected there rather than
497
+ silently doing nothing, and on `create` it means "append last".
488
498
 
489
499
  ## Func Backend Code As Files
490
500
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "creght-cli",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "description": "Creght CLI for syncing local site code with Creght.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/creght-dev/creght-cli#readme",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file