@wix/auto_sdk_loyalty_coupons 1.0.40 → 1.0.42

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, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { RedeemPointsForCouponOptions, RedeemPointsForCouponResponse, RedeemCurrentMemberPointsForCouponResponse, LoyaltyCoupon, BulkGetLoyaltyCouponOptions, BulkGetLoyaltyCouponResponse, GetCurrentMemberCouponsResponse, CouponCreatedEnvelope, CouponDeletedEnvelope, LoyaltyCouponQuery, QueryLoyaltyCouponOptions, typedQueryLoyaltyCoupons, LoyaltyCouponsQueryBuilder } from './index.typings.js';
3
- export { AccountInfo, AccountInfoMetadata, ActionEvent, BaseEventMetadata, BulkGetLoyaltyCouponRequest, BuyXGetY, CommonQueryWithEntityContext, CouponReference, CouponsInSite, CursorPaging, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteLoyaltyCouponRequest, DeleteLoyaltyCouponResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetCurrentMemberCouponsRequest, GetLoyaltyCouponRequest, GetLoyaltyCouponResponse, IdentificationData, IdentificationDataIdOneOf, LoyaltyCouponQuerySpec, LoyaltyCouponsQueryResult, MessageEnvelope, Paging, PagingMetadataV2, QueryLoyaltyCouponRequest, QueryLoyaltyCouponResponse, QueryV2, QueryV2PagingMethodOneOf, RedeemCurrentMemberPointsForCouponRequest, RedeemMemberPointsForDiscountAmountCouponRequest, RedeemMemberPointsForDiscountAmountCouponResponse, RedeemPointsForCouponRequest, RestoreInfo, Scope, SortOrder, SortOrderWithLiterals, Sorting, Specification, SpecificationScopeOrMinSubtotalOneOf, SpecificationTypeDetailsOneOf, Status, StatusWithLiterals, Type, TypeWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
2
+ import { RedeemPointsForCouponOptions, RedeemPointsForCouponResponse, RedeemCurrentMemberPointsForCouponResponse, LoyaltyCoupon, BulkGetLoyaltyCouponOptions, BulkGetLoyaltyCouponResponse, GetCurrentMemberCouponsResponse, CouponCreatedEnvelope, CouponDeletedEnvelope, LoyaltyCouponsQueryBuilder, LoyaltyCouponQuery, typedQueryLoyaltyCoupons } from './index.typings.js';
3
+ export { AccountInfo, AccountInfoMetadata, ActionEvent, BaseEventMetadata, BulkGetLoyaltyCouponRequest, BuyXGetY, CommonQueryWithEntityContext, CouponReference, CouponsInSite, CursorPaging, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteLoyaltyCouponRequest, DeleteLoyaltyCouponResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, Filter, GetCurrentMemberCouponsRequest, GetLoyaltyCouponRequest, GetLoyaltyCouponResponse, IdentificationData, IdentificationDataIdOneOf, LoyaltyCouponQuerySpec, LoyaltyCouponsQueryResult, MessageEnvelope, Paging, PagingMetadataV2, QueryBuilder, QueryLoyaltyCouponRequest, QueryLoyaltyCouponResponse, QueryV2, QueryV2PagingMethodOneOf, RedeemCurrentMemberPointsForCouponRequest, RedeemMemberPointsForDiscountAmountCouponRequest, RedeemMemberPointsForDiscountAmountCouponResponse, RedeemPointsForCouponRequest, RestoreInfo, Scope, Sort, SortOrder, SortOrderWithLiterals, Sorting, Specification, SpecificationScopeOrMinSubtotalOneOf, SpecificationTypeDetailsOneOf, Status, StatusWithLiterals, Type, TypeWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
4
 
5
5
  declare function redeemPointsForCoupon$1(httpClient: HttpClient): RedeemPointsForCouponSignature;
6
6
  interface RedeemPointsForCouponSignature {
@@ -76,8 +76,8 @@ declare const onCouponCreated$1: EventDefinition<CouponCreatedEnvelope, "wix.loy
76
76
  declare const onCouponDeleted$1: EventDefinition<CouponDeletedEnvelope, "wix.loyalty.v1.coupon_deleted">;
77
77
 
78
78
  declare function customQueryLoyaltyCoupons(httpClient: HttpClient): {
79
- (query: LoyaltyCouponQuery, options?: QueryLoyaltyCouponOptions): ReturnType<typeof typedQueryLoyaltyCoupons>;
80
- (options?: QueryLoyaltyCouponOptions): LoyaltyCouponsQueryBuilder;
79
+ (): LoyaltyCouponsQueryBuilder;
80
+ (query: LoyaltyCouponQuery): ReturnType<typeof typedQueryLoyaltyCoupons>;
81
81
  };
82
82
  declare const redeemPointsForCoupon: MaybeContext<BuildRESTFunction<typeof redeemPointsForCoupon$1> & typeof redeemPointsForCoupon$1>;
83
83
  declare const redeemCurrentMemberPointsForCoupon: MaybeContext<BuildRESTFunction<typeof redeemCurrentMemberPointsForCoupon$1> & typeof redeemCurrentMemberPointsForCoupon$1>;
@@ -95,4 +95,4 @@ declare const onCouponCreated: BuildEventDefinition<typeof onCouponCreated$1> &
95
95
  */
96
96
  declare const onCouponDeleted: BuildEventDefinition<typeof onCouponDeleted$1> & typeof onCouponDeleted$1;
97
97
 
98
- export { BulkGetLoyaltyCouponOptions, BulkGetLoyaltyCouponResponse, CouponCreatedEnvelope, CouponDeletedEnvelope, GetCurrentMemberCouponsResponse, LoyaltyCoupon, LoyaltyCouponQuery, LoyaltyCouponsQueryBuilder, QueryLoyaltyCouponOptions, RedeemCurrentMemberPointsForCouponResponse, RedeemPointsForCouponOptions, RedeemPointsForCouponResponse, bulkGetLoyaltyCoupon, deleteLoyaltyCoupon, getCurrentMemberCoupons, getLoyaltyCoupon, onCouponCreated, onCouponDeleted, queryLoyaltyCoupons, redeemCurrentMemberPointsForCoupon, redeemPointsForCoupon };
98
+ export { BulkGetLoyaltyCouponOptions, BulkGetLoyaltyCouponResponse, CouponCreatedEnvelope, CouponDeletedEnvelope, GetCurrentMemberCouponsResponse, LoyaltyCoupon, LoyaltyCouponQuery, LoyaltyCouponsQueryBuilder, RedeemCurrentMemberPointsForCouponResponse, RedeemPointsForCouponOptions, RedeemPointsForCouponResponse, bulkGetLoyaltyCoupon, deleteLoyaltyCoupon, getCurrentMemberCoupons, getLoyaltyCoupon, onCouponCreated, onCouponDeleted, queryLoyaltyCoupons, redeemCurrentMemberPointsForCoupon, redeemPointsForCoupon };
@@ -20,6 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ Filter: () => Filter,
24
+ QueryBuilder: () => QueryBuilder,
25
+ Sort: () => Sort,
23
26
  SortOrder: () => SortOrder,
24
27
  Status: () => Status,
25
28
  Type: () => Type,
@@ -416,6 +419,7 @@ function deleteLoyaltyCoupon(payload) {
416
419
 
417
420
  // src/loyalty-v1-coupon-coupons.universal.ts
418
421
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
422
+ var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
419
423
  var Type = /* @__PURE__ */ ((Type2) => {
420
424
  Type2["UNKNOWN"] = "UNKNOWN";
421
425
  Type2["MONEY_OFF_AMOUNT"] = "MONEY_OFF_AMOUNT";
@@ -572,14 +576,11 @@ async function getCurrentMemberCoupons2() {
572
576
  throw transformedError;
573
577
  }
574
578
  }
575
- function queryLoyaltyCoupons(options) {
576
- const { httpClient, sideEffects } = arguments[1];
579
+ function queryLoyaltyCoupons() {
580
+ const { httpClient, sideEffects } = arguments[0];
577
581
  return (0, import_query_builder.queryBuilder)({
578
582
  func: async (payload) => {
579
- const reqOpts = queryLoyaltyCoupon({
580
- ...payload,
581
- ...options ?? {}
582
- });
583
+ const reqOpts = queryLoyaltyCoupon(payload);
583
584
  sideEffects?.onSiteCall?.();
584
585
  try {
585
586
  const result = await httpClient.request(reqOpts);
@@ -591,7 +592,7 @@ function queryLoyaltyCoupons(options) {
591
592
  }
592
593
  },
593
594
  requestTransformer: (query) => {
594
- const args = [query, options];
595
+ const args = [query, {}];
595
596
  return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
596
597
  ...args?.[1],
597
598
  query: args?.[0]
@@ -620,12 +621,9 @@ function queryLoyaltyCoupons(options) {
620
621
  transformationPaths: {}
621
622
  });
622
623
  }
623
- async function typedQueryLoyaltyCoupons(query, options) {
624
- const { httpClient, sideEffects } = arguments[2];
625
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
626
- query,
627
- ...options
628
- });
624
+ async function typedQueryLoyaltyCoupons(query) {
625
+ const { httpClient, sideEffects } = arguments[1];
626
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
629
627
  const reqOpts = queryLoyaltyCoupon(payload);
630
628
  sideEffects?.onSiteCall?.();
631
629
  try {
@@ -640,12 +638,13 @@ async function typedQueryLoyaltyCoupons(query, options) {
640
638
  explicitPathsToArguments: { query: "$[0]" },
641
639
  singleArgumentUnchanged: false
642
640
  },
643
- ["query", "options"]
641
+ ["query"]
644
642
  );
645
643
  sideEffects?.onError?.(err);
646
644
  throw transformedError;
647
645
  }
648
646
  }
647
+ var { QueryBuilder, Filter, Sort } = (0, import_query_builder_utils.createQueryUtils)();
649
648
  async function deleteLoyaltyCoupon2(_id, revision) {
650
649
  const { httpClient, sideEffects } = arguments[2];
651
650
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -709,16 +708,14 @@ function getCurrentMemberCoupons3(httpClient) {
709
708
  );
710
709
  }
711
710
  function queryLoyaltyCoupons2(httpClient) {
712
- return (options) => queryLoyaltyCoupons(
713
- options,
711
+ return () => queryLoyaltyCoupons(
714
712
  // @ts-ignore
715
713
  { httpClient }
716
714
  );
717
715
  }
718
716
  function typedQueryLoyaltyCoupons2(httpClient) {
719
- return (query, options) => typedQueryLoyaltyCoupons(
717
+ return (query) => typedQueryLoyaltyCoupons(
720
718
  query,
721
- options,
722
719
  // @ts-ignore
723
720
  { httpClient }
724
721
  );
@@ -790,11 +787,11 @@ var import_event_definition_modules = require("@wix/sdk-runtime/event-definition
790
787
  var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
791
788
  function customQueryLoyaltyCoupons(httpClient) {
792
789
  const router = (0, import_query_method_router.createQueryOverloadRouter)({
793
- builderQueryFunction: (options) => queryLoyaltyCoupons2(httpClient)(options),
794
- typedQueryFunction: (query, options) => typedQueryLoyaltyCoupons2(httpClient)(query, options),
795
- hasOptionsParameter: true
790
+ builderQueryFunction: () => queryLoyaltyCoupons2(httpClient)(),
791
+ typedQueryFunction: (query) => typedQueryLoyaltyCoupons2(httpClient)(query),
792
+ hasOptionsParameter: false
796
793
  });
797
- function overloadedQuery(queryOrOptions, options) {
794
+ function overloadedQuery(query) {
798
795
  return router(...arguments);
799
796
  }
800
797
  return overloadedQuery;
@@ -810,6 +807,9 @@ var onCouponCreated2 = (0, import_event_definition_modules.createEventModule)(on
810
807
  var onCouponDeleted2 = (0, import_event_definition_modules.createEventModule)(onCouponDeleted);
811
808
  // Annotate the CommonJS export names for ESM import in node:
812
809
  0 && (module.exports = {
810
+ Filter,
811
+ QueryBuilder,
812
+ Sort,
813
813
  SortOrder,
814
814
  Status,
815
815
  Type,