@wix/auto_sdk_staff-time-clock_timecard-audit-logs 0.0.0-stage → 1.0.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.
- package/build/cjs/index.d.ts +20 -0
- package/build/cjs/index.js +164 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +417 -0
- package/build/cjs/index.typings.js +150 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +408 -0
- package/build/cjs/meta.js +137 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/index.d.mts +20 -0
- package/build/es/index.mjs +137 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +417 -0
- package/build/es/index.typings.mjs +123 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +408 -0
- package/build/es/meta.mjs +107 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/internal/cjs/index.d.ts +20 -0
- package/build/internal/cjs/index.typings.d.ts +422 -0
- package/build/internal/cjs/meta.d.ts +455 -0
- package/build/internal/es/index.d.mts +20 -0
- package/build/internal/es/index.typings.d.mts +422 -0
- package/build/internal/es/meta.d.mts +455 -0
- package/meta/package.json +3 -0
- package/package.json +51 -3
- package/README.md +0 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { ListTimecardAuditLogsOptions, ListTimecardAuditLogsResponse } from './index.typings.js';
|
|
3
|
+
export { AccountInfo, ActionEvent, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, FieldChange, IdentificationData, IdentificationDataIdOneOf, IdentityType, IdentityTypeWithLiterals, ListTimecardAuditLogsRequest, MessageEnvelope, Performer, PerformerWhoOneOf, RestoreInfo, TimecardAuditAction, TimecardAuditActionWithLiterals, TimecardAuditLog, V1IdentificationData, V1IdentificationDataIdOneOf, WebhookIdentityType, WebhookIdentityTypeWithLiterals, ZonedDate } from './index.typings.js';
|
|
4
|
+
|
|
5
|
+
declare function listTimecardAuditLogs$1(httpClient: HttpClient): ListTimecardAuditLogsSignature;
|
|
6
|
+
interface ListTimecardAuditLogsSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves all audit records of a timecard, newest first.
|
|
9
|
+
*
|
|
10
|
+
* A record is written shortly after each change to the timecard, so a change
|
|
11
|
+
* you just made might not be listed yet. Records of a deleted timecard are
|
|
12
|
+
* kept.
|
|
13
|
+
* @param - ID of the timecard to retrieve audit records for.
|
|
14
|
+
*/
|
|
15
|
+
(timecardId: string, options?: ListTimecardAuditLogsOptions): Promise<NonNullablePaths<ListTimecardAuditLogsResponse, `timecardAuditLogs` | `timecardAuditLogs.${number}.timecardId` | `timecardAuditLogs.${number}.timecardRevision` | `timecardAuditLogs.${number}.performedBy.staffMemberId` | `timecardAuditLogs.${number}.performedBy.identification.anonymousVisitorId` | `timecardAuditLogs.${number}.performedBy.identification.memberId` | `timecardAuditLogs.${number}.performedBy.identification.wixUserId` | `timecardAuditLogs.${number}.performedBy.identification.appId` | `timecardAuditLogs.${number}.action`, 4>>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare const listTimecardAuditLogs: MaybeContext<BuildRESTFunction<typeof listTimecardAuditLogs$1> & typeof listTimecardAuditLogs$1>;
|
|
19
|
+
|
|
20
|
+
export { ListTimecardAuditLogsOptions, ListTimecardAuditLogsResponse, listTimecardAuditLogs };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
IdentityType: () => IdentityType,
|
|
24
|
+
TimecardAuditAction: () => TimecardAuditAction,
|
|
25
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
26
|
+
listTimecardAuditLogs: () => listTimecardAuditLogs4
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
|
29
|
+
|
|
30
|
+
// src/staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.universal.ts
|
|
31
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
32
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
33
|
+
|
|
34
|
+
// src/staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.http.ts
|
|
35
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
36
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
37
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
38
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
39
|
+
var TRANSFORM_PATHS_0 = [
|
|
40
|
+
{ path: "timecardAuditLogs.createdDate" },
|
|
41
|
+
{ path: "timecardAuditLogs.updatedDate" },
|
|
42
|
+
{ path: "timecardAuditLogs.performedDate.utcDate" }
|
|
43
|
+
];
|
|
44
|
+
function resolveWixStaffTimeClockV1TimecardAuditLogsServiceUrl(opts) {
|
|
45
|
+
const domainToMappings = {
|
|
46
|
+
"manage._base_domain_": [
|
|
47
|
+
{
|
|
48
|
+
srcPath: "/_api/timecard-audit",
|
|
49
|
+
destPath: ""
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
};
|
|
53
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
54
|
+
}
|
|
55
|
+
var PACKAGE_NAME = "@wix/auto_sdk_staff-time-clock_timecard-audit-logs";
|
|
56
|
+
function listTimecardAuditLogs(payload) {
|
|
57
|
+
function __listTimecardAuditLogs({ host }) {
|
|
58
|
+
const metadata = {
|
|
59
|
+
entityFqdn: "wix.staff.time_clock.v1.timecard_audit_log",
|
|
60
|
+
method: "GET",
|
|
61
|
+
methodFqn: "wix.staff.time_clock.v1.TimecardAuditLogsService.ListTimecardAuditLogs",
|
|
62
|
+
packageName: PACKAGE_NAME,
|
|
63
|
+
migrationOptions: {
|
|
64
|
+
optInTransformResponse: true
|
|
65
|
+
},
|
|
66
|
+
url: resolveWixStaffTimeClockV1TimecardAuditLogsServiceUrl({
|
|
67
|
+
protoPath: "/v1/timecard-audit-logs",
|
|
68
|
+
data: payload,
|
|
69
|
+
host
|
|
70
|
+
}),
|
|
71
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
72
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
73
|
+
{
|
|
74
|
+
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
75
|
+
paths: TRANSFORM_PATHS_0
|
|
76
|
+
}
|
|
77
|
+
])
|
|
78
|
+
};
|
|
79
|
+
return metadata;
|
|
80
|
+
}
|
|
81
|
+
return __listTimecardAuditLogs;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// src/staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.universal.ts
|
|
85
|
+
var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
|
|
86
|
+
IdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
87
|
+
IdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
88
|
+
IdentityType2["MEMBER"] = "MEMBER";
|
|
89
|
+
IdentityType2["WIX_USER"] = "WIX_USER";
|
|
90
|
+
IdentityType2["APP"] = "APP";
|
|
91
|
+
return IdentityType2;
|
|
92
|
+
})(IdentityType || {});
|
|
93
|
+
var TimecardAuditAction = /* @__PURE__ */ ((TimecardAuditAction2) => {
|
|
94
|
+
TimecardAuditAction2["CLOCKED_IN"] = "CLOCKED_IN";
|
|
95
|
+
TimecardAuditAction2["CLOCKED_OUT"] = "CLOCKED_OUT";
|
|
96
|
+
TimecardAuditAction2["TASK_STARTED"] = "TASK_STARTED";
|
|
97
|
+
TimecardAuditAction2["TASK_ENDED"] = "TASK_ENDED";
|
|
98
|
+
TimecardAuditAction2["MANUALLY_CREATED"] = "MANUALLY_CREATED";
|
|
99
|
+
TimecardAuditAction2["EDITED"] = "EDITED";
|
|
100
|
+
TimecardAuditAction2["DELETED"] = "DELETED";
|
|
101
|
+
TimecardAuditAction2["AUTO_CLOSED"] = "AUTO_CLOSED";
|
|
102
|
+
return TimecardAuditAction2;
|
|
103
|
+
})(TimecardAuditAction || {});
|
|
104
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
105
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
106
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
107
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
108
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
109
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
110
|
+
return WebhookIdentityType2;
|
|
111
|
+
})(WebhookIdentityType || {});
|
|
112
|
+
async function listTimecardAuditLogs2(timecardId, options) {
|
|
113
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
114
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
115
|
+
timecardId,
|
|
116
|
+
timeZone: options?.timeZone
|
|
117
|
+
});
|
|
118
|
+
const reqOpts = listTimecardAuditLogs(
|
|
119
|
+
payload
|
|
120
|
+
);
|
|
121
|
+
sideEffects?.onSiteCall?.();
|
|
122
|
+
try {
|
|
123
|
+
const result = await httpClient.request(reqOpts);
|
|
124
|
+
sideEffects?.onSuccess?.(result);
|
|
125
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
126
|
+
} catch (err) {
|
|
127
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
128
|
+
err,
|
|
129
|
+
{
|
|
130
|
+
spreadPathsToArguments: {},
|
|
131
|
+
explicitPathsToArguments: {
|
|
132
|
+
timecardId: "$[0]",
|
|
133
|
+
timeZone: "$[1].timeZone"
|
|
134
|
+
},
|
|
135
|
+
singleArgumentUnchanged: false
|
|
136
|
+
},
|
|
137
|
+
["timecardId", "options"]
|
|
138
|
+
);
|
|
139
|
+
sideEffects?.onError?.(err);
|
|
140
|
+
throw transformedError;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// src/staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.public.ts
|
|
145
|
+
function listTimecardAuditLogs3(httpClient) {
|
|
146
|
+
return (timecardId, options) => listTimecardAuditLogs2(
|
|
147
|
+
timecardId,
|
|
148
|
+
options,
|
|
149
|
+
// @ts-ignore
|
|
150
|
+
{ httpClient }
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// src/staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.context.ts
|
|
155
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
156
|
+
var listTimecardAuditLogs4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listTimecardAuditLogs3);
|
|
157
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
158
|
+
0 && (module.exports = {
|
|
159
|
+
IdentityType,
|
|
160
|
+
TimecardAuditAction,
|
|
161
|
+
WebhookIdentityType,
|
|
162
|
+
listTimecardAuditLogs
|
|
163
|
+
});
|
|
164
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.universal.ts","../../src/staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.http.ts","../../src/staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.public.ts","../../src/staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.context.ts"],"sourcesContent":["export * from './src/staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixStaffTimeClockV1TimecardAuditLog from './staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.http.js';\n\n/**\n * A record of 1 action on a timecard, such as a clock-in, a task start, an\n * edit, or an automatic clock-out. Records are written automatically after each\n * timecard change and are never changed afterward.\n */\nexport interface TimecardAuditLog {\n /**\n * Audit record ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, server-assigned. Read-only.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the audit record was written.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the audit record was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the timecard the action was performed on.\n * @format GUID\n */\n timecardId?: string;\n /**\n * Timecard revision this record captures. A timecard's records are ordered\n * by it.\n * @readonly\n */\n timecardRevision?: string;\n /** Who performed the action. */\n performedBy?: Performer;\n /** What action was performed. */\n action?: TimecardAuditActionWithLiterals;\n /**\n * Date and time the action was performed. `utcDate` is the exact moment, in\n * UTC. `localDate` and `timeZone` show it in the time zone passed in the\n * request. This can be earlier than `createdDate`, the date the record was\n * written.\n * @readonly\n */\n performedDate?: ZonedDate;\n /**\n * Fields the action changed, with their previous and new values. When the\n * timecard was created or deleted, this holds 1 entry for the whole\n * timecard, with an empty `fieldPath`.\n * @maxSize 200\n */\n changedFields?: FieldChange[];\n /**\n * Reason given for a manual entry, edit, or delete.\n * @maxLength 1000\n */\n reason?: string | null;\n}\n\n/**\n * Who performed an action. An unset `who` denotes a system-initiated action\n * (the only such action is AUTO_CLOSED); every other action has an actor.\n */\nexport interface Performer extends PerformerWhoOneOf {\n /**\n * A self-service staff member (including a staff member with no Wix user).\n * @format GUID\n */\n staffMemberId?: string;\n /** A Wix user or app (e.g. an admin editing a Timecard). */\n identification?: V1IdentificationData;\n}\n\n/** @oneof */\nexport interface PerformerWhoOneOf {\n /**\n * A self-service staff member (including a staff member with no Wix user).\n * @format GUID\n */\n staffMemberId?: string;\n /** A Wix user or app (e.g. an admin editing a Timecard). */\n identification?: V1IdentificationData;\n}\n\nexport interface V1IdentificationData extends V1IdentificationDataIdOneOf {\n /**\n * ID of a site visitor who hasn't logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor who has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user. For example, the site owner or a\n * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /**\n * ID of the contact in the site's [CRM by Ascend](https://www.wix.com/ascend/crm) system.\n * See the Contacts API for additional details.\n * @format GUID\n */\n contactId?: string | null;\n /**\n * @internal\n * @readonly\n */\n identityType?: IdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface V1IdentificationDataIdOneOf {\n /**\n * ID of a site visitor who hasn't logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor who has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user. For example, the site owner or a\n * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type IdentityTypeWithLiterals =\n | IdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\n/** What was done to a timecard. Recorded in the timecard's audit trail. */\nexport enum TimecardAuditAction {\n /** A staff member clocked in. */\n CLOCKED_IN = 'CLOCKED_IN',\n /** A staff member clocked out. */\n CLOCKED_OUT = 'CLOCKED_OUT',\n /** A staff member started a task. */\n TASK_STARTED = 'TASK_STARTED',\n /** A staff member ended a task. */\n TASK_ENDED = 'TASK_ENDED',\n /** An admin created the timecard directly, as a manual entry. */\n MANUALLY_CREATED = 'MANUALLY_CREATED',\n /** An admin edited the timecard. */\n EDITED = 'EDITED',\n /** An admin deleted the timecard. */\n DELETED = 'DELETED',\n /** The system closed an open timecard, as an automatic clock-out. */\n AUTO_CLOSED = 'AUTO_CLOSED',\n}\n\n/** @enumType */\nexport type TimecardAuditActionWithLiterals =\n | TimecardAuditAction\n | 'CLOCKED_IN'\n | 'CLOCKED_OUT'\n | 'TASK_STARTED'\n | 'TASK_ENDED'\n | 'MANUALLY_CREATED'\n | 'EDITED'\n | 'DELETED'\n | 'AUTO_CLOSED';\n\n/**\n * A moment in time, with the local time and time zone it was recorded in.\n *\n * `utcDate` is the exact moment. `localDate` and `timeZone` are the local time and\n * IANA time zone recorded with it. They're stored as provided, so the recorded local\n * time doesn't change if time zone rules change later.\n *\n * When writing, provide `localDate` and `timeZone`. The server calculates `utcDate`\n * from them. A live clock-in or clock-out can have only a `utcDate` set by the server,\n * with `localDate` and `timeZone` not set. When reading, the recorded values are\n * returned as stored. The `adjusted` fields on a clock-in, clock-out, or task show the\n * same moment in the time zone you request.\n */\nexport interface ZonedDate {\n /**\n * Recorded local date and time in `YYYY-MM-DDThh:mm:ss` format, for example\n * `2026-07-01T09:00:00`. Interpreted in `timeZone`. Not set when the recorded time\n * zone is unknown.\n * @format LOCAL_DATE_TIME\n */\n localDate?: string | null;\n /**\n * Recorded time zone in IANA format, for example `America/New_York`. Not set when\n * unknown, for example for a live clock-in that didn't provide one.\n * @maxLength 50\n */\n timeZone?: string | null;\n /**\n * The exact moment, in UTC. Calculated from `localDate` and `timeZone` when writing, or\n * set by the server for a live clock-in or clock-out.\n * @readonly\n */\n utcDate?: Date | null;\n}\n\n/** A field an action changed. */\nexport interface FieldChange {\n /**\n * Path of the changed field, such as `clock_out.date` or\n * `task_assignments[2].end_date`. Empty for the whole timecard.\n * @maxLength 200\n */\n fieldPath?: string;\n /** Value before the change. Not returned when the field was added. */\n previousValue?: any;\n /** Value after the change. Not returned when the field was removed. */\n newValue?: any;\n}\n\nexport interface ListTimecardAuditLogsRequest {\n /**\n * ID of the timecard to retrieve audit records for.\n * @format GUID\n */\n timecardId: string;\n /**\n * Time zone for each record's `performedDate.localDate`, in IANA format, such\n * as `America/New_York`. `performedDate.utcDate` is always in UTC.\n * Default: `UTC`.\n * @maxLength 50\n */\n timeZone?: string | null;\n}\n\nexport interface ListTimecardAuditLogsResponse {\n /** The timecard's audit records, newest first. */\n timecardAuditLogs?: TimecardAuditLog[];\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/**\n * Retrieves all audit records of a timecard, newest first.\n *\n * A record is written shortly after each change to the timecard, so a change\n * you just made might not be listed yet. Records of a deleted timecard are\n * kept.\n * @param timecardId - ID of the timecard to retrieve audit records for.\n * @public\n * @documentationMaturity preview\n * @requiredField timecardId\n * @permissionId staff:time_clock:v1:timecard_audit_log:list_timecard_audit_logs\n * @applicableIdentity APP\n * @fqn wix.staff.time_clock.v1.TimecardAuditLogsService.ListTimecardAuditLogs\n */\nexport async function listTimecardAuditLogs(\n timecardId: string,\n options?: ListTimecardAuditLogsOptions\n): Promise<\n NonNullablePaths<\n ListTimecardAuditLogsResponse,\n | `timecardAuditLogs`\n | `timecardAuditLogs.${number}.timecardId`\n | `timecardAuditLogs.${number}.timecardRevision`\n | `timecardAuditLogs.${number}.performedBy.staffMemberId`\n | `timecardAuditLogs.${number}.performedBy.identification.anonymousVisitorId`\n | `timecardAuditLogs.${number}.performedBy.identification.memberId`\n | `timecardAuditLogs.${number}.performedBy.identification.wixUserId`\n | `timecardAuditLogs.${number}.performedBy.identification.appId`\n | `timecardAuditLogs.${number}.action`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n timecardId: timecardId,\n timeZone: options?.timeZone,\n });\n\n const reqOpts =\n ambassadorWixStaffTimeClockV1TimecardAuditLog.listTimecardAuditLogs(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n timecardId: '$[0]',\n timeZone: '$[1].timeZone',\n },\n singleArgumentUnchanged: false,\n },\n ['timecardId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListTimecardAuditLogsOptions {\n /**\n * Time zone for each record's `performedDate.localDate`, in IANA format, such\n * as `America/New_York`. `performedDate.utcDate` is always in UTC.\n * Default: `UTC`.\n * @maxLength 50\n */\n timeZone?: string | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nconst TRANSFORM_PATHS_0 = [\n { path: 'timecardAuditLogs.createdDate' },\n { path: 'timecardAuditLogs.updatedDate' },\n { path: 'timecardAuditLogs.performedDate.utcDate' },\n];\n\nfunction resolveWixStaffTimeClockV1TimecardAuditLogsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/timecard-audit',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_staff-time-clock_timecard-audit-logs';\n\n/**\n * Retrieves all audit records of a timecard, newest first.\n *\n * A record is written shortly after each change to the timecard, so a change\n * you just made might not be listed yet. Records of a deleted timecard are\n * kept.\n */\nexport function listTimecardAuditLogs(\n payload: object\n): RequestOptionsFactory<any> {\n function __listTimecardAuditLogs({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.time_clock.v1.timecard_audit_log',\n method: 'GET' as any,\n methodFqn:\n 'wix.staff.time_clock.v1.TimecardAuditLogsService.ListTimecardAuditLogs',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffTimeClockV1TimecardAuditLogsServiceUrl({\n protoPath: '/v1/timecard-audit-logs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listTimecardAuditLogs;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ListTimecardAuditLogsOptions,\n ListTimecardAuditLogsResponse,\n listTimecardAuditLogs as universalListTimecardAuditLogs,\n} from './staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/staff-time-clock' };\n\nexport function listTimecardAuditLogs(\n httpClient: HttpClient\n): ListTimecardAuditLogsSignature {\n return (timecardId: string, options?: ListTimecardAuditLogsOptions) =>\n universalListTimecardAuditLogs(\n timecardId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListTimecardAuditLogsSignature {\n /**\n * Retrieves all audit records of a timecard, newest first.\n *\n * A record is written shortly after each change to the timecard, so a change\n * you just made might not be listed yet. Records of a deleted timecard are\n * kept.\n * @param - ID of the timecard to retrieve audit records for.\n */\n (timecardId: string, options?: ListTimecardAuditLogsOptions): Promise<\n NonNullablePaths<\n ListTimecardAuditLogsResponse,\n | `timecardAuditLogs`\n | `timecardAuditLogs.${number}.timecardId`\n | `timecardAuditLogs.${number}.timecardRevision`\n | `timecardAuditLogs.${number}.performedBy.staffMemberId`\n | `timecardAuditLogs.${number}.performedBy.identification.anonymousVisitorId`\n | `timecardAuditLogs.${number}.performedBy.identification.memberId`\n | `timecardAuditLogs.${number}.performedBy.identification.wixUserId`\n | `timecardAuditLogs.${number}.performedBy.identification.appId`\n | `timecardAuditLogs.${number}.action`,\n 4\n >\n >;\n}\n\nexport {\n AccountInfo,\n ActionEvent,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n FieldChange,\n IdentificationData,\n IdentificationDataIdOneOf,\n IdentityType,\n ListTimecardAuditLogsOptions,\n ListTimecardAuditLogsRequest,\n ListTimecardAuditLogsResponse,\n MessageEnvelope,\n Performer,\n PerformerWhoOneOf,\n RestoreInfo,\n TimecardAuditAction,\n TimecardAuditLog,\n V1IdentificationData,\n V1IdentificationDataIdOneOf,\n WebhookIdentityType,\n ZonedDate,\n} from './staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.universal.js';\n","import { listTimecardAuditLogs as publicListTimecardAuditLogs } from './staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const listTimecardAuditLogs: MaybeContext<\n BuildRESTFunction<typeof publicListTimecardAuditLogs> &\n typeof publicListTimecardAuditLogs\n> = /*#__PURE__*/ createRESTModule(publicListTimecardAuditLogs);\n\nexport {\n IdentityType,\n TimecardAuditAction,\n WebhookIdentityType,\n} from './staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.universal.js';\nexport {\n TimecardAuditLog,\n Performer,\n PerformerWhoOneOf,\n V1IdentificationData,\n V1IdentificationDataIdOneOf,\n ZonedDate,\n FieldChange,\n ListTimecardAuditLogsRequest,\n ListTimecardAuditLogsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n ListTimecardAuditLogsOptions,\n} from './staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.universal.js';\nexport {\n IdentityTypeWithLiterals,\n TimecardAuditActionWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './staff-time-clock-v1-timecard-audit-log-timecard-audit-logs.universal.js';\n"],"mappings":"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","names":["listTimecardAuditLogs","import_rest_modules","payload","IdentityType","TimecardAuditAction","WebhookIdentityType","listTimecardAuditLogs","sdkTransformError","listTimecardAuditLogs","import_rest_modules","listTimecardAuditLogs"]}
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A record of 1 action on a timecard, such as a clock-in, a task start, an
|
|
5
|
+
* edit, or an automatic clock-out. Records are written automatically after each
|
|
6
|
+
* timecard change and are never changed afterward.
|
|
7
|
+
*/
|
|
8
|
+
interface TimecardAuditLog {
|
|
9
|
+
/**
|
|
10
|
+
* Audit record ID.
|
|
11
|
+
* @format GUID
|
|
12
|
+
* @readonly
|
|
13
|
+
*/
|
|
14
|
+
_id?: string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Revision number, server-assigned. Read-only.
|
|
17
|
+
* @readonly
|
|
18
|
+
*/
|
|
19
|
+
revision?: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Date and time the audit record was written.
|
|
22
|
+
* @readonly
|
|
23
|
+
*/
|
|
24
|
+
_createdDate?: Date | null;
|
|
25
|
+
/**
|
|
26
|
+
* Date and time the audit record was last updated.
|
|
27
|
+
* @readonly
|
|
28
|
+
*/
|
|
29
|
+
_updatedDate?: Date | null;
|
|
30
|
+
/**
|
|
31
|
+
* ID of the timecard the action was performed on.
|
|
32
|
+
* @format GUID
|
|
33
|
+
*/
|
|
34
|
+
timecardId?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Timecard revision this record captures. A timecard's records are ordered
|
|
37
|
+
* by it.
|
|
38
|
+
* @readonly
|
|
39
|
+
*/
|
|
40
|
+
timecardRevision?: string;
|
|
41
|
+
/** Who performed the action. */
|
|
42
|
+
performedBy?: Performer;
|
|
43
|
+
/** What action was performed. */
|
|
44
|
+
action?: TimecardAuditActionWithLiterals;
|
|
45
|
+
/**
|
|
46
|
+
* Date and time the action was performed. `utcDate` is the exact moment, in
|
|
47
|
+
* UTC. `localDate` and `timeZone` show it in the time zone passed in the
|
|
48
|
+
* request. This can be earlier than `createdDate`, the date the record was
|
|
49
|
+
* written.
|
|
50
|
+
* @readonly
|
|
51
|
+
*/
|
|
52
|
+
performedDate?: ZonedDate;
|
|
53
|
+
/**
|
|
54
|
+
* Fields the action changed, with their previous and new values. When the
|
|
55
|
+
* timecard was created or deleted, this holds 1 entry for the whole
|
|
56
|
+
* timecard, with an empty `fieldPath`.
|
|
57
|
+
* @maxSize 200
|
|
58
|
+
*/
|
|
59
|
+
changedFields?: FieldChange[];
|
|
60
|
+
/**
|
|
61
|
+
* Reason given for a manual entry, edit, or delete.
|
|
62
|
+
* @maxLength 1000
|
|
63
|
+
*/
|
|
64
|
+
reason?: string | null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Who performed an action. An unset `who` denotes a system-initiated action
|
|
68
|
+
* (the only such action is AUTO_CLOSED); every other action has an actor.
|
|
69
|
+
*/
|
|
70
|
+
interface Performer extends PerformerWhoOneOf {
|
|
71
|
+
/**
|
|
72
|
+
* A self-service staff member (including a staff member with no Wix user).
|
|
73
|
+
* @format GUID
|
|
74
|
+
*/
|
|
75
|
+
staffMemberId?: string;
|
|
76
|
+
/** A Wix user or app (e.g. an admin editing a Timecard). */
|
|
77
|
+
identification?: V1IdentificationData;
|
|
78
|
+
}
|
|
79
|
+
/** @oneof */
|
|
80
|
+
interface PerformerWhoOneOf {
|
|
81
|
+
/**
|
|
82
|
+
* A self-service staff member (including a staff member with no Wix user).
|
|
83
|
+
* @format GUID
|
|
84
|
+
*/
|
|
85
|
+
staffMemberId?: string;
|
|
86
|
+
/** A Wix user or app (e.g. an admin editing a Timecard). */
|
|
87
|
+
identification?: V1IdentificationData;
|
|
88
|
+
}
|
|
89
|
+
interface V1IdentificationData extends V1IdentificationDataIdOneOf {
|
|
90
|
+
/**
|
|
91
|
+
* ID of a site visitor who hasn't logged in to the site.
|
|
92
|
+
* @format GUID
|
|
93
|
+
*/
|
|
94
|
+
anonymousVisitorId?: string;
|
|
95
|
+
/**
|
|
96
|
+
* ID of a site visitor who has logged in to the site.
|
|
97
|
+
* @format GUID
|
|
98
|
+
*/
|
|
99
|
+
memberId?: string;
|
|
100
|
+
/**
|
|
101
|
+
* ID of a Wix user. For example, the site owner or a
|
|
102
|
+
* [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).
|
|
103
|
+
* @format GUID
|
|
104
|
+
*/
|
|
105
|
+
wixUserId?: string;
|
|
106
|
+
/**
|
|
107
|
+
* ID of an app.
|
|
108
|
+
* @format GUID
|
|
109
|
+
*/
|
|
110
|
+
appId?: string;
|
|
111
|
+
/**
|
|
112
|
+
* ID of the contact in the site's [CRM by Ascend](https://www.wix.com/ascend/crm) system.
|
|
113
|
+
* See the Contacts API for additional details.
|
|
114
|
+
* @format GUID
|
|
115
|
+
*/
|
|
116
|
+
contactId?: string | null;
|
|
117
|
+
}
|
|
118
|
+
/** @oneof */
|
|
119
|
+
interface V1IdentificationDataIdOneOf {
|
|
120
|
+
/**
|
|
121
|
+
* ID of a site visitor who hasn't logged in to the site.
|
|
122
|
+
* @format GUID
|
|
123
|
+
*/
|
|
124
|
+
anonymousVisitorId?: string;
|
|
125
|
+
/**
|
|
126
|
+
* ID of a site visitor who has logged in to the site.
|
|
127
|
+
* @format GUID
|
|
128
|
+
*/
|
|
129
|
+
memberId?: string;
|
|
130
|
+
/**
|
|
131
|
+
* ID of a Wix user. For example, the site owner or a
|
|
132
|
+
* [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).
|
|
133
|
+
* @format GUID
|
|
134
|
+
*/
|
|
135
|
+
wixUserId?: string;
|
|
136
|
+
/**
|
|
137
|
+
* ID of an app.
|
|
138
|
+
* @format GUID
|
|
139
|
+
*/
|
|
140
|
+
appId?: string;
|
|
141
|
+
}
|
|
142
|
+
declare enum IdentityType {
|
|
143
|
+
UNKNOWN = "UNKNOWN",
|
|
144
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
145
|
+
MEMBER = "MEMBER",
|
|
146
|
+
WIX_USER = "WIX_USER",
|
|
147
|
+
APP = "APP"
|
|
148
|
+
}
|
|
149
|
+
/** @enumType */
|
|
150
|
+
type IdentityTypeWithLiterals = IdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
151
|
+
/** What was done to a timecard. Recorded in the timecard's audit trail. */
|
|
152
|
+
declare enum TimecardAuditAction {
|
|
153
|
+
/** A staff member clocked in. */
|
|
154
|
+
CLOCKED_IN = "CLOCKED_IN",
|
|
155
|
+
/** A staff member clocked out. */
|
|
156
|
+
CLOCKED_OUT = "CLOCKED_OUT",
|
|
157
|
+
/** A staff member started a task. */
|
|
158
|
+
TASK_STARTED = "TASK_STARTED",
|
|
159
|
+
/** A staff member ended a task. */
|
|
160
|
+
TASK_ENDED = "TASK_ENDED",
|
|
161
|
+
/** An admin created the timecard directly, as a manual entry. */
|
|
162
|
+
MANUALLY_CREATED = "MANUALLY_CREATED",
|
|
163
|
+
/** An admin edited the timecard. */
|
|
164
|
+
EDITED = "EDITED",
|
|
165
|
+
/** An admin deleted the timecard. */
|
|
166
|
+
DELETED = "DELETED",
|
|
167
|
+
/** The system closed an open timecard, as an automatic clock-out. */
|
|
168
|
+
AUTO_CLOSED = "AUTO_CLOSED"
|
|
169
|
+
}
|
|
170
|
+
/** @enumType */
|
|
171
|
+
type TimecardAuditActionWithLiterals = TimecardAuditAction | 'CLOCKED_IN' | 'CLOCKED_OUT' | 'TASK_STARTED' | 'TASK_ENDED' | 'MANUALLY_CREATED' | 'EDITED' | 'DELETED' | 'AUTO_CLOSED';
|
|
172
|
+
/**
|
|
173
|
+
* A moment in time, with the local time and time zone it was recorded in.
|
|
174
|
+
*
|
|
175
|
+
* `utcDate` is the exact moment. `localDate` and `timeZone` are the local time and
|
|
176
|
+
* IANA time zone recorded with it. They're stored as provided, so the recorded local
|
|
177
|
+
* time doesn't change if time zone rules change later.
|
|
178
|
+
*
|
|
179
|
+
* When writing, provide `localDate` and `timeZone`. The server calculates `utcDate`
|
|
180
|
+
* from them. A live clock-in or clock-out can have only a `utcDate` set by the server,
|
|
181
|
+
* with `localDate` and `timeZone` not set. When reading, the recorded values are
|
|
182
|
+
* returned as stored. The `adjusted` fields on a clock-in, clock-out, or task show the
|
|
183
|
+
* same moment in the time zone you request.
|
|
184
|
+
*/
|
|
185
|
+
interface ZonedDate {
|
|
186
|
+
/**
|
|
187
|
+
* Recorded local date and time in `YYYY-MM-DDThh:mm:ss` format, for example
|
|
188
|
+
* `2026-07-01T09:00:00`. Interpreted in `timeZone`. Not set when the recorded time
|
|
189
|
+
* zone is unknown.
|
|
190
|
+
* @format LOCAL_DATE_TIME
|
|
191
|
+
*/
|
|
192
|
+
localDate?: string | null;
|
|
193
|
+
/**
|
|
194
|
+
* Recorded time zone in IANA format, for example `America/New_York`. Not set when
|
|
195
|
+
* unknown, for example for a live clock-in that didn't provide one.
|
|
196
|
+
* @maxLength 50
|
|
197
|
+
*/
|
|
198
|
+
timeZone?: string | null;
|
|
199
|
+
/**
|
|
200
|
+
* The exact moment, in UTC. Calculated from `localDate` and `timeZone` when writing, or
|
|
201
|
+
* set by the server for a live clock-in or clock-out.
|
|
202
|
+
* @readonly
|
|
203
|
+
*/
|
|
204
|
+
utcDate?: Date | null;
|
|
205
|
+
}
|
|
206
|
+
/** A field an action changed. */
|
|
207
|
+
interface FieldChange {
|
|
208
|
+
/**
|
|
209
|
+
* Path of the changed field, such as `clock_out.date` or
|
|
210
|
+
* `task_assignments[2].end_date`. Empty for the whole timecard.
|
|
211
|
+
* @maxLength 200
|
|
212
|
+
*/
|
|
213
|
+
fieldPath?: string;
|
|
214
|
+
/** Value before the change. Not returned when the field was added. */
|
|
215
|
+
previousValue?: any;
|
|
216
|
+
/** Value after the change. Not returned when the field was removed. */
|
|
217
|
+
newValue?: any;
|
|
218
|
+
}
|
|
219
|
+
interface ListTimecardAuditLogsRequest {
|
|
220
|
+
/**
|
|
221
|
+
* ID of the timecard to retrieve audit records for.
|
|
222
|
+
* @format GUID
|
|
223
|
+
*/
|
|
224
|
+
timecardId: string;
|
|
225
|
+
/**
|
|
226
|
+
* Time zone for each record's `performedDate.localDate`, in IANA format, such
|
|
227
|
+
* as `America/New_York`. `performedDate.utcDate` is always in UTC.
|
|
228
|
+
* Default: `UTC`.
|
|
229
|
+
* @maxLength 50
|
|
230
|
+
*/
|
|
231
|
+
timeZone?: string | null;
|
|
232
|
+
}
|
|
233
|
+
interface ListTimecardAuditLogsResponse {
|
|
234
|
+
/** The timecard's audit records, newest first. */
|
|
235
|
+
timecardAuditLogs?: TimecardAuditLog[];
|
|
236
|
+
}
|
|
237
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
|
238
|
+
createdEvent?: EntityCreatedEvent;
|
|
239
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
240
|
+
deletedEvent?: EntityDeletedEvent;
|
|
241
|
+
actionEvent?: ActionEvent;
|
|
242
|
+
/** Event ID. With this ID you can easily spot duplicated events and ignore them. */
|
|
243
|
+
_id?: string;
|
|
244
|
+
/**
|
|
245
|
+
* Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
|
|
246
|
+
* For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
|
|
247
|
+
*/
|
|
248
|
+
entityFqdn?: string;
|
|
249
|
+
/**
|
|
250
|
+
* Event action name, placed at the top level to make it easier for users to dispatch messages.
|
|
251
|
+
* For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
|
|
252
|
+
*/
|
|
253
|
+
slug?: string;
|
|
254
|
+
/** ID of the entity associated with the event. */
|
|
255
|
+
entityId?: string;
|
|
256
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
|
|
257
|
+
eventTime?: Date | null;
|
|
258
|
+
/**
|
|
259
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
260
|
+
* (for example, GDPR).
|
|
261
|
+
*/
|
|
262
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
263
|
+
/** If present, indicates the action that triggered the event. */
|
|
264
|
+
originatedFrom?: string | null;
|
|
265
|
+
/**
|
|
266
|
+
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
|
|
267
|
+
* You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
|
|
268
|
+
*/
|
|
269
|
+
entityEventSequence?: string | null;
|
|
270
|
+
}
|
|
271
|
+
/** @oneof */
|
|
272
|
+
interface DomainEventBodyOneOf {
|
|
273
|
+
createdEvent?: EntityCreatedEvent;
|
|
274
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
275
|
+
deletedEvent?: EntityDeletedEvent;
|
|
276
|
+
actionEvent?: ActionEvent;
|
|
277
|
+
}
|
|
278
|
+
interface EntityCreatedEvent {
|
|
279
|
+
entity?: string;
|
|
280
|
+
}
|
|
281
|
+
interface RestoreInfo {
|
|
282
|
+
deletedDate?: Date | null;
|
|
283
|
+
}
|
|
284
|
+
interface EntityUpdatedEvent {
|
|
285
|
+
/**
|
|
286
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
287
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
288
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
289
|
+
*/
|
|
290
|
+
currentEntity?: string;
|
|
291
|
+
}
|
|
292
|
+
interface EntityDeletedEvent {
|
|
293
|
+
/** Entity that was deleted. */
|
|
294
|
+
deletedEntity?: string | null;
|
|
295
|
+
}
|
|
296
|
+
interface ActionEvent {
|
|
297
|
+
body?: string;
|
|
298
|
+
}
|
|
299
|
+
interface Empty {
|
|
300
|
+
}
|
|
301
|
+
interface MessageEnvelope {
|
|
302
|
+
/**
|
|
303
|
+
* App instance ID.
|
|
304
|
+
* @format GUID
|
|
305
|
+
*/
|
|
306
|
+
instanceId?: string | null;
|
|
307
|
+
/**
|
|
308
|
+
* Event type.
|
|
309
|
+
* @maxLength 150
|
|
310
|
+
*/
|
|
311
|
+
eventType?: string;
|
|
312
|
+
/** The identification type and identity data. */
|
|
313
|
+
identity?: IdentificationData;
|
|
314
|
+
/** Stringify payload. */
|
|
315
|
+
data?: string;
|
|
316
|
+
/** Details related to the account */
|
|
317
|
+
accountInfo?: AccountInfo;
|
|
318
|
+
}
|
|
319
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
320
|
+
/**
|
|
321
|
+
* ID of a site visitor that has not logged in to the site.
|
|
322
|
+
* @format GUID
|
|
323
|
+
*/
|
|
324
|
+
anonymousVisitorId?: string;
|
|
325
|
+
/**
|
|
326
|
+
* ID of a site visitor that has logged in to the site.
|
|
327
|
+
* @format GUID
|
|
328
|
+
*/
|
|
329
|
+
memberId?: string;
|
|
330
|
+
/**
|
|
331
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
332
|
+
* @format GUID
|
|
333
|
+
*/
|
|
334
|
+
wixUserId?: string;
|
|
335
|
+
/**
|
|
336
|
+
* ID of an app.
|
|
337
|
+
* @format GUID
|
|
338
|
+
*/
|
|
339
|
+
appId?: string;
|
|
340
|
+
/** @readonly */
|
|
341
|
+
identityType?: WebhookIdentityTypeWithLiterals;
|
|
342
|
+
}
|
|
343
|
+
/** @oneof */
|
|
344
|
+
interface IdentificationDataIdOneOf {
|
|
345
|
+
/**
|
|
346
|
+
* ID of a site visitor that has not logged in to the site.
|
|
347
|
+
* @format GUID
|
|
348
|
+
*/
|
|
349
|
+
anonymousVisitorId?: string;
|
|
350
|
+
/**
|
|
351
|
+
* ID of a site visitor that has logged in to the site.
|
|
352
|
+
* @format GUID
|
|
353
|
+
*/
|
|
354
|
+
memberId?: string;
|
|
355
|
+
/**
|
|
356
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
357
|
+
* @format GUID
|
|
358
|
+
*/
|
|
359
|
+
wixUserId?: string;
|
|
360
|
+
/**
|
|
361
|
+
* ID of an app.
|
|
362
|
+
* @format GUID
|
|
363
|
+
*/
|
|
364
|
+
appId?: string;
|
|
365
|
+
}
|
|
366
|
+
declare enum WebhookIdentityType {
|
|
367
|
+
UNKNOWN = "UNKNOWN",
|
|
368
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
369
|
+
MEMBER = "MEMBER",
|
|
370
|
+
WIX_USER = "WIX_USER",
|
|
371
|
+
APP = "APP"
|
|
372
|
+
}
|
|
373
|
+
/** @enumType */
|
|
374
|
+
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
375
|
+
interface AccountInfo {
|
|
376
|
+
/**
|
|
377
|
+
* ID of the Wix account associated with the event.
|
|
378
|
+
* @format GUID
|
|
379
|
+
*/
|
|
380
|
+
accountId?: string | null;
|
|
381
|
+
/**
|
|
382
|
+
* ID of the parent Wix account. Only included when accountId belongs to a child account.
|
|
383
|
+
* @format GUID
|
|
384
|
+
*/
|
|
385
|
+
parentAccountId?: string | null;
|
|
386
|
+
/**
|
|
387
|
+
* ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
|
|
388
|
+
* @format GUID
|
|
389
|
+
*/
|
|
390
|
+
siteId?: string | null;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Retrieves all audit records of a timecard, newest first.
|
|
394
|
+
*
|
|
395
|
+
* A record is written shortly after each change to the timecard, so a change
|
|
396
|
+
* you just made might not be listed yet. Records of a deleted timecard are
|
|
397
|
+
* kept.
|
|
398
|
+
* @param timecardId - ID of the timecard to retrieve audit records for.
|
|
399
|
+
* @public
|
|
400
|
+
* @documentationMaturity preview
|
|
401
|
+
* @requiredField timecardId
|
|
402
|
+
* @permissionId staff:time_clock:v1:timecard_audit_log:list_timecard_audit_logs
|
|
403
|
+
* @applicableIdentity APP
|
|
404
|
+
* @fqn wix.staff.time_clock.v1.TimecardAuditLogsService.ListTimecardAuditLogs
|
|
405
|
+
*/
|
|
406
|
+
declare function listTimecardAuditLogs(timecardId: string, options?: ListTimecardAuditLogsOptions): Promise<NonNullablePaths<ListTimecardAuditLogsResponse, `timecardAuditLogs` | `timecardAuditLogs.${number}.timecardId` | `timecardAuditLogs.${number}.timecardRevision` | `timecardAuditLogs.${number}.performedBy.staffMemberId` | `timecardAuditLogs.${number}.performedBy.identification.anonymousVisitorId` | `timecardAuditLogs.${number}.performedBy.identification.memberId` | `timecardAuditLogs.${number}.performedBy.identification.wixUserId` | `timecardAuditLogs.${number}.performedBy.identification.appId` | `timecardAuditLogs.${number}.action`, 4>>;
|
|
407
|
+
interface ListTimecardAuditLogsOptions {
|
|
408
|
+
/**
|
|
409
|
+
* Time zone for each record's `performedDate.localDate`, in IANA format, such
|
|
410
|
+
* as `America/New_York`. `performedDate.utcDate` is always in UTC.
|
|
411
|
+
* Default: `UTC`.
|
|
412
|
+
* @maxLength 50
|
|
413
|
+
*/
|
|
414
|
+
timeZone?: string | null;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export { type AccountInfo, type ActionEvent, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type FieldChange, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, type ListTimecardAuditLogsOptions, type ListTimecardAuditLogsRequest, type ListTimecardAuditLogsResponse, type MessageEnvelope, type Performer, type PerformerWhoOneOf, type RestoreInfo, TimecardAuditAction, type TimecardAuditActionWithLiterals, type TimecardAuditLog, type V1IdentificationData, type V1IdentificationDataIdOneOf, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type ZonedDate, listTimecardAuditLogs };
|