@dsptch-work/api-client 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,6 +53,27 @@ export class ApprenticeshipAllocations {
53
53
  }
54
54
  });
55
55
  }
56
+ /**
57
+ * Delete apprenticeship allocation
58
+ *
59
+ * Deletes an allocation nested under the apprentice in the path. Success is
60
+ * `204` and a later GET of the same id is not found. A missing, out-of-scope,
61
+ * or mismatched apprentice/allocation pair is `404`. Company-scoped keys may
62
+ * delete; unlike create, this operation does not require a user-scoped key.
63
+ *
64
+ *
65
+ * **Required scope:**
66
+ *
67
+ * `apprenticeship.apprentices.allocations:delete`
68
+ *
69
+ */
70
+ static deleteAllocation(options) {
71
+ return (options.client ?? client).delete({
72
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
73
+ url: '/api/v1/apprenticeship/apprentices/{apprentice_id}/allocations/{id}',
74
+ ...options
75
+ });
76
+ }
56
77
  /**
57
78
  * Show apprenticeship allocation
58
79
  *
@@ -159,6 +180,47 @@ export class ApprenticeshipOccupations {
159
180
  }
160
181
  });
161
182
  }
183
+ /**
184
+ * Delete apprenticeship occupation
185
+ *
186
+ * Deletes an unused occupation. An occupation that still has work-process
187
+ * categories, wage schedules, or trade apprenticeship links is refused
188
+ * with a `422` — remove those dependents first. An unused occupation
189
+ * returns `204` and is gone from a later GET.
190
+ *
191
+ *
192
+ * **Required scope:**
193
+ *
194
+ * `apprenticeship.programs.occupations:delete`
195
+ *
196
+ */
197
+ static deleteOccupation(options) {
198
+ return (options.client ?? client).delete({
199
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
200
+ url: '/api/v1/apprenticeship/programs/{program_id}/occupations/{id}',
201
+ ...options
202
+ });
203
+ }
204
+ /**
205
+ * Show apprenticeship occupation
206
+ *
207
+ * Returns one occupation in a program the key's company sponsors or is
208
+ * enrolled in as an employer. A missing, mismatched, or out-of-scope id
209
+ * reads as not found.
210
+ *
211
+ *
212
+ * **Required scope:**
213
+ *
214
+ * `apprenticeship.programs.occupations:read`
215
+ *
216
+ */
217
+ static getOccupation(options) {
218
+ return (options.client ?? client).get({
219
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
220
+ url: '/api/v1/apprenticeship/programs/{program_id}/occupations/{id}',
221
+ ...options
222
+ });
223
+ }
162
224
  /**
163
225
  * Update apprenticeship occupation
164
226
  *
@@ -284,6 +346,45 @@ export class ApprenticeshipPrograms {
284
346
  }
285
347
  });
286
348
  }
349
+ /**
350
+ * Delete apprenticeship program
351
+ *
352
+ * Deletes an unused program. A program that still has occupations is refused
353
+ * with a `422` — remove those occupations first. An unused program returns
354
+ * `204` and is gone from a later GET.
355
+ *
356
+ *
357
+ * **Required scope:**
358
+ *
359
+ * `apprenticeship.programs:delete`
360
+ *
361
+ */
362
+ static deleteProgram(options) {
363
+ return (options.client ?? client).delete({
364
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
365
+ url: '/api/v1/apprenticeship/programs/{id}',
366
+ ...options
367
+ });
368
+ }
369
+ /**
370
+ * Show apprenticeship program
371
+ *
372
+ * Returns one program the key's company sponsors or is enrolled in as an
373
+ * employer. A missing or out-of-scope id reads as not found.
374
+ *
375
+ *
376
+ * **Required scope:**
377
+ *
378
+ * `apprenticeship.programs:read`
379
+ *
380
+ */
381
+ static getProgram(options) {
382
+ return (options.client ?? client).get({
383
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
384
+ url: '/api/v1/apprenticeship/programs/{id}',
385
+ ...options
386
+ });
387
+ }
287
388
  /**
288
389
  * Update apprenticeship program
289
390
  *
@@ -394,6 +495,49 @@ export class ApprenticeshipWageSchedules {
394
495
  }
395
496
  });
396
497
  }
498
+ /**
499
+ * Delete apprenticeship wage schedule
500
+ *
501
+ * Deletes an unused wage schedule nested under the occupation in the path.
502
+ * A schedule that still has apprentices is refused with a `422`. An unused
503
+ * schedule returns `204`. Deletes are sponsor-only; an enrolled employer is
504
+ * `403`. A missing, out-of-scope, or mismatched occupation/schedule pair is
505
+ * `404`. Periods on the schedule are removed with it.
506
+ *
507
+ *
508
+ * **Required scope:**
509
+ *
510
+ * `apprenticeship.occupations.wage_schedules:delete`
511
+ *
512
+ */
513
+ static deleteWageSchedule(options) {
514
+ return (options.client ?? client).delete({
515
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
516
+ url: '/api/v1/apprenticeship/occupations/{occupation_id}/wage_schedules/{id}',
517
+ ...options
518
+ });
519
+ }
520
+ /**
521
+ * Show apprenticeship wage schedule
522
+ *
523
+ * Returns one wage schedule nested under the occupation in the path. The
524
+ * object matches the list, create, and update door. A missing, out-of-scope,
525
+ * or mismatched occupation/schedule pair is not found. Nested periods are a
526
+ * separate resource.
527
+ *
528
+ *
529
+ * **Required scope:**
530
+ *
531
+ * `apprenticeship.occupations.wage_schedules:read`
532
+ *
533
+ */
534
+ static getWageSchedule(options) {
535
+ return (options.client ?? client).get({
536
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
537
+ url: '/api/v1/apprenticeship/occupations/{occupation_id}/wage_schedules/{id}',
538
+ ...options
539
+ });
540
+ }
397
541
  /**
398
542
  * Update apprenticeship wage schedule
399
543
  *
@@ -2187,6 +2331,46 @@ export class CompaniesDepartments {
2187
2331
  }
2188
2332
  });
2189
2333
  }
2334
+ /**
2335
+ * Delete department
2336
+ *
2337
+ * Deletes a department that has no employment assignments. A department still
2338
+ * assigned on any employment is refused with a `422` — reassign those
2339
+ * employments first. An unused department returns `204` and is gone from a
2340
+ * later GET.
2341
+ *
2342
+ *
2343
+ * **Required scope:**
2344
+ *
2345
+ * `companies.departments:delete`
2346
+ *
2347
+ */
2348
+ static deleteDepartment(options) {
2349
+ return (options.client ?? client).delete({
2350
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
2351
+ url: '/api/v1/companies/departments/{id}',
2352
+ ...options
2353
+ });
2354
+ }
2355
+ /**
2356
+ * Show department
2357
+ *
2358
+ * Returns one department owned by the key's company. A missing or out-of-scope
2359
+ * id reads as not found.
2360
+ *
2361
+ *
2362
+ * **Required scope:**
2363
+ *
2364
+ * `companies.departments:read`
2365
+ *
2366
+ */
2367
+ static getDepartment(options) {
2368
+ return (options.client ?? client).get({
2369
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
2370
+ url: '/api/v1/companies/departments/{id}',
2371
+ ...options
2372
+ });
2373
+ }
2190
2374
  /**
2191
2375
  * Update department
2192
2376
  *
@@ -3358,6 +3542,47 @@ export class Jobs {
3358
3542
  }
3359
3543
  });
3360
3544
  }
3545
+ /**
3546
+ * Delete position on job
3547
+ *
3548
+ * Deletes a position that has no logged work and no restricting
3549
+ * associations. A position still referenced by time entries,
3550
+ * time-card per diems, completion positions, or aggregate logged
3551
+ * work is refused with a `422`. An unused position returns `204`
3552
+ * and is gone from a later GET.
3553
+ *
3554
+ *
3555
+ * **Required scope:**
3556
+ *
3557
+ * `jobs.positions:delete`
3558
+ *
3559
+ */
3560
+ static deletePosition(options) {
3561
+ return (options.client ?? client).delete({
3562
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
3563
+ url: '/api/v1/jobs/{job_id}/positions/{id}',
3564
+ ...options
3565
+ });
3566
+ }
3567
+ /**
3568
+ * Show position on job
3569
+ *
3570
+ * Returns one position on the named job. A missing, misnested, or
3571
+ * out-of-scope id reads as not found.
3572
+ *
3573
+ *
3574
+ * **Required scope:**
3575
+ *
3576
+ * `jobs.positions:read`
3577
+ *
3578
+ */
3579
+ static getPosition(options) {
3580
+ return (options.client ?? client).get({
3581
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
3582
+ url: '/api/v1/jobs/{job_id}/positions/{id}',
3583
+ ...options
3584
+ });
3585
+ }
3361
3586
  /**
3362
3587
  * Update position on job
3363
3588
  *
@@ -4045,6 +4270,27 @@ export class PayRateRulePackages {
4045
4270
  }
4046
4271
  });
4047
4272
  }
4273
+ /**
4274
+ * Delete a pay rate rule package
4275
+ *
4276
+ * Permanently remove a pay rate rule package. An unused package (no rules,
4277
+ * positions, job or project wage determinations, or employments) returns
4278
+ * `204` and is gone from a later GET. A package still referenced is refused
4279
+ * with `422` `destroy_restricted`.
4280
+ *
4281
+ *
4282
+ * **Required scope:**
4283
+ *
4284
+ * `pay.rates.rule_packages:delete`
4285
+ *
4286
+ */
4287
+ static deletePayRateRulePackage(options) {
4288
+ return (options.client ?? client).delete({
4289
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4290
+ url: '/api/v1/pay/rates/rule_packages/{id}',
4291
+ ...options
4292
+ });
4293
+ }
4048
4294
  /**
4049
4295
  * Get a pay rate rule package
4050
4296
  *
@@ -4060,6 +4306,30 @@ export class PayRateRulePackages {
4060
4306
  ...options
4061
4307
  });
4062
4308
  }
4309
+ /**
4310
+ * Update a pay rate rule package
4311
+ *
4312
+ * Rename or re-describe a pay rate rule package. Only supplied fields change.
4313
+ * `default`, `selectable`, and `scoped_to_job_id` are not writable — those
4314
+ * remain the values set at create (or by the web door).
4315
+ *
4316
+ *
4317
+ * **Required scope:**
4318
+ *
4319
+ * `pay.rates.rule_packages:update`
4320
+ *
4321
+ */
4322
+ static updatePayRateRulePackage(options) {
4323
+ return (options.client ?? client).patch({
4324
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4325
+ url: '/api/v1/pay/rates/rule_packages/{id}',
4326
+ ...options,
4327
+ headers: {
4328
+ 'Content-Type': 'application/json',
4329
+ ...options.headers
4330
+ }
4331
+ });
4332
+ }
4063
4333
  }
4064
4334
  export class AggregateTimeImports {
4065
4335
  /**
@@ -4848,9 +5118,10 @@ export class People {
4848
5118
  /**
4849
5119
  * Schedule an employment change
4850
5120
  *
4851
- * Create one strictly future employment-version boundary. `effective_date` is
4852
- * interpreted at midnight in the credential company's time zone. This operation
4853
- * cannot move or replace an existing boundary.
5121
+ * Create one employment-version boundary. `effective_date` is interpreted at
5122
+ * midnight in the credential company's time zone. Today and past dates must fall
5123
+ * inside the family's latest version; future dates retain the existing scheduling
5124
+ * behavior. This operation cannot move or replace an existing boundary.
4854
5125
  *
4855
5126
  * Conditional: send the employment's `ETag` as `If-Match`.
4856
5127
  *
@@ -4895,8 +5166,9 @@ export class People {
4895
5166
  /**
4896
5167
  * Edit an employment change at an exact boundary
4897
5168
  *
4898
- * Change values at the exact strictly future boundary named by the path. The
4899
- * boundary itself never moves; a date inside a version does not identify it.
5169
+ * Change values at the exact boundary named by the path. A boundary at today
5170
+ * or an earlier date must start the family's latest version. The boundary
5171
+ * itself never moves; a date inside a version does not identify it.
4900
5172
  *
4901
5173
  * Conditional: send the employment's `ETag` as `If-Match`.
4902
5174
  *
@@ -5492,6 +5764,25 @@ export class Users {
5492
5764
  }
5493
5765
  });
5494
5766
  }
5767
+ /**
5768
+ * Delete PWA company user details
5769
+ *
5770
+ * Deletes the PWA company-user details row. A missing or out-of-scope
5771
+ * id reads as not found. Delete removes the row; it does not archive.
5772
+ *
5773
+ *
5774
+ * **Required scope:**
5775
+ *
5776
+ * `pwa.company_user_details:delete`
5777
+ *
5778
+ */
5779
+ static deleteCompanyUserDetail(options) {
5780
+ return (options.client ?? client).delete({
5781
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
5782
+ url: '/api/v1/pwa/company_user_details/{id}',
5783
+ ...options
5784
+ });
5785
+ }
5495
5786
  /**
5496
5787
  * Update PWA company user details
5497
5788
  *
@@ -6202,7 +6493,10 @@ export class TimeEntries {
6202
6493
  * company's default timecodes), state, description, hourly_rate_cents (derived
6203
6494
  * from the position/user default when omitted), and feature_ids. Supplying
6204
6495
  * feature_ids — or setting feature_allocation_acknowledged true — satisfies a
6205
- * job that requires a feature allocation.
6496
+ * job that requires a feature allocation. A user-scoped key may send
6497
+ * hourly_rate_cents only when its user is an admin in the entry's company;
6498
+ * any other user-scoped key that sends it, null included, is forbidden (403)
6499
+ * and nothing is created.
6206
6500
  *
6207
6501
  *
6208
6502
  * **Required scope:**
@@ -6244,6 +6538,28 @@ export class TimeEntries {
6244
6538
  ...options
6245
6539
  });
6246
6540
  }
6541
+ /**
6542
+ * Show time entry
6543
+ *
6544
+ * Fetch one time entry by id. The response is the same object the list,
6545
+ * create, and update doors serialize. An entry outside the key's read
6546
+ * scope is not found (404), including a colleague's entry for a
6547
+ * technician or field-lead key — even when that entry is writable via
6548
+ * PATCH.
6549
+ *
6550
+ *
6551
+ * **Required scope:**
6552
+ *
6553
+ * `time_entries:read`
6554
+ *
6555
+ */
6556
+ static getTimeEntry(options) {
6557
+ return (options.client ?? client).get({
6558
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
6559
+ url: '/api/v1/time_entries/{id}',
6560
+ ...options
6561
+ });
6562
+ }
6247
6563
  /**
6248
6564
  * Update time entry
6249
6565
  *
@@ -6256,7 +6572,9 @@ export class TimeEntries {
6256
6572
  * 422 unless confirm_allocation_conflict is sent true. The feature-allocation cap is
6257
6573
  * enforced, and because a persisted feature_ids= writes its join rows
6258
6574
  * immediately, a rejected save rolls them back within the enclosing
6259
- * transaction.
6575
+ * transaction. A user-scoped key may send hourly_rate_cents only when its user
6576
+ * is an admin in the entry's company; any other user-scoped key that sends
6577
+ * it, null included, is forbidden (403) and the entry is left unchanged.
6260
6578
  *
6261
6579
  *
6262
6580
  * **Required scope:**