@wix/auto_sdk_staff-time-clock_timecards 0.0.0-stage → 1.0.1

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.
@@ -0,0 +1,243 @@
1
+ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { GenerateStaffTokenResponse, GenerateStaffTokenApplicationErrors, GetTimeClockDetailsResponse, GetTimeClockDetailsApplicationErrors, KioskClockInTimecardOptions, ClockInTimecardResponse, KioskClockInTimecardApplicationErrors, KioskClockOutTimecardOptions, ClockOutTimecardResponse, KioskClockOutTimecardApplicationErrors, KioskStartTimecardTaskOptions, StartTimecardTaskResponse, KioskStartTimecardTaskApplicationErrors, KioskEndTimecardTaskOptions, EndTimecardTaskResponse, KioskEndTimecardTaskApplicationErrors, ClockInTimecardOptions, ClockOutTimecardOptions, StartTimecardTaskOptions, EndTimecardTaskOptions, GetOpenTimecardOptions, GetOpenTimecardResponse, Timecard, CreateTimecardOptions, UpdateTimecard, UpdateTimecardOptions, DeleteTimecardOptions, GetTimecardOptions, ListAggregatedTimecardsOptions, ListAggregatedTimecardsResponse, TimecardQuery, QueryTimecardsOptions, typedQueryTimecards, TimecardsQueryBuilder } from './index.typings.js';
3
+ export { AccountInfo, ActionEvent, AggregatedTimecard, ClockInTimecardRequest, ClockOutTimecardRequest, ClockPunch, ClockSource, ClockSourceWithLiterals, CloseTimecardRequest, CloseTimecardResponse, CommonQueryWithEntityContext, CompletePinSetupRequest, CompletePinSetupResponse, CreateTimecardRequest, CreateTimecardResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteTimecardRequest, DeleteTimecardResponse, DomainEvent, DomainEventBodyOneOf, Empty, EndTimecardTaskRequest, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GenerateStaffTokenRequest, GetOpenTimecardRequest, GetTimeClockDetailsRequest, GetTimecardRequest, GetTimecardResponse, IdentificationData, IdentificationDataIdOneOf, ListAggregatedTimecardsRequest, LocationWorkedTime, MessageEnvelope, QueryTimecardsRequest, QueryTimecardsResponse, RestoreInfo, SendPinSetupLinkRequest, SendPinSetupLinkResponse, SortOrder, SortOrderWithLiterals, Sorting, StartTimecardTaskRequest, Task, TaskAssignment, TimecardQuerySpec, TimecardsQueryResult, TimecardsTotals, UpdateTimecardRequest, UpdateTimecardResponse, ValidatePinSetupLinkRequest, ValidatePinSetupLinkResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WorkedTime, ZonedDate, utils } from './index.typings.js';
4
+
5
+ declare function generateStaffToken$1(httpClient: HttpClient): GenerateStaffTokenSignature;
6
+ interface GenerateStaffTokenSignature {
7
+ /**
8
+ * Exchanges a staff member's PIN hash for a short-lived StaffToken.
9
+ *
10
+ * Call this with the device's Kiosk Token as a bearer credential. The site and
11
+ * location are taken from that token.
12
+ *
13
+ * A PIN that matches no staff member and a staff member who has no PIN return the
14
+ * same error, with no detail distinguishing them.
15
+ * @param - Hash of the PIN the staff member entered, as uppercase hex, computed as
16
+ * `SHA-256("Pin(symbols=[1, 2, 3, 4])|<metaSiteId>")` over the entered digits and
17
+ * the site ID from the device's pairing context.
18
+ */
19
+ (pin: string): Promise<NonNullablePaths<GenerateStaffTokenResponse, `staffToken`, 0> & {
20
+ __applicationErrorsType?: GenerateStaffTokenApplicationErrors;
21
+ }>;
22
+ }
23
+ declare function getTimeClockDetails$1(httpClient: HttpClient): GetTimeClockDetailsSignature;
24
+ interface GetTimeClockDetailsSignature {
25
+ /**
26
+ * Retrieves the signed-in staff member's open timecard and the site's task catalog.
27
+ *
28
+ * Call this with the staff member's StaffToken as a bearer credential. The staff
29
+ * member is taken from that token.
30
+ */
31
+ (): Promise<NonNullablePaths<GetTimeClockDetailsResponse, `openTimecard.staffMemberId` | `openTimecard.clockIn.source` | `openTimecard.taskAssignments` | `openTimecard.taskAssignments.${number}.taskId` | `openTimecard.taskAssignments.${number}.label` | `openTimecard.taskAssignments.${number}.paid` | `tasks` | `tasks.${number}.label` | `tasks.${number}.paid`, 3> & {
32
+ __applicationErrorsType?: GetTimeClockDetailsApplicationErrors;
33
+ }>;
34
+ }
35
+ declare function kioskClockInTimecard$1(httpClient: HttpClient): KioskClockInTimecardSignature;
36
+ interface KioskClockInTimecardSignature {
37
+ /**
38
+ * Opens a timecard for the signed-in staff member (clock-in).
39
+ *
40
+ * Call this with the staff member's StaffToken as a bearer credential. Idempotent:
41
+ * if the staff member already has an open timecard, it is returned with
42
+ * `wasAlreadyOpen` set instead of opening a second one.
43
+ */
44
+ (options?: KioskClockInTimecardOptions): Promise<NonNullablePaths<ClockInTimecardResponse, `timecard.staffMemberId` | `timecard.clockIn.source` | `timecard.taskAssignments` | `timecard.taskAssignments.${number}.taskId` | `timecard.taskAssignments.${number}.label` | `timecard.taskAssignments.${number}.paid` | `wasAlreadyOpen`, 3> & {
45
+ __applicationErrorsType?: KioskClockInTimecardApplicationErrors;
46
+ }>;
47
+ }
48
+ declare function kioskClockOutTimecard$1(httpClient: HttpClient): KioskClockOutTimecardSignature;
49
+ interface KioskClockOutTimecardSignature {
50
+ /**
51
+ * Closes the signed-in staff member's open timecard (clock-out). Any still-running
52
+ * task segment is closed at the same time.
53
+ *
54
+ * Call this with the staff member's StaffToken as a bearer credential.
55
+ */
56
+ (options?: KioskClockOutTimecardOptions): Promise<NonNullablePaths<ClockOutTimecardResponse, `timecard.staffMemberId` | `timecard.clockIn.source` | `timecard.taskAssignments` | `timecard.taskAssignments.${number}.taskId` | `timecard.taskAssignments.${number}.label` | `timecard.taskAssignments.${number}.paid`, 3> & {
57
+ __applicationErrorsType?: KioskClockOutTimecardApplicationErrors;
58
+ }>;
59
+ }
60
+ declare function kioskStartTimecardTask$1(httpClient: HttpClient): KioskStartTimecardTaskSignature;
61
+ interface KioskStartTimecardTaskSignature {
62
+ /**
63
+ * Starts a task on the signed-in staff member's open timecard. If another task is
64
+ * already running it is closed first (a task switch).
65
+ *
66
+ * Call this with the staff member's StaffToken as a bearer credential.
67
+ */
68
+ (options?: KioskStartTimecardTaskOptions): Promise<NonNullablePaths<StartTimecardTaskResponse, `timecard.staffMemberId` | `timecard.clockIn.source` | `timecard.taskAssignments` | `timecard.taskAssignments.${number}.taskId` | `timecard.taskAssignments.${number}.label` | `timecard.taskAssignments.${number}.paid`, 3> & {
69
+ __applicationErrorsType?: KioskStartTimecardTaskApplicationErrors;
70
+ }>;
71
+ }
72
+ declare function kioskEndTimecardTask$1(httpClient: HttpClient): KioskEndTimecardTaskSignature;
73
+ interface KioskEndTimecardTaskSignature {
74
+ /**
75
+ * Ends the running task on the signed-in staff member's open timecard, returning it
76
+ * to untasked working time.
77
+ *
78
+ * Call this with the staff member's StaffToken as a bearer credential.
79
+ */
80
+ (options?: KioskEndTimecardTaskOptions): Promise<NonNullablePaths<EndTimecardTaskResponse, `timecard.staffMemberId` | `timecard.clockIn.source` | `timecard.taskAssignments` | `timecard.taskAssignments.${number}.taskId` | `timecard.taskAssignments.${number}.label` | `timecard.taskAssignments.${number}.paid`, 3> & {
81
+ __applicationErrorsType?: KioskEndTimecardTaskApplicationErrors;
82
+ }>;
83
+ }
84
+ declare function clockInTimecard$1(httpClient: HttpClient): ClockInTimecardSignature;
85
+ interface ClockInTimecardSignature {
86
+ /**
87
+ * Opens a timecard for a staff member (clock-in).
88
+ *
89
+ * If the staff member already has an open timecard, from any source, no second
90
+ * timecard is opened. The existing timecard is returned with `wasAlreadyOpen` set
91
+ * to `true`.
92
+ *
93
+ * The call fails if the new timecard would overlap one the staff member already
94
+ * has. For example, a timecard with a clock-out time in the future still covers
95
+ * the moment of the clock-in.
96
+ *
97
+ * A staff member who clocks themselves in needs self clock-in to be enabled in the
98
+ * site's time clock settings. Clocking in on behalf of a staff member, for example
99
+ * from a kiosk, doesn't depend on that setting.
100
+ */
101
+ (options?: ClockInTimecardOptions): Promise<NonNullablePaths<ClockInTimecardResponse, `timecard.staffMemberId` | `timecard.clockIn.source` | `timecard.taskAssignments` | `timecard.taskAssignments.${number}.taskId` | `timecard.taskAssignments.${number}.label` | `timecard.taskAssignments.${number}.paid` | `wasAlreadyOpen`, 3>>;
102
+ }
103
+ declare function clockOutTimecard$1(httpClient: HttpClient): ClockOutTimecardSignature;
104
+ interface ClockOutTimecardSignature {
105
+ /**
106
+ * Closes the staff member's open timecard (clock-out).
107
+ *
108
+ * A task that is still running is closed at the same time. The call fails if the
109
+ * staff member has no open timecard, so a second call right after a clock-out
110
+ * fails.
111
+ */
112
+ (options?: ClockOutTimecardOptions): Promise<NonNullablePaths<ClockOutTimecardResponse, `timecard.staffMemberId` | `timecard.clockIn.source` | `timecard.taskAssignments` | `timecard.taskAssignments.${number}.taskId` | `timecard.taskAssignments.${number}.label` | `timecard.taskAssignments.${number}.paid`, 3>>;
113
+ }
114
+ declare function startTimecardTask$1(httpClient: HttpClient): StartTimecardTaskSignature;
115
+ interface StartTimecardTaskSignature {
116
+ /**
117
+ * Starts a task on the staff member's open timecard.
118
+ *
119
+ * If another task is already running, it is closed first, so switching tasks takes
120
+ * a single call. The task's label and whether it's paid are copied from the site's
121
+ * task catalog when the task starts. Later changes to the catalog don't affect it.
122
+ */
123
+ (options?: StartTimecardTaskOptions): Promise<NonNullablePaths<StartTimecardTaskResponse, `timecard.staffMemberId` | `timecard.clockIn.source` | `timecard.taskAssignments` | `timecard.taskAssignments.${number}.taskId` | `timecard.taskAssignments.${number}.label` | `timecard.taskAssignments.${number}.paid`, 3>>;
124
+ }
125
+ declare function endTimecardTask$1(httpClient: HttpClient): EndTimecardTaskSignature;
126
+ interface EndTimecardTaskSignature {
127
+ /**
128
+ * Ends the running task on the staff member's open timecard, returning it to
129
+ * untasked working time.
130
+ *
131
+ * The call fails if no task is running.
132
+ */
133
+ (options?: EndTimecardTaskOptions): Promise<NonNullablePaths<EndTimecardTaskResponse, `timecard.staffMemberId` | `timecard.clockIn.source` | `timecard.taskAssignments` | `timecard.taskAssignments.${number}.taskId` | `timecard.taskAssignments.${number}.label` | `timecard.taskAssignments.${number}.paid`, 3>>;
134
+ }
135
+ declare function getOpenTimecard$1(httpClient: HttpClient): GetOpenTimecardSignature;
136
+ interface GetOpenTimecardSignature {
137
+ /**
138
+ * Retrieves the staff member's open timecard.
139
+ *
140
+ * If the staff member is clocked out, no timecard is returned. Use this to show
141
+ * whether a staff member is clocked in, working on a task, or clocked out.
142
+ */
143
+ (options?: GetOpenTimecardOptions): Promise<NonNullablePaths<GetOpenTimecardResponse, `timecard.staffMemberId` | `timecard.clockIn.source` | `timecard.taskAssignments` | `timecard.taskAssignments.${number}.taskId` | `timecard.taskAssignments.${number}.label` | `timecard.taskAssignments.${number}.paid`, 3>>;
144
+ }
145
+ declare function createTimecard$1(httpClient: HttpClient): CreateTimecardSignature;
146
+ interface CreateTimecardSignature {
147
+ /**
148
+ * Creates a timecard directly, for example for a manual entry.
149
+ *
150
+ * Provide a complete record: either a closed timecard with a clock-in and a
151
+ * clock-out, or an open timecard with only a clock-in. The `source` of the punches
152
+ * is set to `MANUAL`. You can provide a `reason`, which is recorded in the
153
+ * timecard's audit trail. `locationId` is optional.
154
+ * @param - Timecard to create.
155
+ * @returns Created timecard.
156
+ */
157
+ (timecard: NonNullablePaths<Timecard, `clockIn` | `clockIn.date.localDate` | `clockIn.date.timeZone` | `staffMemberId`, 2>, options?: CreateTimecardOptions): Promise<NonNullablePaths<Timecard, `staffMemberId` | `clockIn.source` | `taskAssignments` | `taskAssignments.${number}.taskId` | `taskAssignments.${number}.label` | `taskAssignments.${number}.paid`, 2>>;
158
+ }
159
+ declare function updateTimecard$1(httpClient: HttpClient): UpdateTimecardSignature;
160
+ interface UpdateTimecardSignature {
161
+ /**
162
+ * Updates a timecard, for example to correct a clock-in or clock-out time.
163
+ *
164
+ * Each time the timecard is updated, `revision` increments by 1. The current
165
+ * `revision` must be passed when updating the timecard. This ensures you're working
166
+ * with the latest timecard and prevents unintended overwrites.
167
+ *
168
+ * Only the fields in `fieldMask` are updated. You can provide a `reason`, which is
169
+ * recorded in the timecard's audit trail.
170
+ * @param - Timecard ID.
171
+ * @returns Updated timecard.
172
+ */
173
+ (_id: string, timecard: NonNullablePaths<UpdateTimecard, `revision`, 0>, options?: UpdateTimecardOptions): Promise<NonNullablePaths<Timecard, `staffMemberId` | `clockIn.source` | `taskAssignments` | `taskAssignments.${number}.taskId` | `taskAssignments.${number}.label` | `taskAssignments.${number}.paid`, 2>>;
174
+ }
175
+ declare function deleteTimecard$1(httpClient: HttpClient): DeleteTimecardSignature;
176
+ interface DeleteTimecardSignature {
177
+ /**
178
+ * Deletes a timecard.
179
+ *
180
+ * You can provide a `reason`, which is recorded in the timecard's audit trail.
181
+ * @param - ID of the timecard to delete.
182
+ */
183
+ (timecardId: string, options?: DeleteTimecardOptions): Promise<void>;
184
+ }
185
+ declare function getTimecard$1(httpClient: HttpClient): GetTimecardSignature;
186
+ interface GetTimecardSignature {
187
+ /**
188
+ * Retrieves a timecard by ID.
189
+ * @param - ID of the timecard to retrieve.
190
+ * @returns Retrieved timecard.
191
+ */
192
+ (timecardId: string, options?: GetTimecardOptions): Promise<NonNullablePaths<Timecard, `staffMemberId` | `clockIn.source` | `taskAssignments` | `taskAssignments.${number}.taskId` | `taskAssignments.${number}.label` | `taskAssignments.${number}.paid`, 2>>;
193
+ }
194
+ declare function listAggregatedTimecards$1(httpClient: HttpClient): ListAggregatedTimecardsSignature;
195
+ interface ListAggregatedTimecardsSignature {
196
+ /**
197
+ * Retrieves the hours each staff member worked over a date range.
198
+ *
199
+ * The response has one row per staff member with paid, unpaid, and total hours, a
200
+ * breakdown by location, and totals across all rows.
201
+ *
202
+ * A timecard counts toward the day its clock-in falls on, whenever it was clocked
203
+ * out. A shift that crosses midnight is reported whole against the day it started
204
+ * and doesn't appear in the next day's report. You can therefore add up reports
205
+ * over consecutive ranges without counting an overnight shift twice.
206
+ *
207
+ * `locationIds` limits which locations the hours are summed over, and a staff
208
+ * member with no timecards in those locations isn't listed. `staffMemberIds` limits
209
+ * which rows are returned and doesn't change the hours per location. Open timecards
210
+ * aren't included in the hours. They're returned as `openTimecardId`.
211
+ *
212
+ * The range can span up to 92 days. Currently, all rows are returned in a single
213
+ * page, and `cursorPaging` is ignored.
214
+ * @param - First day of the reporting range, inclusive. Interpreted in `timeZone`, so the
215
+ * range starts at the beginning of this day. A timecard is included when its
216
+ * clock-in falls within the range, whenever it was clocked out.
217
+ */
218
+ (fromLocalDate: string, options?: NonNullablePaths<ListAggregatedTimecardsOptions, `timeZone` | `toLocalDate`, 0>): Promise<NonNullablePaths<ListAggregatedTimecardsResponse, `aggregatedTimecards` | `aggregatedTimecards.${number}.staffMemberId` | `totals.staffCount` | `totals.openTimecardCount`, 2>>;
219
+ }
220
+
221
+ declare function customQueryTimecards(httpClient: HttpClient): {
222
+ (query: TimecardQuery, options?: QueryTimecardsOptions): ReturnType<typeof typedQueryTimecards>;
223
+ (options?: QueryTimecardsOptions): TimecardsQueryBuilder;
224
+ };
225
+ declare const generateStaffToken: MaybeContext<BuildRESTFunction<typeof generateStaffToken$1> & typeof generateStaffToken$1>;
226
+ declare const getTimeClockDetails: MaybeContext<BuildRESTFunction<typeof getTimeClockDetails$1> & typeof getTimeClockDetails$1>;
227
+ declare const kioskClockInTimecard: MaybeContext<BuildRESTFunction<typeof kioskClockInTimecard$1> & typeof kioskClockInTimecard$1>;
228
+ declare const kioskClockOutTimecard: MaybeContext<BuildRESTFunction<typeof kioskClockOutTimecard$1> & typeof kioskClockOutTimecard$1>;
229
+ declare const kioskStartTimecardTask: MaybeContext<BuildRESTFunction<typeof kioskStartTimecardTask$1> & typeof kioskStartTimecardTask$1>;
230
+ declare const kioskEndTimecardTask: MaybeContext<BuildRESTFunction<typeof kioskEndTimecardTask$1> & typeof kioskEndTimecardTask$1>;
231
+ declare const clockInTimecard: MaybeContext<BuildRESTFunction<typeof clockInTimecard$1> & typeof clockInTimecard$1>;
232
+ declare const clockOutTimecard: MaybeContext<BuildRESTFunction<typeof clockOutTimecard$1> & typeof clockOutTimecard$1>;
233
+ declare const startTimecardTask: MaybeContext<BuildRESTFunction<typeof startTimecardTask$1> & typeof startTimecardTask$1>;
234
+ declare const endTimecardTask: MaybeContext<BuildRESTFunction<typeof endTimecardTask$1> & typeof endTimecardTask$1>;
235
+ declare const getOpenTimecard: MaybeContext<BuildRESTFunction<typeof getOpenTimecard$1> & typeof getOpenTimecard$1>;
236
+ declare const createTimecard: MaybeContext<BuildRESTFunction<typeof createTimecard$1> & typeof createTimecard$1>;
237
+ declare const updateTimecard: MaybeContext<BuildRESTFunction<typeof updateTimecard$1> & typeof updateTimecard$1>;
238
+ declare const deleteTimecard: MaybeContext<BuildRESTFunction<typeof deleteTimecard$1> & typeof deleteTimecard$1>;
239
+ declare const getTimecard: MaybeContext<BuildRESTFunction<typeof getTimecard$1> & typeof getTimecard$1>;
240
+ declare const listAggregatedTimecards: MaybeContext<BuildRESTFunction<typeof listAggregatedTimecards$1> & typeof listAggregatedTimecards$1>;
241
+ declare const queryTimecards: MaybeContext<BuildRESTFunction<typeof customQueryTimecards> & typeof customQueryTimecards>;
242
+
243
+ export { ClockInTimecardOptions, ClockInTimecardResponse, ClockOutTimecardOptions, ClockOutTimecardResponse, CreateTimecardOptions, DeleteTimecardOptions, EndTimecardTaskOptions, EndTimecardTaskResponse, GenerateStaffTokenApplicationErrors, GenerateStaffTokenResponse, GetOpenTimecardOptions, GetOpenTimecardResponse, GetTimeClockDetailsApplicationErrors, GetTimeClockDetailsResponse, GetTimecardOptions, KioskClockInTimecardApplicationErrors, KioskClockInTimecardOptions, KioskClockOutTimecardApplicationErrors, KioskClockOutTimecardOptions, KioskEndTimecardTaskApplicationErrors, KioskEndTimecardTaskOptions, KioskStartTimecardTaskApplicationErrors, KioskStartTimecardTaskOptions, ListAggregatedTimecardsOptions, ListAggregatedTimecardsResponse, QueryTimecardsOptions, StartTimecardTaskOptions, StartTimecardTaskResponse, Timecard, TimecardQuery, TimecardsQueryBuilder, UpdateTimecard, UpdateTimecardOptions, clockInTimecard, clockOutTimecard, createTimecard, deleteTimecard, endTimecardTask, generateStaffToken, getOpenTimecard, getTimeClockDetails, getTimecard, kioskClockInTimecard, kioskClockOutTimecard, kioskEndTimecardTask, kioskStartTimecardTask, listAggregatedTimecards, queryTimecards, startTimecardTask, updateTimecard };