UNPKG

@kkbox/kkbox-js-sdk

Version:

KKBOX Open API developer SDK for JavaScript. Use it to easily access KKBOX open API to get various metadata about KKBOX's tracks, albums, artists, playlists and stations.

1,727 lines 77.8 kB
{ "type": "File", "start": 0, "end": 1032, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 32, "column": 1 } }, "program": { "type": "Program", "start": 0, "end": 1032, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 32, "column": 1 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 58, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 58 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 8, "end": 38, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 38 } }, "imported": { "type": "Identifier", "start": 8, "end": 26, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 26 }, "identifierName": "FEATURED_PLAYLISTS" }, "name": "FEATURED_PLAYLISTS" }, "local": { "type": "Identifier", "start": 30, "end": 38, "loc": { "start": { "line": 1, "column": 30 }, "end": { "line": 1, "column": 38 }, "identifierName": "ENDPOINT" }, "name": "ENDPOINT" } } ], "source": { "type": "StringLiteral", "start": 45, "end": 58, "loc": { "start": { "line": 1, "column": 45 }, "end": { "line": 1, "column": 58 } }, "extra": { "rawValue": "../Endpoint", "raw": "'../Endpoint'" }, "value": "../Endpoint" } }, { "type": "ImportDeclaration", "start": 59, "end": 90, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 31 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 66, "end": 73, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 } }, "local": { "type": "Identifier", "start": 66, "end": 73, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 }, "identifierName": "Fetcher" }, "name": "Fetcher" } } ], "source": { "type": "StringLiteral", "start": 79, "end": 90, "loc": { "start": { "line": 2, "column": 20 }, "end": { "line": 2, "column": 31 } }, "extra": { "rawValue": "./Fetcher", "raw": "'./Fetcher'" }, "value": "./Fetcher", "leadingComments": null, "trailingComments": null }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * List all featured playlists.\n * @see https://kkbox.gelato.io/docs/versions/v1.1/resources/featured-playlists\n ", "start": 92, "end": 211, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 212, "end": 1032, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 32, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 227, "end": 1032, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 32, "column": 1 } }, "id": { "type": "Identifier", "start": 233, "end": 256, "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 44 }, "identifierName": "FeaturedPlaylistFetcher" }, "name": "FeaturedPlaylistFetcher", "leadingComments": null }, "superClass": { "type": "Identifier", "start": 265, "end": 272, "loc": { "start": { "line": 8, "column": 53 }, "end": { "line": 8, "column": 60 }, "identifierName": "Fetcher" }, "name": "Fetcher" }, "body": { "type": "ClassBody", "start": 273, "end": 1032, "loc": { "start": { "line": 8, "column": 61 }, "end": { "line": 32, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 310, "end": 384, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 14, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 310, "end": 321, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 15 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 322, "end": 326, "loc": { "start": { "line": 12, "column": 16 }, "end": { "line": 12, "column": 20 }, "identifierName": "http" }, "name": "http" }, { "type": "AssignmentPattern", "start": 328, "end": 344, "loc": { "start": { "line": 12, "column": 22 }, "end": { "line": 12, "column": 38 } }, "left": { "type": "Identifier", "start": 328, "end": 337, "loc": { "start": { "line": 12, "column": 22 }, "end": { "line": 12, "column": 31 }, "identifierName": "territory" }, "name": "territory" }, "right": { "type": "StringLiteral", "start": 340, "end": 344, "loc": { "start": { "line": 12, "column": 34 }, "end": { "line": 12, "column": 38 } }, "extra": { "rawValue": "TW", "raw": "'TW'" }, "value": "TW" } } ], "body": { "type": "BlockStatement", "start": 346, "end": 384, "loc": { "start": { "line": 12, "column": 40 }, "end": { "line": 14, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 356, "end": 378, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 30 } }, "expression": { "type": "CallExpression", "start": 356, "end": 378, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 30 } }, "callee": { "type": "Super", "start": 356, "end": 361, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 13 } } }, "arguments": [ { "type": "Identifier", "start": 362, "end": 366, "loc": { "start": { "line": 13, "column": 14 }, "end": { "line": 13, "column": 18 }, "identifierName": "http" }, "name": "http" }, { "type": "Identifier", "start": 368, "end": 377, "loc": { "start": { "line": 13, "column": 20 }, "end": { "line": 13, "column": 29 }, "identifierName": "territory" }, "name": "territory" } ] } } ], "directives": [], "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 279, "end": 305, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 11, "column": 7 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * Fetch all featured playlists. Result will be paged.\n *\n * @param {number} [limit] - The size for one page.\n * @param {number} [offset] - The offset index for first element.\n * @return {Promise}\n * @example api.featuredPlaylistFetcher.fetchAllFeaturedPlaylists()\n * @see https://kkbox.gelato.io/docs/versions/v1.1/resources/featured-playlists/endpoints/get-featured-playlists\n ", "start": 390, "end": 807, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 24, "column": 7 } } } ] }, { "type": "ClassMethod", "start": 812, "end": 1030, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 31, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 812, "end": 837, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 29 }, "identifierName": "fetchAllFeaturedPlaylists" }, "name": "fetchAllFeaturedPlaylists", "leadingComments": null }, "static": false, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "AssignmentPattern", "start": 838, "end": 855, "loc": { "start": { "line": 25, "column": 30 }, "end": { "line": 25, "column": 47 } }, "left": { "type": "Identifier", "start": 838, "end": 843, "loc": { "start": { "line": 25, "column": 30 }, "end": { "line": 25, "column": 35 }, "identifierName": "limit" }, "name": "limit" }, "right": { "type": "Identifier", "start": 846, "end": 855, "loc": { "start": { "line": 25, "column": 38 }, "end": { "line": 25, "column": 47 }, "identifierName": "undefined" }, "name": "undefined" } }, { "type": "AssignmentPattern", "start": 857, "end": 875, "loc": { "start": { "line": 25, "column": 49 }, "end": { "line": 25, "column": 67 } }, "left": { "type": "Identifier", "start": 857, "end": 863, "loc": { "start": { "line": 25, "column": 49 }, "end": { "line": 25, "column": 55 }, "identifierName": "offset" }, "name": "offset" }, "right": { "type": "Identifier", "start": 866, "end": 875, "loc": { "start": { "line": 25, "column": 58 }, "end": { "line": 25, "column": 67 }, "identifierName": "undefined" }, "name": "undefined" } } ], "body": { "type": "BlockStatement", "start": 877, "end": 1030, "loc": { "start": { "line": 25, "column": 69 }, "end": { "line": 31, "column": 5 } }, "body": [ { "type": "ReturnStatement", "start": 887, "end": 1024, "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 30, "column": 10 } }, "argument": { "type": "CallExpression", "start": 894, "end": 1024, "loc": { "start": { "line": 26, "column": 15 }, "end": { "line": 30, "column": 10 } }, "callee": { "type": "MemberExpression", "start": 894, "end": 907, "loc": { "start": { "line": 26, "column": 15 }, "end": { "line": 26, "column": 28 } }, "object": { "type": "MemberExpression", "start": 894, "end": 903, "loc": { "start": { "line": 26, "column": 15 }, "end": { "line": 26, "column": 24 } }, "object": { "type": "ThisExpression", "start": 894, "end": 898, "loc": { "start": { "line": 26, "column": 15 }, "end": { "line": 26, "column": 19 } } }, "property": { "type": "Identifier", "start": 899, "end": 903, "loc": { "start": { "line": 26, "column": 20 }, "end": { "line": 26, "column": 24 }, "identifierName": "http" }, "name": "http" }, "computed": false }, "property": { "type": "Identifier", "start": 904, "end": 907, "loc": { "start": { "line": 26, "column": 25 }, "end": { "line": 26, "column": 28 }, "identifierName": "get" }, "name": "get" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 908, "end": 916, "loc": { "start": { "line": 26, "column": 29 }, "end": { "line": 26, "column": 37 }, "identifierName": "ENDPOINT" }, "name": "ENDPOINT" }, { "type": "ObjectExpression", "start": 918, "end": 1023, "loc": { "start": { "line": 26, "column": 39 }, "end": { "line": 30, "column": 9 } }, "properties": [ { "type": "ObjectProperty", "start": 932, "end": 944, "loc": { "start": { "line": 27, "column": 12 }, "end": { "line": 27, "column": 24 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 932, "end": 937, "loc": { "start": { "line": 27, "column": 12 }, "end": { "line": 27, "column": 17 }, "identifierName": "limit" }, "name": "limit" }, "value": { "type": "Identifier", "start": 939, "end": 944, "loc": { "start": { "line": 27, "column": 19 }, "end": { "line": 27, "column": 24 }, "identifierName": "limit" }, "name": "limit" } }, { "type": "ObjectProperty", "start": 959, "end": 973, "loc": { "start": { "line": 28, "column": 12 }, "end": { "line": 28, "column": 26 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 959, "end": 965, "loc": { "start": { "line": 28, "column": 12 }, "end": { "line": 28, "column": 18 }, "identifierName": "offset" }, "name": "offset" }, "value": { "type": "Identifier", "start": 967, "end": 973, "loc": { "start": { "line": 28, "column": 20 }, "end": { "line": 28, "column": 26 }, "identifierName": "offset" }, "name": "offset" } }, { "type": "ObjectProperty", "start": 988, "end": 1013, "loc": { "start": { "line": 29, "column": 12 }, "end": { "line": 29, "column": 37 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 988, "end": 997, "loc": { "start": { "line": 29, "column": 12 }, "end": { "line": 29, "column": 21 }, "identifierName": "territory" }, "name": "territory" }, "value": { "type": "MemberExpression", "start": 999, "end": 1013, "loc": { "start": { "line": 29, "column": 23 }, "end": { "line": 29, "column": 37 } }, "object": { "type": "ThisExpression", "start": 999, "end": 1003, "loc": { "start": { "line": 29, "column": 23 }, "end": { "line": 29, "column": 27 } } }, "property": { "type": "Identifier", "start": 1004, "end": 1013, "loc": { "start": { "line": 29, "column": 28 }, "end": { "line": 29, "column": 37 }, "identifierName": "territory" }, "name": "territory" }, "computed": false } } ] } ] } } ], "directives": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * Fetch all featured playlists. Result will be paged.\n *\n * @param {number} [limit] - The size for one page.\n * @param {number} [offset] - The offset index for first element.\n * @return {Promise}\n * @example api.featuredPlaylistFetcher.fetchAllFeaturedPlaylists()\n * @see https://kkbox.gelato.io/docs/versions/v1.1/resources/featured-playlists/endpoints/get-featured-playlists\n ", "start": 390, "end": 807, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 24, "column": 7 } } } ] } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * List all featured playlists.\n * @see https://kkbox.gelato.io/docs/versions/v1.1/resources/featured-playlists\n ", "start": 92, "end": 211, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } } ], "trailingComments": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * List all featured playlists.\n * @see https://kkbox.gelato.io/docs/versions/v1.1/resources/featured-playlists\n ", "start": 92, "end": 211, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } } ] } ], "directives": [] }, "comments": [ { "type": "CommentBlock", "value": "*\n * List all featured playlists.\n * @see https://kkbox.gelato.io/docs/versions/v1.1/resources/featured-playlists\n ", "start": 92, "end": 211, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } }, { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 279, "end": 305, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 11, "column": 7 } } }, { "type": "CommentBlock", "value": "*\n * Fetch all featured playlists. Result will be paged.\n *\n * @param {number} [limit] - The size for one page.\n * @param {number} [offset] - The offset index for first element.\n * @return {Promise}\n * @example api.featuredPlaylistFetcher.fetchAllFeaturedPlaylists()\n * @see https://kkbox.gelato.io/docs/versions/v1.1/resources/featured-playlists/endpoints/get-featured-playlists\n ", "start": 390, "end": 807, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 24, "column": 7 } } } ], "tokens": [ { "type": { "label": "import", "keyword": "import", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "import", "start": 0, "end": 6, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 6 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 7, "end": 8, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 8 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "FEATURED_PLAYLISTS", "start": 8, "end": 26, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 26 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "as", "start": 27, "end": 29, "loc": { "start": { "line": 1, "column": 27 }, "end": { "line": 1, "column": 29 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "ENDPOINT", "start": 30, "end": 38, "loc": { "start": { "line": 1, "column": 30 }, "end": { "line": 1, "column": 38 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 38, "end": 39, "loc": { "start": { "line": 1, "column": 38 }, "end": { "line": 1, "column": 39 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "from", "start": 40, "end": 44, "loc": { "start": { "line": 1, "column": 40 }, "end": { "line": 1, "column": 44 } } }, { "type": { "label": "string", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "../Endpoint", "start": 45, "end": 58, "loc": { "start": { "line": 1, "column": 45 }, "end": { "line": 1, "column": 58 } } }, { "type": { "label": "import", "keyword": "import", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "import", "start": 59, "end": 65, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 6 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "Fetcher", "start": 66, "end": 73, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "from", "start": 74, "end": 78, "loc": { "start": { "line": 2, "column": 15 }, "end": { "line": 2, "column": 19 } } }, { "type": { "label": "string", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "./Fetcher", "start": 79, "end": 90, "loc": { "start": { "line": 2, "column": 20 }, "end": { "line": 2, "column": 31 } } }, { "type": "CommentBlock", "value": "*\n * List all featured playlists.\n * @see https://kkbox.gelato.io/docs/versions/v1.1/resources/featured-playlists\n ", "start": 92, "end": 211, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } }, { "type": { "label": "export", "keyword": "export", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "export", "start": 212, "end": 218, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 6 } } }, { "type": { "label": "default", "keyword": "default", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "default", "start": 219, "end": 226, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 14 } } }, { "type": { "label": "class", "keyword": "class", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "class", "start": 227, "end": 232, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 8, "column": 20 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "FeaturedPlaylistFetcher", "start": 233, "end": 256, "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 44 } } }, { "type": { "label": "extends", "keyword": "extends", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "extends", "start": 257, "end": 264, "loc": { "start": { "line": 8, "column": 45 }, "end": { "line": 8, "column": 52 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "Fetcher", "start": 265, "end": 272, "loc": { "start": { "line": 8, "column": 53 }, "end": { "line": 8, "column": 60 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 273, "end": 274, "loc": { "start": { "line": 8, "column": 61 }, "end": { "line": 8, "column": 62 } } }, { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 279, "end": 305, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 11, "column": 7 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "constructor", "start": 310, "end": 321, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 15 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 321, "end": 322, "loc": { "start": { "line": 12, "column": 15 }, "end": { "line": 12, "column": 16 } } }, { "type": { "label": "name", "beforeExpr": fals