@figuredev/business-config-sdk
Advanced tools
Comparing version 0.9.3 to 0.9.4
@@ -6,3 +6,3 @@ import { UserContext } from "./utils"; | ||
import { AccountDTO } from "./account"; | ||
import { LocationDTO } from "./location"; | ||
import { LocationDTO, LocationPreviewDTO } from "./location"; | ||
declare type BusinessConfigClientConfig = { | ||
@@ -22,2 +22,5 @@ baseUrl: string; | ||
}; | ||
export declare type GetLocationPreviewsQueryParams = { | ||
locationIds?: string[]; | ||
}; | ||
export declare class BusinessConfigClient { | ||
@@ -28,2 +31,3 @@ private config; | ||
getLocation(ctx: UserContext, id: string): Promise<LocationDTO | null>; | ||
getLocationPreviews(ctx: UserContext, params: GetLocationPreviewsQueryParams): Promise<LocationPreviewDTO[]>; | ||
getAssignments(ctx: UserContext, params: GetAssignmentsQueryParams): Promise<AssignmentDTO[]>; | ||
@@ -30,0 +34,0 @@ getPrinters(ctx: UserContext): Promise<PrinterDTO[]>; |
@@ -42,2 +42,17 @@ "use strict"; | ||
} | ||
getLocationPreviews(ctx, params) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield axios_1.default | ||
.request({ | ||
baseURL: this.config.baseUrl, | ||
method: "GET", | ||
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)), | ||
params: { | ||
locationIds: params.locationIds, | ||
}, | ||
}) | ||
.then((r) => r.data); | ||
}); | ||
} | ||
getAssignments(ctx, params) { | ||
@@ -44,0 +59,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -9,2 +9,7 @@ export declare type LocationDTO = { | ||
}; | ||
export declare type LocationPreviewDTO = { | ||
id: string; | ||
name: string; | ||
timezone: string; | ||
}; | ||
export declare type StoreContactInfoDTO = { | ||
@@ -11,0 +16,0 @@ websiteUrl: string | null; |
{ | ||
"name": "@figuredev/business-config-sdk", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"license": "ISC", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
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
16271
270