@dsptch-work/api-client 0.35.0 → 0.37.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.
@@ -640,7 +640,7 @@ export class AssetsAttributes {
640
640
  /**
641
641
  * Create Attribute
642
642
  *
643
- * Only documented body keys are accepted, including inside `options`. An undeclared key returns 400 before any attribute or option is written.
643
+ * Only documented body keys are accepted. An undeclared top-level key or an omitted `name` or `data_type` returns 400; a wrongly typed value, or an undeclared key inside an `options` row, returns 422 at its pointer. Nothing is written on either.
644
644
  *
645
645
  * **Required scope:**
646
646
  *
@@ -695,7 +695,7 @@ export class AssetsAttributes {
695
695
  /**
696
696
  * Update Attribute
697
697
  *
698
- * Only documented body keys are accepted, including inside `options`. An undeclared key returns 400 without changing the attribute or its options. A missing attribute or one outside the key company or user visibility returns 404.
698
+ * Only documented body keys are accepted. An undeclared top-level key returns 400; a wrongly typed value, or an undeclared key inside an `options` row, returns 422 at its pointer. Neither changes the attribute or its options. A missing attribute or one outside the key company or user visibility returns 404.
699
699
  *
700
700
  * **Required scope:**
701
701
  *
@@ -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
  *
@@ -5987,6 +6098,21 @@ export class PayPeriods {
5987
6098
  ...options
5988
6099
  });
5989
6100
  }
6101
+ /**
6102
+ * Show pay period
6103
+ *
6104
+ * **Required scope:**
6105
+ *
6106
+ * `pay_periods:read`
6107
+ *
6108
+ */
6109
+ static getPayPeriod(options) {
6110
+ return (options.client ?? client).get({
6111
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
6112
+ url: '/api/v1/pay_periods/{id}',
6113
+ ...options
6114
+ });
6115
+ }
5990
6116
  }
5991
6117
  export class CompensationElements {
5992
6118
  /**
@@ -7225,6 +7351,134 @@ export class ProductionCompletions {
7225
7351
  });
7226
7352
  }
7227
7353
  }
7354
+ export class ProjectDocuments {
7355
+ /**
7356
+ * List versions
7357
+ *
7358
+ * Lists PaperTrail versions for the document, oldest first by `created_at`
7359
+ * then `id`. This is transaction-time audit history, not a temporal
7360
+ * `/history` lens: there is no `If-Match` and no valid-time window.
7361
+ *
7362
+ *
7363
+ * **Required scope:**
7364
+ *
7365
+ * `projects.documents.versions:read`
7366
+ *
7367
+ */
7368
+ static listProjectDocumentVersions(options) {
7369
+ return (options.client ?? client).get({
7370
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
7371
+ url: '/api/v1/projects/{project_id}/documents/{document_id}/versions',
7372
+ ...options
7373
+ });
7374
+ }
7375
+ /**
7376
+ * List documents
7377
+ *
7378
+ * Returns the project's documents (`VDocument` rows whose `name` is
7379
+ * `"document"`), oldest first by `created_at` then `id`. Nested under the
7380
+ * authorized project: an unknown or out-of-scope `project_id` is 404.
7381
+ *
7382
+ *
7383
+ * **Required scope:**
7384
+ *
7385
+ * `projects.documents:read`
7386
+ *
7387
+ */
7388
+ static listProjectDocuments(options) {
7389
+ return (options.client ?? client).get({
7390
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
7391
+ url: '/api/v1/projects/{project_id}/documents',
7392
+ ...options
7393
+ });
7394
+ }
7395
+ /**
7396
+ * Create document
7397
+ *
7398
+ * Attaches a file to the authorized project. `file` is a signed id from
7399
+ * `POST /api/v1/direct_uploads` naming `projects.documents`. The project is
7400
+ * taken from the path and the creator from `performed_by_user_id`. `name` is
7401
+ * not writable.
7402
+ *
7403
+ *
7404
+ * **Required scope:**
7405
+ *
7406
+ * `projects.documents:create`
7407
+ *
7408
+ */
7409
+ static createProjectDocument(options) {
7410
+ return (options.client ?? client).post({
7411
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
7412
+ url: '/api/v1/projects/{project_id}/documents',
7413
+ ...options,
7414
+ headers: {
7415
+ 'Content-Type': 'application/json',
7416
+ ...options.headers
7417
+ }
7418
+ });
7419
+ }
7420
+ /**
7421
+ * Delete document
7422
+ *
7423
+ * Permanently deletes the document (`destroy!`). Succeeds with 204 and no
7424
+ * body. A document that belongs to another project is 404.
7425
+ *
7426
+ *
7427
+ * **Required scope:**
7428
+ *
7429
+ * `projects.documents:delete`
7430
+ *
7431
+ */
7432
+ static deleteProjectDocument(options) {
7433
+ return (options.client ?? client).delete({
7434
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
7435
+ url: '/api/v1/projects/{project_id}/documents/{id}',
7436
+ ...options
7437
+ });
7438
+ }
7439
+ /**
7440
+ * Get document
7441
+ *
7442
+ * Returns one project document. A document that belongs to another project
7443
+ * is 404, even when that other project is visible to the key.
7444
+ *
7445
+ *
7446
+ * **Required scope:**
7447
+ *
7448
+ * `projects.documents:read`
7449
+ *
7450
+ */
7451
+ static getProjectDocument(options) {
7452
+ return (options.client ?? client).get({
7453
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
7454
+ url: '/api/v1/projects/{project_id}/documents/{id}',
7455
+ ...options
7456
+ });
7457
+ }
7458
+ /**
7459
+ * Update document
7460
+ *
7461
+ * Updates filename, description, and/or the attached file. `name` is
7462
+ * read-only (`attr_readonly`); sending it is 400 as an undeclared key.
7463
+ *
7464
+ *
7465
+ * **Required scope:**
7466
+ *
7467
+ * `projects.documents:update`
7468
+ *
7469
+ */
7470
+ static updateProjectDocument(options) {
7471
+ return (options.client ?? client).patch({
7472
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
7473
+ url: '/api/v1/projects/{project_id}/documents/{id}',
7474
+ ...options,
7475
+ headers: {
7476
+ 'Content-Type': 'application/json',
7477
+ ...options.headers
7478
+ }
7479
+ });
7480
+ }
7481
+ }
7228
7482
  export class ProjectWageDeterminationRateRules {
7229
7483
  /**
7230
7484
  * List project wage determination rate rule history
@@ -7714,7 +7968,7 @@ export class Projects {
7714
7968
  * Create a project owned by the API key's company (owned_by_company_id is set
7715
7969
  * automatically from the key). Requires `name`, and `created_by_user_id` must
7716
7970
  * reference a member of the owning company. `budget_currency` defaults to USD;
7717
- * the federal-PWA-only fields (administrator name/email/phone, budget, and the
7971
+ * the federal-PWA-only fields (administrator name/email/phone, `budget_cents`, and the
7718
7972
  * prevailing-wage lock-in / beginning-of-construction / placed-in-service dates)
7719
7973
  * and `asset_owner` apply only while `federal_pwa_mode` is not `none`, so sending
7720
7974
  * one of them on a project that tracks no federal PWA — even as null — returns
@@ -7768,7 +8022,7 @@ export class Projects {
7768
8022
  *
7769
8023
  * Update a project's attributes. `name` cannot be blanked, and
7770
8024
  * `created_by_user_id` is create-only — any update that includes it returns 400,
7771
- * even when the value is unchanged. Omit it on PATCH. The federal-PWA-only fields (administrator contact, budget, IRA
8025
+ * even when the value is unchanged. Omit it on PATCH. The federal-PWA-only fields (administrator contact, `budget_cents`, IRA
7772
8026
  * dates) and `asset_owner` apply only while `federal_pwa_mode` is not `none`:
7773
8027
  * switching it to `none` clears the stored values and forces `asset_owner`
7774
8028
  * false, and sending one of them while federal tracking is off — even as null —
@@ -7979,6 +8233,17 @@ export class Users {
7979
8233
  /**
7980
8234
  * Remove employment entirely (retroactive, irreversible)
7981
8235
  *
8236
+ * Permanently remove every valid-time version of this person's
8237
+ * employment at the company.
8238
+ *
8239
+ * Conditional: send the employment's `ETag` as `If-Match`. The
8240
+ * person's user record names the employment as `employment_id`; read
8241
+ * its `ETag` from `GET /api/v1/people/employments/{employment_id}/history`,
8242
+ * or from `GET /api/v1/people/employments/{id}` while a version covers now.
8243
+ * A key without the history scope may send `If-Match: *` instead,
8244
+ * which removes whatever state exists.
8245
+ *
8246
+ *
7982
8247
  * **Required scope:**
7983
8248
  *
7984
8249
  * `users.companies:delete`
@@ -7987,7 +8252,7 @@ export class Users {
7987
8252
  static removeUserFromCompany(options) {
7988
8253
  return (options.client ?? client).delete({
7989
8254
  security: [{ name: 'X-Api-Key', type: 'apiKey' }],
7990
- url: '/api/v1/users/{user_id}/companies/{company_id}',
8255
+ url: '/api/v1/users/{user_id}/companies/{id}',
7991
8256
  ...options
7992
8257
  });
7993
8258
  }
@@ -8002,7 +8267,7 @@ export class Users {
8002
8267
  static updateCompany(options) {
8003
8268
  return (options.client ?? client).patch({
8004
8269
  security: [{ name: 'X-Api-Key', type: 'apiKey' }],
8005
- url: '/api/v1/users/{user_id}/companies/{company_id}',
8270
+ url: '/api/v1/users/{user_id}/companies/{id}',
8006
8271
  ...options,
8007
8272
  headers: {
8008
8273
  'Content-Type': 'application/json',
@@ -8015,10 +8280,11 @@ export class Users {
8015
8280
  *
8016
8281
  * Workers the credential company sees: people it employs, has
8017
8282
  * granted a role, or has invited. Direct monetary employment
8018
- * fields (`hourly_rate`, `training_annual_amount`,
8019
- * `employer_combined_health_amount`, `employer_combined_savings`)
8020
- * are present for company keys, company administrators, and the
8021
- * employed person, and omitted for other user keys.
8283
+ * fields (`hourly_rate_cents`, `training_annual_amount_cents`,
8284
+ * `employer_combined_health_amount_cents`,
8285
+ * `employer_combined_savings_cents`) are present for company
8286
+ * keys, company administrators, and the employed person, and
8287
+ * omitted for other user keys.
8022
8288
  *
8023
8289
  *
8024
8290
  * **Required scope:**
@@ -8056,11 +8322,12 @@ export class Users {
8056
8322
  /**
8057
8323
  * Show user
8058
8324
  *
8059
- * Direct monetary employment fields (`hourly_rate`,
8060
- * `training_annual_amount`, `employer_combined_health_amount`,
8061
- * `employer_combined_savings`) are present for company keys,
8062
- * company administrators, and the employed person, and omitted
8063
- * for other user keys.
8325
+ * Direct monetary employment fields (`hourly_rate_cents`,
8326
+ * `training_annual_amount_cents`,
8327
+ * `employer_combined_health_amount_cents`,
8328
+ * `employer_combined_savings_cents`) are present for company
8329
+ * keys, company administrators, and the employed person, and
8330
+ * omitted for other user keys.
8064
8331
  *
8065
8332
  *
8066
8333
  * **Required scope:**