Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
@dotdev/locations
Advanced tools
import Locations from '@dotdev/locations'
const locationsJS = new Locations({options})
You are able to provide options to locations that will assist with testing. The options are not intended to be used for production.
Using the following settings will send all requests to the Alice mcCall dev environment.
const locationsJS = new StoreLocations({
url: 'https://connector-dev.alicemccall.io/api/apps',
params: '?shop=alice-mccall-stage.myshopify.com',
storeKey: 'pickup_store_id',
locationsUrl: '/location-lookup',
inventoryUrl: '/inventory-lookup/locations'
})
The default url is '/apps/connector'
and there are no default parameters
locationLookup({config})
Find locations near to specified coordinates.
{config}
- required - objectIt is required that you send the location to the locationLookup
data: {
coordinates: {
latitude: lat,
longitude: long
}
}
A callback function for once the stores have been located
success: function (response) {
const json = JSON.parse(response)
}
A callback function fired if the API returns an error
error: function (err) {
console.error(err)
}
const request = {
data: {
coordinates: {
latitude: lat,
longitude: long
}
},
success: function (response) {
const json = JSON.parse(response)
}.bind(this)
}
locationsJS.locationLookup(request)
inventoryLocationsByIds({config})
Find locations that stock a specified list of variants by id.
{config}
- required - objectIt is required that you send the location and an array of variant ids to the locationLookup
data: {
coordinates: {
latitude: lat,
longitude: long
},
variants: [16326964609081, 12445435324234, 32452344534553]
}
A callback function for once the stores have been located
success: function (response) {
const json = JSON.parse(response)
}
A callback function fired if the API returns an error
error: function (err) {
console.error(err)
}
const request = {
data: {
coordinates: {
latitude: lat,
longitude: long
},
variants: [16326964609081]
},
error: function locationError (response) {
console.log(response)
},
success: function (response) {
const json = JSON.parse(response)
}.bind(this)
}
this.storeLocations.inventoryLocationsByIds(request)
setClickAndCollectStore({config})
{config}
- required - objectThe id of the localtion that you wish to us for click and collect.
id: 6
A callback function for once the stores have been located
success: function (response) {
const json = JSON.parse(response)
}
A callback function fired if the API returns an error
error: function (err) {
console.error(err)
}
locationsJS.setClickAndCollectStore({ id: id });
FAQs
Front end store locator api wrapper
The npm package @dotdev/locations receives a total of 0 weekly downloads. As such, @dotdev/locations popularity was classified as not popular.
We found that @dotdev/locations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.