@pvh-afl/graphql 1.2.35 → 1.2.36

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,5 @@
1
- import { AuthUser } from '@pvh-afl/core';
2
1
  import { LoyaltyService } from './loyalty.service';
3
- import { CustomerCouponsInput, CustomerCouponsResult, ShopifyDiscountsByTagInput, ShopifyDiscountsByTagResult, CapillaryCustomerInput, CapillaryCustomerResult, THClubCustomerInput, THClubCustomerResult } from './loyalty.types';
2
+ import { ShopifyDiscountsByTagInput, ShopifyDiscountsByTagResult } from './loyalty.types';
4
3
  /**
5
4
  * Loyalty Resolver
6
5
  *
@@ -9,17 +8,8 @@ import { CustomerCouponsInput, CustomerCouponsResult, ShopifyDiscountsByTagInput
9
8
  export declare class LoyaltyResolver {
10
9
  private readonly loyaltyService;
11
10
  constructor(loyaltyService: LoyaltyService);
12
- getCustomerCoupons(user: AuthUser, input: CustomerCouponsInput, context: {
13
- brand: string;
14
- }): Promise<CustomerCouponsResult>;
15
- getCapillaryCustomer(user: AuthUser, input: CapillaryCustomerInput, context: {
16
- brand: string;
17
- }): Promise<CapillaryCustomerResult>;
18
11
  getShopifyDiscountsByTag(input: ShopifyDiscountsByTagInput, context: {
19
12
  brand: string;
20
13
  }): Promise<ShopifyDiscountsByTagResult>;
21
- createOrUpdateTHClubCustomer(user: AuthUser, input: THClubCustomerInput, context: {
22
- brand: string;
23
- }): Promise<THClubCustomerResult>;
24
14
  }
25
15
  //# sourceMappingURL=loyalty.resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loyalty.resolver.d.ts","sourceRoot":"","sources":["../../src/loyalty/loyalty.resolver.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EAKT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,2B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6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LoyaltyResolver = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ // CAPILLARY PAUSED: `Mutation` is only used by the disabled
6
+ // createOrUpdateTHClubCustomer mutation below — dropped from this import.
5
7
  const graphql_1 = require("@nestjs/graphql");
6
8
  const common_1 = require("@nestjs/common");
7
9
  const core_1 = require("@pvh-afl/core");
@@ -17,55 +19,53 @@ let LoyaltyResolver = class LoyaltyResolver {
17
19
  constructor(loyaltyService) {
18
20
  this.loyaltyService = loyaltyService;
19
21
  }
20
- async getCustomerCoupons(user, input, context) {
21
- (0, core_1.assertOwnsPhone)(user, input.mobile);
22
- return this.loyaltyService.getCustomerCoupons(context.brand, input);
23
- }
24
- async getCapillaryCustomer(user, input, context) {
25
- (0, core_1.assertOwnsPhone)(user, input.mobile);
26
- return this.loyaltyService.getCapillaryCustomer(context.brand, input);
27
- }
22
+ // ===================================================================
23
+ // CAPILLARY PAUSED
24
+ // getCustomerCoupons and getCapillaryCustomer are Capillary-backed and are
25
+ // disabled while loyalty is paused. Removed from the schema (rather than left
26
+ // to throw "not configured" at runtime). The non-Capillary
27
+ // getShopifyDiscountsByTag query below stays live. Restore by uncommenting
28
+ // these two methods and their imports.
29
+ // -------------------------------------------------------------------
30
+ // @Query(() => CustomerCouponsResult, {
31
+ // description: `Get the logged-in customer's coupons by coupon state.
32
+ //
33
+ // Requires authentication. The \`mobile\` in the input must be the caller's own —
34
+ // these are spendable coupon codes, so returning them for an arbitrary number
35
+ // would let anyone collect another customer's coupons.`,
36
+ // })
37
+ // @UseGuards(TenantGuard, JwtAuthGuard)
38
+ // async getCustomerCoupons(
39
+ // @CurrentUser() user: AuthUser,
40
+ // @Args('input') input: CustomerCouponsInput,
41
+ // @Context() context: { brand: string },
42
+ // ): Promise<CustomerCouponsResult> {
43
+ // assertOwnsPhone(user, input.mobile);
44
+ // return this.loyaltyService.getCustomerCoupons(context.brand, input);
45
+ // }
46
+ //
47
+ // @Query(() => CapillaryCustomerResult, {
48
+ // description: `Get the logged-in customer's TH Club (Capillary loyalty) profile by mobile.
49
+ //
50
+ // Requires authentication. The \`mobile\` in the input must be the caller's own —
51
+ // this returns personal data, so it must not be a lookup for arbitrary numbers.
52
+ // \`registered\` is false when the mobile has no TH Club profile.`,
53
+ // })
54
+ // @UseGuards(TenantGuard, JwtAuthGuard)
55
+ // async getCapillaryCustomer(
56
+ // @CurrentUser() user: AuthUser,
57
+ // @Args('input') input: CapillaryCustomerInput,
58
+ // @Context() context: { brand: string },
59
+ // ): Promise<CapillaryCustomerResult> {
60
+ // assertOwnsPhone(user, input.mobile);
61
+ // return this.loyaltyService.getCapillaryCustomer(context.brand, input);
62
+ // }
63
+ // ===================================================================
28
64
  async getShopifyDiscountsByTag(input, context) {
29
65
  return this.loyaltyService.getShopifyDiscountsByTag(context.brand, input);
30
66
  }
31
- async createOrUpdateTHClubCustomer(user, input, context) {
32
- (0, core_1.assertOwnsPhone)(user, input.mobile);
33
- return this.loyaltyService.createOrUpdateTHClubCustomer(context.brand, input);
34
- }
35
67
  };
36
68
  exports.LoyaltyResolver = LoyaltyResolver;
37
- tslib_1.__decorate([
38
- (0, graphql_1.Query)(() => loyalty_types_1.CustomerCouponsResult, {
39
- description: `Get the logged-in customer's coupons by coupon state.
40
-
41
- Requires authentication. The \`mobile\` in the input must be the caller's own —
42
- these are spendable coupon codes, so returning them for an arbitrary number
43
- would let anyone collect another customer's coupons.`,
44
- }),
45
- (0, common_1.UseGuards)(core_1.TenantGuard, core_1.JwtAuthGuard),
46
- tslib_1.__param(0, (0, core_1.CurrentUser)()),
47
- tslib_1.__param(1, (0, graphql_1.Args)('input')),
48
- tslib_1.__param(2, (0, graphql_1.Context)()),
49
- tslib_1.__metadata("design:type", Function),
50
- tslib_1.__metadata("design:paramtypes", [Object, loyalty_types_1.CustomerCouponsInput, Object]),
51
- tslib_1.__metadata("design:returntype", Promise)
52
- ], LoyaltyResolver.prototype, "getCustomerCoupons", null);
53
- tslib_1.__decorate([
54
- (0, graphql_1.Query)(() => loyalty_types_1.CapillaryCustomerResult, {
55
- description: `Get the logged-in customer's TH Club (Capillary loyalty) profile by mobile.
56
-
57
- Requires authentication. The \`mobile\` in the input must be the caller's own —
58
- this returns personal data, so it must not be a lookup for arbitrary numbers.
59
- \`registered\` is false when the mobile has no TH Club profile.`,
60
- }),
61
- (0, common_1.UseGuards)(core_1.TenantGuard, core_1.JwtAuthGuard),
62
- tslib_1.__param(0, (0, core_1.CurrentUser)()),
63
- tslib_1.__param(1, (0, graphql_1.Args)('input')),
64
- tslib_1.__param(2, (0, graphql_1.Context)()),
65
- tslib_1.__metadata("design:type", Function),
66
- tslib_1.__metadata("design:paramtypes", [Object, loyalty_types_1.CapillaryCustomerInput, Object]),
67
- tslib_1.__metadata("design:returntype", Promise)
68
- ], LoyaltyResolver.prototype, "getCapillaryCustomer", null);
69
69
  tslib_1.__decorate([
70
70
  (0, graphql_1.Query)(() => loyalty_types_1.ShopifyDiscountsByTagResult, {
71
71
  description: `Get Shopify discount codes filtered by tag.`,
@@ -77,21 +77,6 @@ tslib_1.__decorate([
77
77
  tslib_1.__metadata("design:paramtypes", [loyalty_types_1.ShopifyDiscountsByTagInput, Object]),
78
78
  tslib_1.__metadata("design:returntype", Promise)
79
79
  ], LoyaltyResolver.prototype, "getShopifyDiscountsByTag", null);
80
- tslib_1.__decorate([
81
- (0, graphql_1.Mutation)(() => loyalty_types_1.THClubCustomerResult, {
82
- description: `Create or update the logged-in customer in TH Club (Capillary loyalty).
83
-
84
- Requires authentication. The \`mobile\` in the input must be the caller's own —
85
- a customer can only ever create or update their own TH Club profile.`,
86
- }),
87
- (0, common_1.UseGuards)(core_1.TenantGuard, core_1.JwtAuthGuard),
88
- tslib_1.__param(0, (0, core_1.CurrentUser)()),
89
- tslib_1.__param(1, (0, graphql_1.Args)('input')),
90
- tslib_1.__param(2, (0, graphql_1.Context)()),
91
- tslib_1.__metadata("design:type", Function),
92
- tslib_1.__metadata("design:paramtypes", [Object, loyalty_types_1.THClubCustomerInput, Object]),
93
- tslib_1.__metadata("design:returntype", Promise)
94
- ], LoyaltyResolver.prototype, "createOrUpdateTHClubCustomer", null);
95
80
  exports.LoyaltyResolver = LoyaltyResolver = tslib_1.__decorate([
96
81
  (0, graphql_1.Resolver)(),
97
82
  tslib_1.__metadata("design:paramtypes", [loyalty_service_1.LoyaltyService])
@@ -1 +1 @@
1
- {"version":3,"file":"loyalty.resolver.js","sourceRoot":"","sources":["../../src/loyalty/loyalty.resolver.ts"],"names":[],"mappings":";;;;AAAA,6CAA2E;AAC3E,2CAA2C;AAC3C,wCAMuB;AACvB,uDAAmD;AACnD,mDASyB;AAEzB;;;;GAIG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAUzD,AAAN,KAAK,CAAC,kBAAkB,CACP,IAAc,EACd,KAA2B,EAC/B,OAA0B;QAErC,IAAA,sBAAe,EAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAUK,AAAN,KAAK,CAAC,oBAAoB,CACT,IAAc,EACd,KAA6B,EACjC,OAA0B;QAErC,IAAA,sBAAe,EAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC;IAMK,AAAN,KAAK,CAAC,wBAAwB,CACb,KAAiC,EACrC,OAA0B;QAErC,OAAO,IAAI,CAAC,cAAc,CAAC,wBAAwB,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;IASK,AAAN,KAAK,CAAC,4BAA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AAW,EAAE,mBAAY,CAAC;IAElC,mBAAA,IAAA,kBAAW,GAAE,CAAA;IACb,mBAAA,IAAA,cAAI,EAAC,OAAO,CAAC,CAAA;IACb,mBAAA,IAAA,iBAAO,GAAE,CAAA;;qDADY,mCAAmB;;mEAK1C;0BA9DU,eAAe;IAD3B,IAAA,kBAAQ,GAAE;6CAEoC,gCAAc;GADhD,eAAe,CA+D3B"}
1
+ {"version":3,"file":"loyalty.resolver.js","sourceRoot":"","sources":["../../src/loyalty/loyalty.resolver.ts"],"names":[],"mappings":";;;;AAAA,4DAA4D;AAC5D,0EAA0E;AAC1E,6CAAiE;AACjE,2CAA2C;AAC3C,wCAOuB;AACvB,uDAAmD;AACnD,mDAYyB;AAEzB;;;;GAIG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAE/D,sEAAsE;IACtE,mBAAmB;IACnB,2EAA2E;IAC3E,8EAA8E;IAC9E,2DAA2D;IAC3D,2EAA2E;IAC3E,uCAAuC;IACvC,sEAAsE;IACtE,wCAAwC;IACxC,wEAAwE;IACxE,EAAE;IACF,kFAAkF;IAClF,8EAA8E;IAC9E,yDAAyD;IACzD,KAAK;IACL,wCAAwC;IACxC,4BAA4B;IAC5B,mCAAmC;IACnC,gDAAgD;IAChD,2CAA2C;IAC3C,sCAAsC;IACtC,yCAAyC;IACzC,yEAAyE;IACzE,IAAI;IACJ,EAAE;IACF,0CAA0C;IAC1C,8FAA8F;IAC9F,EAAE;IACF,kFAAkF;IAClF,gFAAgF;IAChF,oEAAoE;IACpE,KAAK;IACL,wCAAwC;IACxC,8BAA8B;IAC9B,mCAAmC;IACnC,kDAAkD;IAClD,2CAA2C;IAC3C,wCAAwC;IACxC,yCAAyC;IACzC,2EAA2E;IAC3E,IAAI;IACJ,sEAAsE;IAMhE,AAAN,KAAK,CAAC,wBAAwB,CACb,KAAiC,EACrC,OAA0B;QAErC,OAAO,IAAI,CAAC,cAAc,CAAC,wBAAwB,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;CAwBF,CAAA;AA/EY,0CAAe;AAkDpB;IAJL,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,2CAA2B,EAAE;QACxC,WAAW,EAAE,6CAA6C;KAC3D,CAAC;IACD,IAAA,kBAAS,EAAC,kBAAW,CAAC;IAEpB,mBAAA,IAAA,cAAI,EAAC,OAAO,CAAC,CAAA;IACb,mBAAA,IAAA,iBAAO,GAAE,CAAA;;6CADY,0CAA0B;;+DAIjD;0BAvDU,eAAe;IAD3B,IAAA,kBAAQ,GAAE;6CAEoC,gCAAc;GADhD,eAAe,CA+E3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pvh-afl/graphql",
3
- "version": "1.2.35",
3
+ "version": "1.2.36",
4
4
  "description": "AFL GraphQL - Shared GraphQL modules for multi-brand commerce platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",