@dsptch-work/api-client 0.21.0 → 0.23.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.
@@ -34,6 +34,25 @@ export class ApprenticeshipAllocations {
34
34
  ...options
35
35
  });
36
36
  }
37
+ /**
38
+ * Create apprenticeship allocation
39
+ *
40
+ * **Required scope:**
41
+ *
42
+ * `apprenticeship.apprentices.allocations:create`
43
+ *
44
+ */
45
+ static createAllocation(options) {
46
+ return (options.client ?? client).post({
47
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
48
+ url: '/api/v1/apprenticeship/apprentices/{apprentice_id}/allocations',
49
+ ...options,
50
+ headers: {
51
+ 'Content-Type': 'application/json',
52
+ ...options.headers
53
+ }
54
+ });
55
+ }
37
56
  /**
38
57
  * Show apprenticeship allocation
39
58
  *
@@ -50,7 +69,7 @@ export class ApprenticeshipAllocations {
50
69
  });
51
70
  }
52
71
  /**
53
- * Update apprenticeship allocation effective date
72
+ * Update apprenticeship allocation
54
73
  *
55
74
  * **Required scope:**
56
75
  *
@@ -4700,6 +4719,89 @@ export class Paystubs {
4700
4719
  }
4701
4720
  }
4702
4721
  export class People {
4722
+ /**
4723
+ * List employment custom fields
4724
+ *
4725
+ * Stored custom-field values on one employment family, independent
4726
+ * of its valid-time versions. A null is a stored value. Hidden
4727
+ * configurations with stored values remain readable, as in the
4728
+ * employment details UI. Join `custom_field_config_id` to
4729
+ * `GET /api/v1/custom_field_configs` for names and definitions;
4730
+ * that endpoint requires its own scope and includes hidden configs.
4731
+ *
4732
+ *
4733
+ * **Required scope:**
4734
+ *
4735
+ * `people.employments.custom_fields:read`
4736
+ *
4737
+ */
4738
+ static listCustomFields(options) {
4739
+ return (options.client ?? client).get({
4740
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4741
+ url: '/api/v1/people/employments/{employment_id}/custom_fields',
4742
+ ...options
4743
+ });
4744
+ }
4745
+ /**
4746
+ * Update employment custom fields
4747
+ *
4748
+ * Update several stored values on one employment family in one
4749
+ * transaction. Each row names a company-owned employment config by
4750
+ * ID; omitted configs remain unchanged and an explicit null stores
4751
+ * a null value. A hidden config may update a value already attached
4752
+ * to the family, but cannot attach a new one. Values must be strings
4753
+ * or null. Send the family's current ETag as `If-Match`.
4754
+ *
4755
+ *
4756
+ * **Required scope:**
4757
+ *
4758
+ * `people.employments.custom_fields:update`
4759
+ *
4760
+ */
4761
+ static updateCustomField(options) {
4762
+ return (options.client ?? client).patch({
4763
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4764
+ url: '/api/v1/people/employments/{employment_id}/custom_fields',
4765
+ ...options,
4766
+ headers: {
4767
+ 'Content-Type': 'application/json',
4768
+ ...options.headers
4769
+ }
4770
+ });
4771
+ }
4772
+ /**
4773
+ * Correct employment hire-date boundary
4774
+ *
4775
+ * Correct where one employment stint's valid-time timeline begins.
4776
+ * Moving the date earlier extends the first version; moving it later
4777
+ * removes older versions or coverage before the new date. This is a
4778
+ * valid-time correction and does not preserve removed versions as
4779
+ * bitemporal history.
4780
+ *
4781
+ * Employments with no recorded hire-date boundary cannot use this
4782
+ * endpoint because employment reconciliation requires a finite start.
4783
+ * Read the employment again after a successful correction; the response
4784
+ * carries the family's new `ETag`.
4785
+ *
4786
+ * Conditional: send the employment's `ETag` as `If-Match`.
4787
+ *
4788
+ *
4789
+ * **Required scope:**
4790
+ *
4791
+ * `people.employments.genesis:update`
4792
+ *
4793
+ */
4794
+ static updateGenesis(options) {
4795
+ return (options.client ?? client).patch({
4796
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4797
+ url: '/api/v1/people/employments/{employment_id}/genesis',
4798
+ ...options,
4799
+ headers: {
4800
+ 'Content-Type': 'application/json',
4801
+ ...options.headers
4802
+ }
4803
+ });
4804
+ }
4703
4805
  /**
4704
4806
  * List employment history
4705
4807
  *
@@ -4743,6 +4845,123 @@ export class People {
4743
4845
  ...options
4744
4846
  });
4745
4847
  }
4848
+ /**
4849
+ * Schedule an employment change
4850
+ *
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.
4854
+ *
4855
+ * Conditional: send the employment's `ETag` as `If-Match`.
4856
+ *
4857
+ *
4858
+ * **Required scope:**
4859
+ *
4860
+ * `people.employments.scheduled_changes:create`
4861
+ *
4862
+ */
4863
+ static createEmploymentScheduledChange(options) {
4864
+ return (options.client ?? client).post({
4865
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4866
+ url: '/api/v1/people/employments/{employment_id}/scheduled_changes',
4867
+ ...options,
4868
+ headers: {
4869
+ 'Content-Type': 'application/json',
4870
+ ...options.headers
4871
+ }
4872
+ });
4873
+ }
4874
+ /**
4875
+ * Cancel one employment change at an exact boundary
4876
+ *
4877
+ * Cancel only the exact strictly future boundary named by the path. Its preceding
4878
+ * version expands across the removed interval; any later boundary remains in place.
4879
+ *
4880
+ * Conditional: send the employment's `ETag` as `If-Match`.
4881
+ *
4882
+ *
4883
+ * **Required scope:**
4884
+ *
4885
+ * `people.employments.scheduled_changes:delete`
4886
+ *
4887
+ */
4888
+ static deleteEmploymentScheduledChange(options) {
4889
+ return (options.client ?? client).delete({
4890
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4891
+ url: '/api/v1/people/employments/{employment_id}/scheduled_changes/{effective_date}',
4892
+ ...options
4893
+ });
4894
+ }
4895
+ /**
4896
+ * Edit an employment change at an exact boundary
4897
+ *
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.
4900
+ *
4901
+ * Conditional: send the employment's `ETag` as `If-Match`.
4902
+ *
4903
+ *
4904
+ * **Required scope:**
4905
+ *
4906
+ * `people.employments.scheduled_changes:update`
4907
+ *
4908
+ */
4909
+ static updateEmploymentScheduledChange(options) {
4910
+ return (options.client ?? client).patch({
4911
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4912
+ url: '/api/v1/people/employments/{employment_id}/scheduled_changes/{effective_date}',
4913
+ ...options,
4914
+ headers: {
4915
+ 'Content-Type': 'application/json',
4916
+ ...options.headers
4917
+ }
4918
+ });
4919
+ }
4920
+ /**
4921
+ * Cancel a scheduled employment termination
4922
+ *
4923
+ * **Required scope:**
4924
+ *
4925
+ * `people.employments.scheduled_terminations:delete`
4926
+ *
4927
+ */
4928
+ static deleteScheduledTermination(options) {
4929
+ return (options.client ?? client).delete({
4930
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4931
+ url: '/api/v1/people/employments/{employment_id}/scheduled_termination',
4932
+ ...options
4933
+ });
4934
+ }
4935
+ /**
4936
+ * Schedule an employment termination
4937
+ *
4938
+ * Close this employment stint's timeline at `effective_date`. The employment remains
4939
+ * readable in history strictly before that date, but stops applying at company-local
4940
+ * midnight starting that date. This does not delete the employment family; family
4941
+ * deletion is a separate operation.
4942
+ *
4943
+ * A family with a termination already standing returns `409`. To move its end, cancel it
4944
+ * with `DELETE` and then make a new `POST` with the replacement date.
4945
+ * A termination at or before the employment's genesis is refused with `422`.
4946
+ * Conditional: send the employment's `ETag` as `If-Match`.
4947
+ *
4948
+ *
4949
+ * **Required scope:**
4950
+ *
4951
+ * `people.employments.scheduled_terminations:create`
4952
+ *
4953
+ */
4954
+ static createEmploymentScheduledTermination(options) {
4955
+ return (options.client ?? client).post({
4956
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
4957
+ url: '/api/v1/people/employments/{employment_id}/scheduled_termination',
4958
+ ...options,
4959
+ headers: {
4960
+ 'Content-Type': 'application/json',
4961
+ ...options.headers
4962
+ }
4963
+ });
4964
+ }
4746
4965
  /**
4747
4966
  * List employments
4748
4967
  *
@@ -4764,6 +4983,58 @@ export class People {
4764
4983
  ...options
4765
4984
  });
4766
4985
  }
4986
+ /**
4987
+ * Create employment
4988
+ *
4989
+ * Create a new employment stint for an existing user in the
4990
+ * credential company. `hire_date` is interpreted at midnight in
4991
+ * the company time zone. A rehire creates a distinct stint; an
4992
+ * overlapping stint is rejected. This operation creates no user,
4993
+ * invitation, role, group, or login identity.
4994
+ *
4995
+ *
4996
+ * **Required scope:**
4997
+ *
4998
+ * `people.employments:create`
4999
+ *
5000
+ */
5001
+ static createEmployment(options) {
5002
+ return (options.client ?? client).post({
5003
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
5004
+ url: '/api/v1/people/employments',
5005
+ ...options,
5006
+ headers: {
5007
+ 'Content-Type': 'application/json',
5008
+ ...options.headers
5009
+ }
5010
+ });
5011
+ }
5012
+ /**
5013
+ * Remove employment family
5014
+ *
5015
+ * Permanently remove every valid-time version in this employment
5016
+ * stint. This deletes the stint's family-owned records, such as its
5017
+ * custom fields, while preserving the person, company-level PWA
5018
+ * details, and different employment stints.
5019
+ *
5020
+ * This is distinct from scheduling a termination. Conditional: send
5021
+ * the employment's `ETag` as `If-Match`. Employment families without
5022
+ * a start boundary are refused because the derived-data reconciliation
5023
+ * needs that earliest affected instant.
5024
+ *
5025
+ *
5026
+ * **Required scope:**
5027
+ *
5028
+ * `people.employments:delete`
5029
+ *
5030
+ */
5031
+ static deleteEmployment(options) {
5032
+ return (options.client ?? client).delete({
5033
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
5034
+ url: '/api/v1/people/employments/{id}',
5035
+ ...options
5036
+ });
5037
+ }
4767
5038
  /**
4768
5039
  * Get employment
4769
5040
  *
@@ -4784,6 +5055,35 @@ export class People {
4784
5055
  ...options
4785
5056
  });
4786
5057
  }
5058
+ /**
5059
+ * Update employment details
5060
+ *
5061
+ * Update one employment stint's direct details from its first
5062
+ * recorded boundary forward. Values that differ there propagate
5063
+ * through every later version in the family. Values already true at
5064
+ * that boundary are a no-op, even when a later version differs.
5065
+ * Schedule compensation and PWA changes through their dedicated
5066
+ * temporal endpoints.
5067
+ *
5068
+ * Conditional: send the employment's `ETag` as `If-Match`.
5069
+ *
5070
+ *
5071
+ * **Required scope:**
5072
+ *
5073
+ * `people.employments:update`
5074
+ *
5075
+ */
5076
+ static updateEmployment(options) {
5077
+ return (options.client ?? client).patch({
5078
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
5079
+ url: '/api/v1/people/employments/{id}',
5080
+ ...options,
5081
+ headers: {
5082
+ 'Content-Type': 'application/json',
5083
+ ...options.headers
5084
+ }
5085
+ });
5086
+ }
4787
5087
  }
4788
5088
  export class PerDiems {
4789
5089
  /**