@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,222 lines (1,221 loc) • 128 kB
JSON
{
"type": "File",
"start": 0,
"end": 778,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 31,
"column": 1
}
},
"program": {
"type": "Program",
"start": 0,
"end": 778,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 31,
"column": 1
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 35
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 17
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 17
},
"identifierName": "nodemailer"
},
"name": "nodemailer"
}
}
],
"source": {
"type": "StringLiteral",
"start": 23,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 35
}
},
"extra": {
"rawValue": "nodemailer",
"raw": "'nodemailer'"
},
"value": "nodemailer"
}
},
{
"type": "ImportDeclaration",
"start": 36,
"end": 74,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 38
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 44,
"end": 50,
"loc": {
"start": {
"line": 2,
"column": 8
},
"end": {
"line": 2,
"column": 14
}
},
"imported": {
"type": "Identifier",
"start": 44,
"end": 50,
"loc": {
"start": {
"line": 2,
"column": 8
},
"end": {
"line": 2,
"column": 14
},
"identifierName": "mailTo"
},
"name": "mailTo"
},
"local": {
"type": "Identifier",
"start": 44,
"end": 50,
"loc": {
"start": {
"line": 2,
"column": 8
},
"end": {
"line": 2,
"column": 14
},
"identifierName": "mailTo"
},
"name": "mailTo"
}
}
],
"source": {
"type": "StringLiteral",
"start": 57,
"end": 74,
"loc": {
"start": {
"line": 2,
"column": 21
},
"end": {
"line": 2,
"column": 38
}
},
"extra": {
"rawValue": "../package.json",
"raw": "'../package.json'"
},
"value": "../package.json",
"leadingComments": null,
"trailingComments": null
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 76,
"end": 94,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 6,
"column": 3
}
}
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 95,
"end": 778,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 31,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 110,
"end": 778,
"loc": {
"start": {
"line": 7,
"column": 15
},
"end": {
"line": 31,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 116,
"end": 122,
"loc": {
"start": {
"line": 7,
"column": 21
},
"end": {
"line": 7,
"column": 27
},
"identifierName": "Mailer"
},
"name": "Mailer",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 123,
"end": 778,
"loc": {
"start": {
"line": 7,
"column": 28
},
"end": {
"line": 31,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 129,
"end": 271,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 13,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 129,
"end": 140,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 143,
"end": 271,
"loc": {
"start": {
"line": 8,
"column": 18
},
"end": {
"line": 13,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 153,
"end": 265,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 12,
"column": 10
}
},
"expression": {
"type": "AssignmentExpression",
"start": 153,
"end": 265,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 12,
"column": 10
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 153,
"end": 169,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 24
}
},
"object": {
"type": "ThisExpression",
"start": 153,
"end": 157,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 158,
"end": 169,
"loc": {
"start": {
"line": 9,
"column": 13
},
"end": {
"line": 9,
"column": 24
},
"identifierName": "transporter"
},
"name": "transporter"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 172,
"end": 265,
"loc": {
"start": {
"line": 9,
"column": 27
},
"end": {
"line": 12,
"column": 10
}
},
"callee": {
"type": "MemberExpression",
"start": 172,
"end": 198,
"loc": {
"start": {
"line": 9,
"column": 27
},
"end": {
"line": 9,
"column": 53
}
},
"object": {
"type": "Identifier",
"start": 172,
"end": 182,
"loc": {
"start": {
"line": 9,
"column": 27
},
"end": {
"line": 9,
"column": 37
},
"identifierName": "nodemailer"
},
"name": "nodemailer"
},
"property": {
"type": "Identifier",
"start": 183,
"end": 198,
"loc": {
"start": {
"line": 9,
"column": 38
},
"end": {
"line": 9,
"column": 53
},
"identifierName": "createTransport"
},
"name": "createTransport"
},
"computed": false
},
"arguments": [
{
"type": "ObjectExpression",
"start": 199,
"end": 264,
"loc": {
"start": {
"line": 9,
"column": 54
},
"end": {
"line": 12,
"column": 9
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 213,
"end": 232,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 31
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 213,
"end": 217,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 16
},
"identifierName": "host"
},
"name": "host"
},
"value": {
"type": "StringLiteral",
"start": 219,
"end": 232,
"loc": {
"start": {
"line": 10,
"column": 18
},
"end": {
"line": 10,
"column": 31
}
},
"extra": {
"rawValue": "10.255.0.14",
"raw": "'10.255.0.14'"
},
"value": "10.255.0.14"
}
},
{
"type": "ObjectProperty",
"start": 246,
"end": 254,
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 20
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 246,
"end": 250,
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 16
},
"identifierName": "port"
},
"name": "port"
},
"value": {
"type": "NumericLiteral",
"start": 252,
"end": 254,
"loc": {
"start": {
"line": 11,
"column": 18
},
"end": {
"line": 11,
"column": 20
}
},
"extra": {
"rawValue": 25,
"raw": "25"
},
"value": 25
}
}
]
}
]
}
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 277,
"end": 776,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 30,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 277,
"end": 281,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 8
},
"identifierName": "send"
},
"name": "send"
},
"static": false,
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 282,
"end": 289,
"loc": {
"start": {
"line": 15,
"column": 9
},
"end": {
"line": 15,
"column": 16
},
"identifierName": "subject"
},
"name": "subject"
},
{
"type": "Identifier",
"start": 291,
"end": 298,
"loc": {
"start": {
"line": 15,
"column": 18
},
"end": {
"line": 15,
"column": 25
},
"identifierName": "message"
},
"name": "message"
}
],
"body": {
"type": "BlockStatement",
"start": 300,
"end": 776,
"loc": {
"start": {
"line": 15,
"column": 27
},
"end": {
"line": 30,
"column": 5
}
},
"body": [
{
"type": "ReturnStatement",
"start": 310,
"end": 770,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 29,
"column": 10
}
},
"argument": {
"type": "NewExpression",
"start": 317,
"end": 770,
"loc": {
"start": {
"line": 16,
"column": 15
},
"end": {
"line": 29,
"column": 10
}
},
"callee": {
"type": "Identifier",
"start": 321,
"end": 328,
"loc": {
"start": {
"line": 16,
"column": 19
},
"end": {
"line": 16,
"column": 26
},
"identifierName": "Promise"
},
"name": "Promise"
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 329,
"end": 769,
"loc": {
"start": {
"line": 16,
"column": 27
},
"end": {
"line": 29,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 330,
"end": 337,
"loc": {
"start": {
"line": 16,
"column": 28
},
"end": {
"line": 16,
"column": 35
},
"identifierName": "resolve"
},
"name": "resolve"
},
{
"type": "Identifier",
"start": 339,
"end": 345,
"loc": {
"start": {
"line": 16,
"column": 37
},
"end": {
"line": 16,
"column": 43
},
"identifierName": "reject"
},
"name": "reject"
}
],
"body": {
"type": "BlockStatement",
"start": 350,
"end": 769,
"loc": {
"start": {
"line": 16,
"column": 48
},
"end": {
"line": 29,
"column": 9
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 364,
"end": 759,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 28,
"column": 14
}
},
"expression": {
"type": "CallExpression",
"start": 364,
"end": 759,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 28,
"column": 14
}
},
"callee": {
"type": "MemberExpression",
"start": 364,
"end": 389,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 37
}
},
"object": {
"type": "MemberExpression",
"start": 364,
"end": 380,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 28
}
},
"object": {
"type": "ThisExpression",
"start": 364,
"end": 368,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 16
}
}
},
"property": {
"type": "Identifier",
"start": 369,
"end": 380,
"loc": {
"start": {
"line": 17,
"column": 17
},
"end": {
"line": 17,
"column": 28
},
"identifierName": "transporter"
},
"name": "transporter"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 381,
"end": 389,
"loc": {
"start": {
"line": 17,
"column": 29
},
"end": {
"line": 17,
"column": 37
},
"identifierName": "sendMail"
},
"name": "sendMail"
},
"computed": false
},
"arguments": [
{
"type": "ObjectExpression",
"start": 390,
"end": 567,
"loc": {
"start": {
"line": 17,
"column": 38
},
"end": {
"line": 22,
"column": 13
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 408,
"end": 460,
"loc": {
"start": {
"line": 18,
"column": 16
},
"end": {
"line": 18,
"column": 68
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 408,
"end": 412,
"loc": {
"start": {
"line": 18,
"column": 16
},
"end": {
"line": 18,
"column": 20
},
"identifierName": "from"
},
"name": "from"
},
"value": {
"type": "StringLiteral",
"start": 414,
"end": 460,
"loc": {
"start": {
"line": 18,
"column": 22
},
"end": {
"line": 18,
"column": 68
}
},
"extra": {
"rawValue": "\"Open API Status\" <openapi#status@kkbox.com>",
"raw": "'\"Open API Status\" <openapi#status@kkbox.com>'"
},
"value": "\"Open API Status\" <openapi#status@kkbox.com>"
}
},
{
"type": "ObjectProperty",
"start": 478,
"end": 488,
"loc": {
"start": {
"line": 19,
"column": 16
},
"end": {
"line": 19,
"column": 26
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 478,
"end": 480,
"loc": {
"start": {
"line": 19,
"column": 16
},
"end": {
"line": 19,
"column": 18
},
"identifierName": "to"
},
"name": "to"
},
"value": {
"type": "Identifier",
"start": 482,
"end": 488,
"loc": {
"start": {
"line": 19,
"column": 20
},
"end": {
"line": 19,
"column": 26
},
"identifierName": "mailTo"
},
"name": "mailTo"
}
},
{
"type": "ObjectProperty",
"start": 506,
"end": 522,
"loc": {
"start": {
"line": 20,
"column": 16
},
"end": {
"line": 20,
"column": 32
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 506,
"end": 513,
"loc": {
"start": {
"line": 20,
"column": 16
},
"end": {
"line": 20,
"column": 23
},
"identifierName": "subject"
},
"name": "subject"
},
"value": {
"type": "Identifier",
"start": 515,
"end": 522,
"loc": {
"start": {
"line": 20,
"column": 25
},
"end": {
"line": 20,
"column": 32
},
"identifierName": "subject"
},
"name": "subject"
}
},
{
"type": "ObjectProperty",
"start": 540,
"end": 553,
"loc": {
"start": {
"line": 21,
"column": 16
},
"end": {
"line": 21,
"column": 29
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 540,
"end": 544,
"loc": {
"start": {
"line": 21,
"column": 16
},
"end": {
"line": 21,
"column": 20
},
"identifierName": "text"
},
"name": "text"
},
"value": {
"type": "Identifier",
"start": 546,
"end": 553,
"loc": {
"start": {
"line": 21,
"column": 22
},
"end": {
"line": 21,
"column": 29
},
"identifierName": "message"
},
"name": "message"
}
}
]
},
{
"type": "ArrowFunctionExpression",
"start": 569,
"end": 758,
"loc": {
"start": {
"line": 22,
"column": 15
},
"end": {
"line": 28,
"column": 13
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 570,
"end": 575,
"loc": {
"start": {
"line": 22,
"column": 16
},
"end": {
"line": 22,
"column": 21
},
"identifierName": "error"
},
"name": "error"
},
{
"type": "Identifier",
"start": 577,
"end": 581,
"loc": {
"start": {
"line": 22,
"column": 23
},
"end": {
"line": 22,
"column": 27
},
"identifierName": "info"
},
"name": "info"
}
],
"body": {
"type": "BlockStatement",
"start": 586,
"end": 758,
"loc": {
"start": {
"line": 22,
"column": 32
},
"end": {
"line": 28,
"column": 13
}
},
"body": [
{
"type": "IfStatement",
"start": 604,
"end": 714,
"loc": {
"start": {
"line": 23,
"column": 16
},
"end": {
"line": 26,
"column": 17