@wix/auto_sdk_ecom_tip-settings 1.0.7 → 1.0.9
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 +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.context.d.ts +9 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.context.js +16 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.context.js.map +1 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.http.d.ts +48 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.http.js +274 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.http.js.map +1 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.meta.d.ts +19 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.meta.js +123 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.meta.js.map +1 -0
- package/build/{index.d.ts → cjs/src/tips-settings-v1-tip-settings-tip-settings.public.d.ts} +11 -17
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.public.js +41 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.public.js.map +1 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.types.d.ts +475 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.types.js +35 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.types.js.map +1 -0
- package/build/{internal/tips-settings-v1-tip-settings-tip-settings.universal-BvU_OtgN.d.mts → cjs/src/tips-settings-v1-tip-settings-tip-settings.universal.d.ts} +146 -39
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.universal.js +300 -0
- package/build/cjs/src/tips-settings-v1-tip-settings-tip-settings.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.context.d.ts +9 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.context.js +9 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.context.js.map +1 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.http.d.ts +48 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.http.js +266 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.http.js.map +1 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.meta.d.ts +19 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.meta.js +92 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.meta.js.map +1 -0
- package/build/{internal/index.d.ts → es/src/tips-settings-v1-tip-settings-tip-settings.public.d.ts} +11 -17
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.public.js +29 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.public.js.map +1 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.types.d.ts +475 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.types.js +32 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.types.js.map +1 -0
- package/build/{tips-settings-v1-tip-settings-tip-settings.universal-BvU_OtgN.d.mts → es/src/tips-settings-v1-tip-settings-tip-settings.universal.d.ts} +146 -39
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.universal.js +269 -0
- package/build/es/src/tips-settings-v1-tip-settings-tip-settings.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.context.d.ts +9 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.context.js +16 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.context.js.map +1 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.http.d.ts +48 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.http.js +274 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.http.js.map +1 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.meta.d.ts +19 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.meta.js +123 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.meta.js.map +1 -0
- package/build/{index.d.mts → internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.public.d.ts} +11 -17
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.public.js +41 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.public.js.map +1 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.types.d.ts +475 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.types.js +35 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.types.js.map +1 -0
- package/build/{tips-settings-v1-tip-settings-tip-settings.universal-BvU_OtgN.d.ts → internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.universal.d.ts} +146 -39
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.universal.js +300 -0
- package/build/internal/cjs/src/tips-settings-v1-tip-settings-tip-settings.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.context.d.ts +9 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.context.js +9 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.context.js.map +1 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.http.d.ts +48 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.http.js +266 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.http.js.map +1 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.meta.d.ts +19 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.meta.js +92 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.meta.js.map +1 -0
- package/build/internal/{index.d.mts → es/src/tips-settings-v1-tip-settings-tip-settings.public.d.ts} +11 -17
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.public.js +29 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.public.js.map +1 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.types.d.ts +475 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.types.js +32 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.types.js.map +1 -0
- package/build/internal/{tips-settings-v1-tip-settings-tip-settings.universal-BvU_OtgN.d.ts → es/src/tips-settings-v1-tip-settings-tip-settings.universal.d.ts} +146 -39
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.universal.js +269 -0
- package/build/internal/es/src/tips-settings-v1-tip-settings-tip-settings.universal.js.map +1 -0
- package/package.json +11 -12
- package/build/index.js +0 -487
- package/build/index.js.map +0 -1
- package/build/index.mjs +0 -455
- package/build/index.mjs.map +0 -1
- package/build/internal/index.js +0 -487
- package/build/internal/index.js.map +0 -1
- package/build/internal/index.mjs +0 -455
- package/build/internal/index.mjs.map +0 -1
- package/build/internal/meta.d.mts +0 -355
- package/build/internal/meta.d.ts +0 -355
- package/build/internal/meta.js +0 -355
- package/build/internal/meta.js.map +0 -1
- package/build/internal/meta.mjs +0 -324
- package/build/internal/meta.mjs.map +0 -1
- package/build/meta.d.mts +0 -355
- package/build/meta.d.ts +0 -355
- package/build/meta.js +0 -355
- package/build/meta.js.map +0 -1
- package/build/meta.mjs +0 -324
- package/build/meta.mjs.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
1
2
|
/**
|
|
2
3
|
* Tip settings define how tips are calculated and distributed among staff. When
|
|
3
4
|
* Wix Tips is installed, default settings are automatically created. You can't
|
|
@@ -5,7 +6,7 @@
|
|
|
5
6
|
* settings allows Wix users to customize tip screens for different payment
|
|
6
7
|
* terminals or set specific presets for various products or services.
|
|
7
8
|
*/
|
|
8
|
-
interface TipSettings extends TipSettingsIdentifierOneOf {
|
|
9
|
+
export interface TipSettings extends TipSettingsIdentifierOneOf {
|
|
9
10
|
/**
|
|
10
11
|
* ID of the location ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/location-object))
|
|
11
12
|
* for which the tip settings apply.
|
|
@@ -124,7 +125,7 @@ interface TipSettings extends TipSettingsIdentifierOneOf {
|
|
|
124
125
|
extendedFields?: ExtendedFields;
|
|
125
126
|
}
|
|
126
127
|
/** @oneof */
|
|
127
|
-
interface TipSettingsIdentifierOneOf {
|
|
128
|
+
export interface TipSettingsIdentifierOneOf {
|
|
128
129
|
/**
|
|
129
130
|
* ID of the location ([SDK](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/locations/location-object))
|
|
130
131
|
* for which the tip settings apply.
|
|
@@ -146,7 +147,7 @@ interface TipSettingsIdentifierOneOf {
|
|
|
146
147
|
*/
|
|
147
148
|
userId?: string | null;
|
|
148
149
|
}
|
|
149
|
-
declare enum TipType {
|
|
150
|
+
export declare enum TipType {
|
|
150
151
|
/** There is no information about the tip type. */
|
|
151
152
|
UNKNOWN_TIP_TYPE = "UNKNOWN_TIP_TYPE",
|
|
152
153
|
/** The tip is calculated as a percentage of the subtotal of all related line items. */
|
|
@@ -154,7 +155,7 @@ declare enum TipType {
|
|
|
154
155
|
/** The tip is a fixed amount. */
|
|
155
156
|
AMOUNT = "AMOUNT"
|
|
156
157
|
}
|
|
157
|
-
interface Preset {
|
|
158
|
+
export interface Preset {
|
|
158
159
|
/**
|
|
159
160
|
* Value of the preset tip choice that's displayed to customers in the
|
|
160
161
|
* eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).
|
|
@@ -171,7 +172,7 @@ interface Preset {
|
|
|
171
172
|
*/
|
|
172
173
|
default?: boolean | null;
|
|
173
174
|
}
|
|
174
|
-
declare enum StaffDistributionMethod {
|
|
175
|
+
export declare enum StaffDistributionMethod {
|
|
175
176
|
/** There is no information about the staff distribution method. */
|
|
176
177
|
UNKNOWN_SPLIT_METHOD = "UNKNOWN_SPLIT_METHOD",
|
|
177
178
|
/** All staff receive an equal amount of the tip. */
|
|
@@ -179,7 +180,7 @@ declare enum StaffDistributionMethod {
|
|
|
179
180
|
/** Staff receive a proportional amount of the tip. */
|
|
180
181
|
PROPORTIONAL = "PROPORTIONAL"
|
|
181
182
|
}
|
|
182
|
-
interface ExtendedFields {
|
|
183
|
+
export interface ExtendedFields {
|
|
183
184
|
/**
|
|
184
185
|
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
185
186
|
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
@@ -190,11 +191,11 @@ interface ExtendedFields {
|
|
|
190
191
|
*/
|
|
191
192
|
namespaces?: Record<string, Record<string, any>>;
|
|
192
193
|
}
|
|
193
|
-
interface QueryTipSettingsRequest {
|
|
194
|
+
export interface QueryTipSettingsRequest {
|
|
194
195
|
/** WQL expression */
|
|
195
196
|
query: QueryV2;
|
|
196
197
|
}
|
|
197
|
-
interface QueryV2 extends QueryV2PagingMethodOneOf {
|
|
198
|
+
export interface QueryV2 extends QueryV2PagingMethodOneOf {
|
|
198
199
|
/** Paging options to limit and skip the number of items. */
|
|
199
200
|
paging?: Paging;
|
|
200
201
|
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
@@ -228,13 +229,13 @@ interface QueryV2 extends QueryV2PagingMethodOneOf {
|
|
|
228
229
|
fieldsets?: string[];
|
|
229
230
|
}
|
|
230
231
|
/** @oneof */
|
|
231
|
-
interface QueryV2PagingMethodOneOf {
|
|
232
|
+
export interface QueryV2PagingMethodOneOf {
|
|
232
233
|
/** Paging options to limit and skip the number of items. */
|
|
233
234
|
paging?: Paging;
|
|
234
235
|
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
235
236
|
cursorPaging?: CursorPaging;
|
|
236
237
|
}
|
|
237
|
-
interface Sorting {
|
|
238
|
+
export interface Sorting {
|
|
238
239
|
/**
|
|
239
240
|
* Name of the field to sort by.
|
|
240
241
|
* @maxLength 512
|
|
@@ -243,17 +244,17 @@ interface Sorting {
|
|
|
243
244
|
/** Sort order. */
|
|
244
245
|
order?: SortOrder;
|
|
245
246
|
}
|
|
246
|
-
declare enum SortOrder {
|
|
247
|
+
export declare enum SortOrder {
|
|
247
248
|
ASC = "ASC",
|
|
248
249
|
DESC = "DESC"
|
|
249
250
|
}
|
|
250
|
-
interface Paging {
|
|
251
|
+
export interface Paging {
|
|
251
252
|
/** Number of items to load. */
|
|
252
253
|
limit?: number | null;
|
|
253
254
|
/** Number of items to skip in the current sort order. */
|
|
254
255
|
offset?: number | null;
|
|
255
256
|
}
|
|
256
|
-
interface CursorPaging {
|
|
257
|
+
export interface CursorPaging {
|
|
257
258
|
/**
|
|
258
259
|
* Maximum number of items to return in the results.
|
|
259
260
|
* @max 100
|
|
@@ -268,13 +269,13 @@ interface CursorPaging {
|
|
|
268
269
|
*/
|
|
269
270
|
cursor?: string | null;
|
|
270
271
|
}
|
|
271
|
-
interface QueryTipSettingsResponse {
|
|
272
|
+
export interface QueryTipSettingsResponse {
|
|
272
273
|
/** Retrieved `tipSettings` objects. */
|
|
273
274
|
tipSettings?: TipSettings[];
|
|
274
275
|
/** Metadate for the paged set of retrieved `tipSettings` objects. */
|
|
275
276
|
pagingMetadata?: PagingMetadataV2;
|
|
276
277
|
}
|
|
277
|
-
interface PagingMetadataV2 {
|
|
278
|
+
export interface PagingMetadataV2 {
|
|
278
279
|
/** Number of items returned in the response. */
|
|
279
280
|
count?: number | null;
|
|
280
281
|
/** Offset that was requested. */
|
|
@@ -286,7 +287,7 @@ interface PagingMetadataV2 {
|
|
|
286
287
|
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
|
|
287
288
|
cursors?: Cursors;
|
|
288
289
|
}
|
|
289
|
-
interface Cursors {
|
|
290
|
+
export interface Cursors {
|
|
290
291
|
/**
|
|
291
292
|
* Cursor string pointing to the next page in the list of results.
|
|
292
293
|
* @maxLength 16000
|
|
@@ -298,40 +299,40 @@ interface Cursors {
|
|
|
298
299
|
*/
|
|
299
300
|
prev?: string | null;
|
|
300
301
|
}
|
|
301
|
-
interface UpdateTipSettingsRequest {
|
|
302
|
+
export interface UpdateTipSettingsRequest {
|
|
302
303
|
/** Tip settings to update. */
|
|
303
304
|
tipSettings: TipSettings;
|
|
304
305
|
}
|
|
305
|
-
interface UpdateTipSettingsResponse {
|
|
306
|
+
export interface UpdateTipSettingsResponse {
|
|
306
307
|
/** Updated tip settings. */
|
|
307
308
|
tipSettings?: TipSettings;
|
|
308
309
|
}
|
|
309
|
-
interface CreateTipSettingsRequest {
|
|
310
|
+
export interface CreateTipSettingsRequest {
|
|
310
311
|
/** Tip settings to create. */
|
|
311
312
|
tipSettings: TipSettings;
|
|
312
313
|
}
|
|
313
|
-
interface CreateTipSettingsResponse {
|
|
314
|
+
export interface CreateTipSettingsResponse {
|
|
314
315
|
/** Created tip settings. */
|
|
315
316
|
tipSettings?: TipSettings;
|
|
316
317
|
}
|
|
317
|
-
interface CreateDefaultTipSettingsRequest {
|
|
318
|
+
export interface CreateDefaultTipSettingsRequest {
|
|
318
319
|
/** Default tip settings to create. */
|
|
319
320
|
tipSettings: TipSettings;
|
|
320
321
|
}
|
|
321
|
-
interface CreateDefaultTipSettingsResponse {
|
|
322
|
+
export interface CreateDefaultTipSettingsResponse {
|
|
322
323
|
/** Created default tip settings. */
|
|
323
324
|
tipSettings?: TipSettings;
|
|
324
325
|
}
|
|
325
|
-
interface DeleteTipSettingsRequest {
|
|
326
|
+
export interface DeleteTipSettingsRequest {
|
|
326
327
|
/**
|
|
327
328
|
* ID of the `tipSettings` object to delete.
|
|
328
329
|
* @format GUID
|
|
329
330
|
*/
|
|
330
331
|
tipSettingsId: string | null;
|
|
331
332
|
}
|
|
332
|
-
interface DeleteTipSettingsResponse {
|
|
333
|
+
export interface DeleteTipSettingsResponse {
|
|
333
334
|
}
|
|
334
|
-
interface DomainEvent extends DomainEventBodyOneOf {
|
|
335
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
335
336
|
createdEvent?: EntityCreatedEvent;
|
|
336
337
|
updatedEvent?: EntityUpdatedEvent;
|
|
337
338
|
deletedEvent?: EntityDeletedEvent;
|
|
@@ -374,19 +375,19 @@ interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
374
375
|
entityEventSequence?: string | null;
|
|
375
376
|
}
|
|
376
377
|
/** @oneof */
|
|
377
|
-
interface DomainEventBodyOneOf {
|
|
378
|
+
export interface DomainEventBodyOneOf {
|
|
378
379
|
createdEvent?: EntityCreatedEvent;
|
|
379
380
|
updatedEvent?: EntityUpdatedEvent;
|
|
380
381
|
deletedEvent?: EntityDeletedEvent;
|
|
381
382
|
actionEvent?: ActionEvent;
|
|
382
383
|
}
|
|
383
|
-
interface EntityCreatedEvent {
|
|
384
|
+
export interface EntityCreatedEvent {
|
|
384
385
|
entity?: string;
|
|
385
386
|
}
|
|
386
|
-
interface RestoreInfo {
|
|
387
|
+
export interface RestoreInfo {
|
|
387
388
|
deletedDate?: Date | null;
|
|
388
389
|
}
|
|
389
|
-
interface EntityUpdatedEvent {
|
|
390
|
+
export interface EntityUpdatedEvent {
|
|
390
391
|
/**
|
|
391
392
|
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
392
393
|
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
@@ -394,14 +395,14 @@ interface EntityUpdatedEvent {
|
|
|
394
395
|
*/
|
|
395
396
|
currentEntity?: string;
|
|
396
397
|
}
|
|
397
|
-
interface EntityDeletedEvent {
|
|
398
|
+
export interface EntityDeletedEvent {
|
|
398
399
|
/** Entity that was deleted */
|
|
399
400
|
deletedEntity?: string | null;
|
|
400
401
|
}
|
|
401
|
-
interface ActionEvent {
|
|
402
|
+
export interface ActionEvent {
|
|
402
403
|
body?: string;
|
|
403
404
|
}
|
|
404
|
-
interface MessageEnvelope {
|
|
405
|
+
export interface MessageEnvelope {
|
|
405
406
|
/**
|
|
406
407
|
* App instance ID.
|
|
407
408
|
* @format GUID
|
|
@@ -417,7 +418,7 @@ interface MessageEnvelope {
|
|
|
417
418
|
/** Stringify payload. */
|
|
418
419
|
data?: string;
|
|
419
420
|
}
|
|
420
|
-
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
421
|
+
export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
421
422
|
/**
|
|
422
423
|
* ID of a site visitor that has not logged in to the site.
|
|
423
424
|
* @format GUID
|
|
@@ -442,7 +443,7 @@ interface IdentificationData extends IdentificationDataIdOneOf {
|
|
|
442
443
|
identityType?: WebhookIdentityType;
|
|
443
444
|
}
|
|
444
445
|
/** @oneof */
|
|
445
|
-
interface IdentificationDataIdOneOf {
|
|
446
|
+
export interface IdentificationDataIdOneOf {
|
|
446
447
|
/**
|
|
447
448
|
* ID of a site visitor that has not logged in to the site.
|
|
448
449
|
* @format GUID
|
|
@@ -464,13 +465,43 @@ interface IdentificationDataIdOneOf {
|
|
|
464
465
|
*/
|
|
465
466
|
appId?: string;
|
|
466
467
|
}
|
|
467
|
-
declare enum WebhookIdentityType {
|
|
468
|
+
export declare enum WebhookIdentityType {
|
|
468
469
|
UNKNOWN = "UNKNOWN",
|
|
469
470
|
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
470
471
|
MEMBER = "MEMBER",
|
|
471
472
|
WIX_USER = "WIX_USER",
|
|
472
473
|
APP = "APP"
|
|
473
474
|
}
|
|
475
|
+
type TipSettingsNonNullablePaths = `tipType` | `presets` | `staffDistributionMethod`;
|
|
476
|
+
/**
|
|
477
|
+
* Creates a query to retrieve a list of tip settings.
|
|
478
|
+
*
|
|
479
|
+
* The `queryTipSettings()` function builds a query to retrieve a list of tip settings and returns a `TipSettingsQueryBuilder` object.
|
|
480
|
+
*
|
|
481
|
+
* The returned object contains the query definition, which is typically used to run the query using the [find()](https://dev.wix.com/docs/sdk/backend-modules/ecom/tip-settings/tip-settings-query-builder/find) function.
|
|
482
|
+
*
|
|
483
|
+
* You can refine the query by chaining `TipSettingsQueryBuilder` functions onto the query. `TipSettingsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTipSettings()` returns.
|
|
484
|
+
*
|
|
485
|
+
* `queryTipSettings()` runs with the following `TipSettingsQueryBuilder` default that you can override:
|
|
486
|
+
*
|
|
487
|
+
* + `limit` is `50`.
|
|
488
|
+
* + Sorted by `id` in ascending order.
|
|
489
|
+
*
|
|
490
|
+
* The functions that are chained to `queryTipSettings()` are applied in the order they are called. For example, if you apply `ascending("tipType")` and then `ascending("locationId")`, the results are sorted first by the `"tipType"`, and then, if there are multiple results with the same `"tipType"`, the items are sorted by `"locationId"`.
|
|
491
|
+
*
|
|
492
|
+
* The following `TipSettingsQueryBuilder` functions are supported for the `queryTipSettings()` function. For a full description of the tip settings object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/ecom/tip-settings/tip-settings-query-result/items) property in `TipSettingsQueryResult`.
|
|
493
|
+
* @public
|
|
494
|
+
* @documentationMaturity preview
|
|
495
|
+
* @permissionScope Manage Bookings
|
|
496
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
497
|
+
* @permissionScope Manage Bookings - all permissions
|
|
498
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
499
|
+
* @permissionId WIX_TIPS.TIP_SETTINGS_READ
|
|
500
|
+
* @applicableIdentity APP
|
|
501
|
+
* @applicableIdentity VISITOR
|
|
502
|
+
* @fqn wix.tips.settings.v1.TipSettingsService.QueryTipSettings
|
|
503
|
+
*/
|
|
504
|
+
export declare function queryTipSettings(): TipSettingsQueryBuilder;
|
|
474
505
|
interface QueryCursorResult {
|
|
475
506
|
cursors: Cursors;
|
|
476
507
|
hasNext: () => boolean;
|
|
@@ -478,13 +509,13 @@ interface QueryCursorResult {
|
|
|
478
509
|
length: number;
|
|
479
510
|
pageSize: number;
|
|
480
511
|
}
|
|
481
|
-
interface TipSettingsQueryResult extends QueryCursorResult {
|
|
512
|
+
export interface TipSettingsQueryResult extends QueryCursorResult {
|
|
482
513
|
items: TipSettings[];
|
|
483
514
|
query: TipSettingsQueryBuilder;
|
|
484
515
|
next: () => Promise<TipSettingsQueryResult>;
|
|
485
516
|
prev: () => Promise<TipSettingsQueryResult>;
|
|
486
517
|
}
|
|
487
|
-
interface TipSettingsQueryBuilder {
|
|
518
|
+
export interface TipSettingsQueryBuilder {
|
|
488
519
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
489
520
|
* @param value - Value to compare against.
|
|
490
521
|
* @documentationMaturity preview
|
|
@@ -528,5 +559,81 @@ interface TipSettingsQueryBuilder {
|
|
|
528
559
|
/** @documentationMaturity preview */
|
|
529
560
|
find: () => Promise<TipSettingsQueryResult>;
|
|
530
561
|
}
|
|
531
|
-
|
|
532
|
-
|
|
562
|
+
/**
|
|
563
|
+
* Updates a `tipSettings` object.
|
|
564
|
+
*
|
|
565
|
+
*
|
|
566
|
+
* You can't update the `default` field.
|
|
567
|
+
* @param tipSettings - Tip settings to update.
|
|
568
|
+
* @public
|
|
569
|
+
* @documentationMaturity preview
|
|
570
|
+
* @requiredField tipSettings
|
|
571
|
+
* @param options - Options to use when updating tip settings.
|
|
572
|
+
* @permissionId WIX_TIPS.TIP_SETTINGS_UPDATE
|
|
573
|
+
* @permissionScope Manage Bookings
|
|
574
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
575
|
+
* @permissionScope Manage Bookings - all permissions
|
|
576
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
577
|
+
* @applicableIdentity APP
|
|
578
|
+
* @returns Updated tip settings.
|
|
579
|
+
* @fqn wix.tips.settings.v1.TipSettingsService.UpdateTipSettings
|
|
580
|
+
*/
|
|
581
|
+
export declare function updateTipSettings(tipSettings: TipSettings): Promise<NonNullablePaths<TipSettings, TipSettingsNonNullablePaths>>;
|
|
582
|
+
/**
|
|
583
|
+
* Creates a `tipSettings` object.
|
|
584
|
+
*
|
|
585
|
+
*
|
|
586
|
+
* You can't create a `tipSettings` object with `{"default": true}`.
|
|
587
|
+
* @param tipSettings - Tip settings to create.
|
|
588
|
+
* @public
|
|
589
|
+
* @documentationMaturity preview
|
|
590
|
+
* @requiredField tipSettings
|
|
591
|
+
* @permissionId WIX_TIPS.TIP_SETTINGS_CREATE
|
|
592
|
+
* @permissionScope Manage Bookings
|
|
593
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
594
|
+
* @permissionScope Manage Bookings - all permissions
|
|
595
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
596
|
+
* @applicableIdentity APP
|
|
597
|
+
* @returns Created tip settings.
|
|
598
|
+
* @fqn wix.tips.settings.v1.TipSettingsService.CreateTipSettings
|
|
599
|
+
*/
|
|
600
|
+
export declare function createTipSettings(tipSettings: TipSettings): Promise<NonNullablePaths<TipSettings, TipSettingsNonNullablePaths>>;
|
|
601
|
+
/**
|
|
602
|
+
* Creates a default `tipSettings` object.
|
|
603
|
+
*
|
|
604
|
+
*
|
|
605
|
+
* The call fails if there is already an existing default `tipSettings` object.
|
|
606
|
+
* @param tipSettings - Default tip settings to create.
|
|
607
|
+
* @public
|
|
608
|
+
* @documentationMaturity preview
|
|
609
|
+
* @requiredField tipSettings
|
|
610
|
+
* @permissionId WIX_TIPS.TIP_SETTINGS_CREATE
|
|
611
|
+
* @permissionScope Manage Bookings
|
|
612
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
613
|
+
* @permissionScope Manage Bookings - all permissions
|
|
614
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
615
|
+
* @applicableIdentity APP
|
|
616
|
+
* @fqn wix.tips.settings.v1.TipSettingsService.CreateDefaultTipSettings
|
|
617
|
+
*/
|
|
618
|
+
export declare function createDefaultTipSettings(tipSettings: TipSettings): Promise<NonNullablePaths<CreateDefaultTipSettingsResponse, {
|
|
619
|
+
[P in TipSettingsNonNullablePaths]: `tipSettings.${P}`;
|
|
620
|
+
}[TipSettingsNonNullablePaths]>>;
|
|
621
|
+
/**
|
|
622
|
+
* Deletes a `tipSettings` object.
|
|
623
|
+
*
|
|
624
|
+
*
|
|
625
|
+
* You can't delete the default `tipSettings` object.
|
|
626
|
+
* @param tipSettingsId - ID of the `tipSettings` object to delete.
|
|
627
|
+
* @public
|
|
628
|
+
* @documentationMaturity preview
|
|
629
|
+
* @requiredField tipSettingsId
|
|
630
|
+
* @permissionId WIX_TIPS.TIP_SETTINGS_DELETE
|
|
631
|
+
* @permissionScope Manage Bookings
|
|
632
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
633
|
+
* @permissionScope Manage Bookings - all permissions
|
|
634
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
635
|
+
* @applicableIdentity APP
|
|
636
|
+
* @fqn wix.tips.settings.v1.TipSettingsService.DeleteTipSettings
|
|
637
|
+
*/
|
|
638
|
+
export declare function deleteTipSettings(tipSettingsId: string): Promise<void>;
|
|
639
|
+
export {};
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.deleteTipSettings = exports.createDefaultTipSettings = exports.createTipSettings = exports.updateTipSettings = exports.queryTipSettings = exports.WebhookIdentityType = exports.SortOrder = exports.StaffDistributionMethod = exports.TipType = void 0;
|
|
27
|
+
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
28
|
+
const query_builder_1 = require("@wix/sdk-runtime/query-builder");
|
|
29
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
+
const ambassadorWixTipsSettingsV1TipSettings = __importStar(require("./tips-settings-v1-tip-settings-tip-settings.http.js"));
|
|
31
|
+
var TipType;
|
|
32
|
+
(function (TipType) {
|
|
33
|
+
/** There is no information about the tip type. */
|
|
34
|
+
TipType["UNKNOWN_TIP_TYPE"] = "UNKNOWN_TIP_TYPE";
|
|
35
|
+
/** The tip is calculated as a percentage of the subtotal of all related line items. */
|
|
36
|
+
TipType["PERCENTAGE"] = "PERCENTAGE";
|
|
37
|
+
/** The tip is a fixed amount. */
|
|
38
|
+
TipType["AMOUNT"] = "AMOUNT";
|
|
39
|
+
})(TipType || (exports.TipType = TipType = {}));
|
|
40
|
+
var StaffDistributionMethod;
|
|
41
|
+
(function (StaffDistributionMethod) {
|
|
42
|
+
/** There is no information about the staff distribution method. */
|
|
43
|
+
StaffDistributionMethod["UNKNOWN_SPLIT_METHOD"] = "UNKNOWN_SPLIT_METHOD";
|
|
44
|
+
/** All staff receive an equal amount of the tip. */
|
|
45
|
+
StaffDistributionMethod["EQUAL"] = "EQUAL";
|
|
46
|
+
/** Staff receive a proportional amount of the tip. */
|
|
47
|
+
StaffDistributionMethod["PROPORTIONAL"] = "PROPORTIONAL";
|
|
48
|
+
})(StaffDistributionMethod || (exports.StaffDistributionMethod = StaffDistributionMethod = {}));
|
|
49
|
+
var SortOrder;
|
|
50
|
+
(function (SortOrder) {
|
|
51
|
+
SortOrder["ASC"] = "ASC";
|
|
52
|
+
SortOrder["DESC"] = "DESC";
|
|
53
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
54
|
+
var WebhookIdentityType;
|
|
55
|
+
(function (WebhookIdentityType) {
|
|
56
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
57
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
58
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
59
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
60
|
+
WebhookIdentityType["APP"] = "APP";
|
|
61
|
+
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
62
|
+
/**
|
|
63
|
+
* Creates a query to retrieve a list of tip settings.
|
|
64
|
+
*
|
|
65
|
+
* The `queryTipSettings()` function builds a query to retrieve a list of tip settings and returns a `TipSettingsQueryBuilder` object.
|
|
66
|
+
*
|
|
67
|
+
* The returned object contains the query definition, which is typically used to run the query using the [find()](https://dev.wix.com/docs/sdk/backend-modules/ecom/tip-settings/tip-settings-query-builder/find) function.
|
|
68
|
+
*
|
|
69
|
+
* You can refine the query by chaining `TipSettingsQueryBuilder` functions onto the query. `TipSettingsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTipSettings()` returns.
|
|
70
|
+
*
|
|
71
|
+
* `queryTipSettings()` runs with the following `TipSettingsQueryBuilder` default that you can override:
|
|
72
|
+
*
|
|
73
|
+
* + `limit` is `50`.
|
|
74
|
+
* + Sorted by `id` in ascending order.
|
|
75
|
+
*
|
|
76
|
+
* The functions that are chained to `queryTipSettings()` are applied in the order they are called. For example, if you apply `ascending("tipType")` and then `ascending("locationId")`, the results are sorted first by the `"tipType"`, and then, if there are multiple results with the same `"tipType"`, the items are sorted by `"locationId"`.
|
|
77
|
+
*
|
|
78
|
+
* The following `TipSettingsQueryBuilder` functions are supported for the `queryTipSettings()` function. For a full description of the tip settings object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/ecom/tip-settings/tip-settings-query-result/items) property in `TipSettingsQueryResult`.
|
|
79
|
+
* @public
|
|
80
|
+
* @documentationMaturity preview
|
|
81
|
+
* @permissionScope Manage Bookings
|
|
82
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
83
|
+
* @permissionScope Manage Bookings - all permissions
|
|
84
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
85
|
+
* @permissionId WIX_TIPS.TIP_SETTINGS_READ
|
|
86
|
+
* @applicableIdentity APP
|
|
87
|
+
* @applicableIdentity VISITOR
|
|
88
|
+
* @fqn wix.tips.settings.v1.TipSettingsService.QueryTipSettings
|
|
89
|
+
*/
|
|
90
|
+
function queryTipSettings() {
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
93
|
+
return (0, query_builder_1.queryBuilder)({
|
|
94
|
+
func: async (payload) => {
|
|
95
|
+
const reqOpts = ambassadorWixTipsSettingsV1TipSettings.queryTipSettings(payload);
|
|
96
|
+
sideEffects?.onSiteCall?.();
|
|
97
|
+
try {
|
|
98
|
+
const result = await httpClient.request(reqOpts);
|
|
99
|
+
sideEffects?.onSuccess?.(result);
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
sideEffects?.onError?.(err);
|
|
104
|
+
throw err;
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
requestTransformer: (query) => {
|
|
108
|
+
const args = [query, {}];
|
|
109
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
110
|
+
...args?.[1],
|
|
111
|
+
query: args?.[0],
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
responseTransformer: ({ data }) => {
|
|
115
|
+
const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(data);
|
|
116
|
+
return {
|
|
117
|
+
items: transformedData?.tipSettings,
|
|
118
|
+
pagingMetadata: transformedData?.pagingMetadata,
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
errorTransformer: (err) => {
|
|
122
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
123
|
+
spreadPathsToArguments: {},
|
|
124
|
+
explicitPathsToArguments: { query: '$[0]' },
|
|
125
|
+
singleArgumentUnchanged: false,
|
|
126
|
+
});
|
|
127
|
+
throw transformedError;
|
|
128
|
+
},
|
|
129
|
+
pagingMethod: 'CURSOR',
|
|
130
|
+
transformationPaths: {},
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
exports.queryTipSettings = queryTipSettings;
|
|
134
|
+
/**
|
|
135
|
+
* Updates a `tipSettings` object.
|
|
136
|
+
*
|
|
137
|
+
*
|
|
138
|
+
* You can't update the `default` field.
|
|
139
|
+
* @param tipSettings - Tip settings to update.
|
|
140
|
+
* @public
|
|
141
|
+
* @documentationMaturity preview
|
|
142
|
+
* @requiredField tipSettings
|
|
143
|
+
* @param options - Options to use when updating tip settings.
|
|
144
|
+
* @permissionId WIX_TIPS.TIP_SETTINGS_UPDATE
|
|
145
|
+
* @permissionScope Manage Bookings
|
|
146
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
147
|
+
* @permissionScope Manage Bookings - all permissions
|
|
148
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
149
|
+
* @applicableIdentity APP
|
|
150
|
+
* @returns Updated tip settings.
|
|
151
|
+
* @fqn wix.tips.settings.v1.TipSettingsService.UpdateTipSettings
|
|
152
|
+
*/
|
|
153
|
+
async function updateTipSettings(tipSettings) {
|
|
154
|
+
// @ts-ignore
|
|
155
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
156
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
157
|
+
tipSettings: tipSettings,
|
|
158
|
+
});
|
|
159
|
+
const reqOpts = ambassadorWixTipsSettingsV1TipSettings.updateTipSettings(payload);
|
|
160
|
+
sideEffects?.onSiteCall?.();
|
|
161
|
+
try {
|
|
162
|
+
const result = await httpClient.request(reqOpts);
|
|
163
|
+
sideEffects?.onSuccess?.(result);
|
|
164
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.tipSettings;
|
|
165
|
+
}
|
|
166
|
+
catch (err) {
|
|
167
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
168
|
+
spreadPathsToArguments: {},
|
|
169
|
+
explicitPathsToArguments: { tipSettings: '$[0]' },
|
|
170
|
+
singleArgumentUnchanged: false,
|
|
171
|
+
}, ['tipSettings']);
|
|
172
|
+
sideEffects?.onError?.(err);
|
|
173
|
+
throw transformedError;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
exports.updateTipSettings = updateTipSettings;
|
|
177
|
+
/**
|
|
178
|
+
* Creates a `tipSettings` object.
|
|
179
|
+
*
|
|
180
|
+
*
|
|
181
|
+
* You can't create a `tipSettings` object with `{"default": true}`.
|
|
182
|
+
* @param tipSettings - Tip settings to create.
|
|
183
|
+
* @public
|
|
184
|
+
* @documentationMaturity preview
|
|
185
|
+
* @requiredField tipSettings
|
|
186
|
+
* @permissionId WIX_TIPS.TIP_SETTINGS_CREATE
|
|
187
|
+
* @permissionScope Manage Bookings
|
|
188
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
189
|
+
* @permissionScope Manage Bookings - all permissions
|
|
190
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
191
|
+
* @applicableIdentity APP
|
|
192
|
+
* @returns Created tip settings.
|
|
193
|
+
* @fqn wix.tips.settings.v1.TipSettingsService.CreateTipSettings
|
|
194
|
+
*/
|
|
195
|
+
async function createTipSettings(tipSettings) {
|
|
196
|
+
// @ts-ignore
|
|
197
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
198
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
199
|
+
tipSettings: tipSettings,
|
|
200
|
+
});
|
|
201
|
+
const reqOpts = ambassadorWixTipsSettingsV1TipSettings.createTipSettings(payload);
|
|
202
|
+
sideEffects?.onSiteCall?.();
|
|
203
|
+
try {
|
|
204
|
+
const result = await httpClient.request(reqOpts);
|
|
205
|
+
sideEffects?.onSuccess?.(result);
|
|
206
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.tipSettings;
|
|
207
|
+
}
|
|
208
|
+
catch (err) {
|
|
209
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
210
|
+
spreadPathsToArguments: {},
|
|
211
|
+
explicitPathsToArguments: { tipSettings: '$[0]' },
|
|
212
|
+
singleArgumentUnchanged: false,
|
|
213
|
+
}, ['tipSettings']);
|
|
214
|
+
sideEffects?.onError?.(err);
|
|
215
|
+
throw transformedError;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
exports.createTipSettings = createTipSettings;
|
|
219
|
+
/**
|
|
220
|
+
* Creates a default `tipSettings` object.
|
|
221
|
+
*
|
|
222
|
+
*
|
|
223
|
+
* The call fails if there is already an existing default `tipSettings` object.
|
|
224
|
+
* @param tipSettings - Default tip settings to create.
|
|
225
|
+
* @public
|
|
226
|
+
* @documentationMaturity preview
|
|
227
|
+
* @requiredField tipSettings
|
|
228
|
+
* @permissionId WIX_TIPS.TIP_SETTINGS_CREATE
|
|
229
|
+
* @permissionScope Manage Bookings
|
|
230
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
231
|
+
* @permissionScope Manage Bookings - all permissions
|
|
232
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
233
|
+
* @applicableIdentity APP
|
|
234
|
+
* @fqn wix.tips.settings.v1.TipSettingsService.CreateDefaultTipSettings
|
|
235
|
+
*/
|
|
236
|
+
async function createDefaultTipSettings(tipSettings) {
|
|
237
|
+
// @ts-ignore
|
|
238
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
239
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
240
|
+
tipSettings: tipSettings,
|
|
241
|
+
});
|
|
242
|
+
const reqOpts = ambassadorWixTipsSettingsV1TipSettings.createDefaultTipSettings(payload);
|
|
243
|
+
sideEffects?.onSiteCall?.();
|
|
244
|
+
try {
|
|
245
|
+
const result = await httpClient.request(reqOpts);
|
|
246
|
+
sideEffects?.onSuccess?.(result);
|
|
247
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
248
|
+
}
|
|
249
|
+
catch (err) {
|
|
250
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
251
|
+
spreadPathsToArguments: {},
|
|
252
|
+
explicitPathsToArguments: { tipSettings: '$[0]' },
|
|
253
|
+
singleArgumentUnchanged: false,
|
|
254
|
+
}, ['tipSettings']);
|
|
255
|
+
sideEffects?.onError?.(err);
|
|
256
|
+
throw transformedError;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
exports.createDefaultTipSettings = createDefaultTipSettings;
|
|
260
|
+
/**
|
|
261
|
+
* Deletes a `tipSettings` object.
|
|
262
|
+
*
|
|
263
|
+
*
|
|
264
|
+
* You can't delete the default `tipSettings` object.
|
|
265
|
+
* @param tipSettingsId - ID of the `tipSettings` object to delete.
|
|
266
|
+
* @public
|
|
267
|
+
* @documentationMaturity preview
|
|
268
|
+
* @requiredField tipSettingsId
|
|
269
|
+
* @permissionId WIX_TIPS.TIP_SETTINGS_DELETE
|
|
270
|
+
* @permissionScope Manage Bookings
|
|
271
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
|
|
272
|
+
* @permissionScope Manage Bookings - all permissions
|
|
273
|
+
* @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
|
|
274
|
+
* @applicableIdentity APP
|
|
275
|
+
* @fqn wix.tips.settings.v1.TipSettingsService.DeleteTipSettings
|
|
276
|
+
*/
|
|
277
|
+
async function deleteTipSettings(tipSettingsId) {
|
|
278
|
+
// @ts-ignore
|
|
279
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
280
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
281
|
+
tipSettingsId: tipSettingsId,
|
|
282
|
+
});
|
|
283
|
+
const reqOpts = ambassadorWixTipsSettingsV1TipSettings.deleteTipSettings(payload);
|
|
284
|
+
sideEffects?.onSiteCall?.();
|
|
285
|
+
try {
|
|
286
|
+
const result = await httpClient.request(reqOpts);
|
|
287
|
+
sideEffects?.onSuccess?.(result);
|
|
288
|
+
}
|
|
289
|
+
catch (err) {
|
|
290
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
291
|
+
spreadPathsToArguments: {},
|
|
292
|
+
explicitPathsToArguments: { tipSettingsId: '$[0]' },
|
|
293
|
+
singleArgumentUnchanged: false,
|
|
294
|
+
}, ['tipSettingsId']);
|
|
295
|
+
sideEffects?.onError?.(err);
|
|
296
|
+
throw transformedError;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
exports.deleteTipSettings = deleteTipSettings;
|
|
300
|
+
//# sourceMappingURL=tips-settings-v1-tip-settings-tip-settings.universal.js.map
|