@dsptch-work/api-client 0.46.0 → 0.48.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.
@@ -1755,6 +1755,108 @@ export class AssetsProducts {
1755
1755
  }
1756
1756
  });
1757
1757
  }
1758
+ /**
1759
+ * List documents
1760
+ *
1761
+ * **Required scope:**
1762
+ *
1763
+ * `assets.products.documents:read`
1764
+ *
1765
+ */
1766
+ static listProductDocuments(options) {
1767
+ return (options.client ?? client).get({
1768
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
1769
+ url: '/api/v1/assets/products/{product_id}/documents',
1770
+ ...options
1771
+ });
1772
+ }
1773
+ /**
1774
+ * Create document
1775
+ *
1776
+ * **Required scope:**
1777
+ *
1778
+ * `assets.products.documents:create`
1779
+ *
1780
+ */
1781
+ static createProductDocument(options) {
1782
+ return (options.client ?? client).post({
1783
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
1784
+ url: '/api/v1/assets/products/{product_id}/documents',
1785
+ ...options,
1786
+ headers: {
1787
+ 'Content-Type': 'application/json',
1788
+ ...options.headers
1789
+ }
1790
+ });
1791
+ }
1792
+ /**
1793
+ * Delete document
1794
+ *
1795
+ * Permanently deletes the document (`destroy!`). Succeeds with 204 and no
1796
+ * body. A document that belongs to another product is 404.
1797
+ *
1798
+ *
1799
+ * **Required scope:**
1800
+ *
1801
+ * `assets.products.documents:delete`
1802
+ *
1803
+ */
1804
+ static deleteProductDocument(options) {
1805
+ return (options.client ?? client).delete({
1806
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
1807
+ url: '/api/v1/assets/products/{product_id}/documents/{id}',
1808
+ ...options
1809
+ });
1810
+ }
1811
+ /**
1812
+ * Show document
1813
+ *
1814
+ * **Required scope:**
1815
+ *
1816
+ * `assets.products.documents:read`
1817
+ *
1818
+ */
1819
+ static getProductDocument(options) {
1820
+ return (options.client ?? client).get({
1821
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
1822
+ url: '/api/v1/assets/products/{product_id}/documents/{id}',
1823
+ ...options
1824
+ });
1825
+ }
1826
+ /**
1827
+ * Update document
1828
+ *
1829
+ * **Required scope:**
1830
+ *
1831
+ * `assets.products.documents:update`
1832
+ *
1833
+ */
1834
+ static updateProductDocument(options) {
1835
+ return (options.client ?? client).patch({
1836
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
1837
+ url: '/api/v1/assets/products/{product_id}/documents/{id}',
1838
+ ...options,
1839
+ headers: {
1840
+ 'Content-Type': 'application/json',
1841
+ ...options.headers
1842
+ }
1843
+ });
1844
+ }
1845
+ /**
1846
+ * List document versions
1847
+ *
1848
+ * **Required scope:**
1849
+ *
1850
+ * `assets.products.documents.versions:read`
1851
+ *
1852
+ */
1853
+ static listProductDocumentVersions(options) {
1854
+ return (options.client ?? client).get({
1855
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
1856
+ url: '/api/v1/assets/products/{product_id}/documents/{document_id}/versions',
1857
+ ...options
1858
+ });
1859
+ }
1758
1860
  }
1759
1861
  export class AssetsSites {
1760
1862
  /**
@@ -4657,6 +4759,28 @@ export class Jobs {
4657
4759
  }
4658
4760
  });
4659
4761
  }
4762
+ /**
4763
+ * Delete job
4764
+ *
4765
+ * Deletes a job that has no restricting activity. A job still
4766
+ * referenced by time entries, time sessions, job-owned timecodes,
4767
+ * archived form assignments, or other restricted dependents is
4768
+ * refused with a `422`. An unused job returns `204` and is gone
4769
+ * from a later GET.
4770
+ *
4771
+ *
4772
+ * **Required scope:**
4773
+ *
4774
+ * `jobs:delete`
4775
+ *
4776
+ */
4777
+ static deleteJob(options) {
4778
+ return (options.client ?? client).delete({
4779
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4780
+ url: '/api/v1/jobs/{id}',
4781
+ ...options
4782
+ });
4783
+ }
4660
4784
  /**
4661
4785
  * Show job
4662
4786
  *
@@ -5038,11 +5162,11 @@ export class ProductionJobScopePrices {
5038
5162
  * List production job scope prices
5039
5163
  *
5040
5164
  * Scope prices on a production-tracked job. Company keys,
5041
- * and user keys held by an administrator, manager, safety
5042
- * manager, or field lead of the company that owns the job,
5043
- * receive `unit_price_cents`. Other user
5044
- * keys, held by crew on the job, receive the same rows
5045
- * without the price. A present `unit_price_cents` is an
5165
+ * and user keys held by an administrator, manager, or safety
5166
+ * manager of the company that owns the job, receive
5167
+ * `unit_price_cents`. Other user keys, held by a field lead
5168
+ * of that company or by crew on the job, receive the same
5169
+ * rows without the price. A present `unit_price_cents` is an
5046
5170
  * exact decimal string, or null when the current price is unknown.
5047
5171
  *
5048
5172
  *
@@ -5104,11 +5228,11 @@ export class ProductionJobScopePrices {
5104
5228
  * Show production job scope price
5105
5229
  *
5106
5230
  * One scope price on a production-tracked job. Company keys,
5107
- * and user keys held by an administrator, manager, safety
5108
- * manager, or field lead of the company that owns the job,
5109
- * receive `unit_price_cents`. Other user
5110
- * keys, held by crew on the job, receive the row without
5111
- * the price. A present `unit_price_cents` is an exact
5231
+ * and user keys held by an administrator, manager, or safety
5232
+ * manager of the company that owns the job, receive
5233
+ * `unit_price_cents`. Other user keys, held by a field lead
5234
+ * of that company or by crew on the job, receive the row
5235
+ * without the price. A present `unit_price_cents` is an exact
5112
5236
  * decimal string, or null when the current price is unknown.
5113
5237
  *
5114
5238
  *
@@ -9772,6 +9896,10 @@ export class PwaTradeApprenticeScope {
9772
9896
  * undecided, which denies apprentice treatment just as `out_of_scope` does — the two
9773
9897
  * differ only in whether the pair still prompts a curator for review.
9774
9898
  *
9899
+ * A key whose company owns the trade's project root, or created its standalone job,
9900
+ * lists every decision on it. Any other key lists only the decisions on its company's
9901
+ * own occupations.
9902
+ *
9775
9903
  *
9776
9904
  * **Required scope:**
9777
9905
  *
@@ -9789,9 +9917,9 @@ export class PwaTradeApprenticeScope {
9789
9917
  * Record an apprentice scope decision
9790
9918
  *
9791
9919
  * Records a reviewed verdict for an (occupation, craft) pair. Writes are the
9792
- * occupation's employer companies' to make — a credential may read the decisions on any
9793
- * trade it can see, but may only write those whose occupation belongs to a program it
9794
- * is enrolled in as an employer.
9920
+ * occupation's employer companies' to make — a key may write a decision on any trade
9921
+ * it can read, but only for an occupation of a program its company is enrolled in as
9922
+ * an employer.
9795
9923
  *
9796
9924
  * The decision re-prices every hour the occupation's apprentices charged to this craft,
9797
9925
  * so it takes effect on recorded work, not only on work going forward.
@@ -9837,8 +9965,9 @@ export class PwaTradeApprenticeScope {
9837
9965
  *
9838
9966
  * Returns one reviewed (occupation, craft) pair on this trade. The payload is
9839
9967
  * the same object create, update, and destroy already serialize. A missing,
9840
- * mismatched, or out-of-scope id is not found. Reading follows the trade;
9841
- * employer enrollment is not required.
9968
+ * mismatched, or out-of-scope id is not found. A key whose company owns the
9969
+ * trade's project root, or created its standalone job, reads every decision on
9970
+ * it; any other key reads only the decisions on its company's own occupations.
9842
9971
  *
9843
9972
  *
9844
9973
  * **Required scope:**
@@ -10536,6 +10665,17 @@ export class Timecodes {
10536
10665
  /**
10537
10666
  * Cancel scheduled termination on timecode
10538
10667
  *
10668
+ * Remove the timecode's standing end: its last version runs on, open-ended,
10669
+ * with the values it carries now. Everything recorded since the end was set —
10670
+ * a correction, a change scheduled ahead of the end, a genesis shift — is
10671
+ * kept. A change that was scheduled past the end was removed when the end was
10672
+ * set, and does not come back.
10673
+ *
10674
+ * Returns `422` `nothing_to_cancel` when the timecode has no end.
10675
+ *
10676
+ * Conditional: send the timecode's `ETag` as `If-Match`.
10677
+ *
10678
+ *
10539
10679
  * **Required scope:**
10540
10680
  *
10541
10681
  * `timecodes.scheduled_terminations:delete`
@@ -10659,20 +10799,25 @@ export class Timecodes {
10659
10799
  *
10660
10800
  * Update a timecode by applying a bitemporal correction rather than mutating
10661
10801
  * the row in place; `name` must remain present, and only the fields sent in
10662
- * the body are changed (omitted fields keep the corrected version's values).
10663
- * Changing rate-affecting attributes (billable, overtime_eligible, unpaid,
10664
- * pwa, holiday, pto, rest_and_recovery, incentive_pay_eligible) enqueues a
10665
- * background rate re-sync.
10802
+ * the body are changed (omitted fields keep the values each corrected
10803
+ * segment already holds). Changing rate-affecting attributes (billable,
10804
+ * overtime_eligible, unpaid, pwa, holiday, pto, rest_and_recovery,
10805
+ * incentive_pay_eligible) enqueues a background rate re-sync from the first
10806
+ * instant one of them actually changes.
10666
10807
  *
10667
10808
  * The correction may name the stretch of valid time it applies to.
10668
10809
  * `effective_from` defaults to the addressed version's own start, and
10669
10810
  * `effective_to` — omitted — runs the correction to the end of the segment
10670
10811
  * containing it, so later scheduled changes stand. Sending `effective_to`
10671
10812
  * corrects exactly `[effective_from, effective_to)` and the timeline resumes
10672
- * its previous values afterwards. Neighbouring segments' boundaries are the
10673
- * engine's to move; a request never names one. Sending neither parameter
10674
- * corrects from the addressed version's start, which is what an unqualified
10675
- * update has always done.
10813
+ * its previous values afterwards. A span may cross change points the
10814
+ * timeline already carries: each segment it crosses takes the sent fields
10815
+ * and keeps its own values for the rest, and each is validated as it would
10816
+ * stand, so a value one of them cannot take refuses the whole correction
10817
+ * with `422`, naming the change point. Neighbouring segments' boundaries are
10818
+ * the engine's to move; a request never names one. Sending neither
10819
+ * parameter corrects from the addressed version's start, which is what an
10820
+ * unqualified update has always done.
10676
10821
  *
10677
10822
  * Conditional: send the timecode's `ETag` as `If-Match`.
10678
10823
  *
@@ -10862,6 +11007,35 @@ export class PaySchedules {
10862
11007
  }
10863
11008
  });
10864
11009
  }
11010
+ /**
11011
+ * Delete pay schedule
11012
+ *
11013
+ * Remove the pay schedule outright: every version of the family goes, and
11014
+ * nothing is readable through `as_of[valid]` or `/history` afterwards. This
11015
+ * is valid-axis erasure — the family is deleted, not retracted on the
11016
+ * transaction axis.
11017
+ *
11018
+ * Deletion is asynchronous: an empty family, or a populated family this
11019
+ * caller is allowed to delete, enqueues the same job the web app uses and
11020
+ * answers `202`. Recorded time, payroll data, or retained payroll mappings
11021
+ * that the caller cannot take with them answer `409`. A delete already
11022
+ * running answers `409`.
11023
+ *
11024
+ * Conditional: send the schedule's `ETag` as `If-Match`.
11025
+ *
11026
+ *
11027
+ * **Required scope:**
11028
+ *
11029
+ * `timekeeping.pay_period_configs:delete`
11030
+ *
11031
+ */
11032
+ static deletePayPeriodConfig(options) {
11033
+ return (options.client ?? client).delete({
11034
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
11035
+ url: '/api/v1/timekeeping/pay_period_configs/{id}',
11036
+ ...options
11037
+ });
11038
+ }
10865
11039
  /**
10866
11040
  * Show pay schedule
10867
11041
  *
@@ -10877,6 +11051,39 @@ export class PaySchedules {
10877
11051
  ...options
10878
11052
  });
10879
11053
  }
11054
+ /**
11055
+ * Schedule a pay schedule change
11056
+ *
11057
+ * Apply a dated change to the pay schedule, the same path the
11058
+ * web scheduled-change form uses. `effective_date` is required
11059
+ * and must fall on `start_day_of_week`; the API never snaps it
11060
+ * to another weekday. Other fields are optional. `tz_name`,
11061
+ * `time_mode`, and `payroll_mode` are refused.
11062
+ *
11063
+ * The family is written immediately. Pay periods rebuild
11064
+ * asynchronously, so this answers `202` with the family as
11065
+ * `GET` would return it (the version valid now). Future
11066
+ * versions are on `/history`.
11067
+ *
11068
+ * Conditional: send the schedule's `ETag` as `If-Match`.
11069
+ *
11070
+ *
11071
+ * **Required scope:**
11072
+ *
11073
+ * `timekeeping.pay_period_configs:update`
11074
+ *
11075
+ */
11076
+ static updatePayPeriodConfig(options) {
11077
+ return (options.client ?? client).patch({
11078
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
11079
+ url: '/api/v1/timekeeping/pay_period_configs/{id}',
11080
+ ...options,
11081
+ headers: {
11082
+ 'Content-Type': 'application/json',
11083
+ ...options.headers
11084
+ }
11085
+ });
11086
+ }
10880
11087
  }
10881
11088
  export class Holidays {
10882
11089
  /**