@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.
@@ -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 and cleared
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: string;
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: string[];
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 until it's unarchived with Unarchive Pay Model.
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 and cleared
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. To make it available again, call Unarchive Pay Model.
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 BulkDeletePayModelsApplicationErrors, 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, bulkDeletePayModels, createPayModel, deletePayModel, getPayModel, queryPayModels, typedQueryPayModels, unarchivePayModel, updatePayModel, utils };
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 };
@@ -29,13 +29,11 @@ __export(index_typings_exports, {
29
29
  TaxBasis: () => TaxBasis,
30
30
  WebhookIdentityType: () => WebhookIdentityType,
31
31
  archivePayModel: () => archivePayModel2,
32
- bulkDeletePayModels: () => bulkDeletePayModels2,
33
32
  createPayModel: () => createPayModel2,
34
33
  deletePayModel: () => deletePayModel2,
35
34
  getPayModel: () => getPayModel2,
36
35
  queryPayModels: () => queryPayModels2,
37
36
  typedQueryPayModels: () => typedQueryPayModels,
38
- unarchivePayModel: () => unarchivePayModel2,
39
37
  updatePayModel: () => updatePayModel2,
40
38
  utils: () => utils
41
39
  });
@@ -259,54 +257,6 @@ function archivePayModel(payload) {
259
257
  }
260
258
  return __archivePayModel;
261
259
  }
262
- function unarchivePayModel(payload) {
263
- function __unarchivePayModel({ host }) {
264
- const metadata = {
265
- entityFqdn: "wix.staff.pay.v1.pay_model",
266
- method: "POST",
267
- methodFqn: "wix.staff.pay.v1.PayModelsService.UnarchivePayModel",
268
- packageName: PACKAGE_NAME,
269
- migrationOptions: {
270
- optInTransformResponse: true
271
- },
272
- url: resolveWixStaffPayV1PayModelsServiceUrl({
273
- protoPath: "/v1/pay-models/{payModelId}/unarchive",
274
- data: payload,
275
- host
276
- }),
277
- data: payload,
278
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
279
- {
280
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
281
- paths: TRANSFORM_PATHS_0
282
- }
283
- ])
284
- };
285
- return metadata;
286
- }
287
- return __unarchivePayModel;
288
- }
289
- function bulkDeletePayModels(payload) {
290
- function __bulkDeletePayModels({ host }) {
291
- const metadata = {
292
- entityFqdn: "wix.staff.pay.v1.pay_model",
293
- method: "POST",
294
- methodFqn: "wix.staff.pay.v1.PayModelsService.BulkDeletePayModels",
295
- packageName: PACKAGE_NAME,
296
- migrationOptions: {
297
- optInTransformResponse: true
298
- },
299
- url: resolveWixStaffPayV1PayModelsServiceUrl({
300
- protoPath: "/v1/bulk/pay-models/delete",
301
- data: payload,
302
- host
303
- }),
304
- data: payload
305
- };
306
- return metadata;
307
- }
308
- return __bulkDeletePayModels;
309
- }
310
260
 
311
261
  // src/staff-pay-v1-pay-model-pay-models.universal.ts
312
262
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
@@ -555,56 +505,6 @@ async function archivePayModel2(payModelId) {
555
505
  throw transformedError;
556
506
  }
557
507
  }
558
- async function unarchivePayModel2(payModelId) {
559
- const { httpClient, sideEffects } = arguments[1];
560
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
561
- payModelId
562
- });
563
- const reqOpts = unarchivePayModel(payload);
564
- sideEffects?.onSiteCall?.();
565
- try {
566
- const result = await httpClient.request(reqOpts);
567
- sideEffects?.onSuccess?.(result);
568
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
569
- } catch (err) {
570
- const transformedError = (0, import_transform_error.transformError)(
571
- err,
572
- {
573
- spreadPathsToArguments: {},
574
- explicitPathsToArguments: { payModelId: "$[0]" },
575
- singleArgumentUnchanged: false
576
- },
577
- ["payModelId"]
578
- );
579
- sideEffects?.onError?.(err);
580
- throw transformedError;
581
- }
582
- }
583
- async function bulkDeletePayModels2(payModelIds) {
584
- const { httpClient, sideEffects } = arguments[1];
585
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
586
- payModelIds
587
- });
588
- const reqOpts = bulkDeletePayModels(payload);
589
- sideEffects?.onSiteCall?.();
590
- try {
591
- const result = await httpClient.request(reqOpts);
592
- sideEffects?.onSuccess?.(result);
593
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
594
- } catch (err) {
595
- const transformedError = (0, import_transform_error.transformError)(
596
- err,
597
- {
598
- spreadPathsToArguments: {},
599
- explicitPathsToArguments: { payModelIds: "$[0]" },
600
- singleArgumentUnchanged: false
601
- },
602
- ["payModelIds"]
603
- );
604
- sideEffects?.onError?.(err);
605
- throw transformedError;
606
- }
607
- }
608
508
  // Annotate the CommonJS export names for ESM import in node:
609
509
  0 && (module.exports = {
610
510
  AttendeeCountBasis,
@@ -616,13 +516,11 @@ async function bulkDeletePayModels2(payModelIds) {
616
516
  TaxBasis,
617
517
  WebhookIdentityType,
618
518
  archivePayModel,
619
- bulkDeletePayModels,
620
519
  createPayModel,
621
520
  deletePayModel,
622
521
  getPayModel,
623
522
  queryPayModels,
624
523
  typedQueryPayModels,
625
- unarchivePayModel,
626
524
  updatePayModel,
627
525
  utils
628
526
  });