1.3.16 • Published 6 months ago

musora-content-services v1.3.16

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

Musora Content Services

Welcome to the musora-content-services repository. This package provides a collection of utility functions designed to fetch and manage content from our Sanity Studio. These functions are tailored to interact with our Sanity backend, allowing you to easily retrieve, filter, and manipulate content for use in various applications.

Setup

To set up the Musora Content Services project for local development, follow these steps:

  • Pull the latest railenvironment php-8-3-upgrade branch changes
  • In the railenvironment directory, start up the container with the ./rrr.sh command
  • Run r setup musora-content-services
  • Run npm install --save-dev jest
  • Create a new .env file in the root of the project and copy the contents from 1Password "musora-content-services .env"

You're now set for doing basic development and running tests through npm. To set up an even better developer experience, you can also do the following:

  • Find the location of node within the container by running which node in your terminal (inside the rrr shell)
    • This should be something along the lines of /home/.nvm/versions/node/v20.14.0/bin/node
  • Add the Node interpreter to your IDE. The following steps are for PHPStorm:
    • Go to File > Settings
    • Under Languages & Frameworks, click on Node.js
    • Under the Node interpreter dropdown, click "Add..." and select "Add Remote..."
    • In the next window, choose the Docker option
      • Set the Server to Docker
      • For the Image name, use the dropdown to select railenvironment_docker-manager:latest (this is the docker image that we're in when running the rrr shell)
      • For the Node.js interpreter path, paste in the path from step 1 (e.g. /home/.nvm/versions/node/v20.14.0/bin/node)
    • Apply the changes and click OK
  • You now have a Node interpreter set up that will assist in linting, tests, etc.

Features

  • Fetch Content by ID: Retrieve specific content items using their unique Railcontent ID.
  • Fetch All Songs: Get a list of all songs for a brand with pagination and search capabilities.
  • Filter Options: Generate filtering options based on difficulty, genre, and more.
  • Fetch Related Content: Easily fetch related lessons, songs, and content items.
  • Sanity Integration: Simplified interaction with the Sanity API using customizable configurations.

Installation

To install the package, use npm:

npm install musora-content-services

Generating index.js and index.d.ts

The index.js and index.d.ts files provide all exported functions from this package, and are generated automatically. Simply run npm run build-index to build these files. It works by running the tools/generate-index.js file, which simply parses the files under the src/services directory and builds up the index files with any functions tagged with export.

If you want to exclude any of your exported functions from the generated index files, be sure to add the function name to the excludeFromGeneratedIndex array inside the service file.

Publishing Package Updates

To publish a new version to NPM run,

./publish.sh

Symlinking

To link this package to the MWP repo for local development run,

./link_mcs.sh

If either of these commands fail due to permissions,

chmod +x <command>

Publish Documentation

This repo uses JSDoc to generate API documentation. To update the docs, run:

npm run doc

GitHub Page Documentation

https://railroadmedia.github.io/musora-content-services/

Run tests

Ensure that the setup process has been completed, including copying .env file from 1Password "musora-content-services .env" and having jest installed (npm install --save-dev jest). To run the full test suite, simply run the following:

npm test

You can also filter down to specific tests with the -- -t="..." option. e.g. you can run the userContext test suite with npm test -- -t="userContext" or just the contentLiked test with npm test -- -t="contentLiked"

1.0.200

10 months ago

1.0.206

10 months ago

1.0.205

10 months ago

1.0.208

10 months ago

1.0.207

10 months ago

1.0.202

10 months ago

1.0.201

10 months ago

1.0.204

10 months ago

1.0.203

10 months ago

1.0.187

10 months ago

1.0.186

10 months ago

1.0.189

10 months ago

1.0.188

10 months ago

1.0.183

10 months ago

1.0.182

10 months ago

1.0.185

10 months ago

1.0.184

10 months ago

1.3.10

7 months ago

1.3.14

7 months ago

1.3.11

7 months ago

1.0.181

10 months ago

1.0.180

10 months ago

1.3.15

7 months ago

1.3.16

6 months ago

1.0.176

10 months ago

1.0.175

10 months ago

1.0.178

10 months ago

1.0.177

10 months ago

1.0.172

10 months ago

1.0.171

11 months ago

1.0.174

10 months ago

1.0.173

10 months ago

1.0.179

10 months ago

1.0.170

11 months ago

1.3.7

7 months ago

1.3.5

7 months ago

1.3.3

8 months ago

1.3.2

8 months ago

1.3.1

8 months ago

1.0.198

10 months ago

1.0.197

10 months ago

1.0.199

10 months ago

1.0.194

10 months ago

1.0.193

10 months ago

1.0.196

10 months ago

1.0.195

10 months ago

1.0.190

10 months ago

1.0.192

10 months ago

1.0.191

10 months ago

1.2.0

8 months ago

1.2.5

8 months ago

1.2.4

8 months ago

1.2.3

8 months ago

1.2.2

8 months ago

1.2.1

8 months ago

1.0.253

9 months ago

1.0.252

9 months ago

1.0.255

9 months ago

1.0.254

9 months ago

1.0.251

9 months ago

1.0.250

9 months ago

1.0.257

9 months ago

1.0.256

9 months ago

1.0.258

9 months ago

1.3.9

7 months ago

1.3.8

7 months ago

1.0.165

11 months ago

1.0.164

11 months ago

1.0.167

11 months ago

1.0.166

11 months ago

1.0.161

11 months ago

1.0.160

11 months ago

1.0.163

11 months ago

1.0.162

11 months ago

1.0.169

11 months ago

1.0.168

11 months ago

1.1.3

9 months ago

1.0.154

11 months ago

1.0.153

11 months ago

1.0.156

11 months ago

1.0.155

11 months ago

1.0.150

11 months ago

1.0.152

11 months ago

1.0.158

11 months ago

1.0.157

11 months ago

1.0.159

11 months ago

1.0.220

10 months ago

1.0.222

10 months ago

1.0.221

10 months ago

1.0.228

10 months ago

1.0.229

10 months ago

1.0.224

10 months ago

1.0.223

10 months ago

1.0.226

10 months ago

1.0.225

10 months ago

1.0.211

10 months ago

1.0.210

10 months ago

1.0.217

10 months ago

1.0.216

10 months ago

1.0.219

10 months ago

1.0.218

10 months ago

1.0.213

10 months ago

1.0.212

10 months ago

1.0.215

10 months ago

1.0.214

10 months ago

1.0.209

10 months ago

1.0.242

9 months ago

1.0.241

9 months ago

1.0.244

9 months ago

1.0.243

9 months ago

1.0.240

9 months ago

1.0.246

9 months ago

1.0.247

9 months ago

1.0.231

10 months ago

1.0.230

10 months ago

1.0.233

10 months ago

1.0.232

10 months ago

1.0.239

9 months ago

1.0.238

9 months ago

1.0.235

9 months ago

1.0.234

9 months ago

1.0.237

9 months ago

1.0.236

9 months ago

1.0.143

11 months ago

1.0.145

11 months ago

1.0.144

11 months ago

1.0.147

11 months ago

1.0.146

11 months ago

1.0.148

11 months ago

1.0.142

11 months ago

1.0.141

11 months ago

1.0.140

11 months ago

1.0.62

1 year ago

1.0.60

1 year ago

1.0.66

1 year ago

1.0.65

1 year ago

1.0.64

1 year ago

1.0.63

1 year ago

1.0.69

1 year ago

1.0.68

1 year ago

1.0.67

1 year ago

1.0.132

12 months ago

1.0.131

12 months ago

1.0.134

12 months ago

1.0.133

12 months ago

1.0.130

12 months ago

1.0.139

11 months ago

1.0.136

11 months ago

1.0.135

12 months ago

1.0.138

11 months ago

1.0.137

11 months ago

1.0.73

1 year ago

1.0.72

1 year ago

1.0.71

1 year ago

1.0.70

1 year ago

1.0.77

1 year ago

1.0.76

1 year ago

1.0.75

1 year ago

1.0.74

1 year ago

1.0.79

1 year ago

1.0.78

1 year ago

1.0.55

1 year ago

1.0.59

1 year ago

1.0.58

1 year ago

1.0.57

1 year ago

1.0.56

1 year ago

1.0.101

1 year ago

1.0.100

1 year ago

1.0.107

1 year ago

1.0.109

1 year ago

1.0.108

1 year ago

1.0.102

1 year ago

1.0.105

1 year ago

1.0.104

1 year ago

1.0.121

12 months ago

1.0.120

12 months ago

1.0.123

12 months ago

1.0.122

12 months ago

1.0.129

12 months ago

1.0.128

12 months ago

1.0.125

12 months ago

1.0.124

12 months ago

1.0.127

12 months ago

1.0.126

12 months ago

1.0.84

1 year ago

1.0.83

1 year ago

1.0.82

1 year ago

1.0.81

1 year ago

1.0.88

1 year ago

1.0.87

1 year ago

1.0.86

1 year ago

1.0.85

1 year ago

1.0.89

1 year ago

1.0.110

1 year ago

1.0.112

12 months ago

1.0.111

12 months ago

1.0.118

12 months ago

1.0.119

12 months ago

1.0.114

12 months ago

1.0.113

12 months ago

1.0.116

12 months ago

1.0.115

12 months ago

1.0.91

1 year ago

1.0.90

1 year ago

1.0.95

1 year ago

1.0.94

1 year ago

1.0.93

1 year ago

1.0.92

1 year ago

1.0.99

1 year ago

1.0.98

1 year ago

1.0.97

1 year ago

1.0.96

1 year ago

1.0.54

1 year ago

1.0.53

1 year ago

1.0.52

1 year ago

1.0.51

1 year ago

1.0.50

1 year ago

1.0.49

1 year ago

1.0.48

1 year ago

1.0.47

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.40

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.7

1 year ago

1.0.2

1 year ago

1.0.0

1 year ago