@workbuddy/sdk-js-edge 1.0.0 → 1.0.1

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/index.d.ts +2813 -424
  2. package/index.js +900 -61
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const PUBLIC_API_BASE_PATH = '/api/v2/public';
2
2
  const DEFAULT_API_VERSION = '2026-01';
3
- const DEFAULT_TOKEN_URL = 'https://tarek.workbuddy.dev/api/oauth2/token';
3
+ const DEFAULT_TOKEN_URL = 'https://abutanka.workbuddy.io/api/oauth2/token';
4
4
 
5
5
  export class WorkBuddyApiError extends Error {
6
6
  constructor(message, response, data) {
@@ -34,6 +34,22 @@ export class WorkBuddyClient {
34
34
  }
35
35
 
36
36
  this.jobs = {
37
+ template: {
38
+ /**
39
+ * Create a job using a job template. Template-owned fields win over request values before final job validation.
40
+ * Operation: PublicApiJobController_createFromTemplate
41
+ */
42
+ createFromTemplate: (params = {}, options = {}) =>
43
+ this.request('PublicApiJobController_createFromTemplate', params, options),
44
+ },
45
+ status: {
46
+ /**
47
+ * Change an existing job status and cascade the change to stages through the job domain command.
48
+ * Operation: PublicApiJobController_updateStatus
49
+ */
50
+ updateStatus: (params = {}, options = {}) =>
51
+ this.request('PublicApiJobController_updateStatus', params, options),
52
+ },
37
53
  stages: {
38
54
  items: {
39
55
  /**
@@ -46,12 +62,83 @@ export class WorkBuddyClient {
46
62
  /** Iterate raw pages by following cursor pagination for list(). */
47
63
  pages: (params = {}, options = {}) =>
48
64
  this.paginatePages('PublicApiJobController_getStageItems', params, options),
65
+ /**
66
+ * Add one or more catalogue-backed line items to a stage.
67
+ * Operation: PublicApiJobController_createStageItems
68
+ */
69
+ createStageItems: (params = {}, options = {}) =>
70
+ this.request('PublicApiJobController_createStageItems', params, options),
49
71
  /**
50
72
  * Get a specific item within a stage.
51
73
  * Operation: PublicApiJobController_getStageItem
52
74
  */
53
75
  getStageItem: (params = {}, options = {}) =>
54
76
  this.request('PublicApiJobController_getStageItem', params, options),
77
+ /**
78
+ * Update mutable fields on a stage line item.
79
+ * Operation: PublicApiJobController_updateStageItem
80
+ */
81
+ updateStageItem: (params = {}, options = {}) =>
82
+ this.request('PublicApiJobController_updateStageItem', params, options),
83
+ /**
84
+ * Remove or cancel a stage item depending on tenant deletion settings.
85
+ * Operation: PublicApiJobController_deleteStageItem
86
+ */
87
+ deleteStageItem: (params = {}, options = {}) =>
88
+ this.request('PublicApiJobController_deleteStageItem', params, options),
89
+ },
90
+ pendingItems: {
91
+ status: {
92
+ /**
93
+ * Set the dedicated pending-item status. No general item fields are accepted.
94
+ * Operation: PublicJobStagePendingItemController_updateStatus
95
+ */
96
+ updateStatus: (params = {}, options = {}) =>
97
+ this.request('PublicJobStagePendingItemController_updateStatus', params, options),
98
+ },
99
+ approve: {
100
+ /**
101
+ * Approve a pending item and promote it to a standard stage item.
102
+ * Operation: PublicJobStagePendingItemController_approve
103
+ */
104
+ approve: (params = {}, options = {}) =>
105
+ this.request('PublicJobStagePendingItemController_approve', params, options),
106
+ },
107
+ /**
108
+ * List items awaiting approval for a stage.
109
+ * Operation: PublicJobStagePendingItemController_list
110
+ */
111
+ list: (params = {}, options = {}) =>
112
+ this.request('PublicJobStagePendingItemController_list', params, options),
113
+ /** Iterate all items by following cursor pagination for list(). */
114
+ all: (params = {}, options = {}) =>
115
+ this.paginate('PublicJobStagePendingItemController_list', params, options),
116
+ /** Iterate raw pages by following cursor pagination for list(). */
117
+ pages: (params = {}, options = {}) =>
118
+ this.paginatePages('PublicJobStagePendingItemController_list', params, options),
119
+ /**
120
+ * Create one or more items awaiting approval.
121
+ * Operation: PublicJobStagePendingItemController_create
122
+ */
123
+ create: (params = {}, options = {}) =>
124
+ this.request('PublicJobStagePendingItemController_create', params, options),
125
+ /**
126
+ * Get a specific pending item within a stage.
127
+ * Operation: PublicJobStagePendingItemController_get
128
+ */
129
+ get: (params = {}, options = {}) => this.request('PublicJobStagePendingItemController_get', params, options),
130
+ /**
131
+ * Update general pending-item fields. Use the status route for itemStatus.
132
+ * Operation: PublicJobStagePendingItemController_update
133
+ */
134
+ update: (params = {}, options = {}) =>
135
+ this.request('PublicJobStagePendingItemController_update', params, options),
136
+ /**
137
+ * Delete or decline a pending item according to tenant deletion settings.
138
+ * Operation: PublicJobStagePendingItemController_delete
139
+ */
140
+ delete: (params = {}, options = {}) =>
141
+ this.request('PublicJobStagePendingItemController_delete', params, options),
55
142
  },
56
143
  resources: {
57
144
  reissue: {
@@ -64,14 +151,14 @@ export class WorkBuddyClient {
64
151
  },
65
152
  status: {
66
153
  /**
67
- * Update status (enroute, onsite, checkedout, completed, onhold).
154
+ * Update status (completed, onhold).
68
155
  * Operation: PublicJobStageResourceController_updateStatus
69
156
  */
70
157
  updateStatus: (params = {}, options = {}) =>
71
158
  this.request('PublicJobStageResourceController_updateStatus', params, options),
72
159
  },
73
160
  /**
74
- * Get all assigned resources for a stage.
161
+ * List people assigned to the stage via this API: employees (resource rows) and the stage contractor when set. Contractors assigned with POST .../resources appear here with isContractor=true (same shape as the assign response) (WBS-10448). Login contacts auto-created for contractor dispatch are excluded.
75
162
  * Operation: PublicJobStageResourceController_list
76
163
  */
77
164
  list: (params = {}, options = {}) => this.request('PublicJobStageResourceController_list', params, options),
@@ -81,13 +168,13 @@ export class WorkBuddyClient {
81
168
  pages: (params = {}, options = {}) =>
82
169
  this.paginatePages('PublicJobStageResourceController_list', params, options),
83
170
  /**
84
- * Assign a technician or contractor.
171
+ * Assign an Employee or Subcontractor by contactId. Employee → resource row. Subcontractor → stage contractor (isContractor=true). Both appear on GET list (WBS-10448). contactId is a person Contact id (use /employees for staff), not a CRM Contact from /contacts (WBS-10445 / WBS-10442).
85
172
  * Operation: PublicJobStageResourceController_assign
86
173
  */
87
174
  assign: (params = {}, options = {}) =>
88
175
  this.request('PublicJobStageResourceController_assign', params, options),
89
176
  /**
90
- * Get a specific resource assignment.
177
+ * Get one assignment by id. Employee rows use the resource/contact id; the stage contractor uses the contractor contact id (same id as POST assign when isContractor=true) (WBS-10448).
91
178
  * Operation: PublicJobStageResourceController_get
92
179
  */
93
180
  get: (params = {}, options = {}) => this.request('PublicJobStageResourceController_get', params, options),
@@ -417,14 +504,37 @@ export class WorkBuddyClient {
417
504
  dispatch: (params = {}, options = {}) => this.request('PublicApiJobController_dispatch', params, options),
418
505
  };
419
506
 
507
+ this.items = {
508
+ /**
509
+ * Find a job line item by external integration ID.
510
+ * Operation: PublicApiJobLineItemController_list
511
+ */
512
+ list: (params = {}, options = {}) => this.request('PublicApiJobLineItemController_list', params, options),
513
+ };
514
+
515
+ this.pendingItems = {
516
+ /**
517
+ * Find a pending stage item by its external integration ID.
518
+ * Operation: PublicApiPendingItemController_list
519
+ */
520
+ list: (params = {}, options = {}) => this.request('PublicApiPendingItemController_list', params, options),
521
+ };
522
+
420
523
  this.stages = {
421
524
  complete: {
422
525
  /**
423
- * Mark a stage as completed. Field work is done but stage may still need finalisation/billing.
526
+ * Mark a stage as completed. Field work is done but stage may still need finalisation/billing. Optional statusId selects a tenant Completed status from GET /settings/stage-statuses (systemStatus Completed); omit to use the system Completed status (MAI-2101).
424
527
  * Operation: PublicJobStageController_complete
425
528
  */
426
529
  complete: (params = {}, options = {}) => this.request('PublicJobStageController_complete', params, options),
427
530
  },
531
+ inProgress: {
532
+ /**
533
+ * Set the stage to an In Progress status. Pass statusId from GET /settings/stage-statuses with systemStatus In Progress (multiple peer statuses may share that systemStatus) (MAI-2101).
534
+ * Operation: PublicJobStageController_inProgress
535
+ */
536
+ inProgress: (params = {}, options = {}) => this.request('PublicJobStageController_inProgress', params, options),
537
+ },
428
538
  finalise: {
429
539
  /**
430
540
  * Finalise a completed stage. This typically indicates billing/invoicing is complete.
@@ -439,6 +549,13 @@ export class WorkBuddyClient {
439
549
  */
440
550
  cancel: (params = {}, options = {}) => this.request('PublicJobStageController_cancel', params, options),
441
551
  },
552
+ onHold: {
553
+ /**
554
+ * Set the stage to an On Hold status. Pass statusId from GET /settings/stage-statuses with systemStatus On Hold (multiple peer statuses may share that systemStatus). Blocked from Completed, Closed, or Finalised.
555
+ * Operation: PublicJobStageController_onHold
556
+ */
557
+ onHold: (params = {}, options = {}) => this.request('PublicJobStageController_onHold', params, options),
558
+ },
442
559
  reverse: {
443
560
  /**
444
561
  * Reverse (reopen) a stage to a previous status. This is an admin action that bypasses normal transition rules and clears fields appropriate to the target status.
@@ -464,7 +581,7 @@ export class WorkBuddyClient {
464
581
  */
465
582
  update: (params = {}, options = {}) => this.request('PublicJobStageController_update', params, options),
466
583
  /**
467
- * Permanently delete a stage and all associated items/resources. This action cannot be undone.
584
+ * Delete a stage. If tenant settings are configured to mark stages and items as cancelled on deletion, the stage is cancelled instead of permanently removed.
468
585
  * Operation: PublicJobStageController_delete
469
586
  */
470
587
  delete: (params = {}, options = {}) => this.request('PublicJobStageController_delete', params, options),
@@ -478,7 +595,7 @@ export class WorkBuddyClient {
478
595
  this.settings = {
479
596
  entityStatuses: {
480
597
  /**
481
- * Retrieve all active statuses for a given entity type. Supported entities: customer, contractor, supplier
598
+ * Retrieve all active statuses for a given entity type. Supported entities: customer, contractor, supplier, contact, external-user, pending-item
482
599
  * Operation: PublicApiEntityStatusController_list
483
600
  */
484
601
  list: (params = {}, options = {}) => this.request('PublicApiEntityStatusController_list', params, options),
@@ -497,6 +614,13 @@ export class WorkBuddyClient {
497
614
  */
498
615
  list: (params = {}, options = {}) => this.request('PublicApiJobTypeController_list', params, options),
499
616
  },
617
+ jobTemplates: {
618
+ /**
619
+ * Retrieve all active, public job templates configured for the tenant. Use the returned id as the templateId for POST /jobs/template/:templateId.
620
+ * Operation: PublicApiJobTemplateController_list
621
+ */
622
+ list: (params = {}, options = {}) => this.request('PublicApiJobTemplateController_list', params, options),
623
+ },
500
624
  priorities: {
501
625
  /**
502
626
  * Retrieve all active priority levels configured for the tenant. Priorities indicate the urgency of jobs (e.g., Critical, High, Medium, Low).
@@ -504,11 +628,38 @@ export class WorkBuddyClient {
504
628
  */
505
629
  list: (params = {}, options = {}) => this.request('PublicApiPriorityController_list', params, options),
506
630
  },
507
- stageStatuses: {
631
+ pricebooks: {
508
632
  /**
509
- * Retrieve all stage statuses configured for the tenant. Stage statuses represent the workflow states a stage (work order) can transition through (e.g., New, Dispatched, En Route, On Site, Completed, Finalised).
510
- * Operation: PublicApiStageStatusController_list
633
+ * Discover tenant pricebooks for a category (customer / contractor / supplier). Use category=customer&status=current&assignableOnly=true for job-create candidates. Optional accountId scopes to a CRM account (includeGlobal defaults true). Each item includes company (owning company) and optional account both match Settings UI fields.
634
+ * Operation: PublicApiPriceBookController_list
511
635
  */
636
+ list: (params = {}, options = {}) => this.request('PublicApiPriceBookController_list', params, options),
637
+ /**
638
+ * Retrieve a pricebook by id (preferred) or exact name (case-insensitive). Pass category when the name may exist in more than one category. Response includes company (owning company) and optional account, matching Settings UI.
639
+ * Operation: PublicApiPriceBookController_getByIdOrName
640
+ */
641
+ getByIdOrName: (params = {}, options = {}) =>
642
+ this.request('PublicApiPriceBookController_getByIdOrName', params, options),
643
+ },
644
+ stageStatuses: {
645
+ /**
646
+ * Retrieve all stage statuses configured for the tenant (Settings > Stage Status).
647
+ Each item is a workflow state a stage (work order) can use (e.g. New, Dispatched, En Route, On Site, Completed, Finalised).
648
+
649
+ Response fields include:
650
+ - identity: id, name, systemName, systemStatus, sortOrder
651
+ - description (nullable)
652
+ - activityOptions: shareWithCustomer, shareWithField (always present; unset = false)
653
+ - displayOptions: showInContractorPortal, showInFieldApp (always present)
654
+
655
+ Display Options rules (match Settings UI):
656
+ - Only systemStatus On Hold or In Progress support display options; other systemStatus values return both flags as false
657
+ - showInFieldApp is not configurable for In Progress and is always false
658
+ - When supported and not configured, visibility defaults to true (Settings UI default)
659
+
660
+ Requires scope: settings:read
661
+ * Operation: PublicApiStageStatusController_list
662
+ */
512
663
  list: (params = {}, options = {}) => this.request('PublicApiStageStatusController_list', params, options),
513
664
  },
514
665
  tags: {
@@ -562,7 +713,12 @@ export class WorkBuddyClient {
562
713
  */
563
714
  create: (params = {}, options = {}) => this.request('PublicApiItemController_create', params, options),
564
715
  /**
565
- * Retrieve a settings item by ID.
716
+ * Create or partially update a settings item using integrationId when supplied, otherwise name. Create still requires mandatory item fields.
717
+ * Operation: PublicApiItemController_upsert
718
+ */
719
+ upsert: (params = {}, options = {}) => this.request('PublicApiItemController_upsert', params, options),
720
+ /**
721
+ * Retrieve a settings item by ID, name, or integration ID.
566
722
  * Operation: PublicApiItemController_getById
567
723
  */
568
724
  get: (params = {}, options = {}) => this.request('PublicApiItemController_getById', params, options),
@@ -576,15 +732,10 @@ export class WorkBuddyClient {
576
732
  * Operation: PublicApiItemController_delete
577
733
  */
578
734
  delete: (params = {}, options = {}) => this.request('PublicApiItemController_delete', params, options),
579
- /**
580
- * Create or update a settings item using integrationId or name as the match key.
581
- * Operation: PublicApiItemController_upsert
582
- */
583
- upsert: (params = {}, options = {}) => this.request('PublicApiItemController_upsert', params, options),
584
735
  },
585
736
  itemCategories: {
586
737
  /**
587
- * Retrieve active item categories and sub-categories.
738
+ * Retrieve active item categories and sub-categories. Use search, name, or id to filter by category/sub-category name or id.
588
739
  * Operation: PublicApiItemCategoryController_list
589
740
  */
590
741
  list: (params = {}, options = {}) => this.request('PublicApiItemCategoryController_list', params, options),
@@ -601,6 +752,58 @@ export class WorkBuddyClient {
601
752
  */
602
753
  list: (params = {}, options = {}) => this.request('PublicApiUoMController_list', params, options),
603
754
  },
755
+ customFields: {
756
+ jobs: {
757
+ /**
758
+ * Retrieve configured custom fields that may be used in Job customFields payloads.
759
+ * Operation: PublicApiCustomFieldController_listJobCustomFields
760
+ */
761
+ listJobCustomFields: (params = {}, options = {}) =>
762
+ this.request('PublicApiCustomFieldController_listJobCustomFields', params, options),
763
+ },
764
+ stages: {
765
+ /**
766
+ * Retrieve configured custom fields that may be used in Stage customFields payloads.
767
+ * Operation: PublicApiCustomFieldController_listStageCustomFields
768
+ */
769
+ listStageCustomFields: (params = {}, options = {}) =>
770
+ this.request('PublicApiCustomFieldController_listStageCustomFields', params, options),
771
+ },
772
+ accounts: {
773
+ /**
774
+ * Retrieve configured custom fields that may be used in CRM account customFields payloads.
775
+ * Operation: PublicApiCustomFieldController_listAccountCustomFields
776
+ */
777
+ listAccountCustomFields: (params = {}, options = {}) =>
778
+ this.request('PublicApiCustomFieldController_listAccountCustomFields', params, options),
779
+ },
780
+ items: {
781
+ /**
782
+ * Retrieve configured custom fields that may be used in settings item customFields payloads.
783
+ * Operation: PublicApiCustomFieldController_listItemCustomFields
784
+ */
785
+ listItemCustomFields: (params = {}, options = {}) =>
786
+ this.request('PublicApiCustomFieldController_listItemCustomFields', params, options),
787
+ },
788
+ },
789
+ roles: {
790
+ clientPortal: {
791
+ /**
792
+ * Roles assignable to customer login contacts (UserType.Client). Includes custom client roles; includes built-in system client roles only when Enable System Security Roles is on for the tenant. Use item.id as roleId when login is true on contact create/invite.
793
+ * Operation: PublicApiPortalRoleController_listClientPortal
794
+ */
795
+ list: (params = {}, options = {}) =>
796
+ this.request('PublicApiPortalRoleController_listClientPortal', params, options),
797
+ },
798
+ contractorPortal: {
799
+ /**
800
+ * Roles assignable to contractor login contacts (UserType.Subcontractor). Includes custom contractor roles; includes built-in system contractor roles only when Enable System Security Roles is on for the tenant. Use item.id as roleId when login is true on contact create/invite.
801
+ * Operation: PublicApiPortalRoleController_listContractorPortal
802
+ */
803
+ list: (params = {}, options = {}) =>
804
+ this.request('PublicApiPortalRoleController_listContractorPortal', params, options),
805
+ },
806
+ },
604
807
  };
605
808
 
606
809
  this.attachments = {
@@ -637,9 +840,25 @@ export class WorkBuddyClient {
637
840
 
638
841
  this.crm = {
639
842
  customers: {
843
+ status: {
844
+ /**
845
+ * Update customer status
846
+ * Operation: PublicCrmCustomerController_updateStatus
847
+ */
848
+ updateStatus: (params = {}, options = {}) =>
849
+ this.request('PublicCrmCustomerController_updateStatus', params, options),
850
+ },
640
851
  contacts: {
852
+ invite: {
853
+ /**
854
+ * Invite contact (CRM)
855
+ * Operation: PublicCrmCustomerController_inviteContact
856
+ */
857
+ inviteContact: (params = {}, options = {}) =>
858
+ this.request('PublicCrmCustomerController_inviteContact', params, options),
859
+ },
641
860
  /**
642
- * List contacts for customer
861
+ * List contacts for customer (contacts + external users)
643
862
  * Operation: PublicCrmCustomerController_listContacts
644
863
  */
645
864
  list: (params = {}, options = {}) =>
@@ -650,6 +869,18 @@ export class WorkBuddyClient {
650
869
  /** Iterate raw pages by following cursor pagination for list(). */
651
870
  pages: (params = {}, options = {}) =>
652
871
  this.paginatePages('PublicCrmCustomerController_listContacts', params, options),
872
+ /**
873
+ * Create customer contact
874
+ * Operation: PublicCrmCustomerController_createContact
875
+ */
876
+ createContact: (params = {}, options = {}) =>
877
+ this.request('PublicCrmCustomerController_createContact', params, options),
878
+ /**
879
+ * Delete customer contact
880
+ * Operation: PublicCrmCustomerController_deleteContact
881
+ */
882
+ deleteContact: (params = {}, options = {}) =>
883
+ this.request('PublicCrmCustomerController_deleteContact', params, options),
653
884
  },
654
885
  sites: {
655
886
  /**
@@ -687,6 +918,11 @@ export class WorkBuddyClient {
687
918
  * Operation: PublicCrmCustomerController_update
688
919
  */
689
920
  update: (params = {}, options = {}) => this.request('PublicCrmCustomerController_update', params, options),
921
+ /**
922
+ * Delete customer
923
+ * Operation: PublicCrmCustomerController_delete
924
+ */
925
+ delete: (params = {}, options = {}) => this.request('PublicCrmCustomerController_delete', params, options),
690
926
  },
691
927
  employees: {
692
928
  /**
@@ -705,6 +941,48 @@ export class WorkBuddyClient {
705
941
  get: (params = {}, options = {}) => this.request('PublicCrmEmployeeController_getById', params, options),
706
942
  },
707
943
  contractors: {
944
+ status: {
945
+ /**
946
+ * Update contractor status
947
+ * Operation: PublicCrmContractorController_updateStatus
948
+ */
949
+ updateStatus: (params = {}, options = {}) =>
950
+ this.request('PublicCrmContractorController_updateStatus', params, options),
951
+ },
952
+ contacts: {
953
+ invite: {
954
+ /**
955
+ * Invite contact (CRM > Contractors)
956
+ * Operation: PublicCrmContractorController_inviteContact
957
+ */
958
+ inviteContact: (params = {}, options = {}) =>
959
+ this.request('PublicCrmContractorController_inviteContact', params, options),
960
+ },
961
+ /**
962
+ * List contacts for contractor (contacts + external users)
963
+ * Operation: PublicCrmContractorController_listContacts
964
+ */
965
+ list: (params = {}, options = {}) =>
966
+ this.request('PublicCrmContractorController_listContacts', params, options),
967
+ /** Iterate all items by following cursor pagination for list(). */
968
+ all: (params = {}, options = {}) =>
969
+ this.paginate('PublicCrmContractorController_listContacts', params, options),
970
+ /** Iterate raw pages by following cursor pagination for list(). */
971
+ pages: (params = {}, options = {}) =>
972
+ this.paginatePages('PublicCrmContractorController_listContacts', params, options),
973
+ /**
974
+ * Create contractor contact
975
+ * Operation: PublicCrmContractorController_createContact
976
+ */
977
+ createContact: (params = {}, options = {}) =>
978
+ this.request('PublicCrmContractorController_createContact', params, options),
979
+ /**
980
+ * Delete contractor contact
981
+ * Operation: PublicCrmContractorController_deleteContact
982
+ */
983
+ deleteContact: (params = {}, options = {}) =>
984
+ this.request('PublicCrmContractorController_deleteContact', params, options),
985
+ },
708
986
  /**
709
987
  * List contractors
710
988
  * Operation: PublicCrmContractorController_list
@@ -729,8 +1007,21 @@ export class WorkBuddyClient {
729
1007
  * Operation: PublicCrmContractorController_update
730
1008
  */
731
1009
  update: (params = {}, options = {}) => this.request('PublicCrmContractorController_update', params, options),
1010
+ /**
1011
+ * Delete contractor
1012
+ * Operation: PublicCrmContractorController_delete
1013
+ */
1014
+ delete: (params = {}, options = {}) => this.request('PublicCrmContractorController_delete', params, options),
732
1015
  },
733
1016
  suppliers: {
1017
+ status: {
1018
+ /**
1019
+ * Update supplier status
1020
+ * Operation: PublicCrmSupplierController_updateStatus
1021
+ */
1022
+ updateStatus: (params = {}, options = {}) =>
1023
+ this.request('PublicCrmSupplierController_updateStatus', params, options),
1024
+ },
734
1025
  /**
735
1026
  * List suppliers
736
1027
  * Operation: PublicCrmSupplierController_list
@@ -755,6 +1046,11 @@ export class WorkBuddyClient {
755
1046
  * Operation: PublicCrmSupplierController_update
756
1047
  */
757
1048
  update: (params = {}, options = {}) => this.request('PublicCrmSupplierController_update', params, options),
1049
+ /**
1050
+ * Delete supplier
1051
+ * Operation: PublicCrmSupplierController_delete
1052
+ */
1053
+ delete: (params = {}, options = {}) => this.request('PublicCrmSupplierController_delete', params, options),
758
1054
  },
759
1055
  companies: {
760
1056
  /**
@@ -784,14 +1080,22 @@ export class WorkBuddyClient {
784
1080
  pages: (params = {}, options = {}) =>
785
1081
  this.paginatePages('PublicCrmExternalUserController_list', params, options),
786
1082
  /**
787
- * Get external user by ID
1083
+ * Login Contact (portal user). parents lists active parent accounts only; portal role is parents[].role.
788
1084
  * Operation: PublicCrmExternalUserController_getById
789
1085
  */
790
1086
  get: (params = {}, options = {}) => this.request('PublicCrmExternalUserController_getById', params, options),
791
1087
  },
792
1088
  contacts: {
1089
+ status: {
1090
+ /**
1091
+ * Update contact status
1092
+ * Operation: PublicCrmContactController_updateStatus
1093
+ */
1094
+ updateStatus: (params = {}, options = {}) =>
1095
+ this.request('PublicCrmContactController_updateStatus', params, options),
1096
+ },
793
1097
  /**
794
- * List contacts (Basic and Login contacts)
1098
+ * List contacts (contacts + external users)
795
1099
  * Operation: PublicCrmContactController_list
796
1100
  */
797
1101
  list: (params = {}, options = {}) => this.request('PublicCrmContactController_list', params, options),
@@ -800,10 +1104,15 @@ export class WorkBuddyClient {
800
1104
  /** Iterate raw pages by following cursor pagination for list(). */
801
1105
  pages: (params = {}, options = {}) => this.paginatePages('PublicCrmContactController_list', params, options),
802
1106
  /**
803
- * Get contact by ID
1107
+ * Returns a people contact (basic or Login Contact). parents lists active parent accounts only (inactive/soft-deleted omitted); portal role for Login Contacts is parents[].role.
804
1108
  * Operation: PublicCrmContactController_getById
805
1109
  */
806
1110
  get: (params = {}, options = {}) => this.request('PublicCrmContactController_getById', params, options),
1111
+ /**
1112
+ * Update contact
1113
+ * Operation: PublicCrmContactController_update
1114
+ */
1115
+ update: (params = {}, options = {}) => this.request('PublicCrmContactController_update', params, options),
807
1116
  },
808
1117
  invites: {
809
1118
  /**
@@ -822,8 +1131,20 @@ export class WorkBuddyClient {
822
1131
  get: (params = {}, options = {}) => this.request('PublicCrmInviteController_getById', params, options),
823
1132
  },
824
1133
  sites: {
1134
+ contacts: {
1135
+ /**
1136
+ * List contacts linked to this site (same pattern as GET /customers/{id}/contacts). Returns basic contacts and external users parented to the site.
1137
+ * Operation: PublicCrmSiteController_listContacts
1138
+ */
1139
+ list: (params = {}, options = {}) => this.request('PublicCrmSiteController_listContacts', params, options),
1140
+ /** Iterate all items by following cursor pagination for list(). */
1141
+ all: (params = {}, options = {}) => this.paginate('PublicCrmSiteController_listContacts', params, options),
1142
+ /** Iterate raw pages by following cursor pagination for list(). */
1143
+ pages: (params = {}, options = {}) =>
1144
+ this.paginatePages('PublicCrmSiteController_listContacts', params, options),
1145
+ },
825
1146
  /**
826
- * List all sites
1147
+ * List CRM sites for the tenant (Managed and Account only — Adhoc sites are excluded). Each item includes type (Managed | Account), optional primaryContact, and address. Optional search filters by site name/address tokens (space-separated words; all must match).
827
1148
  * Operation: PublicCrmSiteController_list
828
1149
  */
829
1150
  list: (params = {}, options = {}) => this.request('PublicCrmSiteController_list', params, options),
@@ -832,7 +1153,7 @@ export class WorkBuddyClient {
832
1153
  /** Iterate raw pages by following cursor pagination for list(). */
833
1154
  pages: (params = {}, options = {}) => this.paginatePages('PublicCrmSiteController_list', params, options),
834
1155
  /**
835
- * Get site by ID
1156
+ * Retrieve a CRM site by id (Managed or Account only). Adhoc sites are not exposed. Includes primaryContact when set (UI Primary Contact). type is CRM Site Type — not address.type.
836
1157
  * Operation: PublicCrmSiteController_getById
837
1158
  */
838
1159
  get: (params = {}, options = {}) => this.request('PublicCrmSiteController_getById', params, options),
@@ -1236,6 +1557,31 @@ export const operations = [
1236
1557
  queryParams: [],
1237
1558
  hasRequestBody: true,
1238
1559
  },
1560
+ {
1561
+ operationId: 'PublicApiJobController_createFromTemplate',
1562
+ resourcePath: ['jobs', 'template'],
1563
+ actionName: 'createFromTemplate',
1564
+ displayName: 'Create a new job from template',
1565
+ description:
1566
+ 'Create a job using a job template. Template-owned fields win over request values before final job validation.',
1567
+ method: 'POST',
1568
+ path: '/jobs/template/{templateId}',
1569
+ pathParams: ['templateId'],
1570
+ queryParams: [],
1571
+ hasRequestBody: true,
1572
+ },
1573
+ {
1574
+ operationId: 'PublicApiJobController_updateStatus',
1575
+ resourcePath: ['jobs', 'status'],
1576
+ actionName: 'updateStatus',
1577
+ displayName: 'Update job status',
1578
+ description: 'Change an existing job status and cascade the change to stages through the job domain command.',
1579
+ method: 'PATCH',
1580
+ path: '/jobs/{id}/status',
1581
+ pathParams: ['id'],
1582
+ queryParams: [],
1583
+ hasRequestBody: true,
1584
+ },
1239
1585
  {
1240
1586
  operationId: 'PublicApiJobController_update',
1241
1587
  resourcePath: ['jobs'],
@@ -1300,6 +1646,18 @@ export const operations = [
1300
1646
  queryParams: ['cursor', 'limit'],
1301
1647
  hasRequestBody: false,
1302
1648
  },
1649
+ {
1650
+ operationId: 'PublicApiJobController_createStageItems',
1651
+ resourcePath: ['jobs', 'stages', 'items'],
1652
+ actionName: 'createStageItems',
1653
+ displayName: 'Create stage items',
1654
+ description: 'Add one or more catalogue-backed line items to a stage.',
1655
+ method: 'POST',
1656
+ path: '/jobs/{id}/stages/{stageId}/items',
1657
+ pathParams: ['id', 'stageId'],
1658
+ queryParams: [],
1659
+ hasRequestBody: true,
1660
+ },
1303
1661
  {
1304
1662
  operationId: 'PublicApiJobController_getStageItem',
1305
1663
  resourcePath: ['jobs', 'stages', 'items'],
@@ -1312,6 +1670,140 @@ export const operations = [
1312
1670
  queryParams: [],
1313
1671
  hasRequestBody: false,
1314
1672
  },
1673
+ {
1674
+ operationId: 'PublicApiJobController_updateStageItem',
1675
+ resourcePath: ['jobs', 'stages', 'items'],
1676
+ actionName: 'updateStageItem',
1677
+ displayName: 'Update stage item',
1678
+ description: 'Update mutable fields on a stage line item.',
1679
+ method: 'PATCH',
1680
+ path: '/jobs/{id}/stages/{stageId}/items/{itemId}',
1681
+ pathParams: ['id', 'stageId', 'itemId'],
1682
+ queryParams: [],
1683
+ hasRequestBody: true,
1684
+ },
1685
+ {
1686
+ operationId: 'PublicApiJobController_deleteStageItem',
1687
+ resourcePath: ['jobs', 'stages', 'items'],
1688
+ actionName: 'deleteStageItem',
1689
+ displayName: 'Delete stage item',
1690
+ description: 'Remove or cancel a stage item depending on tenant deletion settings.',
1691
+ method: 'DELETE',
1692
+ path: '/jobs/{id}/stages/{stageId}/items/{itemId}',
1693
+ pathParams: ['id', 'stageId', 'itemId'],
1694
+ queryParams: [],
1695
+ hasRequestBody: false,
1696
+ },
1697
+ {
1698
+ operationId: 'PublicApiJobLineItemController_list',
1699
+ resourcePath: ['items'],
1700
+ actionName: 'list',
1701
+ displayName: 'Find job line items',
1702
+ description: 'Find a job line item by external integration ID.',
1703
+ method: 'GET',
1704
+ path: '/items',
1705
+ pathParams: [],
1706
+ queryParams: ['integrationId'],
1707
+ hasRequestBody: false,
1708
+ },
1709
+ {
1710
+ operationId: 'PublicApiPendingItemController_list',
1711
+ resourcePath: ['pendingItems'],
1712
+ actionName: 'list',
1713
+ displayName: 'Find a pending item',
1714
+ description: 'Find a pending stage item by its external integration ID.',
1715
+ method: 'GET',
1716
+ path: '/pending-items',
1717
+ pathParams: [],
1718
+ queryParams: ['integrationId'],
1719
+ hasRequestBody: false,
1720
+ },
1721
+ {
1722
+ operationId: 'PublicJobStagePendingItemController_list',
1723
+ resourcePath: ['jobs', 'stages', 'pendingItems'],
1724
+ actionName: 'list',
1725
+ paginatedItemsActionName: 'all',
1726
+ paginatedPagesActionName: 'pages',
1727
+ displayName: 'List stage pending items',
1728
+ description: 'List items awaiting approval for a stage.',
1729
+ method: 'GET',
1730
+ path: '/jobs/{id}/stages/{stageId}/pending-items',
1731
+ pathParams: ['id', 'stageId'],
1732
+ queryParams: ['cursor', 'limit'],
1733
+ hasRequestBody: false,
1734
+ },
1735
+ {
1736
+ operationId: 'PublicJobStagePendingItemController_create',
1737
+ resourcePath: ['jobs', 'stages', 'pendingItems'],
1738
+ actionName: 'create',
1739
+ displayName: 'Create stage pending items',
1740
+ description: 'Create one or more items awaiting approval.',
1741
+ method: 'POST',
1742
+ path: '/jobs/{id}/stages/{stageId}/pending-items',
1743
+ pathParams: ['id', 'stageId'],
1744
+ queryParams: [],
1745
+ hasRequestBody: true,
1746
+ },
1747
+ {
1748
+ operationId: 'PublicJobStagePendingItemController_get',
1749
+ resourcePath: ['jobs', 'stages', 'pendingItems'],
1750
+ actionName: 'get',
1751
+ displayName: 'Get stage pending item',
1752
+ description: 'Get a specific pending item within a stage.',
1753
+ method: 'GET',
1754
+ path: '/jobs/{id}/stages/{stageId}/pending-items/{itemId}',
1755
+ pathParams: ['id', 'stageId', 'itemId'],
1756
+ queryParams: [],
1757
+ hasRequestBody: false,
1758
+ },
1759
+ {
1760
+ operationId: 'PublicJobStagePendingItemController_update',
1761
+ resourcePath: ['jobs', 'stages', 'pendingItems'],
1762
+ actionName: 'update',
1763
+ displayName: 'Update stage pending item',
1764
+ description: 'Update general pending-item fields. Use the status route for itemStatus.',
1765
+ method: 'PATCH',
1766
+ path: '/jobs/{id}/stages/{stageId}/pending-items/{itemId}',
1767
+ pathParams: ['id', 'stageId', 'itemId'],
1768
+ queryParams: [],
1769
+ hasRequestBody: true,
1770
+ },
1771
+ {
1772
+ operationId: 'PublicJobStagePendingItemController_delete',
1773
+ resourcePath: ['jobs', 'stages', 'pendingItems'],
1774
+ actionName: 'delete',
1775
+ displayName: 'Delete stage pending item',
1776
+ description: 'Delete or decline a pending item according to tenant deletion settings.',
1777
+ method: 'DELETE',
1778
+ path: '/jobs/{id}/stages/{stageId}/pending-items/{itemId}',
1779
+ pathParams: ['id', 'stageId', 'itemId'],
1780
+ queryParams: [],
1781
+ hasRequestBody: false,
1782
+ },
1783
+ {
1784
+ operationId: 'PublicJobStagePendingItemController_updateStatus',
1785
+ resourcePath: ['jobs', 'stages', 'pendingItems', 'status'],
1786
+ actionName: 'updateStatus',
1787
+ displayName: 'Update pending-item status',
1788
+ description: 'Set the dedicated pending-item status. No general item fields are accepted.',
1789
+ method: 'PATCH',
1790
+ path: '/jobs/{id}/stages/{stageId}/pending-items/{itemId}/status',
1791
+ pathParams: ['id', 'stageId', 'itemId'],
1792
+ queryParams: [],
1793
+ hasRequestBody: true,
1794
+ },
1795
+ {
1796
+ operationId: 'PublicJobStagePendingItemController_approve',
1797
+ resourcePath: ['jobs', 'stages', 'pendingItems', 'approve'],
1798
+ actionName: 'approve',
1799
+ displayName: 'Approve stage pending item',
1800
+ description: 'Approve a pending item and promote it to a standard stage item.',
1801
+ method: 'POST',
1802
+ path: '/jobs/{id}/stages/{stageId}/pending-items/{itemId}/approve',
1803
+ pathParams: ['id', 'stageId', 'itemId'],
1804
+ queryParams: [],
1805
+ hasRequestBody: false,
1806
+ },
1315
1807
  {
1316
1808
  operationId: 'PublicJobStageController_create',
1317
1809
  resourcePath: ['stages'],
@@ -1341,7 +1833,8 @@ export const operations = [
1341
1833
  resourcePath: ['stages'],
1342
1834
  actionName: 'delete',
1343
1835
  displayName: 'Delete a stage',
1344
- description: 'Permanently delete a stage and all associated items/resources. This action cannot be undone.',
1836
+ description:
1837
+ 'Delete a stage. If tenant settings are configured to mark stages and items as cancelled on deletion, the stage is cancelled instead of permanently removed.',
1345
1838
  method: 'DELETE',
1346
1839
  path: '/stages/{id}',
1347
1840
  pathParams: ['id'],
@@ -1365,13 +1858,27 @@ export const operations = [
1365
1858
  resourcePath: ['stages', 'complete'],
1366
1859
  actionName: 'complete',
1367
1860
  displayName: 'Complete a stage',
1368
- description: 'Mark a stage as completed. Field work is done but stage may still need finalisation/billing.',
1861
+ description:
1862
+ 'Mark a stage as completed. Field work is done but stage may still need finalisation/billing. Optional statusId selects a tenant Completed status from GET /settings/stage-statuses (systemStatus Completed); omit to use the system Completed status (MAI-2101).',
1369
1863
  method: 'POST',
1370
1864
  path: '/stages/{id}/complete',
1371
1865
  pathParams: ['id'],
1372
1866
  queryParams: [],
1373
1867
  hasRequestBody: true,
1374
1868
  },
1869
+ {
1870
+ operationId: 'PublicJobStageController_inProgress',
1871
+ resourcePath: ['stages', 'inProgress'],
1872
+ actionName: 'inProgress',
1873
+ displayName: 'Mark a stage in progress',
1874
+ description:
1875
+ 'Set the stage to an In Progress status. Pass statusId from GET /settings/stage-statuses with systemStatus In Progress (multiple peer statuses may share that systemStatus) (MAI-2101).',
1876
+ method: 'POST',
1877
+ path: '/stages/{id}/in-progress',
1878
+ pathParams: ['id'],
1879
+ queryParams: [],
1880
+ hasRequestBody: true,
1881
+ },
1375
1882
  {
1376
1883
  operationId: 'PublicJobStageController_finalise',
1377
1884
  resourcePath: ['stages', 'finalise'],
@@ -1396,6 +1903,19 @@ export const operations = [
1396
1903
  queryParams: [],
1397
1904
  hasRequestBody: true,
1398
1905
  },
1906
+ {
1907
+ operationId: 'PublicJobStageController_onHold',
1908
+ resourcePath: ['stages', 'onHold'],
1909
+ actionName: 'onHold',
1910
+ displayName: 'Put a stage on hold',
1911
+ description:
1912
+ 'Set the stage to an On Hold status. Pass statusId from GET /settings/stage-statuses with systemStatus On Hold (multiple peer statuses may share that systemStatus). Blocked from Completed, Closed, or Finalised.',
1913
+ method: 'POST',
1914
+ path: '/stages/{id}/on-hold',
1915
+ pathParams: ['id'],
1916
+ queryParams: [],
1917
+ hasRequestBody: true,
1918
+ },
1399
1919
  {
1400
1920
  operationId: 'PublicJobStageController_reverse',
1401
1921
  resourcePath: ['stages', 'reverse'],
@@ -1428,7 +1948,8 @@ export const operations = [
1428
1948
  paginatedItemsActionName: 'all',
1429
1949
  paginatedPagesActionName: 'pages',
1430
1950
  displayName: 'List stage resources',
1431
- description: 'Get all assigned resources for a stage.',
1951
+ description:
1952
+ 'List people assigned to the stage via this API: employees (resource rows) and the stage contractor when set. Contractors assigned with POST .../resources appear here with isContractor=true (same shape as the assign response) (WBS-10448). Login contacts auto-created for contractor dispatch are excluded.',
1432
1953
  method: 'GET',
1433
1954
  path: '/jobs/{jobId}/stages/{stageId}/resources',
1434
1955
  pathParams: ['jobId', 'stageId'],
@@ -1440,7 +1961,8 @@ export const operations = [
1440
1961
  resourcePath: ['jobs', 'stages', 'resources'],
1441
1962
  actionName: 'assign',
1442
1963
  displayName: 'Assign resource to stage',
1443
- description: 'Assign a technician or contractor.',
1964
+ description:
1965
+ 'Assign an Employee or Subcontractor by contactId. Employee → resource row. Subcontractor → stage contractor (isContractor=true). Both appear on GET list (WBS-10448). contactId is a person Contact id (use /employees for staff), not a CRM Contact from /contacts (WBS-10445 / WBS-10442).',
1444
1966
  method: 'POST',
1445
1967
  path: '/jobs/{jobId}/stages/{stageId}/resources',
1446
1968
  pathParams: ['jobId', 'stageId'],
@@ -1452,7 +1974,8 @@ export const operations = [
1452
1974
  resourcePath: ['jobs', 'stages', 'resources'],
1453
1975
  actionName: 'get',
1454
1976
  displayName: 'Get stage resource',
1455
- description: 'Get a specific resource assignment.',
1977
+ description:
1978
+ 'Get one assignment by id. Employee rows use the resource/contact id; the stage contractor uses the contractor contact id (same id as POST assign when isContractor=true) (WBS-10448).',
1456
1979
  method: 'GET',
1457
1980
  path: '/jobs/{jobId}/stages/{stageId}/resources/{resourceId}',
1458
1981
  pathParams: ['jobId', 'stageId', 'resourceId'],
@@ -1488,7 +2011,7 @@ export const operations = [
1488
2011
  resourcePath: ['jobs', 'stages', 'resources', 'status'],
1489
2012
  actionName: 'updateStatus',
1490
2013
  displayName: 'Update resource status',
1491
- description: 'Update status (enroute, onsite, checkedout, completed, onhold).',
2014
+ description: 'Update status (completed, onhold).',
1492
2015
  method: 'POST',
1493
2016
  path: '/jobs/{jobId}/stages/{stageId}/resources/{resourceId}/status',
1494
2017
  pathParams: ['jobId', 'stageId', 'resourceId'],
@@ -1501,7 +2024,7 @@ export const operations = [
1501
2024
  actionName: 'list',
1502
2025
  displayName: 'List entity statuses',
1503
2026
  description:
1504
- 'Retrieve all active statuses for a given entity type. Supported entities: customer, contractor, supplier',
2027
+ 'Retrieve all active statuses for a given entity type. Supported entities: customer, contractor, supplier, contact, external-user, pending-item',
1505
2028
  method: 'GET',
1506
2029
  path: '/settings/entity-statuses/{entity}',
1507
2030
  pathParams: ['entity'],
@@ -1534,6 +2057,19 @@ export const operations = [
1534
2057
  queryParams: [],
1535
2058
  hasRequestBody: false,
1536
2059
  },
2060
+ {
2061
+ operationId: 'PublicApiJobTemplateController_list',
2062
+ resourcePath: ['settings', 'jobTemplates'],
2063
+ actionName: 'list',
2064
+ displayName: 'List job templates',
2065
+ description:
2066
+ 'Retrieve all active, public job templates configured for the tenant. Use the returned id as the templateId for POST /jobs/template/:templateId.',
2067
+ method: 'GET',
2068
+ path: '/settings/job-templates',
2069
+ pathParams: [],
2070
+ queryParams: [],
2071
+ hasRequestBody: false,
2072
+ },
1537
2073
  {
1538
2074
  operationId: 'PublicApiPriorityController_list',
1539
2075
  resourcePath: ['settings', 'priorities'],
@@ -1547,13 +2083,39 @@ export const operations = [
1547
2083
  queryParams: [],
1548
2084
  hasRequestBody: false,
1549
2085
  },
2086
+ {
2087
+ operationId: 'PublicApiPriceBookController_list',
2088
+ resourcePath: ['settings', 'pricebooks'],
2089
+ actionName: 'list',
2090
+ displayName: 'List pricebooks',
2091
+ description:
2092
+ 'Discover tenant pricebooks for a category (customer / contractor / supplier). Use category=customer&status=current&assignableOnly=true for job-create candidates. Optional accountId scopes to a CRM account (includeGlobal defaults true). Each item includes company (owning company) and optional account — both match Settings UI fields.',
2093
+ method: 'GET',
2094
+ path: '/settings/pricebooks',
2095
+ pathParams: [],
2096
+ queryParams: ['limit', 'assignableOnly', 'mode', 'search', 'includeGlobal', 'accountId', 'status', 'category'],
2097
+ hasRequestBody: false,
2098
+ },
2099
+ {
2100
+ operationId: 'PublicApiPriceBookController_getByIdOrName',
2101
+ resourcePath: ['settings', 'pricebooks'],
2102
+ actionName: 'getByIdOrName',
2103
+ displayName: 'Get pricebook',
2104
+ description:
2105
+ 'Retrieve a pricebook by id (preferred) or exact name (case-insensitive). Pass category when the name may exist in more than one category. Response includes company (owning company) and optional account, matching Settings UI.',
2106
+ method: 'GET',
2107
+ path: '/settings/pricebooks/{idOrName}',
2108
+ pathParams: ['idOrName'],
2109
+ queryParams: ['category'],
2110
+ hasRequestBody: false,
2111
+ },
1550
2112
  {
1551
2113
  operationId: 'PublicApiStageStatusController_list',
1552
2114
  resourcePath: ['settings', 'stageStatuses'],
1553
2115
  actionName: 'list',
1554
2116
  displayName: 'List stage statuses',
1555
2117
  description:
1556
- 'Retrieve all stage statuses configured for the tenant. Stage statuses represent the workflow states a stage (work order) can transition through (e.g., New, Dispatched, En Route, On Site, Completed, Finalised).',
2118
+ 'Retrieve all stage statuses configured for the tenant (Settings > Stage Status).\nEach item is a workflow state a stage (work order) can use (e.g. New, Dispatched, En Route, On Site, Completed, Finalised).\n\nResponse fields include:\n- identity: id, name, systemName, systemStatus, sortOrder\n- description (nullable)\n- activityOptions: shareWithCustomer, shareWithField (always present; unset = false)\n- displayOptions: showInContractorPortal, showInFieldApp (always present)\n\nDisplay Options rules (match Settings UI):\n- Only systemStatus On Hold or In Progress support display options; other systemStatus values return both flags as false\n- showInFieldApp is not configurable for In Progress and is always false\n- When supported and not configured, visibility defaults to true (Settings UI default)\n\nRequires scope: settings:read',
1557
2119
  method: 'GET',
1558
2120
  path: '/settings/stage-statuses',
1559
2121
  pathParams: [],
@@ -1647,12 +2209,25 @@ export const operations = [
1647
2209
  queryParams: [],
1648
2210
  hasRequestBody: true,
1649
2211
  },
2212
+ {
2213
+ operationId: 'PublicApiItemController_upsert',
2214
+ resourcePath: ['settings', 'items'],
2215
+ actionName: 'upsert',
2216
+ displayName: 'Upsert item',
2217
+ description:
2218
+ 'Create or partially update a settings item using integrationId when supplied, otherwise name. Create still requires mandatory item fields.',
2219
+ method: 'PUT',
2220
+ path: '/settings/items',
2221
+ pathParams: [],
2222
+ queryParams: [],
2223
+ hasRequestBody: true,
2224
+ },
1650
2225
  {
1651
2226
  operationId: 'PublicApiItemController_getById',
1652
2227
  resourcePath: ['settings', 'items'],
1653
2228
  actionName: 'get',
1654
2229
  displayName: 'Get item',
1655
- description: 'Retrieve a settings item by ID.',
2230
+ description: 'Retrieve a settings item by ID, name, or integration ID.',
1656
2231
  method: 'GET',
1657
2232
  path: '/settings/items/{id}',
1658
2233
  pathParams: ['id'],
@@ -1683,28 +2258,17 @@ export const operations = [
1683
2258
  queryParams: [],
1684
2259
  hasRequestBody: false,
1685
2260
  },
1686
- {
1687
- operationId: 'PublicApiItemController_upsert',
1688
- resourcePath: ['settings', 'items'],
1689
- actionName: 'upsert',
1690
- displayName: 'Upsert item',
1691
- description: 'Create or update a settings item using integrationId or name as the match key.',
1692
- method: 'POST',
1693
- path: '/settings/items/upsert',
1694
- pathParams: [],
1695
- queryParams: [],
1696
- hasRequestBody: true,
1697
- },
1698
2261
  {
1699
2262
  operationId: 'PublicApiItemCategoryController_list',
1700
2263
  resourcePath: ['settings', 'itemCategories'],
1701
2264
  actionName: 'list',
1702
2265
  displayName: 'List item categories',
1703
- description: 'Retrieve active item categories and sub-categories.',
2266
+ description:
2267
+ 'Retrieve active item categories and sub-categories. Use search, name, or id to filter by category/sub-category name or id.',
1704
2268
  method: 'GET',
1705
2269
  path: '/settings/item-categories',
1706
2270
  pathParams: [],
1707
- queryParams: [],
2271
+ queryParams: ['id', 'name', 'search'],
1708
2272
  hasRequestBody: false,
1709
2273
  },
1710
2274
  {
@@ -1731,6 +2295,80 @@ export const operations = [
1731
2295
  queryParams: [],
1732
2296
  hasRequestBody: false,
1733
2297
  },
2298
+ {
2299
+ operationId: 'PublicApiCustomFieldController_listJobCustomFields',
2300
+ resourcePath: ['settings', 'customFields', 'jobs'],
2301
+ actionName: 'listJobCustomFields',
2302
+ displayName: 'List job custom fields',
2303
+ description: 'Retrieve configured custom fields that may be used in Job customFields payloads.',
2304
+ method: 'GET',
2305
+ path: '/settings/custom-fields/jobs',
2306
+ pathParams: [],
2307
+ queryParams: [],
2308
+ hasRequestBody: false,
2309
+ },
2310
+ {
2311
+ operationId: 'PublicApiCustomFieldController_listStageCustomFields',
2312
+ resourcePath: ['settings', 'customFields', 'stages'],
2313
+ actionName: 'listStageCustomFields',
2314
+ displayName: 'List stage custom fields',
2315
+ description: 'Retrieve configured custom fields that may be used in Stage customFields payloads.',
2316
+ method: 'GET',
2317
+ path: '/settings/custom-fields/stages',
2318
+ pathParams: [],
2319
+ queryParams: [],
2320
+ hasRequestBody: false,
2321
+ },
2322
+ {
2323
+ operationId: 'PublicApiCustomFieldController_listAccountCustomFields',
2324
+ resourcePath: ['settings', 'customFields', 'accounts'],
2325
+ actionName: 'listAccountCustomFields',
2326
+ displayName: 'List account custom fields',
2327
+ description: 'Retrieve configured custom fields that may be used in CRM account customFields payloads.',
2328
+ method: 'GET',
2329
+ path: '/settings/custom-fields/accounts',
2330
+ pathParams: [],
2331
+ queryParams: [],
2332
+ hasRequestBody: false,
2333
+ },
2334
+ {
2335
+ operationId: 'PublicApiCustomFieldController_listItemCustomFields',
2336
+ resourcePath: ['settings', 'customFields', 'items'],
2337
+ actionName: 'listItemCustomFields',
2338
+ displayName: 'List item custom fields',
2339
+ description: 'Retrieve configured custom fields that may be used in settings item customFields payloads.',
2340
+ method: 'GET',
2341
+ path: '/settings/custom-fields/items',
2342
+ pathParams: [],
2343
+ queryParams: [],
2344
+ hasRequestBody: false,
2345
+ },
2346
+ {
2347
+ operationId: 'PublicApiPortalRoleController_listClientPortal',
2348
+ resourcePath: ['settings', 'roles', 'clientPortal'],
2349
+ actionName: 'list',
2350
+ displayName: 'List client portal roles',
2351
+ description:
2352
+ 'Roles assignable to customer login contacts (UserType.Client). Includes custom client roles; includes built-in system client roles only when Enable System Security Roles is on for the tenant. Use item.id as roleId when login is true on contact create/invite.',
2353
+ method: 'GET',
2354
+ path: '/settings/roles/client-portal',
2355
+ pathParams: [],
2356
+ queryParams: [],
2357
+ hasRequestBody: false,
2358
+ },
2359
+ {
2360
+ operationId: 'PublicApiPortalRoleController_listContractorPortal',
2361
+ resourcePath: ['settings', 'roles', 'contractorPortal'],
2362
+ actionName: 'list',
2363
+ displayName: 'List contractor portal roles',
2364
+ description:
2365
+ 'Roles assignable to contractor login contacts (UserType.Subcontractor). Includes custom contractor roles; includes built-in system contractor roles only when Enable System Security Roles is on for the tenant. Use item.id as roleId when login is true on contact create/invite.',
2366
+ method: 'GET',
2367
+ path: '/settings/roles/contractor-portal',
2368
+ pathParams: [],
2369
+ queryParams: [],
2370
+ hasRequestBody: false,
2371
+ },
1734
2372
  {
1735
2373
  operationId: 'PublicAttachmentController_createUploadSession',
1736
2374
  resourcePath: ['attachments'],
@@ -2272,7 +2910,7 @@ export const operations = [
2272
2910
  method: 'GET',
2273
2911
  path: '/customers',
2274
2912
  pathParams: [],
2275
- queryParams: ['status', 'cursor', 'limit'],
2913
+ queryParams: ['search', 'integrationId', 'status', 'cursor', 'limit'],
2276
2914
  hasRequestBody: false,
2277
2915
  },
2278
2916
  {
@@ -2311,20 +2949,80 @@ export const operations = [
2311
2949
  queryParams: [],
2312
2950
  hasRequestBody: true,
2313
2951
  },
2952
+ {
2953
+ operationId: 'PublicCrmCustomerController_delete',
2954
+ resourcePath: ['crm', 'customers'],
2955
+ actionName: 'delete',
2956
+ displayName: 'Delete customer',
2957
+ description: 'Delete customer',
2958
+ method: 'DELETE',
2959
+ path: '/customers/{id}',
2960
+ pathParams: ['id'],
2961
+ queryParams: [],
2962
+ hasRequestBody: false,
2963
+ },
2964
+ {
2965
+ operationId: 'PublicCrmCustomerController_updateStatus',
2966
+ resourcePath: ['crm', 'customers', 'status'],
2967
+ actionName: 'updateStatus',
2968
+ displayName: 'Update customer status',
2969
+ description: 'Update customer status',
2970
+ method: 'PATCH',
2971
+ path: '/customers/{id}/status',
2972
+ pathParams: ['id'],
2973
+ queryParams: [],
2974
+ hasRequestBody: true,
2975
+ },
2314
2976
  {
2315
2977
  operationId: 'PublicCrmCustomerController_listContacts',
2316
2978
  resourcePath: ['crm', 'customers', 'contacts'],
2317
2979
  actionName: 'list',
2318
2980
  paginatedItemsActionName: 'all',
2319
2981
  paginatedPagesActionName: 'pages',
2320
- displayName: 'List contacts for customer',
2321
- description: 'List contacts for customer',
2982
+ displayName: 'List contacts for customer (contacts + external users)',
2983
+ description: 'List contacts for customer (contacts + external users)',
2322
2984
  method: 'GET',
2323
2985
  path: '/customers/{customerId}/contacts',
2324
2986
  pathParams: ['customerId'],
2325
2987
  queryParams: ['cursor', 'limit'],
2326
2988
  hasRequestBody: false,
2327
2989
  },
2990
+ {
2991
+ operationId: 'PublicCrmCustomerController_createContact',
2992
+ resourcePath: ['crm', 'customers', 'contacts'],
2993
+ actionName: 'createContact',
2994
+ displayName: 'Create customer contact',
2995
+ description: 'Create customer contact',
2996
+ method: 'POST',
2997
+ path: '/customers/{customerId}/contacts',
2998
+ pathParams: ['customerId'],
2999
+ queryParams: [],
3000
+ hasRequestBody: true,
3001
+ },
3002
+ {
3003
+ operationId: 'PublicCrmCustomerController_deleteContact',
3004
+ resourcePath: ['crm', 'customers', 'contacts'],
3005
+ actionName: 'deleteContact',
3006
+ displayName: 'Delete customer contact',
3007
+ description: 'Delete customer contact',
3008
+ method: 'DELETE',
3009
+ path: '/customers/{customerId}/contacts/{contactId}',
3010
+ pathParams: ['customerId', 'contactId'],
3011
+ queryParams: [],
3012
+ hasRequestBody: false,
3013
+ },
3014
+ {
3015
+ operationId: 'PublicCrmCustomerController_inviteContact',
3016
+ resourcePath: ['crm', 'customers', 'contacts', 'invite'],
3017
+ actionName: 'inviteContact',
3018
+ displayName: 'Invite contact (CRM)',
3019
+ description: 'Invite contact (CRM)',
3020
+ method: 'POST',
3021
+ path: '/customers/{customerId}/contacts/{contactId}/invite',
3022
+ pathParams: ['customerId', 'contactId'],
3023
+ queryParams: [],
3024
+ hasRequestBody: true,
3025
+ },
2328
3026
  {
2329
3027
  operationId: 'PublicCrmCustomerController_listSites',
2330
3028
  resourcePath: ['crm', 'customers', 'sites'],
@@ -2376,7 +3074,7 @@ export const operations = [
2376
3074
  method: 'GET',
2377
3075
  path: '/contractors',
2378
3076
  pathParams: [],
2379
- queryParams: ['cursor', 'limit'],
3077
+ queryParams: ['search', 'cursor', 'limit'],
2380
3078
  hasRequestBody: false,
2381
3079
  },
2382
3080
  {
@@ -2415,6 +3113,80 @@ export const operations = [
2415
3113
  queryParams: [],
2416
3114
  hasRequestBody: true,
2417
3115
  },
3116
+ {
3117
+ operationId: 'PublicCrmContractorController_delete',
3118
+ resourcePath: ['crm', 'contractors'],
3119
+ actionName: 'delete',
3120
+ displayName: 'Delete contractor',
3121
+ description: 'Delete contractor',
3122
+ method: 'DELETE',
3123
+ path: '/contractors/{id}',
3124
+ pathParams: ['id'],
3125
+ queryParams: [],
3126
+ hasRequestBody: false,
3127
+ },
3128
+ {
3129
+ operationId: 'PublicCrmContractorController_updateStatus',
3130
+ resourcePath: ['crm', 'contractors', 'status'],
3131
+ actionName: 'updateStatus',
3132
+ displayName: 'Update contractor status',
3133
+ description: 'Update contractor status',
3134
+ method: 'PATCH',
3135
+ path: '/contractors/{id}/status',
3136
+ pathParams: ['id'],
3137
+ queryParams: [],
3138
+ hasRequestBody: true,
3139
+ },
3140
+ {
3141
+ operationId: 'PublicCrmContractorController_listContacts',
3142
+ resourcePath: ['crm', 'contractors', 'contacts'],
3143
+ actionName: 'list',
3144
+ paginatedItemsActionName: 'all',
3145
+ paginatedPagesActionName: 'pages',
3146
+ displayName: 'List contacts for contractor (contacts + external users)',
3147
+ description: 'List contacts for contractor (contacts + external users)',
3148
+ method: 'GET',
3149
+ path: '/contractors/{contractorId}/contacts',
3150
+ pathParams: ['contractorId'],
3151
+ queryParams: ['cursor', 'limit'],
3152
+ hasRequestBody: false,
3153
+ },
3154
+ {
3155
+ operationId: 'PublicCrmContractorController_createContact',
3156
+ resourcePath: ['crm', 'contractors', 'contacts'],
3157
+ actionName: 'createContact',
3158
+ displayName: 'Create contractor contact',
3159
+ description: 'Create contractor contact',
3160
+ method: 'POST',
3161
+ path: '/contractors/{contractorId}/contacts',
3162
+ pathParams: ['contractorId'],
3163
+ queryParams: [],
3164
+ hasRequestBody: true,
3165
+ },
3166
+ {
3167
+ operationId: 'PublicCrmContractorController_deleteContact',
3168
+ resourcePath: ['crm', 'contractors', 'contacts'],
3169
+ actionName: 'deleteContact',
3170
+ displayName: 'Delete contractor contact',
3171
+ description: 'Delete contractor contact',
3172
+ method: 'DELETE',
3173
+ path: '/contractors/{contractorId}/contacts/{contactId}',
3174
+ pathParams: ['contractorId', 'contactId'],
3175
+ queryParams: [],
3176
+ hasRequestBody: false,
3177
+ },
3178
+ {
3179
+ operationId: 'PublicCrmContractorController_inviteContact',
3180
+ resourcePath: ['crm', 'contractors', 'contacts', 'invite'],
3181
+ actionName: 'inviteContact',
3182
+ displayName: 'Invite contact (CRM > Contractors)',
3183
+ description: 'Invite contact (CRM > Contractors)',
3184
+ method: 'POST',
3185
+ path: '/contractors/{contractorId}/contacts/{contactId}/invite',
3186
+ pathParams: ['contractorId', 'contactId'],
3187
+ queryParams: [],
3188
+ hasRequestBody: true,
3189
+ },
2418
3190
  {
2419
3191
  operationId: 'PublicCrmSupplierController_list',
2420
3192
  resourcePath: ['crm', 'suppliers'],
@@ -2426,7 +3198,7 @@ export const operations = [
2426
3198
  method: 'GET',
2427
3199
  path: '/suppliers',
2428
3200
  pathParams: [],
2429
- queryParams: ['cursor', 'limit'],
3201
+ queryParams: ['search', 'cursor', 'limit'],
2430
3202
  hasRequestBody: false,
2431
3203
  },
2432
3204
  {
@@ -2465,6 +3237,30 @@ export const operations = [
2465
3237
  queryParams: [],
2466
3238
  hasRequestBody: true,
2467
3239
  },
3240
+ {
3241
+ operationId: 'PublicCrmSupplierController_delete',
3242
+ resourcePath: ['crm', 'suppliers'],
3243
+ actionName: 'delete',
3244
+ displayName: 'Delete supplier',
3245
+ description: 'Delete supplier',
3246
+ method: 'DELETE',
3247
+ path: '/suppliers/{id}',
3248
+ pathParams: ['id'],
3249
+ queryParams: [],
3250
+ hasRequestBody: false,
3251
+ },
3252
+ {
3253
+ operationId: 'PublicCrmSupplierController_updateStatus',
3254
+ resourcePath: ['crm', 'suppliers', 'status'],
3255
+ actionName: 'updateStatus',
3256
+ displayName: 'Update supplier status',
3257
+ description: 'Update supplier status',
3258
+ method: 'PATCH',
3259
+ path: '/suppliers/{id}/status',
3260
+ pathParams: ['id'],
3261
+ queryParams: [],
3262
+ hasRequestBody: true,
3263
+ },
2468
3264
  {
2469
3265
  operationId: 'PublicCrmCompanyController_list',
2470
3266
  resourcePath: ['crm', 'companies'],
@@ -2476,7 +3272,7 @@ export const operations = [
2476
3272
  method: 'GET',
2477
3273
  path: '/companies',
2478
3274
  pathParams: [],
2479
- queryParams: ['cursor', 'limit'],
3275
+ queryParams: ['search', 'cursor', 'limit'],
2480
3276
  hasRequestBody: false,
2481
3277
  },
2482
3278
  {
@@ -2510,7 +3306,8 @@ export const operations = [
2510
3306
  resourcePath: ['crm', 'externalUsers'],
2511
3307
  actionName: 'get',
2512
3308
  displayName: 'Get external user by ID',
2513
- description: 'Get external user by ID',
3309
+ description:
3310
+ 'Login Contact (portal user). parents lists active parent accounts only; portal role is parents[].role.',
2514
3311
  method: 'GET',
2515
3312
  path: '/external-users/{id}',
2516
3313
  pathParams: ['id'],
@@ -2523,8 +3320,8 @@ export const operations = [
2523
3320
  actionName: 'list',
2524
3321
  paginatedItemsActionName: 'all',
2525
3322
  paginatedPagesActionName: 'pages',
2526
- displayName: 'List contacts (Basic and Login contacts)',
2527
- description: 'List contacts (Basic and Login contacts)',
3323
+ displayName: 'List contacts (contacts + external users)',
3324
+ description: 'List contacts (contacts + external users)',
2528
3325
  method: 'GET',
2529
3326
  path: '/contacts',
2530
3327
  pathParams: [],
@@ -2536,13 +3333,38 @@ export const operations = [
2536
3333
  resourcePath: ['crm', 'contacts'],
2537
3334
  actionName: 'get',
2538
3335
  displayName: 'Get contact by ID',
2539
- description: 'Get contact by ID',
3336
+ description:
3337
+ 'Returns a people contact (basic or Login Contact). parents lists active parent accounts only (inactive/soft-deleted omitted); portal role for Login Contacts is parents[].role.',
2540
3338
  method: 'GET',
2541
3339
  path: '/contacts/{id}',
2542
3340
  pathParams: ['id'],
2543
3341
  queryParams: [],
2544
3342
  hasRequestBody: false,
2545
3343
  },
3344
+ {
3345
+ operationId: 'PublicCrmContactController_update',
3346
+ resourcePath: ['crm', 'contacts'],
3347
+ actionName: 'update',
3348
+ displayName: 'Update contact',
3349
+ description: 'Update contact',
3350
+ method: 'PATCH',
3351
+ path: '/contacts/{id}',
3352
+ pathParams: ['id'],
3353
+ queryParams: [],
3354
+ hasRequestBody: true,
3355
+ },
3356
+ {
3357
+ operationId: 'PublicCrmContactController_updateStatus',
3358
+ resourcePath: ['crm', 'contacts', 'status'],
3359
+ actionName: 'updateStatus',
3360
+ displayName: 'Update contact status',
3361
+ description: 'Update contact status',
3362
+ method: 'PATCH',
3363
+ path: '/contacts/{id}/status',
3364
+ pathParams: ['id'],
3365
+ queryParams: [],
3366
+ hasRequestBody: true,
3367
+ },
2546
3368
  {
2547
3369
  operationId: 'PublicCrmInviteController_list',
2548
3370
  resourcePath: ['crm', 'invites'],
@@ -2554,7 +3376,7 @@ export const operations = [
2554
3376
  method: 'GET',
2555
3377
  path: '/invites',
2556
3378
  pathParams: [],
2557
- queryParams: ['cursor', 'limit'],
3379
+ queryParams: ['search', 'cursor', 'limit'],
2558
3380
  hasRequestBody: false,
2559
3381
  },
2560
3382
  {
@@ -2576,11 +3398,12 @@ export const operations = [
2576
3398
  paginatedItemsActionName: 'all',
2577
3399
  paginatedPagesActionName: 'pages',
2578
3400
  displayName: 'List all sites',
2579
- description: 'List all sites',
3401
+ description:
3402
+ 'List CRM sites for the tenant (Managed and Account only — Adhoc sites are excluded). Each item includes type (Managed | Account), optional primaryContact, and address. Optional search filters by site name/address tokens (space-separated words; all must match).',
2580
3403
  method: 'GET',
2581
3404
  path: '/sites',
2582
3405
  pathParams: [],
2583
- queryParams: ['status', 'cursor', 'limit'],
3406
+ queryParams: ['search', 'status', 'cursor', 'limit'],
2584
3407
  hasRequestBody: false,
2585
3408
  },
2586
3409
  {
@@ -2588,13 +3411,29 @@ export const operations = [
2588
3411
  resourcePath: ['crm', 'sites'],
2589
3412
  actionName: 'get',
2590
3413
  displayName: 'Get site by ID',
2591
- description: 'Get site by ID',
3414
+ description:
3415
+ 'Retrieve a CRM site by id (Managed or Account only). Adhoc sites are not exposed. Includes primaryContact when set (UI Primary Contact). type is CRM Site Type — not address.type.',
2592
3416
  method: 'GET',
2593
3417
  path: '/sites/{id}',
2594
3418
  pathParams: ['id'],
2595
3419
  queryParams: [],
2596
3420
  hasRequestBody: false,
2597
3421
  },
3422
+ {
3423
+ operationId: 'PublicCrmSiteController_listContacts',
3424
+ resourcePath: ['crm', 'sites', 'contacts'],
3425
+ actionName: 'list',
3426
+ paginatedItemsActionName: 'all',
3427
+ paginatedPagesActionName: 'pages',
3428
+ displayName: 'List contacts for site',
3429
+ description:
3430
+ 'List contacts linked to this site (same pattern as GET /customers/{id}/contacts). Returns basic contacts and external users parented to the site.',
3431
+ method: 'GET',
3432
+ path: '/sites/{id}/contacts',
3433
+ pathParams: ['id'],
3434
+ queryParams: ['cursor', 'limit'],
3435
+ hasRequestBody: false,
3436
+ },
2598
3437
  {
2599
3438
  operationId: 'PublicApiWebhookV2Controller_listEntities',
2600
3439
  resourcePath: ['webhooks', 'entities'],