@dsptch-work/api-client 0.27.0 → 0.29.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.
@@ -5258,6 +5258,57 @@ export class PaystubImports {
5258
5258
  });
5259
5259
  }
5260
5260
  }
5261
+ export class WidePaystubImports {
5262
+ /**
5263
+ * List Wide Paystub Imports
5264
+ *
5265
+ * **Required scope:**
5266
+ *
5267
+ * `payrolls.payroll_runs.imports.wide_paystubs:read`
5268
+ *
5269
+ */
5270
+ static listWidePaystubImports(options) {
5271
+ return (options.client ?? client).get({
5272
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
5273
+ url: '/api/v1/payrolls/payroll_runs/{payroll_run_id}/imports/wide_paystubs',
5274
+ ...options
5275
+ });
5276
+ }
5277
+ /**
5278
+ * Create Wide Paystub Import
5279
+ *
5280
+ * **Required scope:**
5281
+ *
5282
+ * `payrolls.payroll_runs.imports.wide_paystubs:create`
5283
+ *
5284
+ */
5285
+ static createWidePaystubImport(options) {
5286
+ return (options.client ?? client).post({
5287
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
5288
+ url: '/api/v1/payrolls/payroll_runs/{payroll_run_id}/imports/wide_paystubs',
5289
+ ...options,
5290
+ headers: {
5291
+ 'Content-Type': 'application/json',
5292
+ ...options.headers
5293
+ }
5294
+ });
5295
+ }
5296
+ /**
5297
+ * Get Wide Paystub Import
5298
+ *
5299
+ * **Required scope:**
5300
+ *
5301
+ * `payrolls.payroll_runs.imports.wide_paystubs:read`
5302
+ *
5303
+ */
5304
+ static getWidePaystubImport(options) {
5305
+ return (options.client ?? client).get({
5306
+ security: [{ name: 'X-Api-Key', type: 'apiKey' }],
5307
+ url: '/api/v1/payrolls/payroll_runs/{payroll_run_id}/imports/wide_paystubs/{id}',
5308
+ ...options
5309
+ });
5310
+ }
5311
+ }
5261
5312
  export class PayrollRuns {
5262
5313
  /**
5263
5314
  * List payroll runs
@@ -395,7 +395,7 @@ export type DirectUploadParameters = {
395
395
  /**
396
396
  * What the file is for, named as the endpoint that will attach it (for example `assets.vendors`). Required. It decides where the file is stored, and the signed ID this call returns is issued for that resource alone — it will not resolve at any other endpoint, so a vendor logo cannot be attached as an avatar, or an avatar as a logo.
397
397
  */
398
- resource: 'assets.items' | 'assets.items.documents' | 'assets.items.service_events' | 'assets.products' | 'assets.vendors' | 'compliance.checks' | 'internal.companies' | 'internal.company_todos' | 'internal.job_todos' | 'internal.project_todos' | 'pay_periods.imports.aggregate_times' | 'pay_periods.imports.dsptch_cprs' | 'pay_periods.imports.time_entries' | 'payrolls.payroll_runs.imports.paystubs' | 'users';
398
+ resource: 'assets.items' | 'assets.items.documents' | 'assets.items.service_events' | 'assets.products' | 'assets.vendors' | 'compliance.checks' | 'internal.companies' | 'internal.company_todos' | 'internal.job_todos' | 'internal.project_todos' | 'pay_periods.imports.aggregate_times' | 'pay_periods.imports.dsptch_cprs' | 'pay_periods.imports.time_entries' | 'payrolls.payroll_runs.imports.paystubs' | 'payrolls.payroll_runs.imports.wide_paystubs' | 'users';
399
399
  /**
400
400
  * Metadata describing the file being registered, before its bytes are uploaded.
401
401
  */
@@ -5139,6 +5139,10 @@ export type FormDefinitionObject = {
5139
5139
  * Whether the form is always shown to users.
5140
5140
  */
5141
5141
  always_visible: boolean;
5142
+ /**
5143
+ * Whether the form is hidden from free-submit catalogs and available only through assignments and tasks.
5144
+ */
5145
+ assignment_only: boolean;
5142
5146
  /**
5143
5147
  * Whether the form collects sensitive data.
5144
5148
  */
@@ -6072,6 +6076,54 @@ export type PaystubImportParameters = {
6072
6076
  */
6073
6077
  file_signed_id: string;
6074
6078
  };
6079
+ /**
6080
+ * One bulk upload of wide paystub amounts against a payroll run, and how it turned out.
6081
+ */
6082
+ export type WidePaystubImportResponseObject = {
6083
+ /**
6084
+ * Unique identifier.
6085
+ */
6086
+ id: string;
6087
+ /**
6088
+ * The payroll run the amounts were imported against.
6089
+ */
6090
+ payrolls_payroll_run_id: string;
6091
+ /**
6092
+ * Where the import has got to. `pending` until the background job starts, then `success` or `failed`.
6093
+ */
6094
+ status: 'pending' | 'processing' | 'processed' | 'success' | 'failed' | 'superseded' | 'withdrawn';
6095
+ /**
6096
+ * How many rows passed validation and were prepared for writing. On a `success` import that is also how many rows were written. On a `failed` one it is not — the import writes all of its rows in a single transaction, so a failure part-way through undoes every write already made while this count still reports every row that had been prepared.
6097
+ */
6098
+ processed_rows_count: number;
6099
+ /**
6100
+ * Every problem found after the import was accepted, oldest row first; empty when there were none, and always empty while the import is `pending`.
6101
+ */
6102
+ processing_errors: Array<ImportProcessingError>;
6103
+ /**
6104
+ * When processing finished; null while the import is still pending.
6105
+ */
6106
+ completed_at: string | null;
6107
+ /**
6108
+ * When the import was submitted.
6109
+ */
6110
+ created_at: string;
6111
+ /**
6112
+ * When the import was last modified.
6113
+ */
6114
+ updated_at: string;
6115
+ };
6116
+ /**
6117
+ * Submit a spreadsheet of wide paystub amounts for a payroll run. Each row is one employee: payroll_id names them, and every other column is a pay, deduction, or contribution amount. Extra pay-element columns are accepted; they are not unknown columns. The run's pay schedule must record the contributor on the external map (`requires_external_map_contributor`) and must not be connected to a payroll provider; where a provider is configured the paystubs come from that connection and a file is refused. payroll_id must be present as a header and carry a value on every row, or the file is refused naming what is missing. Header matching ignores case and treats spaces as underscores, and column order does not matter.
6118
+ *
6119
+ * Because acceptance is synchronous but the write happens in the background, only one wide paystub import at a time is accepted for a payroll run: while an earlier one is still `pending` or `processing`, a second answers 409 naming `import_in_progress`, and nothing is written. Poll the earlier import until it reports, then submit again.
6120
+ */
6121
+ export type WidePaystubImportParameters = {
6122
+ /**
6123
+ * A signed_id from POST /api/v1/direct_uploads identifying the uploaded spreadsheet. Register the upload naming `payrolls.payroll_runs.imports.wide_paystubs` — a signed_id issued for any other resource will not resolve here.
6124
+ */
6125
+ file_signed_id: string;
6126
+ };
6075
6127
  /**
6076
6128
  * One bulk upload of time entries against a pay period, and how it turned out.
6077
6129
  */
@@ -8644,7 +8696,7 @@ export type PaystubLineItemResponseObject = {
8644
8696
  updated_at: string;
8645
8697
  };
8646
8698
  /**
8647
- * Request body for creating a paystub line item. All four fields are required.
8699
+ * Request body for creating a paystub line item. All four fields are required. Undeclared body keys are rejected with 400; references outside the authenticated company return 404.
8648
8700
  */
8649
8701
  export type PaystubLineItemParameters = {
8650
8702
  /**
@@ -8660,12 +8712,12 @@ export type PaystubLineItemParameters = {
8660
8712
  */
8661
8713
  contributor: 'employee' | 'employer';
8662
8714
  /**
8663
- * ID of the external map defining which compensation element this line item represents. Required.
8715
+ * Family ID of the external map defining which compensation element this line item represents. Must be global or belong to a pay schedule of the payroll run company; another schedule within that company is allowed. Required.
8664
8716
  */
8665
8717
  payrolls_external_map_id: string;
8666
8718
  };
8667
8719
  /**
8668
- * Request body for updating a paystub line item. Send only the fields to change.
8720
+ * Request body for updating a paystub line item. Send only the fields to change. Undeclared body keys are rejected with 400; newly supplied references outside the authenticated company return 404.
8669
8721
  */
8670
8722
  export type PaystubLineItemUpdateParameters = {
8671
8723
  /**
@@ -8681,7 +8733,7 @@ export type PaystubLineItemUpdateParameters = {
8681
8733
  */
8682
8734
  contributor?: 'employee' | 'employer';
8683
8735
  /**
8684
- * ID of the external map defining which compensation element this line item represents. Omit to leave it unchanged.
8736
+ * Family ID of the external map defining which compensation element this line item represents. A changed reference must be global or belong to a pay schedule of the payroll run company. Omit or repeat the held ID to leave the relationship unchanged.
8685
8737
  */
8686
8738
  payrolls_external_map_id?: string;
8687
8739
  };
@@ -10295,6 +10347,10 @@ export type WageDeterminationResponseObject = {
10295
10347
  * Identifier of this determination record — permanent, because the record is an immutable DOL publication; a DOL revision arrives as a new record linked through superseded_by_wage_determination_id, not a rewrite of this one.
10296
10348
  */
10297
10349
  id: string;
10350
+ /**
10351
+ * Stable UUID identifying the annual general decision family, shared by every modification. A successor-year general decision has its own UID. Use id to retrieve a specific published revision.
10352
+ */
10353
+ uid: string;
10298
10354
  /**
10299
10355
  * DOL general decision number identifying this determination (e.g. "CA20240001"); combine with modification_number for the full versioned identifier (e.g. "CA20240001/1").
10300
10356
  */
@@ -13668,6 +13724,10 @@ export type ListApprenticesData = {
13668
13724
  *
13669
13725
  */
13670
13726
  'filter[status]'?: string;
13727
+ /**
13728
+ * Fuzzy-matches the enrolled worker name (trigram word-similarity). Matches the user name only — not the program, occupation, or wage-schedule name.
13729
+ */
13730
+ 'filter[name]'?: string;
13671
13731
  'filter[created_at][gte]'?: string;
13672
13732
  'filter[created_at][lte]'?: string;
13673
13733
  'filter[updated_at][gte]'?: string;
@@ -18643,6 +18703,10 @@ export type ListFormSubmissionsData = {
18643
18703
  path?: never;
18644
18704
  query?: {
18645
18705
  'filter[form_definition_id]'?: string;
18706
+ /**
18707
+ * Returns only submissions for this worker.
18708
+ */
18709
+ 'filter[user_id]'?: string;
18646
18710
  'filter[created_at][gte]'?: string;
18647
18711
  'filter[created_at][lte]'?: string;
18648
18712
  'filter[updated_at][gte]'?: string;
@@ -22935,6 +22999,140 @@ export type GetPaystubImportResponses = {
22935
22999
  200: PaystubImportResponseObject;
22936
23000
  };
22937
23001
  export type GetPaystubImportResponse = GetPaystubImportResponses[keyof GetPaystubImportResponses];
23002
+ export type ListWidePaystubImportsData = {
23003
+ body?: never;
23004
+ path: {
23005
+ payroll_run_id: string;
23006
+ };
23007
+ query?: {
23008
+ /**
23009
+ * Filter by import status:
23010
+ * * `pending`
23011
+ * * `processing`
23012
+ * * `processed`
23013
+ * * `success`
23014
+ * * `failed`
23015
+ * * `superseded`
23016
+ * * `withdrawn`
23017
+ *
23018
+ */
23019
+ 'filter[status]'?: string;
23020
+ 'filter[completed_at][gte]'?: string;
23021
+ 'filter[completed_at][lte]'?: string;
23022
+ 'filter[created_at][gte]'?: string;
23023
+ 'filter[created_at][lte]'?: string;
23024
+ 'filter[updated_at][gte]'?: string;
23025
+ 'filter[updated_at][lte]'?: string;
23026
+ /**
23027
+ * This pagination cursor corresponds to the cursor value found in the response in
23028
+ * `meta.page.next_cursor`.
23029
+ */
23030
+ 'page[cursor]'?: string;
23031
+ /**
23032
+ * Maximum number of records to return per page. Defaults to 20. A value above 100 is capped to 100 rather than rejected; a value that is zero, negative, or not an integer is rejected with a `400`.
23033
+ */
23034
+ 'page[limit]'?: number;
23035
+ page?: string;
23036
+ filter?: string;
23037
+ 'filter[unexpected]'?: string;
23038
+ };
23039
+ url: '/api/v1/payrolls/payroll_runs/{payroll_run_id}/imports/wide_paystubs';
23040
+ };
23041
+ export type ListWidePaystubImportsErrors = {
23042
+ /**
23043
+ * Bad Request
23044
+ */
23045
+ 400: Problem;
23046
+ /**
23047
+ * Forbidden
23048
+ */
23049
+ 403: Problem;
23050
+ /**
23051
+ * Not Found
23052
+ */
23053
+ 404: Problem;
23054
+ /**
23055
+ * Unprocessable Content
23056
+ */
23057
+ 422: Problem;
23058
+ };
23059
+ export type ListWidePaystubImportsError = ListWidePaystubImportsErrors[keyof ListWidePaystubImportsErrors];
23060
+ export type ListWidePaystubImportsResponses = {
23061
+ /**
23062
+ * Success
23063
+ */
23064
+ 200: {
23065
+ meta: Meta;
23066
+ links: Links;
23067
+ data: Array<WidePaystubImportResponseObject>;
23068
+ };
23069
+ };
23070
+ export type ListWidePaystubImportsResponse = ListWidePaystubImportsResponses[keyof ListWidePaystubImportsResponses];
23071
+ export type CreateWidePaystubImportData = {
23072
+ body: WidePaystubImportParameters;
23073
+ path: {
23074
+ payroll_run_id: string;
23075
+ };
23076
+ query?: never;
23077
+ url: '/api/v1/payrolls/payroll_runs/{payroll_run_id}/imports/wide_paystubs';
23078
+ };
23079
+ export type CreateWidePaystubImportErrors = {
23080
+ /**
23081
+ * Bad Request
23082
+ */
23083
+ 400: Problem;
23084
+ /**
23085
+ * Forbidden
23086
+ */
23087
+ 403: Problem;
23088
+ /**
23089
+ * Not Found
23090
+ */
23091
+ 404: Problem;
23092
+ /**
23093
+ * Conflict
23094
+ */
23095
+ 409: Problem;
23096
+ /**
23097
+ * Unprocessable Content
23098
+ */
23099
+ 422: Problem;
23100
+ };
23101
+ export type CreateWidePaystubImportError = CreateWidePaystubImportErrors[keyof CreateWidePaystubImportErrors];
23102
+ export type CreateWidePaystubImportResponses = {
23103
+ /**
23104
+ * Created
23105
+ */
23106
+ 201: WidePaystubImportResponseObject;
23107
+ };
23108
+ export type CreateWidePaystubImportResponse = CreateWidePaystubImportResponses[keyof CreateWidePaystubImportResponses];
23109
+ export type GetWidePaystubImportData = {
23110
+ body?: never;
23111
+ path: {
23112
+ payroll_run_id: string;
23113
+ id: string;
23114
+ };
23115
+ query?: never;
23116
+ url: '/api/v1/payrolls/payroll_runs/{payroll_run_id}/imports/wide_paystubs/{id}';
23117
+ };
23118
+ export type GetWidePaystubImportErrors = {
23119
+ /**
23120
+ * Forbidden
23121
+ */
23122
+ 403: Problem;
23123
+ /**
23124
+ * Not Found
23125
+ */
23126
+ 404: Problem;
23127
+ };
23128
+ export type GetWidePaystubImportError = GetWidePaystubImportErrors[keyof GetWidePaystubImportErrors];
23129
+ export type GetWidePaystubImportResponses = {
23130
+ /**
23131
+ * Success
23132
+ */
23133
+ 200: WidePaystubImportResponseObject;
23134
+ };
23135
+ export type GetWidePaystubImportResponse = GetWidePaystubImportResponses[keyof GetWidePaystubImportResponses];
22938
23136
  export type ListPayrollRunsData = {
22939
23137
  body?: never;
22940
23138
  path?: never;
@@ -23160,10 +23358,18 @@ export type CreatePaystubLineItemData = {
23160
23358
  url: '/api/v1/paystub_line_items';
23161
23359
  };
23162
23360
  export type CreatePaystubLineItemErrors = {
23361
+ /**
23362
+ * Bad Request
23363
+ */
23364
+ 400: Problem;
23163
23365
  /**
23164
23366
  * Forbidden
23165
23367
  */
23166
23368
  403: Problem;
23369
+ /**
23370
+ * Not Found
23371
+ */
23372
+ 404: Problem;
23167
23373
  /**
23168
23374
  * Unprocessable Content
23169
23375
  */
@@ -23247,6 +23453,10 @@ export type UpdatePaystubLineItemData = {
23247
23453
  url: '/api/v1/paystub_line_items/{id}';
23248
23454
  };
23249
23455
  export type UpdatePaystubLineItemErrors = {
23456
+ /**
23457
+ * Bad Request
23458
+ */
23459
+ 400: Problem;
23250
23460
  /**
23251
23461
  * Forbidden
23252
23462
  */
@@ -24163,6 +24373,10 @@ export type ListPerDiemsData = {
24163
24373
  * Filter by taxable status
24164
24374
  */
24165
24375
  'filter[taxable]'?: boolean;
24376
+ /**
24377
+ * Fuzzy-matches the per diem name (trigram word-similarity). Matches the name column only.
24378
+ */
24379
+ 'filter[name]'?: string;
24166
24380
  'filter[created_at][gte]'?: string;
24167
24381
  'filter[created_at][lte]'?: string;
24168
24382
  'filter[updated_at][gte]'?: string;
@@ -24504,6 +24718,22 @@ export type ListCompletionsData = {
24504
24718
  'filter[scope_kind]'?: string;
24505
24719
  'filter[feature_id]'?: string;
24506
24720
  'filter[created_by_user_id]'?: string;
24721
+ /**
24722
+ * Feature completions on this site, or quantity completions on a job that has exactly this one site.
24723
+ */
24724
+ 'filter[site_id]'?: string;
24725
+ /**
24726
+ * Completions whose crew includes this worker. Distinct from created_by_user_id (the filer).
24727
+ */
24728
+ 'filter[crew_user_id]'?: string;
24729
+ /**
24730
+ * Completions whose crew includes a current member of this department.
24731
+ */
24732
+ 'filter[crew_department_id]'?: string;
24733
+ /**
24734
+ * Completions whose crew includes a member of this group.
24735
+ */
24736
+ 'filter[crew_group_id]'?: string;
24507
24737
  'filter[created_at][gte]'?: string;
24508
24738
  'filter[created_at][lte]'?: string;
24509
24739
  'filter[updated_at][gte]'?: string;
@@ -25522,6 +25752,18 @@ export type ListPositionsData = {
25522
25752
  job_id: string;
25523
25753
  };
25524
25754
  query?: {
25755
+ /**
25756
+ * Return positions on this job fulfilled by this user. A user with no position on the job returns an empty list.
25757
+ */
25758
+ 'filter[fulfilled_by_user_id]'?: string;
25759
+ /**
25760
+ * Set to `true` to return unfilled positions (no assigned worker).
25761
+ */
25762
+ 'filter[fulfilled_by_user_id][null]'?: boolean;
25763
+ /**
25764
+ * Return positions on this job with this function.
25765
+ */
25766
+ 'filter[position_function_id]'?: string;
25525
25767
  'filter[created_at][gte]'?: string;
25526
25768
  'filter[created_at][lte]'?: string;
25527
25769
  'filter[updated_at][gte]'?: string;