@figuredev/orders-sdk
Advanced tools
Comparing version 0.13.3 to 0.13.4
@@ -6,2 +6,5 @@ # Changelog | ||
## 0.13.4 | ||
- Added `SDK.getCustomerLoyaltyInfo` to match a customer by email or phone number | ||
## 0.13.3 | ||
@@ -8,0 +11,0 @@ - Added `SDK.matchCustomer` to match a customer by email or phone number |
@@ -37,1 +37,6 @@ import { Maybe } from "./types"; | ||
}; | ||
export declare type CustomerLoyaltyInfoDTO = { | ||
customerLoyaltyProgramId: string; | ||
rewardsBalance: number; | ||
spendUntilNextReward: number; | ||
}; |
@@ -10,3 +10,3 @@ import { Maybe } from "@figurepos/fgr-lib-backend/lib/types"; | ||
import { UserContext } from "./utils"; | ||
import { CustomerDTO } from "./customer"; | ||
import { CustomerDTO, CustomerLoyaltyInfoDTO } from "./customer"; | ||
declare type OrdersClientConfig = { | ||
@@ -78,2 +78,3 @@ baseUrl: string; | ||
matchCustomer(ctx: UserContext, data: CustomerMatchInput, fullData?: boolean): Promise<Maybe<CustomerDTO>>; | ||
getCustomerLoyaltyInfo(ctx: UserContext, customerId: string): Promise<Maybe<CustomerLoyaltyInfoDTO>>; | ||
private prepareHeaders; | ||
@@ -80,0 +81,0 @@ private post; |
@@ -164,2 +164,16 @@ "use strict"; | ||
} | ||
getCustomerLoyaltyInfo(ctx, customerId) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
return yield this.get(ctx, `/customer/${customerId}/loyalty-info`); | ||
} | ||
catch (error) { | ||
if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 404) { | ||
return null; | ||
} | ||
throw error; | ||
} | ||
}); | ||
} | ||
prepareHeaders(ctx) { | ||
@@ -166,0 +180,0 @@ return Object.assign(Object.assign(Object.assign({ "fgr-service-token": this.config.secret }, (ctx.accountId ? { "twbrds-account-id": ctx.accountId } : null)), (ctx.locationId ? { "twbrds-location-id": ctx.locationId } : null)), (ctx.terminalId ? { "twbrds-terminal-id": ctx.terminalId } : null)); |
{ | ||
"name": "@figuredev/orders-sdk", | ||
"version": "0.13.3", | ||
"version": "0.13.4", | ||
"license": "ISC", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80765
1541