Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev into master #51

Merged
merged 156 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
a9e41b2
rebrand
inferrinizzard Aug 10, 2023
09e3295
remove spotify web scripts, husky
inferrinizzard Aug 10, 2023
24b4abf
remove web-scripts
inferrinizzard Aug 13, 2023
84e2179
install typescript
inferrinizzard Aug 13, 2023
a13f859
configure tsc
inferrinizzard Aug 13, 2023
8b56536
Merge branch 'typescript' into reset
inferrinizzard Aug 13, 2023
9d054b1
install vitest
inferrinizzard Aug 13, 2023
fce253e
add vite config
inferrinizzard Aug 13, 2023
3877be2
configure tsconfig for vitest
inferrinizzard Aug 13, 2023
05b2743
config and run existing tests
inferrinizzard Aug 13, 2023
bff7cff
replace jest with vi
inferrinizzard Aug 13, 2023
7d038a8
rename all files to use *.test
inferrinizzard Aug 13, 2023
a818d58
fix tsc errors
inferrinizzard Aug 13, 2023
4a80c72
install eslint
inferrinizzard Aug 13, 2023
51c4ad9
install prettier
inferrinizzard Aug 13, 2023
bb5d9eb
install eslint config
inferrinizzard Aug 13, 2023
a972470
configure eslint
inferrinizzard Aug 13, 2023
f3dec35
eslint autofix
inferrinizzard Aug 13, 2023
6e0172a
:recycle:
inferrinizzard Aug 13, 2023
9f02845
Merge branch 'vitest' into reset
inferrinizzard Aug 13, 2023
2dbe6b9
Merge branch 'eslint' into reset
inferrinizzard Aug 13, 2023
e6241fe
fix eslint
inferrinizzard Aug 13, 2023
0295ba5
turn off unbound-method for now
inferrinizzard Aug 13, 2023
8a32067
update eslint config version
inferrinizzard Aug 13, 2023
bd64e2f
autolint test files
inferrinizzard Aug 13, 2023
9367b9f
fix all top level hooks in test files
inferrinizzard Aug 13, 2023
cb533ff
add return types
inferrinizzard Aug 13, 2023
4b7d96d
fix misc lint errors
inferrinizzard Aug 13, 2023
61d0c93
build with vite
inferrinizzard Aug 13, 2023
df53447
configure build entry points
inferrinizzard Aug 14, 2023
ad216e8
install vite-plugin-dts
inferrinizzard Aug 14, 2023
9cc673b
:recycle:
inferrinizzard Aug 14, 2023
a86931e
Merge branch 'vitest' into reset
inferrinizzard Aug 14, 2023
4dc4c63
export types in build
inferrinizzard Aug 14, 2023
c7ea230
lint vite config
inferrinizzard Aug 14, 2023
f2e406a
export all types
inferrinizzard Aug 14, 2023
47ff444
Merge branch 'vite' into reset
inferrinizzard Aug 14, 2023
c59b1bd
update gitignore
inferrinizzard Aug 14, 2023
ff8a56a
install husky
inferrinizzard Aug 14, 2023
781d579
install lint-staged
inferrinizzard Aug 14, 2023
ec08dc7
add pre-commit hook
inferrinizzard Aug 14, 2023
46838f6
add pre-push hook
inferrinizzard Aug 14, 2023
63c8034
Merge branch 'git-hooks' into reset
inferrinizzard Aug 14, 2023
384a3da
add contributors
inferrinizzard Aug 14, 2023
0ccd001
Merge branch 'reset'
inferrinizzard Aug 14, 2023
8eb0777
install openapi-typescript-codegen
inferrinizzard Aug 14, 2023
d4907d3
curl spotify openapi schema
inferrinizzard Aug 14, 2023
0e04e52
add script to fetch schema
inferrinizzard Aug 14, 2023
ed9c8d7
add policies yaml
inferrinizzard Aug 14, 2023
ac30f76
move schema to dir
inferrinizzard Aug 14, 2023
a1fc256
add script to generate openapi types
inferrinizzard Aug 14, 2023
5ae40c3
add initial generated types
inferrinizzard Aug 14, 2023
f2226d9
fix tsc check for lint-staged
inferrinizzard Aug 14, 2023
ffa25a7
:recycle:
inferrinizzard Aug 14, 2023
3eb87db
add node engine
inferrinizzard Aug 14, 2023
557d928
update PR action
inferrinizzard Aug 14, 2023
4fea4f0
fix tsc check for lint-staged
inferrinizzard Aug 14, 2023
b89da9f
add lint check to pre-push
inferrinizzard Aug 14, 2023
edf8171
:recycle:
inferrinizzard Aug 14, 2023
815125c
lint fix
inferrinizzard Aug 14, 2023
29eee06
Merge branch 'reset'
inferrinizzard Aug 14, 2023
239865f
Merge branch 'master' into openapi
inferrinizzard Aug 14, 2023
fe52235
install form-data
inferrinizzard Aug 14, 2023
6d7eff1
generate openapi with axios instead
inferrinizzard Aug 14, 2023
d1a0e64
indent: 2
inferrinizzard Aug 14, 2023
c52c9f0
rename dir to openapi
inferrinizzard Aug 16, 2023
51db551
:recycle:
inferrinizzard Aug 16, 2023
b810625
Merge pull request #1 from inferrinizzard/openapi
inferrinizzard Aug 16, 2023
1294c61
replace AlbumsApi with services
inferrinizzard Aug 15, 2023
d69fce2
replace ArtistsApi with services
inferrinizzard Aug 15, 2023
9caac7d
update BrowseApi to services
inferrinizzard Aug 15, 2023
0fd723b
update EpisodesApi to services
inferrinizzard Aug 15, 2023
ed5d7f8
update FollowApi to services
inferrinizzard Aug 16, 2023
2993e60
update LibraryApi to services
inferrinizzard Aug 16, 2023
a9bd0ae
update PersonalizationApi to services
inferrinizzard Aug 16, 2023
a5a61ae
update PlayerApi to services
inferrinizzard Aug 16, 2023
690ec3d
update PlaylistsApi to services
inferrinizzard Aug 16, 2023
d7dce0a
update ShowsApi to services
inferrinizzard Aug 16, 2023
9f030cf
update TracksApi to services
inferrinizzard Aug 16, 2023
43e589d
update UsersApi to services
inferrinizzard Aug 16, 2023
dfe83e4
add missing episode endpoints in LibraryApi
inferrinizzard Aug 16, 2023
aea17a7
add missing audiobook endpoints in LibraryApi
inferrinizzard Aug 16, 2023
8cfd43a
add AudiobooksApi
inferrinizzard Aug 16, 2023
bdecde7
add misc remaining apis
inferrinizzard Aug 16, 2023
c786e87
update SearchApi with services
inferrinizzard Aug 16, 2023
3224a92
mark all api tests with todo
inferrinizzard Aug 16, 2023
c200857
remove wrapper level for apis that return multiple
inferrinizzard Aug 16, 2023
4940a8c
remove return on Promise<void>
inferrinizzard Aug 16, 2023
fee4598
delete removePlaylistItemByPosition
inferrinizzard Aug 16, 2023
232fd34
Merge pull request #2 from inferrinizzard/openapi-services
inferrinizzard Aug 16, 2023
43e216f
castrate Http
inferrinizzard Aug 16, 2023
60a3e03
update axios
inferrinizzard Aug 16, 2023
73b4e9e
add basic spotifyAxios client
inferrinizzard Aug 16, 2023
06087f2
remove old spotifyAxios
inferrinizzard Aug 16, 2023
a9466be
move main logic into own dir
inferrinizzard Aug 16, 2023
b1a6498
remove redundant options types
inferrinizzard Aug 16, 2023
7dccd1a
remove SpotifyResponses types
inferrinizzard Aug 16, 2023
2de23a2
remove SpotifyObjects, fix fixtures
inferrinizzard Aug 16, 2023
1ee32d9
use spotifyAxios in existing spotifyApi methods
inferrinizzard Aug 16, 2023
1fd3a77
update auth scopes
inferrinizzard Aug 16, 2023
3481d98
split credentials from api options, add assertion
inferrinizzard Aug 16, 2023
b6cb0c3
force credentials on init, use getters
inferrinizzard Aug 16, 2023
d4c7c6d
use base64 from request.ts
inferrinizzard Aug 16, 2023
6f785bf
remove http from spotifyApi
inferrinizzard Aug 16, 2023
5b17fa4
temp skip spotifyApi tests
inferrinizzard Aug 16, 2023
002c5dc
remove Http test file
inferrinizzard Aug 16, 2023
cdb6af3
remove contentType from spotifyAxios
inferrinizzard Aug 16, 2023
22404fc
autogen with custom request.ts inject
inferrinizzard Aug 16, 2023
704075b
passThrough request.ts
inferrinizzard Aug 16, 2023
9225cb3
use spotifyAxios in request
inferrinizzard Aug 16, 2023
5968557
inject accessToken via apiConfigs
inferrinizzard Aug 16, 2023
1381b9f
fix types for fixtures
inferrinizzard Aug 16, 2023
cfac13c
Merge pull request #3 from inferrinizzard/openapi-axios
inferrinizzard Aug 16, 2023
5a4cbf8
fix test
inferrinizzard Aug 16, 2023
348c9a3
Merge branch 'master' into authorisation
inferrinizzard Aug 16, 2023
0144569
Merge pull request #4 from inferrinizzard/clean-types
inferrinizzard Aug 17, 2023
989f1c6
restore tests for AlbumsApi
inferrinizzard Aug 16, 2023
4bebc84
restore tests for ArtistsApi
inferrinizzard Aug 16, 2023
4cef19d
restore tests for BrowseApi
inferrinizzard Aug 17, 2023
15fb57e
restore tests for EpisodesApi
inferrinizzard Aug 17, 2023
2b3c688
restore tests for FollowApi
inferrinizzard Aug 17, 2023
99db0b7
add fixture for new LibraryApi functions
inferrinizzard Aug 17, 2023
b125fce
add fixtures for new AudioBooksApi
inferrinizzard Aug 17, 2023
4429004
add fixtures for misc new api
inferrinizzard Aug 17, 2023
8554ea4
re-export all new fixtures
inferrinizzard Aug 17, 2023
ccbc810
re-export new fixtures from LibraryApi
inferrinizzard Aug 17, 2023
b0f88a5
restore tests for PersonalizationApi, fix types
inferrinizzard Aug 17, 2023
f8c8a43
add getPlaylistCoverFixture
inferrinizzard Aug 18, 2023
b4ca57c
restore tests for PlaylistsApi
inferrinizzard Aug 18, 2023
68572e4
Merge pull request #5 from inferrinizzard/add-missing-fixtures
inferrinizzard Aug 18, 2023
2d5a24b
add missing searchAudiobooksFixture
inferrinizzard Aug 18, 2023
2f8db5f
Merge pull request #6 from inferrinizzard/add-missing-fixtures
inferrinizzard Aug 18, 2023
f8d708f
Merge branch 'master' into openapi-tests
inferrinizzard Aug 18, 2023
1f8c78e
restore tests for SearchApi
inferrinizzard Aug 18, 2023
cfb707a
restore tests for ShowsApi
inferrinizzard Aug 18, 2023
d22ba7b
restore tests for TracksApi
inferrinizzard Aug 18, 2023
7f35560
restore tests for UsersApi
inferrinizzard Aug 18, 2023
9f2075b
fix last test in FollowApi
inferrinizzard Aug 18, 2023
08b4fb5
add tests for AudiobooksApi
inferrinizzard Aug 18, 2023
f09c3c5
add tests for MarketsApi
inferrinizzard Aug 18, 2023
df5c701
restore tests for PlayerApi, add getMyDevicesFixture
inferrinizzard Aug 18, 2023
e137c0a
restore tests for LibraryApi
inferrinizzard Aug 18, 2023
0b682a6
fix last test for PlaylistsApi
inferrinizzard Aug 18, 2023
e01ccae
remove validateClientConfigs
inferrinizzard Aug 18, 2023
a6b40b7
add PKCE auth methods
inferrinizzard Aug 18, 2023
27dbb43
restore tests for spotifyApi
inferrinizzard Aug 18, 2023
5122931
add tests for PKCE
inferrinizzard Aug 18, 2023
8dfc39d
Merge pull request #7 from inferrinizzard/openapi-tests
inferrinizzard Aug 18, 2023
711840d
Merge pull request #8 from inferrinizzard/authorisation
inferrinizzard Aug 18, 2023
448a03f
remove searchHelper
inferrinizzard Aug 18, 2023
6f9a0bd
remove Http
inferrinizzard Aug 18, 2023
da7a8de
remove getAuthorizationUrl test
inferrinizzard Aug 18, 2023
8b36039
rename helpers to utils
inferrinizzard Aug 18, 2023
743b9db
Merge pull request #9 from inferrinizzard/clean-utils
inferrinizzard Aug 18, 2023
41b38be
restore package changes
inferrinizzard Sep 13, 2023
bfc6c81
Merge pull request #50 from inferrinizzard/master
inferrinizzard Sep 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package.json
.eslintrc.*

tsconfig.json
tsconfig.*.json

dist/

src/openapi/**/(!request)*
15 changes: 15 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// require('@spotify/web-scripts/config/eslintrc.js');
module.exports = {
extends: ["@inferrinizzard/eslint-config"],
rules: {
"@typescript-eslint/unbound-method": "off",
},
overrides: [
{
files: "src/openapi/**/*",
rules: {
"@typescript-eslint/ban-tslint-comment": "off",
},
},
],
};
1 change: 0 additions & 1 deletion .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pull-request-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 18.x
- run: yarn install
- run: yarn lint
- run: yarn test
41 changes: 1 addition & 40 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,68 +9,29 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# Visual Studio Code settings
.vscode

# Build output
cjs
esm
types
dist

# Generated documentation
docs
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn pre-commit
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn pre-push
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2019 Adam Grieger
Copyright (c) 2023 inferrinizzard
Copyright (c) 2019-2023 Adam Grieger

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<p align="center">
<a href="https://github.com/adamgrieger/spotify-web-api-ts">
<a href="https://github.com/inferrinizzard/spotify-web-api">
<img src="assets/logo.svg" height="100">
</a>

<h3 align="center">spotify-web-api-ts</h3>
<h3 align="center">spotify-web-api</h3>

<p align="center">
An isomorphic TypeScript wrapper for Spotify's Web API
<br />
<a href="https://adamgrieger.github.io/spotify-web-api-ts/"><strong>View the docs »</strong></a>
<a href="https://inferrinizzard.github.io/spotify-web-api/"><strong>View the docs »</strong></a>
<br />
<p align="center">
<img alt="npm" src="https://badgen.net/npm/v/spotify-web-api-ts"/>
<img alt="minzipped size" src="https://badgen.net/bundlephobia/minzip/spotify-web-api-ts">
<img alt="license" src="https://badgen.net/github/license/adamgrieger/spotify-web-api-ts">
<img alt="npm" src="https://badgen.net/npm/v/spotify-web-api"/>
<img alt="minzipped size" src="https://badgen.net/bundlephobia/minzip/spotify-web-api">
<img alt="license" src="https://badgen.net/github/license/inferrinizzard/spotify-web-api">
</p>
<p align="center">
<img alt="Master Workflow" src="https://github.com/adamgrieger/spotify-web-api-ts/workflows/Master%20Workflow/badge.svg"/>
<img alt="codecov" src="https://codecov.io/gh/adamgrieger/spotify-web-api-ts/branch/master/graph/badge.svg"/>
<img alt="Master Workflow" src="https://github.com/inferrinizzard/spotify-web-api/workflows/Master%20Workflow/badge.svg"/>
<img alt="codecov" src="https://codecov.io/gh/inferrinizzard/spotify-web-api/branch/master/graph/badge.svg"/>
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</p>
</p>
Expand All @@ -28,24 +28,29 @@
### yarn

```sh
yarn add spotify-web-api-ts
yarn add spotify-web-api
```

### npm

```sh
npm install spotify-web-api-ts
npm install spotify-web-api
```

## Basic Example

```typescript
import { SpotifyWebApi } from 'spotify-web-api-ts';
import { SpotifyWebApi } from "spotify-web-api";

const spotify = new SpotifyWebApi({ accessToken: '<YOUR_ACCESS_TOKEN_HERE>' });
const spotify = new SpotifyWebApi({ accessToken: "<YOUR_ACCESS_TOKEN_HERE>" });

const { artists } = await spotify.albums.getAlbum('1uzfGk9vxMXfaZ2avqwxod');
const { artists } = await spotify.albums.getAlbum("1uzfGk9vxMXfaZ2avqwxod");

console.log(artists.map(artist => artist.name));
console.log(artists.map((artist) => artist.name));
// Array [ "Against All Logic" ]
```

### Contributors

- @inferrinizzard
- @adamgrieger
2 changes: 1 addition & 1 deletion assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion jest.config.js

This file was deleted.

79 changes: 52 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,68 @@
{
"name": "spotify-web-api-ts",
"version": "1.0.0",
"version": "2.0.0-alpha-0",
"description": "An isomorphic TypeScript wrapper for Spotify's Web API",
"main": "cjs/index.js",
"module": "esm/index.js",
"types": "types",
"repository": "https://github.com/adamgrieger/spotify-web-api-ts.git",
"author": "Adam Grieger",
"license": "MIT",
"engines": {
"node": "^16.0.0 || >=18.0.0"
},
"type": "module",
"main": "dist/spotify-web-api.umd.js",
"module": "dist/spotify-web-api.cjs",
"types": "dist/spotify-web-api.d.ts",
"exports": {
".": {
"import": "./dist/spotify-web-api.cjs",
"require": "./dist/spotify-web-api.umd.js"
}
},
"files": [
"cjs",
"esm",
"types",
"dist",
"assets"
],
"scripts": {
"build": "web-scripts build --project tsconfig.build.json",
"commit": "web-scripts commit",
"format": "web-scripts format",
"lint": "web-scripts lint",
"prepare": "web-scripts audit",
"release": "web-scripts release",
"test": "web-scripts test",
"generate-docs": "typedoc --out docs src/index.ts"
"build": "vite build",
"lint": "eslint src",
"lint:fix": "eslint --fix src",
"test:dom": "vitest run --environment jsdom",
"test:node": "vitest run --environment node",
"test": "yarn test:dom && yarn test:node",
"types": "tsc --project tsconfig.json",

"generate-api": "bash -c ./tools/generate-openapi.sh",
"generate-docs": "typedoc --out docs src/index.ts",

"pre-commit": "lint-staged",
"pre-push": "yarn lint:fix && yarn test"
},
"husky": {
"hooks": {
"commit-msg": "web-scripts commitmsg",
"pre-commit": "web-scripts precommit"
}
"lint-staged": {
"src/**/*": "eslint --fix",
"*.ts": "bash -c yarn types"
},
"dependencies": {
"axios": "^1.4.0",
"qs": "^6.9.4"
},
"devDependencies": {
"@spotify/web-scripts": "^8.0.2",
"@inferrinizzard/eslint-config": "^0.1.3",
"@types/qs": "^6.9.4",
"husky": "^4.2.5",
"typedoc": "^0.18.0"
"eslint": "^8.47.0",
"form-data": "4.x",
"husky": "^8.0.3",
"jsdom": "^22.1.0",
"lint-staged": "^14.0.0",
"openapi-typescript-codegen": "^0.25.0",
"prettier": "^2.7.1",
"typedoc": "^0.18.0",
"typescript": "^5.1.6",
"vite": "^4.4.9",
"vite-plugin-dts": "^3.5.2",
"vitest": "^0.34.1"
},
"dependencies": {
"axios": "^0.21.1",
"qs": "^6.9.4"
}
"contributors": [
"inferrinizzard",
"adamgrieger"
]
}
1 change: 0 additions & 1 deletion prettier.config.js

This file was deleted.

Loading
Loading