@wix/auto_sdk_staff-time-clock_time-clock-settings 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.
@@ -0,0 +1,35 @@
1
+ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { GetTimeClockSettingsResponse, TimeClockSettings } from './index.typings.js';
3
+ export { AccountInfo, ActionEvent, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetTimeClockSettingsRequest, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, RestoreInfo, Task, UpdateTimeClockSettingsRequest, UpdateTimeClockSettingsResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
+
5
+ declare function getTimeClockSettings$1(httpClient: HttpClient): GetTimeClockSettingsSignature;
6
+ interface GetTimeClockSettingsSignature {
7
+ /**
8
+ * Retrieves the site's time clock settings.
9
+ *
10
+ * If the settings were never updated, the defaults are returned: an empty task
11
+ * catalog and self clock-in disabled.
12
+ */
13
+ (): Promise<NonNullablePaths<GetTimeClockSettingsResponse, `timeClockSettings.tasks` | `timeClockSettings.tasks.${number}.label` | `timeClockSettings.tasks.${number}.paid` | `timeClockSettings.selfClockInEnabled`, 3>>;
14
+ }
15
+ declare function updateTimeClockSettings$1(httpClient: HttpClient): UpdateTimeClockSettingsSignature;
16
+ interface UpdateTimeClockSettingsSignature {
17
+ /**
18
+ * Updates the site's time clock settings.
19
+ *
20
+ * Only the fields in `fieldMask` are updated. Without `fieldMask`, it's inferred
21
+ * from the fields you pass.
22
+ *
23
+ * `tasks` is replaced as a whole. To add, rename, or remove a task, pass the
24
+ * full task catalog. Keep the ID of each existing task, and leave the ID empty
25
+ * for a new task so one is assigned.
26
+ * @param - Settings to update; may be partial (see `field_mask`).
27
+ * @returns The settings after the update.
28
+ */
29
+ (timeClockSettings: TimeClockSettings): Promise<NonNullablePaths<TimeClockSettings, `tasks` | `tasks.${number}.label` | `tasks.${number}.paid` | `selfClockInEnabled`, 2>>;
30
+ }
31
+
32
+ declare const getTimeClockSettings: MaybeContext<BuildRESTFunction<typeof getTimeClockSettings$1> & typeof getTimeClockSettings$1>;
33
+ declare const updateTimeClockSettings: MaybeContext<BuildRESTFunction<typeof updateTimeClockSettings$1> & typeof updateTimeClockSettings$1>;
34
+
35
+ export { GetTimeClockSettingsResponse, TimeClockSettings, getTimeClockSettings, updateTimeClockSettings };
@@ -0,0 +1,209 @@
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
+ WebhookIdentityType: () => WebhookIdentityType,
24
+ getTimeClockSettings: () => getTimeClockSettings4,
25
+ updateTimeClockSettings: () => updateTimeClockSettings4
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+
29
+ // src/staff-time-clock-v1-time-clock-settings-time-clock-settings.universal.ts
30
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
31
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
32
+
33
+ // src/staff-time-clock-v1-time-clock-settings-time-clock-settings.http.ts
34
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
35
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
36
+ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
37
+ var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
38
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
39
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
40
+ var TRANSFORM_PATHS_0 = [
41
+ { path: "timeClockSettings.createdDate" },
42
+ { path: "timeClockSettings.updatedDate" }
43
+ ];
44
+ var TRANSFORM_PATHS_1 = [{ path: "fieldMask" }];
45
+ function resolveWixStaffTimeClockV1TimeClockSettingsServiceUrl(opts) {
46
+ const domainToMappings = {
47
+ "manage._base_domain_": [
48
+ {
49
+ srcPath: "/_api/time-clock-settings",
50
+ destPath: ""
51
+ }
52
+ ]
53
+ };
54
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
55
+ }
56
+ var PACKAGE_NAME = "@wix/auto_sdk_staff-time-clock_time-clock-settings";
57
+ function getTimeClockSettings(payload) {
58
+ function __getTimeClockSettings({ host }) {
59
+ const metadata = {
60
+ entityFqdn: "wix.staff.time_clock.v1.time_clock_settings",
61
+ method: "GET",
62
+ methodFqn: "wix.staff.time_clock.v1.TimeClockSettingsService.GetTimeClockSettings",
63
+ packageName: PACKAGE_NAME,
64
+ migrationOptions: {
65
+ optInTransformResponse: true
66
+ },
67
+ url: resolveWixStaffTimeClockV1TimeClockSettingsServiceUrl({
68
+ protoPath: "/v1/time-clock-settings",
69
+ data: payload,
70
+ host
71
+ }),
72
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
73
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
74
+ {
75
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
76
+ paths: TRANSFORM_PATHS_0
77
+ }
78
+ ])
79
+ };
80
+ return metadata;
81
+ }
82
+ return __getTimeClockSettings;
83
+ }
84
+ function updateTimeClockSettings(payload) {
85
+ function __updateTimeClockSettings({ host }) {
86
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
87
+ {
88
+ transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
89
+ paths: TRANSFORM_PATHS_1
90
+ },
91
+ {
92
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
93
+ paths: TRANSFORM_PATHS_0
94
+ }
95
+ ]);
96
+ const metadata = {
97
+ entityFqdn: "wix.staff.time_clock.v1.time_clock_settings",
98
+ method: "PATCH",
99
+ methodFqn: "wix.staff.time_clock.v1.TimeClockSettingsService.UpdateTimeClockSettings",
100
+ packageName: PACKAGE_NAME,
101
+ migrationOptions: {
102
+ optInTransformResponse: true
103
+ },
104
+ url: resolveWixStaffTimeClockV1TimeClockSettingsServiceUrl({
105
+ protoPath: "/v1/time-clock-settings",
106
+ data: serializedData,
107
+ host
108
+ }),
109
+ data: serializedData,
110
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
111
+ {
112
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
113
+ paths: TRANSFORM_PATHS_0
114
+ }
115
+ ])
116
+ };
117
+ return metadata;
118
+ }
119
+ return __updateTimeClockSettings;
120
+ }
121
+
122
+ // src/staff-time-clock-v1-time-clock-settings-time-clock-settings.universal.ts
123
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
124
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
125
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
126
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
127
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
128
+ WebhookIdentityType2["APP"] = "APP";
129
+ return WebhookIdentityType2;
130
+ })(WebhookIdentityType || {});
131
+ async function getTimeClockSettings2() {
132
+ const { httpClient, sideEffects } = arguments[0];
133
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
134
+ const reqOpts = getTimeClockSettings(
135
+ payload
136
+ );
137
+ sideEffects?.onSiteCall?.();
138
+ try {
139
+ const result = await httpClient.request(reqOpts);
140
+ sideEffects?.onSuccess?.(result);
141
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
142
+ } catch (err) {
143
+ const transformedError = (0, import_transform_error.transformError)(
144
+ err,
145
+ {
146
+ spreadPathsToArguments: {},
147
+ explicitPathsToArguments: {},
148
+ singleArgumentUnchanged: false
149
+ },
150
+ []
151
+ );
152
+ sideEffects?.onError?.(err);
153
+ throw transformedError;
154
+ }
155
+ }
156
+ async function updateTimeClockSettings2(timeClockSettings) {
157
+ const { httpClient, sideEffects } = arguments[1];
158
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
159
+ timeClockSettings
160
+ });
161
+ const reqOpts = updateTimeClockSettings(
162
+ payload
163
+ );
164
+ sideEffects?.onSiteCall?.();
165
+ try {
166
+ const result = await httpClient.request(reqOpts);
167
+ sideEffects?.onSuccess?.(result);
168
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.timeClockSettings;
169
+ } catch (err) {
170
+ const transformedError = (0, import_transform_error.transformError)(
171
+ err,
172
+ {
173
+ spreadPathsToArguments: {},
174
+ explicitPathsToArguments: { timeClockSettings: "$[0]" },
175
+ singleArgumentUnchanged: false
176
+ },
177
+ ["timeClockSettings"]
178
+ );
179
+ sideEffects?.onError?.(err);
180
+ throw transformedError;
181
+ }
182
+ }
183
+
184
+ // src/staff-time-clock-v1-time-clock-settings-time-clock-settings.public.ts
185
+ function getTimeClockSettings3(httpClient) {
186
+ return () => getTimeClockSettings2(
187
+ // @ts-ignore
188
+ { httpClient }
189
+ );
190
+ }
191
+ function updateTimeClockSettings3(httpClient) {
192
+ return (timeClockSettings) => updateTimeClockSettings2(
193
+ timeClockSettings,
194
+ // @ts-ignore
195
+ { httpClient }
196
+ );
197
+ }
198
+
199
+ // src/staff-time-clock-v1-time-clock-settings-time-clock-settings.context.ts
200
+ var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
201
+ var getTimeClockSettings4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getTimeClockSettings3);
202
+ var updateTimeClockSettings4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateTimeClockSettings3);
203
+ // Annotate the CommonJS export names for ESM import in node:
204
+ 0 && (module.exports = {
205
+ WebhookIdentityType,
206
+ getTimeClockSettings,
207
+ updateTimeClockSettings
208
+ });
209
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.ts","../../src/staff-time-clock-v1-time-clock-settings-time-clock-settings.universal.ts","../../src/staff-time-clock-v1-time-clock-settings-time-clock-settings.http.ts","../../src/staff-time-clock-v1-time-clock-settings-time-clock-settings.public.ts","../../src/staff-time-clock-v1-time-clock-settings-time-clock-settings.context.ts"],"sourcesContent":["export * from './src/staff-time-clock-v1-time-clock-settings-time-clock-settings.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 ambassadorWixStaffTimeClockV1TimeClockSettings from './staff-time-clock-v1-time-clock-settings-time-clock-settings.http.js';\n\n/**\n * A site's time clock settings: the tasks staff members can work on during a\n * shift, and whether they can clock themselves in. Each site has 1 set of time\n * clock settings.\n */\nexport interface TimeClockSettings {\n /**\n * Time clock settings ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, incremented on each update.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the settings were created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the settings were last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Task catalog: the tasks staff members can start during a timecard. Empty\n * by default. Replaced as a whole on update.\n * @maxSize 100\n */\n tasks?: Task[];\n /**\n * Whether staff members can clock themselves in and start tasks, for example\n * from their own phone. When `false`, staff members who are already clocked\n * in can still clock themselves out. Clocking in on behalf of a staff member,\n * such as from a kiosk, isn't affected. Default: `false`.\n */\n selfClockInEnabled?: boolean;\n /**\n * How long, in seconds, a timecard can stay open before it's closed\n * automatically. Default: `86400` (24 hours).\n * @internal\n * @min 60\n * @max 86400\n */\n autoClockOutThresholdInSeconds?: number | null;\n}\n\n/**\n * A kind of work a staff member can start during a timecard, such as \"Front\n * desk\" or \"Lunch\". Time spent on an unpaid task isn't counted as paid working\n * time.\n */\nexport interface Task {\n /**\n * Task ID. Leave empty when adding a task, and one is assigned. Pass the\n * existing ID when updating a task. Tasks are identified by ID, so 2 tasks\n * can have the same label.\n * @format GUID\n */\n _id?: string | null;\n /**\n * Task name shown to staff members and managers, such as \"Lunch\" or\n * \"Training\".\n * @maxLength 100\n */\n label?: string;\n /** Whether time spent on this task counts as paid working time. */\n paid?: boolean;\n}\n\nexport interface GetTimeClockSettingsRequest {}\n\nexport interface GetTimeClockSettingsResponse {\n /** The current site's time-clock settings. */\n timeClockSettings?: TimeClockSettings;\n}\n\nexport interface UpdateTimeClockSettingsRequest {\n /** Settings to update; may be partial (see `field_mask`). */\n timeClockSettings: TimeClockSettings;\n /**\n * Set of fields to update. Inferred from the payload when omitted.\n * @internal\n */\n fieldMask?: string[];\n}\n\nexport interface UpdateTimeClockSettingsResponse {\n /** The settings after the update. */\n timeClockSettings?: TimeClockSettings;\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 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 the site's time clock settings.\n *\n * If the settings were never updated, the defaults are returned: an empty task\n * catalog and self clock-in disabled.\n * @public\n * @documentationMaturity preview\n * @permissionId staff:time_clock:v1:time_clock_settings:get_time_clock_settings\n * @applicableIdentity APP\n * @fqn wix.staff.time_clock.v1.TimeClockSettingsService.GetTimeClockSettings\n */\nexport async function getTimeClockSettings(): Promise<\n NonNullablePaths<\n GetTimeClockSettingsResponse,\n | `timeClockSettings.tasks`\n | `timeClockSettings.tasks.${number}.label`\n | `timeClockSettings.tasks.${number}.paid`\n | `timeClockSettings.selfClockInEnabled`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixStaffTimeClockV1TimeClockSettings.getTimeClockSettings(\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 singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates the site's time clock settings.\n *\n * Only the fields in `fieldMask` are updated. Without `fieldMask`, it's inferred\n * from the fields you pass.\n *\n * `tasks` is replaced as a whole. To add, rename, or remove a task, pass the\n * full task catalog. Keep the ID of each existing task, and leave the ID empty\n * for a new task so one is assigned.\n * @param timeClockSettings - Settings to update; may be partial (see `field_mask`).\n * @public\n * @documentationMaturity preview\n * @requiredField timeClockSettings\n * @permissionId staff:time_clock:v1:time_clock_settings:update_time_clock_settings\n * @applicableIdentity APP\n * @returns The settings after the update.\n * @fqn wix.staff.time_clock.v1.TimeClockSettingsService.UpdateTimeClockSettings\n */\nexport async function updateTimeClockSettings(\n timeClockSettings: TimeClockSettings\n): Promise<\n NonNullablePaths<\n TimeClockSettings,\n | `tasks`\n | `tasks.${number}.label`\n | `tasks.${number}.paid`\n | `selfClockInEnabled`,\n 2\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n timeClockSettings: timeClockSettings,\n });\n\n const reqOpts =\n ambassadorWixStaffTimeClockV1TimeClockSettings.updateTimeClockSettings(\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 ?.timeClockSettings!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { timeClockSettings: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['timeClockSettings']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\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: 'timeClockSettings.createdDate' },\n { path: 'timeClockSettings.updatedDate' },\n];\nconst TRANSFORM_PATHS_1 = [{ path: 'fieldMask' }];\n\nfunction resolveWixStaffTimeClockV1TimeClockSettingsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/time-clock-settings',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_staff-time-clock_time-clock-settings';\n\n/**\n * Retrieves the site's time clock settings.\n *\n * If the settings were never updated, the defaults are returned: an empty task\n * catalog and self clock-in disabled.\n */\nexport function getTimeClockSettings(\n payload: object\n): RequestOptionsFactory<any> {\n function __getTimeClockSettings({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.staff.time_clock.v1.time_clock_settings',\n method: 'GET' as any,\n methodFqn:\n 'wix.staff.time_clock.v1.TimeClockSettingsService.GetTimeClockSettings',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffTimeClockV1TimeClockSettingsServiceUrl({\n protoPath: '/v1/time-clock-settings',\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 __getTimeClockSettings;\n}\n\n/**\n * Updates the site's time clock settings.\n *\n * Only the fields in `fieldMask` are updated. Without `fieldMask`, it's inferred\n * from the fields you pass.\n *\n * `tasks` is replaced as a whole. To add, rename, or remove a task, pass the\n * full task catalog. Keep the ID of each existing task, and leave the ID empty\n * for a new task so one is assigned.\n */\nexport function updateTimeClockSettings(\n payload: object\n): RequestOptionsFactory<any> {\n function __updateTimeClockSettings({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: TRANSFORM_PATHS_1,\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.staff.time_clock.v1.time_clock_settings',\n method: 'PATCH' as any,\n methodFqn:\n 'wix.staff.time_clock.v1.TimeClockSettingsService.UpdateTimeClockSettings',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixStaffTimeClockV1TimeClockSettingsServiceUrl({\n protoPath: '/v1/time-clock-settings',\n data: serializedData,\n host,\n }),\n data: serializedData,\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 __updateTimeClockSettings;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetTimeClockSettingsResponse,\n TimeClockSettings,\n getTimeClockSettings as universalGetTimeClockSettings,\n updateTimeClockSettings as universalUpdateTimeClockSettings,\n} from './staff-time-clock-v1-time-clock-settings-time-clock-settings.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/staff-time-clock' };\n\nexport function getTimeClockSettings(\n httpClient: HttpClient\n): GetTimeClockSettingsSignature {\n return () =>\n universalGetTimeClockSettings(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetTimeClockSettingsSignature {\n /**\n * Retrieves the site's time clock settings.\n *\n * If the settings were never updated, the defaults are returned: an empty task\n * catalog and self clock-in disabled.\n */\n (): Promise<\n NonNullablePaths<\n GetTimeClockSettingsResponse,\n | `timeClockSettings.tasks`\n | `timeClockSettings.tasks.${number}.label`\n | `timeClockSettings.tasks.${number}.paid`\n | `timeClockSettings.selfClockInEnabled`,\n 3\n >\n >;\n}\n\nexport function updateTimeClockSettings(\n httpClient: HttpClient\n): UpdateTimeClockSettingsSignature {\n return (timeClockSettings: TimeClockSettings) =>\n universalUpdateTimeClockSettings(\n timeClockSettings,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateTimeClockSettingsSignature {\n /**\n * Updates the site's time clock settings.\n *\n * Only the fields in `fieldMask` are updated. Without `fieldMask`, it's inferred\n * from the fields you pass.\n *\n * `tasks` is replaced as a whole. To add, rename, or remove a task, pass the\n * full task catalog. Keep the ID of each existing task, and leave the ID empty\n * for a new task so one is assigned.\n * @param - Settings to update; may be partial (see `field_mask`).\n * @returns The settings after the update.\n */\n (timeClockSettings: TimeClockSettings): Promise<\n NonNullablePaths<\n TimeClockSettings,\n | `tasks`\n | `tasks.${number}.label`\n | `tasks.${number}.paid`\n | `selfClockInEnabled`,\n 2\n >\n >;\n}\n\nexport {\n AccountInfo,\n ActionEvent,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetTimeClockSettingsRequest,\n GetTimeClockSettingsResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n Task,\n TimeClockSettings,\n UpdateTimeClockSettingsRequest,\n UpdateTimeClockSettingsResponse,\n WebhookIdentityType,\n} from './staff-time-clock-v1-time-clock-settings-time-clock-settings.universal.js';\n","import {\n getTimeClockSettings as publicGetTimeClockSettings,\n updateTimeClockSettings as publicUpdateTimeClockSettings,\n} from './staff-time-clock-v1-time-clock-settings-time-clock-settings.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getTimeClockSettings: MaybeContext<\n BuildRESTFunction<typeof publicGetTimeClockSettings> &\n typeof publicGetTimeClockSettings\n> = /*#__PURE__*/ createRESTModule(publicGetTimeClockSettings);\nexport const updateTimeClockSettings: MaybeContext<\n BuildRESTFunction<typeof publicUpdateTimeClockSettings> &\n typeof publicUpdateTimeClockSettings\n> = /*#__PURE__*/ createRESTModule(publicUpdateTimeClockSettings);\n\nexport { WebhookIdentityType } from './staff-time-clock-v1-time-clock-settings-time-clock-settings.universal.js';\nexport {\n TimeClockSettings,\n Task,\n GetTimeClockSettingsRequest,\n GetTimeClockSettingsResponse,\n UpdateTimeClockSettingsRequest,\n UpdateTimeClockSettingsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n} from './staff-time-clock-v1-time-clock-settings-time-clock-settings.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './staff-time-clock-v1-time-clock-settings-time-clock-settings.universal.js';\n"],"mappings":"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","names":["getTimeClockSettings","updateTimeClockSettings","import_timestamp","import_rest_modules","payload","WebhookIdentityType","getTimeClockSettings","sdkTransformError","updateTimeClockSettings","getTimeClockSettings","updateTimeClockSettings","import_rest_modules","getTimeClockSettings","updateTimeClockSettings"]}
@@ -0,0 +1,265 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ /**
4
+ * A site's time clock settings: the tasks staff members can work on during a
5
+ * shift, and whether they can clock themselves in. Each site has 1 set of time
6
+ * clock settings.
7
+ */
8
+ interface TimeClockSettings {
9
+ /**
10
+ * Time clock settings ID.
11
+ * @format GUID
12
+ * @readonly
13
+ */
14
+ _id?: string | null;
15
+ /**
16
+ * Revision number, incremented on each update.
17
+ * @readonly
18
+ */
19
+ revision?: string | null;
20
+ /**
21
+ * Date and time the settings were created.
22
+ * @readonly
23
+ */
24
+ _createdDate?: Date | null;
25
+ /**
26
+ * Date and time the settings were last updated.
27
+ * @readonly
28
+ */
29
+ _updatedDate?: Date | null;
30
+ /**
31
+ * Task catalog: the tasks staff members can start during a timecard. Empty
32
+ * by default. Replaced as a whole on update.
33
+ * @maxSize 100
34
+ */
35
+ tasks?: Task[];
36
+ /**
37
+ * Whether staff members can clock themselves in and start tasks, for example
38
+ * from their own phone. When `false`, staff members who are already clocked
39
+ * in can still clock themselves out. Clocking in on behalf of a staff member,
40
+ * such as from a kiosk, isn't affected. Default: `false`.
41
+ */
42
+ selfClockInEnabled?: boolean;
43
+ }
44
+ /**
45
+ * A kind of work a staff member can start during a timecard, such as "Front
46
+ * desk" or "Lunch". Time spent on an unpaid task isn't counted as paid working
47
+ * time.
48
+ */
49
+ interface Task {
50
+ /**
51
+ * Task ID. Leave empty when adding a task, and one is assigned. Pass the
52
+ * existing ID when updating a task. Tasks are identified by ID, so 2 tasks
53
+ * can have the same label.
54
+ * @format GUID
55
+ */
56
+ _id?: string | null;
57
+ /**
58
+ * Task name shown to staff members and managers, such as "Lunch" or
59
+ * "Training".
60
+ * @maxLength 100
61
+ */
62
+ label?: string;
63
+ /** Whether time spent on this task counts as paid working time. */
64
+ paid?: boolean;
65
+ }
66
+ interface GetTimeClockSettingsRequest {
67
+ }
68
+ interface GetTimeClockSettingsResponse {
69
+ /** The current site's time-clock settings. */
70
+ timeClockSettings?: TimeClockSettings;
71
+ }
72
+ interface UpdateTimeClockSettingsRequest {
73
+ /** Settings to update; may be partial (see `field_mask`). */
74
+ timeClockSettings: TimeClockSettings;
75
+ }
76
+ interface UpdateTimeClockSettingsResponse {
77
+ /** The settings after the update. */
78
+ timeClockSettings?: TimeClockSettings;
79
+ }
80
+ interface DomainEvent extends DomainEventBodyOneOf {
81
+ createdEvent?: EntityCreatedEvent;
82
+ updatedEvent?: EntityUpdatedEvent;
83
+ deletedEvent?: EntityDeletedEvent;
84
+ actionEvent?: ActionEvent;
85
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
86
+ _id?: string;
87
+ /**
88
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
89
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
90
+ */
91
+ entityFqdn?: string;
92
+ /**
93
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
94
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
95
+ */
96
+ slug?: string;
97
+ /** ID of the entity associated with the event. */
98
+ entityId?: string;
99
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
100
+ eventTime?: Date | null;
101
+ /**
102
+ * Whether the event was triggered as a result of a privacy regulation application
103
+ * (for example, GDPR).
104
+ */
105
+ triggeredByAnonymizeRequest?: boolean | null;
106
+ /** If present, indicates the action that triggered the event. */
107
+ originatedFrom?: string | null;
108
+ /**
109
+ * 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.
110
+ * 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.
111
+ */
112
+ entityEventSequence?: string | null;
113
+ }
114
+ /** @oneof */
115
+ interface DomainEventBodyOneOf {
116
+ createdEvent?: EntityCreatedEvent;
117
+ updatedEvent?: EntityUpdatedEvent;
118
+ deletedEvent?: EntityDeletedEvent;
119
+ actionEvent?: ActionEvent;
120
+ }
121
+ interface EntityCreatedEvent {
122
+ entity?: string;
123
+ }
124
+ interface RestoreInfo {
125
+ deletedDate?: Date | null;
126
+ }
127
+ interface EntityUpdatedEvent {
128
+ /**
129
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
130
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
131
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
132
+ */
133
+ currentEntity?: string;
134
+ }
135
+ interface EntityDeletedEvent {
136
+ /** Entity that was deleted. */
137
+ deletedEntity?: string | null;
138
+ }
139
+ interface ActionEvent {
140
+ body?: string;
141
+ }
142
+ interface MessageEnvelope {
143
+ /**
144
+ * App instance ID.
145
+ * @format GUID
146
+ */
147
+ instanceId?: string | null;
148
+ /**
149
+ * Event type.
150
+ * @maxLength 150
151
+ */
152
+ eventType?: string;
153
+ /** The identification type and identity data. */
154
+ identity?: IdentificationData;
155
+ /** Stringify payload. */
156
+ data?: string;
157
+ /** Details related to the account */
158
+ accountInfo?: AccountInfo;
159
+ }
160
+ interface IdentificationData extends IdentificationDataIdOneOf {
161
+ /**
162
+ * ID of a site visitor that has not logged in to the site.
163
+ * @format GUID
164
+ */
165
+ anonymousVisitorId?: string;
166
+ /**
167
+ * ID of a site visitor that has logged in to the site.
168
+ * @format GUID
169
+ */
170
+ memberId?: string;
171
+ /**
172
+ * ID of a Wix user (site owner, contributor, etc.).
173
+ * @format GUID
174
+ */
175
+ wixUserId?: string;
176
+ /**
177
+ * ID of an app.
178
+ * @format GUID
179
+ */
180
+ appId?: string;
181
+ /** @readonly */
182
+ identityType?: WebhookIdentityTypeWithLiterals;
183
+ }
184
+ /** @oneof */
185
+ interface IdentificationDataIdOneOf {
186
+ /**
187
+ * ID of a site visitor that has not logged in to the site.
188
+ * @format GUID
189
+ */
190
+ anonymousVisitorId?: string;
191
+ /**
192
+ * ID of a site visitor that has logged in to the site.
193
+ * @format GUID
194
+ */
195
+ memberId?: string;
196
+ /**
197
+ * ID of a Wix user (site owner, contributor, etc.).
198
+ * @format GUID
199
+ */
200
+ wixUserId?: string;
201
+ /**
202
+ * ID of an app.
203
+ * @format GUID
204
+ */
205
+ appId?: string;
206
+ }
207
+ declare enum WebhookIdentityType {
208
+ UNKNOWN = "UNKNOWN",
209
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
210
+ MEMBER = "MEMBER",
211
+ WIX_USER = "WIX_USER",
212
+ APP = "APP"
213
+ }
214
+ /** @enumType */
215
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
216
+ interface AccountInfo {
217
+ /**
218
+ * ID of the Wix account associated with the event.
219
+ * @format GUID
220
+ */
221
+ accountId?: string | null;
222
+ /**
223
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
224
+ * @format GUID
225
+ */
226
+ parentAccountId?: string | null;
227
+ /**
228
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
229
+ * @format GUID
230
+ */
231
+ siteId?: string | null;
232
+ }
233
+ /**
234
+ * Retrieves the site's time clock settings.
235
+ *
236
+ * If the settings were never updated, the defaults are returned: an empty task
237
+ * catalog and self clock-in disabled.
238
+ * @public
239
+ * @documentationMaturity preview
240
+ * @permissionId staff:time_clock:v1:time_clock_settings:get_time_clock_settings
241
+ * @applicableIdentity APP
242
+ * @fqn wix.staff.time_clock.v1.TimeClockSettingsService.GetTimeClockSettings
243
+ */
244
+ declare function getTimeClockSettings(): Promise<NonNullablePaths<GetTimeClockSettingsResponse, `timeClockSettings.tasks` | `timeClockSettings.tasks.${number}.label` | `timeClockSettings.tasks.${number}.paid` | `timeClockSettings.selfClockInEnabled`, 3>>;
245
+ /**
246
+ * Updates the site's time clock settings.
247
+ *
248
+ * Only the fields in `fieldMask` are updated. Without `fieldMask`, it's inferred
249
+ * from the fields you pass.
250
+ *
251
+ * `tasks` is replaced as a whole. To add, rename, or remove a task, pass the
252
+ * full task catalog. Keep the ID of each existing task, and leave the ID empty
253
+ * for a new task so one is assigned.
254
+ * @param timeClockSettings - Settings to update; may be partial (see `field_mask`).
255
+ * @public
256
+ * @documentationMaturity preview
257
+ * @requiredField timeClockSettings
258
+ * @permissionId staff:time_clock:v1:time_clock_settings:update_time_clock_settings
259
+ * @applicableIdentity APP
260
+ * @returns The settings after the update.
261
+ * @fqn wix.staff.time_clock.v1.TimeClockSettingsService.UpdateTimeClockSettings
262
+ */
263
+ declare function updateTimeClockSettings(timeClockSettings: TimeClockSettings): Promise<NonNullablePaths<TimeClockSettings, `tasks` | `tasks.${number}.label` | `tasks.${number}.paid` | `selfClockInEnabled`, 2>>;
264
+
265
+ export { type AccountInfo, type ActionEvent, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetTimeClockSettingsRequest, type GetTimeClockSettingsResponse, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type RestoreInfo, type Task, type TimeClockSettings, type UpdateTimeClockSettingsRequest, type UpdateTimeClockSettingsResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getTimeClockSettings, updateTimeClockSettings };