@pvh-afl/graphql 1.2.34 → 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 {
|
|
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":"
|
|
1
|
+
{"version":3,"file":"loyalty.resolver.d.ts","sourceRoot":"","sources":["../../src/loyalty/loyalty.resolver.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAML,0BAA0B,EAC1B,2BAA2B,EAK5B,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,qBACa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,cAAc;IAiDrD,wBAAwB,CACb,KAAK,EAAE,0BAA0B,EACrC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GACpC,OAAO,CAAC,2BAA2B,CAAC;CA0BxC"}
|
|
@@ -2,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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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,
|
|
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.
|
|
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",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@nestjs/common": "^10.0.0",
|
|
23
23
|
"@nestjs/core": "^10.0.0",
|
|
24
24
|
"@nestjs/graphql": "^12.0.0",
|
|
25
|
-
"@pvh-afl/core": "^1.2.
|
|
25
|
+
"@pvh-afl/core": "^1.2.27",
|
|
26
26
|
"graphql": "^16.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|