@workbuddy/sdk-js-vnext 1.0.131 → 1.0.133

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 +625 -3
  2. package/index.js +231 -4
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1701,6 +1701,71 @@ export interface WorkBuddyJobsStagesResourcesStatusUpdateStatusParams extends Wo
1701
1701
  location?: { lat: number; lng: number };
1702
1702
  }
1703
1703
 
1704
+ export interface WorkBuddyJobsStagesAppointmentsListParams extends WorkBuddyRequestParams {
1705
+ /**
1706
+ * Job ID
1707
+ */
1708
+ jobId: string;
1709
+ /**
1710
+ * Stage ID
1711
+ */
1712
+ stageId: string;
1713
+ }
1714
+
1715
+ export interface WorkBuddyJobsStagesAppointmentsCreateParams extends WorkBuddyRequestParams {
1716
+ /**
1717
+ * Job ID
1718
+ */
1719
+ jobId: string;
1720
+ /**
1721
+ * Stage ID
1722
+ */
1723
+ stageId: string;
1724
+ /**
1725
+ * resource ID
1726
+ */
1727
+ resourceId: string;
1728
+
1729
+ start: string;
1730
+
1731
+ end: string;
1732
+
1733
+ type?: 'Onsite' | 'Meeting' | 'Phone Call';
1734
+
1735
+ bookingStatus?: 'Confirmed' | 'Tentative';
1736
+
1737
+ note?: string;
1738
+ /**
1739
+ * integration ID
1740
+ */
1741
+ integrationId?: string;
1742
+ /**
1743
+ * Status filter
1744
+ */
1745
+ status?: 'Open' | 'Enroute' | 'Onsite' | 'Checked Out' | 'Completed' | 'Cancelled';
1746
+ }
1747
+
1748
+ export interface WorkBuddyJobsStagesAppointmentsUpdateParams extends WorkBuddyRequestParams {
1749
+ /**
1750
+ * Job ID
1751
+ */
1752
+ jobId: string;
1753
+ /**
1754
+ * Stage ID
1755
+ */
1756
+ stageId: string;
1757
+ /**
1758
+ * Appointment ID
1759
+ */
1760
+ appointmentId: string;
1761
+ /**
1762
+ * Status filter
1763
+ */
1764
+ status?: 'Open' | 'Enroute' | 'Onsite' | 'Checked Out' | 'Completed' | 'Cancelled';
1765
+
1766
+ bookingStatus?: 'Confirmed' | 'Tentative';
1767
+ }
1768
+
1704
1769
  export interface WorkBuddySettingsEntityStatusesListParams extends WorkBuddyRequestParams {
1705
1770
  /**
1706
1771
  * Entity type (customer, contractor, supplier, contact, external-user, pending-item)
@@ -3285,6 +3350,8 @@ export interface WorkBuddySettingsItemsUpsertParams extends WorkBuddyRequestPara
3285
3350
 
3286
3351
  codeInvoicingStatus?: 'Billable' | 'No Charge' | 'Not Billable';
3287
3352
 
3353
+ payable?: boolean;
3354
+
3288
3355
  suppliedBySubcontractor?: boolean;
3289
3356
 
3290
3357
  autoCreateTask?: boolean;
@@ -3389,6 +3456,8 @@ export interface WorkBuddySettingsItemsUpdateParams extends WorkBuddyRequestPara
3389
3456
 
3390
3457
  codeInvoicingStatus?: 'Billable' | 'No Charge' | 'Not Billable';
3391
3458
 
3459
+ payable?: boolean;
3460
+
3392
3461
  suppliedBySubcontractor?: boolean;
3393
3462
 
3394
3463
  autoCreateTask?: boolean;
@@ -3489,6 +3558,24 @@ export interface WorkBuddyJobsActivitiesListParams extends WorkBuddyRequestParam
3489
3558
  limit?: number;
3490
3559
  }
3491
3560
 
3561
+ export interface WorkBuddyJobsActivitiesTemplatesListParams extends WorkBuddyRequestParams {
3562
+ /**
3563
+ * Job ID or job number (e.g. J12345)
3564
+ */
3565
+ jobId: string;
3566
+ /**
3567
+ * Message channel
3568
+ */
3569
+ channel: 'email' | 'sms';
3570
+ }
3571
+
3572
+ export interface WorkBuddyJobsActivitiesMergeFieldsListParams extends WorkBuddyRequestParams {
3573
+ /**
3574
+ * Job ID or job number (e.g. J12345)
3575
+ */
3576
+ jobId: string;
3577
+ }
3578
+
3492
3579
  export interface WorkBuddyJobsActivitiesGetParams extends WorkBuddyRequestParams {
3493
3580
  /**
3494
3581
  * Job ID or job number (e.g. J12345)
@@ -3606,6 +3693,76 @@ export interface WorkBuddyJobsActivitiesSmsCreateSmsParams extends WorkBuddyRequ
3606
3693
  sharing?: { sharedWithCustomer?: boolean; sharedWithField?: boolean; sensitive?: boolean };
3607
3694
  }
3608
3695
 
3696
+ export interface WorkBuddyJobsActivitiesEmailPreviewPreviewEmailParams extends WorkBuddyRequestParams {
3697
+ /**
3698
+ * Job ID or job number (e.g. J12345)
3699
+ */
3700
+ jobId: string;
3701
+ /**
3702
+ * Template ID to pre-populate fields from a template
3703
+ */
3704
+ templateId?: string;
3705
+ /**
3706
+ * Email subject line
3707
+ */
3708
+ subject?: string;
3709
+ /**
3710
+ * Message body content (HTML supported for email)
3711
+ */
3712
+ body?: string;
3713
+ /**
3714
+ * Recipients
3715
+ */
3716
+ to?: { email: string }[];
3717
+ /**
3718
+ * CC recipients
3719
+ */
3720
+ cc?: { email: string }[];
3721
+ /**
3722
+ * BCC recipients
3723
+ */
3724
+ bcc?: { email: string }[];
3725
+ /**
3726
+ * Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")
3727
+ */
3728
+ labelIds?: string[];
3729
+ /**
3730
+ * Attachment IDs from the upload endpoint (comma-separated, e.g. "id1,id2")
3731
+ */
3732
+ attachmentIds?: string[];
3733
+ /**
3734
+ * Sharing options — control visibility to customer portal and field app
3735
+ */
3736
+ sharing?: { sharedWithCustomer?: boolean; sharedWithField?: boolean; sensitive?: boolean };
3737
+ }
3738
+
3739
+ export interface WorkBuddyJobsActivitiesSmsPreviewPreviewSmsParams extends WorkBuddyRequestParams {
3740
+ /**
3741
+ * Job ID or job number (e.g. J12345)
3742
+ */
3743
+ jobId: string;
3744
+ /**
3745
+ * Template ID to pre-populate fields from a template
3746
+ */
3747
+ templateId?: string;
3748
+ /**
3749
+ * Message body content (HTML supported for email)
3750
+ */
3751
+ body?: string;
3752
+ /**
3753
+ * Recipients
3754
+ */
3755
+ to?: { name?: string; mobile: string }[];
3756
+ /**
3757
+ * Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")
3758
+ */
3759
+ labelIds?: string[];
3760
+ /**
3761
+ * Sharing options — control visibility to customer portal and field app
3762
+ */
3763
+ sharing?: { sharedWithCustomer?: boolean; sharedWithField?: boolean; sensitive?: boolean };
3764
+ }
3765
+
3609
3766
  export interface WorkBuddyJobsActivitiesPhoneCreatePhoneParams extends WorkBuddyRequestParams {
3610
3767
  /**
3611
3768
  * Job ID or job number (e.g. J12345)
@@ -3690,6 +3847,28 @@ export interface WorkBuddyJobsStagesActivitiesListParams extends WorkBuddyReques
3690
3847
  limit?: number;
3691
3848
  }
3692
3849
 
3850
+ export interface WorkBuddyJobsStagesActivitiesTemplatesListParams extends WorkBuddyRequestParams {
3851
+ /**
3852
+ * Stage ID or stage number
3853
+ */
3854
+ stageId: string;
3855
+
3856
+ jobId: string;
3857
+ /**
3858
+ * Message channel
3859
+ */
3860
+ channel: 'email' | 'sms';
3861
+ }
3862
+
3863
+ export interface WorkBuddyJobsStagesActivitiesMergeFieldsListParams extends WorkBuddyRequestParams {
3864
+ /**
3865
+ * Stage ID or stage number
3866
+ */
3867
+ stageId: string;
3868
+
3869
+ jobId: string;
3870
+ }
3871
+
3693
3872
  export interface WorkBuddyJobsStagesActivitiesGetParams extends WorkBuddyRequestParams {
3694
3873
  /**
3695
3874
  * Stage ID or stage number
@@ -3821,6 +4000,80 @@ export interface WorkBuddyJobsStagesActivitiesSmsCreateSmsParams extends WorkBud
3821
4000
  sharing?: { sharedWithCustomer?: boolean; sharedWithField?: boolean; sensitive?: boolean };
3822
4001
  }
3823
4002
 
4003
+ export interface WorkBuddyJobsStagesActivitiesEmailPreviewPreviewEmailParams extends WorkBuddyRequestParams {
4004
+ /**
4005
+ * Stage ID or stage number
4006
+ */
4007
+ stageId: string;
4008
+
4009
+ jobId: string;
4010
+ /**
4011
+ * Template ID to pre-populate fields from a template
4012
+ */
4013
+ templateId?: string;
4014
+ /**
4015
+ * Email subject line
4016
+ */
4017
+ subject?: string;
4018
+ /**
4019
+ * Message body content (HTML supported for email)
4020
+ */
4021
+ body?: string;
4022
+ /**
4023
+ * Recipients
4024
+ */
4025
+ to?: { email: string }[];
4026
+ /**
4027
+ * CC recipients
4028
+ */
4029
+ cc?: { email: string }[];
4030
+ /**
4031
+ * BCC recipients
4032
+ */
4033
+ bcc?: { email: string }[];
4034
+ /**
4035
+ * Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")
4036
+ */
4037
+ labelIds?: string[];
4038
+ /**
4039
+ * Attachment IDs from the upload endpoint (comma-separated, e.g. "id1,id2")
4040
+ */
4041
+ attachmentIds?: string[];
4042
+ /**
4043
+ * Sharing options — control visibility to customer portal and field app
4044
+ */
4045
+ sharing?: { sharedWithCustomer?: boolean; sharedWithField?: boolean; sensitive?: boolean };
4046
+ }
4047
+
4048
+ export interface WorkBuddyJobsStagesActivitiesSmsPreviewPreviewSmsParams extends WorkBuddyRequestParams {
4049
+ /**
4050
+ * Stage ID or stage number
4051
+ */
4052
+ stageId: string;
4053
+
4054
+ jobId: string;
4055
+ /**
4056
+ * Template ID to pre-populate fields from a template
4057
+ */
4058
+ templateId?: string;
4059
+ /**
4060
+ * Message body content (HTML supported for email)
4061
+ */
4062
+ body?: string;
4063
+ /**
4064
+ * Recipients
4065
+ */
4066
+ to?: { name?: string; mobile: string }[];
4067
+ /**
4068
+ * Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")
4069
+ */
4070
+ labelIds?: string[];
4071
+ /**
4072
+ * Sharing options — control visibility to customer portal and field app
4073
+ */
4074
+ sharing?: { sharedWithCustomer?: boolean; sharedWithField?: boolean; sensitive?: boolean };
4075
+ }
4076
+
3824
4077
  export interface WorkBuddyJobsStagesActivitiesPhoneCreatePhoneParams extends WorkBuddyRequestParams {
3825
4078
  /**
3826
4079
  * Stage ID or stage number
@@ -5440,7 +5693,16 @@ export interface WorkBuddyAgentHarnessRunsEventsIngestEventParams extends WorkBu
5440
5693
  /**
5441
5694
  * Lifecycle event being reported for the run
5442
5695
  */
5443
- eventType: 'message' | 'progress' | 'action_required' | 'action_resolved' | 'completed' | 'failed' | 'heartbeat';
5696
+ eventType:
5697
+ | 'message'
5698
+ | 'progress'
5699
+ | 'action_required'
5700
+ | 'action_resolved'
5701
+ | 'completed'
5702
+ | 'failed'
5703
+ | 'heartbeat'
5704
+ | 'waiting'
5705
+ | 'resume_requested';
5444
5706
  /**
5445
5707
  * Optional monotonically increasing sequence number from the agent
5446
5708
  */
@@ -7449,6 +7711,44 @@ export type WorkBuddyJobsStagesResourcesGetResponse = {
7449
7711
  export type WorkBuddyJobsStagesResourcesUnassignResponse = unknown;
7450
7712
  export type WorkBuddyJobsStagesResourcesReissueReissueResponse = unknown;
7451
7713
  export type WorkBuddyJobsStagesResourcesStatusUpdateStatusResponse = unknown;
7714
+ export type WorkBuddyJobsStagesAppointmentsListResponse = {
7715
+ items: {
7716
+ id: string;
7717
+ resource: string;
7718
+ start: string;
7719
+ end: string;
7720
+ timezone: string;
7721
+ type: string;
7722
+ bookingStatus: string;
7723
+ note: string;
7724
+ status: 'Open' | 'Enroute' | 'Onsite' | 'Checked Out' | 'Completed' | 'Cancelled';
7725
+ integrationId: string;
7726
+ }[];
7727
+ };
7728
+ export type WorkBuddyJobsStagesAppointmentsCreateResponse = {
7729
+ id: string;
7730
+ resource: string;
7731
+ start: string;
7732
+ end: string;
7733
+ timezone: string;
7734
+ type: string;
7735
+ bookingStatus: string;
7736
+ note: string;
7737
+ status: 'Open' | 'Enroute' | 'Onsite' | 'Checked Out' | 'Completed' | 'Cancelled';
7738
+ integrationId: string;
7739
+ };
7740
+ export type WorkBuddyJobsStagesAppointmentsUpdateResponse = {
7741
+ id: string;
7742
+ resource: string;
7743
+ start: string;
7744
+ end: string;
7745
+ timezone: string;
7746
+ type: string;
7747
+ bookingStatus: string;
7748
+ note: string;
7749
+ status: 'Open' | 'Enroute' | 'Onsite' | 'Checked Out' | 'Completed' | 'Cancelled';
7750
+ integrationId: string;
7751
+ };
7452
7752
  export type WorkBuddySettingsEntityStatusesListResponse = { items: { id: string; name: string; statusType: string }[] };
7453
7753
  export type WorkBuddySettingsJobStatusesListResponse = { items: { id: string; name: string }[] };
7454
7754
  export type WorkBuddySettingsJobTypesListResponse = {
@@ -11788,6 +12088,7 @@ export type WorkBuddySettingsItemsListResponse = {
11788
12088
  purchaseGlCode?: string;
11789
12089
  purchaseTaxRate?: string;
11790
12090
  codeInvoicingStatus?: 'Billable' | 'No Charge' | 'Not Billable';
12091
+ payable: boolean;
11791
12092
  suppliedBySubcontractor?: boolean;
11792
12093
  autoCreateTask?: boolean;
11793
12094
  customFields?: string;
@@ -11825,6 +12126,7 @@ export type WorkBuddySettingsItemsCreateResponse = {
11825
12126
  purchaseGlCode?: string;
11826
12127
  purchaseTaxRate?: string;
11827
12128
  codeInvoicingStatus?: 'Billable' | 'No Charge' | 'Not Billable';
12129
+ payable: boolean;
11828
12130
  suppliedBySubcontractor?: boolean;
11829
12131
  autoCreateTask?: boolean;
11830
12132
  customFields?: string;
@@ -11861,6 +12163,7 @@ export type WorkBuddySettingsItemsUpsertResponse = {
11861
12163
  purchaseGlCode?: string;
11862
12164
  purchaseTaxRate?: string;
11863
12165
  codeInvoicingStatus?: 'Billable' | 'No Charge' | 'Not Billable';
12166
+ payable: boolean;
11864
12167
  suppliedBySubcontractor?: boolean;
11865
12168
  autoCreateTask?: boolean;
11866
12169
  customFields?: string;
@@ -11897,6 +12200,7 @@ export type WorkBuddySettingsItemsGetResponse = {
11897
12200
  purchaseGlCode?: string;
11898
12201
  purchaseTaxRate?: string;
11899
12202
  codeInvoicingStatus?: 'Billable' | 'No Charge' | 'Not Billable';
12203
+ payable: boolean;
11900
12204
  suppliedBySubcontractor?: boolean;
11901
12205
  autoCreateTask?: boolean;
11902
12206
  customFields?: string;
@@ -11933,6 +12237,7 @@ export type WorkBuddySettingsItemsUpdateResponse = {
11933
12237
  purchaseGlCode?: string;
11934
12238
  purchaseTaxRate?: string;
11935
12239
  codeInvoicingStatus?: 'Billable' | 'No Charge' | 'Not Billable';
12240
+ payable: boolean;
11936
12241
  suppliedBySubcontractor?: boolean;
11937
12242
  autoCreateTask?: boolean;
11938
12243
  customFields?: string;
@@ -12033,6 +12338,23 @@ export type WorkBuddyJobsActivitiesListResponse = {
12033
12338
  items: Record<string, unknown>[];
12034
12339
  pagination: { limit: number; hasMore: boolean; nextCursor: string };
12035
12340
  };
12341
+ export type WorkBuddyJobsActivitiesTemplatesListResponse = {
12342
+ items: {
12343
+ id: string;
12344
+ name: string;
12345
+ channel: 'email' | 'sms';
12346
+ context: 'job' | 'stage';
12347
+ subject?: string;
12348
+ body?: string;
12349
+ from?: string;
12350
+ to: { id?: string; name?: string; kind: 'role' | 'fixed'; email?: string; mobile?: string }[];
12351
+ cc: { id?: string; name?: string; kind: 'role' | 'fixed'; email?: string; mobile?: string }[];
12352
+ bcc: { id?: string; name?: string; kind: 'role' | 'fixed'; email?: string; mobile?: string }[];
12353
+ }[];
12354
+ };
12355
+ export type WorkBuddyJobsActivitiesMergeFieldsListResponse = {
12356
+ items: { key: string; label: string; type: string; custom: boolean; group?: string; itemFields?: string }[];
12357
+ };
12036
12358
  export type WorkBuddyJobsActivitiesGetResponse = {
12037
12359
  id: string;
12038
12360
  kind:
@@ -12122,6 +12444,80 @@ export type WorkBuddyJobsActivitiesSmsCreateSmsResponse = {
12122
12444
  labels?: string;
12123
12445
  sharing?: string;
12124
12446
  };
12447
+ export type WorkBuddyJobsActivitiesEmailPreviewPreviewEmailResponse = {
12448
+ channel: 'email' | 'sms';
12449
+ template?: string;
12450
+ renderedFor?: string;
12451
+ subject?: string;
12452
+ body?: string;
12453
+ from?: string;
12454
+ recipients: {
12455
+ to: {
12456
+ source: 'request' | 'template';
12457
+ role?: string;
12458
+ name?: string;
12459
+ email?: string;
12460
+ mobile?: string;
12461
+ status: 'resolved' | 'no_address' | 'unresolved';
12462
+ }[];
12463
+ cc: {
12464
+ source: 'request' | 'template';
12465
+ role?: string;
12466
+ name?: string;
12467
+ email?: string;
12468
+ mobile?: string;
12469
+ status: 'resolved' | 'no_address' | 'unresolved';
12470
+ }[];
12471
+ bcc: {
12472
+ source: 'request' | 'template';
12473
+ role?: string;
12474
+ name?: string;
12475
+ email?: string;
12476
+ mobile?: string;
12477
+ status: 'resolved' | 'no_address' | 'unresolved';
12478
+ }[];
12479
+ };
12480
+ mergeFields: { key: string; label?: string; status: 'resolved' | 'empty' | 'unknown' }[];
12481
+ diagnostics: { code: string; severity: 'error' | 'warning'; message: string; field?: string }[];
12482
+ sendable: boolean;
12483
+ };
12484
+ export type WorkBuddyJobsActivitiesSmsPreviewPreviewSmsResponse = {
12485
+ channel: 'email' | 'sms';
12486
+ template?: string;
12487
+ renderedFor?: string;
12488
+ subject?: string;
12489
+ body?: string;
12490
+ from?: string;
12491
+ recipients: {
12492
+ to: {
12493
+ source: 'request' | 'template';
12494
+ role?: string;
12495
+ name?: string;
12496
+ email?: string;
12497
+ mobile?: string;
12498
+ status: 'resolved' | 'no_address' | 'unresolved';
12499
+ }[];
12500
+ cc: {
12501
+ source: 'request' | 'template';
12502
+ role?: string;
12503
+ name?: string;
12504
+ email?: string;
12505
+ mobile?: string;
12506
+ status: 'resolved' | 'no_address' | 'unresolved';
12507
+ }[];
12508
+ bcc: {
12509
+ source: 'request' | 'template';
12510
+ role?: string;
12511
+ name?: string;
12512
+ email?: string;
12513
+ mobile?: string;
12514
+ status: 'resolved' | 'no_address' | 'unresolved';
12515
+ }[];
12516
+ };
12517
+ mergeFields: { key: string; label?: string; status: 'resolved' | 'empty' | 'unknown' }[];
12518
+ diagnostics: { code: string; severity: 'error' | 'warning'; message: string; field?: string }[];
12519
+ sendable: boolean;
12520
+ };
12125
12521
  export type WorkBuddyJobsActivitiesPhoneCreatePhoneResponse = {
12126
12522
  id: string;
12127
12523
  kind:
@@ -12192,6 +12588,23 @@ export type WorkBuddyJobsStagesActivitiesListResponse = {
12192
12588
  items: Record<string, unknown>[];
12193
12589
  pagination: { limit: number; hasMore: boolean; nextCursor: string };
12194
12590
  };
12591
+ export type WorkBuddyJobsStagesActivitiesTemplatesListResponse = {
12592
+ items: {
12593
+ id: string;
12594
+ name: string;
12595
+ channel: 'email' | 'sms';
12596
+ context: 'job' | 'stage';
12597
+ subject?: string;
12598
+ body?: string;
12599
+ from?: string;
12600
+ to: { id?: string; name?: string; kind: 'role' | 'fixed'; email?: string; mobile?: string }[];
12601
+ cc: { id?: string; name?: string; kind: 'role' | 'fixed'; email?: string; mobile?: string }[];
12602
+ bcc: { id?: string; name?: string; kind: 'role' | 'fixed'; email?: string; mobile?: string }[];
12603
+ }[];
12604
+ };
12605
+ export type WorkBuddyJobsStagesActivitiesMergeFieldsListResponse = {
12606
+ items: { key: string; label: string; type: string; custom: boolean; group?: string; itemFields?: string }[];
12607
+ };
12195
12608
  export type WorkBuddyJobsStagesActivitiesGetResponse = {
12196
12609
  id: string;
12197
12610
  kind:
@@ -12281,6 +12694,80 @@ export type WorkBuddyJobsStagesActivitiesSmsCreateSmsResponse = {
12281
12694
  labels?: string;
12282
12695
  sharing?: string;
12283
12696
  };
12697
+ export type WorkBuddyJobsStagesActivitiesEmailPreviewPreviewEmailResponse = {
12698
+ channel: 'email' | 'sms';
12699
+ template?: string;
12700
+ renderedFor?: string;
12701
+ subject?: string;
12702
+ body?: string;
12703
+ from?: string;
12704
+ recipients: {
12705
+ to: {
12706
+ source: 'request' | 'template';
12707
+ role?: string;
12708
+ name?: string;
12709
+ email?: string;
12710
+ mobile?: string;
12711
+ status: 'resolved' | 'no_address' | 'unresolved';
12712
+ }[];
12713
+ cc: {
12714
+ source: 'request' | 'template';
12715
+ role?: string;
12716
+ name?: string;
12717
+ email?: string;
12718
+ mobile?: string;
12719
+ status: 'resolved' | 'no_address' | 'unresolved';
12720
+ }[];
12721
+ bcc: {
12722
+ source: 'request' | 'template';
12723
+ role?: string;
12724
+ name?: string;
12725
+ email?: string;
12726
+ mobile?: string;
12727
+ status: 'resolved' | 'no_address' | 'unresolved';
12728
+ }[];
12729
+ };
12730
+ mergeFields: { key: string; label?: string; status: 'resolved' | 'empty' | 'unknown' }[];
12731
+ diagnostics: { code: string; severity: 'error' | 'warning'; message: string; field?: string }[];
12732
+ sendable: boolean;
12733
+ };
12734
+ export type WorkBuddyJobsStagesActivitiesSmsPreviewPreviewSmsResponse = {
12735
+ channel: 'email' | 'sms';
12736
+ template?: string;
12737
+ renderedFor?: string;
12738
+ subject?: string;
12739
+ body?: string;
12740
+ from?: string;
12741
+ recipients: {
12742
+ to: {
12743
+ source: 'request' | 'template';
12744
+ role?: string;
12745
+ name?: string;
12746
+ email?: string;
12747
+ mobile?: string;
12748
+ status: 'resolved' | 'no_address' | 'unresolved';
12749
+ }[];
12750
+ cc: {
12751
+ source: 'request' | 'template';
12752
+ role?: string;
12753
+ name?: string;
12754
+ email?: string;
12755
+ mobile?: string;
12756
+ status: 'resolved' | 'no_address' | 'unresolved';
12757
+ }[];
12758
+ bcc: {
12759
+ source: 'request' | 'template';
12760
+ role?: string;
12761
+ name?: string;
12762
+ email?: string;
12763
+ mobile?: string;
12764
+ status: 'resolved' | 'no_address' | 'unresolved';
12765
+ }[];
12766
+ };
12767
+ mergeFields: { key: string; label?: string; status: 'resolved' | 'empty' | 'unknown' }[];
12768
+ diagnostics: { code: string; severity: 'error' | 'warning'; message: string; field?: string }[];
12769
+ sendable: boolean;
12770
+ };
12284
12771
  export type WorkBuddyJobsStagesActivitiesPhoneCreatePhoneResponse = {
12285
12772
  id: string;
12286
12773
  kind:
@@ -14025,6 +14512,8 @@ export interface WorkBuddyJobsStagesResource {
14025
14512
  pendingItems: WorkBuddyJobsStagesPendingItemsResource;
14026
14513
  /** Resources API operations. */
14027
14514
  resources: WorkBuddyJobsStagesResourcesResource;
14515
+ /** Appointments API operations. */
14516
+ appointments: WorkBuddyJobsStagesAppointmentsResource;
14028
14517
  /** Activities API operations. */
14029
14518
  activities: WorkBuddyJobsStagesActivitiesResource;
14030
14519
  /** Files API operations. */
@@ -14270,7 +14759,40 @@ export interface WorkBuddyJobsStagesResourcesStatusResource {
14270
14759
  ): Promise<TResponse>;
14271
14760
  }
14272
14761
 
14762
+ export interface WorkBuddyJobsStagesAppointmentsResource {
14763
+ /**
14764
+ * List stage appointments
14765
+ * Operation: PublicJobStageAppointmentController_list
14766
+ */
14767
+ list<TResponse = WorkBuddyJobsStagesAppointmentsListResponse>(
14768
+ params: WorkBuddyJobsStagesAppointmentsListParams,
14769
+ options?: WorkBuddyRequestOptions
14770
+ ): Promise<TResponse>;
14771
+
14772
+ /**
14773
+ * start and end are a local clock with no timezone, read in the stage site timezone. A status other than Open is applied after the appointment is created.
14774
+ * Operation: PublicJobStageAppointmentController_create
14775
+ */
14776
+ create<TResponse = WorkBuddyJobsStagesAppointmentsCreateResponse>(
14777
+ params: WorkBuddyJobsStagesAppointmentsCreateParams,
14778
+ options?: WorkBuddyRequestOptions
14779
+ ): Promise<TResponse>;
14780
+
14781
+ /**
14782
+ * Update an appointment status or booking
14783
+ * Operation: PublicJobStageAppointmentController_update
14784
+ */
14785
+ update<TResponse = WorkBuddyJobsStagesAppointmentsUpdateResponse>(
14786
+ params: WorkBuddyJobsStagesAppointmentsUpdateParams,
14787
+ options?: WorkBuddyRequestOptions
14788
+ ): Promise<TResponse>;
14789
+ }
14790
+
14273
14791
  export interface WorkBuddyJobsStagesActivitiesResource {
14792
+ /** Templates API operations. */
14793
+ templates: WorkBuddyJobsStagesActivitiesTemplatesResource;
14794
+ /** Merge Fields API operations. */
14795
+ mergeFields: WorkBuddyJobsStagesActivitiesMergeFieldsResource;
14274
14796
  /** Note API operations. */
14275
14797
  note: WorkBuddyJobsStagesActivitiesNoteResource;
14276
14798
  /** Email API operations. */
@@ -14320,6 +14842,28 @@ export interface WorkBuddyJobsStagesActivitiesResource {
14320
14842
  ): Promise<TResponse>;
14321
14843
  }
14322
14844
 
14845
+ export interface WorkBuddyJobsStagesActivitiesTemplatesResource {
14846
+ /**
14847
+ * Published templates of the channel this record may send: its own entity's (and, on a stage, the job's), narrowed by each template's company, job type and work category scope exactly as the send applies it. Pass an `id` as `templateId` to the email or SMS create or preview.
14848
+ * Operation: PublicStageActivitiesController_listTemplates
14849
+ */
14850
+ list<TResponse = WorkBuddyJobsStagesActivitiesTemplatesListResponse>(
14851
+ params: WorkBuddyJobsStagesActivitiesTemplatesListParams,
14852
+ options?: WorkBuddyRequestOptions
14853
+ ): Promise<TResponse>;
14854
+ }
14855
+
14856
+ export interface WorkBuddyJobsStagesActivitiesMergeFieldsResource {
14857
+ /**
14858
+ * The merge fields this record's email and SMS templates may use, custom fields included, with keys as templates name them (`<span data-wb-merge="job.jobNumber">` or `{{job.jobNumber}}`).
14859
+ * Operation: PublicStageActivitiesController_listMergeFields
14860
+ */
14861
+ list<TResponse = WorkBuddyJobsStagesActivitiesMergeFieldsListResponse>(
14862
+ params: WorkBuddyJobsStagesActivitiesMergeFieldsListParams,
14863
+ options?: WorkBuddyRequestOptions
14864
+ ): Promise<TResponse>;
14865
+ }
14866
+
14323
14867
  export interface WorkBuddyJobsStagesActivitiesNoteResource {
14324
14868
  /**
14325
14869
  * Create note activity (Stages)
@@ -14332,6 +14876,8 @@ export interface WorkBuddyJobsStagesActivitiesNoteResource {
14332
14876
  }
14333
14877
 
14334
14878
  export interface WorkBuddyJobsStagesActivitiesEmailResource {
14879
+ /** Preview API operations. */
14880
+ preview: WorkBuddyJobsStagesActivitiesEmailPreviewResource;
14335
14881
  /**
14336
14882
  * Create email activity (Stages)
14337
14883
  * Operation: PublicStageActivitiesController_createEmail
@@ -14342,9 +14888,22 @@ export interface WorkBuddyJobsStagesActivitiesEmailResource {
14342
14888
  ): Promise<TResponse>;
14343
14889
  }
14344
14890
 
14891
+ export interface WorkBuddyJobsStagesActivitiesEmailPreviewResource {
14892
+ /**
14893
+ * Renders the email create body with the create's own template renderer and reports the subject, body, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.
14894
+ * Operation: PublicStageActivitiesController_previewEmail
14895
+ */
14896
+ previewEmail<TResponse = WorkBuddyJobsStagesActivitiesEmailPreviewPreviewEmailResponse>(
14897
+ params: WorkBuddyJobsStagesActivitiesEmailPreviewPreviewEmailParams,
14898
+ options?: WorkBuddyRequestOptions
14899
+ ): Promise<TResponse>;
14900
+ }
14901
+
14345
14902
  export interface WorkBuddyJobsStagesActivitiesSmsResource {
14903
+ /** Preview API operations. */
14904
+ preview: WorkBuddyJobsStagesActivitiesSmsPreviewResource;
14346
14905
  /**
14347
- * Create SMS activity (Stages)
14906
+ * Queues an SMS: the response is the stored activity with `sendStatus` `pending`; read the activity again for `sent` or `failed`. With `templateId`, the template is rendered for the record and fills the message and recipients the body leaves out; preview the same body at `sms/preview` first.
14348
14907
  * Operation: PublicStageActivitiesController_createSms
14349
14908
  */
14350
14909
  createSms<TResponse = WorkBuddyJobsStagesActivitiesSmsCreateSmsResponse>(
@@ -14353,6 +14912,17 @@ export interface WorkBuddyJobsStagesActivitiesSmsResource {
14353
14912
  ): Promise<TResponse>;
14354
14913
  }
14355
14914
 
14915
+ export interface WorkBuddyJobsStagesActivitiesSmsPreviewResource {
14916
+ /**
14917
+ * Renders the SMS create body with the create's own template renderer and reports the message, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.
14918
+ * Operation: PublicStageActivitiesController_previewSms
14919
+ */
14920
+ previewSms<TResponse = WorkBuddyJobsStagesActivitiesSmsPreviewPreviewSmsResponse>(
14921
+ params: WorkBuddyJobsStagesActivitiesSmsPreviewPreviewSmsParams,
14922
+ options?: WorkBuddyRequestOptions
14923
+ ): Promise<TResponse>;
14924
+ }
14925
+
14356
14926
  export interface WorkBuddyJobsStagesActivitiesPhoneResource {
14357
14927
  /**
14358
14928
  * Create phone activity (Stages)
@@ -14485,6 +15055,10 @@ export interface WorkBuddyJobsStagesTasksEvidenceResource {
14485
15055
  }
14486
15056
 
14487
15057
  export interface WorkBuddyJobsActivitiesResource {
15058
+ /** Templates API operations. */
15059
+ templates: WorkBuddyJobsActivitiesTemplatesResource;
15060
+ /** Merge Fields API operations. */
15061
+ mergeFields: WorkBuddyJobsActivitiesMergeFieldsResource;
14488
15062
  /** Note API operations. */
14489
15063
  note: WorkBuddyJobsActivitiesNoteResource;
14490
15064
  /** Email API operations. */
@@ -14534,6 +15108,28 @@ export interface WorkBuddyJobsActivitiesResource {
14534
15108
  ): Promise<TResponse>;
14535
15109
  }
14536
15110
 
15111
+ export interface WorkBuddyJobsActivitiesTemplatesResource {
15112
+ /**
15113
+ * Published templates of the channel this record may send: its own entity's (and, on a stage, the job's), narrowed by each template's company, job type and work category scope exactly as the send applies it. Pass an `id` as `templateId` to the email or SMS create or preview.
15114
+ * Operation: PublicJobActivitiesController_listTemplates
15115
+ */
15116
+ list<TResponse = WorkBuddyJobsActivitiesTemplatesListResponse>(
15117
+ params: WorkBuddyJobsActivitiesTemplatesListParams,
15118
+ options?: WorkBuddyRequestOptions
15119
+ ): Promise<TResponse>;
15120
+ }
15121
+
15122
+ export interface WorkBuddyJobsActivitiesMergeFieldsResource {
15123
+ /**
15124
+ * The merge fields this record's email and SMS templates may use, custom fields included, with keys as templates name them (`<span data-wb-merge="job.jobNumber">` or `{{job.jobNumber}}`).
15125
+ * Operation: PublicJobActivitiesController_listMergeFields
15126
+ */
15127
+ list<TResponse = WorkBuddyJobsActivitiesMergeFieldsListResponse>(
15128
+ params: WorkBuddyJobsActivitiesMergeFieldsListParams,
15129
+ options?: WorkBuddyRequestOptions
15130
+ ): Promise<TResponse>;
15131
+ }
15132
+
14537
15133
  export interface WorkBuddyJobsActivitiesNoteResource {
14538
15134
  /**
14539
15135
  * Create note activity (Jobs)
@@ -14546,6 +15142,8 @@ export interface WorkBuddyJobsActivitiesNoteResource {
14546
15142
  }
14547
15143
 
14548
15144
  export interface WorkBuddyJobsActivitiesEmailResource {
15145
+ /** Preview API operations. */
15146
+ preview: WorkBuddyJobsActivitiesEmailPreviewResource;
14549
15147
  /**
14550
15148
  * Create email activity (Jobs)
14551
15149
  * Operation: PublicJobActivitiesController_createEmail
@@ -14556,9 +15154,22 @@ export interface WorkBuddyJobsActivitiesEmailResource {
14556
15154
  ): Promise<TResponse>;
14557
15155
  }
14558
15156
 
15157
+ export interface WorkBuddyJobsActivitiesEmailPreviewResource {
15158
+ /**
15159
+ * Renders the email create body with the create's own template renderer and reports the subject, body, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.
15160
+ * Operation: PublicJobActivitiesController_previewEmail
15161
+ */
15162
+ previewEmail<TResponse = WorkBuddyJobsActivitiesEmailPreviewPreviewEmailResponse>(
15163
+ params: WorkBuddyJobsActivitiesEmailPreviewPreviewEmailParams,
15164
+ options?: WorkBuddyRequestOptions
15165
+ ): Promise<TResponse>;
15166
+ }
15167
+
14559
15168
  export interface WorkBuddyJobsActivitiesSmsResource {
15169
+ /** Preview API operations. */
15170
+ preview: WorkBuddyJobsActivitiesSmsPreviewResource;
14560
15171
  /**
14561
- * Create SMS activity (Jobs)
15172
+ * Queues an SMS: the response is the stored activity with `sendStatus` `pending`; read the activity again for `sent` or `failed`. With `templateId`, the template is rendered for the record and fills the message and recipients the body leaves out; preview the same body at `sms/preview` first.
14562
15173
  * Operation: PublicJobActivitiesController_createSms
14563
15174
  */
14564
15175
  createSms<TResponse = WorkBuddyJobsActivitiesSmsCreateSmsResponse>(
@@ -14567,6 +15178,17 @@ export interface WorkBuddyJobsActivitiesSmsResource {
14567
15178
  ): Promise<TResponse>;
14568
15179
  }
14569
15180
 
15181
+ export interface WorkBuddyJobsActivitiesSmsPreviewResource {
15182
+ /**
15183
+ * Renders the SMS create body with the create's own template renderer and reports the message, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.
15184
+ * Operation: PublicJobActivitiesController_previewSms
15185
+ */
15186
+ previewSms<TResponse = WorkBuddyJobsActivitiesSmsPreviewPreviewSmsResponse>(
15187
+ params: WorkBuddyJobsActivitiesSmsPreviewPreviewSmsParams,
15188
+ options?: WorkBuddyRequestOptions
15189
+ ): Promise<TResponse>;
15190
+ }
15191
+
14570
15192
  export interface WorkBuddyJobsActivitiesPhoneResource {
14571
15193
  /**
14572
15194
  * Create phone activity (Jobs)
package/index.js CHANGED
@@ -193,7 +193,43 @@ export class WorkBuddyClient {
193
193
  unassign: (params = {}, options = {}) =>
194
194
  this.request('PublicJobStageResourceController_unassign', params, options),
195
195
  },
196
+ appointments: {
197
+ /**
198
+ * List stage appointments
199
+ * Operation: PublicJobStageAppointmentController_list
200
+ */
201
+ list: (params = {}, options = {}) =>
202
+ this.request('PublicJobStageAppointmentController_list', params, options),
203
+ /**
204
+ * start and end are a local clock with no timezone, read in the stage site timezone. A status other than Open is applied after the appointment is created.
205
+ * Operation: PublicJobStageAppointmentController_create
206
+ */
207
+ create: (params = {}, options = {}) =>
208
+ this.request('PublicJobStageAppointmentController_create', params, options),
209
+ /**
210
+ * Update an appointment status or booking
211
+ * Operation: PublicJobStageAppointmentController_update
212
+ */
213
+ update: (params = {}, options = {}) =>
214
+ this.request('PublicJobStageAppointmentController_update', params, options),
215
+ },
196
216
  activities: {
217
+ templates: {
218
+ /**
219
+ * Published templates of the channel this record may send: its own entity's (and, on a stage, the job's), narrowed by each template's company, job type and work category scope exactly as the send applies it. Pass an `id` as `templateId` to the email or SMS create or preview.
220
+ * Operation: PublicStageActivitiesController_listTemplates
221
+ */
222
+ list: (params = {}, options = {}) =>
223
+ this.request('PublicStageActivitiesController_listTemplates', params, options),
224
+ },
225
+ mergeFields: {
226
+ /**
227
+ * The merge fields this record's email and SMS templates may use, custom fields included, with keys as templates name them (`<span data-wb-merge="job.jobNumber">` or `{{job.jobNumber}}`).
228
+ * Operation: PublicStageActivitiesController_listMergeFields
229
+ */
230
+ list: (params = {}, options = {}) =>
231
+ this.request('PublicStageActivitiesController_listMergeFields', params, options),
232
+ },
197
233
  note: {
198
234
  /**
199
235
  * Create note activity (Stages)
@@ -203,6 +239,14 @@ export class WorkBuddyClient {
203
239
  this.request('PublicStageActivitiesController_createNote', params, options),
204
240
  },
205
241
  email: {
242
+ preview: {
243
+ /**
244
+ * Renders the email create body with the create's own template renderer and reports the subject, body, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.
245
+ * Operation: PublicStageActivitiesController_previewEmail
246
+ */
247
+ previewEmail: (params = {}, options = {}) =>
248
+ this.request('PublicStageActivitiesController_previewEmail', params, options),
249
+ },
206
250
  /**
207
251
  * Create email activity (Stages)
208
252
  * Operation: PublicStageActivitiesController_createEmail
@@ -211,8 +255,16 @@ export class WorkBuddyClient {
211
255
  this.request('PublicStageActivitiesController_createEmail', params, options),
212
256
  },
213
257
  sms: {
258
+ preview: {
259
+ /**
260
+ * Renders the SMS create body with the create's own template renderer and reports the message, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.
261
+ * Operation: PublicStageActivitiesController_previewSms
262
+ */
263
+ previewSms: (params = {}, options = {}) =>
264
+ this.request('PublicStageActivitiesController_previewSms', params, options),
265
+ },
214
266
  /**
215
- * Create SMS activity (Stages)
267
+ * Queues an SMS: the response is the stored activity with `sendStatus` `pending`; read the activity again for `sent` or `failed`. With `templateId`, the template is rendered for the record and fills the message and recipients the body leaves out; preview the same body at `sms/preview` first.
216
268
  * Operation: PublicStageActivitiesController_createSms
217
269
  */
218
270
  createSms: (params = {}, options = {}) =>
@@ -338,6 +390,22 @@ export class WorkBuddyClient {
338
390
  getJobStage: (params = {}, options = {}) => this.request('PublicApiJobController_getJobStage', params, options),
339
391
  },
340
392
  activities: {
393
+ templates: {
394
+ /**
395
+ * Published templates of the channel this record may send: its own entity's (and, on a stage, the job's), narrowed by each template's company, job type and work category scope exactly as the send applies it. Pass an `id` as `templateId` to the email or SMS create or preview.
396
+ * Operation: PublicJobActivitiesController_listTemplates
397
+ */
398
+ list: (params = {}, options = {}) =>
399
+ this.request('PublicJobActivitiesController_listTemplates', params, options),
400
+ },
401
+ mergeFields: {
402
+ /**
403
+ * The merge fields this record's email and SMS templates may use, custom fields included, with keys as templates name them (`<span data-wb-merge="job.jobNumber">` or `{{job.jobNumber}}`).
404
+ * Operation: PublicJobActivitiesController_listMergeFields
405
+ */
406
+ list: (params = {}, options = {}) =>
407
+ this.request('PublicJobActivitiesController_listMergeFields', params, options),
408
+ },
341
409
  note: {
342
410
  /**
343
411
  * Create note activity (Jobs)
@@ -347,6 +415,14 @@ export class WorkBuddyClient {
347
415
  this.request('PublicJobActivitiesController_createNote', params, options),
348
416
  },
349
417
  email: {
418
+ preview: {
419
+ /**
420
+ * Renders the email create body with the create's own template renderer and reports the subject, body, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.
421
+ * Operation: PublicJobActivitiesController_previewEmail
422
+ */
423
+ previewEmail: (params = {}, options = {}) =>
424
+ this.request('PublicJobActivitiesController_previewEmail', params, options),
425
+ },
350
426
  /**
351
427
  * Create email activity (Jobs)
352
428
  * Operation: PublicJobActivitiesController_createEmail
@@ -355,8 +431,16 @@ export class WorkBuddyClient {
355
431
  this.request('PublicJobActivitiesController_createEmail', params, options),
356
432
  },
357
433
  sms: {
434
+ preview: {
435
+ /**
436
+ * Renders the SMS create body with the create's own template renderer and reports the message, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.
437
+ * Operation: PublicJobActivitiesController_previewSms
438
+ */
439
+ previewSms: (params = {}, options = {}) =>
440
+ this.request('PublicJobActivitiesController_previewSms', params, options),
441
+ },
358
442
  /**
359
- * Create SMS activity (Jobs)
443
+ * Queues an SMS: the response is the stored activity with `sendStatus` `pending`; read the activity again for `sent` or `failed`. With `templateId`, the template is rendered for the record and fills the message and recipients the body leaves out; preview the same body at `sms/preview` first.
360
444
  * Operation: PublicJobActivitiesController_createSms
361
445
  */
362
446
  createSms: (params = {}, options = {}) =>
@@ -2193,6 +2277,43 @@ export const operations = [
2193
2277
  queryParams: [],
2194
2278
  hasRequestBody: true,
2195
2279
  },
2280
+ {
2281
+ operationId: 'PublicJobStageAppointmentController_list',
2282
+ resourcePath: ['jobs', 'stages', 'appointments'],
2283
+ actionName: 'list',
2284
+ displayName: 'List stage appointments',
2285
+ description: 'List stage appointments',
2286
+ method: 'GET',
2287
+ path: '/jobs/{jobId}/stages/{stageId}/appointments',
2288
+ pathParams: ['jobId', 'stageId'],
2289
+ queryParams: [],
2290
+ hasRequestBody: false,
2291
+ },
2292
+ {
2293
+ operationId: 'PublicJobStageAppointmentController_create',
2294
+ resourcePath: ['jobs', 'stages', 'appointments'],
2295
+ actionName: 'create',
2296
+ displayName: 'Create a stage appointment',
2297
+ description:
2298
+ 'start and end are a local clock with no timezone, read in the stage site timezone. A status other than Open is applied after the appointment is created.',
2299
+ method: 'POST',
2300
+ path: '/jobs/{jobId}/stages/{stageId}/appointments',
2301
+ pathParams: ['jobId', 'stageId'],
2302
+ queryParams: [],
2303
+ hasRequestBody: true,
2304
+ },
2305
+ {
2306
+ operationId: 'PublicJobStageAppointmentController_update',
2307
+ resourcePath: ['jobs', 'stages', 'appointments'],
2308
+ actionName: 'update',
2309
+ displayName: 'Update an appointment status or booking',
2310
+ description: 'Update an appointment status or booking',
2311
+ method: 'PATCH',
2312
+ path: '/jobs/{jobId}/stages/{stageId}/appointments/{appointmentId}',
2313
+ pathParams: ['jobId', 'stageId', 'appointmentId'],
2314
+ queryParams: [],
2315
+ hasRequestBody: true,
2316
+ },
2196
2317
  {
2197
2318
  operationId: 'PublicApiEntityStatusController_list',
2198
2319
  resourcePath: ['settings', 'entityStatuses'],
@@ -2597,6 +2718,32 @@ export const operations = [
2597
2718
  queryParams: ['kind', 'cursor', 'limit'],
2598
2719
  hasRequestBody: false,
2599
2720
  },
2721
+ {
2722
+ operationId: 'PublicJobActivitiesController_listTemplates',
2723
+ resourcePath: ['jobs', 'activities', 'templates'],
2724
+ actionName: 'list',
2725
+ displayName: 'List email or SMS templates for this record (Jobs)',
2726
+ description:
2727
+ "Published templates of the channel this record may send: its own entity's (and, on a stage, the job's), narrowed by each template's company, job type and work category scope exactly as the send applies it. Pass an `id` as `templateId` to the email or SMS create or preview.",
2728
+ method: 'GET',
2729
+ path: '/jobs/{jobId}/activities/templates',
2730
+ pathParams: ['jobId'],
2731
+ queryParams: ['channel'],
2732
+ hasRequestBody: false,
2733
+ },
2734
+ {
2735
+ operationId: 'PublicJobActivitiesController_listMergeFields',
2736
+ resourcePath: ['jobs', 'activities', 'mergeFields'],
2737
+ actionName: 'list',
2738
+ displayName: "List merge fields for this record's templates (Jobs)",
2739
+ description:
2740
+ 'The merge fields this record\'s email and SMS templates may use, custom fields included, with keys as templates name them (`<span data-wb-merge="job.jobNumber">` or `{{job.jobNumber}}`).',
2741
+ method: 'GET',
2742
+ path: '/jobs/{jobId}/activities/merge-fields',
2743
+ pathParams: ['jobId'],
2744
+ queryParams: [],
2745
+ hasRequestBody: false,
2746
+ },
2600
2747
  {
2601
2748
  operationId: 'PublicJobActivitiesController_getById',
2602
2749
  resourcePath: ['jobs', 'activities'],
@@ -2650,13 +2797,40 @@ export const operations = [
2650
2797
  resourcePath: ['jobs', 'activities', 'sms'],
2651
2798
  actionName: 'createSms',
2652
2799
  displayName: 'Create SMS activity (Jobs)',
2653
- description: 'Create SMS activity (Jobs)',
2800
+ description:
2801
+ 'Queues an SMS: the response is the stored activity with `sendStatus` `pending`; read the activity again for `sent` or `failed`. With `templateId`, the template is rendered for the record and fills the message and recipients the body leaves out; preview the same body at `sms/preview` first.',
2654
2802
  method: 'POST',
2655
2803
  path: '/jobs/{jobId}/activities/sms',
2656
2804
  pathParams: ['jobId'],
2657
2805
  queryParams: [],
2658
2806
  hasRequestBody: true,
2659
2807
  },
2808
+ {
2809
+ operationId: 'PublicJobActivitiesController_previewEmail',
2810
+ resourcePath: ['jobs', 'activities', 'email', 'preview'],
2811
+ actionName: 'previewEmail',
2812
+ displayName: 'Preview an email activity (Jobs)',
2813
+ description:
2814
+ "Renders the email create body with the create's own template renderer and reports the subject, body, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.",
2815
+ method: 'POST',
2816
+ path: '/jobs/{jobId}/activities/email/preview',
2817
+ pathParams: ['jobId'],
2818
+ queryParams: [],
2819
+ hasRequestBody: true,
2820
+ },
2821
+ {
2822
+ operationId: 'PublicJobActivitiesController_previewSms',
2823
+ resourcePath: ['jobs', 'activities', 'sms', 'preview'],
2824
+ actionName: 'previewSms',
2825
+ displayName: 'Preview an SMS activity (Jobs)',
2826
+ description:
2827
+ "Renders the SMS create body with the create's own template renderer and reports the message, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.",
2828
+ method: 'POST',
2829
+ path: '/jobs/{jobId}/activities/sms/preview',
2830
+ pathParams: ['jobId'],
2831
+ queryParams: [],
2832
+ hasRequestBody: true,
2833
+ },
2660
2834
  {
2661
2835
  operationId: 'PublicJobActivitiesController_createPhone',
2662
2836
  resourcePath: ['jobs', 'activities', 'phone'],
@@ -2707,6 +2881,32 @@ export const operations = [
2707
2881
  queryParams: ['kind', 'cursor', 'limit'],
2708
2882
  hasRequestBody: false,
2709
2883
  },
2884
+ {
2885
+ operationId: 'PublicStageActivitiesController_listTemplates',
2886
+ resourcePath: ['jobs', 'stages', 'activities', 'templates'],
2887
+ actionName: 'list',
2888
+ displayName: 'List email or SMS templates for this record (Stages)',
2889
+ description:
2890
+ "Published templates of the channel this record may send: its own entity's (and, on a stage, the job's), narrowed by each template's company, job type and work category scope exactly as the send applies it. Pass an `id` as `templateId` to the email or SMS create or preview.",
2891
+ method: 'GET',
2892
+ path: '/jobs/{jobId}/stages/{stageId}/activities/templates',
2893
+ pathParams: ['stageId', 'jobId'],
2894
+ queryParams: ['channel'],
2895
+ hasRequestBody: false,
2896
+ },
2897
+ {
2898
+ operationId: 'PublicStageActivitiesController_listMergeFields',
2899
+ resourcePath: ['jobs', 'stages', 'activities', 'mergeFields'],
2900
+ actionName: 'list',
2901
+ displayName: "List merge fields for this record's templates (Stages)",
2902
+ description:
2903
+ 'The merge fields this record\'s email and SMS templates may use, custom fields included, with keys as templates name them (`<span data-wb-merge="job.jobNumber">` or `{{job.jobNumber}}`).',
2904
+ method: 'GET',
2905
+ path: '/jobs/{jobId}/stages/{stageId}/activities/merge-fields',
2906
+ pathParams: ['stageId', 'jobId'],
2907
+ queryParams: [],
2908
+ hasRequestBody: false,
2909
+ },
2710
2910
  {
2711
2911
  operationId: 'PublicStageActivitiesController_getById',
2712
2912
  resourcePath: ['jobs', 'stages', 'activities'],
@@ -2760,13 +2960,40 @@ export const operations = [
2760
2960
  resourcePath: ['jobs', 'stages', 'activities', 'sms'],
2761
2961
  actionName: 'createSms',
2762
2962
  displayName: 'Create SMS activity (Stages)',
2763
- description: 'Create SMS activity (Stages)',
2963
+ description:
2964
+ 'Queues an SMS: the response is the stored activity with `sendStatus` `pending`; read the activity again for `sent` or `failed`. With `templateId`, the template is rendered for the record and fills the message and recipients the body leaves out; preview the same body at `sms/preview` first.',
2764
2965
  method: 'POST',
2765
2966
  path: '/jobs/{jobId}/stages/{stageId}/activities/sms',
2766
2967
  pathParams: ['stageId', 'jobId'],
2767
2968
  queryParams: [],
2768
2969
  hasRequestBody: true,
2769
2970
  },
2971
+ {
2972
+ operationId: 'PublicStageActivitiesController_previewEmail',
2973
+ resourcePath: ['jobs', 'stages', 'activities', 'email', 'preview'],
2974
+ actionName: 'previewEmail',
2975
+ displayName: 'Preview an email activity (Stages)',
2976
+ description:
2977
+ "Renders the email create body with the create's own template renderer and reports the subject, body, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.",
2978
+ method: 'POST',
2979
+ path: '/jobs/{jobId}/stages/{stageId}/activities/email/preview',
2980
+ pathParams: ['stageId', 'jobId'],
2981
+ queryParams: [],
2982
+ hasRequestBody: true,
2983
+ },
2984
+ {
2985
+ operationId: 'PublicStageActivitiesController_previewSms',
2986
+ resourcePath: ['jobs', 'stages', 'activities', 'sms', 'preview'],
2987
+ actionName: 'previewSms',
2988
+ displayName: 'Preview an SMS activity (Stages)',
2989
+ description:
2990
+ "Renders the SMS create body with the create's own template renderer and reports the message, sender and recipients the send would use, the merge fields it uses and diagnostics. Nothing is saved or sent. An `error` diagnostic is exactly what the create refuses with 400; `warning`s do not block it.",
2991
+ method: 'POST',
2992
+ path: '/jobs/{jobId}/stages/{stageId}/activities/sms/preview',
2993
+ pathParams: ['stageId', 'jobId'],
2994
+ queryParams: [],
2995
+ hasRequestBody: true,
2996
+ },
2770
2997
  {
2771
2998
  operationId: 'PublicStageActivitiesController_createPhone',
2772
2999
  resourcePath: ['jobs', 'stages', 'activities', 'phone'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workbuddy/sdk-js-vnext",
3
- "version": "1.0.131",
3
+ "version": "1.0.133",
4
4
  "description": "WorkBuddy Public API JavaScript client",
5
5
  "license": "MIT",
6
6
  "type": "module",