@bookinglab/booking-journey-api 2.19.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -650,9 +650,10 @@ var BookingLabClient = class extends ApiClient {
|
|
|
650
650
|
* Sends the host to the absolute serviceStatus endpoint on api.bookinglab.co.uk.
|
|
651
651
|
* @param token - Value for the X-BL-TOKEN header
|
|
652
652
|
* @param request - Body containing the host to check
|
|
653
|
+
* @param production - When true, hits the production endpoint; otherwise the `-staging` variant
|
|
653
654
|
*/
|
|
654
|
-
async getOrdinanceSurveyStatus(token, request) {
|
|
655
|
-
const url =
|
|
655
|
+
async getOrdinanceSurveyStatus(token, request, production = false) {
|
|
656
|
+
const url = `https://api.bookinglab.co.uk/serviceStatus/osplaces${production ? "" : "-staging"}`;
|
|
656
657
|
const controller = new AbortController();
|
|
657
658
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
658
659
|
try {
|
|
@@ -1587,13 +1588,13 @@ function useOsPlacesStatus(token, isStaging = false, enabled = true) {
|
|
|
1587
1588
|
enabled: enabled && !!token
|
|
1588
1589
|
});
|
|
1589
1590
|
}
|
|
1590
|
-
function useOrdinanceSurveyStatus(token, host, enabled = true) {
|
|
1591
|
+
function useOrdinanceSurveyStatus(token, host, production = false, enabled = true) {
|
|
1591
1592
|
const client = useBookingLabClient();
|
|
1592
1593
|
return useQuery({
|
|
1593
|
-
queryKey: ["ordinanceSurveyStatus", host],
|
|
1594
|
+
queryKey: ["ordinanceSurveyStatus", host, production],
|
|
1594
1595
|
queryFn: async () => {
|
|
1595
1596
|
const request = { host };
|
|
1596
|
-
const response = await client.getOrdinanceSurveyStatus(token, request);
|
|
1597
|
+
const response = await client.getOrdinanceSurveyStatus(token, request, production);
|
|
1597
1598
|
return response.data;
|
|
1598
1599
|
},
|
|
1599
1600
|
enabled: enabled && !!token && !!host
|