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

@figuredev/business-config-sdk

Package Overview
Dependencies
Maintainers
4
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@figuredev/business-config-sdk - npm Package Compare versions

Comparing version 0.9.7 to 0.9.8

lib/terminal.d.ts

12

lib/index.d.ts

@@ -7,2 +7,3 @@ import { UserContext } from "./utils";

import { LocationDTO, LocationPreviewDTO } from "./location";
import { TerminalDTO, TerminalPreviewDTO } from "./terminal";
declare type BusinessConfigClientConfig = {

@@ -25,2 +26,5 @@ baseUrl: string;

};
export declare type GetTerminalPreviewsQueryParams = {
locationIds?: string[];
};
export declare type GetPrintersQueryParams = {

@@ -32,5 +36,13 @@ printerType?: PrinterType;

constructor(config: BusinessConfigClientConfig);
prepareHeaders(ctx: UserContext): {
"twbrds-terminal-id": string;
"twbrds-location-id": string;
"twbrds-account-id": string;
"fgr-service-token": string;
};
getAccount(ctx: UserContext, id: string): Promise<AccountDTO | null>;
getLocation(ctx: UserContext, id: string): Promise<LocationDTO | null>;
getLocationPreviews(ctx: UserContext, params: GetLocationPreviewsQueryParams): Promise<LocationPreviewDTO[]>;
getTerminal(ctx: UserContext, id: string): Promise<TerminalDTO | null>;
getTerminalPreviews(ctx: UserContext, params: GetTerminalPreviewsQueryParams): Promise<TerminalPreviewDTO[]>;
getAssignments(ctx: UserContext, params: GetAssignmentsQueryParams): Promise<AssignmentDTO[]>;

@@ -37,0 +49,0 @@ getPrinters(ctx: UserContext, params?: GetPrintersQueryParams): Promise<PrinterDTO[]>;

44

lib/index.js

@@ -18,2 +18,5 @@ "use strict";

}
prepareHeaders(ctx) {
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));
}
getAccount(ctx, id) {

@@ -26,3 +29,3 @@ return __awaiter(this, void 0, void 0, function* () {

url: `/account/${id}`,
headers: 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)),
headers: this.prepareHeaders(ctx),
})

@@ -39,3 +42,3 @@ .then((r) => r.data);

url: `/location/${id}`,
headers: 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)),
headers: this.prepareHeaders(ctx),
})

@@ -52,3 +55,3 @@ .then((r) => r.data);

url: "/location",
headers: 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)),
headers: this.prepareHeaders(ctx),
params: {

@@ -61,2 +64,29 @@ locationIds: params.locationIds,

}
getTerminal(ctx, id) {
return __awaiter(this, void 0, void 0, function* () {
return yield axios_1.default
.request({
baseURL: this.config.baseUrl,
method: "GET",
url: `/terminal/${id}`,
headers: this.prepareHeaders(ctx),
})
.then((r) => r.data);
});
}
getTerminalPreviews(ctx, params) {
return __awaiter(this, void 0, void 0, function* () {
return yield axios_1.default
.request({
baseURL: this.config.baseUrl,
method: "GET",
url: `/terminal`,
headers: this.prepareHeaders(ctx),
params: {
locationIds: params.locationIds,
},
})
.then((r) => r.data);
});
}
getAssignments(ctx, params) {

@@ -69,3 +99,3 @@ return __awaiter(this, void 0, void 0, function* () {

url: "/assignment",
headers: 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)),
headers: this.prepareHeaders(ctx),
params: {

@@ -87,3 +117,3 @@ includeDeleted: params.includeDeleted,

url: "/printer",
headers: 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)),
headers: this.prepareHeaders(ctx),
params: {

@@ -103,3 +133,3 @@ printerType: params.printerType

url: "/printer/physical",
headers: 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)),
headers: this.prepareHeaders(ctx),
})

@@ -116,3 +146,3 @@ .then((r) => r.data);

url: "/setting",
headers: 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)),
headers: this.prepareHeaders(ctx),
params: {

@@ -119,0 +149,0 @@ terminalId: params.terminalId,

2

package.json
{
"name": "@figuredev/business-config-sdk",
"version": "0.9.7",
"version": "0.9.8",
"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