@dsptch-work/api-client 0.36.0 → 0.38.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.
@@ -1385,6 +1385,10 @@ export class AssetsItems {
1385
1385
  /**
1386
1386
  * Delete document
1387
1387
  *
1388
+ * Permanently deletes the document (`destroy!`). Succeeds with 204 and no
1389
+ * body. A document that belongs to another item is 404.
1390
+ *
1391
+ *
1388
1392
  * **Required scope:**
1389
1393
  *
1390
1394
  * `assets.items.documents:delete`
@@ -2618,39 +2622,39 @@ export class CompetenciesAssessments {
2618
2622
  });
2619
2623
  }
2620
2624
  }
2621
- export class CompetenciesAssessmentKeyActivities {
2625
+ export class CompetenciesAssessmentCriteria {
2622
2626
  /**
2623
- * List assessment key activities
2627
+ * List assessment criteria
2624
2628
  *
2625
- * Lists the task lines snapshotted onto an assessment. decision and
2629
+ * Lists the criterion lines snapshotted onto an assessment. decision and
2626
2630
  * qa_feedback are omitted when the caller is the candidate and the
2627
2631
  * package is not yet decided.
2628
2632
  *
2629
2633
  *
2630
2634
  * **Required scope:**
2631
2635
  *
2632
- * `competencies.assessments.key_activities:read`
2636
+ * `competencies.assessments.criteria:read`
2633
2637
  *
2634
2638
  */
2635
- static listAssessmentKeyActivities(options) {
2639
+ static listAssessmentCriteria(options) {
2636
2640
  return (options.client ?? client).get({
2637
2641
  security: [{ name: 'X-Api-Key', type: 'apiKey' }],
2638
- url: '/api/v1/competencies/assessments/{assessment_id}/key_activities',
2642
+ url: '/api/v1/competencies/assessments/{assessment_id}/criteria',
2639
2643
  ...options
2640
2644
  });
2641
2645
  }
2642
2646
  /**
2643
- * Show assessment key activity
2647
+ * Show assessment criterion
2644
2648
  *
2645
2649
  * **Required scope:**
2646
2650
  *
2647
- * `competencies.assessments.key_activities:read`
2651
+ * `competencies.assessments.criteria:read`
2648
2652
  *
2649
2653
  */
2650
- static getAssessmentKeyActivity(options) {
2654
+ static getAssessmentCriterion(options) {
2651
2655
  return (options.client ?? client).get({
2652
2656
  security: [{ name: 'X-Api-Key', type: 'apiKey' }],
2653
- url: '/api/v1/competencies/assessments/{assessment_id}/key_activities/{id}',
2657
+ url: '/api/v1/competencies/assessments/{assessment_id}/criteria/{id}',
2654
2658
  ...options
2655
2659
  });
2656
2660
  }
@@ -2663,13 +2667,13 @@ export class CompetenciesEvidenceItems {
2663
2667
  *
2664
2668
  * **Required scope:**
2665
2669
  *
2666
- * `competencies.assessments.key_activities.evidence_items:read`
2670
+ * `competencies.assessments.criteria.evidence_items:read`
2667
2671
  *
2668
2672
  */
2669
2673
  static listEvidenceItems(options) {
2670
2674
  return (options.client ?? client).get({
2671
2675
  security: [{ name: 'X-Api-Key', type: 'apiKey' }],
2672
- url: '/api/v1/competencies/assessments/{assessment_id}/key_activities/{key_activity_id}/evidence_items',
2676
+ url: '/api/v1/competencies/assessments/{assessment_id}/criteria/{criterion_id}/evidence_items',
2673
2677
  ...options
2674
2678
  });
2675
2679
  }
@@ -2678,13 +2682,13 @@ export class CompetenciesEvidenceItems {
2678
2682
  *
2679
2683
  * **Required scope:**
2680
2684
  *
2681
- * `competencies.assessments.key_activities.evidence_items:read`
2685
+ * `competencies.assessments.criteria.evidence_items:read`
2682
2686
  *
2683
2687
  */
2684
2688
  static getEvidenceItem(options) {
2685
2689
  return (options.client ?? client).get({
2686
2690
  security: [{ name: 'X-Api-Key', type: 'apiKey' }],
2687
- url: '/api/v1/competencies/assessments/{assessment_id}/key_activities/{key_activity_id}/evidence_items/{id}',
2691
+ url: '/api/v1/competencies/assessments/{assessment_id}/criteria/{criterion_id}/evidence_items/{id}',
2688
2692
  ...options
2689
2693
  });
2690
2694
  }
@@ -3807,6 +3811,113 @@ export class Groups {
3807
3811
  }
3808
3812
  }
3809
3813
  export class Jobs {
3814
+ /**
3815
+ * List documents for job
3816
+ *
3817
+ * Returns documents on the named job, including PWA documentation
3818
+ * the caller may see. `{id}` is the job document. A missing or
3819
+ * out-of-scope job reads as not found. Admin-only documents are
3820
+ * omitted when the key cannot see job financials.
3821
+ *
3822
+ *
3823
+ * **Required scope:**
3824
+ *
3825
+ * `jobs.documents:read`
3826
+ *
3827
+ */
3828
+ static listJobDocuments(options) {
3829
+ return (options.client ?? client).get({
3830
+ querySerializer: { parameters: { 'filter[type]': { array: { explode: false } } } },
3831
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
3832
+ url: '/api/v1/jobs/{job_id}/documents',
3833
+ ...options
3834
+ });
3835
+ }
3836
+ /**
3837
+ * Create document for job
3838
+ *
3839
+ * Creates a document on the named job. `job_id` is the path only.
3840
+ * Supply exactly one of `url` or `file`. `PWA_DOCUMENTATION` is
3841
+ * persisted as admin-only.
3842
+ *
3843
+ *
3844
+ * **Required scope:**
3845
+ *
3846
+ * `jobs.documents:create`
3847
+ *
3848
+ */
3849
+ static createJobDocument(options) {
3850
+ return (options.client ?? client).post({
3851
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
3852
+ url: '/api/v1/jobs/{job_id}/documents',
3853
+ ...options,
3854
+ headers: {
3855
+ 'Content-Type': 'application/json',
3856
+ ...options.headers
3857
+ }
3858
+ });
3859
+ }
3860
+ /**
3861
+ * Delete document on job
3862
+ *
3863
+ * Removes the job document. A missing or misnested id reads as
3864
+ * not found.
3865
+ *
3866
+ *
3867
+ * **Required scope:**
3868
+ *
3869
+ * `jobs.documents:delete`
3870
+ *
3871
+ */
3872
+ static deleteJobDocument(options) {
3873
+ return (options.client ?? client).delete({
3874
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
3875
+ url: '/api/v1/jobs/{job_id}/documents/{id}',
3876
+ ...options
3877
+ });
3878
+ }
3879
+ /**
3880
+ * Show document on job
3881
+ *
3882
+ * Returns one document on the named job. A missing, misnested, or
3883
+ * unauthorized admin-only id reads as not found.
3884
+ *
3885
+ *
3886
+ * **Required scope:**
3887
+ *
3888
+ * `jobs.documents:read`
3889
+ *
3890
+ */
3891
+ static getJobDocument(options) {
3892
+ return (options.client ?? client).get({
3893
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
3894
+ url: '/api/v1/jobs/{job_id}/documents/{id}',
3895
+ ...options
3896
+ });
3897
+ }
3898
+ /**
3899
+ * Update document on job
3900
+ *
3901
+ * Updates a document on the named job. Omit a field to preserve
3902
+ * it. The document must remain exactly one of `url` or `file`.
3903
+ *
3904
+ *
3905
+ * **Required scope:**
3906
+ *
3907
+ * `jobs.documents:update`
3908
+ *
3909
+ */
3910
+ static updateJobDocument(options) {
3911
+ return (options.client ?? client).patch({
3912
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
3913
+ url: '/api/v1/jobs/{job_id}/documents/{id}',
3914
+ ...options,
3915
+ headers: {
3916
+ 'Content-Type': 'application/json',
3917
+ ...options.headers
3918
+ }
3919
+ });
3920
+ }
3810
3921
  /**
3811
3922
  * List form assignment tasks for job
3812
3923
  *
@@ -4277,7 +4388,7 @@ export class ProductionJobScopePrices {
4277
4388
  * Scope prices on a production-tracked job. Company keys,
4278
4389
  * and user keys held by an administrator, manager, safety
4279
4390
  * manager, or field lead of the company that owns the job,
4280
- * receive `unit_price` and `contracted_count`. Other user
4391
+ * receive `unit_price_cents` and `contracted_count`. Other user
4281
4392
  * keys, held by crew on the job, receive the same rows
4282
4393
  * without those two fields.
4283
4394
  *
@@ -4298,9 +4409,10 @@ export class ProductionJobScopePrices {
4298
4409
  * Create production job scope price
4299
4410
  *
4300
4411
  * Creates a scope price on the URL's job. The body accepts only `scope_kind`,
4301
- * `unit_price`, `contracted_count`, and `unit_of_measure`. Undeclared keys or a
4302
- * missing `scope_kind` or `unit_price` return `400`, and a null or wrong-typed
4303
- * value returns `422`, without creating a price.
4412
+ * `unit_price_cents`, `contracted_count`, and `unit_of_measure`. Undeclared keys,
4413
+ * including the retired dollar `unit_price`, or a missing `scope_kind` or
4414
+ * `unit_price_cents` return `400`, and a null or wrong-typed value returns `422`,
4415
+ * without creating a price.
4304
4416
  *
4305
4417
  *
4306
4418
  * **Required scope:**
@@ -4340,7 +4452,7 @@ export class ProductionJobScopePrices {
4340
4452
  * One scope price on a production-tracked job. Company keys,
4341
4453
  * and user keys held by an administrator, manager, safety
4342
4454
  * manager, or field lead of the company that owns the job,
4343
- * receive `unit_price` and `contracted_count`. Other user
4455
+ * receive `unit_price_cents` and `contracted_count`. Other user
4344
4456
  * keys, held by crew on the job, receive the price without
4345
4457
  * those two fields.
4346
4458
  *
@@ -4360,10 +4472,11 @@ export class ProductionJobScopePrices {
4360
4472
  /**
4361
4473
  * Update production job scope price
4362
4474
  *
4363
- * Updates only the supplied `scope_kind`, `unit_price`, `contracted_count`,
4475
+ * Updates only the supplied `scope_kind`, `unit_price_cents`, `contracted_count`,
4364
4476
  * and `unit_of_measure`; a null `contracted_count` clears it. Undeclared body
4365
- * keys return `400`, and a null or wrong-typed value elsewhere returns `422`,
4366
- * without changing the scope price. The job stays on the URL.
4477
+ * keys, including the retired dollar `unit_price`, return `400`, and a null or
4478
+ * wrong-typed value elsewhere returns `422`, without changing the scope price.
4479
+ * The job stays on the URL.
4367
4480
  *
4368
4481
  *
4369
4482
  * **Required scope:**
@@ -7562,6 +7675,102 @@ export class ProjectSites {
7562
7675
  });
7563
7676
  }
7564
7677
  }
7678
+ export class ProjectUserVisibilities {
7679
+ /**
7680
+ * List project user visibilities
7681
+ *
7682
+ * Returns the project's user-visibility joins (`Projects::UserVisibility`).
7683
+ * Path `{id}` on the member routes is the join id. Nested under the
7684
+ * authorized project. Reads are owner-only: rows are listed only to the
7685
+ * restricting owner's company key, or to a user key the owner issued to
7686
+ * one of its admins. Any other caller that can GET the project lists
7687
+ * nothing, the owner's own keys included while it does not restrict.
7688
+ *
7689
+ *
7690
+ * **Required scope:**
7691
+ *
7692
+ * `projects.user_visibilities:read`
7693
+ *
7694
+ */
7695
+ static listUserVisibilities(options) {
7696
+ return (options.client ?? client).get({
7697
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
7698
+ url: '/api/v1/projects/{project_id}/user_visibilities',
7699
+ ...options
7700
+ });
7701
+ }
7702
+ /**
7703
+ * Create a project user visibility
7704
+ *
7705
+ * Names a person on the project. `user_id` is required and must hold a
7706
+ * manager, safety manager, or field lead role at the owner. The project
7707
+ * is taken from the path. Duplicate `(project, user)` pairs are 422. A
7708
+ * user the key cannot see is 404. Writes are owner-only while the owner
7709
+ * restricts project visibility: only its company key, or a user key it
7710
+ * issued to one of its admins, may name a person. Any other caller that
7711
+ * can GET the project receives 403.
7712
+ *
7713
+ *
7714
+ * **Required scope:**
7715
+ *
7716
+ * `projects.user_visibilities:create`
7717
+ *
7718
+ */
7719
+ static createUserVisibility(options) {
7720
+ return (options.client ?? client).post({
7721
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
7722
+ url: '/api/v1/projects/{project_id}/user_visibilities',
7723
+ ...options,
7724
+ headers: {
7725
+ 'Content-Type': 'application/json',
7726
+ ...options.headers
7727
+ }
7728
+ });
7729
+ }
7730
+ /**
7731
+ * Delete a project user visibility
7732
+ *
7733
+ * Removes this project's user-visibility join. Descendant projects' rows
7734
+ * for the same person stay put. Writes are owner-only while the owner
7735
+ * restricts project visibility: only its company key, or a user key it
7736
+ * issued to one of its admins, may remove a row. For any other caller
7737
+ * the row is 404, as an unknown id is.
7738
+ *
7739
+ *
7740
+ * **Required scope:**
7741
+ *
7742
+ * `projects.user_visibilities:delete`
7743
+ *
7744
+ */
7745
+ static deleteUserVisibility(options) {
7746
+ return (options.client ?? client).delete({
7747
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
7748
+ url: '/api/v1/projects/{project_id}/user_visibilities/{id}',
7749
+ ...options
7750
+ });
7751
+ }
7752
+ /**
7753
+ * Show a project user visibility
7754
+ *
7755
+ * Returns one project–user visibility join. Reads are owner-only: only the
7756
+ * restricting owner's company key, or a user key the owner issued to one
7757
+ * of its admins, reads a row. A missing, mismatched, or out-of-scope id,
7758
+ * or a row the caller cannot read, is 404.
7759
+ *
7760
+ *
7761
+ * **Required scope:**
7762
+ *
7763
+ * `projects.user_visibilities:read`
7764
+ *
7765
+ */
7766
+ static getUserVisibility(options) {
7767
+ return (options.client ?? client).get({
7768
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
7769
+ url: '/api/v1/projects/{project_id}/user_visibilities/{id}',
7770
+ ...options
7771
+ });
7772
+ }
7773
+ }
7565
7774
  export class ProjectWageDeterminations {
7566
7775
  /**
7567
7776
  * Shift project wage determination genesis
@@ -7857,7 +8066,7 @@ export class Projects {
7857
8066
  * Create a project owned by the API key's company (owned_by_company_id is set
7858
8067
  * automatically from the key). Requires `name`, and `created_by_user_id` must
7859
8068
  * reference a member of the owning company. `budget_currency` defaults to USD;
7860
- * the federal-PWA-only fields (administrator name/email/phone, budget, and the
8069
+ * the federal-PWA-only fields (administrator name/email/phone, `budget_cents`, and the
7861
8070
  * prevailing-wage lock-in / beginning-of-construction / placed-in-service dates)
7862
8071
  * and `asset_owner` apply only while `federal_pwa_mode` is not `none`, so sending
7863
8072
  * one of them on a project that tracks no federal PWA — even as null — returns
@@ -7911,7 +8120,7 @@ export class Projects {
7911
8120
  *
7912
8121
  * Update a project's attributes. `name` cannot be blanked, and
7913
8122
  * `created_by_user_id` is create-only — any update that includes it returns 400,
7914
- * even when the value is unchanged. Omit it on PATCH. The federal-PWA-only fields (administrator contact, budget, IRA
8123
+ * even when the value is unchanged. Omit it on PATCH. The federal-PWA-only fields (administrator contact, `budget_cents`, IRA
7915
8124
  * dates) and `asset_owner` apply only while `federal_pwa_mode` is not `none`:
7916
8125
  * switching it to `none` clears the stored values and forces `asset_owner`
7917
8126
  * false, and sending one of them while federal tracking is off — even as null —
@@ -8122,6 +8331,17 @@ export class Users {
8122
8331
  /**
8123
8332
  * Remove employment entirely (retroactive, irreversible)
8124
8333
  *
8334
+ * Permanently remove every valid-time version of this person's
8335
+ * employment at the company.
8336
+ *
8337
+ * Conditional: send the employment's `ETag` as `If-Match`. The
8338
+ * person's user record names the employment as `employment_id`; read
8339
+ * its `ETag` from `GET /api/v1/people/employments/{employment_id}/history`,
8340
+ * or from `GET /api/v1/people/employments/{id}` while a version covers now.
8341
+ * A key without the history scope may send `If-Match: *` instead,
8342
+ * which removes whatever state exists.
8343
+ *
8344
+ *
8125
8345
  * **Required scope:**
8126
8346
  *
8127
8347
  * `users.companies:delete`
@@ -8158,10 +8378,11 @@ export class Users {
8158
8378
  *
8159
8379
  * Workers the credential company sees: people it employs, has
8160
8380
  * granted a role, or has invited. Direct monetary employment
8161
- * fields (`hourly_rate`, `training_annual_amount`,
8162
- * `employer_combined_health_amount`, `employer_combined_savings`)
8163
- * are present for company keys, company administrators, and the
8164
- * employed person, and omitted for other user keys.
8381
+ * fields (`hourly_rate_cents`, `training_annual_amount_cents`,
8382
+ * `employer_combined_health_amount_cents`,
8383
+ * `employer_combined_savings_cents`) are present for company
8384
+ * keys, company administrators, and the employed person, and
8385
+ * omitted for other user keys.
8165
8386
  *
8166
8387
  *
8167
8388
  * **Required scope:**
@@ -8199,11 +8420,12 @@ export class Users {
8199
8420
  /**
8200
8421
  * Show user
8201
8422
  *
8202
- * Direct monetary employment fields (`hourly_rate`,
8203
- * `training_annual_amount`, `employer_combined_health_amount`,
8204
- * `employer_combined_savings`) are present for company keys,
8205
- * company administrators, and the employed person, and omitted
8206
- * for other user keys.
8423
+ * Direct monetary employment fields (`hourly_rate_cents`,
8424
+ * `training_annual_amount_cents`,
8425
+ * `employer_combined_health_amount_cents`,
8426
+ * `employer_combined_savings_cents`) are present for company
8427
+ * keys, company administrators, and the employed person, and
8428
+ * omitted for other user keys.
8207
8429
  *
8208
8430
  *
8209
8431
  * **Required scope:**
@@ -9084,7 +9306,8 @@ export class Timecodes {
9084
9306
  * Create a timecode for the calling company; `name` is the only required
9085
9307
  * field, and omitted fields take their model/DB defaults. Its owning company
9086
9308
  * is set automatically from the API key, and an optional `effective_date`
9087
- * sets the version's `valid_from` (defaulting to the request time). A timecode
9309
+ * (a calendar day) starts the version at 00:00 UTC that day, the same as
9310
+ * the web; omitted, it starts at the request time. A timecode
9088
9311
  * marked `pwa: true` may not also be `restricted_to: non_job`.
9089
9312
  *
9090
9313
  *