Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@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
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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.