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

acast-content-client

v2.6.4

Published

This is a npm module to read content from various places in our stack.

Downloads

3

Readme

Content-client

CircleCI

This is a npm package used to access content directly from the backend databases. It currently only supports elasticSearch but could support other datasources in the future.

It's a read-only api, so any writes need to be pushed to the servicebus using other services.

Some new additions

Check out how Content-client signes image urls!

##Usage

The client is initiated with the url to the elastic server as follows:

var elastic = Elastic("https://site:[email protected]");

It's also possible to pass a default value for the index so that you won't have to provide that for each call:

var elastic = Elastic("https://site:[email protected]", "content-alias");

The query format is as follows

var query = {
	query: {
		aProperty: "aValue"
	},
	skip: 10,
	limit: 31
}

It's possible to include parent or child entities

var query = {
	query: {
		aProperty: "aValue"
	},
	includes: [
	{
		type: "bling",
		relation: "child"
	},
	{
		type: "channel",
		relation: "parent"
	}],
	skip: 10,
	limit: 31
}

If you only need a specific field you can use the fields property:

var query = {
	query: {
		aProperty: "aValue"
	},
	fields: ["name"]
}

It's possible to filter by multiple properties. Those are applied with logical OR:

var query = {
	query: {
		aProperty: ["aValue", "bValue"]
	},
	fields: ["name"]
}

NOTE: The query below isn't supported after a rewrite of the aggregations

(Now added support for nested includes

var query = {
	query: {
		aProperty: "aValue"
	},
	includes: [
	{
		type: "acast",
		relation: "child",
		includes: [
		{
			type: "bling",
			relation: "child",
			limit: 1000
		}
		]
	}],
	skip: 10,
	limit: 31
}

) Word of caution for nested includes: The limit is per entity, so if you want all blings for a set of acasts you need to use a pretty high limit

Signed Image Urls

When there is a image property available there should also be a image_signature and image_signed property. The signing is done omitting query string parameters and protocol (http/https).

| Property | Purpose | |----------|---------| |image_signature| Is a 40 character hexadecimal hash of the image url | | image_signed | The whole address to the image via proxy and all |

Example of a bling image

{
	duration: 30,
	start: 1175,
	type: 'com.acast.bling.iframe',
	id: 'b37376ef-4337-4346-bf9b-2b298370bd85',
	body: [Object],
	image: 'https://acastprod.blob.core.windows.net:443/media/v1/b37376ef-4337-4346-bf9b-2b298370bd85/ska-rmavbild2015-11-20kl.09.44.37-ih7f835p.png',
	description: 'Valerie Jerrett and President Obama ',
	image_signed: 'https://imagecdn.acast.com/imagesign?source=https%3A%2F%2Facastprod.blob.core.windows.net%3A443%2Fmedia%2Fv1%2Fb37376ef-4337-4346-bf9b-2b298370bd85%2Fska-rmavbild2015-11-20kl.09.44.37-ih7f835p.png&sign=a83f5b00e4ccf3bc08f6205c72e53ec27923cccd',
  image_signature: 'a83f5b00e4ccf3bc08f6205c72e53ec27923cccd'
}

Config

| Key | Purpose | Values | Default | |-----|---------|--------|---------| | IMAGE_SIGN_KEY | Used to cryptographicly sign the url | Any string | 'i-like-cupcakes' | | IMAGE_PROXY_URL | The base url for the proxy route | A valid URL + route | 'https://imagecdn.acast.com/imagesign' | |LOG_QUERIES|Toggles logging of elastic searches|verbose|empty = no logging| |AZURE_SERVICEBUS_CONNECTION_STRING|The service bus is used for logging searches| | | |APP_NAME|Will be included in elastic logs| | | |APP_REGION|Will be included in elastic logs| | |

Categories codes

|iTunes main categories|Acast categories (codes)| |-----|---------|--------|---------| |Arts| arts| |Business| business| |Comedy| comedy| |Education| education| |Games & Hobbies| hobbies| |Government & Organizations| govorg| |Health| health| |Kids & Family| family| |Music| music| |News & Politics| politics| |Religion & Spirituality| religion| |Science & Medicine| science| |Society & Culture| society| |Sports & Hobbies (Sports & Recreation)| sports| |Technology| technology| |TV & Film| film|