├── .gitignore ├── README.md ├── gatsby-node.js ├── helpers └── index.js ├── output-color.js ├── package-lock.json ├── package.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # Project dependencies 2 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 3 | node_modules 4 | .cache/ 5 | # Build directory 6 | public/ 7 | static/admin/*.bundle.* 8 | .DS_Store 9 | yarn-error.log 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gatsby-source-woocommerce 2 | 3 | Source plugin for [Gatsby](https://www.gatsbyjs.org/). Pulls in data from protected routes via the [WooCommerce REST API](http://woocommerce.github.io/woocommerce-rest-api-docs/) with credentials. 4 | 5 | ## Install 6 | 7 | `npm i --save @massivdash/gatsby-source-woocommerce ` 8 | 9 | ## How to Use 10 | 11 | ```javascript 12 | // In gatsby-config.js 13 | plugins:[ 14 | { 15 | resolve: "@massivdash/gatsby-source-woocommerce", 16 | options: { 17 | // Base URL of Wordpress site 18 | api: 'wordpress.domain', 19 | 20 | // This counts controls the API get with ?per_page= 21 | // default: 10 22 | itemCount: 20, 23 | 24 | // set to true to see fetch output in console, during build 25 | // default: false 26 | verbose: true, 27 | 28 | // true if using https. false if nah. 29 | https: false, 30 | api_keys: { 31 | consumer_key: , 32 | consumer_secret: , 33 | }, 34 | // Array of strings with fields you'd like to create nodes for... 35 | fields: ['products'] 36 | } 37 | } 38 | ] 39 | ``` 40 | 41 | ## Currently Supported Fields 42 | 43 | - Products 44 | - Customers 45 | - Orders 46 | - Reports 47 | - Coupons 48 | 49 | 50 | ### FORK 51 | 52 | This is fork from https://registry.npmjs.org/gatsby-source-woocommerce/ 53 | 54 | 55 | 56 | ![spaceghost](https://blog.spaceout.pl/content/images/2018/11/spaceghost-1.jpg) 57 | 58 | ### @SPACEGHOST 59 | https://spaceout.pl 60 | 61 | 62 | 03.03. 2019 63 | Added support for page pagination via ?per_page= request for displaying more than 10 products in a single call. 64 | 65 | 09.03.2019 66 | Added verbose output to console for details while fetching nodes. 67 | Updated packages 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /gatsby-node.js: -------------------------------------------------------------------------------- 1 | const WooCommerceAPI = require('woocommerce-api'); 2 | const { processNode } = require('./helpers'); 3 | const colorized = require(`./output-color`); 4 | 5 | exports.sourceNodes = async ( 6 | { boundActionCreators, createNodeId }, 7 | configOptions 8 | ) => { 9 | const { createNode } = boundActionCreators; 10 | delete configOptions.plugins; 11 | 12 | const { api, https, api_keys, fields, itemCount, verbose } = configOptions; 13 | 14 | // set up WooCommerce node api tool 15 | const WooCommerce = new WooCommerceAPI({ 16 | url: `http${https?'s':''}://${api}`, 17 | consumerKey: api_keys.consumer_key, 18 | consumerSecret: api_keys.consumer_secret, 19 | wpAPI: true, 20 | version: 'wc/v1', 21 | }); 22 | 23 | 24 | 25 | // Fetch Node and turn our response to JSON 26 | const fetchNodes = async (fieldName) => { 27 | 28 | let pag = `${fieldName}?per_page=${itemCount}` 29 | if (itemCount === null || typeof itemCount === 'undefined') { 30 | pag = fieldName 31 | } 32 | const res = await WooCommerce.getAsync(pag); 33 | return JSON.parse(res.toJSON().body); 34 | }; 35 | 36 | // Loop over each field set in configOptions and process/create nodes 37 | async function fetchNodesAndCreate (array) { 38 | 39 | for (const field of array) { 40 | const nodes = await fetchNodes(field); 41 | if (verbose) { 42 | console.log(colorized.out(` 43 | ============== WOO FETCHING ===================================== 44 | 45 | ITEMS FOUND: ${nodes.length} FOR FIELD: ${field} 46 | 47 | 48 | `, colorized.color.Font.FgMagenta)); 49 | } 50 | nodes.forEach(n=>createNode(processNode(createNodeId, n, field, verbose))); 51 | if (verbose) { 52 | console.log(colorized.out(` 53 | ============== WOO FETCHING ENDED ============================== 54 | `, colorized.color.Font.FgMagenta)); 55 | } 56 | } 57 | } 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | // Leh go... 66 | await fetchNodesAndCreate(fields); 67 | return; 68 | }; 69 | -------------------------------------------------------------------------------- /helpers/index.js: -------------------------------------------------------------------------------- 1 | const crypto = require("crypto"); 2 | const colorized = require(`../output-color`); 3 | 4 | const processNode = (createNodeId, node, fieldName, verbose) => { 5 | const nodeId = createNodeId(`woocommerce-${fieldName}-${node.id}`) 6 | const nodeContent = JSON.stringify(node); 7 | const nodeContentDigest = crypto 8 | .createHash('md5') 9 | .update(nodeContent) 10 | .digest('hex') 11 | 12 | const nodeData = Object.assign({}, node, { 13 | id: nodeId, 14 | parent: null, 15 | children: [], 16 | internal: { 17 | type: `WC${capitalize(fieldName)}`, 18 | content: nodeContent, 19 | contentDigest: nodeContentDigest, 20 | }, 21 | }) 22 | if(verbose) { 23 | 24 | if(fieldName === 'products'){ 25 | console.log(colorized.out(` 26 | GATSBY NODE ID: ${nodeId} 27 | IMPORTING PRODUCT: ${node.id}, ${node.name} 28 | VARIATIONS: ${node.variations.length} 29 | `, colorized.color.Font.FgMagenta)); 30 | } 31 | else { 32 | console.log(colorized.out(` 33 | GATSBY NODE ID: ${nodeId} 34 | NODE WOO RESPONSE: ${nodeContent} 35 | `, colorized.color.Font.FgMagenta)); 36 | } 37 | 38 | 39 | 40 | } 41 | 42 | return nodeData 43 | }; 44 | 45 | module.exports = { processNode }; 46 | 47 | // Helper Helpers 48 | function capitalize(s){ 49 | return s[0].toUpperCase() + s.slice(1); 50 | } 51 | -------------------------------------------------------------------------------- /output-color.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | /** 4 | * Colorize the output 5 | * 6 | * @param {any} msg 7 | * @param {any} c 8 | */ 9 | const out = (msg, c) => `${c}${msg}${color.Reset}`; 10 | 11 | const color = { 12 | Reset: `\x1b[0m`, 13 | Effect: { 14 | Bright: `\x1b[1m`, 15 | Dim: `\x1b[2m`, 16 | Underscore: `\x1b[4m`, 17 | Blink: `\x1b[5m`, 18 | Reverse: `\x1b[7m`, 19 | Hidden: `\x1b[8m` 20 | }, 21 | Font: { 22 | FgBlack: `\x1b[30m`, 23 | FgRed: `\x1b[31m`, 24 | FgGreen: `\x1b[32m`, 25 | FgYellow: `\x1b[33m`, 26 | FgBlue: `\x1b[34m`, 27 | FgMagenta: `\x1b[35m`, 28 | FgCyan: `\x1b[36m`, 29 | FgWhite: `\x1b[37m` 30 | }, 31 | Back: { 32 | BgBlack: `\x1b[40m`, 33 | BgRed: `\x1b[41m`, 34 | BgGreen: `\x1b[42m`, 35 | BgYellow: `\x1b[43m`, 36 | BgBlue: `\x1b[44m`, 37 | BgMagenta: `\x1b[45m`, 38 | BgCyan: `\x1b[46m`, 39 | BgWhite: `\x1b[47m` 40 | } 41 | }; 42 | const colorized = { 43 | out, 44 | color 45 | }; 46 | module.exports = colorized; -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@massivdash/gatsby-source-woocommerce", 3 | "version": "0.2.3", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "ajv": { 8 | "version": "6.10.0", 9 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", 10 | "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", 11 | "requires": { 12 | "fast-deep-equal": "^2.0.1", 13 | "fast-json-stable-stringify": "^2.0.0", 14 | "json-schema-traverse": "^0.4.1", 15 | "uri-js": "^4.2.2" 16 | } 17 | }, 18 | "asn1": { 19 | "version": "0.2.4", 20 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", 21 | "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", 22 | "requires": { 23 | "safer-buffer": "~2.1.0" 24 | } 25 | }, 26 | "assert-plus": { 27 | "version": "1.0.0", 28 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 29 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 30 | }, 31 | "asynckit": { 32 | "version": "0.4.0", 33 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 34 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 35 | }, 36 | "aws-sign2": { 37 | "version": "0.7.0", 38 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", 39 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" 40 | }, 41 | "aws4": { 42 | "version": "1.8.0", 43 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", 44 | "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" 45 | }, 46 | "bcrypt-pbkdf": { 47 | "version": "1.0.2", 48 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", 49 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", 50 | "requires": { 51 | "tweetnacl": "^0.14.3" 52 | } 53 | }, 54 | "bluebird": { 55 | "version": "3.5.3", 56 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", 57 | "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==" 58 | }, 59 | "caseless": { 60 | "version": "0.12.0", 61 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", 62 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 63 | }, 64 | "combined-stream": { 65 | "version": "1.0.7", 66 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", 67 | "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", 68 | "requires": { 69 | "delayed-stream": "~1.0.0" 70 | } 71 | }, 72 | "core-util-is": { 73 | "version": "1.0.2", 74 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 75 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 76 | }, 77 | "dashdash": { 78 | "version": "1.14.1", 79 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", 80 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 81 | "requires": { 82 | "assert-plus": "^1.0.0" 83 | } 84 | }, 85 | "delayed-stream": { 86 | "version": "1.0.0", 87 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 88 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 89 | }, 90 | "ecc-jsbn": { 91 | "version": "0.1.2", 92 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", 93 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", 94 | "requires": { 95 | "jsbn": "~0.1.0", 96 | "safer-buffer": "^2.1.0" 97 | } 98 | }, 99 | "extend": { 100 | "version": "3.0.2", 101 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 102 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 103 | }, 104 | "extsprintf": { 105 | "version": "1.3.0", 106 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", 107 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" 108 | }, 109 | "fast-deep-equal": { 110 | "version": "2.0.1", 111 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", 112 | "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" 113 | }, 114 | "fast-json-stable-stringify": { 115 | "version": "2.0.0", 116 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", 117 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" 118 | }, 119 | "forever-agent": { 120 | "version": "0.6.1", 121 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 122 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 123 | }, 124 | "form-data": { 125 | "version": "2.3.3", 126 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", 127 | "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", 128 | "requires": { 129 | "asynckit": "^0.4.0", 130 | "combined-stream": "^1.0.6", 131 | "mime-types": "^2.1.12" 132 | } 133 | }, 134 | "getpass": { 135 | "version": "0.1.7", 136 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 137 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 138 | "requires": { 139 | "assert-plus": "^1.0.0" 140 | } 141 | }, 142 | "har-schema": { 143 | "version": "2.0.0", 144 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", 145 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" 146 | }, 147 | "har-validator": { 148 | "version": "5.1.3", 149 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", 150 | "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", 151 | "requires": { 152 | "ajv": "^6.5.5", 153 | "har-schema": "^2.0.0" 154 | } 155 | }, 156 | "http-signature": { 157 | "version": "1.2.0", 158 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", 159 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 160 | "requires": { 161 | "assert-plus": "^1.0.0", 162 | "jsprim": "^1.2.2", 163 | "sshpk": "^1.7.0" 164 | } 165 | }, 166 | "is-typedarray": { 167 | "version": "1.0.0", 168 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 169 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 170 | }, 171 | "isstream": { 172 | "version": "0.1.2", 173 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 174 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 175 | }, 176 | "jsbn": { 177 | "version": "0.1.1", 178 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 179 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" 180 | }, 181 | "json-schema": { 182 | "version": "0.2.3", 183 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", 184 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 185 | }, 186 | "json-schema-traverse": { 187 | "version": "0.4.1", 188 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 189 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" 190 | }, 191 | "json-stringify-safe": { 192 | "version": "5.0.1", 193 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 194 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 195 | }, 196 | "jsprim": { 197 | "version": "1.4.1", 198 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", 199 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", 200 | "requires": { 201 | "assert-plus": "1.0.0", 202 | "extsprintf": "1.3.0", 203 | "json-schema": "0.2.3", 204 | "verror": "1.10.0" 205 | } 206 | }, 207 | "mime-db": { 208 | "version": "1.38.0", 209 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", 210 | "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" 211 | }, 212 | "mime-types": { 213 | "version": "2.1.22", 214 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", 215 | "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", 216 | "requires": { 217 | "mime-db": "~1.38.0" 218 | } 219 | }, 220 | "oauth-1.0a": { 221 | "version": "2.2.5", 222 | "resolved": "https://registry.npmjs.org/oauth-1.0a/-/oauth-1.0a-2.2.5.tgz", 223 | "integrity": "sha512-7Y4Gs+2dPOjrlJDzEPdpuH46gzgYeVF7CKOOQNpWKz1nlbWn2rqKSt3oF0By6KxudbOQATEUY74SphuTN0grPg==" 224 | }, 225 | "oauth-sign": { 226 | "version": "0.9.0", 227 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", 228 | "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" 229 | }, 230 | "performance-now": { 231 | "version": "2.1.0", 232 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", 233 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 234 | }, 235 | "psl": { 236 | "version": "1.1.31", 237 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", 238 | "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" 239 | }, 240 | "punycode": { 241 | "version": "2.1.1", 242 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 243 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" 244 | }, 245 | "qs": { 246 | "version": "6.5.2", 247 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", 248 | "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" 249 | }, 250 | "request": { 251 | "version": "2.88.0", 252 | "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", 253 | "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", 254 | "requires": { 255 | "aws-sign2": "~0.7.0", 256 | "aws4": "^1.8.0", 257 | "caseless": "~0.12.0", 258 | "combined-stream": "~1.0.6", 259 | "extend": "~3.0.2", 260 | "forever-agent": "~0.6.1", 261 | "form-data": "~2.3.2", 262 | "har-validator": "~5.1.0", 263 | "http-signature": "~1.2.0", 264 | "is-typedarray": "~1.0.0", 265 | "isstream": "~0.1.2", 266 | "json-stringify-safe": "~5.0.1", 267 | "mime-types": "~2.1.19", 268 | "oauth-sign": "~0.9.0", 269 | "performance-now": "^2.1.0", 270 | "qs": "~6.5.2", 271 | "safe-buffer": "^5.1.2", 272 | "tough-cookie": "~2.4.3", 273 | "tunnel-agent": "^0.6.0", 274 | "uuid": "^3.3.2" 275 | } 276 | }, 277 | "safe-buffer": { 278 | "version": "5.1.2", 279 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 280 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 281 | }, 282 | "safer-buffer": { 283 | "version": "2.1.2", 284 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 285 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 286 | }, 287 | "sshpk": { 288 | "version": "1.16.1", 289 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", 290 | "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", 291 | "requires": { 292 | "asn1": "~0.2.3", 293 | "assert-plus": "^1.0.0", 294 | "bcrypt-pbkdf": "^1.0.0", 295 | "dashdash": "^1.12.0", 296 | "ecc-jsbn": "~0.1.1", 297 | "getpass": "^0.1.1", 298 | "jsbn": "~0.1.0", 299 | "safer-buffer": "^2.0.2", 300 | "tweetnacl": "~0.14.0" 301 | } 302 | }, 303 | "tough-cookie": { 304 | "version": "2.4.3", 305 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", 306 | "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", 307 | "requires": { 308 | "psl": "^1.1.24", 309 | "punycode": "^1.4.1" 310 | }, 311 | "dependencies": { 312 | "punycode": { 313 | "version": "1.4.1", 314 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 315 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" 316 | } 317 | } 318 | }, 319 | "tunnel-agent": { 320 | "version": "0.6.0", 321 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 322 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 323 | "requires": { 324 | "safe-buffer": "^5.0.1" 325 | } 326 | }, 327 | "tweetnacl": { 328 | "version": "0.14.5", 329 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 330 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" 331 | }, 332 | "uri-js": { 333 | "version": "4.2.2", 334 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", 335 | "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", 336 | "requires": { 337 | "punycode": "^2.1.0" 338 | } 339 | }, 340 | "uuid": { 341 | "version": "3.3.2", 342 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 343 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" 344 | }, 345 | "verror": { 346 | "version": "1.10.0", 347 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", 348 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 349 | "requires": { 350 | "assert-plus": "^1.0.0", 351 | "core-util-is": "1.0.2", 352 | "extsprintf": "^1.2.0" 353 | } 354 | }, 355 | "woocommerce-api": { 356 | "version": "1.4.2", 357 | "resolved": "https://registry.npmjs.org/woocommerce-api/-/woocommerce-api-1.4.2.tgz", 358 | "integrity": "sha1-/fe5Hip+EQjqAHxQ4qexPRJ1xAw=", 359 | "requires": { 360 | "bluebird": "^3.4.6", 361 | "oauth-1.0a": "^2.0.0", 362 | "request": "^2.75.0" 363 | } 364 | } 365 | } 366 | } 367 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Łukasz Celitan, Forked from Marc Aaron Glasser" 4 | }, 5 | "_requiredBy": [ 6 | "/" 7 | ], 8 | "bundleDependencies": false, 9 | "dependencies": { 10 | "woocommerce-api": "^1.4.2" 11 | }, 12 | "deprecated": false, 13 | "description": "Gatsby source plugin for WooCommerce", 14 | "license": "ISC", 15 | "repository": "https://github.com/MassivDash/gatsby-source-woocommerce", 16 | "main": "gatsby-node.js", 17 | "name": "@massivdash/gatsby-source-woocommerce", 18 | "scripts": { 19 | "test": "echo \"Error: no test specified\" && exit 1" 20 | }, 21 | "version": "0.2.4", 22 | "keywords": [ 23 | "gatsby", 24 | "gatsby-plugin", 25 | "gatsby-source-plugin", 26 | "woocommerce", 27 | "wordpress", 28 | "gatsbyjs" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | ajv@^5.3.0: 6 | version "5.5.2" 7 | resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" 8 | dependencies: 9 | co "^4.6.0" 10 | fast-deep-equal "^1.0.0" 11 | fast-json-stable-stringify "^2.0.0" 12 | json-schema-traverse "^0.3.0" 13 | 14 | asn1@~0.2.3: 15 | version "0.2.4" 16 | resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" 17 | dependencies: 18 | safer-buffer "~2.1.0" 19 | 20 | assert-plus@1.0.0, assert-plus@^1.0.0: 21 | version "1.0.0" 22 | resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" 23 | 24 | asynckit@^0.4.0: 25 | version "0.4.0" 26 | resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" 27 | 28 | aws-sign2@~0.7.0: 29 | version "0.7.0" 30 | resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" 31 | 32 | aws4@^1.8.0: 33 | version "1.8.0" 34 | resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" 35 | 36 | bcrypt-pbkdf@^1.0.0: 37 | version "1.0.2" 38 | resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" 39 | dependencies: 40 | tweetnacl "^0.14.3" 41 | 42 | bluebird@^3.4.6: 43 | version "3.5.1" 44 | resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" 45 | 46 | caseless@~0.12.0: 47 | version "0.12.0" 48 | resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" 49 | 50 | co@^4.6.0: 51 | version "4.6.0" 52 | resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" 53 | 54 | combined-stream@1.0.6, combined-stream@~1.0.6: 55 | version "1.0.6" 56 | resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" 57 | dependencies: 58 | delayed-stream "~1.0.0" 59 | 60 | core-util-is@1.0.2: 61 | version "1.0.2" 62 | resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" 63 | 64 | dashdash@^1.12.0: 65 | version "1.14.1" 66 | resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" 67 | dependencies: 68 | assert-plus "^1.0.0" 69 | 70 | decode-uri-component@^0.2.0: 71 | version "0.2.0" 72 | resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" 73 | 74 | delayed-stream@~1.0.0: 75 | version "1.0.0" 76 | resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" 77 | 78 | ecc-jsbn@~0.1.1: 79 | version "0.1.2" 80 | resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" 81 | dependencies: 82 | jsbn "~0.1.0" 83 | safer-buffer "^2.1.0" 84 | 85 | extend@~3.0.2: 86 | version "3.0.2" 87 | resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" 88 | 89 | extsprintf@1.3.0: 90 | version "1.3.0" 91 | resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" 92 | 93 | extsprintf@^1.2.0: 94 | version "1.4.0" 95 | resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" 96 | 97 | fast-deep-equal@^1.0.0: 98 | version "1.1.0" 99 | resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" 100 | 101 | fast-json-stable-stringify@^2.0.0: 102 | version "2.0.0" 103 | resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" 104 | 105 | forever-agent@~0.6.1: 106 | version "0.6.1" 107 | resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" 108 | 109 | form-data@~2.3.2: 110 | version "2.3.2" 111 | resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" 112 | dependencies: 113 | asynckit "^0.4.0" 114 | combined-stream "1.0.6" 115 | mime-types "^2.1.12" 116 | 117 | getpass@^0.1.1: 118 | version "0.1.7" 119 | resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" 120 | dependencies: 121 | assert-plus "^1.0.0" 122 | 123 | har-schema@^2.0.0: 124 | version "2.0.0" 125 | resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" 126 | 127 | har-validator@~5.1.0: 128 | version "5.1.0" 129 | resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" 130 | dependencies: 131 | ajv "^5.3.0" 132 | har-schema "^2.0.0" 133 | 134 | http-signature@~1.2.0: 135 | version "1.2.0" 136 | resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" 137 | dependencies: 138 | assert-plus "^1.0.0" 139 | jsprim "^1.2.2" 140 | sshpk "^1.7.0" 141 | 142 | is-typedarray@~1.0.0: 143 | version "1.0.0" 144 | resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" 145 | 146 | isstream@~0.1.2: 147 | version "0.1.2" 148 | resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" 149 | 150 | jsbn@~0.1.0: 151 | version "0.1.1" 152 | resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" 153 | 154 | json-schema-traverse@^0.3.0: 155 | version "0.3.1" 156 | resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" 157 | 158 | json-schema@0.2.3: 159 | version "0.2.3" 160 | resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" 161 | 162 | json-stringify-safe@~5.0.1: 163 | version "5.0.1" 164 | resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" 165 | 166 | jsprim@^1.2.2: 167 | version "1.4.1" 168 | resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" 169 | dependencies: 170 | assert-plus "1.0.0" 171 | extsprintf "1.3.0" 172 | json-schema "0.2.3" 173 | verror "1.10.0" 174 | 175 | mime-db@~1.35.0: 176 | version "1.35.0" 177 | resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47" 178 | 179 | mime-types@^2.1.12, mime-types@~2.1.19: 180 | version "2.1.19" 181 | resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0" 182 | dependencies: 183 | mime-db "~1.35.0" 184 | 185 | node-fetch@^2.2.0: 186 | version "2.2.0" 187 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.2.0.tgz#4ee79bde909262f9775f731e3656d0db55ced5b5" 188 | 189 | oauth-1.0a@^2.0.0: 190 | version "2.2.4" 191 | resolved "https://registry.yarnpkg.com/oauth-1.0a/-/oauth-1.0a-2.2.4.tgz#5b0caf0de64516bd7b0f480377adba254bf24ac2" 192 | 193 | oauth-sign@~0.9.0: 194 | version "0.9.0" 195 | resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" 196 | 197 | performance-now@^2.1.0: 198 | version "2.1.0" 199 | resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" 200 | 201 | psl@^1.1.24: 202 | version "1.1.29" 203 | resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" 204 | 205 | punycode@^1.4.1: 206 | version "1.4.1" 207 | resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" 208 | 209 | qs@~6.5.2: 210 | version "6.5.2" 211 | resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" 212 | 213 | query-string@^6.1.0: 214 | version "6.1.0" 215 | resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.1.0.tgz#01e7d69f6a0940dac67a937d6c6325647aa4532a" 216 | dependencies: 217 | decode-uri-component "^0.2.0" 218 | strict-uri-encode "^2.0.0" 219 | 220 | request@^2.75.0: 221 | version "2.88.0" 222 | resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" 223 | dependencies: 224 | aws-sign2 "~0.7.0" 225 | aws4 "^1.8.0" 226 | caseless "~0.12.0" 227 | combined-stream "~1.0.6" 228 | extend "~3.0.2" 229 | forever-agent "~0.6.1" 230 | form-data "~2.3.2" 231 | har-validator "~5.1.0" 232 | http-signature "~1.2.0" 233 | is-typedarray "~1.0.0" 234 | isstream "~0.1.2" 235 | json-stringify-safe "~5.0.1" 236 | mime-types "~2.1.19" 237 | oauth-sign "~0.9.0" 238 | performance-now "^2.1.0" 239 | qs "~6.5.2" 240 | safe-buffer "^5.1.2" 241 | tough-cookie "~2.4.3" 242 | tunnel-agent "^0.6.0" 243 | uuid "^3.3.2" 244 | 245 | safe-buffer@^5.0.1, safe-buffer@^5.1.2: 246 | version "5.1.2" 247 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" 248 | 249 | safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: 250 | version "2.1.2" 251 | resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" 252 | 253 | sshpk@^1.7.0: 254 | version "1.14.2" 255 | resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98" 256 | dependencies: 257 | asn1 "~0.2.3" 258 | assert-plus "^1.0.0" 259 | dashdash "^1.12.0" 260 | getpass "^0.1.1" 261 | safer-buffer "^2.0.2" 262 | optionalDependencies: 263 | bcrypt-pbkdf "^1.0.0" 264 | ecc-jsbn "~0.1.1" 265 | jsbn "~0.1.0" 266 | tweetnacl "~0.14.0" 267 | 268 | strict-uri-encode@^2.0.0: 269 | version "2.0.0" 270 | resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" 271 | 272 | tough-cookie@~2.4.3: 273 | version "2.4.3" 274 | resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" 275 | dependencies: 276 | psl "^1.1.24" 277 | punycode "^1.4.1" 278 | 279 | tunnel-agent@^0.6.0: 280 | version "0.6.0" 281 | resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" 282 | dependencies: 283 | safe-buffer "^5.0.1" 284 | 285 | tweetnacl@^0.14.3, tweetnacl@~0.14.0: 286 | version "0.14.5" 287 | resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" 288 | 289 | uuid@^3.3.2: 290 | version "3.3.2" 291 | resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" 292 | 293 | verror@1.10.0: 294 | version "1.10.0" 295 | resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" 296 | dependencies: 297 | assert-plus "^1.0.0" 298 | core-util-is "1.0.2" 299 | extsprintf "^1.2.0" 300 | 301 | woocommerce-api@^1.4.2: 302 | version "1.4.2" 303 | resolved "https://registry.yarnpkg.com/woocommerce-api/-/woocommerce-api-1.4.2.tgz#fdf7b91e2a7e1108ea007c50e2a7b13d1275c40c" 304 | dependencies: 305 | bluebird "^3.4.6" 306 | oauth-1.0a "^2.0.0" 307 | request "^2.75.0" 308 | --------------------------------------------------------------------------------