creght-cli 0.7.3 → 0.7.5

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,15 @@ 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> --data=./content.json --sort=15
432
+ ```
433
+
434
+ `sort` controls the order editors see in the CMS list — bigger shows first, and `0` is a real value rather than "unset". When neither the flag nor the file sets it, the request omits `sort` entirely: `create` takes the platform default (appended last) and `update` leaves the entry's current sort 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.
435
+
434
436
  ## Manage Forms
435
437
 
436
438
  List, create, update, and delete forms:
@@ -484,7 +486,9 @@ creght table record delete --site_id=<project_id>/<site_id> --table=appointments
484
486
  ```
485
487
 
486
488
  `record update` sends a patch body to the backend. Existing fields are merged,
487
- and a `null` field value removes that field.
489
+ and a `null` field value removes that field. Both `create` and `update` accept
490
+ `--sort=<n>` with the same semantics as content sort: `0` is a real value, and
491
+ omitting the flag leaves `sort` out of the request instead of zeroing it.
488
492
 
489
493
  ## Func Backend Code As Files
490
494
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "creght-cli",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
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