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
3
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.4.0 to 0.5.0

assignments.ts

54

index.ts
import axios from "axios"
import { UserContext } from "./utils"
import { PrinterDTO } from "./printers"
import { AssignmentDTO } from "./assignments"
import { SettingDTO } from "./settings"

@@ -10,5 +12,36 @@ type BusinessConfigClientConfig = {

export type GetAssignmentsQueryParams = {
includeDeleted?: boolean
locationIds?: string[]
}
export type GetSettingsQueryParams = {
locationId?: string
terminalId?: string
keys?: string[]
}
export class BusinessConfigClient {
constructor(private config: BusinessConfigClientConfig) {}
async getAssignments(ctx: UserContext, params: GetAssignmentsQueryParams): Promise<AssignmentDTO[]> {
return await axios
.request({
baseURL: this.config.baseUrl,
method: "GET",
url: "/assignment",
headers: {
"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),
},
params: {
includeDeleted: params.includeDeleted,
locationIds: params.locationIds,
},
})
.then((r) => r.data)
}
async getPrinters(ctx: UserContext): Promise<PrinterDTO[]> {

@@ -29,2 +62,23 @@ return await axios

}
async getSettings(ctx: UserContext, params: GetSettingsQueryParams): Promise<SettingDTO[]> {
return await axios
.request({
baseURL: this.config.baseUrl,
method: "GET",
url: "/setting",
headers: {
"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),
},
params: {
terminalId: params.terminalId,
locationId: params.locationId,
keys: params.keys,
},
})
.then((r) => r.data)
}
}

2

package.json
{
"name": "@figuredev/business-config-sdk",
"version": "0.4.0",
"version": "0.5.0",
"license": "ISC",

@@ -5,0 +5,0 @@ "dependencies": {

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