import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient"; import * as core from "../../../../core"; import type * as Square from "../../../index"; import { BreakTypesClient } from "../resources/breakTypes/client/Client"; import { EmployeeWagesClient } from "../resources/employeeWages/client/Client"; import { ShiftsClient } from "../resources/shifts/client/Client"; import { TeamMemberWagesClient } from "../resources/teamMemberWages/client/Client"; import { WorkweekConfigsClient } from "../resources/workweekConfigs/client/Client"; export declare namespace LaborClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class LaborClient { protected readonly _options: NormalizedClientOptionsWithAuth; protected _breakTypes: BreakTypesClient | undefined; protected _employeeWages: EmployeeWagesClient | undefined; protected _shifts: ShiftsClient | undefined; protected _teamMemberWages: TeamMemberWagesClient | undefined; protected _workweekConfigs: WorkweekConfigsClient | undefined; constructor(options?: LaborClient.Options); get breakTypes(): BreakTypesClient; get employeeWages(): EmployeeWagesClient; get shifts(): ShiftsClient; get teamMemberWages(): TeamMemberWagesClient; get workweekConfigs(): WorkweekConfigsClient; /** * Creates a scheduled shift by providing draft shift details such as job ID, * team member assignment, and start and end times. * * The following `draft_shift_details` fields are required: * - `location_id` * - `job_id` * - `start_at` * - `end_at` * * @param {Square.CreateScheduledShiftRequest} request * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.createScheduledShift({ * idempotencyKey: "HIDSNG5KS478L", * scheduledShift: { * draftShiftDetails: { * teamMemberId: "ormj0jJJZ5OZIzxrZYJI", * locationId: "PAA1RJZZKXBFG", * jobId: "FzbJAtt9qEWncK1BWgVCxQ6M", * startAt: "2019-01-25T03:11:00-05:00", * endAt: "2019-01-25T13:11:00-05:00", * notes: "Dont forget to prep the vegetables", * isDeleted: false * } * } * }) */ createScheduledShift(request: Square.CreateScheduledShiftRequest, requestOptions?: LaborClient.RequestOptions): core.HttpResponsePromise; private __createScheduledShift; /** * Publishes 1 - 100 scheduled shifts. This endpoint takes a map of individual publish * requests and returns a map of responses. When a scheduled shift is published, Square keeps * the `draft_shift_details` field as is and copies it to the `published_shift_details` field. * * The minimum `start_at` and maximum `end_at` timestamps of all shifts in a * `BulkPublishScheduledShifts` request must fall within a two-week period. * * @param {Square.BulkPublishScheduledShiftsRequest} request * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.bulkPublishScheduledShifts({ * scheduledShifts: { * "key": {} * }, * scheduledShiftNotificationAudience: "AFFECTED" * }) */ bulkPublishScheduledShifts(request: Square.BulkPublishScheduledShiftsRequest, requestOptions?: LaborClient.RequestOptions): core.HttpResponsePromise; private __bulkPublishScheduledShifts; /** * Returns a paginated list of scheduled shifts, with optional filter and sort settings. * By default, results are sorted by `start_at` in ascending order. * * @param {Square.SearchScheduledShiftsRequest} request * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.searchScheduledShifts({ * query: { * filter: { * assignmentStatus: "ASSIGNED" * }, * sort: { * field: "CREATED_AT", * order: "ASC" * } * }, * limit: 2, * cursor: "xoxp-1234-5678-90123" * }) */ searchScheduledShifts(request?: Square.SearchScheduledShiftsRequest, requestOptions?: LaborClient.RequestOptions): core.HttpResponsePromise; private __searchScheduledShifts; /** * Retrieves a scheduled shift by ID. * * @param {Square.RetrieveScheduledShiftRequest} request * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.retrieveScheduledShift({ * id: "id" * }) */ retrieveScheduledShift(request: Square.RetrieveScheduledShiftRequest, requestOptions?: LaborClient.RequestOptions): core.HttpResponsePromise; private __retrieveScheduledShift; /** * Updates the draft shift details for a scheduled shift. This endpoint supports * sparse updates, so only new, changed, or removed fields are required in the request. * You must publish the shift to make updates public. * * You can make the following updates to `draft_shift_details`: * - Change the `location_id`, `job_id`, `start_at`, and `end_at` fields. * - Add, change, or clear the `team_member_id` and `notes` fields. To clear these fields, * set the value to null. * - Change the `is_deleted` field. To delete a scheduled shift, set `is_deleted` to true * and then publish the shift. * * @param {Square.UpdateScheduledShiftRequest} request * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.updateScheduledShift({ * id: "id", * scheduledShift: { * draftShiftDetails: { * teamMemberId: "ormj0jJJZ5OZIzxrZYJI", * locationId: "PAA1RJZZKXBFG", * jobId: "FzbJAtt9qEWncK1BWgVCxQ6M", * startAt: "2019-03-25T03:11:00-05:00", * endAt: "2019-03-25T13:18:00-05:00", * notes: "Dont forget to prep the vegetables", * isDeleted: false * }, * version: 1 * } * }) */ updateScheduledShift(request: Square.UpdateScheduledShiftRequest, requestOptions?: LaborClient.RequestOptions): core.HttpResponsePromise; private __updateScheduledShift; /** * Publishes a scheduled shift. When a scheduled shift is published, Square keeps the * `draft_shift_details` field as is and copies it to the `published_shift_details` field. * * @param {Square.PublishScheduledShiftRequest} request * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.publishScheduledShift({ * id: "id", * idempotencyKey: "HIDSNG5KS478L", * version: 2, * scheduledShiftNotificationAudience: "ALL" * }) */ publishScheduledShift(request: Square.PublishScheduledShiftRequest, requestOptions?: LaborClient.RequestOptions): core.HttpResponsePromise; private __publishScheduledShift; /** * Creates a new `Timecard`. * * A `Timecard` represents a complete workday for a single team member. * You must provide the following values in your request to this * endpoint: * * - `location_id` * - `team_member_id` * - `start_at` * * An attempt to create a new `Timecard` can result in a `BAD_REQUEST` error when: * - The `status` of the new `Timecard` is `OPEN` and the team member has another * timecard with an `OPEN` status. * - The `start_at` date is in the future. * - The `start_at` or `end_at` date overlaps another timecard for the same team member. * - The `Break` instances are set in the request and a break `start_at` * is before the `Timecard.start_at`, a break `end_at` is after * the `Timecard.end_at`, or both. * * @param {Square.CreateTimecardRequest} request * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.createTimecard({ * idempotencyKey: "HIDSNG5KS478L", * timecard: { * locationId: "PAA1RJZZKXBFG", * startAt: "2019-01-25T03:11:00-05:00", * endAt: "2019-01-25T13:11:00-05:00", * wage: { * title: "Barista", * hourlyRate: { * amount: BigInt("1100"), * currency: "USD" * }, * tipEligible: true * }, * breaks: [{ * startAt: "2019-01-25T06:11:00-05:00", * endAt: "2019-01-25T06:16:00-05:00", * breakTypeId: "REGS1EQR1TPZ5", * name: "Tea Break", * expectedDuration: "PT5M", * isPaid: true * }], * teamMemberId: "ormj0jJJZ5OZIzxrZYJI", * declaredCashTipMoney: { * amount: BigInt("500"), * currency: "USD" * } * } * }) */ createTimecard(request: Square.CreateTimecardRequest, requestOptions?: LaborClient.RequestOptions): core.HttpResponsePromise; private __createTimecard; /** * Returns a paginated list of `Timecard` records for a business. * The list to be returned can be filtered by: * - Location IDs * - Team member IDs * - Timecard status (`OPEN` or `CLOSED`) * - Timecard start * - Timecard end * - Workday details * * The list can be sorted by: * - `START_AT` * - `END_AT` * - `CREATED_AT` * - `UPDATED_AT` * * @param {Square.SearchTimecardsRequest} request * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.searchTimecards({ * query: { * filter: { * workday: { * dateRange: { * startDate: "2019-01-20", * endDate: "2019-02-03" * }, * matchTimecardsBy: "START_AT", * defaultTimezone: "America/Los_Angeles" * } * } * }, * limit: 100 * }) */ searchTimecards(request?: Square.SearchTimecardsRequest, requestOptions?: LaborClient.RequestOptions): core.HttpResponsePromise; private __searchTimecards; /** * Returns a single `Timecard` specified by `id`. * * @param {Square.RetrieveTimecardRequest} request * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.retrieveTimecard({ * id: "id" * }) */ retrieveTimecard(request: Square.RetrieveTimecardRequest, requestOptions?: LaborClient.RequestOptions): core.HttpResponsePromise; private __retrieveTimecard; /** * Updates an existing `Timecard`. * * When adding a `Break` to a `Timecard`, any earlier `Break` instances in the `Timecard` have * the `end_at` property set to a valid RFC-3339 datetime string. * * When closing a `Timecard`, all `Break` instances in the `Timecard` must be complete with `end_at` * set on each `Break`. * * @param {Square.UpdateTimecardRequest} request * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.updateTimecard({ * id: "id", * timecard: { * locationId: "PAA1RJZZKXBFG", * startAt: "2019-01-25T03:11:00-05:00", * endAt: "2019-01-25T13:11:00-05:00", * wage: { * title: "Bartender", * hourlyRate: { * amount: BigInt("1500"), * currency: "USD" * }, * tipEligible: true * }, * breaks: [{ * id: "X7GAQYVVRRG6P", * startAt: "2019-01-25T06:11:00-05:00", * endAt: "2019-01-25T06:16:00-05:00", * breakTypeId: "REGS1EQR1TPZ5", * name: "Tea Break", * expectedDuration: "PT5M", * isPaid: true * }], * status: "CLOSED", * version: 1, * teamMemberId: "ormj0jJJZ5OZIzxrZYJI", * declaredCashTipMoney: { * amount: BigInt("500"), * currency: "USD" * } * } * }) */ updateTimecard(request: Square.UpdateTimecardRequest, requestOptions?: LaborClient.RequestOptions): core.HttpResponsePromise; private __updateTimecard; /** * Deletes a `Timecard`. * * @param {Square.DeleteTimecardRequest} request * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.deleteTimecard({ * id: "id" * }) */ deleteTimecard(request: Square.DeleteTimecardRequest, requestOptions?: LaborClient.RequestOptions): core.HttpResponsePromise; private __deleteTimecard; }