buezli-api 0.1.3 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72afbc79a92f0dcf2fa04d2845f1e32c92e6b3f7458a577bc6035bd0900fb029
4
- data.tar.gz: 33431ed374dd3736966ec91ed11d98dac857800269d36caa169c719fd32a66f8
3
+ metadata.gz: 77a3197316474cb805a02be4365b7b09005bc4a15f38ac1effb88a5c9238de42
4
+ data.tar.gz: 212dcbba0b71fb8b14bf32e2683a69f2186191e7b1acbb8050ce3a27d05f8e49
5
5
  SHA512:
6
- metadata.gz: 706ecfa2d6bfff78c0688307c91f02ad5bb5830da79a615cfdd7f986eeff5963de37e73b2fc49bc081b679a9320f48f358cd46837bcf85e058ac19457bda420f
7
- data.tar.gz: 8aa3ca708ddccc580eb38789af9cf5b8fd511a1c8fb3785f38c5ff9eb3546470b4e9290b6b3a20c280999d850a956ef30c5ed2a15e736ec63c67756ca7f65e96
6
+ metadata.gz: 34b03912ec06dd551a679bddf1bbacebdb11cfbcfe0483b7c175e1019cefa3e105cc853206870021496d7e4b318313fa1cd750f7892a3922eaf2cd450b4e8b90
7
+ data.tar.gz: 07dc7644a6a29db6f5404fef52fde917ac8e168c9b296e262090f6378752a28880efdfb77b0bf8dac896c7b4dfaa88202fed8260aeff18fda2aa47a2ba4b978b
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # buezli-api
2
2
 
3
- The official schema-driven Ruby client for the read-only
3
+ The official schema-driven, read-only Ruby client for the
4
4
  [Buezli API](https://buezli.app/api). Buezli is straightforward invoicing,
5
5
  time tracking, and project management for small service teams. Learn more at
6
6
  [buezli.app](https://buezli.app).
@@ -79,6 +79,23 @@ next_page = invoices.next_page
79
79
  previous_page = next_page&.previous_page
80
80
  ```
81
81
 
82
+ Collections include archived records (with `archived_at`), voided invoices
83
+ and running time entries (with `status`); `archived: false` narrows a resource
84
+ that can be archived. A tombstone means only that the record was deleted.
85
+ Buezli reports deletions for 90 days. An older `updated_since` raises an error
86
+ with the code `FULL_SYNC_REQUIRED`: list the resource again without it and
87
+ treat records you no longer receive as deleted.
88
+
89
+ ```ruby
90
+ begin
91
+ changes = client.retrieve_projects(updated_since: last_synced_at)
92
+ rescue Buezli::Api::Client::Error => error
93
+ raise unless error.code == "FULL_SYNC_REQUIRED"
94
+
95
+ full_sync(client.retrieve_projects)
96
+ end
97
+ ```
98
+
82
99
  ## Downloads
83
100
 
84
101
  ```ruby
@@ -42,7 +42,8 @@ module Buezli
42
42
 
43
43
  def define_methods_from_schema
44
44
  schema.endpoints.each do |resource, endpoints|
45
- endpoints.each do |endpoint_config|
45
+ # The client reads; write endpoints have no generated methods.
46
+ endpoints.select { |endpoint_config| endpoint_config.fetch("verb") == "GET" }.each do |endpoint_config|
46
47
  define_singleton_method(method_name_for(resource, endpoint_config.fetch("action"))) do |*path_values, **params|
47
48
  perform_endpoint(resource, endpoint_config, path_values, params)
48
49
  end
@@ -1,5 +1,5 @@
1
1
  module Buezli
2
2
  module Api
3
- VERSION = "0.1.3"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -261,6 +261,18 @@
261
261
  }
262
262
  }
263
263
  },
264
+ "Membership": {
265
+ "resource_name": "memberships",
266
+ "attributes": {
267
+ "id": "integer",
268
+ "created_at": "datetime",
269
+ "updated_at": "datetime",
270
+ "name": "string",
271
+ "role": "string",
272
+ "archived_at": "datetime"
273
+ },
274
+ "associations": {}
275
+ },
264
276
  "Payment": {
265
277
  "resource_name": "payments",
266
278
  "attributes": {
@@ -297,6 +309,9 @@
297
309
  "notes": "string",
298
310
  "currency": "string",
299
311
  "project_type": "string",
312
+ "rate_source": "string",
313
+ "hourly_rate": "money",
314
+ "fee": "money",
300
315
  "starts_on": "date",
301
316
  "ends_on": "date",
302
317
  "archived_at": "datetime"
@@ -306,6 +321,54 @@
306
321
  "type": "belongs_to",
307
322
  "class_name": "Client",
308
323
  "inline": false
324
+ },
325
+ "project_tasks": {
326
+ "type": "has_many",
327
+ "class_name": "ProjectTask",
328
+ "inline": true
329
+ },
330
+ "project_assignments": {
331
+ "type": "has_many",
332
+ "class_name": "ProjectAssignment",
333
+ "inline": true
334
+ }
335
+ }
336
+ },
337
+ "ProjectAssignment": {
338
+ "resource_name": "project_assignments",
339
+ "attributes": {
340
+ "id": "integer",
341
+ "created_at": "datetime",
342
+ "updated_at": "datetime",
343
+ "membership_id": "integer",
344
+ "project_manager": "boolean",
345
+ "hourly_rate": "money",
346
+ "archived_at": "datetime"
347
+ },
348
+ "associations": {
349
+ "membership": {
350
+ "type": "belongs_to",
351
+ "class_name": "Membership",
352
+ "inline": false
353
+ }
354
+ }
355
+ },
356
+ "ProjectTask": {
357
+ "resource_name": "project_tasks",
358
+ "attributes": {
359
+ "id": "integer",
360
+ "created_at": "datetime",
361
+ "updated_at": "datetime",
362
+ "task_id": "integer",
363
+ "billable": "boolean",
364
+ "hourly_rate": "money",
365
+ "archived_at": "datetime"
366
+ },
367
+ "associations": {
368
+ "task": {
369
+ "type": "belongs_to",
370
+ "class_name": "Task",
371
+ "inline": false
309
372
  }
310
373
  }
311
374
  },
@@ -340,6 +403,8 @@
340
403
  "tax_rate": "decimal",
341
404
  "interval_unit": "string",
342
405
  "interval_count": "integer",
406
+ "anchor_day": "integer",
407
+ "end_of_month": "boolean",
343
408
  "starts_on": "date",
344
409
  "next_issue_on": "date",
345
410
  "ends_on": "date",
@@ -380,6 +445,7 @@
380
445
  "client_id": "integer",
381
446
  "project_id": "integer",
382
447
  "task_id": "integer",
448
+ "membership_id": "integer",
383
449
  "invoice_id": "integer",
384
450
  "spent_on": "date",
385
451
  "duration_seconds": "integer",
@@ -387,7 +453,15 @@
387
453
  "billable": "boolean",
388
454
  "billed": "boolean",
389
455
  "billable_rate": "money",
390
- "cost_rate": "money"
456
+ "cost_rate": "money",
457
+ "status": "string",
458
+ "tracking_key": "string",
459
+ "started_at": "datetime",
460
+ "ended_at": "datetime",
461
+ "last_heartbeat_at": "datetime",
462
+ "elapsed_duration_seconds": "integer",
463
+ "agent_harness_id": "integer",
464
+ "tracking_source": "string"
391
465
  },
392
466
  "associations": {
393
467
  "client": {
@@ -405,10 +479,20 @@
405
479
  "class_name": "Task",
406
480
  "inline": false
407
481
  },
482
+ "membership": {
483
+ "type": "belongs_to",
484
+ "class_name": "Membership",
485
+ "inline": false
486
+ },
408
487
  "invoice": {
409
488
  "type": "belongs_to",
410
489
  "class_name": "Invoice",
411
490
  "inline": false
491
+ },
492
+ "agent_harness": {
493
+ "type": "belongs_to",
494
+ "class_name": "AgentHarness",
495
+ "inline": false
412
496
  }
413
497
  }
414
498
  }
@@ -427,10 +511,45 @@
427
511
  "verb": "GET",
428
512
  "path": "/2026-07-14/clients"
429
513
  },
514
+ {
515
+ "action": "create",
516
+ "verb": "POST",
517
+ "path": "/2026-07-14/clients",
518
+ "params": {
519
+ "required": [
520
+ "name"
521
+ ],
522
+ "optional": [
523
+ "address",
524
+ "currency",
525
+ "locale"
526
+ ]
527
+ }
528
+ },
430
529
  {
431
530
  "action": "show",
432
531
  "verb": "GET",
433
532
  "path": "/2026-07-14/clients/:id"
533
+ },
534
+ {
535
+ "action": "update",
536
+ "verb": "PATCH",
537
+ "path": "/2026-07-14/clients/:id",
538
+ "params": {
539
+ "required": [],
540
+ "optional": [
541
+ "name",
542
+ "address",
543
+ "currency",
544
+ "locale",
545
+ "archived"
546
+ ]
547
+ }
548
+ },
549
+ {
550
+ "action": "destroy",
551
+ "verb": "DELETE",
552
+ "path": "/2026-07-14/clients/:id"
434
553
  }
435
554
  ],
436
555
  "contacts": [
@@ -439,10 +558,50 @@
439
558
  "verb": "GET",
440
559
  "path": "/2026-07-14/contacts"
441
560
  },
561
+ {
562
+ "action": "create",
563
+ "verb": "POST",
564
+ "path": "/2026-07-14/contacts",
565
+ "params": {
566
+ "required": [
567
+ "client_id"
568
+ ],
569
+ "optional": [
570
+ "title",
571
+ "first_name",
572
+ "last_name",
573
+ "email",
574
+ "phone_office",
575
+ "phone_mobile"
576
+ ]
577
+ }
578
+ },
442
579
  {
443
580
  "action": "show",
444
581
  "verb": "GET",
445
582
  "path": "/2026-07-14/contacts/:id"
583
+ },
584
+ {
585
+ "action": "update",
586
+ "verb": "PATCH",
587
+ "path": "/2026-07-14/contacts/:id",
588
+ "params": {
589
+ "required": [],
590
+ "optional": [
591
+ "title",
592
+ "first_name",
593
+ "last_name",
594
+ "email",
595
+ "phone_office",
596
+ "phone_mobile",
597
+ "archived"
598
+ ]
599
+ }
600
+ },
601
+ {
602
+ "action": "destroy",
603
+ "verb": "DELETE",
604
+ "path": "/2026-07-14/contacts/:id"
446
605
  }
447
606
  ],
448
607
  "estimates": [
@@ -451,15 +610,79 @@
451
610
  "verb": "GET",
452
611
  "path": "/2026-07-14/estimates/:id/pdf"
453
612
  },
613
+ {
614
+ "action": "deliver",
615
+ "verb": "POST",
616
+ "path": "/2026-07-14/estimates/:id/deliver",
617
+ "params": {
618
+ "required": [],
619
+ "optional": [
620
+ "contact_id",
621
+ "subject",
622
+ "body",
623
+ "attach_pdf"
624
+ ],
625
+ "sensitive": true
626
+ }
627
+ },
454
628
  {
455
629
  "action": "index",
456
630
  "verb": "GET",
457
631
  "path": "/2026-07-14/estimates"
458
632
  },
633
+ {
634
+ "action": "create",
635
+ "verb": "POST",
636
+ "path": "/2026-07-14/estimates",
637
+ "params": {
638
+ "required": [
639
+ "client_id"
640
+ ],
641
+ "optional": [
642
+ "issue_date",
643
+ "subject",
644
+ "notes",
645
+ "currency",
646
+ "locale",
647
+ "tax_rate",
648
+ "discount_rate",
649
+ "line_items"
650
+ ]
651
+ }
652
+ },
459
653
  {
460
654
  "action": "show",
461
655
  "verb": "GET",
462
656
  "path": "/2026-07-14/estimates/:id"
657
+ },
658
+ {
659
+ "action": "update",
660
+ "verb": "PATCH",
661
+ "path": "/2026-07-14/estimates/:id",
662
+ "params": {
663
+ "required": [],
664
+ "optional": [
665
+ "decision",
666
+ "client_id",
667
+ "issue_date",
668
+ "subject",
669
+ "notes",
670
+ "currency",
671
+ "locale",
672
+ "tax_rate",
673
+ "discount_rate",
674
+ "line_items",
675
+ "sent_on"
676
+ ],
677
+ "sensitive": [
678
+ "sent_on"
679
+ ]
680
+ }
681
+ },
682
+ {
683
+ "action": "destroy",
684
+ "verb": "DELETE",
685
+ "path": "/2026-07-14/estimates/:id"
463
686
  }
464
687
  ],
465
688
  "expense_categories": [
@@ -497,15 +720,96 @@
497
720
  "verb": "GET",
498
721
  "path": "/2026-07-14/invoices/:id/pdf"
499
722
  },
723
+ {
724
+ "action": "deliver",
725
+ "verb": "POST",
726
+ "path": "/2026-07-14/invoices/:id/deliver",
727
+ "params": {
728
+ "required": [],
729
+ "optional": [
730
+ "contact_id",
731
+ "subject",
732
+ "body",
733
+ "attach_pdf"
734
+ ],
735
+ "sensitive": true
736
+ }
737
+ },
500
738
  {
501
739
  "action": "index",
502
740
  "verb": "GET",
503
741
  "path": "/2026-07-14/invoices"
504
742
  },
743
+ {
744
+ "action": "create",
745
+ "verb": "POST",
746
+ "path": "/2026-07-14/invoices",
747
+ "params": {
748
+ "required": [],
749
+ "optional": [
750
+ "source_estimate_id",
751
+ "due_date",
752
+ "client_id",
753
+ "issue_date",
754
+ "subject",
755
+ "notes",
756
+ "currency",
757
+ "locale",
758
+ "tax_rate",
759
+ "discount_rate",
760
+ "line_items"
761
+ ]
762
+ }
763
+ },
505
764
  {
506
765
  "action": "show",
507
766
  "verb": "GET",
508
767
  "path": "/2026-07-14/invoices/:id"
768
+ },
769
+ {
770
+ "action": "update",
771
+ "verb": "PATCH",
772
+ "path": "/2026-07-14/invoices/:id",
773
+ "params": {
774
+ "required": [],
775
+ "optional": [
776
+ "due_date",
777
+ "client_id",
778
+ "issue_date",
779
+ "subject",
780
+ "notes",
781
+ "currency",
782
+ "locale",
783
+ "tax_rate",
784
+ "discount_rate",
785
+ "line_items",
786
+ "sent_on",
787
+ "void_reason",
788
+ "voided_on"
789
+ ],
790
+ "sensitive": [
791
+ "sent_on",
792
+ "void_reason",
793
+ "voided_on"
794
+ ]
795
+ }
796
+ },
797
+ {
798
+ "action": "destroy",
799
+ "verb": "DELETE",
800
+ "path": "/2026-07-14/invoices/:id"
801
+ }
802
+ ],
803
+ "memberships": [
804
+ {
805
+ "action": "index",
806
+ "verb": "GET",
807
+ "path": "/2026-07-14/memberships"
808
+ },
809
+ {
810
+ "action": "show",
811
+ "verb": "GET",
812
+ "path": "/2026-07-14/memberships/:id"
509
813
  }
510
814
  ],
511
815
  "payments": [
@@ -514,6 +818,22 @@
514
818
  "verb": "GET",
515
819
  "path": "/2026-07-14/payments"
516
820
  },
821
+ {
822
+ "action": "create",
823
+ "verb": "POST",
824
+ "path": "/2026-07-14/payments",
825
+ "params": {
826
+ "required": [],
827
+ "optional": [
828
+ "invoice_id",
829
+ "amount",
830
+ "paid_on",
831
+ "notes",
832
+ "reversal_of_id"
833
+ ],
834
+ "sensitive": true
835
+ }
836
+ },
517
837
  {
518
838
  "action": "show",
519
839
  "verb": "GET",
@@ -526,10 +846,63 @@
526
846
  "verb": "GET",
527
847
  "path": "/2026-07-14/projects"
528
848
  },
849
+ {
850
+ "action": "create",
851
+ "verb": "POST",
852
+ "path": "/2026-07-14/projects",
853
+ "params": {
854
+ "required": [
855
+ "name",
856
+ "client_id"
857
+ ],
858
+ "optional": [
859
+ "notes",
860
+ "starts_on",
861
+ "ends_on",
862
+ "project_type",
863
+ "currency",
864
+ "rate_source",
865
+ "apply_to_uninvoiced_time",
866
+ "hourly_rate",
867
+ "fee",
868
+ "project_tasks",
869
+ "project_assignments"
870
+ ]
871
+ }
872
+ },
529
873
  {
530
874
  "action": "show",
531
875
  "verb": "GET",
532
876
  "path": "/2026-07-14/projects/:id"
877
+ },
878
+ {
879
+ "action": "update",
880
+ "verb": "PATCH",
881
+ "path": "/2026-07-14/projects/:id",
882
+ "params": {
883
+ "required": [],
884
+ "optional": [
885
+ "name",
886
+ "client_id",
887
+ "archived",
888
+ "notes",
889
+ "starts_on",
890
+ "ends_on",
891
+ "project_type",
892
+ "currency",
893
+ "rate_source",
894
+ "apply_to_uninvoiced_time",
895
+ "hourly_rate",
896
+ "fee",
897
+ "project_tasks",
898
+ "project_assignments"
899
+ ]
900
+ }
901
+ },
902
+ {
903
+ "action": "destroy",
904
+ "verb": "DELETE",
905
+ "path": "/2026-07-14/projects/:id"
533
906
  }
534
907
  ],
535
908
  "recurring_invoice_templates": [
@@ -538,10 +911,66 @@
538
911
  "verb": "GET",
539
912
  "path": "/2026-07-14/recurring_invoice_templates"
540
913
  },
914
+ {
915
+ "action": "create",
916
+ "verb": "POST",
917
+ "path": "/2026-07-14/recurring_invoice_templates",
918
+ "params": {
919
+ "required": [
920
+ "client_id"
921
+ ],
922
+ "optional": [
923
+ "name",
924
+ "currency",
925
+ "locale",
926
+ "subject",
927
+ "notes",
928
+ "discount_rate",
929
+ "tax_rate",
930
+ "interval_unit",
931
+ "interval_count",
932
+ "anchor_day",
933
+ "end_of_month",
934
+ "next_issue_on",
935
+ "ends_on",
936
+ "due_days",
937
+ "paused",
938
+ "line_items"
939
+ ]
940
+ }
941
+ },
541
942
  {
542
943
  "action": "show",
543
944
  "verb": "GET",
544
945
  "path": "/2026-07-14/recurring_invoice_templates/:id"
946
+ },
947
+ {
948
+ "action": "update",
949
+ "verb": "PATCH",
950
+ "path": "/2026-07-14/recurring_invoice_templates/:id",
951
+ "params": {
952
+ "required": [],
953
+ "optional": [
954
+ "client_id",
955
+ "name",
956
+ "currency",
957
+ "locale",
958
+ "subject",
959
+ "notes",
960
+ "discount_rate",
961
+ "tax_rate",
962
+ "interval_unit",
963
+ "interval_count",
964
+ "anchor_day",
965
+ "end_of_month",
966
+ "next_issue_on",
967
+ "ends_on",
968
+ "due_days",
969
+ "paused",
970
+ "line_items",
971
+ "archived"
972
+ ]
973
+ }
545
974
  }
546
975
  ],
547
976
  "schema": [
@@ -557,22 +986,129 @@
557
986
  "verb": "GET",
558
987
  "path": "/2026-07-14/tasks"
559
988
  },
989
+ {
990
+ "action": "create",
991
+ "verb": "POST",
992
+ "path": "/2026-07-14/tasks",
993
+ "params": {
994
+ "required": [
995
+ "name"
996
+ ],
997
+ "optional": []
998
+ }
999
+ },
560
1000
  {
561
1001
  "action": "show",
562
1002
  "verb": "GET",
563
1003
  "path": "/2026-07-14/tasks/:id"
1004
+ },
1005
+ {
1006
+ "action": "update",
1007
+ "verb": "PATCH",
1008
+ "path": "/2026-07-14/tasks/:id",
1009
+ "params": {
1010
+ "required": [],
1011
+ "optional": [
1012
+ "name",
1013
+ "archived"
1014
+ ]
1015
+ }
1016
+ },
1017
+ {
1018
+ "action": "destroy",
1019
+ "verb": "DELETE",
1020
+ "path": "/2026-07-14/tasks/:id"
564
1021
  }
565
1022
  ],
566
1023
  "time_entries": [
1024
+ {
1025
+ "action": "start",
1026
+ "verb": "POST",
1027
+ "path": "/2026-07-14/time_entries/start",
1028
+ "params": {
1029
+ "required": [
1030
+ "tracking_key",
1031
+ "project_id",
1032
+ "task_id",
1033
+ "started_at"
1034
+ ],
1035
+ "optional": [
1036
+ "notes"
1037
+ ]
1038
+ }
1039
+ },
1040
+ {
1041
+ "action": "checkpoint",
1042
+ "verb": "POST",
1043
+ "path": "/2026-07-14/time_entries/checkpoint",
1044
+ "params": {
1045
+ "required": [
1046
+ "tracking_key",
1047
+ "checkpointed_at"
1048
+ ],
1049
+ "optional": [
1050
+ "notes"
1051
+ ]
1052
+ }
1053
+ },
1054
+ {
1055
+ "action": "finish",
1056
+ "verb": "POST",
1057
+ "path": "/2026-07-14/time_entries/finish",
1058
+ "params": {
1059
+ "required": [
1060
+ "tracking_key",
1061
+ "ended_at"
1062
+ ],
1063
+ "optional": [
1064
+ "notes"
1065
+ ]
1066
+ }
1067
+ },
567
1068
  {
568
1069
  "action": "index",
569
1070
  "verb": "GET",
570
1071
  "path": "/2026-07-14/time_entries"
571
1072
  },
1073
+ {
1074
+ "action": "create",
1075
+ "verb": "POST",
1076
+ "path": "/2026-07-14/time_entries",
1077
+ "params": {
1078
+ "required": [
1079
+ "project_id",
1080
+ "task_id",
1081
+ "spent_on",
1082
+ "duration_seconds"
1083
+ ],
1084
+ "optional": [
1085
+ "notes"
1086
+ ]
1087
+ }
1088
+ },
572
1089
  {
573
1090
  "action": "show",
574
1091
  "verb": "GET",
575
1092
  "path": "/2026-07-14/time_entries/:id"
1093
+ },
1094
+ {
1095
+ "action": "update",
1096
+ "verb": "PATCH",
1097
+ "path": "/2026-07-14/time_entries/:id",
1098
+ "params": {
1099
+ "required": [],
1100
+ "optional": [
1101
+ "project_id",
1102
+ "task_id",
1103
+ "duration_seconds",
1104
+ "notes"
1105
+ ]
1106
+ }
1107
+ },
1108
+ {
1109
+ "action": "destroy",
1110
+ "verb": "DELETE",
1111
+ "path": "/2026-07-14/time_entries/:id"
576
1112
  }
577
1113
  ]
578
1114
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buezli-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codegestalt