@workbuddy/cli-edge 1.0.4 → 1.0.6

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 (2) hide show
  1. package/dist/index.js +341 -224
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2542,7 +2542,12 @@ function buildHttpErrorMessage(status, contentType, buffer) {
2542
2542
  if (contentType.includes("application/json")) {
2543
2543
  try {
2544
2544
  const parsed = JSON.parse(text);
2545
- const detail = parsed.message ?? parsed.error ?? parsed.details;
2545
+ const errorObj = parsed?.error;
2546
+ if (errorObj && typeof errorObj === "object") {
2547
+ const msg = errorObj.message ?? errorObj.code ?? JSON.stringify(errorObj);
2548
+ return "Request failed with status " + status + ": " + msg;
2549
+ }
2550
+ const detail = parsed?.message ?? (typeof errorObj === "string" ? errorObj : null) ?? parsed?.details;
2546
2551
  return detail ? "Request failed with status " + status + ": " + detail : "Request failed with status " + status + ": " + text;
2547
2552
  } catch {
2548
2553
  return "Request failed with status " + status + ": " + text;
@@ -2704,7 +2709,7 @@ var operations = [
2704
2709
  source: "body",
2705
2710
  type: "string",
2706
2711
  required: false,
2707
- description: "",
2712
+ description: "Search mode",
2708
2713
  enumValues: ["jobs", "stages"]
2709
2714
  },
2710
2715
  {
@@ -2714,7 +2719,7 @@ var operations = [
2714
2719
  source: "body",
2715
2720
  type: "integer",
2716
2721
  required: false,
2717
- description: ""
2722
+ description: "Maximum number of results to return"
2718
2723
  },
2719
2724
  {
2720
2725
  name: "cursor",
@@ -2723,7 +2728,7 @@ var operations = [
2723
2728
  source: "body",
2724
2729
  type: "string",
2725
2730
  required: false,
2726
- description: ""
2731
+ description: "Pagination cursor from a previous response"
2727
2732
  },
2728
2733
  {
2729
2734
  name: "sortBy",
@@ -2732,7 +2737,7 @@ var operations = [
2732
2737
  source: "body",
2733
2738
  type: "string",
2734
2739
  required: false,
2735
- description: "",
2740
+ description: "Field to sort results by",
2736
2741
  enumValues: ["created_at", "due_date", "completed_date", "priority"]
2737
2742
  },
2738
2743
  {
@@ -2742,7 +2747,7 @@ var operations = [
2742
2747
  source: "body",
2743
2748
  type: "string",
2744
2749
  required: false,
2745
- description: "",
2750
+ description: "Sort direction: asc or desc",
2746
2751
  enumValues: ["asc", "desc"]
2747
2752
  },
2748
2753
  {
@@ -2752,7 +2757,7 @@ var operations = [
2752
2757
  source: "body",
2753
2758
  type: "array",
2754
2759
  required: false,
2755
- description: ""
2760
+ description: "Status filter"
2756
2761
  },
2757
2762
  {
2758
2763
  name: "customer",
@@ -2761,7 +2766,7 @@ var operations = [
2761
2766
  source: "body",
2762
2767
  type: "array",
2763
2768
  required: false,
2764
- description: ""
2769
+ description: "Inline customer object — alternative to customerId"
2765
2770
  },
2766
2771
  {
2767
2772
  name: "site",
@@ -2770,7 +2775,7 @@ var operations = [
2770
2775
  source: "body",
2771
2776
  type: "array",
2772
2777
  required: false,
2773
- description: ""
2778
+ description: "Inline site object — alternative to siteId"
2774
2779
  },
2775
2780
  {
2776
2781
  name: "type",
@@ -2878,7 +2883,7 @@ var operations = [
2878
2883
  source: "body",
2879
2884
  type: "string",
2880
2885
  required: false,
2881
- description: ""
2886
+ description: "Free-text search query"
2882
2887
  },
2883
2888
  {
2884
2889
  name: "createdDate",
@@ -2887,7 +2892,7 @@ var operations = [
2887
2892
  source: "body",
2888
2893
  type: "object",
2889
2894
  required: false,
2890
- description: ""
2895
+ description: "Date range filter for creation date"
2891
2896
  },
2892
2897
  {
2893
2898
  name: "dueDate",
@@ -2896,7 +2901,7 @@ var operations = [
2896
2901
  source: "body",
2897
2902
  type: "object",
2898
2903
  required: false,
2899
- description: ""
2904
+ description: "Due date (ISO 8601 datetime)"
2900
2905
  },
2901
2906
  {
2902
2907
  name: "completedDate",
@@ -2905,7 +2910,7 @@ var operations = [
2905
2910
  source: "body",
2906
2911
  type: "object",
2907
2912
  required: false,
2908
- description: ""
2913
+ description: "Completion date (ISO 8601 datetime)"
2909
2914
  },
2910
2915
  {
2911
2916
  name: "finalisedDate",
@@ -2914,7 +2919,7 @@ var operations = [
2914
2919
  source: "body",
2915
2920
  type: "object",
2916
2921
  required: false,
2917
- description: ""
2922
+ description: "Finalisation date (ISO 8601 datetime)"
2918
2923
  },
2919
2924
  {
2920
2925
  name: "stageDueDate",
@@ -2923,7 +2928,7 @@ var operations = [
2923
2928
  source: "body",
2924
2929
  type: "object",
2925
2930
  required: false,
2926
- description: ""
2931
+ description: "stage due date (ISO 8601 datetime)"
2927
2932
  },
2928
2933
  {
2929
2934
  name: "stageCompletedDate",
@@ -2932,7 +2937,7 @@ var operations = [
2932
2937
  source: "body",
2933
2938
  type: "object",
2934
2939
  required: false,
2935
- description: ""
2940
+ description: "stage completed date (ISO 8601 datetime)"
2936
2941
  },
2937
2942
  {
2938
2943
  name: "fields",
@@ -2941,7 +2946,7 @@ var operations = [
2941
2946
  source: "body",
2942
2947
  type: "array",
2943
2948
  required: false,
2944
- description: ""
2949
+ description: "Field projection — array of field names to include in the response"
2945
2950
  },
2946
2951
  {
2947
2952
  name: "include",
@@ -2950,7 +2955,7 @@ var operations = [
2950
2955
  source: "body",
2951
2956
  type: "array",
2952
2957
  required: false,
2953
- description: ""
2958
+ description: "Related entities to include in the response"
2954
2959
  },
2955
2960
  {
2956
2961
  name: "raw-body",
@@ -3008,7 +3013,7 @@ var operations = [
3008
3013
  source: "body",
3009
3014
  type: "string",
3010
3015
  required: true,
3011
- description: ""
3016
+ description: "Reason for the action (e.g. cancellation reason)"
3012
3017
  },
3013
3018
  {
3014
3019
  name: "raw-body",
@@ -3037,7 +3042,7 @@ var operations = [
3037
3042
  source: "body",
3038
3043
  type: "string",
3039
3044
  required: false,
3040
- description: ""
3045
+ description: "Display name"
3041
3046
  },
3042
3047
  {
3043
3048
  name: "description",
@@ -3046,7 +3051,7 @@ var operations = [
3046
3051
  source: "body",
3047
3052
  type: "string",
3048
3053
  required: false,
3049
- description: ""
3054
+ description: "Detailed description"
3050
3055
  },
3051
3056
  {
3052
3057
  name: "customerId",
@@ -3055,7 +3060,7 @@ var operations = [
3055
3060
  source: "body",
3056
3061
  type: "string",
3057
3062
  required: false,
3058
- description: ""
3063
+ description: "Customer ID — use /crm/customers to look up"
3059
3064
  },
3060
3065
  {
3061
3066
  name: "customer",
@@ -3064,7 +3069,7 @@ var operations = [
3064
3069
  source: "body",
3065
3070
  type: "object",
3066
3071
  required: false,
3067
- description: ""
3072
+ description: "Inline customer object — alternative to customerId"
3068
3073
  },
3069
3074
  {
3070
3075
  name: "siteId",
@@ -3073,7 +3078,7 @@ var operations = [
3073
3078
  source: "body",
3074
3079
  type: "string",
3075
3080
  required: false,
3076
- description: ""
3081
+ description: "Site ID — use /crm/sites to look up"
3077
3082
  },
3078
3083
  {
3079
3084
  name: "site",
@@ -3082,7 +3087,7 @@ var operations = [
3082
3087
  source: "body",
3083
3088
  type: "object",
3084
3089
  required: false,
3085
- description: ""
3090
+ description: "Inline site object — alternative to siteId"
3086
3091
  },
3087
3092
  {
3088
3093
  name: "contactId",
@@ -3091,7 +3096,7 @@ var operations = [
3091
3096
  source: "body",
3092
3097
  type: "string",
3093
3098
  required: false,
3094
- description: ""
3099
+ description: "Contact ID — use /crm/contacts to look up"
3095
3100
  },
3096
3101
  {
3097
3102
  name: "contact",
@@ -3100,7 +3105,7 @@ var operations = [
3100
3105
  source: "body",
3101
3106
  type: "object",
3102
3107
  required: false,
3103
- description: ""
3108
+ description: "Inline contact object — alternative to contactId"
3104
3109
  },
3105
3110
  {
3106
3111
  name: "typeId",
@@ -3109,7 +3114,7 @@ var operations = [
3109
3114
  source: "body",
3110
3115
  type: "string",
3111
3116
  required: false,
3112
- description: ""
3117
+ description: "Job type ID — use /settings/job-types to look up"
3113
3118
  },
3114
3119
  {
3115
3120
  name: "priorityId",
@@ -3118,7 +3123,7 @@ var operations = [
3118
3123
  source: "body",
3119
3124
  type: "string",
3120
3125
  required: false,
3121
- description: ""
3126
+ description: "Priority ID — use /settings/priorities to look up"
3122
3127
  },
3123
3128
  {
3124
3129
  name: "priceBookId",
@@ -3127,7 +3132,7 @@ var operations = [
3127
3132
  source: "body",
3128
3133
  type: "string",
3129
3134
  required: false,
3130
- description: ""
3135
+ description: "Price book ID for job pricing"
3131
3136
  },
3132
3137
  {
3133
3138
  name: "ownerId",
@@ -3136,7 +3141,7 @@ var operations = [
3136
3141
  source: "body",
3137
3142
  type: "string",
3138
3143
  required: false,
3139
- description: ""
3144
+ description: "Owner (employee) ID — use /crm/employees to look up"
3140
3145
  },
3141
3146
  {
3142
3147
  name: "fieldSupervisorId",
@@ -3145,7 +3150,7 @@ var operations = [
3145
3150
  source: "body",
3146
3151
  type: "string",
3147
3152
  required: false,
3148
- description: ""
3153
+ description: "Field supervisor (employee) ID — use /crm/employees to look up"
3149
3154
  },
3150
3155
  {
3151
3156
  name: "zoneId",
@@ -3154,7 +3159,7 @@ var operations = [
3154
3159
  source: "body",
3155
3160
  type: "string",
3156
3161
  required: false,
3157
- description: ""
3162
+ description: "Zone ID — use /settings/zones to look up"
3158
3163
  },
3159
3164
  {
3160
3165
  name: "tagIds",
@@ -3163,7 +3168,7 @@ var operations = [
3163
3168
  source: "body",
3164
3169
  type: "array",
3165
3170
  required: false,
3166
- description: ""
3171
+ description: 'Array of tag IDs (comma-separated, e.g. "id1,id2") — use /settings/tags to look up'
3167
3172
  },
3168
3173
  {
3169
3174
  name: "notes",
@@ -3172,7 +3177,7 @@ var operations = [
3172
3177
  source: "body",
3173
3178
  type: "string",
3174
3179
  required: false,
3175
- description: ""
3180
+ description: "Additional notes or comments"
3176
3181
  },
3177
3182
  {
3178
3183
  name: "reference",
@@ -3181,7 +3186,7 @@ var operations = [
3181
3186
  source: "body",
3182
3187
  type: "string",
3183
3188
  required: false,
3184
- description: ""
3189
+ description: "External reference number"
3185
3190
  },
3186
3191
  {
3187
3192
  name: "customerWO",
@@ -3190,7 +3195,7 @@ var operations = [
3190
3195
  source: "body",
3191
3196
  type: "string",
3192
3197
  required: false,
3193
- description: ""
3198
+ description: "Customer work order reference"
3194
3199
  },
3195
3200
  {
3196
3201
  name: "customerPO",
@@ -3199,7 +3204,7 @@ var operations = [
3199
3204
  source: "body",
3200
3205
  type: "string",
3201
3206
  required: false,
3202
- description: ""
3207
+ description: "Customer purchase order reference"
3203
3208
  },
3204
3209
  {
3205
3210
  name: "templateId",
@@ -3208,7 +3213,7 @@ var operations = [
3208
3213
  source: "body",
3209
3214
  type: "string",
3210
3215
  required: false,
3211
- description: ""
3216
+ description: "Template ID to pre-populate fields from a template"
3212
3217
  },
3213
3218
  {
3214
3219
  name: "startDate",
@@ -3217,7 +3222,7 @@ var operations = [
3217
3222
  source: "body",
3218
3223
  type: "string",
3219
3224
  required: false,
3220
- description: "",
3225
+ description: "Start date (ISO 8601 datetime)",
3221
3226
  format: "date-time"
3222
3227
  },
3223
3228
  {
@@ -3227,7 +3232,7 @@ var operations = [
3227
3232
  source: "body",
3228
3233
  type: "string",
3229
3234
  required: false,
3230
- description: "",
3235
+ description: "Due date (ISO 8601 datetime)",
3231
3236
  format: "date-time"
3232
3237
  },
3233
3238
  {
@@ -3237,7 +3242,7 @@ var operations = [
3237
3242
  source: "body",
3238
3243
  type: "object",
3239
3244
  required: false,
3240
- description: ""
3245
+ description: "Custom fields as key-value pairs — validated against tenant field definitions"
3241
3246
  },
3242
3247
  {
3243
3248
  name: "raw-body",
@@ -3275,7 +3280,7 @@ var operations = [
3275
3280
  source: "body",
3276
3281
  type: "string",
3277
3282
  required: false,
3278
- description: "",
3283
+ description: "For optimistic concurrency — update fails if entity was modified after this timestamp",
3279
3284
  format: "date-time"
3280
3285
  },
3281
3286
  {
@@ -3285,7 +3290,7 @@ var operations = [
3285
3290
  source: "body",
3286
3291
  type: "string",
3287
3292
  required: false,
3288
- description: ""
3293
+ description: "Display name"
3289
3294
  },
3290
3295
  {
3291
3296
  name: "description",
@@ -3294,7 +3299,7 @@ var operations = [
3294
3299
  source: "body",
3295
3300
  type: "string",
3296
3301
  required: false,
3297
- description: ""
3302
+ description: "Detailed description"
3298
3303
  },
3299
3304
  {
3300
3305
  name: "siteId",
@@ -3303,7 +3308,7 @@ var operations = [
3303
3308
  source: "body",
3304
3309
  type: "string",
3305
3310
  required: false,
3306
- description: ""
3311
+ description: "Site ID — use /crm/sites to look up"
3307
3312
  },
3308
3313
  {
3309
3314
  name: "contactId",
@@ -3312,7 +3317,7 @@ var operations = [
3312
3317
  source: "body",
3313
3318
  type: "string",
3314
3319
  required: false,
3315
- description: ""
3320
+ description: "Contact ID — use /crm/contacts to look up"
3316
3321
  },
3317
3322
  {
3318
3323
  name: "typeId",
@@ -3321,7 +3326,7 @@ var operations = [
3321
3326
  source: "body",
3322
3327
  type: "string",
3323
3328
  required: false,
3324
- description: ""
3329
+ description: "Job type ID — use /settings/job-types to look up"
3325
3330
  },
3326
3331
  {
3327
3332
  name: "priorityId",
@@ -3330,7 +3335,7 @@ var operations = [
3330
3335
  source: "body",
3331
3336
  type: "string",
3332
3337
  required: false,
3333
- description: ""
3338
+ description: "Priority ID — use /settings/priorities to look up"
3334
3339
  },
3335
3340
  {
3336
3341
  name: "priceBookId",
@@ -3339,7 +3344,7 @@ var operations = [
3339
3344
  source: "body",
3340
3345
  type: "string",
3341
3346
  required: false,
3342
- description: ""
3347
+ description: "Price book ID for job pricing"
3343
3348
  },
3344
3349
  {
3345
3350
  name: "ownerId",
@@ -3348,7 +3353,7 @@ var operations = [
3348
3353
  source: "body",
3349
3354
  type: "string",
3350
3355
  required: false,
3351
- description: ""
3356
+ description: "Owner (employee) ID — use /crm/employees to look up"
3352
3357
  },
3353
3358
  {
3354
3359
  name: "fieldSupervisorId",
@@ -3357,7 +3362,7 @@ var operations = [
3357
3362
  source: "body",
3358
3363
  type: "string",
3359
3364
  required: false,
3360
- description: ""
3365
+ description: "Field supervisor (employee) ID — use /crm/employees to look up"
3361
3366
  },
3362
3367
  {
3363
3368
  name: "zoneId",
@@ -3366,7 +3371,7 @@ var operations = [
3366
3371
  source: "body",
3367
3372
  type: "string",
3368
3373
  required: false,
3369
- description: ""
3374
+ description: "Zone ID — use /settings/zones to look up"
3370
3375
  },
3371
3376
  {
3372
3377
  name: "tagIds",
@@ -3375,7 +3380,7 @@ var operations = [
3375
3380
  source: "body",
3376
3381
  type: "array",
3377
3382
  required: false,
3378
- description: ""
3383
+ description: 'Array of tag IDs (comma-separated, e.g. "id1,id2") — use /settings/tags to look up'
3379
3384
  },
3380
3385
  {
3381
3386
  name: "notes",
@@ -3384,7 +3389,7 @@ var operations = [
3384
3389
  source: "body",
3385
3390
  type: "string",
3386
3391
  required: false,
3387
- description: ""
3392
+ description: "Additional notes or comments"
3388
3393
  },
3389
3394
  {
3390
3395
  name: "reference",
@@ -3393,7 +3398,7 @@ var operations = [
3393
3398
  source: "body",
3394
3399
  type: "string",
3395
3400
  required: false,
3396
- description: ""
3401
+ description: "External reference number"
3397
3402
  },
3398
3403
  {
3399
3404
  name: "customerWO",
@@ -3402,7 +3407,7 @@ var operations = [
3402
3407
  source: "body",
3403
3408
  type: "string",
3404
3409
  required: false,
3405
- description: ""
3410
+ description: "Customer work order reference"
3406
3411
  },
3407
3412
  {
3408
3413
  name: "customerPO",
@@ -3411,7 +3416,7 @@ var operations = [
3411
3416
  source: "body",
3412
3417
  type: "string",
3413
3418
  required: false,
3414
- description: ""
3419
+ description: "Customer purchase order reference"
3415
3420
  },
3416
3421
  {
3417
3422
  name: "startDate",
@@ -3420,7 +3425,7 @@ var operations = [
3420
3425
  source: "body",
3421
3426
  type: "string",
3422
3427
  required: false,
3423
- description: "",
3428
+ description: "Start date (ISO 8601 datetime)",
3424
3429
  format: "date-time"
3425
3430
  },
3426
3431
  {
@@ -3430,7 +3435,7 @@ var operations = [
3430
3435
  source: "body",
3431
3436
  type: "string",
3432
3437
  required: false,
3433
- description: "",
3438
+ description: "Due date (ISO 8601 datetime)",
3434
3439
  format: "date-time"
3435
3440
  },
3436
3441
  {
@@ -3440,7 +3445,7 @@ var operations = [
3440
3445
  source: "body",
3441
3446
  type: "object",
3442
3447
  required: false,
3443
- description: ""
3448
+ description: "Custom fields as key-value pairs — validated against tenant field definitions"
3444
3449
  },
3445
3450
  {
3446
3451
  name: "raw-body",
@@ -3641,7 +3646,7 @@ var operations = [
3641
3646
  source: "body",
3642
3647
  type: "string",
3643
3648
  required: true,
3644
- description: ""
3649
+ description: "Job ID or job number (e.g. J12345)"
3645
3650
  },
3646
3651
  {
3647
3652
  name: "name",
@@ -3650,7 +3655,7 @@ var operations = [
3650
3655
  source: "body",
3651
3656
  type: "string",
3652
3657
  required: true,
3653
- description: ""
3658
+ description: "Display name"
3654
3659
  },
3655
3660
  {
3656
3661
  name: "workCategoryId",
@@ -3659,7 +3664,7 @@ var operations = [
3659
3664
  source: "body",
3660
3665
  type: "string",
3661
3666
  required: false,
3662
- description: ""
3667
+ description: "Work category ID — use /settings/work-types to look up"
3663
3668
  },
3664
3669
  {
3665
3670
  name: "sequence",
@@ -3668,7 +3673,7 @@ var operations = [
3668
3673
  source: "body",
3669
3674
  type: "number",
3670
3675
  required: false,
3671
- description: ""
3676
+ description: "Display order / sequence number"
3672
3677
  },
3673
3678
  {
3674
3679
  name: "startDate",
@@ -3677,7 +3682,7 @@ var operations = [
3677
3682
  source: "body",
3678
3683
  type: "string",
3679
3684
  required: false,
3680
- description: ""
3685
+ description: "Start date (ISO 8601 datetime)"
3681
3686
  },
3682
3687
  {
3683
3688
  name: "dueDate",
@@ -3686,7 +3691,7 @@ var operations = [
3686
3691
  source: "body",
3687
3692
  type: "string",
3688
3693
  required: false,
3689
- description: ""
3694
+ description: "Due date (ISO 8601 datetime)"
3690
3695
  },
3691
3696
  {
3692
3697
  name: "notes",
@@ -3695,7 +3700,7 @@ var operations = [
3695
3700
  source: "body",
3696
3701
  type: "string",
3697
3702
  required: false,
3698
- description: ""
3703
+ description: "Additional notes or comments"
3699
3704
  },
3700
3705
  {
3701
3706
  name: "customFields",
@@ -3704,7 +3709,7 @@ var operations = [
3704
3709
  source: "body",
3705
3710
  type: "object",
3706
3711
  required: false,
3707
- description: ""
3712
+ description: "Custom fields as key-value pairs — validated against tenant field definitions"
3708
3713
  },
3709
3714
  {
3710
3715
  name: "raw-body",
@@ -3742,7 +3747,7 @@ var operations = [
3742
3747
  source: "body",
3743
3748
  type: "string",
3744
3749
  required: false,
3745
- description: ""
3750
+ description: "Display name"
3746
3751
  },
3747
3752
  {
3748
3753
  name: "workCategoryId",
@@ -3751,7 +3756,7 @@ var operations = [
3751
3756
  source: "body",
3752
3757
  type: "string",
3753
3758
  required: false,
3754
- description: ""
3759
+ description: "Work category ID — use /settings/work-types to look up"
3755
3760
  },
3756
3761
  {
3757
3762
  name: "startDate",
@@ -3760,7 +3765,7 @@ var operations = [
3760
3765
  source: "body",
3761
3766
  type: "string",
3762
3767
  required: false,
3763
- description: ""
3768
+ description: "Start date (ISO 8601 datetime)"
3764
3769
  },
3765
3770
  {
3766
3771
  name: "dueDate",
@@ -3769,7 +3774,7 @@ var operations = [
3769
3774
  source: "body",
3770
3775
  type: "string",
3771
3776
  required: false,
3772
- description: ""
3777
+ description: "Due date (ISO 8601 datetime)"
3773
3778
  },
3774
3779
  {
3775
3780
  name: "notes",
@@ -3778,7 +3783,7 @@ var operations = [
3778
3783
  source: "body",
3779
3784
  type: "string",
3780
3785
  required: false,
3781
- description: ""
3786
+ description: "Additional notes or comments"
3782
3787
  },
3783
3788
  {
3784
3789
  name: "tagsSet",
@@ -3847,7 +3852,7 @@ var operations = [
3847
3852
  source: "body",
3848
3853
  type: "object",
3849
3854
  required: false,
3850
- description: ""
3855
+ description: "Custom fields as key-value pairs — validated against tenant field definitions"
3851
3856
  },
3852
3857
  {
3853
3858
  name: "raw-body",
@@ -3925,7 +3930,7 @@ var operations = [
3925
3930
  source: "body",
3926
3931
  type: "string",
3927
3932
  required: false,
3928
- description: "",
3933
+ description: "Completion date (ISO 8601 datetime)",
3929
3934
  format: "date-time"
3930
3935
  },
3931
3936
  {
@@ -3935,7 +3940,7 @@ var operations = [
3935
3940
  source: "body",
3936
3941
  type: "string",
3937
3942
  required: false,
3938
- description: ""
3943
+ description: "Additional notes or comments"
3939
3944
  },
3940
3945
  {
3941
3946
  name: "raw-body",
@@ -3973,7 +3978,7 @@ var operations = [
3973
3978
  source: "body",
3974
3979
  type: "string",
3975
3980
  required: false,
3976
- description: "",
3981
+ description: "Finalisation date (ISO 8601 datetime)",
3977
3982
  format: "date-time"
3978
3983
  },
3979
3984
  {
@@ -4174,7 +4179,7 @@ var operations = [
4174
4179
  source: "body",
4175
4180
  type: "string",
4176
4181
  required: true,
4177
- description: ""
4182
+ description: "Stage ID or stage number"
4178
4183
  },
4179
4184
  {
4180
4185
  name: "contactId",
@@ -4183,7 +4188,7 @@ var operations = [
4183
4188
  source: "body",
4184
4189
  type: "string",
4185
4190
  required: true,
4186
- description: ""
4191
+ description: "Contact ID — use /crm/contacts to look up"
4187
4192
  },
4188
4193
  {
4189
4194
  name: "raw-body",
@@ -4353,7 +4358,7 @@ var operations = [
4353
4358
  source: "body",
4354
4359
  type: "string",
4355
4360
  required: true,
4356
- description: ""
4361
+ description: "Stage ID or stage number"
4357
4362
  },
4358
4363
  {
4359
4364
  name: "status",
@@ -4362,7 +4367,7 @@ var operations = [
4362
4367
  source: "body",
4363
4368
  type: "string",
4364
4369
  required: true,
4365
- description: "",
4370
+ description: "Status filter",
4366
4371
  enumValues: ["enroute", "onsite", "checkedout", "completed", "onhold"]
4367
4372
  },
4368
4373
  {
@@ -4618,7 +4623,7 @@ var operations = [
4618
4623
  source: "path",
4619
4624
  type: "string",
4620
4625
  required: true,
4621
- description: ""
4626
+ description: "Job ID or job number (e.g. J12345)"
4622
4627
  }
4623
4628
  ],
4624
4629
  hasRequestBody: false
@@ -4638,7 +4643,7 @@ var operations = [
4638
4643
  source: "path",
4639
4644
  type: "string",
4640
4645
  required: true,
4641
- description: ""
4646
+ description: "Job ID or job number (e.g. J12345)"
4642
4647
  },
4643
4648
  {
4644
4649
  name: "id",
@@ -4667,7 +4672,7 @@ var operations = [
4667
4672
  source: "path",
4668
4673
  type: "string",
4669
4674
  required: true,
4670
- description: ""
4675
+ description: "Job ID or job number (e.g. J12345)"
4671
4676
  },
4672
4677
  {
4673
4678
  name: "id",
@@ -4696,7 +4701,7 @@ var operations = [
4696
4701
  source: "path",
4697
4702
  type: "string",
4698
4703
  required: true,
4699
- description: ""
4704
+ description: "Job ID or job number (e.g. J12345)"
4700
4705
  },
4701
4706
  {
4702
4707
  name: "body",
@@ -4705,7 +4710,7 @@ var operations = [
4705
4710
  source: "body",
4706
4711
  type: "string",
4707
4712
  required: true,
4708
- description: ""
4713
+ description: "Message body content (HTML supported for email)"
4709
4714
  },
4710
4715
  {
4711
4716
  name: "labelIds",
@@ -4714,7 +4719,7 @@ var operations = [
4714
4719
  source: "body",
4715
4720
  type: "array",
4716
4721
  required: false,
4717
- description: ""
4722
+ description: 'Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")'
4718
4723
  },
4719
4724
  {
4720
4725
  name: "attachmentIds",
@@ -4723,7 +4728,7 @@ var operations = [
4723
4728
  source: "body",
4724
4729
  type: "array",
4725
4730
  required: false,
4726
- description: ""
4731
+ description: 'Attachment IDs from the upload endpoint (comma-separated, e.g. "id1,id2")'
4727
4732
  },
4728
4733
  {
4729
4734
  name: "sharing",
@@ -4732,7 +4737,7 @@ var operations = [
4732
4737
  source: "body",
4733
4738
  type: "object",
4734
4739
  required: false,
4735
- description: ""
4740
+ description: "Sharing options — control visibility to customer portal and field app"
4736
4741
  },
4737
4742
  {
4738
4743
  name: "raw-body",
@@ -4761,7 +4766,7 @@ var operations = [
4761
4766
  source: "path",
4762
4767
  type: "string",
4763
4768
  required: true,
4764
- description: ""
4769
+ description: "Job ID or job number (e.g. J12345)"
4765
4770
  },
4766
4771
  {
4767
4772
  name: "templateId",
@@ -4770,7 +4775,7 @@ var operations = [
4770
4775
  source: "body",
4771
4776
  type: "string",
4772
4777
  required: false,
4773
- description: ""
4778
+ description: "Template ID to pre-populate fields from a template"
4774
4779
  },
4775
4780
  {
4776
4781
  name: "subject",
@@ -4779,7 +4784,7 @@ var operations = [
4779
4784
  source: "body",
4780
4785
  type: "string",
4781
4786
  required: false,
4782
- description: ""
4787
+ description: "Email subject line"
4783
4788
  },
4784
4789
  {
4785
4790
  name: "body",
@@ -4788,7 +4793,7 @@ var operations = [
4788
4793
  source: "body",
4789
4794
  type: "string",
4790
4795
  required: false,
4791
- description: ""
4796
+ description: "Message body content (HTML supported for email)"
4792
4797
  },
4793
4798
  {
4794
4799
  name: "to",
@@ -4797,7 +4802,7 @@ var operations = [
4797
4802
  source: "body",
4798
4803
  type: "array",
4799
4804
  required: false,
4800
- description: ""
4805
+ description: "Recipients"
4801
4806
  },
4802
4807
  {
4803
4808
  name: "cc",
@@ -4806,7 +4811,7 @@ var operations = [
4806
4811
  source: "body",
4807
4812
  type: "array",
4808
4813
  required: false,
4809
- description: ""
4814
+ description: "CC recipients"
4810
4815
  },
4811
4816
  {
4812
4817
  name: "bcc",
@@ -4815,7 +4820,7 @@ var operations = [
4815
4820
  source: "body",
4816
4821
  type: "array",
4817
4822
  required: false,
4818
- description: ""
4823
+ description: "BCC recipients"
4819
4824
  },
4820
4825
  {
4821
4826
  name: "labelIds",
@@ -4824,7 +4829,7 @@ var operations = [
4824
4829
  source: "body",
4825
4830
  type: "array",
4826
4831
  required: false,
4827
- description: ""
4832
+ description: 'Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")'
4828
4833
  },
4829
4834
  {
4830
4835
  name: "attachmentIds",
@@ -4833,7 +4838,7 @@ var operations = [
4833
4838
  source: "body",
4834
4839
  type: "array",
4835
4840
  required: false,
4836
- description: ""
4841
+ description: 'Attachment IDs from the upload endpoint (comma-separated, e.g. "id1,id2")'
4837
4842
  },
4838
4843
  {
4839
4844
  name: "sharing",
@@ -4842,7 +4847,7 @@ var operations = [
4842
4847
  source: "body",
4843
4848
  type: "object",
4844
4849
  required: false,
4845
- description: ""
4850
+ description: "Sharing options — control visibility to customer portal and field app"
4846
4851
  },
4847
4852
  {
4848
4853
  name: "raw-body",
@@ -4871,7 +4876,7 @@ var operations = [
4871
4876
  source: "path",
4872
4877
  type: "string",
4873
4878
  required: true,
4874
- description: ""
4879
+ description: "Job ID or job number (e.g. J12345)"
4875
4880
  },
4876
4881
  {
4877
4882
  name: "templateId",
@@ -4880,7 +4885,7 @@ var operations = [
4880
4885
  source: "body",
4881
4886
  type: "string",
4882
4887
  required: false,
4883
- description: ""
4888
+ description: "Template ID to pre-populate fields from a template"
4884
4889
  },
4885
4890
  {
4886
4891
  name: "body",
@@ -4889,7 +4894,7 @@ var operations = [
4889
4894
  source: "body",
4890
4895
  type: "string",
4891
4896
  required: false,
4892
- description: ""
4897
+ description: "Message body content (HTML supported for email)"
4893
4898
  },
4894
4899
  {
4895
4900
  name: "to",
@@ -4898,7 +4903,7 @@ var operations = [
4898
4903
  source: "body",
4899
4904
  type: "array",
4900
4905
  required: false,
4901
- description: ""
4906
+ description: "Recipients"
4902
4907
  },
4903
4908
  {
4904
4909
  name: "labelIds",
@@ -4907,7 +4912,7 @@ var operations = [
4907
4912
  source: "body",
4908
4913
  type: "array",
4909
4914
  required: false,
4910
- description: ""
4915
+ description: 'Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")'
4911
4916
  },
4912
4917
  {
4913
4918
  name: "sharing",
@@ -4916,7 +4921,7 @@ var operations = [
4916
4921
  source: "body",
4917
4922
  type: "object",
4918
4923
  required: false,
4919
- description: ""
4924
+ description: "Sharing options — control visibility to customer portal and field app"
4920
4925
  },
4921
4926
  {
4922
4927
  name: "raw-body",
@@ -4945,7 +4950,7 @@ var operations = [
4945
4950
  source: "path",
4946
4951
  type: "string",
4947
4952
  required: true,
4948
- description: ""
4953
+ description: "Job ID or job number (e.g. J12345)"
4949
4954
  },
4950
4955
  {
4951
4956
  name: "direction",
@@ -4991,7 +4996,7 @@ var operations = [
4991
4996
  source: "body",
4992
4997
  type: "string",
4993
4998
  required: false,
4994
- description: "",
4999
+ description: "call date (ISO 8601 datetime)",
4995
5000
  format: "date-time"
4996
5001
  },
4997
5002
  {
@@ -5001,7 +5006,7 @@ var operations = [
5001
5006
  source: "body",
5002
5007
  type: "string",
5003
5008
  required: false,
5004
- description: ""
5009
+ description: "Message body content (HTML supported for email)"
5005
5010
  },
5006
5011
  {
5007
5012
  name: "labelIds",
@@ -5010,7 +5015,7 @@ var operations = [
5010
5015
  source: "body",
5011
5016
  type: "array",
5012
5017
  required: false,
5013
- description: ""
5018
+ description: 'Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")'
5014
5019
  },
5015
5020
  {
5016
5021
  name: "sharing",
@@ -5019,7 +5024,7 @@ var operations = [
5019
5024
  source: "body",
5020
5025
  type: "object",
5021
5026
  required: false,
5022
- description: ""
5027
+ description: "Sharing options — control visibility to customer portal and field app"
5023
5028
  },
5024
5029
  {
5025
5030
  name: "raw-body",
@@ -5048,7 +5053,7 @@ var operations = [
5048
5053
  source: "path",
5049
5054
  type: "string",
5050
5055
  required: true,
5051
- description: ""
5056
+ description: "Job ID or job number (e.g. J12345)"
5052
5057
  },
5053
5058
  {
5054
5059
  name: "body",
@@ -5057,7 +5062,7 @@ var operations = [
5057
5062
  source: "body",
5058
5063
  type: "string",
5059
5064
  required: true,
5060
- description: ""
5065
+ description: "Message body content (HTML supported for email)"
5061
5066
  },
5062
5067
  {
5063
5068
  name: "integrationType",
@@ -5075,7 +5080,7 @@ var operations = [
5075
5080
  source: "body",
5076
5081
  type: "object",
5077
5082
  required: false,
5078
- description: ""
5083
+ description: "Sharing options — control visibility to customer portal and field app"
5079
5084
  },
5080
5085
  {
5081
5086
  name: "raw-body",
@@ -5104,7 +5109,7 @@ var operations = [
5104
5109
  source: "path",
5105
5110
  type: "string",
5106
5111
  required: true,
5107
- description: ""
5112
+ description: "Stage ID or stage number"
5108
5113
  },
5109
5114
  {
5110
5115
  name: "jobId",
@@ -5133,7 +5138,7 @@ var operations = [
5133
5138
  source: "path",
5134
5139
  type: "string",
5135
5140
  required: true,
5136
- description: ""
5141
+ description: "Stage ID or stage number"
5137
5142
  },
5138
5143
  {
5139
5144
  name: "id",
@@ -5171,7 +5176,7 @@ var operations = [
5171
5176
  source: "path",
5172
5177
  type: "string",
5173
5178
  required: true,
5174
- description: ""
5179
+ description: "Stage ID or stage number"
5175
5180
  },
5176
5181
  {
5177
5182
  name: "id",
@@ -5209,7 +5214,7 @@ var operations = [
5209
5214
  source: "path",
5210
5215
  type: "string",
5211
5216
  required: true,
5212
- description: ""
5217
+ description: "Stage ID or stage number"
5213
5218
  },
5214
5219
  {
5215
5220
  name: "jobId",
@@ -5227,7 +5232,7 @@ var operations = [
5227
5232
  source: "body",
5228
5233
  type: "string",
5229
5234
  required: true,
5230
- description: ""
5235
+ description: "Message body content (HTML supported for email)"
5231
5236
  },
5232
5237
  {
5233
5238
  name: "labelIds",
@@ -5236,7 +5241,7 @@ var operations = [
5236
5241
  source: "body",
5237
5242
  type: "array",
5238
5243
  required: false,
5239
- description: ""
5244
+ description: 'Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")'
5240
5245
  },
5241
5246
  {
5242
5247
  name: "attachmentIds",
@@ -5245,7 +5250,7 @@ var operations = [
5245
5250
  source: "body",
5246
5251
  type: "array",
5247
5252
  required: false,
5248
- description: ""
5253
+ description: 'Attachment IDs from the upload endpoint (comma-separated, e.g. "id1,id2")'
5249
5254
  },
5250
5255
  {
5251
5256
  name: "sharing",
@@ -5254,7 +5259,7 @@ var operations = [
5254
5259
  source: "body",
5255
5260
  type: "object",
5256
5261
  required: false,
5257
- description: ""
5262
+ description: "Sharing options — control visibility to customer portal and field app"
5258
5263
  },
5259
5264
  {
5260
5265
  name: "raw-body",
@@ -5283,7 +5288,7 @@ var operations = [
5283
5288
  source: "path",
5284
5289
  type: "string",
5285
5290
  required: true,
5286
- description: ""
5291
+ description: "Stage ID or stage number"
5287
5292
  },
5288
5293
  {
5289
5294
  name: "jobId",
@@ -5301,7 +5306,7 @@ var operations = [
5301
5306
  source: "body",
5302
5307
  type: "string",
5303
5308
  required: false,
5304
- description: ""
5309
+ description: "Template ID to pre-populate fields from a template"
5305
5310
  },
5306
5311
  {
5307
5312
  name: "subject",
@@ -5310,7 +5315,7 @@ var operations = [
5310
5315
  source: "body",
5311
5316
  type: "string",
5312
5317
  required: false,
5313
- description: ""
5318
+ description: "Email subject line"
5314
5319
  },
5315
5320
  {
5316
5321
  name: "body",
@@ -5319,7 +5324,7 @@ var operations = [
5319
5324
  source: "body",
5320
5325
  type: "string",
5321
5326
  required: false,
5322
- description: ""
5327
+ description: "Message body content (HTML supported for email)"
5323
5328
  },
5324
5329
  {
5325
5330
  name: "to",
@@ -5328,7 +5333,7 @@ var operations = [
5328
5333
  source: "body",
5329
5334
  type: "array",
5330
5335
  required: false,
5331
- description: ""
5336
+ description: "Recipients"
5332
5337
  },
5333
5338
  {
5334
5339
  name: "cc",
@@ -5337,7 +5342,7 @@ var operations = [
5337
5342
  source: "body",
5338
5343
  type: "array",
5339
5344
  required: false,
5340
- description: ""
5345
+ description: "CC recipients"
5341
5346
  },
5342
5347
  {
5343
5348
  name: "bcc",
@@ -5346,7 +5351,7 @@ var operations = [
5346
5351
  source: "body",
5347
5352
  type: "array",
5348
5353
  required: false,
5349
- description: ""
5354
+ description: "BCC recipients"
5350
5355
  },
5351
5356
  {
5352
5357
  name: "labelIds",
@@ -5355,7 +5360,7 @@ var operations = [
5355
5360
  source: "body",
5356
5361
  type: "array",
5357
5362
  required: false,
5358
- description: ""
5363
+ description: 'Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")'
5359
5364
  },
5360
5365
  {
5361
5366
  name: "attachmentIds",
@@ -5364,7 +5369,7 @@ var operations = [
5364
5369
  source: "body",
5365
5370
  type: "array",
5366
5371
  required: false,
5367
- description: ""
5372
+ description: 'Attachment IDs from the upload endpoint (comma-separated, e.g. "id1,id2")'
5368
5373
  },
5369
5374
  {
5370
5375
  name: "sharing",
@@ -5373,7 +5378,7 @@ var operations = [
5373
5378
  source: "body",
5374
5379
  type: "object",
5375
5380
  required: false,
5376
- description: ""
5381
+ description: "Sharing options — control visibility to customer portal and field app"
5377
5382
  },
5378
5383
  {
5379
5384
  name: "raw-body",
@@ -5402,7 +5407,7 @@ var operations = [
5402
5407
  source: "path",
5403
5408
  type: "string",
5404
5409
  required: true,
5405
- description: ""
5410
+ description: "Stage ID or stage number"
5406
5411
  },
5407
5412
  {
5408
5413
  name: "jobId",
@@ -5420,7 +5425,7 @@ var operations = [
5420
5425
  source: "body",
5421
5426
  type: "string",
5422
5427
  required: false,
5423
- description: ""
5428
+ description: "Template ID to pre-populate fields from a template"
5424
5429
  },
5425
5430
  {
5426
5431
  name: "body",
@@ -5429,7 +5434,7 @@ var operations = [
5429
5434
  source: "body",
5430
5435
  type: "string",
5431
5436
  required: false,
5432
- description: ""
5437
+ description: "Message body content (HTML supported for email)"
5433
5438
  },
5434
5439
  {
5435
5440
  name: "to",
@@ -5438,7 +5443,7 @@ var operations = [
5438
5443
  source: "body",
5439
5444
  type: "array",
5440
5445
  required: false,
5441
- description: ""
5446
+ description: "Recipients"
5442
5447
  },
5443
5448
  {
5444
5449
  name: "labelIds",
@@ -5447,7 +5452,7 @@ var operations = [
5447
5452
  source: "body",
5448
5453
  type: "array",
5449
5454
  required: false,
5450
- description: ""
5455
+ description: 'Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")'
5451
5456
  },
5452
5457
  {
5453
5458
  name: "sharing",
@@ -5456,7 +5461,7 @@ var operations = [
5456
5461
  source: "body",
5457
5462
  type: "object",
5458
5463
  required: false,
5459
- description: ""
5464
+ description: "Sharing options — control visibility to customer portal and field app"
5460
5465
  },
5461
5466
  {
5462
5467
  name: "raw-body",
@@ -5485,7 +5490,7 @@ var operations = [
5485
5490
  source: "path",
5486
5491
  type: "string",
5487
5492
  required: true,
5488
- description: ""
5493
+ description: "Stage ID or stage number"
5489
5494
  },
5490
5495
  {
5491
5496
  name: "jobId",
@@ -5540,7 +5545,7 @@ var operations = [
5540
5545
  source: "body",
5541
5546
  type: "string",
5542
5547
  required: false,
5543
- description: "",
5548
+ description: "call date (ISO 8601 datetime)",
5544
5549
  format: "date-time"
5545
5550
  },
5546
5551
  {
@@ -5550,7 +5555,7 @@ var operations = [
5550
5555
  source: "body",
5551
5556
  type: "string",
5552
5557
  required: false,
5553
- description: ""
5558
+ description: "Message body content (HTML supported for email)"
5554
5559
  },
5555
5560
  {
5556
5561
  name: "labelIds",
@@ -5559,7 +5564,7 @@ var operations = [
5559
5564
  source: "body",
5560
5565
  type: "array",
5561
5566
  required: false,
5562
- description: ""
5567
+ description: 'Array of label/tag IDs to attach (comma-separated, e.g. "id1,id2")'
5563
5568
  },
5564
5569
  {
5565
5570
  name: "sharing",
@@ -5568,7 +5573,7 @@ var operations = [
5568
5573
  source: "body",
5569
5574
  type: "object",
5570
5575
  required: false,
5571
- description: ""
5576
+ description: "Sharing options — control visibility to customer portal and field app"
5572
5577
  },
5573
5578
  {
5574
5579
  name: "raw-body",
@@ -5597,7 +5602,7 @@ var operations = [
5597
5602
  source: "path",
5598
5603
  type: "string",
5599
5604
  required: true,
5600
- description: ""
5605
+ description: "Stage ID or stage number"
5601
5606
  },
5602
5607
  {
5603
5608
  name: "jobId",
@@ -5615,7 +5620,7 @@ var operations = [
5615
5620
  source: "body",
5616
5621
  type: "string",
5617
5622
  required: true,
5618
- description: ""
5623
+ description: "Message body content (HTML supported for email)"
5619
5624
  },
5620
5625
  {
5621
5626
  name: "integrationType",
@@ -5633,7 +5638,7 @@ var operations = [
5633
5638
  source: "body",
5634
5639
  type: "object",
5635
5640
  required: false,
5636
- description: ""
5641
+ description: "Sharing options — control visibility to customer portal and field app"
5637
5642
  },
5638
5643
  {
5639
5644
  name: "raw-body",
@@ -5662,7 +5667,7 @@ var operations = [
5662
5667
  source: "path",
5663
5668
  type: "string",
5664
5669
  required: true,
5665
- description: ""
5670
+ description: "Job ID or job number (e.g. J12345)"
5666
5671
  }
5667
5672
  ],
5668
5673
  hasRequestBody: false
@@ -5682,7 +5687,7 @@ var operations = [
5682
5687
  source: "path",
5683
5688
  type: "string",
5684
5689
  required: true,
5685
- description: ""
5690
+ description: "Job ID or job number (e.g. J12345)"
5686
5691
  }
5687
5692
  ],
5688
5693
  hasRequestBody: false
@@ -5702,7 +5707,7 @@ var operations = [
5702
5707
  source: "path",
5703
5708
  type: "string",
5704
5709
  required: true,
5705
- description: ""
5710
+ description: "Job ID or job number (e.g. J12345)"
5706
5711
  },
5707
5712
  {
5708
5713
  name: "id",
@@ -5731,7 +5736,7 @@ var operations = [
5731
5736
  source: "path",
5732
5737
  type: "string",
5733
5738
  required: true,
5734
- description: ""
5739
+ description: "Job ID or job number (e.g. J12345)"
5735
5740
  },
5736
5741
  {
5737
5742
  name: "id",
@@ -5760,7 +5765,7 @@ var operations = [
5760
5765
  source: "path",
5761
5766
  type: "string",
5762
5767
  required: true,
5763
- description: ""
5768
+ description: "Stage ID or stage number"
5764
5769
  },
5765
5770
  {
5766
5771
  name: "jobId",
@@ -5789,7 +5794,7 @@ var operations = [
5789
5794
  source: "path",
5790
5795
  type: "string",
5791
5796
  required: true,
5792
- description: ""
5797
+ description: "Stage ID or stage number"
5793
5798
  },
5794
5799
  {
5795
5800
  name: "jobId",
@@ -5818,7 +5823,7 @@ var operations = [
5818
5823
  source: "path",
5819
5824
  type: "string",
5820
5825
  required: true,
5821
- description: ""
5826
+ description: "Stage ID or stage number"
5822
5827
  },
5823
5828
  {
5824
5829
  name: "id",
@@ -5856,7 +5861,7 @@ var operations = [
5856
5861
  source: "path",
5857
5862
  type: "string",
5858
5863
  required: true,
5859
- description: ""
5864
+ description: "Stage ID or stage number"
5860
5865
  },
5861
5866
  {
5862
5867
  name: "id",
@@ -5894,7 +5899,7 @@ var operations = [
5894
5899
  source: "path",
5895
5900
  type: "string",
5896
5901
  required: true,
5897
- description: ""
5902
+ description: "Job ID or job number (e.g. J12345)"
5898
5903
  }
5899
5904
  ],
5900
5905
  hasRequestBody: false
@@ -5914,7 +5919,7 @@ var operations = [
5914
5919
  source: "path",
5915
5920
  type: "string",
5916
5921
  required: true,
5917
- description: ""
5922
+ description: "Job ID or job number (e.g. J12345)"
5918
5923
  },
5919
5924
  {
5920
5925
  name: "name",
@@ -5923,7 +5928,7 @@ var operations = [
5923
5928
  source: "body",
5924
5929
  type: "string",
5925
5930
  required: true,
5926
- description: ""
5931
+ description: "Display name"
5927
5932
  },
5928
5933
  {
5929
5934
  name: "description",
@@ -5932,7 +5937,7 @@ var operations = [
5932
5937
  source: "body",
5933
5938
  type: "string",
5934
5939
  required: false,
5935
- description: ""
5940
+ description: "Detailed description"
5936
5941
  },
5937
5942
  {
5938
5943
  name: "target",
@@ -5951,7 +5956,7 @@ var operations = [
5951
5956
  source: "body",
5952
5957
  type: "string",
5953
5958
  required: false,
5954
- description: ""
5959
+ description: "assignee ID"
5955
5960
  },
5956
5961
  {
5957
5962
  name: "dueDate",
@@ -5960,7 +5965,7 @@ var operations = [
5960
5965
  source: "body",
5961
5966
  type: "string",
5962
5967
  required: false,
5963
- description: "",
5968
+ description: "Due date (ISO 8601 datetime)",
5964
5969
  format: "date-time"
5965
5970
  },
5966
5971
  {
@@ -5970,7 +5975,7 @@ var operations = [
5970
5975
  source: "body",
5971
5976
  type: "array",
5972
5977
  required: false,
5973
- description: ""
5978
+ description: 'Array of tag IDs (comma-separated, e.g. "id1,id2") — use /settings/tags to look up'
5974
5979
  },
5975
5980
  {
5976
5981
  name: "evidenceOptions",
@@ -5988,7 +5993,7 @@ var operations = [
5988
5993
  source: "body",
5989
5994
  type: "object",
5990
5995
  required: false,
5991
- description: ""
5996
+ description: "Sharing options — control visibility to customer portal and field app"
5992
5997
  },
5993
5998
  {
5994
5999
  name: "raw-body",
@@ -6017,7 +6022,7 @@ var operations = [
6017
6022
  source: "path",
6018
6023
  type: "string",
6019
6024
  required: true,
6020
- description: ""
6025
+ description: "Job ID or job number (e.g. J12345)"
6021
6026
  },
6022
6027
  {
6023
6028
  name: "id",
@@ -6046,7 +6051,7 @@ var operations = [
6046
6051
  source: "path",
6047
6052
  type: "string",
6048
6053
  required: true,
6049
- description: ""
6054
+ description: "Job ID or job number (e.g. J12345)"
6050
6055
  },
6051
6056
  {
6052
6057
  name: "id",
@@ -6064,7 +6069,7 @@ var operations = [
6064
6069
  source: "body",
6065
6070
  type: "string",
6066
6071
  required: false,
6067
- description: ""
6072
+ description: "Display name"
6068
6073
  },
6069
6074
  {
6070
6075
  name: "description",
@@ -6073,7 +6078,7 @@ var operations = [
6073
6078
  source: "body",
6074
6079
  type: "string",
6075
6080
  required: false,
6076
- description: ""
6081
+ description: "Detailed description"
6077
6082
  },
6078
6083
  {
6079
6084
  name: "status",
@@ -6082,7 +6087,7 @@ var operations = [
6082
6087
  source: "body",
6083
6088
  type: "string",
6084
6089
  required: false,
6085
- description: "",
6090
+ description: "Status filter",
6086
6091
  enumValues: ["open", "completed"]
6087
6092
  },
6088
6093
  {
@@ -6102,7 +6107,7 @@ var operations = [
6102
6107
  source: "body",
6103
6108
  type: "string",
6104
6109
  required: false,
6105
- description: ""
6110
+ description: "assignee ID"
6106
6111
  },
6107
6112
  {
6108
6113
  name: "dueDate",
@@ -6111,7 +6116,7 @@ var operations = [
6111
6116
  source: "body",
6112
6117
  type: "string",
6113
6118
  required: false,
6114
- description: ""
6119
+ description: "Due date (ISO 8601 datetime)"
6115
6120
  },
6116
6121
  {
6117
6122
  name: "completedOn",
@@ -6129,7 +6134,7 @@ var operations = [
6129
6134
  source: "body",
6130
6135
  type: "string",
6131
6136
  required: false,
6132
- description: ""
6137
+ description: "completed by ID"
6133
6138
  },
6134
6139
  {
6135
6140
  name: "tagIds",
@@ -6138,7 +6143,7 @@ var operations = [
6138
6143
  source: "body",
6139
6144
  type: "array",
6140
6145
  required: false,
6141
- description: ""
6146
+ description: 'Array of tag IDs (comma-separated, e.g. "id1,id2") — use /settings/tags to look up'
6142
6147
  },
6143
6148
  {
6144
6149
  name: "sharing",
@@ -6147,7 +6152,7 @@ var operations = [
6147
6152
  source: "body",
6148
6153
  type: "object",
6149
6154
  required: false,
6150
- description: ""
6155
+ description: "Sharing options — control visibility to customer portal and field app"
6151
6156
  },
6152
6157
  {
6153
6158
  name: "raw-body",
@@ -6176,7 +6181,7 @@ var operations = [
6176
6181
  source: "path",
6177
6182
  type: "string",
6178
6183
  required: true,
6179
- description: ""
6184
+ description: "Job ID or job number (e.g. J12345)"
6180
6185
  },
6181
6186
  {
6182
6187
  name: "id",
@@ -6205,7 +6210,7 @@ var operations = [
6205
6210
  source: "path",
6206
6211
  type: "string",
6207
6212
  required: true,
6208
- description: ""
6213
+ description: "Job ID or job number (e.g. J12345)"
6209
6214
  },
6210
6215
  {
6211
6216
  name: "id",
@@ -6223,7 +6228,7 @@ var operations = [
6223
6228
  source: "body",
6224
6229
  type: "array",
6225
6230
  required: false,
6226
- description: ""
6231
+ description: 'Array of signature attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6227
6232
  },
6228
6233
  {
6229
6234
  name: "beforePhotoAttachmentIds",
@@ -6232,7 +6237,7 @@ var operations = [
6232
6237
  source: "body",
6233
6238
  type: "array",
6234
6239
  required: false,
6235
- description: ""
6240
+ description: 'Array of before photo attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6236
6241
  },
6237
6242
  {
6238
6243
  name: "duringPhotoAttachmentIds",
@@ -6241,7 +6246,7 @@ var operations = [
6241
6246
  source: "body",
6242
6247
  type: "array",
6243
6248
  required: false,
6244
- description: ""
6249
+ description: 'Array of during photo attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6245
6250
  },
6246
6251
  {
6247
6252
  name: "afterPhotoAttachmentIds",
@@ -6250,7 +6255,7 @@ var operations = [
6250
6255
  source: "body",
6251
6256
  type: "array",
6252
6257
  required: false,
6253
- description: ""
6258
+ description: 'Array of after photo attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6254
6259
  },
6255
6260
  {
6256
6261
  name: "comment",
@@ -6277,7 +6282,7 @@ var operations = [
6277
6282
  source: "body",
6278
6283
  type: "string",
6279
6284
  required: false,
6280
- description: ""
6285
+ description: "form response ID"
6281
6286
  },
6282
6287
  {
6283
6288
  name: "fileAttachmentIds",
@@ -6286,7 +6291,7 @@ var operations = [
6286
6291
  source: "body",
6287
6292
  type: "array",
6288
6293
  required: false,
6289
- description: ""
6294
+ description: 'Array of file attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6290
6295
  },
6291
6296
  {
6292
6297
  name: "additionalFileAttachmentIds",
@@ -6295,7 +6300,7 @@ var operations = [
6295
6300
  source: "body",
6296
6301
  type: "array",
6297
6302
  required: false,
6298
- description: ""
6303
+ description: 'Array of additional file attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6299
6304
  },
6300
6305
  {
6301
6306
  name: "complete",
@@ -6333,7 +6338,7 @@ var operations = [
6333
6338
  source: "path",
6334
6339
  type: "string",
6335
6340
  required: true,
6336
- description: ""
6341
+ description: "Stage ID or stage number"
6337
6342
  },
6338
6343
  {
6339
6344
  name: "jobId",
@@ -6342,7 +6347,7 @@ var operations = [
6342
6347
  source: "path",
6343
6348
  type: "string",
6344
6349
  required: true,
6345
- description: ""
6350
+ description: "Job ID or job number (e.g. J12345)"
6346
6351
  }
6347
6352
  ],
6348
6353
  hasRequestBody: false
@@ -6362,7 +6367,7 @@ var operations = [
6362
6367
  source: "path",
6363
6368
  type: "string",
6364
6369
  required: true,
6365
- description: ""
6370
+ description: "Stage ID or stage number"
6366
6371
  },
6367
6372
  {
6368
6373
  name: "jobId",
@@ -6371,7 +6376,7 @@ var operations = [
6371
6376
  source: "path",
6372
6377
  type: "string",
6373
6378
  required: true,
6374
- description: ""
6379
+ description: "Job ID or job number (e.g. J12345)"
6375
6380
  },
6376
6381
  {
6377
6382
  name: "name",
@@ -6380,7 +6385,7 @@ var operations = [
6380
6385
  source: "body",
6381
6386
  type: "string",
6382
6387
  required: true,
6383
- description: ""
6388
+ description: "Display name"
6384
6389
  },
6385
6390
  {
6386
6391
  name: "description",
@@ -6389,7 +6394,7 @@ var operations = [
6389
6394
  source: "body",
6390
6395
  type: "string",
6391
6396
  required: false,
6392
- description: ""
6397
+ description: "Detailed description"
6393
6398
  },
6394
6399
  {
6395
6400
  name: "target",
@@ -6408,7 +6413,7 @@ var operations = [
6408
6413
  source: "body",
6409
6414
  type: "string",
6410
6415
  required: false,
6411
- description: ""
6416
+ description: "assignee ID"
6412
6417
  },
6413
6418
  {
6414
6419
  name: "dueDate",
@@ -6417,7 +6422,7 @@ var operations = [
6417
6422
  source: "body",
6418
6423
  type: "string",
6419
6424
  required: false,
6420
- description: "",
6425
+ description: "Due date (ISO 8601 datetime)",
6421
6426
  format: "date-time"
6422
6427
  },
6423
6428
  {
@@ -6427,7 +6432,7 @@ var operations = [
6427
6432
  source: "body",
6428
6433
  type: "array",
6429
6434
  required: false,
6430
- description: ""
6435
+ description: 'Array of tag IDs (comma-separated, e.g. "id1,id2") — use /settings/tags to look up'
6431
6436
  },
6432
6437
  {
6433
6438
  name: "evidenceOptions",
@@ -6445,7 +6450,7 @@ var operations = [
6445
6450
  source: "body",
6446
6451
  type: "object",
6447
6452
  required: false,
6448
- description: ""
6453
+ description: "Sharing options — control visibility to customer portal and field app"
6449
6454
  },
6450
6455
  {
6451
6456
  name: "raw-body",
@@ -6474,7 +6479,7 @@ var operations = [
6474
6479
  source: "path",
6475
6480
  type: "string",
6476
6481
  required: true,
6477
- description: ""
6482
+ description: "Stage ID or stage number"
6478
6483
  },
6479
6484
  {
6480
6485
  name: "id",
@@ -6512,7 +6517,7 @@ var operations = [
6512
6517
  source: "path",
6513
6518
  type: "string",
6514
6519
  required: true,
6515
- description: ""
6520
+ description: "Stage ID or stage number"
6516
6521
  },
6517
6522
  {
6518
6523
  name: "id",
@@ -6539,7 +6544,7 @@ var operations = [
6539
6544
  source: "body",
6540
6545
  type: "string",
6541
6546
  required: false,
6542
- description: ""
6547
+ description: "Display name"
6543
6548
  },
6544
6549
  {
6545
6550
  name: "description",
@@ -6548,7 +6553,7 @@ var operations = [
6548
6553
  source: "body",
6549
6554
  type: "string",
6550
6555
  required: false,
6551
- description: ""
6556
+ description: "Detailed description"
6552
6557
  },
6553
6558
  {
6554
6559
  name: "status",
@@ -6557,7 +6562,7 @@ var operations = [
6557
6562
  source: "body",
6558
6563
  type: "string",
6559
6564
  required: false,
6560
- description: "",
6565
+ description: "Status filter",
6561
6566
  enumValues: ["open", "completed"]
6562
6567
  },
6563
6568
  {
@@ -6577,7 +6582,7 @@ var operations = [
6577
6582
  source: "body",
6578
6583
  type: "string",
6579
6584
  required: false,
6580
- description: ""
6585
+ description: "assignee ID"
6581
6586
  },
6582
6587
  {
6583
6588
  name: "dueDate",
@@ -6586,7 +6591,7 @@ var operations = [
6586
6591
  source: "body",
6587
6592
  type: "string",
6588
6593
  required: false,
6589
- description: ""
6594
+ description: "Due date (ISO 8601 datetime)"
6590
6595
  },
6591
6596
  {
6592
6597
  name: "completedOn",
@@ -6604,7 +6609,7 @@ var operations = [
6604
6609
  source: "body",
6605
6610
  type: "string",
6606
6611
  required: false,
6607
- description: ""
6612
+ description: "completed by ID"
6608
6613
  },
6609
6614
  {
6610
6615
  name: "tagIds",
@@ -6613,7 +6618,7 @@ var operations = [
6613
6618
  source: "body",
6614
6619
  type: "array",
6615
6620
  required: false,
6616
- description: ""
6621
+ description: 'Array of tag IDs (comma-separated, e.g. "id1,id2") — use /settings/tags to look up'
6617
6622
  },
6618
6623
  {
6619
6624
  name: "sharing",
@@ -6622,7 +6627,7 @@ var operations = [
6622
6627
  source: "body",
6623
6628
  type: "object",
6624
6629
  required: false,
6625
- description: ""
6630
+ description: "Sharing options — control visibility to customer portal and field app"
6626
6631
  },
6627
6632
  {
6628
6633
  name: "raw-body",
@@ -6651,7 +6656,7 @@ var operations = [
6651
6656
  source: "path",
6652
6657
  type: "string",
6653
6658
  required: true,
6654
- description: ""
6659
+ description: "Stage ID or stage number"
6655
6660
  },
6656
6661
  {
6657
6662
  name: "id",
@@ -6689,7 +6694,7 @@ var operations = [
6689
6694
  source: "path",
6690
6695
  type: "string",
6691
6696
  required: true,
6692
- description: ""
6697
+ description: "Stage ID or stage number"
6693
6698
  },
6694
6699
  {
6695
6700
  name: "id",
@@ -6716,7 +6721,7 @@ var operations = [
6716
6721
  source: "body",
6717
6722
  type: "array",
6718
6723
  required: false,
6719
- description: ""
6724
+ description: 'Array of signature attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6720
6725
  },
6721
6726
  {
6722
6727
  name: "beforePhotoAttachmentIds",
@@ -6725,7 +6730,7 @@ var operations = [
6725
6730
  source: "body",
6726
6731
  type: "array",
6727
6732
  required: false,
6728
- description: ""
6733
+ description: 'Array of before photo attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6729
6734
  },
6730
6735
  {
6731
6736
  name: "duringPhotoAttachmentIds",
@@ -6734,7 +6739,7 @@ var operations = [
6734
6739
  source: "body",
6735
6740
  type: "array",
6736
6741
  required: false,
6737
- description: ""
6742
+ description: 'Array of during photo attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6738
6743
  },
6739
6744
  {
6740
6745
  name: "afterPhotoAttachmentIds",
@@ -6743,7 +6748,7 @@ var operations = [
6743
6748
  source: "body",
6744
6749
  type: "array",
6745
6750
  required: false,
6746
- description: ""
6751
+ description: 'Array of after photo attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6747
6752
  },
6748
6753
  {
6749
6754
  name: "comment",
@@ -6770,7 +6775,7 @@ var operations = [
6770
6775
  source: "body",
6771
6776
  type: "string",
6772
6777
  required: false,
6773
- description: ""
6778
+ description: "form response ID"
6774
6779
  },
6775
6780
  {
6776
6781
  name: "fileAttachmentIds",
@@ -6779,7 +6784,7 @@ var operations = [
6779
6784
  source: "body",
6780
6785
  type: "array",
6781
6786
  required: false,
6782
- description: ""
6787
+ description: 'Array of file attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6783
6788
  },
6784
6789
  {
6785
6790
  name: "additionalFileAttachmentIds",
@@ -6788,7 +6793,7 @@ var operations = [
6788
6793
  source: "body",
6789
6794
  type: "array",
6790
6795
  required: false,
6791
- description: ""
6796
+ description: 'Array of additional file attachment IDs (comma-separated in CLI, e.g. "id1,id2")'
6792
6797
  },
6793
6798
  {
6794
6799
  name: "complete",
@@ -6826,7 +6831,7 @@ var operations = [
6826
6831
  source: "path",
6827
6832
  type: "string",
6828
6833
  required: true,
6829
- description: ""
6834
+ description: "Job ID or job number (e.g. J12345)"
6830
6835
  }
6831
6836
  ],
6832
6837
  hasRequestBody: false
@@ -6846,7 +6851,7 @@ var operations = [
6846
6851
  source: "path",
6847
6852
  type: "string",
6848
6853
  required: true,
6849
- description: ""
6854
+ description: "Job ID or job number (e.g. J12345)"
6850
6855
  }
6851
6856
  ],
6852
6857
  hasRequestBody: false
@@ -6866,7 +6871,7 @@ var operations = [
6866
6871
  source: "path",
6867
6872
  type: "string",
6868
6873
  required: true,
6869
- description: ""
6874
+ description: "Job ID or job number (e.g. J12345)"
6870
6875
  },
6871
6876
  {
6872
6877
  name: "id",
@@ -6895,7 +6900,7 @@ var operations = [
6895
6900
  source: "path",
6896
6901
  type: "string",
6897
6902
  required: true,
6898
- description: ""
6903
+ description: "Job ID or job number (e.g. J12345)"
6899
6904
  },
6900
6905
  {
6901
6906
  name: "id",
@@ -7529,7 +7534,7 @@ var operations = [
7529
7534
  source: "path",
7530
7535
  type: "string",
7531
7536
  required: true,
7532
- description: ""
7537
+ description: "Entity ID"
7533
7538
  }
7534
7539
  ],
7535
7540
  hasRequestBody: false
@@ -7549,7 +7554,7 @@ var operations = [
7549
7554
  source: "path",
7550
7555
  type: "string",
7551
7556
  required: true,
7552
- description: ""
7557
+ description: "Entity ID"
7553
7558
  }
7554
7559
  ],
7555
7560
  hasRequestBody: false
@@ -7569,7 +7574,7 @@ var operations = [
7569
7574
  source: "path",
7570
7575
  type: "string",
7571
7576
  required: true,
7572
- description: ""
7577
+ description: "Entity ID"
7573
7578
  }
7574
7579
  ],
7575
7580
  hasRequestBody: false
@@ -7589,7 +7594,7 @@ var operations = [
7589
7594
  source: "path",
7590
7595
  type: "string",
7591
7596
  required: true,
7592
- description: ""
7597
+ description: "Entity ID"
7593
7598
  }
7594
7599
  ],
7595
7600
  hasRequestBody: false
@@ -7609,7 +7614,7 @@ var operations = [
7609
7614
  source: "path",
7610
7615
  type: "string",
7611
7616
  required: true,
7612
- description: ""
7617
+ description: "Entity ID"
7613
7618
  }
7614
7619
  ],
7615
7620
  hasRequestBody: false
@@ -7629,7 +7634,7 @@ var operations = [
7629
7634
  source: "path",
7630
7635
  type: "string",
7631
7636
  required: true,
7632
- description: ""
7637
+ description: "Entity ID"
7633
7638
  }
7634
7639
  ],
7635
7640
  hasRequestBody: false
@@ -7711,7 +7716,7 @@ var operations = [
7711
7716
  source: "path",
7712
7717
  type: "string",
7713
7718
  required: true,
7714
- description: ""
7719
+ description: "run ID"
7715
7720
  },
7716
7721
  {
7717
7722
  name: "eventId",
@@ -7777,7 +7782,7 @@ var operations = [
7777
7782
  source: "path",
7778
7783
  type: "string",
7779
7784
  required: true,
7780
- description: ""
7785
+ description: "run ID"
7781
7786
  },
7782
7787
  {
7783
7788
  name: "eventId",
@@ -7844,7 +7849,7 @@ var operations = [
7844
7849
  source: "body",
7845
7850
  type: "string",
7846
7851
  required: false,
7847
- description: ""
7852
+ description: "Entity ID"
7848
7853
  },
7849
7854
  {
7850
7855
  name: "method",
@@ -8105,7 +8110,19 @@ function registerGeneratedCommands(program2) {
8105
8110
  applyCommonOptions(parent);
8106
8111
  applyOperationOptions(parent, operation.options);
8107
8112
  parent.action(async (options) => {
8108
- const outputFormat = getOutputFormat(options.output);
8113
+ if (options.describe) {
8114
+ console.log(JSON.stringify(describeOperation(operation), null, 2));
8115
+ return;
8116
+ }
8117
+ if (options.example) {
8118
+ const example = generateExample(operation);
8119
+ if (!example) {
8120
+ console.log("This command has no request body.");
8121
+ } else {
8122
+ console.log(JSON.stringify(example, null, 2));
8123
+ }
8124
+ return;
8125
+ }
8109
8126
  const config = resolveConfig({
8110
8127
  profile: options.profile,
8111
8128
  baseUrl: options.baseUrl,
@@ -8114,6 +8131,12 @@ function registerGeneratedCommands(program2) {
8114
8131
  accessToken: options.accessToken,
8115
8132
  apiVersion: options.apiVersion
8116
8133
  });
8134
+ if (options.dryRun) {
8135
+ const dryRun = buildDryRun(operation, options, config);
8136
+ console.log(JSON.stringify(dryRun, null, 2));
8137
+ return;
8138
+ }
8139
+ const outputFormat = getOutputFormat(options.output);
8117
8140
  validateRequiredOptions(operation, options);
8118
8141
  const response = await executeOperation(operation, options, config);
8119
8142
  printResponse(response, outputFormat, options.save);
@@ -8129,6 +8152,9 @@ function applyCommonOptions(command) {
8129
8152
  command.option("--api-version <version>", "WorkBuddy API version header override");
8130
8153
  command.option("--output <format>", "Output format: json, table, raw", "json");
8131
8154
  command.option("--save <file>", "Save the response body to a file");
8155
+ command.option("--describe", "Print machine-readable JSON description of this command");
8156
+ command.option("--example", "Print an example request body for this command");
8157
+ command.option("--dry-run", "Print the request that would be sent without executing it");
8132
8158
  }
8133
8159
  function applyOperationOptions(command, options) {
8134
8160
  for (const option of options) {
@@ -8145,6 +8171,97 @@ function buildOptionDescription(option) {
8145
8171
  }
8146
8172
  return parts.join(" ");
8147
8173
  }
8174
+ function describeOperation(operation) {
8175
+ return {
8176
+ operationId: operation.operationId,
8177
+ command: operation.commandPath.join(" "),
8178
+ method: operation.method,
8179
+ path: operation.path,
8180
+ description: operation.description,
8181
+ hasRequestBody: operation.hasRequestBody,
8182
+ options: operation.options.filter((o) => o.name !== "raw-body").map((option) => ({
8183
+ name: option.name,
8184
+ flag: "--" + option.cliName,
8185
+ source: option.source,
8186
+ type: option.type,
8187
+ required: option.required,
8188
+ description: option.description,
8189
+ ...option.enumValues?.length ? { enum: option.enumValues } : {},
8190
+ ...option.format ? { format: option.format } : {}
8191
+ }))
8192
+ };
8193
+ }
8194
+ function generateExample(operation) {
8195
+ const bodyOptions = operation.options.filter((o) => o.source === "body" && o.name !== "raw-body");
8196
+ if (bodyOptions.length === 0) {
8197
+ return null;
8198
+ }
8199
+ const example = {};
8200
+ for (const option of bodyOptions) {
8201
+ const key = option.bodyPath ?? option.name;
8202
+ let value;
8203
+ if (option.enumValues?.length) {
8204
+ value = option.enumValues[0];
8205
+ } else {
8206
+ switch (option.type) {
8207
+ case "integer":
8208
+ value = 1;
8209
+ break;
8210
+ case "number":
8211
+ value = 0;
8212
+ break;
8213
+ case "boolean":
8214
+ value = false;
8215
+ break;
8216
+ case "array":
8217
+ value = [];
8218
+ break;
8219
+ case "object":
8220
+ value = {};
8221
+ break;
8222
+ default:
8223
+ if (option.format === "date-time") {
8224
+ value = "2026-01-01T00:00:00Z";
8225
+ } else if (option.name.endsWith("Id") || option.name === "id") {
8226
+ value = "<" + option.name + ">";
8227
+ } else {
8228
+ value = option.description || option.name;
8229
+ }
8230
+ }
8231
+ }
8232
+ setNestedValue(example, key, value);
8233
+ }
8234
+ return example;
8235
+ }
8236
+ function buildDryRun(operation, values, config) {
8237
+ let requestPath = "/api/v2/public" + operation.path;
8238
+ for (const option of operation.options.filter((o) => o.source === "path")) {
8239
+ const rawValue = values[option.optionKey];
8240
+ if (rawValue !== undefined && rawValue !== null && rawValue !== "") {
8241
+ requestPath = requestPath.replace("{" + option.name + "}", encodeURIComponent(String(rawValue)));
8242
+ }
8243
+ }
8244
+ const queryParams = {};
8245
+ for (const option of operation.options.filter((o) => o.source === "query")) {
8246
+ const rawValue = values[option.optionKey];
8247
+ if (rawValue !== undefined && rawValue !== null && rawValue !== "") {
8248
+ queryParams[option.name] = String(rawValue);
8249
+ }
8250
+ }
8251
+ const body = buildRequestBody(operation, values);
8252
+ const url = config.baseUrl ? config.baseUrl + requestPath : requestPath;
8253
+ const queryString = Object.entries(queryParams).map(([k, v]) => k + "=" + encodeURIComponent(v)).join("&");
8254
+ return {
8255
+ method: operation.method,
8256
+ url: queryString ? url + "?" + queryString : url,
8257
+ headers: {
8258
+ "Content-Type": "application/json",
8259
+ "X-WorkBuddy-Version": config.apiVersion ?? "2026-01",
8260
+ Authorization: "Bearer <token>"
8261
+ },
8262
+ ...body !== undefined ? { body } : {}
8263
+ };
8264
+ }
8148
8265
  function validateRequiredOptions(operation, values) {
8149
8266
  const hasBody = typeof values.rawBody === "string" && values.rawBody.length > 0;
8150
8267
  const missing = operation.options.filter((option) => {