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,740 lines 79.5 kB
{ "type": "File", "start": 0, "end": 922, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 33, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 922, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 33, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 61, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 61 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 9, "end": 39, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 39 } }, "imported": { "type": "Identifier", "start": 9, "end": 27, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 27 }, "identifierName": "FEATURED_PLAYLISTS" }, "name": "FEATURED_PLAYLISTS" }, "local": { "type": "Identifier", "start": 31, "end": 39, "loc": { "start": { "line": 1, "column": 31 }, "end": { "line": 1, "column": 39 }, "identifierName": "ENDPOINT" }, "name": "ENDPOINT" } } ], "source": { "type": "StringLiteral", "start": 47, "end": 60, "loc": { "start": { "line": 1, "column": 47 }, "end": { "line": 1, "column": 60 } }, "extra": { "rawValue": "../Endpoint", "raw": "'../Endpoint'" }, "value": "../Endpoint" } }, { "type": "ImportDeclaration", "start": 62, "end": 94, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 32 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 69, "end": 76, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 } }, "local": { "type": "Identifier", "start": 69, "end": 76, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 }, "identifierName": "Fetcher" }, "name": "Fetcher" } } ], "source": { "type": "StringLiteral", "start": 82, "end": 93, "loc": { "start": { "line": 2, "column": 20 }, "end": { "line": 2, "column": 31 } }, "extra": { "rawValue": "./Fetcher", "raw": "'./Fetcher'" }, "value": "./Fetcher" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * List all featured playlists.\n * @see https://docs-en.kkbox.codes/v1.1/reference#featured-playlists\n ", "start": 96, "end": 205, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 206, "end": 921, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 32, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 221, "end": 921, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 32, "column": 1 } }, "id": { "type": "Identifier", "start": 227, "end": 250, "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 44 }, "identifierName": "FeaturedPlaylistFetcher" }, "name": "FeaturedPlaylistFetcher", "leadingComments": null }, "superClass": { "type": "Identifier", "start": 259, "end": 266, "loc": { "start": { "line": 8, "column": 53 }, "end": { "line": 8, "column": 60 }, "identifierName": "Fetcher" }, "name": "Fetcher" }, "body": { "type": "ClassBody", "start": 267, "end": 921, "loc": { "start": { "line": 8, "column": 61 }, "end": { "line": 32, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 296, "end": 365, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 14, "column": 3 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 296, "end": 307, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 13 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 308, "end": 312, "loc": { "start": { "line": 12, "column": 14 }, "end": { "line": 12, "column": 18 }, "identifierName": "http" }, "name": "http" }, { "type": "AssignmentPattern", "start": 314, "end": 330, "loc": { "start": { "line": 12, "column": 20 }, "end": { "line": 12, "column": 36 } }, "left": { "type": "Identifier", "start": 314, "end": 323, "loc": { "start": { "line": 12, "column": 20 }, "end": { "line": 12, "column": 29 }, "identifierName": "territory" }, "name": "territory" }, "right": { "type": "StringLiteral", "start": 326, "end": 330, "loc": { "start": { "line": 12, "column": 32 }, "end": { "line": 12, "column": 36 } }, "extra": { "rawValue": "TW", "raw": "'TW'" }, "value": "TW" } } ], "body": { "type": "BlockStatement", "start": 332, "end": 365, "loc": { "start": { "line": 12, "column": 38 }, "end": { "line": 14, "column": 3 } }, "body": [ { "type": "ExpressionStatement", "start": 338, "end": 361, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 27 } }, "expression": { "type": "CallExpression", "start": 338, "end": 360, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 26 } }, "callee": { "type": "Super", "start": 338, "end": 343, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 9 } } }, "arguments": [ { "type": "Identifier", "start": 344, "end": 348, "loc": { "start": { "line": 13, "column": 10 }, "end": { "line": 13, "column": 14 }, "identifierName": "http" }, "name": "http" }, { "type": "Identifier", "start": 350, "end": 359, "loc": { "start": { "line": 13, "column": 16 }, "end": { "line": 13, "column": 25 }, "identifierName": "territory" }, "name": "territory" } ] } } ], "directives": [], "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 271, "end": 293, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 11, "column": 5 } } } ], "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://docs-en.kkbox.codes/v1.1/reference#featuredplaylists\n ", "start": 369, "end": 727, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 24, "column": 5 } } } ] }, { "type": "ClassMethod", "start": 730, "end": 919, "loc": { "start": { "line": 25, "column": 2 }, "end": { "line": 31, "column": 3 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 730, "end": 755, "loc": { "start": { "line": 25, "column": 2 }, "end": { "line": 25, "column": 27 }, "identifierName": "fetchAllFeaturedPlaylists" }, "name": "fetchAllFeaturedPlaylists", "leadingComments": null }, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "AssignmentPattern", "start": 756, "end": 773, "loc": { "start": { "line": 25, "column": 28 }, "end": { "line": 25, "column": 45 } }, "left": { "type": "Identifier", "start": 756, "end": 761, "loc": { "start": { "line": 25, "column": 28 }, "end": { "line": 25, "column": 33 }, "identifierName": "limit" }, "name": "limit" }, "right": { "type": "Identifier", "start": 764, "end": 773, "loc": { "start": { "line": 25, "column": 36 }, "end": { "line": 25, "column": 45 }, "identifierName": "undefined" }, "name": "undefined" } }, { "type": "AssignmentPattern", "start": 775, "end": 793, "loc": { "start": { "line": 25, "column": 47 }, "end": { "line": 25, "column": 65 } }, "left": { "type": "Identifier", "start": 775, "end": 781, "loc": { "start": { "line": 25, "column": 47 }, "end": { "line": 25, "column": 53 }, "identifierName": "offset" }, "name": "offset" }, "right": { "type": "Identifier", "start": 784, "end": 793, "loc": { "start": { "line": 25, "column": 56 }, "end": { "line": 25, "column": 65 }, "identifierName": "undefined" }, "name": "undefined" } } ], "body": { "type": "BlockStatement", "start": 795, "end": 919, "loc": { "start": { "line": 25, "column": 67 }, "end": { "line": 31, "column": 3 } }, "body": [ { "type": "ReturnStatement", "start": 801, "end": 915, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 30, "column": 7 } }, "argument": { "type": "CallExpression", "start": 808, "end": 914, "loc": { "start": { "line": 26, "column": 11 }, "end": { "line": 30, "column": 6 } }, "callee": { "type": "MemberExpression", "start": 808, "end": 821, "loc": { "start": { "line": 26, "column": 11 }, "end": { "line": 26, "column": 24 } }, "object": { "type": "MemberExpression", "start": 808, "end": 817, "loc": { "start": { "line": 26, "column": 11 }, "end": { "line": 26, "column": 20 } }, "object": { "type": "ThisExpression", "start": 808, "end": 812, "loc": { "start": { "line": 26, "column": 11 }, "end": { "line": 26, "column": 15 } } }, "property": { "type": "Identifier", "start": 813, "end": 817, "loc": { "start": { "line": 26, "column": 16 }, "end": { "line": 26, "column": 20 }, "identifierName": "http" }, "name": "http" }, "computed": false }, "property": { "type": "Identifier", "start": 818, "end": 821, "loc": { "start": { "line": 26, "column": 21 }, "end": { "line": 26, "column": 24 }, "identifierName": "get" }, "name": "get" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 822, "end": 830, "loc": { "start": { "line": 26, "column": 25 }, "end": { "line": 26, "column": 33 }, "identifierName": "ENDPOINT" }, "name": "ENDPOINT" }, { "type": "ObjectExpression", "start": 832, "end": 913, "loc": { "start": { "line": 26, "column": 35 }, "end": { "line": 30, "column": 5 } }, "properties": [ { "type": "ObjectProperty", "start": 840, "end": 852, "loc": { "start": { "line": 27, "column": 6 }, "end": { "line": 27, "column": 18 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 840, "end": 845, "loc": { "start": { "line": 27, "column": 6 }, "end": { "line": 27, "column": 11 }, "identifierName": "limit" }, "name": "limit" }, "value": { "type": "Identifier", "start": 847, "end": 852, "loc": { "start": { "line": 27, "column": 13 }, "end": { "line": 27, "column": 18 }, "identifierName": "limit" }, "name": "limit" } }, { "type": "ObjectProperty", "start": 860, "end": 874, "loc": { "start": { "line": 28, "column": 6 }, "end": { "line": 28, "column": 20 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 860, "end": 866, "loc": { "start": { "line": 28, "column": 6 }, "end": { "line": 28, "column": 12 }, "identifierName": "offset" }, "name": "offset" }, "value": { "type": "Identifier", "start": 868, "end": 874, "loc": { "start": { "line": 28, "column": 14 }, "end": { "line": 28, "column": 20 }, "identifierName": "offset" }, "name": "offset" } }, { "type": "ObjectProperty", "start": 882, "end": 907, "loc": { "start": { "line": 29, "column": 6 }, "end": { "line": 29, "column": 31 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 882, "end": 891, "loc": { "start": { "line": 29, "column": 6 }, "end": { "line": 29, "column": 15 }, "identifierName": "territory" }, "name": "territory" }, "value": { "type": "MemberExpression", "start": 893, "end": 907, "loc": { "start": { "line": 29, "column": 17 }, "end": { "line": 29, "column": 31 } }, "object": { "type": "ThisExpression", "start": 893, "end": 897, "loc": { "start": { "line": 29, "column": 17 }, "end": { "line": 29, "column": 21 } } }, "property": { "type": "Identifier", "start": 898, "end": 907, "loc": { "start": { "line": 29, "column": 22 }, "end": { "line": 29, "column": 31 }, "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://docs-en.kkbox.codes/v1.1/reference#featuredplaylists\n ", "start": 369, "end": 727, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 24, "column": 5 } } } ] } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * List all featured playlists.\n * @see https://docs-en.kkbox.codes/v1.1/reference#featured-playlists\n ", "start": 96, "end": 205, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } } ], "trailingComments": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * List all featured playlists.\n * @see https://docs-en.kkbox.codes/v1.1/reference#featured-playlists\n ", "start": 96, "end": 205, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } } ] } ], "directives": [] }, "comments": [ { "type": "CommentBlock", "value": "*\n * List all featured playlists.\n * @see https://docs-en.kkbox.codes/v1.1/reference#featured-playlists\n ", "start": 96, "end": 205, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } }, { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 271, "end": 293, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 11, "column": 5 } } }, { "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://docs-en.kkbox.codes/v1.1/reference#featuredplaylists\n ", "start": 369, "end": 727, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 24, "column": 5 } } } ], "tokens": [ { "type": { "label": "import", "keyword": "import", "beforeExpr": false, "startsExpr": true, "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": 9, "end": 27, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 27 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "as", "start": 28, "end": 30, "loc": { "start": { "line": 1, "column": 28 }, "end": { "line": 1, "column": 30 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "ENDPOINT", "start": 31, "end": 39, "loc": { "start": { "line": 1, "column": 31 }, "end": { "line": 1, "column": 39 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 40, "end": 41, "loc": { "start": { "line": 1, "column": 40 }, "end": { "line": 1, "column": 41 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "from", "start": 42, "end": 46, "loc": { "start": { "line": 1, "column": 42 }, "end": { "line": 1, "column": 46 } } }, { "type": { "label": "string", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "../Endpoint", "start": 47, "end": 60, "loc": { "start": { "line": 1, "column": 47 }, "end": { "line": 1, "column": 60 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 60, "end": 61, "loc": { "start": { "line": 1, "column": 60 }, "end": { "line": 1, "column": 61 } } }, { "type": { "label": "import", "keyword": "import", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "import", "start": 62, "end": 68, "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": 69, "end": 76, "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": 77, "end": 81, "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": 82, "end": 93, "loc": { "start": { "line": 2, "column": 20 }, "end": { "line": 2, "column": 31 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 93, "end": 94, "loc": { "start": { "line": 2, "column": 31 }, "end": { "line": 2, "column": 32 } } }, { "type": "CommentBlock", "value": "*\n * List all featured playlists.\n * @see https://docs-en.kkbox.codes/v1.1/reference#featured-playlists\n ", "start": 96, "end": 205, "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": 206, "end": 212, "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": 213, "end": 220, "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": 221, "end": 226, "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": 227, "end": 250, "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": 251, "end": 258, "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": 259, "end": 266, "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": 267, "end": 268, "loc": { "start": { "line": 8, "column": 61 }, "end": { "line": 8, "column": 62 } } }, { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 271, "end": 293, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 11, "column": 5 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "constructor", "start": 296, "end": 307, "loc": { "start": { "