npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@salling-group/jobs

v1.0.2

Published

An SDK for Salling Group's Jobs API

Downloads

5

Readme

Salling Group Jobs SDK

This SDK simplifies the process of querying Salling Group's open job positions. Salling Group owns Netto, Føtex, Bilka, Salling, and more. Through this SDK you will be able to find information about open job positions. The requests are made through the Salling Group API which can be found here.

You can get your credentials through the developer portal.

Getting Started.

The SDK heavily relies on Traversers. You can read more about them here.

The following example gets names of all Netto job openings in the ZIP code 8200. You will need to get a JWT secret or Bearer token with access to the Jobs API from the developer portal.

const Jobs = require('@salling-group/jobs');
const instance = new Jobs({
  'auth': {
    'token': 'my_token',
    'type': 'bearer',
  },
});

const traverser = instance.beginQuery()
  .ofBrand('netto')
  .inZIP(8200)
  .pick('title', 'address')
  .execute();

traverser.get().then((page) => console.log(page));

This prints:

[
  {
    "title": "Butiksassistent under 18 år - Aarhus N",
    "address": {
      "city": "Aarhus N",
      "country": "DK",
      "street": "Finlandsgade 15",
      "zip": "8200"
    }
  },
  {
    "title": "Butiksassistent under 18 år - Aarhus N",
    "address": {
      "city": "Aarhus N",
      "country": "DK",
      "street": "Randersvej 116-118",
      "zip": "8200"
    }
  },
  {
    "title": "Souschef - Aarhus N",
    "address":
     { "city": "Aarhus N",
       "country": "DK",
       "street": "Finlandsgade 15",
       "zip": "8200"
     }
  }
]

Documentation

constructor(options)

This initializes a new Jobs SDK object. options must be an object containing an auth object with the following contract:

|Property|Value|Required|Description| |--------|-----|--------|-----------| |type|'jwt' or 'bearer'|Yes|The authentication type. This is either a JWT or a Bearer Token.| |token|String|If type is 'bearer'.|The token associared with the bearer token credentials.| |issuer|String|If type is 'jwt'.|The issuer associated with the JWT credentials.| |secret|String|If type is 'jwt'.|The secret associated with the JWT credentials.|

applicationName should be set in the options object, but this is optional. (This value will be sent in the UserAgent during requests.)

Example:

const Jobs = require('@salling-group/jobs');
const instance = new Jobs({
  'applicationName': 'My Application v1.0.0',
  'auth': {
    'type': 'jwt',
    'issuer': 'my_issuer',
    'secret': 'my_secret'
  },
});

get(jobID)

This gets the open job position with the given ID.

Example:

const jobData = await instance.get('3764efcb-4a7a-4d30-a274-7cefa0dce797');

getAll()

This gets all jobs.

Example:

const traverser = instance.getAll();
const page = await traverser.get();

beginQuery()

This begins a query for jobs. This should be followed by a chain of these commands:

|Method|Description|Example| |------|-----------|-------| |pick(field1, field2, ...)|Only returns the given fields.|.pick('id', 'name')| |ofBrand(brand)|Returns jobs from the given brand.|.ofBrand('netto')| |inCity(city)|Returns jobs in the given city.|.inCity('Risskov')| |inZIP(zip)|Returns jobs located in the given ZIP code.|.inZIP(8200)| |inCountry(country)|Returns jobs located in the given country code (ISO 3166-1 alpha-2).|.inCountry('dk')|

The chain should be ended with .execute(). This will return a Traverser for the query.

Example:

const traverser = instance.beginQuery()
    .ofBrand('netto')
    .inZIP(8200)
    .pick('title', 'id')
    .execute();
// This will return title and ID of Netto jobs in the ZIP code 8200.
const page = await traverser.get();

query(params = {})

This queries the Jobs API directly and returns a Traverser. (See this for more informaton.) params is the search parameters. This is mostly used internally.