@dsptch-work/api-client 0.17.0 → 0.19.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.
@@ -18,6 +18,57 @@ export class ApiKeyScopes {
18
18
  });
19
19
  }
20
20
  }
21
+ export class ApprenticeshipAllocations {
22
+ /**
23
+ * List apprenticeship allocations
24
+ *
25
+ * **Required scope:**
26
+ *
27
+ * `apprenticeship.apprentices.allocations:read`
28
+ *
29
+ */
30
+ static listAllocations(options) {
31
+ return (options.client ?? client).get({
32
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
33
+ url: '/api/v1/apprenticeship/apprentices/{apprentice_id}/allocations',
34
+ ...options
35
+ });
36
+ }
37
+ /**
38
+ * Show apprenticeship allocation
39
+ *
40
+ * **Required scope:**
41
+ *
42
+ * `apprenticeship.apprentices.allocations:read`
43
+ *
44
+ */
45
+ static getAllocation(options) {
46
+ return (options.client ?? client).get({
47
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
48
+ url: '/api/v1/apprenticeship/apprentices/{apprentice_id}/allocations/{id}',
49
+ ...options
50
+ });
51
+ }
52
+ /**
53
+ * Update apprenticeship allocation effective date
54
+ *
55
+ * **Required scope:**
56
+ *
57
+ * `apprenticeship.apprentices.allocations:update`
58
+ *
59
+ */
60
+ static updateAllocation(options) {
61
+ return (options.client ?? client).patch({
62
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
63
+ url: '/api/v1/apprenticeship/apprentices/{apprentice_id}/allocations/{id}',
64
+ ...options,
65
+ headers: {
66
+ 'Content-Type': 'application/json',
67
+ ...options.headers
68
+ }
69
+ });
70
+ }
71
+ }
21
72
  export class ApprenticeshipApprentices {
22
73
  /**
23
74
  * List apprenticeship apprentices
@@ -4310,6 +4361,82 @@ export class Paystubs {
4310
4361
  });
4311
4362
  }
4312
4363
  }
4364
+ export class People {
4365
+ /**
4366
+ * List employment history
4367
+ *
4368
+ * Every valid-time version of one employment stint, newest first. Each
4369
+ * entry uses `people_employment_id` rather than an entry-level id and
4370
+ * includes prior recorded corrections.
4371
+ *
4372
+ *
4373
+ * **Required scope:**
4374
+ *
4375
+ * `people.employments.history:read`
4376
+ *
4377
+ */
4378
+ static listEmploymentHistory(options) {
4379
+ return (options.client ?? client).get({
4380
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4381
+ url: '/api/v1/people/employments/{employment_id}/history',
4382
+ ...options
4383
+ });
4384
+ }
4385
+ /**
4386
+ * List employment histories
4387
+ *
4388
+ * Employment history across all authorized stints in the credential
4389
+ * company, including ended stints and rehired employments.
4390
+ *
4391
+ *
4392
+ * **Required scope:**
4393
+ *
4394
+ * `people.employments.history:read`
4395
+ *
4396
+ */
4397
+ static listEmploymentsHistory(options) {
4398
+ return (options?.client ?? client).get({
4399
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4400
+ url: '/api/v1/people/employments/history',
4401
+ ...options
4402
+ });
4403
+ }
4404
+ /**
4405
+ * List employments
4406
+ *
4407
+ * Current employments in the credential company, or versions at
4408
+ * `as_of[valid]`. A user key sees its own records unless it is a
4409
+ * company administrator.
4410
+ *
4411
+ *
4412
+ * **Required scope:**
4413
+ *
4414
+ * `people.employments:read`
4415
+ *
4416
+ */
4417
+ static listEmployments(options) {
4418
+ return (options?.client ?? client).get({
4419
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4420
+ url: '/api/v1/people/employments',
4421
+ ...options
4422
+ });
4423
+ }
4424
+ /**
4425
+ * Get employment
4426
+ *
4427
+ * **Required scope:**
4428
+ *
4429
+ * `people.employments:read`
4430
+ *
4431
+ */
4432
+ static getEmployment(options) {
4433
+ return (options.client ?? client).get({
4434
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4435
+ url: '/api/v1/people/employments/{id}',
4436
+ ...options
4437
+ });
4438
+ }
4439
+ }
4313
4440
  export class PerDiems {
4314
4441
  /**
4315
4442
  * List per diems
@@ -4615,10 +4742,11 @@ export class Projects {
4615
4742
  * Create a project owned by the API key's company (owned_by_company_id is set
4616
4743
  * automatically from the key). Requires `name`, and `created_by_user_id` must
4617
4744
  * reference a member of the owning company. `budget_currency` defaults to USD;
4618
- * when `federal_pwa_mode` is `none`, `asset_owner` is forced to false and the
4619
- * federal-PWA-only fields (administrator name/email/phone, budget, and the
4745
+ * the federal-PWA-only fields (administrator name/email/phone, budget, and the
4620
4746
  * prevailing-wage lock-in / beginning-of-construction / placed-in-service dates)
4621
- * are dropped. Returns 201 with the created project; a duplicate name within the
4747
+ * and `asset_owner` apply only while `federal_pwa_mode` is not `none`, so sending
4748
+ * one of them on a project that tracks no federal PWA — even as null — returns
4749
+ * 422. Returns 201 with the created project; a duplicate name within the
4622
4750
  * company, a creator outside the owning company, end_date before start_date, an
4623
4751
  * unknown PWA mode, an unparseable date, or a regional mode without a region each
4624
4752
  * return 422.
@@ -4664,9 +4792,11 @@ export class Projects {
4664
4792
  *
4665
4793
  * Update a project's attributes. `name` cannot be blanked, and
4666
4794
  * `created_by_user_id` is immutable — any request that sets, changes, or clears it
4667
- * returns 422. Switching `federal_pwa_mode` to `none` forces `asset_owner` false
4668
- * and drops the federal-PWA-only params (previously persisted values are left
4669
- * untouched); `budget_currency` defaults to USD when blank. A project owned by
4795
+ * returns 422. The federal-PWA-only fields (administrator contact, budget, IRA
4796
+ * dates) and `asset_owner` apply only while `federal_pwa_mode` is not `none`:
4797
+ * switching it to `none` clears the stored values and forces `asset_owner`
4798
+ * false, and sending one of them while federal tracking is off — even as null —
4799
+ * returns 422. `budget_currency` defaults to USD when blank. A project owned by
4670
4800
  * another company, or an unknown id, returns 404.
4671
4801
  *
4672
4802
  *
@@ -6052,6 +6182,52 @@ export class TimeCardActuals {
6052
6182
  });
6053
6183
  }
6054
6184
  }
6185
+ export class TimeSessions {
6186
+ /**
6187
+ * List time sessions
6188
+ *
6189
+ * List the company's time sessions — one per clock-in, open while the worker is
6190
+ * clocked in (`active: true`) and retained once they clock out (`active: false`).
6191
+ * A worker holds at most one active session, so `filter[active]=true` answers
6192
+ * who is clocked in right now. Results are ordered by start_time then id
6193
+ * (ascending) and cursor-paginated. Narrow with filter[user_id], filter[job_id]
6194
+ * (or filter[job_id][null]=true for sessions with no job), and filter[active];
6195
+ * the controller also accepts gte/lte time-range filters on start_time,
6196
+ * created_at, and updated_at.
6197
+ *
6198
+ *
6199
+ * **Required scope:**
6200
+ *
6201
+ * `timekeeping.time_sessions:read`
6202
+ *
6203
+ */
6204
+ static listTimeSessions(options) {
6205
+ return (options?.client ?? client).get({
6206
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
6207
+ url: '/api/v1/timekeeping/time_sessions',
6208
+ ...options
6209
+ });
6210
+ }
6211
+ /**
6212
+ * Show time session
6213
+ *
6214
+ * Fetch one time session by id. `active` says whether the worker is still
6215
+ * clocked in on it.
6216
+ *
6217
+ *
6218
+ * **Required scope:**
6219
+ *
6220
+ * `timekeeping.time_sessions:read`
6221
+ *
6222
+ */
6223
+ static getTimeSession(options) {
6224
+ return (options.client ?? client).get({
6225
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
6226
+ url: '/api/v1/timekeeping/time_sessions/{id}',
6227
+ ...options
6228
+ });
6229
+ }
6230
+ }
6055
6231
  export class Todos {
6056
6232
  /**
6057
6233
  * List Todos
@@ -6135,6 +6311,40 @@ export class UserRoles {
6135
6311
  }
6136
6312
  }
6137
6313
  export class WageDeterminations {
6314
+ /**
6315
+ * List boundary links
6316
+ *
6317
+ * Company and user keys require the paid wage determinations entitlement on the acting company. Trusted application keys bypass this product gate.
6318
+ *
6319
+ * **Required scope:**
6320
+ *
6321
+ * `wage_determinations.boundaries:read`
6322
+ *
6323
+ */
6324
+ static listBoundaries(options) {
6325
+ return (options.client ?? client).get({
6326
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
6327
+ url: '/api/v1/wage_determinations/{wage_determination_id}/boundaries',
6328
+ ...options
6329
+ });
6330
+ }
6331
+ /**
6332
+ * List construction types
6333
+ *
6334
+ * Company and user keys require the paid wage determinations entitlement on the acting company. Trusted application keys bypass this product gate.
6335
+ *
6336
+ * **Required scope:**
6337
+ *
6338
+ * `wage_determinations.construction_types:read`
6339
+ *
6340
+ */
6341
+ static listConstructionTypes(options) {
6342
+ return (options.client ?? client).get({
6343
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
6344
+ url: '/api/v1/wage_determinations/{wage_determination_id}/construction_types',
6345
+ ...options
6346
+ });
6347
+ }
6138
6348
  /**
6139
6349
  * List labor rates
6140
6350
  *
@@ -6152,6 +6362,57 @@ export class WageDeterminations {
6152
6362
  ...options
6153
6363
  });
6154
6364
  }
6365
+ /**
6366
+ * List project types
6367
+ *
6368
+ * Company and user keys require the paid wage determinations entitlement on the acting company. Trusted application keys bypass this product gate.
6369
+ *
6370
+ * **Required scope:**
6371
+ *
6372
+ * `wage_determinations.project_types:read`
6373
+ *
6374
+ */
6375
+ static listProjectTypes(options) {
6376
+ return (options.client ?? client).get({
6377
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
6378
+ url: '/api/v1/wage_determinations/{wage_determination_id}/project_types',
6379
+ ...options
6380
+ });
6381
+ }
6382
+ /**
6383
+ * List reference items
6384
+ *
6385
+ * Company and user keys require the paid wage determinations entitlement on the acting company. Trusted application keys bypass this product gate.
6386
+ *
6387
+ * **Required scope:**
6388
+ *
6389
+ * `wage_determinations.reference_items:read`
6390
+ *
6391
+ */
6392
+ static listReferenceItems(options) {
6393
+ return (options.client ?? client).get({
6394
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
6395
+ url: '/api/v1/wage_determinations/{wage_determination_id}/reference_items',
6396
+ ...options
6397
+ });
6398
+ }
6399
+ /**
6400
+ * List wage classifications
6401
+ *
6402
+ * Company and user keys require the paid wage determinations entitlement on the acting company. Trusted application keys bypass this product gate.
6403
+ *
6404
+ * **Required scope:**
6405
+ *
6406
+ * `wage_determinations.wage_classifications:read`
6407
+ *
6408
+ */
6409
+ static listWageClassifications(options) {
6410
+ return (options.client ?? client).get({
6411
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
6412
+ url: '/api/v1/wage_determinations/{wage_determination_id}/wage_classifications',
6413
+ ...options
6414
+ });
6415
+ }
6155
6416
  /**
6156
6417
  * List wage determinations
6157
6418
  *