@dsptch-work/api-client 0.23.0 → 0.25.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.
@@ -418,6 +418,7 @@ export const zDirectUploadParameters = z.object({
418
418
  'assets.products',
419
419
  'assets.vendors',
420
420
  'compliance.checks',
421
+ 'internal.companies',
421
422
  'internal.company_todos',
422
423
  'internal.job_todos',
423
424
  'internal.project_todos',
@@ -538,11 +539,12 @@ export const zApprenticeshipWageScheduleResponseObject = z.object({
538
539
  end_wage_currency: z.string(),
539
540
  journeyworker_wage_cents: z.string(),
540
541
  journeyworker_wage_currency: z.string(),
542
+ journeyworker_fringe_cents: z.string().nullable(),
541
543
  created_at: z.iso.datetime(),
542
544
  updated_at: z.iso.datetime()
543
545
  });
544
546
  /**
545
- * One step in a wage schedule's progression — the apprentice's pay, as a percentage of the journeyworker wage, for a band of accumulated hours or a number of competencies.
547
+ * One step in a wage schedule's progression — the apprentice's pay, as a percentage of the journeyworker wage, for a band of accumulated hours or a number of competencies. A period may also list its apprentices' fringe, as a percentage of the charged wage determination's fringe or as a fixed hourly amount, and an in-ratio apprentice is obligated at that fringe. The listing is ignored — fringe is priced as if nothing were listed — when the apprentice is out of ratio, on a regional Illinois wage determination, or on an apprentice-basis wage determination, which carries its own apprentice fringe.
546
548
  */
547
549
  export const zApprenticeshipWageSchedulePeriodResponseObject = z.object({
548
550
  id: z.string(),
@@ -555,6 +557,8 @@ export const zApprenticeshipWageSchedulePeriodResponseObject = z.object({
555
557
  wage_percent: z.string(),
556
558
  wage_cents: z.string(),
557
559
  wage_currency: z.string(),
560
+ fringe_percent: z.string().nullable(),
561
+ fringe_cents: z.string().nullable(),
558
562
  created_at: z.iso.datetime(),
559
563
  updated_at: z.iso.datetime()
560
564
  });
@@ -711,14 +715,14 @@ export const zApprenticeshipProgramEmployerParameters = z.object({
711
715
  require_timecard_allocation: z.boolean().optional()
712
716
  });
713
717
  /**
714
- * Update an employer authorization in a program. Send only the fields to change; only the program's sponsor may manage this roster.
718
+ * Update an employer authorization in a program. Send only the fields to change; only the program's sponsor may manage this roster, and an API key may change only the row naming its own company.
715
719
  */
716
720
  export const zApprenticeshipProgramEmployerUpdateParameters = z.object({
717
721
  company_id: z.string().optional(),
718
722
  require_timecard_allocation: z.boolean().optional()
719
723
  });
720
724
  /**
721
- * Create a period on a wage schedule; the wage schedule is taken from the URL path. wage_cents is sent as integer cents.
725
+ * Create a period on a wage schedule; the wage schedule is taken from the URL path. wage_cents and fringe_cents are sent as integer cents.
722
726
  */
723
727
  export const zApprenticeshipWageSchedulePeriodParameters = z.object({
724
728
  period_number: z.int(),
@@ -727,10 +731,12 @@ export const zApprenticeshipWageSchedulePeriodParameters = z.object({
727
731
  num_competencies: z.int().nullish(),
728
732
  description: z.string().nullish(),
729
733
  wage_percent: z.number(),
730
- wage_cents: z.int()
734
+ wage_cents: z.int(),
735
+ fringe_percent: z.number().nullish(),
736
+ fringe_cents: z.int().nullish()
731
737
  });
732
738
  /**
733
- * Update a period on a wage schedule. Send only the fields to change; the wage schedule is taken from the URL path and wage_cents is sent as integer cents.
739
+ * Update a period on a wage schedule. Send only the fields to change; the wage schedule is taken from the URL path, and wage_cents and fringe_cents are sent as integer cents.
734
740
  */
735
741
  export const zApprenticeshipWageSchedulePeriodUpdateParameters = z.object({
736
742
  period_number: z.int().optional(),
@@ -739,7 +745,9 @@ export const zApprenticeshipWageSchedulePeriodUpdateParameters = z.object({
739
745
  num_competencies: z.int().nullish(),
740
746
  description: z.string().nullish(),
741
747
  wage_percent: z.number().optional(),
742
- wage_cents: z.int().optional()
748
+ wage_cents: z.int().optional(),
749
+ fringe_percent: z.number().nullish(),
750
+ fringe_cents: z.int().nullish()
743
751
  });
744
752
  /**
745
753
  * Create a wage schedule for an occupation; the occupation is taken from the URL path. Money is sent as integer cents; periods may be created inline via periods_attributes.
@@ -772,6 +780,7 @@ export const zApprenticeshipWageScheduleParameters = z.object({
772
780
  'year'
773
781
  ]),
774
782
  journeyworker_wage_cents: z.int().optional(),
783
+ journeyworker_fringe_cents: z.int().nullish(),
775
784
  end_wage_cents: z.int().optional(),
776
785
  periods_attributes: z.array(z.object({
777
786
  id: z.string().optional(),
@@ -782,6 +791,8 @@ export const zApprenticeshipWageScheduleParameters = z.object({
782
791
  description: z.string().nullish(),
783
792
  wage_percent: z.number(),
784
793
  wage_cents: z.int(),
794
+ fringe_percent: z.number().nullish(),
795
+ fringe_cents: z.int().nullish(),
785
796
  _destroy: z.boolean().optional()
786
797
  })).optional()
787
798
  });
@@ -816,6 +827,7 @@ export const zApprenticeshipWageScheduleUpdateParameters = z.object({
816
827
  'year'
817
828
  ]).optional(),
818
829
  journeyworker_wage_cents: z.int().optional(),
830
+ journeyworker_fringe_cents: z.int().nullish(),
819
831
  end_wage_cents: z.int().optional(),
820
832
  periods_attributes: z.array(z.intersection(z.union([
821
833
  z.unknown(),
@@ -842,6 +854,8 @@ export const zApprenticeshipWageScheduleUpdateParameters = z.object({
842
854
  description: z.string().nullish(),
843
855
  wage_percent: z.number().optional(),
844
856
  wage_cents: z.int().optional(),
857
+ fringe_percent: z.number().nullish(),
858
+ fringe_cents: z.int().nullish(),
845
859
  _destroy: z.boolean().optional()
846
860
  }))).optional()
847
861
  });
@@ -934,7 +948,7 @@ export const zPeopleEmploymentCreateParameters = z.object({
934
948
  employer_combined_savings_cents: z.string().nullish()
935
949
  });
936
950
  /**
937
- * Request body for creating one strictly future employment boundary. effective_date is required and is interpreted at midnight in the credential company's time zone. Send at least one value to change; omitted values carry forward from the version immediately before the new boundary.
951
+ * Request body for creating one employment boundary. effective_date is required and is interpreted at midnight in the credential company's time zone. Today and past dates must fall inside the family's latest version, before its termination; future dates retain scheduling behavior. Send at least one value to change; omitted values carry forward from the version immediately before the new boundary.
938
952
  */
939
953
  export const zPeopleEmploymentScheduledChangeCreateParameters = z.object({
940
954
  compensation_type: z.enum(['hourly', 'salary']).optional(),
@@ -952,7 +966,7 @@ export const zPeopleEmploymentScheduledChangeCreateParameters = z.object({
952
966
  effective_date: z.iso.date()
953
967
  });
954
968
  /**
955
- * Request body for changing values at one exact strictly future employment boundary. Send only the fields to change; omitted values remain as recorded at that boundary. The boundary date cannot move.
969
+ * Request body for changing values at one exact employment boundary. Today and past dates must name the latest version's start; future exact boundaries remain editable. Send only the fields to change; omitted values remain as recorded at that boundary. The boundary date cannot move.
956
970
  */
957
971
  export const zPeopleEmploymentScheduledChangeUpdateParameters = z.object({
958
972
  compensation_type: z.enum(['hourly', 'salary']).optional(),
@@ -2584,7 +2598,8 @@ export const zAggregateTimeImportResponseObject = z.object({
2584
2598
  'processed',
2585
2599
  'success',
2586
2600
  'failed',
2587
- 'superseded'
2601
+ 'superseded',
2602
+ 'withdrawn'
2588
2603
  ]),
2589
2604
  processed_rows_count: z.int(),
2590
2605
  processing_errors: z.array(zImportProcessingError),
@@ -2614,7 +2629,8 @@ export const zDsptchCprImportResponseObject = z.object({
2614
2629
  'processed',
2615
2630
  'success',
2616
2631
  'failed',
2617
- 'superseded'
2632
+ 'superseded',
2633
+ 'withdrawn'
2618
2634
  ]),
2619
2635
  processed_rows_count: z.int(),
2620
2636
  processing_errors: z.array(zImportProcessingError),
@@ -2644,7 +2660,8 @@ export const zPaystubImportResponseObject = z.object({
2644
2660
  'processed',
2645
2661
  'success',
2646
2662
  'failed',
2647
- 'superseded'
2663
+ 'superseded',
2664
+ 'withdrawn'
2648
2665
  ]),
2649
2666
  processed_rows_count: z.int(),
2650
2667
  processing_errors: z.array(zImportProcessingError),
@@ -2674,7 +2691,8 @@ export const zTimeEntryImportResponseObject = z.object({
2674
2691
  'processed',
2675
2692
  'success',
2676
2693
  'failed',
2677
- 'superseded'
2694
+ 'superseded',
2695
+ 'withdrawn'
2678
2696
  ]),
2679
2697
  processed_rows_count: z.int(),
2680
2698
  processing_errors: z.array(zImportProcessingError),
@@ -4000,6 +4018,13 @@ export const zPayRatesRulePackageParameters = z.object({
4000
4018
  name: z.string().min(1),
4001
4019
  description: z.string().nullish()
4002
4020
  });
4021
+ /**
4022
+ * Request body for updating a pay-rate rule package. Send only the fields to change. `default`, `selectable`, and `scoped_to_job_id` are not writable on this operation.
4023
+ */
4024
+ export const zPayRatesRulePackageUpdateParameters = z.object({
4025
+ name: z.string().min(1).optional(),
4026
+ description: z.string().nullish()
4027
+ });
4003
4028
  /**
4004
4029
  * Request body for creating or updating a position on a job. The job is taken from the URL path.
4005
4030
  */
@@ -4157,7 +4182,7 @@ export const zFormAssignmentTaskResponseObject = z.array(z.object({
4157
4182
  }))
4158
4183
  }));
4159
4184
  /**
4160
- * Request body for creating a certification — a named qualification a worker can hold. You can only manage your own company's certifications; global (platform) certifications are read-only.
4185
+ * Request body for creating a certification — a named qualification a worker can hold. You can only manage your own company's certifications; global (platform) certifications are read-only. Only the keys listed here are accepted — any other key is rejected with 400 unknown_key.
4161
4186
  */
4162
4187
  export const zCertificationParameters = z.object({
4163
4188
  company_id: z.string(),
@@ -4167,10 +4192,9 @@ export const zCertificationParameters = z.object({
4167
4192
  duration: z.string().nullish()
4168
4193
  });
4169
4194
  /**
4170
- * Request body for updating a certification — a named qualification a worker can hold. Include only the fields to change. You can only manage your own company's certifications; global (platform) certifications are read-only.
4195
+ * Request body for updating a certification — a named qualification a worker can hold. Include only the fields to change. You can only manage your own company's certifications; global (platform) certifications are read-only. company_id is absent by design — the certification's company is fixed at creation, so sending the key is rejected with 400 unknown_key, as is any other key not listed here.
4171
4196
  */
4172
4197
  export const zCertificationUpdateParameters = z.object({
4173
- company_id: z.string().optional(),
4174
4198
  name: z.string().optional(),
4175
4199
  description: z.string().nullish(),
4176
4200
  verified: z.boolean().optional(),
@@ -4191,7 +4215,7 @@ export const zCertificationPackageResponseObject = z.object({
4191
4215
  updated_at: z.iso.datetime()
4192
4216
  });
4193
4217
  /**
4194
- * Request body for creating a certification package — a named set of certifications a company requires together.
4218
+ * Request body for creating a certification package — a named set of certifications a company requires together. The package belongs to the company that owns the API key. Only the keys listed here are accepted — any other key is rejected with 400 unknown_key.
4195
4219
  */
4196
4220
  export const zCertificationPackageParameters = z.object({
4197
4221
  name: z.string(),
@@ -4200,7 +4224,7 @@ export const zCertificationPackageParameters = z.object({
4200
4224
  performed_by_user_id: z.string()
4201
4225
  });
4202
4226
  /**
4203
- * Request body for updating a certification package — a named set of certifications a company requires together. Include only the fields to change.
4227
+ * Request body for updating a certification package — a named set of certifications a company requires together. Include only the fields to change. Any key not listed here is rejected with 400 unknown_key.
4204
4228
  */
4205
4229
  export const zCertificationPackageUpdateParameters = z.object({
4206
4230
  name: z.string().optional(),
@@ -4547,14 +4571,21 @@ export const zUserResponseObject = z.object({
4547
4571
  ])).nullable()
4548
4572
  }).nullable()
4549
4573
  });
4550
- /**
4551
- * Request body for onboarding a worker into your company. In one call it creates the person (if new), their employment record, roles, group memberships, an optional invite, and optional compliance details. company_id, email, first_name, and last_name are required.
4552
- */
4553
- export const zUserParameters = z.object({
4554
- company_id: z.string(),
4555
- email: z.string(),
4556
- personal_email: z.string().optional(),
4557
- phone_number: z.string().optional(),
4574
+ export const zUserParameters = z.intersection(z.union([
4575
+ z.object({
4576
+ email: z.string().min(1)
4577
+ }),
4578
+ z.object({
4579
+ phone_number: z.string().min(1)
4580
+ }),
4581
+ z.object({
4582
+ skip_invite: z.literal(true)
4583
+ })
4584
+ ]), z.object({
4585
+ company_id: z.string().optional(),
4586
+ email: z.string().nullish(),
4587
+ personal_email: z.string().nullish(),
4588
+ phone_number: z.string().nullish(),
4558
4589
  first_name: z.string(),
4559
4590
  last_name: z.string(),
4560
4591
  preferred_first_name: z.string().nullish(),
@@ -4654,7 +4685,7 @@ export const zUserParameters = z.object({
4654
4685
  'portuguese_or_brazilian'
4655
4686
  ])).nullish()
4656
4687
  }).nullish()
4657
- });
4688
+ }));
4658
4689
  /**
4659
4690
  * Request body for updating a worker's employment at your company. Corrects administrative fields (employment type, title, manager, payroll id, hire date, and time-and-attendance enrollment) across the whole employment history. For time-effective pay changes, use the scheduled-changes endpoints instead.
4660
4691
  */
@@ -6642,6 +6673,14 @@ export const zCreateAllocationPath = z.object({
6642
6673
  * Created
6643
6674
  */
6644
6675
  export const zCreateAllocationResponse = zApprenticeshipAllocationResponseObject;
6676
+ export const zDeleteAllocationPath = z.object({
6677
+ apprentice_id: z.string(),
6678
+ id: z.string()
6679
+ });
6680
+ /**
6681
+ * No Content
6682
+ */
6683
+ export const zDeleteAllocationResponse = z.void();
6645
6684
  export const zGetAllocationPath = z.object({
6646
6685
  apprentice_id: z.string(),
6647
6686
  id: z.string()
@@ -6721,6 +6760,22 @@ export const zCreateOccupationPath = z.object({
6721
6760
  * Created
6722
6761
  */
6723
6762
  export const zCreateOccupationResponse = zApprenticeshipOccupationResponseObject;
6763
+ export const zDeleteOccupationPath = z.object({
6764
+ program_id: z.string(),
6765
+ id: z.string()
6766
+ });
6767
+ /**
6768
+ * No Content
6769
+ */
6770
+ export const zDeleteOccupationResponse = z.void();
6771
+ export const zGetOccupationPath = z.object({
6772
+ program_id: z.string(),
6773
+ id: z.string()
6774
+ });
6775
+ /**
6776
+ * Success
6777
+ */
6778
+ export const zGetOccupationResponse = zApprenticeshipOccupationResponseObject;
6724
6779
  export const zUpdateOccupationBody = zApprenticeshipOccupationUpdateParameters;
6725
6780
  export const zUpdateOccupationPath = z.object({
6726
6781
  program_id: z.string(),
@@ -6801,6 +6856,20 @@ export const zCreateProgramBody = zApprenticeshipProgramParameters;
6801
6856
  * Created
6802
6857
  */
6803
6858
  export const zCreateProgramResponse = zApprenticeshipProgramResponseObject;
6859
+ export const zDeleteProgramPath = z.object({
6860
+ id: z.string()
6861
+ });
6862
+ /**
6863
+ * No Content
6864
+ */
6865
+ export const zDeleteProgramResponse = z.void();
6866
+ export const zGetProgramPath = z.object({
6867
+ id: z.string()
6868
+ });
6869
+ /**
6870
+ * Success
6871
+ */
6872
+ export const zGetProgramResponse = zApprenticeshipProgramResponseObject;
6804
6873
  export const zUpdateProgramBody = zApprenticeshipProgramUpdateParameters;
6805
6874
  export const zUpdateProgramPath = z.object({
6806
6875
  id: z.string()
@@ -6878,6 +6947,22 @@ export const zCreateWageSchedulePath = z.object({
6878
6947
  * Created
6879
6948
  */
6880
6949
  export const zCreateWageScheduleResponse = zApprenticeshipWageScheduleResponseObject;
6950
+ export const zDeleteWageSchedulePath = z.object({
6951
+ occupation_id: z.string(),
6952
+ id: z.string()
6953
+ });
6954
+ /**
6955
+ * No Content
6956
+ */
6957
+ export const zDeleteWageScheduleResponse = z.void();
6958
+ export const zGetWageSchedulePath = z.object({
6959
+ occupation_id: z.string(),
6960
+ id: z.string()
6961
+ });
6962
+ /**
6963
+ * Success
6964
+ */
6965
+ export const zGetWageScheduleResponse = zApprenticeshipWageScheduleResponseObject;
6881
6966
  export const zUpdateWageScheduleBody = zApprenticeshipWageScheduleUpdateParameters;
6882
6967
  export const zUpdateWageSchedulePath = z.object({
6883
6968
  occupation_id: z.string(),
@@ -7915,6 +8000,20 @@ export const zCreateDepartmentBody = zDepartmentParameters;
7915
8000
  * Created
7916
8001
  */
7917
8002
  export const zCreateDepartmentResponse = zDepartmentResponseObject;
8003
+ export const zDeleteDepartmentPath = z.object({
8004
+ id: z.string()
8005
+ });
8006
+ /**
8007
+ * No Content
8008
+ */
8009
+ export const zDeleteDepartmentResponse = z.void();
8010
+ export const zGetDepartmentPath = z.object({
8011
+ id: z.string()
8012
+ });
8013
+ /**
8014
+ * Success
8015
+ */
8016
+ export const zGetDepartmentResponse = zDepartmentResponseObject;
7918
8017
  export const zUpdateDepartmentBody = zDepartmentUpdateParameters;
7919
8018
  export const zUpdateDepartmentPath = z.object({
7920
8019
  id: z.string()
@@ -8470,6 +8569,8 @@ export const zListJobsQuery = z.object({
8470
8569
  'feature',
8471
8570
  'quantity'
8472
8571
  ]).optional(),
8572
+ 'filter[name]': z.string().optional(),
8573
+ 'filter[purchase_order_number]': z.string().optional(),
8473
8574
  'page[cursor]': z.string().optional(),
8474
8575
  'page[limit]': z.int().gte(1).optional().default(20),
8475
8576
  page: z.string().optional(),
@@ -8888,6 +8989,13 @@ export const zCreatePayRateRulePackageBody = zPayRatesRulePackageParameters;
8888
8989
  * Created
8889
8990
  */
8890
8991
  export const zCreatePayRateRulePackageResponse = zPayRatesRulePackageResponseObject;
8992
+ export const zDeletePayRateRulePackagePath = z.object({
8993
+ id: z.string()
8994
+ });
8995
+ /**
8996
+ * No Content
8997
+ */
8998
+ export const zDeletePayRateRulePackageResponse = z.void();
8891
8999
  export const zGetPayRateRulePackagePath = z.object({
8892
9000
  id: z.string()
8893
9001
  });
@@ -8895,6 +9003,14 @@ export const zGetPayRateRulePackagePath = z.object({
8895
9003
  * Success
8896
9004
  */
8897
9005
  export const zGetPayRateRulePackageResponse = zPayRatesRulePackageResponseObject;
9006
+ export const zUpdatePayRateRulePackageBody = zPayRatesRulePackageUpdateParameters;
9007
+ export const zUpdatePayRateRulePackagePath = z.object({
9008
+ id: z.string()
9009
+ });
9010
+ /**
9011
+ * Success
9012
+ */
9013
+ export const zUpdatePayRateRulePackageResponse = zPayRatesRulePackageResponseObject;
8898
9014
  export const zListAggregateTimeImportsPath = z.object({
8899
9015
  pay_period_id: z.string()
8900
9016
  });
@@ -9654,6 +9770,7 @@ export const zListProjectsQuery = z.object({
9654
9770
  'none'
9655
9771
  ]).optional(),
9656
9772
  'filter[external_id]': z.string().optional(),
9773
+ 'filter[name]': z.string().optional(),
9657
9774
  'filter[created_at][gte]': z.iso.datetime().optional(),
9658
9775
  'filter[created_at][lte]': z.iso.datetime().optional(),
9659
9776
  'filter[updated_at][gte]': z.iso.datetime().optional(),
@@ -9697,6 +9814,13 @@ export const zCreateCompanyUserDetailBody = zPwaCompanyUserDetailsParameters;
9697
9814
  * Created
9698
9815
  */
9699
9816
  export const zCreateCompanyUserDetailResponse = zPwaCompanyUserDetailsResponseObject;
9817
+ export const zDeleteCompanyUserDetailPath = z.object({
9818
+ id: z.string()
9819
+ });
9820
+ /**
9821
+ * No Content
9822
+ */
9823
+ export const zDeleteCompanyUserDetailResponse = z.void();
9700
9824
  export const zUpdateCompanyUserDetailBody = zPwaCompanyUserDetailsUpdateParameters;
9701
9825
  export const zUpdateCompanyUserDetailPath = z.object({
9702
9826
  id: z.string()
@@ -9897,6 +10021,22 @@ export const zCreatePositionPath = z.object({
9897
10021
  * Created
9898
10022
  */
9899
10023
  export const zCreatePositionResponse = zPositionResponseObject;
10024
+ export const zDeletePositionPath = z.object({
10025
+ job_id: z.string(),
10026
+ id: z.string()
10027
+ });
10028
+ /**
10029
+ * No Content
10030
+ */
10031
+ export const zDeletePositionResponse = z.void();
10032
+ export const zGetPositionPath = z.object({
10033
+ job_id: z.string(),
10034
+ id: z.string()
10035
+ });
10036
+ /**
10037
+ * Success
10038
+ */
10039
+ export const zGetPositionResponse = zPositionResponseObject;
9900
10040
  export const zUpdatePositionBody = zPositionParameters;
9901
10041
  export const zUpdatePositionPath = z.object({
9902
10042
  job_id: z.string(),
@@ -10138,6 +10278,13 @@ export const zDeleteTimeEntryPath = z.object({
10138
10278
  * Success
10139
10279
  */
10140
10280
  export const zDeleteTimeEntryResponse = zTimeEntryResponseObject;
10281
+ export const zGetTimeEntryPath = z.object({
10282
+ id: z.string()
10283
+ });
10284
+ /**
10285
+ * Success
10286
+ */
10287
+ export const zGetTimeEntryResponse = zTimeEntryResponseObject;
10141
10288
  export const zUpdateTimeEntryBody = zTimeEntryUpdateParameters;
10142
10289
  export const zUpdateTimeEntryPath = z.object({
10143
10290
  id: z.string()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsptch-work/api-client",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "Generated TypeScript client for the DSPTCH REST API.",
5
5
  "keywords": [
6
6
  "dsptch",