1.3.16 • Published 7 months ago

musora-content-services v1.3.16

Weekly downloads
-
License
ISC
Repository
github
Last release
7 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

11 months ago

1.0.206

11 months ago

1.0.205

11 months ago

1.0.208

11 months ago

1.0.207

11 months ago

1.0.202

11 months ago

1.0.201

11 months ago

1.0.204

11 months ago

1.0.203

11 months ago

1.0.187

11 months ago

1.0.186

11 months ago

1.0.189

11 months ago

1.0.188

11 months ago

1.0.183

11 months ago

1.0.182

11 months ago

1.0.185

11 months ago

1.0.184

11 months ago

1.3.10

8 months ago

1.3.14

8 months ago

1.3.11

8 months ago

1.0.181

11 months ago

1.0.180

11 months ago

1.3.15

7 months ago

1.3.16

7 months ago

1.0.176

11 months ago

1.0.175

11 months ago

1.0.178

11 months ago

1.0.177

11 months ago

1.0.172

11 months ago

1.0.171

11 months ago

1.0.174

11 months ago

1.0.173

11 months ago

1.0.179

11 months ago

1.0.170

11 months ago

1.3.7

8 months ago

1.3.5

8 months ago

1.3.3

9 months ago

1.3.2

9 months ago

1.3.1

9 months ago

1.0.198

11 months ago

1.0.197

11 months ago

1.0.199

11 months ago

1.0.194

11 months ago

1.0.193

11 months ago

1.0.196

11 months ago

1.0.195

11 months ago

1.0.190

11 months ago

1.0.192

11 months ago

1.0.191

11 months ago

1.2.0

9 months ago

1.2.5

9 months ago

1.2.4

9 months ago

1.2.3

9 months ago

1.2.2

9 months ago

1.2.1

9 months ago

1.0.253

10 months ago

1.0.252

10 months ago

1.0.255

10 months ago

1.0.254

10 months ago

1.0.251

10 months ago

1.0.250

10 months ago

1.0.257

10 months ago

1.0.256

10 months ago

1.0.258

9 months ago

1.3.9

8 months ago

1.3.8

8 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

12 months ago

1.0.153

12 months ago

1.0.156

12 months ago

1.0.155

12 months ago

1.0.150

12 months ago

1.0.152

12 months ago

1.0.158

11 months ago

1.0.157

11 months ago

1.0.159

11 months ago

1.0.220

11 months ago

1.0.222

11 months ago

1.0.221

11 months ago

1.0.228

10 months ago

1.0.229

10 months ago

1.0.224

11 months ago

1.0.223

11 months ago

1.0.226

10 months ago

1.0.225

11 months ago

1.0.211

11 months ago

1.0.210

11 months ago

1.0.217

11 months ago

1.0.216

11 months ago

1.0.219

11 months ago

1.0.218

11 months ago

1.0.213

11 months ago

1.0.212

11 months ago

1.0.215

11 months ago

1.0.214

11 months ago

1.0.209

11 months ago

1.0.242

10 months ago

1.0.241

10 months ago

1.0.244

10 months ago

1.0.243

10 months ago

1.0.240

10 months ago

1.0.246

10 months ago

1.0.247

10 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

10 months ago

1.0.238

10 months ago

1.0.235

10 months ago

1.0.234

10 months ago

1.0.237

10 months ago

1.0.236

10 months ago

1.0.143

12 months ago

1.0.145

12 months ago

1.0.144

12 months ago

1.0.147

12 months ago

1.0.146

12 months ago

1.0.148

12 months ago

1.0.142

12 months ago

1.0.141

1 year ago

1.0.140

1 year 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

1 year ago

1.0.131

1 year ago

1.0.134

1 year ago

1.0.133

1 year ago

1.0.130

1 year ago

1.0.139

1 year ago

1.0.136

1 year ago

1.0.135

1 year ago

1.0.138

1 year ago

1.0.137

1 year 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

1 year ago

1.0.120

1 year ago

1.0.123

1 year ago

1.0.122

1 year ago

1.0.129

1 year ago

1.0.128

1 year ago

1.0.125

1 year ago

1.0.124

1 year ago

1.0.127

1 year ago

1.0.126

1 year 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

1 year ago

1.0.111

1 year ago

1.0.118

1 year ago

1.0.119

1 year ago

1.0.114

1 year ago

1.0.113

1 year ago

1.0.116

1 year ago

1.0.115

1 year 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