@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.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { PayModel, CreatePayModelApplicationErrors, UpdatePayModel, UpdatePayModelApplicationErrors, DeletePayModelApplicationErrors, ArchivePayModelResponse, UnarchivePayModelResponse, BulkDeletePayModelsResponse, BulkDeletePayModelsApplicationErrors, PayModelsQueryBuilder, PayModelQuery, typedQueryPayModels } from './index.typings.js';
3
- export { AccountInfo, ActionEvent, ApplicationError, ArchivePayModelRequest, AttendanceTier, AttendanceTiersOptions, AttendeeCountBasis, AttendeeCountBasisWithLiterals, BasePlusPerHeadOptions, BulkActionMetadata, BulkDeletePayModelsRequest, BulkPayModelResult, Combinator, CombinatorOptionsOneOf, CombinatorType, CombinatorTypeWithLiterals, CommissionTier, CommissionTierMode, CommissionTierModeWithLiterals, CommonQueryWithEntityContext, ComponentType, ComponentTypeWithLiterals, CostDeduction, CostDeductionKindOneOf, CreatePayModelRequest, CreatePayModelResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeletePayModelRequest, DeletePayModelResponse, DiscountBasis, DiscountBasisWithLiterals, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ExtendedFields, ExtraAttendeeTier, FlatPerSessionOptions, GetPayModelRequest, GetPayModelResponse, GreaterOfOptions, HourlyOptions, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, MessageEnvelope, PayComponent, PayComponentOptionsOneOf, PayModelQuerySpec, PayModelsQueryResult, PerCourseOptions, PlanSaleCommissionOptions, ProductCommissionOptions, QueryPayModelsRequest, QueryPayModelsResponse, RestoreInfo, RevenueRules, SalaryOptions, ServiceCommissionOptions, SortOrder, SortOrderWithLiterals, Sorting, TaxBasis, TaxBasisWithLiterals, TipsOptions, UnarchivePayModelRequest, UpdatePayModelRequest, UpdatePayModelResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
2
+ import { PayModel, CreatePayModelApplicationErrors, UpdatePayModel, UpdatePayModelApplicationErrors, DeletePayModelApplicationErrors, ArchivePayModelResponse, PayModelsQueryBuilder, PayModelQuery, typedQueryPayModels } from './index.typings.js';
3
+ export { AccountInfo, ActionEvent, ApplicationError, ArchivePayModelRequest, AttendanceTier, AttendanceTiersOptions, AttendeeCountBasis, AttendeeCountBasisWithLiterals, BasePlusPerHeadOptions, BulkActionMetadata, BulkDeletePayModelsRequest, BulkDeletePayModelsResponse, BulkPayModelResult, Combinator, CombinatorOptionsOneOf, CombinatorType, CombinatorTypeWithLiterals, CommissionTier, CommissionTierMode, CommissionTierModeWithLiterals, CommonQueryWithEntityContext, ComponentType, ComponentTypeWithLiterals, CostDeduction, CostDeductionKindOneOf, CreatePayModelRequest, CreatePayModelResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeletePayModelRequest, DeletePayModelResponse, DiscountBasis, DiscountBasisWithLiterals, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ExtendedFields, ExtraAttendeeTier, FlatPerSessionOptions, GetPayModelRequest, GetPayModelResponse, GreaterOfOptions, HourlyOptions, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, MessageEnvelope, PayComponent, PayComponentOptionsOneOf, PayModelQuerySpec, PayModelsQueryResult, PerCourseOptions, PlanSaleCommissionOptions, ProductCommissionOptions, QueryPayModelsRequest, QueryPayModelsResponse, RestoreInfo, RevenueRules, SalaryOptions, ServiceCommissionOptions, SortOrder, SortOrderWithLiterals, Sorting, TaxBasis, TaxBasisWithLiterals, TipsOptions, UnarchivePayModelRequest, UnarchivePayModelResponse, UpdatePayModelRequest, UpdatePayModelResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
4
4
 
5
5
  declare function createPayModel$1(httpClient: HttpClient): CreatePayModelSignature;
6
6
  interface CreatePayModelSignature {
@@ -38,7 +38,7 @@ interface UpdatePayModelSignature {
38
38
  * lines stay linked to it. Changes apply to staff pays calculated after the update, and the staff pays of the staff
39
39
  * members paid with the pay model are marked stale.
40
40
  *
41
- * An archived pay model can't be updated until it's unarchived with Unarchive Pay Model.
41
+ * An archived pay model can't be updated.
42
42
  * @param - Pay model ID.
43
43
  * @returns Updated pay model.
44
44
  */
@@ -53,8 +53,6 @@ interface DeletePayModelSignature {
53
53
  *
54
54
  * A pay model that any pay terms use, past, current or upcoming, can't be deleted. Archive it instead, with Archive
55
55
  * Pay Model.
56
- *
57
- * To delete multiple pay models in a single API call, call Bulk Delete Pay Models.
58
56
  * @param - ID of the pay model to delete.
59
57
  */
60
58
  (payModelId: string): Promise<void & {
@@ -69,36 +67,11 @@ interface ArchivePayModelSignature {
69
67
  * 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
70
68
  * the pay model keep it, and it can still be retrieved. An archived pay model can't be updated.
71
69
  *
72
- * Archiving an archived pay model returns it unchanged. To make it available again, call Unarchive Pay Model.
70
+ * Archiving an archived pay model returns it unchanged.
73
71
  * @param - ID of the pay model to archive.
74
72
  */
75
73
  (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>>;
76
74
  }
77
- declare function unarchivePayModel$1(httpClient: HttpClient): UnarchivePayModelSignature;
78
- interface UnarchivePayModelSignature {
79
- /**
80
- * Unarchives a pay model. Clears `archivedDate`, so the pay model can be updated and offered again.
81
- *
82
- * Unarchiving a pay model that isn't archived returns it unchanged.
83
- * @param - ID of the pay model to unarchive.
84
- */
85
- (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>>;
86
- }
87
- declare function bulkDeletePayModels$1(httpClient: HttpClient): BulkDeletePayModelsSignature;
88
- interface BulkDeletePayModelsSignature {
89
- /**
90
- * Deletes multiple pay models.
91
- *
92
- * Each pay model is deleted on its own: one that pay terms use isn't deleted and its result fails with
93
- * `PAY_MODEL_IN_USE`, while the others are still deleted.
94
- *
95
- * To delete a single pay model, call Delete Pay Model.
96
- * @param - IDs of the pay models to delete.
97
- */
98
- (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> & {
99
- __applicationErrorsType?: BulkDeletePayModelsApplicationErrors;
100
- }>;
101
- }
102
75
 
103
76
  declare function customQueryPayModels(httpClient: HttpClient): {
104
77
  (): PayModelsQueryBuilder;
@@ -109,8 +82,6 @@ declare const getPayModel: MaybeContext<BuildRESTFunction<typeof getPayModel$1>
109
82
  declare const updatePayModel: MaybeContext<BuildRESTFunction<typeof updatePayModel$1> & typeof updatePayModel$1>;
110
83
  declare const deletePayModel: MaybeContext<BuildRESTFunction<typeof deletePayModel$1> & typeof deletePayModel$1>;
111
84
  declare const archivePayModel: MaybeContext<BuildRESTFunction<typeof archivePayModel$1> & typeof archivePayModel$1>;
112
- declare const unarchivePayModel: MaybeContext<BuildRESTFunction<typeof unarchivePayModel$1> & typeof unarchivePayModel$1>;
113
- declare const bulkDeletePayModels: MaybeContext<BuildRESTFunction<typeof bulkDeletePayModels$1> & typeof bulkDeletePayModels$1>;
114
85
  declare const queryPayModels: MaybeContext<BuildRESTFunction<typeof customQueryPayModels> & typeof customQueryPayModels>;
115
86
 
116
- export { ArchivePayModelResponse, BulkDeletePayModelsApplicationErrors, BulkDeletePayModelsResponse, CreatePayModelApplicationErrors, DeletePayModelApplicationErrors, PayModel, PayModelQuery, PayModelsQueryBuilder, UnarchivePayModelResponse, UpdatePayModel, UpdatePayModelApplicationErrors, archivePayModel, bulkDeletePayModels, createPayModel, deletePayModel, getPayModel, queryPayModels, unarchivePayModel, updatePayModel };
87
+ export { ArchivePayModelResponse, CreatePayModelApplicationErrors, DeletePayModelApplicationErrors, PayModel, PayModelQuery, PayModelsQueryBuilder, UpdatePayModel, UpdatePayModelApplicationErrors, archivePayModel, createPayModel, deletePayModel, getPayModel, queryPayModels, updatePayModel };
@@ -29,12 +29,10 @@ __export(index_exports, {
29
29
  TaxBasis: () => TaxBasis,
30
30
  WebhookIdentityType: () => WebhookIdentityType,
31
31
  archivePayModel: () => archivePayModel4,
32
- bulkDeletePayModels: () => bulkDeletePayModels4,
33
32
  createPayModel: () => createPayModel4,
34
33
  deletePayModel: () => deletePayModel4,
35
34
  getPayModel: () => getPayModel4,
36
35
  queryPayModels: () => queryPayModels4,
37
- unarchivePayModel: () => unarchivePayModel4,
38
36
  updatePayModel: () => updatePayModel4,
39
37
  utils: () => utils
40
38
  });
@@ -258,54 +256,6 @@ function archivePayModel(payload) {
258
256
  }
259
257
  return __archivePayModel;
260
258
  }
261
- function unarchivePayModel(payload) {
262
- function __unarchivePayModel({ host }) {
263
- const metadata = {
264
- entityFqdn: "wix.staff.pay.v1.pay_model",
265
- method: "POST",
266
- methodFqn: "wix.staff.pay.v1.PayModelsService.UnarchivePayModel",
267
- packageName: PACKAGE_NAME,
268
- migrationOptions: {
269
- optInTransformResponse: true
270
- },
271
- url: resolveWixStaffPayV1PayModelsServiceUrl({
272
- protoPath: "/v1/pay-models/{payModelId}/unarchive",
273
- data: payload,
274
- host
275
- }),
276
- data: payload,
277
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
278
- {
279
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
280
- paths: TRANSFORM_PATHS_0
281
- }
282
- ])
283
- };
284
- return metadata;
285
- }
286
- return __unarchivePayModel;
287
- }
288
- function bulkDeletePayModels(payload) {
289
- function __bulkDeletePayModels({ host }) {
290
- const metadata = {
291
- entityFqdn: "wix.staff.pay.v1.pay_model",
292
- method: "POST",
293
- methodFqn: "wix.staff.pay.v1.PayModelsService.BulkDeletePayModels",
294
- packageName: PACKAGE_NAME,
295
- migrationOptions: {
296
- optInTransformResponse: true
297
- },
298
- url: resolveWixStaffPayV1PayModelsServiceUrl({
299
- protoPath: "/v1/bulk/pay-models/delete",
300
- data: payload,
301
- host
302
- }),
303
- data: payload
304
- };
305
- return metadata;
306
- }
307
- return __bulkDeletePayModels;
308
- }
309
259
 
310
260
  // src/staff-pay-v1-pay-model-pay-models.universal.ts
311
261
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
@@ -554,56 +504,6 @@ async function archivePayModel2(payModelId) {
554
504
  throw transformedError;
555
505
  }
556
506
  }
557
- async function unarchivePayModel2(payModelId) {
558
- const { httpClient, sideEffects } = arguments[1];
559
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
560
- payModelId
561
- });
562
- const reqOpts = unarchivePayModel(payload);
563
- sideEffects?.onSiteCall?.();
564
- try {
565
- const result = await httpClient.request(reqOpts);
566
- sideEffects?.onSuccess?.(result);
567
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
568
- } catch (err) {
569
- const transformedError = (0, import_transform_error.transformError)(
570
- err,
571
- {
572
- spreadPathsToArguments: {},
573
- explicitPathsToArguments: { payModelId: "$[0]" },
574
- singleArgumentUnchanged: false
575
- },
576
- ["payModelId"]
577
- );
578
- sideEffects?.onError?.(err);
579
- throw transformedError;
580
- }
581
- }
582
- async function bulkDeletePayModels2(payModelIds) {
583
- const { httpClient, sideEffects } = arguments[1];
584
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
585
- payModelIds
586
- });
587
- const reqOpts = bulkDeletePayModels(payload);
588
- sideEffects?.onSiteCall?.();
589
- try {
590
- const result = await httpClient.request(reqOpts);
591
- sideEffects?.onSuccess?.(result);
592
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
593
- } catch (err) {
594
- const transformedError = (0, import_transform_error.transformError)(
595
- err,
596
- {
597
- spreadPathsToArguments: {},
598
- explicitPathsToArguments: { payModelIds: "$[0]" },
599
- singleArgumentUnchanged: false
600
- },
601
- ["payModelIds"]
602
- );
603
- sideEffects?.onError?.(err);
604
- throw transformedError;
605
- }
606
- }
607
507
 
608
508
  // src/staff-pay-v1-pay-model-pay-models.public.ts
609
509
  function createPayModel3(httpClient) {
@@ -655,20 +555,6 @@ function archivePayModel3(httpClient) {
655
555
  { httpClient }
656
556
  );
657
557
  }
658
- function unarchivePayModel3(httpClient) {
659
- return (payModelId) => unarchivePayModel2(
660
- payModelId,
661
- // @ts-ignore
662
- { httpClient }
663
- );
664
- }
665
- function bulkDeletePayModels3(httpClient) {
666
- return (payModelIds) => bulkDeletePayModels2(
667
- payModelIds,
668
- // @ts-ignore
669
- { httpClient }
670
- );
671
- }
672
558
 
673
559
  // src/staff-pay-v1-pay-model-pay-models.context.ts
674
560
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
@@ -689,8 +575,6 @@ var getPayModel4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(ge
689
575
  var updatePayModel4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updatePayModel3);
690
576
  var deletePayModel4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deletePayModel3);
691
577
  var archivePayModel4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(archivePayModel3);
692
- var unarchivePayModel4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(unarchivePayModel3);
693
- var bulkDeletePayModels4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkDeletePayModels3);
694
578
  var queryPayModels4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryPayModels);
695
579
  // Annotate the CommonJS export names for ESM import in node:
696
580
  0 && (module.exports = {
@@ -703,12 +587,10 @@ var queryPayModels4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)
703
587
  TaxBasis,
704
588
  WebhookIdentityType,
705
589
  archivePayModel,
706
- bulkDeletePayModels,
707
590
  createPayModel,
708
591
  deletePayModel,
709
592
  getPayModel,
710
593
  queryPayModels,
711
- unarchivePayModel,
712
594
  updatePayModel,
713
595
  utils
714
596
  });