@pvh-afl/graphql 1.1.11 → 1.1.12
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.
- package/dist/customer/customer.module.d.ts +9 -0
- package/dist/customer/customer.module.d.ts.map +1 -0
- package/dist/customer/customer.module.js +25 -0
- package/dist/customer/customer.module.js.map +1 -0
- package/dist/customer/customer.resolver.d.ts +15 -0
- package/dist/customer/customer.resolver.d.ts.map +1 -0
- package/dist/customer/customer.resolver.js +46 -0
- package/dist/customer/customer.resolver.js.map +1 -0
- package/dist/customer/customer.service.d.ts +18 -0
- package/dist/customer/customer.service.d.ts.map +1 -0
- package/dist/customer/customer.service.js +66 -0
- package/dist/customer/customer.service.js.map +1 -0
- package/dist/customer/customer.types.d.ts +17 -0
- package/dist/customer/customer.types.d.ts.map +1 -0
- package/dist/customer/customer.types.js +70 -0
- package/dist/customer/customer.types.js.map +1 -0
- package/dist/customer/index.d.ts +5 -0
- package/dist/customer/index.d.ts.map +1 -0
- package/dist/customer/index.js +8 -0
- package/dist/customer/index.js.map +1 -0
- package/dist/graphql.module.d.ts.map +1 -1
- package/dist/graphql.module.js +2 -0
- package/dist/graphql.module.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.module.d.ts","sourceRoot":"","sources":["../../src/customer/customer.module.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,qBAKa,cAAc;CAAG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomerModule = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const core_1 = require("@pvh-afl/core");
|
|
7
|
+
const customer_resolver_1 = require("./customer.resolver");
|
|
8
|
+
const customer_service_1 = require("./customer.service");
|
|
9
|
+
/**
|
|
10
|
+
* Customer Module
|
|
11
|
+
*
|
|
12
|
+
* GraphQL module for customer authentication (login) via the Shopify
|
|
13
|
+
* Storefront API.
|
|
14
|
+
*/
|
|
15
|
+
let CustomerModule = class CustomerModule {
|
|
16
|
+
};
|
|
17
|
+
exports.CustomerModule = CustomerModule;
|
|
18
|
+
exports.CustomerModule = CustomerModule = tslib_1.__decorate([
|
|
19
|
+
(0, common_1.Module)({
|
|
20
|
+
imports: [core_1.IntegrationsModule],
|
|
21
|
+
providers: [customer_resolver_1.CustomerResolver, customer_service_1.CustomerService],
|
|
22
|
+
exports: [customer_service_1.CustomerService],
|
|
23
|
+
})
|
|
24
|
+
], CustomerModule);
|
|
25
|
+
//# sourceMappingURL=customer.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.module.js","sourceRoot":"","sources":["../../src/customer/customer.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,wCAAmD;AACnD,2DAAuD;AACvD,yDAAqD;AAErD;;;;;GAKG;AAMI,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAL1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yBAAkB,CAAC;QAC7B,SAAS,EAAE,CAAC,oCAAgB,EAAE,kCAAe,CAAC;QAC9C,OAAO,EAAE,CAAC,kCAAe,CAAC;KAC3B,CAAC;GACW,cAAc,CAAG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CustomerService } from './customer.service';
|
|
2
|
+
import { CustomerLoginResult } from './customer.types';
|
|
3
|
+
interface GqlContext {
|
|
4
|
+
req: {
|
|
5
|
+
brand: string;
|
|
6
|
+
};
|
|
7
|
+
brand?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class CustomerResolver {
|
|
10
|
+
private readonly customerService;
|
|
11
|
+
constructor(customerService: CustomerService);
|
|
12
|
+
customerLogin(ctx: GqlContext, email: string, password: string): Promise<CustomerLoginResult>;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=customer.resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.resolver.d.ts","sourceRoot":"","sources":["../../src/customer/customer.resolver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,UAAU,UAAU;IAClB,GAAG,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBACa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;IAevD,aAAa,CACN,GAAG,EAAE,UAAU,EAE1B,KAAK,EAAE,MAAM,EAEb,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,mBAAmB,CAAC;CAIhC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomerResolver = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
const core_1 = require("@pvh-afl/core");
|
|
8
|
+
const customer_service_1 = require("./customer.service");
|
|
9
|
+
const customer_types_1 = require("./customer.types");
|
|
10
|
+
let CustomerResolver = class CustomerResolver {
|
|
11
|
+
customerService;
|
|
12
|
+
constructor(customerService) {
|
|
13
|
+
this.customerService = customerService;
|
|
14
|
+
}
|
|
15
|
+
async customerLogin(ctx, email, password) {
|
|
16
|
+
const brand = ctx.brand ?? ctx.req.brand;
|
|
17
|
+
return this.customerService.login(brand, email, password);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.CustomerResolver = CustomerResolver;
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
(0, graphql_1.Mutation)(() => customer_types_1.CustomerLoginResult, {
|
|
23
|
+
description: `Log a customer in with email and password.
|
|
24
|
+
|
|
25
|
+
Flow:
|
|
26
|
+
1. Create a Storefront customer access token (customerAccessTokenCreate)
|
|
27
|
+
2. Fetch the customer with that token (customer query)
|
|
28
|
+
|
|
29
|
+
Returns the customer access token, its expiry, and the customer. The frontend
|
|
30
|
+
should pass the returned customerAccessToken to cartBuyerIdentityUpdate so the
|
|
31
|
+
cart is associated with the logged-in customer (required for customer-specific
|
|
32
|
+
Capillary coupons to apply).`,
|
|
33
|
+
}),
|
|
34
|
+
(0, common_1.UseGuards)(core_1.TenantGuard),
|
|
35
|
+
tslib_1.__param(0, (0, graphql_1.Context)()),
|
|
36
|
+
tslib_1.__param(1, (0, graphql_1.Args)('email', { type: () => String, description: 'Customer email' })),
|
|
37
|
+
tslib_1.__param(2, (0, graphql_1.Args)('password', { type: () => String, description: 'Customer password' })),
|
|
38
|
+
tslib_1.__metadata("design:type", Function),
|
|
39
|
+
tslib_1.__metadata("design:paramtypes", [Object, String, String]),
|
|
40
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
41
|
+
], CustomerResolver.prototype, "customerLogin", null);
|
|
42
|
+
exports.CustomerResolver = CustomerResolver = tslib_1.__decorate([
|
|
43
|
+
(0, graphql_1.Resolver)(),
|
|
44
|
+
tslib_1.__metadata("design:paramtypes", [customer_service_1.CustomerService])
|
|
45
|
+
], CustomerResolver);
|
|
46
|
+
//# sourceMappingURL=customer.resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.resolver.js","sourceRoot":"","sources":["../../src/customer/customer.resolver.ts"],"names":[],"mappings":";;;;AAAA,6CAAoE;AACpE,2CAA2C;AAC3C,wCAA4C;AAC5C,yDAAqD;AACrD,qDAAuD;AAQhD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACE;IAA7B,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAe3D,AAAN,KAAK,CAAC,aAAa,CACN,GAAe,EAE1B,KAAa,EAEb,QAAgB;QAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC;QACzC,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;CACF,CAAA;AA1BY,4CAAgB;AAgBrB;IAbL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,oCAAmB,EAAE;QACnC,WAAW,EAAE;;;;;;;;;6BASY;KAC1B,CAAC;IACD,IAAA,kBAAS,EAAC,kBAAW,CAAC;IAEpB,mBAAA,IAAA,iBAAO,GAAE,CAAA;IACT,mBAAA,IAAA,cAAI,EAAC,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC,CAAA;IAEpE,mBAAA,IAAA,cAAI,EAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC,CAAA;;;;qDAK5E;2BAzBU,gBAAgB;IAD5B,IAAA,kBAAQ,GAAE;6CAEqC,kCAAe;GADlD,gBAAgB,CA0B5B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IntegrationFactory } from '@pvh-afl/core';
|
|
2
|
+
import { CustomerLoginResult } from './customer.types';
|
|
3
|
+
export declare class CustomerService {
|
|
4
|
+
private readonly integrationFactory;
|
|
5
|
+
constructor(integrationFactory: IntegrationFactory);
|
|
6
|
+
private getCommerceService;
|
|
7
|
+
/**
|
|
8
|
+
* Log a customer in with email + password.
|
|
9
|
+
*
|
|
10
|
+
* 1. Create a Storefront customer access token (customerAccessTokenCreate).
|
|
11
|
+
* 2. Fetch the customer with that token (customer query).
|
|
12
|
+
*
|
|
13
|
+
* Returns the token (for the frontend to attach to the cart via
|
|
14
|
+
* cartBuyerIdentityUpdate) together with the customer.
|
|
15
|
+
*/
|
|
16
|
+
login(brand: string, email: string, password: string): Promise<CustomerLoginResult>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=customer.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.service.d.ts","sourceRoot":"","sources":["../../src/customer/customer.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAA4B,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,qBACa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,kBAAkB;IAEnE,OAAO,CAAC,kBAAkB;IAQ1B;;;;;;;;OAQG;IACG,KAAK,CACT,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,mBAAmB,CAAC;CAwChC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomerService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const core_1 = require("@pvh-afl/core");
|
|
7
|
+
let CustomerService = class CustomerService {
|
|
8
|
+
integrationFactory;
|
|
9
|
+
constructor(integrationFactory) {
|
|
10
|
+
this.integrationFactory = integrationFactory;
|
|
11
|
+
}
|
|
12
|
+
getCommerceService(brand) {
|
|
13
|
+
const commerce = this.integrationFactory.get(brand, 'commerce');
|
|
14
|
+
if (!commerce) {
|
|
15
|
+
throw new Error(`Commerce integration not configured for brand: ${brand}`);
|
|
16
|
+
}
|
|
17
|
+
return commerce;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Log a customer in with email + password.
|
|
21
|
+
*
|
|
22
|
+
* 1. Create a Storefront customer access token (customerAccessTokenCreate).
|
|
23
|
+
* 2. Fetch the customer with that token (customer query).
|
|
24
|
+
*
|
|
25
|
+
* Returns the token (for the frontend to attach to the cart via
|
|
26
|
+
* cartBuyerIdentityUpdate) together with the customer.
|
|
27
|
+
*/
|
|
28
|
+
async login(brand, email, password) {
|
|
29
|
+
const commerce = this.getCommerceService(brand);
|
|
30
|
+
// Step 1: create the access token. Never log the password.
|
|
31
|
+
const tokenResult = await commerce.createCustomerAccessToken(email, password);
|
|
32
|
+
if (!tokenResult.success || !tokenResult.data) {
|
|
33
|
+
core_1.logger.warn('Customer login failed', {
|
|
34
|
+
brand,
|
|
35
|
+
errorCode: tokenResult.error?.code,
|
|
36
|
+
});
|
|
37
|
+
throw new Error(tokenResult.error?.message ?? 'Invalid email or password');
|
|
38
|
+
}
|
|
39
|
+
const { accessToken, expiresAt } = tokenResult.data;
|
|
40
|
+
// Step 2: fetch the customer with the token.
|
|
41
|
+
const customerResult = await commerce.getCustomer(accessToken);
|
|
42
|
+
if (!customerResult.success || !customerResult.data) {
|
|
43
|
+
throw new Error(customerResult.error?.message ?? 'Failed to fetch customer details');
|
|
44
|
+
}
|
|
45
|
+
const customer = customerResult.data;
|
|
46
|
+
core_1.logger.info('Customer logged in', { brand, customerId: customer.id });
|
|
47
|
+
return {
|
|
48
|
+
customerAccessToken: accessToken,
|
|
49
|
+
expiresAt,
|
|
50
|
+
customer: {
|
|
51
|
+
id: customer.id,
|
|
52
|
+
email: customer.email ?? undefined,
|
|
53
|
+
firstName: customer.firstName ?? undefined,
|
|
54
|
+
lastName: customer.lastName ?? undefined,
|
|
55
|
+
phone: customer.phone ?? undefined,
|
|
56
|
+
displayName: customer.displayName,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.CustomerService = CustomerService;
|
|
62
|
+
exports.CustomerService = CustomerService = tslib_1.__decorate([
|
|
63
|
+
(0, common_1.Injectable)(),
|
|
64
|
+
tslib_1.__metadata("design:paramtypes", [core_1.IntegrationFactory])
|
|
65
|
+
], CustomerService);
|
|
66
|
+
//# sourceMappingURL=customer.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.service.js","sourceRoot":"","sources":["../../src/customer/customer.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,wCAA6E;AAItE,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;IAAG,CAAC;IAE/D,kBAAkB,CAAC,KAAa;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAChE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,kDAAkD,KAAK,EAAE,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO,QAAuC,CAAC;IACjD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,KAAK,CACT,KAAa,EACb,KAAa,EACb,QAAgB;QAEhB,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAEhD,2DAA2D;QAC3D,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC9E,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;YAC9C,aAAM,CAAC,IAAI,CAAC,uBAAuB,EAAE;gBACnC,KAAK;gBACL,SAAS,EAAE,WAAW,CAAC,KAAK,EAAE,IAAI;aACnC,CAAC,CAAC;YACH,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,IAAI,2BAA2B,CAAC,CAAC;QAC7E,CAAC;QAED,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC;QAEpD,6CAA6C;QAC7C,MAAM,cAAc,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAC/D,IAAI,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CACb,cAAc,CAAC,KAAK,EAAE,OAAO,IAAI,kCAAkC,CACpE,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC;QAErC,aAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;QAEtE,OAAO;YACL,mBAAmB,EAAE,WAAW;YAChC,SAAS;YACT,QAAQ,EAAE;gBACR,EAAE,EAAE,QAAQ,CAAC,EAAE;gBACf,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,SAAS;gBAClC,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,SAAS;gBAC1C,QAAQ,EAAE,QAAQ,CAAC,QAAQ,IAAI,SAAS;gBACxC,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,SAAS;gBAClC,WAAW,EAAE,QAAQ,CAAC,WAAW;aAClC;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAhEY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;6CAEsC,yBAAkB;GADxD,eAAe,CAgE3B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL Types for Customer authentication.
|
|
3
|
+
*/
|
|
4
|
+
export declare class Customer {
|
|
5
|
+
id: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
firstName?: string;
|
|
8
|
+
lastName?: string;
|
|
9
|
+
phone?: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class CustomerLoginResult {
|
|
13
|
+
customerAccessToken: string;
|
|
14
|
+
expiresAt: string;
|
|
15
|
+
customer: Customer;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=customer.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.types.d.ts","sourceRoot":"","sources":["../../src/customer/customer.types.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,qBACa,QAAQ;IAEnB,EAAE,EAAG,MAAM,CAAC;IAGZ,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,WAAW,EAAG,MAAM,CAAC;CACtB;AAED,qBAIa,mBAAmB;IAK9B,mBAAmB,EAAG,MAAM,CAAC;IAG7B,SAAS,EAAG,MAAM,CAAC;IAGnB,QAAQ,EAAG,QAAQ,CAAC;CACrB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomerLoginResult = exports.Customer = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
6
|
+
/**
|
|
7
|
+
* GraphQL Types for Customer authentication.
|
|
8
|
+
*/
|
|
9
|
+
let Customer = class Customer {
|
|
10
|
+
id;
|
|
11
|
+
email;
|
|
12
|
+
firstName;
|
|
13
|
+
lastName;
|
|
14
|
+
phone;
|
|
15
|
+
displayName;
|
|
16
|
+
};
|
|
17
|
+
exports.Customer = Customer;
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, graphql_1.Field)({ description: 'Shopify customer ID (GID).' }),
|
|
20
|
+
tslib_1.__metadata("design:type", String)
|
|
21
|
+
], Customer.prototype, "id", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, graphql_1.Field)({ nullable: true, description: 'Customer email.' }),
|
|
24
|
+
tslib_1.__metadata("design:type", String)
|
|
25
|
+
], Customer.prototype, "email", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, graphql_1.Field)({ nullable: true, description: 'Customer first name.' }),
|
|
28
|
+
tslib_1.__metadata("design:type", String)
|
|
29
|
+
], Customer.prototype, "firstName", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, graphql_1.Field)({ nullable: true, description: 'Customer last name.' }),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], Customer.prototype, "lastName", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, graphql_1.Field)({ nullable: true, description: 'Customer phone number.' }),
|
|
36
|
+
tslib_1.__metadata("design:type", String)
|
|
37
|
+
], Customer.prototype, "phone", void 0);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, graphql_1.Field)({ description: 'Customer display name.' }),
|
|
40
|
+
tslib_1.__metadata("design:type", String)
|
|
41
|
+
], Customer.prototype, "displayName", void 0);
|
|
42
|
+
exports.Customer = Customer = tslib_1.__decorate([
|
|
43
|
+
(0, graphql_1.ObjectType)({ description: 'A Shopify customer.' })
|
|
44
|
+
], Customer);
|
|
45
|
+
let CustomerLoginResult = class CustomerLoginResult {
|
|
46
|
+
customerAccessToken;
|
|
47
|
+
expiresAt;
|
|
48
|
+
customer;
|
|
49
|
+
};
|
|
50
|
+
exports.CustomerLoginResult = CustomerLoginResult;
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, graphql_1.Field)({
|
|
53
|
+
description: 'Storefront customer access token. Pass this to cartBuyerIdentityUpdate so the cart is associated with the customer.',
|
|
54
|
+
}),
|
|
55
|
+
tslib_1.__metadata("design:type", String)
|
|
56
|
+
], CustomerLoginResult.prototype, "customerAccessToken", void 0);
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, graphql_1.Field)({ description: 'ISO-8601 timestamp when the access token expires.' }),
|
|
59
|
+
tslib_1.__metadata("design:type", String)
|
|
60
|
+
], CustomerLoginResult.prototype, "expiresAt", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, graphql_1.Field)(() => Customer, { description: 'The authenticated customer.' }),
|
|
63
|
+
tslib_1.__metadata("design:type", Customer)
|
|
64
|
+
], CustomerLoginResult.prototype, "customer", void 0);
|
|
65
|
+
exports.CustomerLoginResult = CustomerLoginResult = tslib_1.__decorate([
|
|
66
|
+
(0, graphql_1.ObjectType)({
|
|
67
|
+
description: 'Result of a customer login: a Storefront access token plus the customer.',
|
|
68
|
+
})
|
|
69
|
+
], CustomerLoginResult);
|
|
70
|
+
//# sourceMappingURL=customer.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.types.js","sourceRoot":"","sources":["../../src/customer/customer.types.ts"],"names":[],"mappings":";;;;AAAA,6CAAoD;AAEpD;;GAEG;AAGI,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAEnB,EAAE,CAAU;IAGZ,KAAK,CAAU;IAGf,SAAS,CAAU;IAGnB,QAAQ,CAAU;IAGlB,KAAK,CAAU;IAGf,WAAW,CAAU;CACtB,CAAA;AAlBY,4BAAQ;AAEnB;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;oCACzC;AAGZ;IADC,IAAA,eAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;;uCAC3C;AAGf;IADC,IAAA,eAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;;2CAC5C;AAGnB;IADC,IAAA,eAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;;0CAC5C;AAGlB;IADC,IAAA,eAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;;uCAClD;AAGf;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;;6CAC5B;mBAjBV,QAAQ;IADpB,IAAA,oBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CAkBpB;AAMM,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAK9B,mBAAmB,CAAU;IAG7B,SAAS,CAAU;IAGnB,QAAQ,CAAY;CACrB,CAAA;AAZY,kDAAmB;AAK9B;IAJC,IAAA,eAAK,EAAC;QACL,WAAW,EACT,qHAAqH;KACxH,CAAC;;gEAC2B;AAG7B;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,mDAAmD,EAAE,CAAC;;sDACzD;AAGnB;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;sCAC3D,QAAQ;qDAAC;8BAXT,mBAAmB;IAJ/B,IAAA,oBAAU,EAAC;QACV,WAAW,EACT,0EAA0E;KAC7E,CAAC;GACW,mBAAmB,CAY/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/customer/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./customer.module"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./customer.resolver"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./customer.service"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./customer.types"), exports);
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/customer/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,8DAAoC;AACpC,6DAAmC;AACnC,2DAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.module.d.ts","sourceRoot":"","sources":["../src/graphql.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql.module.d.ts","sourceRoot":"","sources":["../src/graphql.module.ts"],"names":[],"mappings":"AAuBA,qBA4Ba,aAAa;CAAG"}
|
package/dist/graphql.module.js
CHANGED
|
@@ -9,6 +9,7 @@ const path_1 = require("path");
|
|
|
9
9
|
const product_module_1 = require("./product/product.module");
|
|
10
10
|
const collection_module_1 = require("./collection/collection.module");
|
|
11
11
|
const cart_module_1 = require("./cart/cart.module");
|
|
12
|
+
const customer_module_1 = require("./customer/customer.module");
|
|
12
13
|
const cms_module_1 = require("./cms/cms.module");
|
|
13
14
|
const page_content_module_1 = require("./page-content/page-content.module");
|
|
14
15
|
const product_content_module_1 = require("./product-content/product-content.module");
|
|
@@ -38,6 +39,7 @@ exports.GraphqlModule = GraphqlModule = tslib_1.__decorate([
|
|
|
38
39
|
product_module_1.ProductModule,
|
|
39
40
|
collection_module_1.CollectionModule,
|
|
40
41
|
cart_module_1.CartModule,
|
|
42
|
+
customer_module_1.CustomerModule,
|
|
41
43
|
cms_module_1.CmsModule,
|
|
42
44
|
page_content_module_1.PageContentModule,
|
|
43
45
|
product_content_module_1.ProductContentModule,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.module.js","sourceRoot":"","sources":["../src/graphql.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,2CAAkE;AAClE,+BAA4B;AAE5B,6DAAyD;AACzD,sEAAkE;AAClE,oDAAgD;AAChD,iDAA6C;AAC7C,4EAAuE;AACvE,qFAAgF;AAChF,0DAAsD;AACtD,kFAA8E;AAC9E,+EAA0E;AAC1E,kFAA6E;AAC7E,6DAAyD;
|
|
1
|
+
{"version":3,"file":"graphql.module.js","sourceRoot":"","sources":["../src/graphql.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,2CAAkE;AAClE,+BAA4B;AAE5B,6DAAyD;AACzD,sEAAkE;AAClE,oDAAgD;AAChD,gEAA4D;AAC5D,iDAA6C;AAC7C,4EAAuE;AACvE,qFAAgF;AAChF,0DAAsD;AACtD,kFAA8E;AAC9E,+EAA0E;AAC1E,kFAA6E;AAC7E,6DAAyD;AAmClD,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IA5BzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,OAAO,CAAqB;gBACxC,MAAM,EAAE,qBAAY;gBACpB,cAAc,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC;gBACrD,UAAU,EAAE,IAAI;gBAChB,UAAU,EAAE,IAAI;gBAChB,aAAa,EAAE,IAAI;gBACnB,OAAO,EAAE,CAAC,EAAE,GAAG,EAA6B,EAAE,EAAE,CAAC,CAAC;oBAChD,GAAG;oBACH,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,WAAW,EAAE,GAAG,CAAC,WAAW;iBAC7B,CAAC;aACH,CAAC;YACF,8BAAa;YACb,oCAAgB;YAChB,wBAAU;YACV,gCAAc;YACd,sBAAS;YACT,uCAAiB;YACjB,6CAAoB;YACpB,4BAAY;YACZ,4CAAoB;YACpB,yCAAkB;YAClB,2CAAmB;YACnB,8BAAa;SACd;KACF,CAAC;GACW,aAAa,CAAG"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,WAAW,CAAC;AAG1B,cAAc,QAAQ,CAAC;AAGvB,cAAc,cAAc,CAAC;AAG7B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,WAAW,CAAC;AAG1B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,UAAU,CAAC;AAGzB,cAAc,OAAO,CAAC;AAGtB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,WAAW,CAAC;AAG1B,cAAc,QAAQ,CAAC;AAGvB,cAAc,YAAY,CAAC;AAG3B,cAAc,cAAc,CAAC;AAG7B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,WAAW,CAAC;AAG1B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,UAAU,CAAC;AAGzB,cAAc,OAAO,CAAC;AAGtB,cAAc,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,8 @@ tslib_1.__exportStar(require("./graphql.module"), exports);
|
|
|
12
12
|
tslib_1.__exportStar(require("./product"), exports);
|
|
13
13
|
// Cart
|
|
14
14
|
tslib_1.__exportStar(require("./cart"), exports);
|
|
15
|
+
// Customer (auth / login)
|
|
16
|
+
tslib_1.__exportStar(require("./customer"), exports);
|
|
15
17
|
// Collection
|
|
16
18
|
tslib_1.__exportStar(require("./collection"), exports);
|
|
17
19
|
// Serviceability
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mDAAmD;AACnD,2DAAiC;AAEjC,UAAU;AACV,oDAA0B;AAE1B,OAAO;AACP,iDAAuB;AAEvB,aAAa;AACb,uDAA6B;AAE7B,iBAAiB;AACjB,2DAAiC;AAEjC,gBAAgB;AAChB,0DAAgC;AAEhC,iBAAiB;AACjB,2DAAiC;AAEjC,UAAU;AACV,oDAA0B;AAE1B,eAAe;AACf,yDAA+B;AAE/B,kBAAkB;AAClB,4DAAkC;AAElC,SAAS;AACT,mDAAyB;AAEzB,MAAM;AACN,gDAAsB;AAEtB,2BAA2B;AAC3B,mDAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mDAAmD;AACnD,2DAAiC;AAEjC,UAAU;AACV,oDAA0B;AAE1B,OAAO;AACP,iDAAuB;AAEvB,0BAA0B;AAC1B,qDAA2B;AAE3B,aAAa;AACb,uDAA6B;AAE7B,iBAAiB;AACjB,2DAAiC;AAEjC,gBAAgB;AAChB,0DAAgC;AAEhC,iBAAiB;AACjB,2DAAiC;AAEjC,UAAU;AACV,oDAA0B;AAE1B,eAAe;AACf,yDAA+B;AAE/B,kBAAkB;AAClB,4DAAkC;AAElC,SAAS;AACT,mDAAyB;AAEzB,MAAM;AACN,gDAAsB;AAEtB,2BAA2B;AAC3B,mDAAyB"}
|