apollo-datasource-spotify
Advanced tools
Comparing version 0.0.12 to 0.0.13
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.batch = void 0; | ||
exports.batch = async ({ size = 50, waitForCallback = true, limit = 50, offset = 0, request, callback, }) => { | ||
const batch = async ({ size = 50, waitForCallback = true, limit = 50, offset = 0, request, callback, }) => { | ||
let pending = limit; | ||
@@ -23,2 +23,3 @@ let params = { | ||
}; | ||
exports.batch = batch; | ||
//# sourceMappingURL=batch.js.map |
@@ -6,3 +6,4 @@ export { SpotifyAPI, Context } from './api'; | ||
export * from './responses'; | ||
export * from './requests'; | ||
export * from './typeDefs'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -10,5 +10,6 @@ "use strict"; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.batch = exports.SpotifyAPI = void 0; | ||
var api_1 = require("./api"); | ||
@@ -21,3 +22,4 @@ Object.defineProperty(exports, "SpotifyAPI", { enumerable: true, get: function () { return api_1.SpotifyAPI; } }); | ||
__exportStar(require("./responses"), exports); | ||
__exportStar(require("./requests"), exports); | ||
__exportStar(require("./typeDefs"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=objects.js.map |
@@ -87,3 +87,6 @@ export declare const resolvers: { | ||
}; | ||
PagingObjectItem: { | ||
__resolveType(object: any): "AlbumObject" | "SimplifiedAlbumObject" | "ArtistObject" | "SimplifiedArtistObject" | "PlaylistObject" | "SimplifiedPlaylistObject" | "TrackObject" | "SimplifiedTrackObject" | "ShowObject" | "SimplifiedShowObject" | "EpisodeObject" | "SimplifiedEpisodeObject" | "PlaylistTrackObject" | "SavedAlbumObject" | "SavedTrackObject" | "SavedEpisodeObject" | "SavedShowObject" | "PlayHistoryObject" | "CategoryObject" | "JSON"; | ||
}; | ||
}; | ||
//# sourceMappingURL=resolvers.d.ts.map |
@@ -248,3 +248,55 @@ "use strict"; | ||
}, | ||
PagingObjectItem: { | ||
__resolveType(object) { | ||
const { type, album, track, episode, show, added_at, added_by, followers, genres, images, popularity, available_markets, copyrights, external_ids, episodes, played_at, icons, name, } = object; | ||
switch (type) { | ||
case 'album': | ||
return available_markets || | ||
copyrights || | ||
external_ids || | ||
genres || | ||
popularity | ||
? 'AlbumObject' | ||
: 'SimplifiedAlbumObject'; | ||
case 'artist': | ||
return followers || genres || images || popularity | ||
? 'ArtistObject' | ||
: 'SimplifiedArtistObject'; | ||
case 'playlist': | ||
return followers ? 'PlaylistObject' : 'SimplifiedPlaylistObject'; | ||
case 'track': | ||
return album || external_ids || popularity | ||
? 'TrackObject' | ||
: 'SimplifiedTrackObject'; | ||
case 'show': | ||
return episodes ? 'ShowObject' : 'SimplifiedShowObject'; | ||
case 'episode': | ||
return show ? 'EpisodeObject' : 'SimplifiedEpisodeObject'; | ||
default: | ||
if (track && added_by) { | ||
return 'PlaylistTrackObject'; | ||
} | ||
if (album && added_at) { | ||
return 'SavedAlbumObject'; | ||
} | ||
if (track && added_at) { | ||
return 'SavedTrackObject'; | ||
} | ||
if (episode && added_at) { | ||
return 'SavedEpisodeObject'; | ||
} | ||
if (show && added_at) { | ||
return 'SavedShowObject'; | ||
} | ||
if (track && played_at) { | ||
return 'PlayHistoryObject'; | ||
} | ||
if (icons && name) { | ||
return 'CategoryObject'; | ||
} | ||
return 'JSON'; | ||
} | ||
}, | ||
}, | ||
}; | ||
//# sourceMappingURL=resolvers.js.map |
@@ -30,3 +30,3 @@ import * as o from './objects'; | ||
message: string; | ||
albums: o.PagingObject & { | ||
playlists: o.PagingObject & { | ||
items: o.SimplifiedPlaylistObject[]; | ||
@@ -37,3 +37,3 @@ }; | ||
message: string; | ||
albums: o.PagingObject & { | ||
categories: o.PagingObject & { | ||
items: o.CategoryObject[]; | ||
@@ -40,0 +40,0 @@ }; |
"use strict"; | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=responses.js.map |
{ | ||
"name": "apollo-datasource-spotify", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "RESTDataSource wrapper for the Spotify API", | ||
@@ -20,3 +20,4 @@ "author": "Jamal Carvalho <jamal.a.carvalho@gmail.com>", | ||
"develop": "tsc -w", | ||
"lint": "eslint . --ext .ts" | ||
"lint": "eslint . --ext .ts", | ||
"test": "NODE_OPTIONS=--experimental-vm-modules jest" | ||
}, | ||
@@ -36,2 +37,12 @@ "husky": { | ||
}, | ||
"jest": { | ||
"preset": "ts-jest/presets/default-esm", | ||
"globals": { | ||
"ts-jest": { | ||
"useESM": true | ||
} | ||
}, | ||
"testEnvironment": "node", | ||
"transform": {} | ||
}, | ||
"bugs": { | ||
@@ -42,2 +53,3 @@ "url": "https://github.com/jamalc/apollo-datasource-spotify/issues" | ||
"@types/jest": "^26.0.23", | ||
"@types/node-fetch": "^2.5.10", | ||
"@typescript-eslint/eslint-plugin": "^4.25.0", | ||
@@ -47,10 +59,15 @@ "@typescript-eslint/parser": "^4.25.0", | ||
"dataloader": "^2.0.0", | ||
"dotenv": "^10.0.0", | ||
"eslint": "^7.27.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-jest": "^24.3.6", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"graphql": "^15.5.0", | ||
"husky": "^4.3.8", | ||
"jest": "^27.0.3", | ||
"lint-staged": "^10.5.4", | ||
"node-fetch": "^2.6.1", | ||
"prettier": "^2.3.0", | ||
"typescript": "^3.9.9" | ||
"ts-jest": "^27.0.1", | ||
"typescript": "^4.3.2" | ||
}, | ||
@@ -57,0 +74,0 @@ "optionalDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
489768
35
7027
19