@wix/auto_sdk_staff-pay_pay-models 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +5 -34
- package/build/cjs/index.js +0 -118
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +7 -46
- package/build/cjs/index.typings.js +0 -102
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +5 -16
- package/build/cjs/meta.js +0 -88
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +5 -34
- package/build/es/index.mjs +0 -116
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +7 -46
- package/build/es/index.typings.mjs +0 -100
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +5 -16
- package/build/es/meta.mjs +0 -86
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +5 -34
- package/build/internal/cjs/index.typings.d.ts +7 -46
- package/build/internal/cjs/meta.d.ts +5 -16
- package/build/internal/es/index.d.mts +5 -34
- package/build/internal/es/index.typings.d.mts +7 -46
- package/build/internal/es/meta.d.mts +5 -16
- package/package.json +2 -2
|
@@ -72,8 +72,7 @@ interface PayModel {
|
|
|
72
72
|
* Date and time the pay model was archived.
|
|
73
73
|
*
|
|
74
74
|
* Returned only when the pay model is archived. An archived pay model can't be updated and isn't offered for new pay
|
|
75
|
-
* terms, but pay terms that already use it keep it, so it can still be retrieved. Set by Archive Pay Model
|
|
76
|
-
* by Unarchive Pay Model.
|
|
75
|
+
* terms, but pay terms that already use it keep it, so it can still be retrieved. Set by Archive Pay Model.
|
|
77
76
|
* @readonly
|
|
78
77
|
*/
|
|
79
78
|
archivedDate?: Date | null;
|
|
@@ -716,7 +715,7 @@ interface UnarchivePayModelRequest {
|
|
|
716
715
|
* ID of the pay model to unarchive.
|
|
717
716
|
* @format GUID
|
|
718
717
|
*/
|
|
719
|
-
payModelId
|
|
718
|
+
payModelId?: string;
|
|
720
719
|
}
|
|
721
720
|
interface UnarchivePayModelResponse {
|
|
722
721
|
/** Unarchived pay model. */
|
|
@@ -729,7 +728,7 @@ interface BulkDeletePayModelsRequest {
|
|
|
729
728
|
* @maxSize 100
|
|
730
729
|
* @format GUID
|
|
731
730
|
*/
|
|
732
|
-
payModelIds
|
|
731
|
+
payModelIds?: string[];
|
|
733
732
|
}
|
|
734
733
|
interface BulkDeletePayModelsResponse {
|
|
735
734
|
/**
|
|
@@ -989,12 +988,6 @@ type DeletePayModelApplicationErrors = {
|
|
|
989
988
|
description?: string;
|
|
990
989
|
data?: Record<string, any>;
|
|
991
990
|
};
|
|
992
|
-
/** @docsIgnore */
|
|
993
|
-
type BulkDeletePayModelsApplicationErrors = {
|
|
994
|
-
code?: 'PAY_MODEL_IN_USE';
|
|
995
|
-
description?: string;
|
|
996
|
-
data?: Record<string, any>;
|
|
997
|
-
};
|
|
998
991
|
/**
|
|
999
992
|
* Creates a pay model.
|
|
1000
993
|
*
|
|
@@ -1034,7 +1027,7 @@ declare function getPayModel(payModelId: string): Promise<NonNullablePaths<PayMo
|
|
|
1034
1027
|
* lines stay linked to it. Changes apply to staff pays calculated after the update, and the staff pays of the staff
|
|
1035
1028
|
* members paid with the pay model are marked stale.
|
|
1036
1029
|
*
|
|
1037
|
-
* An archived pay model can't be updated
|
|
1030
|
+
* An archived pay model can't be updated.
|
|
1038
1031
|
* @param _id - Pay model ID.
|
|
1039
1032
|
* @public
|
|
1040
1033
|
* @documentationMaturity preview
|
|
@@ -1111,8 +1104,7 @@ interface UpdatePayModel {
|
|
|
1111
1104
|
* Date and time the pay model was archived.
|
|
1112
1105
|
*
|
|
1113
1106
|
* Returned only when the pay model is archived. An archived pay model can't be updated and isn't offered for new pay
|
|
1114
|
-
* terms, but pay terms that already use it keep it, so it can still be retrieved. Set by Archive Pay Model
|
|
1115
|
-
* by Unarchive Pay Model.
|
|
1107
|
+
* terms, but pay terms that already use it keep it, so it can still be retrieved. Set by Archive Pay Model.
|
|
1116
1108
|
* @readonly
|
|
1117
1109
|
*/
|
|
1118
1110
|
archivedDate?: Date | null;
|
|
@@ -1128,8 +1120,6 @@ interface UpdatePayModel {
|
|
|
1128
1120
|
*
|
|
1129
1121
|
* A pay model that any pay terms use, past, current or upcoming, can't be deleted. Archive it instead, with Archive
|
|
1130
1122
|
* Pay Model.
|
|
1131
|
-
*
|
|
1132
|
-
* To delete multiple pay models in a single API call, call Bulk Delete Pay Models.
|
|
1133
1123
|
* @param payModelId - ID of the pay model to delete.
|
|
1134
1124
|
* @public
|
|
1135
1125
|
* @documentationMaturity preview
|
|
@@ -1301,7 +1291,7 @@ declare const utils: {
|
|
|
1301
1291
|
* Use it for a pay model that's no longer offered but that pay terms used, so it can't be deleted. Pay terms that use
|
|
1302
1292
|
* the pay model keep it, and it can still be retrieved. An archived pay model can't be updated.
|
|
1303
1293
|
*
|
|
1304
|
-
* Archiving an archived pay model returns it unchanged.
|
|
1294
|
+
* Archiving an archived pay model returns it unchanged.
|
|
1305
1295
|
* @param payModelId - ID of the pay model to archive.
|
|
1306
1296
|
* @public
|
|
1307
1297
|
* @documentationMaturity preview
|
|
@@ -1310,34 +1300,5 @@ declare const utils: {
|
|
|
1310
1300
|
* @fqn wix.staff.pay.v1.PayModelsService.ArchivePayModel
|
|
1311
1301
|
*/
|
|
1312
1302
|
declare function archivePayModel(payModelId: string): Promise<NonNullablePaths<ArchivePayModelResponse, `payModel.name` | `payModel.components` | `payModel.components.${number}.salaryOptions.amountPerPeriod` | `payModel.components.${number}.salaryOptions.prorateByDaysEmployed` | `payModel.components.${number}.hourlyOptions.rate` | `payModel.components.${number}.hourlyOptions.overtimeEligible` | `payModel.components.${number}.hourlyOptions.excludeSessionTime` | `payModel.components.${number}.flatPerSessionOptions.amount` | `payModel.components.${number}.flatPerSessionOptions.zeroWhenCancelled` | `payModel.components.${number}.basePlusPerHeadOptions.includedAttendees` | `payModel.components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee` | `payModel.components.${number}.basePlusPerHeadOptions.countBasis` | `payModel.components.${number}.basePlusPerHeadOptions.zeroWhenCancelled` | `payModel.components.${number}.basePlusPerHeadOptions.excludeFreeVisits` | `payModel.components.${number}.attendanceTiersOptions.countBasis` | `payModel.components.${number}.attendanceTiersOptions.zeroWhenCancelled` | `payModel.components.${number}.attendanceTiersOptions.excludeFreeVisits` | `payModel.components.${number}.serviceCommissionOptions.percent` | `payModel.components.${number}.serviceCommissionOptions.tierMode` | `payModel.components.${number}.serviceCommissionOptions.revenueRules.discountBasis` | `payModel.components.${number}.serviceCommissionOptions.revenueRules.taxBasis` | `payModel.components.${number}.productCommissionOptions.percent` | `payModel.components.${number}.name` | `payModel.components.${number}.type` | `payModel.combinator.greaterOfOptions.componentIds` | `payModel.combinator.type`, 5>>;
|
|
1313
|
-
/**
|
|
1314
|
-
* Unarchives a pay model. Clears `archivedDate`, so the pay model can be updated and offered again.
|
|
1315
|
-
*
|
|
1316
|
-
* Unarchiving a pay model that isn't archived returns it unchanged.
|
|
1317
|
-
* @param payModelId - ID of the pay model to unarchive.
|
|
1318
|
-
* @public
|
|
1319
|
-
* @documentationMaturity preview
|
|
1320
|
-
* @requiredField payModelId
|
|
1321
|
-
* @permissionId staff:pay:v1:pay_model:unarchive_pay_model
|
|
1322
|
-
* @fqn wix.staff.pay.v1.PayModelsService.UnarchivePayModel
|
|
1323
|
-
*/
|
|
1324
|
-
declare function unarchivePayModel(payModelId: string): Promise<NonNullablePaths<UnarchivePayModelResponse, `payModel.name` | `payModel.components` | `payModel.components.${number}.salaryOptions.amountPerPeriod` | `payModel.components.${number}.salaryOptions.prorateByDaysEmployed` | `payModel.components.${number}.hourlyOptions.rate` | `payModel.components.${number}.hourlyOptions.overtimeEligible` | `payModel.components.${number}.hourlyOptions.excludeSessionTime` | `payModel.components.${number}.flatPerSessionOptions.amount` | `payModel.components.${number}.flatPerSessionOptions.zeroWhenCancelled` | `payModel.components.${number}.basePlusPerHeadOptions.includedAttendees` | `payModel.components.${number}.basePlusPerHeadOptions.amountPerAdditionalAttendee` | `payModel.components.${number}.basePlusPerHeadOptions.countBasis` | `payModel.components.${number}.basePlusPerHeadOptions.zeroWhenCancelled` | `payModel.components.${number}.basePlusPerHeadOptions.excludeFreeVisits` | `payModel.components.${number}.attendanceTiersOptions.countBasis` | `payModel.components.${number}.attendanceTiersOptions.zeroWhenCancelled` | `payModel.components.${number}.attendanceTiersOptions.excludeFreeVisits` | `payModel.components.${number}.serviceCommissionOptions.percent` | `payModel.components.${number}.serviceCommissionOptions.tierMode` | `payModel.components.${number}.serviceCommissionOptions.revenueRules.discountBasis` | `payModel.components.${number}.serviceCommissionOptions.revenueRules.taxBasis` | `payModel.components.${number}.productCommissionOptions.percent` | `payModel.components.${number}.name` | `payModel.components.${number}.type` | `payModel.combinator.greaterOfOptions.componentIds` | `payModel.combinator.type`, 5>>;
|
|
1325
|
-
/**
|
|
1326
|
-
* Deletes multiple pay models.
|
|
1327
|
-
*
|
|
1328
|
-
* Each pay model is deleted on its own: one that pay terms use isn't deleted and its result fails with
|
|
1329
|
-
* `PAY_MODEL_IN_USE`, while the others are still deleted.
|
|
1330
|
-
*
|
|
1331
|
-
* To delete a single pay model, call Delete Pay Model.
|
|
1332
|
-
* @param payModelIds - IDs of the pay models to delete.
|
|
1333
|
-
* @public
|
|
1334
|
-
* @documentationMaturity preview
|
|
1335
|
-
* @requiredField payModelIds
|
|
1336
|
-
* @permissionId staff:pay:v1:pay_model:bulk_delete_pay_models
|
|
1337
|
-
* @fqn wix.staff.pay.v1.PayModelsService.BulkDeletePayModels
|
|
1338
|
-
*/
|
|
1339
|
-
declare function bulkDeletePayModels(payModelIds: string[]): Promise<NonNullablePaths<BulkDeletePayModelsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 4> & {
|
|
1340
|
-
__applicationErrorsType?: BulkDeletePayModelsApplicationErrors;
|
|
1341
|
-
}>;
|
|
1342
1303
|
|
|
1343
|
-
export { type AccountInfo, type ActionEvent, type ApplicationError, type ArchivePayModelRequest, type ArchivePayModelResponse, type AttendanceTier, type AttendanceTiersOptions, AttendeeCountBasis, type AttendeeCountBasisWithLiterals, type BasePlusPerHeadOptions, type BulkActionMetadata, type
|
|
1304
|
+
export { type AccountInfo, type ActionEvent, type ApplicationError, type ArchivePayModelRequest, type ArchivePayModelResponse, type AttendanceTier, type AttendanceTiersOptions, AttendeeCountBasis, type AttendeeCountBasisWithLiterals, type BasePlusPerHeadOptions, type BulkActionMetadata, type BulkDeletePayModelsRequest, type BulkDeletePayModelsResponse, type BulkPayModelResult, type Combinator, type CombinatorOptionsOneOf, CombinatorType, type CombinatorTypeWithLiterals, type CommissionTier, CommissionTierMode, type CommissionTierModeWithLiterals, type CommonQueryWithEntityContext, ComponentType, type ComponentTypeWithLiterals, type CostDeduction, type CostDeductionKindOneOf, type CreatePayModelApplicationErrors, type CreatePayModelRequest, type CreatePayModelResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeletePayModelApplicationErrors, type DeletePayModelRequest, type DeletePayModelResponse, DiscountBasis, type DiscountBasisWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type ExtraAttendeeTier, type FlatPerSessionOptions, type GetPayModelRequest, type GetPayModelResponse, type GreaterOfOptions, type HourlyOptions, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type MessageEnvelope, type PayComponent, type PayComponentOptionsOneOf, type PayModel, type PayModelQuery, type PayModelQuerySpec, type PayModelsQueryBuilder, type PayModelsQueryResult, type PerCourseOptions, type PlanSaleCommissionOptions, type ProductCommissionOptions, type QueryPayModelsRequest, type QueryPayModelsResponse, type RestoreInfo, type RevenueRules, type SalaryOptions, type ServiceCommissionOptions, SortOrder, type SortOrderWithLiterals, type Sorting, TaxBasis, type TaxBasisWithLiterals, type TipsOptions, type UnarchivePayModelRequest, type UnarchivePayModelResponse, type UpdatePayModel, type UpdatePayModelApplicationErrors, type UpdatePayModelRequest, type UpdatePayModelResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, archivePayModel, createPayModel, deletePayModel, getPayModel, queryPayModels, typedQueryPayModels, updatePayModel, utils };
|
|
@@ -219,54 +219,6 @@ function archivePayModel(payload) {
|
|
|
219
219
|
}
|
|
220
220
|
return __archivePayModel;
|
|
221
221
|
}
|
|
222
|
-
function unarchivePayModel(payload) {
|
|
223
|
-
function __unarchivePayModel({ host }) {
|
|
224
|
-
const metadata = {
|
|
225
|
-
entityFqdn: "wix.staff.pay.v1.pay_model",
|
|
226
|
-
method: "POST",
|
|
227
|
-
methodFqn: "wix.staff.pay.v1.PayModelsService.UnarchivePayModel",
|
|
228
|
-
packageName: PACKAGE_NAME,
|
|
229
|
-
migrationOptions: {
|
|
230
|
-
optInTransformResponse: true
|
|
231
|
-
},
|
|
232
|
-
url: resolveWixStaffPayV1PayModelsServiceUrl({
|
|
233
|
-
protoPath: "/v1/pay-models/{payModelId}/unarchive",
|
|
234
|
-
data: payload,
|
|
235
|
-
host
|
|
236
|
-
}),
|
|
237
|
-
data: payload,
|
|
238
|
-
transformResponse: (payload2) => transformPaths(payload2, [
|
|
239
|
-
{
|
|
240
|
-
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
241
|
-
paths: TRANSFORM_PATHS_0
|
|
242
|
-
}
|
|
243
|
-
])
|
|
244
|
-
};
|
|
245
|
-
return metadata;
|
|
246
|
-
}
|
|
247
|
-
return __unarchivePayModel;
|
|
248
|
-
}
|
|
249
|
-
function bulkDeletePayModels(payload) {
|
|
250
|
-
function __bulkDeletePayModels({ host }) {
|
|
251
|
-
const metadata = {
|
|
252
|
-
entityFqdn: "wix.staff.pay.v1.pay_model",
|
|
253
|
-
method: "POST",
|
|
254
|
-
methodFqn: "wix.staff.pay.v1.PayModelsService.BulkDeletePayModels",
|
|
255
|
-
packageName: PACKAGE_NAME,
|
|
256
|
-
migrationOptions: {
|
|
257
|
-
optInTransformResponse: true
|
|
258
|
-
},
|
|
259
|
-
url: resolveWixStaffPayV1PayModelsServiceUrl({
|
|
260
|
-
protoPath: "/v1/bulk/pay-models/delete",
|
|
261
|
-
data: payload,
|
|
262
|
-
host
|
|
263
|
-
}),
|
|
264
|
-
data: payload
|
|
265
|
-
};
|
|
266
|
-
return metadata;
|
|
267
|
-
}
|
|
268
|
-
return __bulkDeletePayModels;
|
|
269
|
-
}
|
|
270
222
|
|
|
271
223
|
// src/staff-pay-v1-pay-model-pay-models.universal.ts
|
|
272
224
|
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
@@ -515,56 +467,6 @@ async function archivePayModel2(payModelId) {
|
|
|
515
467
|
throw transformedError;
|
|
516
468
|
}
|
|
517
469
|
}
|
|
518
|
-
async function unarchivePayModel2(payModelId) {
|
|
519
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
520
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
521
|
-
payModelId
|
|
522
|
-
});
|
|
523
|
-
const reqOpts = unarchivePayModel(payload);
|
|
524
|
-
sideEffects?.onSiteCall?.();
|
|
525
|
-
try {
|
|
526
|
-
const result = await httpClient.request(reqOpts);
|
|
527
|
-
sideEffects?.onSuccess?.(result);
|
|
528
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
529
|
-
} catch (err) {
|
|
530
|
-
const transformedError = sdkTransformError(
|
|
531
|
-
err,
|
|
532
|
-
{
|
|
533
|
-
spreadPathsToArguments: {},
|
|
534
|
-
explicitPathsToArguments: { payModelId: "$[0]" },
|
|
535
|
-
singleArgumentUnchanged: false
|
|
536
|
-
},
|
|
537
|
-
["payModelId"]
|
|
538
|
-
);
|
|
539
|
-
sideEffects?.onError?.(err);
|
|
540
|
-
throw transformedError;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
async function bulkDeletePayModels2(payModelIds) {
|
|
544
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
545
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
546
|
-
payModelIds
|
|
547
|
-
});
|
|
548
|
-
const reqOpts = bulkDeletePayModels(payload);
|
|
549
|
-
sideEffects?.onSiteCall?.();
|
|
550
|
-
try {
|
|
551
|
-
const result = await httpClient.request(reqOpts);
|
|
552
|
-
sideEffects?.onSuccess?.(result);
|
|
553
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
554
|
-
} catch (err) {
|
|
555
|
-
const transformedError = sdkTransformError(
|
|
556
|
-
err,
|
|
557
|
-
{
|
|
558
|
-
spreadPathsToArguments: {},
|
|
559
|
-
explicitPathsToArguments: { payModelIds: "$[0]" },
|
|
560
|
-
singleArgumentUnchanged: false
|
|
561
|
-
},
|
|
562
|
-
["payModelIds"]
|
|
563
|
-
);
|
|
564
|
-
sideEffects?.onError?.(err);
|
|
565
|
-
throw transformedError;
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
470
|
export {
|
|
569
471
|
AttendeeCountBasis,
|
|
570
472
|
CombinatorType,
|
|
@@ -575,13 +477,11 @@ export {
|
|
|
575
477
|
TaxBasis,
|
|
576
478
|
WebhookIdentityType,
|
|
577
479
|
archivePayModel2 as archivePayModel,
|
|
578
|
-
bulkDeletePayModels2 as bulkDeletePayModels,
|
|
579
480
|
createPayModel2 as createPayModel,
|
|
580
481
|
deletePayModel2 as deletePayModel,
|
|
581
482
|
getPayModel2 as getPayModel,
|
|
582
483
|
queryPayModels2 as queryPayModels,
|
|
583
484
|
typedQueryPayModels,
|
|
584
|
-
unarchivePayModel2 as unarchivePayModel,
|
|
585
485
|
updatePayModel2 as updatePayModel,
|
|
586
486
|
utils
|
|
587
487
|
};
|