@dsptch-work/api-client 0.16.0 → 0.17.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.
@@ -413,6 +413,7 @@ export const zDirectUploadParameters = z.object({
413
413
  'assets.items.service_events',
414
414
  'assets.products',
415
415
  'assets.vendors',
416
+ 'compliance.checks',
416
417
  'pay_periods.imports.aggregate_times',
417
418
  'pay_periods.imports.dsptch_cprs',
418
419
  'pay_periods.imports.time_entries',
@@ -2842,6 +2843,7 @@ export const zComplianceCheckResponseObject = z.object({
2842
2843
  timekeeping_pay_period_id: z.string().nullable(),
2843
2844
  user_id: z.string().nullable(),
2844
2845
  employment_id: z.string().nullable(),
2846
+ assignee_user_ids: z.array(z.string()),
2845
2847
  title: z.string(),
2846
2848
  description: z.string(),
2847
2849
  category: z.enum([
@@ -2877,12 +2879,187 @@ export const zComplianceCheckResponseObject = z.object({
2877
2879
  updated_at: z.iso.datetime()
2878
2880
  });
2879
2881
  /**
2880
- * Update a compliance check. Both fields are optional.
2882
+ * A document attached to a compliance check.
2883
+ */
2884
+ export const zComplianceCheckDocumentObject = z.object({
2885
+ id: z.string(),
2886
+ filename: z.string(),
2887
+ content_type: z.string().nullable(),
2888
+ byte_size: z.int(),
2889
+ url: z.string(),
2890
+ created_by_user_id: z.string(),
2891
+ created_at: z.iso.datetime()
2892
+ });
2893
+ /**
2894
+ * A single compliance check, with the documents attached to it. Same fields as compliance_check_response_object plus `documents`.
2895
+ */
2896
+ export const zComplianceCheckDetailResponseObject = z.object({
2897
+ id: z.string(),
2898
+ type: z.enum([
2899
+ 'Compliances::CompanyCheck',
2900
+ 'Compliances::JobCheck',
2901
+ 'Compliances::ProjectCheck',
2902
+ 'Compliances::TimeCardCheck',
2903
+ 'Compliances::PayPeriodCheck',
2904
+ 'Compliances::UserCheck',
2905
+ 'Compliances::UserCompanyCheck'
2906
+ ]),
2907
+ status: z.enum([
2908
+ 'passed',
2909
+ 'failed',
2910
+ 'not_applicable',
2911
+ 'dismissed',
2912
+ 'pending'
2913
+ ]),
2914
+ compliances_requirement_id: z.string(),
2915
+ company_id: z.string().nullable(),
2916
+ job_id: z.string().nullable(),
2917
+ project_id: z.string().nullable(),
2918
+ timekeeping_time_card_id: z.string().nullable(),
2919
+ timekeeping_pay_period_id: z.string().nullable(),
2920
+ user_id: z.string().nullable(),
2921
+ employment_id: z.string().nullable(),
2922
+ assignee_user_ids: z.array(z.string()),
2923
+ title: z.string(),
2924
+ description: z.string(),
2925
+ category: z.enum([
2926
+ 'apprenticeship',
2927
+ 'certified_payroll',
2928
+ 'company',
2929
+ 'job',
2930
+ 'payroll',
2931
+ 'project',
2932
+ 'regional',
2933
+ 'tax_credit',
2934
+ 'timekeeping',
2935
+ 'worker'
2936
+ ]),
2937
+ phase: z.enum([
2938
+ 'after_pay_date',
2939
+ 'before_approval_deadline',
2940
+ 'close_out',
2941
+ 'maintenance',
2942
+ 'onboarding',
2943
+ 'setup'
2944
+ ]),
2945
+ priority: z.enum([
2946
+ 'critical',
2947
+ 'high',
2948
+ 'medium',
2949
+ 'low'
2950
+ ]).nullable(),
2951
+ checked_at: z.iso.datetime().nullable(),
2952
+ passed_at: z.iso.datetime().nullable(),
2953
+ time_due: z.iso.datetime().nullable(),
2954
+ created_at: z.iso.datetime(),
2955
+ updated_at: z.iso.datetime(),
2956
+ documents: z.array(zComplianceCheckDocumentObject)
2957
+ });
2958
+ /**
2959
+ * Update a compliance check. Every field is optional.
2881
2960
  */
2882
2961
  export const zComplianceCheckParameters = z.object({
2883
2962
  status: z.enum(['dismissed', 'pending']).optional(),
2884
- time_due: z.iso.datetime().nullish()
2963
+ time_due: z.iso.datetime().nullish(),
2964
+ assignee_user_ids: z.array(z.string()).optional(),
2965
+ file_signed_id: z.string().optional()
2966
+ });
2967
+ export const zRichTextObject = z.object({
2968
+ text: z.string(),
2969
+ attachments: z.array(z.object({
2970
+ filename: z.string(),
2971
+ content_type: z.string().nullish(),
2972
+ byte_size: z.int(),
2973
+ url: z.string()
2974
+ }))
2885
2975
  });
2976
+ export const zTodoInboxTodoResponseObject = z.object({
2977
+ kind: z.enum(['todo']),
2978
+ id: z.string(),
2979
+ type: z.enum([
2980
+ 'company',
2981
+ 'job',
2982
+ 'project'
2983
+ ]),
2984
+ company_id: z.string().nullable(),
2985
+ job_id: z.string().nullable(),
2986
+ project_id: z.string().nullable(),
2987
+ name: z.string(),
2988
+ created_by_user_id: z.string(),
2989
+ updated_by_user_id: z.string(),
2990
+ completed: z.boolean(),
2991
+ task_assignee_user_ids: z.array(z.string()),
2992
+ description: zRichTextObject,
2993
+ time_due: z.iso.datetime().nullable(),
2994
+ created_at: z.iso.datetime(),
2995
+ updated_at: z.iso.datetime()
2996
+ });
2997
+ export const zTodoInboxComplianceCheckResponseObject = z.object({
2998
+ kind: z.enum(['compliance_check']),
2999
+ id: z.string(),
3000
+ type: z.enum([
3001
+ 'Compliances::CompanyCheck',
3002
+ 'Compliances::JobCheck',
3003
+ 'Compliances::ProjectCheck',
3004
+ 'Compliances::TimeCardCheck',
3005
+ 'Compliances::PayPeriodCheck',
3006
+ 'Compliances::UserCheck',
3007
+ 'Compliances::UserCompanyCheck'
3008
+ ]),
3009
+ status: z.enum([
3010
+ 'passed',
3011
+ 'failed',
3012
+ 'not_applicable',
3013
+ 'dismissed',
3014
+ 'pending'
3015
+ ]),
3016
+ compliances_requirement_id: z.string(),
3017
+ company_id: z.string().nullable(),
3018
+ job_id: z.string().nullable(),
3019
+ project_id: z.string().nullable(),
3020
+ timekeeping_time_card_id: z.string().nullable(),
3021
+ timekeeping_pay_period_id: z.string().nullable(),
3022
+ user_id: z.string().nullable(),
3023
+ employment_id: z.string().nullable(),
3024
+ assignee_user_ids: z.array(z.string()),
3025
+ title: z.string(),
3026
+ description: z.string(),
3027
+ category: z.enum([
3028
+ 'apprenticeship',
3029
+ 'certified_payroll',
3030
+ 'company',
3031
+ 'job',
3032
+ 'payroll',
3033
+ 'project',
3034
+ 'regional',
3035
+ 'tax_credit',
3036
+ 'timekeeping',
3037
+ 'worker'
3038
+ ]),
3039
+ phase: z.enum([
3040
+ 'after_pay_date',
3041
+ 'before_approval_deadline',
3042
+ 'close_out',
3043
+ 'maintenance',
3044
+ 'onboarding',
3045
+ 'setup'
3046
+ ]),
3047
+ priority: z.enum([
3048
+ 'critical',
3049
+ 'high',
3050
+ 'medium',
3051
+ 'low'
3052
+ ]).nullable(),
3053
+ checked_at: z.iso.datetime().nullable(),
3054
+ passed_at: z.iso.datetime().nullable(),
3055
+ time_due: z.iso.datetime().nullable(),
3056
+ created_at: z.iso.datetime(),
3057
+ updated_at: z.iso.datetime()
3058
+ });
3059
+ export const zTodoInboxEntryResponseObject = z.discriminatedUnion('kind', [
3060
+ zTodoInboxTodoResponseObject.extend({ kind: z.literal('todo') }),
3061
+ zTodoInboxComplianceCheckResponseObject.extend({ kind: z.literal('compliance_check') })
3062
+ ]);
2886
3063
  /**
2887
3064
  * One compliance requirement from the catalog. Requirements ship with the application, so the catalog reads the same for every company.
2888
3065
  */
@@ -3149,10 +3326,7 @@ export const zPositionParameters = z.object({
3149
3326
  hourly_rate_cents: z.number().nullish(),
3150
3327
  pwa_wage_pay_rate_cents: z.number().nullish(),
3151
3328
  wage_adder_rate_cents: z.number().nullish(),
3152
- job_wage_determinations_positions_attributes: z.array(z.object({
3153
- id: z.int().nullish(),
3154
- job_wage_determination_id: z.string().nullish()
3155
- })).optional(),
3329
+ job_wage_determination_ids: z.array(z.string()).optional(),
3156
3330
  pwa_details_attributes: z.object({
3157
3331
  skill_level: z.string().nullish()
3158
3332
  }).optional()
@@ -3512,7 +3686,7 @@ export const zUserRoleResponse = z.object({
3512
3686
  */
3513
3687
  export const zUserCompanyType = z.enum(['EMPLOYEE', 'CONTRACTOR']).nullable();
3514
3688
  /**
3515
- * A worker as your company sees them: the cross-company person merged with their employment record at your company (title, pay, benefits, and accruals), their roles at your company, and optional prevailing-wage compliance details. There is no delete — removing a worker terminates their employment at the company (see the user-company endpoints), which sets termination_date and drops them from the default list.
3689
+ * A worker as your company sees them: the cross-company person merged with their employment record at your company (title, pay, benefits, and accruals), their roles at your company, and optional prevailing-wage compliance details. Your company sees everyone it employs, everyone it has granted a role, and everyone it has invited, which is the same set the web app shows. A role holder or an invitee your company does not employ has no employment record to merge, so the employment fields (employment_id through employment_window, plus manager_user_id) are null for them, no employment custom fields are published for them, and employment_state reads none. There is no delete — removing a worker terminates their employment at the company (see the user-company endpoints), which sets termination_date and drops them from the default list.
3516
3690
  */
3517
3691
  export const zUserResponseObject = z.object({
3518
3692
  id: z.string(),
@@ -3533,13 +3707,19 @@ export const zUserResponseObject = z.object({
3533
3707
  updated_at: z.iso.datetime(),
3534
3708
  winda_id: z.string().nullable(),
3535
3709
  linkedin_url: z.string().nullable(),
3536
- employment_id: z.string(),
3710
+ employment_state: z.enum([
3711
+ 'active',
3712
+ 'scheduled',
3713
+ 'terminated',
3714
+ 'none'
3715
+ ]),
3716
+ employment_id: z.string().nullable(),
3537
3717
  type: zUserCompanyType,
3538
3718
  title: z.string().nullable(),
3539
- overtime_eligible: z.boolean(),
3540
- enrolled_in_t_and_a: z.boolean(),
3719
+ overtime_eligible: z.boolean().nullable(),
3720
+ enrolled_in_t_and_a: z.boolean().nullable(),
3541
3721
  payroll_id: z.string().nullable(),
3542
- compensation_type: z.string(),
3722
+ compensation_type: z.string().nullable(),
3543
3723
  hourly_rate: z.string().nullable(),
3544
3724
  training_annual_amount: z.string().nullable(),
3545
3725
  employer_combined_health_amount: z.string().nullable(),
@@ -3553,7 +3733,7 @@ export const zUserResponseObject = z.object({
3553
3733
  employment_window: z.object({
3554
3734
  valid_from: z.iso.datetime().nullable(),
3555
3735
  valid_to: z.iso.datetime().nullable()
3556
- }),
3736
+ }).nullable(),
3557
3737
  manager_user_id: z.string().nullable(),
3558
3738
  roles: z.array(z.string()),
3559
3739
  company_user_pwa_info: z.object({
@@ -6605,6 +6785,7 @@ export const zListChecksQuery = z.object({
6605
6785
  'filter[job_id][null]': z.boolean().optional(),
6606
6786
  'filter[project_id]': z.string().optional(),
6607
6787
  'filter[compliances_requirement_id]': z.string().optional(),
6788
+ 'filter[assignee_user_id]': z.string().optional(),
6608
6789
  'filter[time_due][gte]': z.iso.datetime().optional(),
6609
6790
  'filter[time_due][lte]': z.iso.datetime().optional(),
6610
6791
  filter: z.string().optional(),
@@ -6627,7 +6808,7 @@ export const zGetCheckPath = z.object({
6627
6808
  /**
6628
6809
  * Success
6629
6810
  */
6630
- export const zGetCheckResponse = zComplianceCheckResponseObject;
6811
+ export const zGetCheckResponse = zComplianceCheckDetailResponseObject;
6631
6812
  export const zUpdateCheckBody = zComplianceCheckParameters;
6632
6813
  export const zUpdateCheckPath = z.object({
6633
6814
  id: z.string()
@@ -6635,7 +6816,7 @@ export const zUpdateCheckPath = z.object({
6635
6816
  /**
6636
6817
  * Success
6637
6818
  */
6638
- export const zUpdateCheckResponse = zComplianceCheckResponseObject;
6819
+ export const zUpdateCheckResponse = zComplianceCheckDetailResponseObject;
6639
6820
  export const zListRequirementsQuery = z.object({
6640
6821
  'filter[search]': z.string().optional(),
6641
6822
  'filter[type]': z.string().optional(),
@@ -8715,6 +8896,12 @@ export const zGetTimeCardActualPath = z.object({
8715
8896
  * Success
8716
8897
  */
8717
8898
  export const zGetTimeCardActualResponse = zTimeCardActualsResponseObject;
8899
+ /**
8900
+ * Success
8901
+ */
8902
+ export const zListTodoInboxResponse = z.object({
8903
+ data: z.array(zTodoInboxEntryResponseObject)
8904
+ });
8718
8905
  export const zListUserRolesQuery = z.object({
8719
8906
  'filter[user_id]': z.string().optional(),
8720
8907
  'filter[role]': z.string().optional(),
@@ -8829,7 +9016,9 @@ export const zUpdateCompanyResponse = zUserResponseObject;
8829
9016
  export const zListUsersQuery = z.object({
8830
9017
  'filter[state]': z.enum([
8831
9018
  'active',
9019
+ 'scheduled',
8832
9020
  'terminated',
9021
+ 'none',
8833
9022
  'all'
8834
9023
  ]).optional(),
8835
9024
  'page[cursor]': z.string().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsptch-work/api-client",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Generated TypeScript client for the DSPTCH REST API.",
5
5
  "keywords": [
6
6
  "dsptch",