Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@figuredev/orders-sdk

Package Overview
Dependencies
Maintainers
9
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@figuredev/orders-sdk - npm Package Compare versions

Comparing version 0.13.3 to 0.13.4

3

CHANGELOG.md

@@ -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;
};

3

lib/index.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc