UNPKG

@eastsideco/escshopify

Version:

WIP JS library for Shopify, containing a variety of useful functionality.

1,559 lines 582 kB
{ "type": "File", "start": 0, "end": 5473, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 188, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 5473, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 188, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 24, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 24 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 11, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 11 } }, "local": { "type": "Identifier", "start": 7, "end": 11, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 11 }, "identifierName": "Evee" }, "name": "Evee" } } ], "source": { "type": "StringLiteral", "start": 17, "end": 23, "loc": { "start": { "line": 1, "column": 17 }, "end": { "line": 1, "column": 23 } }, "extra": { "rawValue": "evee", "raw": "'evee'" }, "value": "evee" } }, { "type": "ImportDeclaration", "start": 25, "end": 59, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 34 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 32, "end": 37, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 } }, "local": { "type": "Identifier", "start": 32, "end": 37, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 }, "identifierName": "Queue" }, "name": "Queue" } } ], "source": { "type": "StringLiteral", "start": 43, "end": 58, "loc": { "start": { "line": 2, "column": 18 }, "end": { "line": 2, "column": 33 } }, "extra": { "rawValue": "promise-queue", "raw": "'promise-queue'" }, "value": "promise-queue" } }, { "type": "ImportDeclaration", "start": 60, "end": 95, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 35 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 67, "end": 76, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 16 } }, "local": { "type": "Identifier", "start": 67, "end": 76, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 16 }, "identifierName": "deepEqual" }, "name": "deepEqual" } } ], "source": { "type": "StringLiteral", "start": 82, "end": 94, "loc": { "start": { "line": 3, "column": 22 }, "end": { "line": 3, "column": 34 } }, "extra": { "rawValue": "deep-equal", "raw": "'deep-equal'" }, "value": "deep-equal" } }, { "type": "ImportDeclaration", "start": 96, "end": 119, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 23 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 103, "end": 104, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 8 } }, "local": { "type": "Identifier", "start": 103, "end": 104, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 8 }, "identifierName": "_" }, "name": "_" } } ], "source": { "type": "StringLiteral", "start": 110, "end": 118, "loc": { "start": { "line": 4, "column": 14 }, "end": { "line": 4, "column": 22 } }, "extra": { "rawValue": "lodash", "raw": "'lodash'" }, "value": "lodash" } }, { "type": "ImportDeclaration", "start": 121, "end": 149, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 28 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 128, "end": 134, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 13 } }, "local": { "type": "Identifier", "start": 128, "end": 134, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 13 }, "identifierName": "config" }, "name": "config" } } ], "source": { "type": "StringLiteral", "start": 140, "end": 148, "loc": { "start": { "line": 6, "column": 19 }, "end": { "line": 6, "column": 27 } }, "extra": { "rawValue": "config", "raw": "'config'" }, "value": "config" } }, { "type": "ImportDeclaration", "start": 150, "end": 172, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 22 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 157, "end": 160, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 10 } }, "local": { "type": "Identifier", "start": 157, "end": 160, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 10 }, "identifierName": "log" }, "name": "log" } } ], "source": { "type": "StringLiteral", "start": 166, "end": 171, "loc": { "start": { "line": 7, "column": 16 }, "end": { "line": 7, "column": 21 } }, "extra": { "rawValue": "log", "raw": "'log'" }, "value": "log" } }, { "type": "VariableDeclaration", "start": 174, "end": 193, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 19 } }, "declarations": [ { "type": "VariableDeclarator", "start": 180, "end": 192, "loc": { "start": { "line": 9, "column": 6 }, "end": { "line": 9, "column": 18 } }, "id": { "type": "Identifier", "start": 180, "end": 183, "loc": { "start": { "line": 9, "column": 6 }, "end": { "line": 9, "column": 9 }, "identifierName": "TAG" }, "name": "TAG" }, "init": { "type": "StringLiteral", "start": 186, "end": 192, "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 18 } }, "extra": { "rawValue": "Shop", "raw": "'Shop'" }, "value": "Shop" } } ], "kind": "const", "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @typedef {Object} ShopifyShop\n * @property {ShopifyAddress} address\n * @property {Number} collections_count\n * @property {String} currency\n * @property {String} description\n * @property {String} domain\n * @property {String} email\n * @property {String[]} enabled_payment_types\n * @property {String} locale\n * @property {String} money_format\n * @property {String} money_format_with_currency\n * @property {String} name\n * @property {String} password_message\n * @property {String} permanent_domain\n * @property {ShopifyPolicy[]} policies\n * @property {String} refund_policy\n * @property {String} secure_url\n * @property {String} terms_of_service\n * @property {String[]} types\n * @property {String} url\n * @property {String[]} vendors\n ", "start": 196, "end": 937, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 34, "column": 3 } } }, { "type": "CommentBlock", "value": "*\n * @typedef {Object} ShopifyAddress\n * @property {String} address1\n * @property {String} address2\n * @property {String} city\n * @property {String|null} company\n * @property {String} country\n * @property {String} country_code\n * @property {String|null} first_name\n * @property {String|null} last_name\n * @property {Number|null} latitude\n * @property {Number|null} longitude\n * @property {String|null} name\n * @property {String|null} phone\n * @property {String|null} province\n * @property {String|null} province_code\n * @property {String|null} zip\n ", "start": 939, "end": 1492, "loc": { "start": { "line": 36, "column": 0 }, "end": { "line": 53, "column": 3 } } }, { "type": "CommentBlock", "value": "*\n * @typedef {Object} ShopifyPolicy\n * @property {String} body\n * @property {String} title\n ", "start": 1494, "end": 1591, "loc": { "start": { "line": 55, "column": 0 }, "end": { "line": 59, "column": 3 } } }, { "type": "CommentBlock", "value": "*\n * Shopify Shop entity.\n * @extends {evee}\n ", "start": 1593, "end": 1643, "loc": { "start": { "line": 61, "column": 0 }, "end": { "line": 64, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 1644, "end": 5471, "loc": { "start": { "line": 65, "column": 0 }, "end": { "line": 186, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 1659, "end": 5471, "loc": { "start": { "line": 65, "column": 15 }, "end": { "line": 186, "column": 1 } }, "id": { "type": "Identifier", "start": 1665, "end": 1669, "loc": { "start": { "line": 65, "column": 21 }, "end": { "line": 65, "column": 25 }, "identifierName": "Shop" }, "name": "Shop", "leadingComments": null }, "superClass": { "type": "Identifier", "start": 1678, "end": 1682, "loc": { "start": { "line": 65, "column": 34 }, "end": { "line": 65, "column": 38 }, "identifierName": "Evee" }, "name": "Evee" }, "body": { "type": "ClassBody", "start": 1683, "end": 5471, "loc": { "start": { "line": 65, "column": 39 }, "end": { "line": 186, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 1757, "end": 3068, "loc": { "start": { "line": 69, "column": 4 }, "end": { "line": 112, "column": 5 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 1757, "end": 1768, "loc": { "start": { "line": 69, "column": 4 }, "end": { "line": 69, "column": 15 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 1771, "end": 3068, "loc": { "start": { "line": 69, "column": 18 }, "end": { "line": 112, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 1781, "end": 1789, "loc": { "start": { "line": 70, "column": 8 }, "end": { "line": 70, "column": 16 } }, "expression": { "type": "CallExpression", "start": 1781, "end": 1788, "loc": { "start": { "line": 70, "column": 8 }, "end": { "line": 70, "column": 15 } }, "callee": { "type": "Super", "start": 1781, "end": 1786, "loc": { "start": { "line": 70, "column": 8 }, "end": { "line": 70, "column": 13 } } }, "arguments": [] }, "trailingComments": [ { "type": "CommentBlock", "value": "* @type {ShopifyAddress} ", "start": 1799, "end": 1828, "loc": { "start": { "line": 72, "column": 8 }, "end": { "line": 72, "column": 37 } } } ] }, { "type": "ExpressionStatement", "start": 1837, "end": 1857, "loc": { "start": { "line": 73, "column": 8 }, "end": { "line": 73, "column": 28 } }, "expression": { "type": "AssignmentExpression", "start": 1837, "end": 1856, "loc": { "start": { "line": 73, "column": 8 }, "end": { "line": 73, "column": 27 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1837, "end": 1849, "loc": { "start": { "line": 73, "column": 8 }, "end": { "line": 73, "column": 20 } }, "object": { "type": "ThisExpression", "start": 1837, "end": 1841, "loc": { "start": { "line": 73, "column": 8 }, "end": { "line": 73, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 1842, "end": 1849, "loc": { "start": { "line": 73, "column": 13 }, "end": { "line": 73, "column": 20 }, "identifierName": "address" }, "name": "address" }, "computed": false, "leadingComments": null }, "right": { "type": "NullLiteral", "start": 1852, "end": 1856, "loc": { "start": { "line": 73, "column": 23 }, "end": { "line": 73, "column": 27 } } }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {ShopifyAddress} ", "start": 1799, "end": 1828, "loc": { "start": { "line": 72, "column": 8 }, "end": { "line": 72, "column": 37 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* @type {Number} ", "start": 1866, "end": 1887, "loc": { "start": { "line": 74, "column": 8 }, "end": { "line": 74, "column": 29 } } } ] }, { "type": "ExpressionStatement", "start": 1896, "end": 1926, "loc": { "start": { "line": 75, "column": 8 }, "end": { "line": 75, "column": 38 } }, "expression": { "type": "AssignmentExpression", "start": 1896, "end": 1925, "loc": { "start": { "line": 75, "column": 8 }, "end": { "line": 75, "column": 37 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1896, "end": 1918, "loc": { "start": { "line": 75, "column": 8 }, "end": { "line": 75, "column": 30 } }, "object": { "type": "ThisExpression", "start": 1896, "end": 1900, "loc": { "start": { "line": 75, "column": 8 }, "end": { "line": 75, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 1901, "end": 1918, "loc": { "start": { "line": 75, "column": 13 }, "end": { "line": 75, "column": 30 }, "identifierName": "collections_count" }, "name": "collections_count" }, "computed": false, "leadingComments": null }, "right": { "type": "NullLiteral", "start": 1921, "end": 1925, "loc": { "start": { "line": 75, "column": 33 }, "end": { "line": 75, "column": 37 } } }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {Number} ", "start": 1866, "end": 1887, "loc": { "start": { "line": 74, "column": 8 }, "end": { "line": 74, "column": 29 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* @type {String} ", "start": 1935, "end": 1956, "loc": { "start": { "line": 76, "column": 8 }, "end": { "line": 76, "column": 29 } } } ] }, { "type": "ExpressionStatement", "start": 1965, "end": 1986, "loc": { "start": { "line": 77, "column": 8 }, "end": { "line": 77, "column": 29 } }, "expression": { "type": "AssignmentExpression", "start": 1965, "end": 1985, "loc": { "start": { "line": 77, "column": 8 }, "end": { "line": 77, "column": 28 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1965, "end": 1978, "loc": { "start": { "line": 77, "column": 8 }, "end": { "line": 77, "column": 21 } }, "object": { "type": "ThisExpression", "start": 1965, "end": 1969, "loc": { "start": { "line": 77, "column": 8 }, "end": { "line": 77, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 1970, "end": 1978, "loc": { "start": { "line": 77, "column": 13 }, "end": { "line": 77, "column": 21 }, "identifierName": "currency" }, "name": "currency" }, "computed": false, "leadingComments": null }, "right": { "type": "NullLiteral", "start": 1981, "end": 1985, "loc": { "start": { "line": 77, "column": 24 }, "end": { "line": 77, "column": 28 } } }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {String} ", "start": 1935, "end": 1956, "loc": { "start": { "line": 76, "column": 8 }, "end": { "line": 76, "column": 29 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* @type {String} ", "start": 1995, "end": 2016, "loc": { "start": { "line": 78, "column": 8 }, "end": { "line": 78, "column": 29 } } } ] }, { "type": "ExpressionStatement", "start": 2025, "end": 2049, "loc": { "start": { "line": 79, "column": 8 }, "end": { "line": 79, "column": 32 } }, "expression": { "type": "AssignmentExpression", "start": 2025, "end": 2048, "loc": { "start": { "line": 79, "column": 8 }, "end": { "line": 79, "column": 31 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2025, "end": 2041, "loc": { "start": { "line": 79, "column": 8 }, "end": { "line": 79, "column": 24 } }, "object": { "type": "ThisExpression", "start": 2025, "end": 2029, "loc": { "start": { "line": 79, "column": 8 }, "end": { "line": 79, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2030, "end": 2041, "loc": { "start": { "line": 79, "column": 13 }, "end": { "line": 79, "column": 24 }, "identifierName": "description" }, "name": "description" }, "computed": false, "leadingComments": null }, "right": { "type": "NullLiteral", "start": 2044, "end": 2048, "loc": { "start": { "line": 79, "column": 27 }, "end": { "line": 79, "column": 31 } } }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {String} ", "start": 1995, "end": 2016, "loc": { "start": { "line": 78, "column": 8 }, "end": { "line": 78, "column": 29 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* @type {String} ", "start": 2058, "end": 2079, "loc": { "start": { "line": 80, "column": 8 }, "end": { "line": 80, "column": 29 } } } ] }, { "type": "ExpressionStatement", "start": 2088, "end": 2107, "loc": { "start": { "line": 81, "column": 8 }, "end": { "line": 81, "column": 27 } }, "expression": { "type": "AssignmentExpression", "start": 2088, "end": 2106, "loc": { "start": { "line": 81, "column": 8 }, "end": { "line": 81, "column": 26 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2088, "end": 2099, "loc": { "start": { "line": 81, "column": 8 }, "end": { "line": 81, "column": 19 } }, "object": { "type": "ThisExpression", "start": 2088, "end": 2092, "loc": { "start": { "line": 81, "column": 8 }, "end": { "line": 81, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2093, "end": 2099, "loc": { "start": { "line": 81, "column": 13 }, "end": { "line": 81, "column": 19 }, "identifierName": "domain" }, "name": "domain" }, "computed": false, "leadingComments": null }, "right": { "type": "NullLiteral", "start": 2102, "end": 2106, "loc": { "start": { "line": 81, "column": 22 }, "end": { "line": 81, "column": 26 } } }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {String} ", "start": 2058, "end": 2079, "loc": { "start": { "line": 80, "column": 8 }, "end": { "line": 80, "column": 29 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* @type {String} ", "start": 2116, "end": 2137, "loc": { "start": { "line": 82, "column": 8 }, "end": { "line": 82, "column": 29 } } } ] }, { "type": "ExpressionStatement", "start": 2146, "end": 2164, "loc": { "start": { "line": 83, "column": 8 }, "end": { "line": 83, "column": 26 } }, "expression": { "type": "AssignmentExpression", "start": 2146, "end": 2163, "loc": { "start": { "line": 83, "column": 8 }, "end": { "line": 83, "column": 25 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2146, "end": 2156, "loc": { "start": { "line": 83, "column": 8 }, "end": { "line": 83, "column": 18 } }, "object": { "type": "ThisExpression", "start": 2146, "end": 2150, "loc": { "start": { "line": 83, "column": 8 }, "end": { "line": 83, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2151, "end": 2156, "loc": { "start": { "line": 83, "column": 13 }, "end": { "line": 83, "column": 18 }, "identifierName": "email" }, "name": "email" }, "computed": false, "leadingComments": null }, "right": { "type": "NullLiteral", "start": 2159, "end": 2163, "loc": { "start": { "line": 83, "column": 21 }, "end": { "line": 83, "column": 25 } } }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {String} ", "start": 2116, "end": 2137, "loc": { "start": { "line": 82, "column": 8 }, "end": { "line": 82, "column": 29 } } } ], "trailingComments": [ { "type": "Com