zinkee 0.1.32 → 0.1.34

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.
@@ -677,38 +677,58 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
677
677
  ]),
678
678
  "records create": buildCommandExamples([
679
679
  {
680
- description: "Minimal create using just two plain string fields.",
680
+ description:
681
+ "Create a single record with --set/--set-json (the single-record flags build one record, sent as a one-element 'records' array).",
681
682
  command:
682
683
  `zinkee --json records create contacts --set contact-name="Ada Lovelace" --set contact-email=ada@example.com`,
683
684
  raw: `{
684
- "values": {
685
- "contact-name": "Ada Lovelace",
686
- "contact-email": "ada@example.com"
687
- }
685
+ "records": [
686
+ {
687
+ "contact-name": "Ada Lovelace",
688
+ "contact-email": "ada@example.com"
689
+ }
690
+ ]
688
691
  }`,
689
692
  response: `{
690
- "recordId": "550e8400-e29b-41d4-a716-446655440000",
691
- "values": {
692
- "contact-name": "Ada Lovelace",
693
- "contact-email": "ada@example.com"
694
- }
693
+ "created": [
694
+ "550e8400-e29b-41d4-a716-446655440000"
695
+ ],
696
+ "errors": []
695
697
  }`,
696
698
  },
697
699
  {
698
700
  description:
699
- "Create a record mixing text, option, number, date, reference and member fields. ReferenceField values must match the target's current targetDisplayField (read it from the target record before writing).",
700
- command:
701
- `zinkee --json records create contacts --set contact-name="Grace Hopper" --set contact-email=grace@example.com --set status=2 --set amount=1999.99 --set due-date=2026-06-01T09:00:00Z --set customer-ref="CUST-12" --set owner=6c8a3e0d-4e5f-4a1b-9c2d-3e4f5a6b7c8d`,
701
+ "Create many records from a JSON array file (one object per record, slug -> value). Best-effort: valid records are created and invalid ones are reported per index in 'errors'. ReferenceField values must match the target's current targetDisplayField.",
702
+ command: `zinkee --json records create contacts --records-file ./records.json`,
702
703
  raw: `{
703
- "values": {
704
- "contact-name": "Grace Hopper",
705
- "contact-email": "grace@example.com",
706
- "status": 2,
707
- "amount": 1999.99,
708
- "due-date": "2026-06-01T09:00:00Z",
709
- "customer-ref": "CUST-12",
710
- "owner": "6c8a3e0d-4e5f-4a1b-9c2d-3e4f5a6b7c8d"
711
- }
704
+ "records": [
705
+ {
706
+ "contact-name": "Ada Lovelace",
707
+ "contact-email": "ada@example.com"
708
+ },
709
+ {
710
+ "contact-name": "Grace Hopper",
711
+ "contact-email": "grace@example.com",
712
+ "status": 2,
713
+ "amount": 1999.99,
714
+ "due-date": "2026-06-01T09:00:00Z",
715
+ "customer-ref": "8ad602a1-f6e3-43f6-9ab2-f1c5afc99621",
716
+ "owner": "6c8a3e0d-4e5f-4a1b-9c2d-3e4f5a6b7c8d"
717
+ }
718
+ ]
719
+ }`,
720
+ response: `{
721
+ "created": [
722
+ "550e8400-e29b-41d4-a716-446655440000"
723
+ ],
724
+ "errors": [
725
+ {
726
+ "index": 1,
727
+ "reason": "record_field_not_found",
728
+ "message": "Field 'contact-emial' was not found in schema '2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e'.",
729
+ "action": "Use a valid field slug from the schema and retry."
730
+ }
731
+ ]
712
732
  }`,
713
733
  },
714
734
  ]),
@@ -2461,10 +2481,25 @@ const specificExamples: Record<string, readonly CommandExample[]> = {
2461
2481
  ]),
2462
2482
  "records delete": buildCommandExamples([
2463
2483
  {
2464
- description: "Delete a record.",
2465
- command: `zinkee --json records delete contacts ${SAMPLE_UUID}`,
2484
+ description: "Delete one or more records by id (--record is repeatable).",
2485
+ command: `zinkee --json records delete contacts --record 550e8400-e29b-41d4-a716-446655440000 --record 6c8a3e0d-4e5f-4a1b-9c2d-3e4f5a6b7c8d`,
2466
2486
  response: `{
2467
- "recordId": "550e8400-e29b-41d4-a716-446655440000",
2487
+ "recordIds": [
2488
+ "550e8400-e29b-41d4-a716-446655440000",
2489
+ "6c8a3e0d-4e5f-4a1b-9c2d-3e4f5a6b7c8d"
2490
+ ],
2491
+ "deleted": true
2492
+ }`,
2493
+ },
2494
+ {
2495
+ description:
2496
+ "Delete many records listing one uuid per line in a file (merged with any --record flags and de-duplicated).",
2497
+ command: `zinkee --json records delete contacts --records-file ./record-ids.txt`,
2498
+ response: `{
2499
+ "recordIds": [
2500
+ "550e8400-e29b-41d4-a716-446655440000",
2501
+ "6c8a3e0d-4e5f-4a1b-9c2d-3e4f5a6b7c8d"
2502
+ ],
2468
2503
  "deleted": true
2469
2504
  }`,
2470
2505
  },