├── .github └── CODEOWNERS ├── .gitignore ├── .prettierrc ├── LICENSE.md ├── README.md ├── misc ├── apollo-server │ ├── README.md │ ├── index.js │ ├── package.json │ └── yarn.lock └── cli-app │ ├── README.md │ ├── index.js │ ├── package.json │ └── yarn.lock ├── renovate.json ├── storefronts ├── express │ ├── README.md │ ├── index.js │ ├── package.json │ ├── views │ │ ├── index.pug │ │ └── product.pug │ └── yarn.lock └── nextjs │ ├── .gitignore │ ├── README.md │ ├── lib │ └── moltin.js │ ├── package.json │ ├── pages │ ├── index.js │ └── product.js │ └── yarn.lock └── webhooks ├── order-confirmation-email ├── README.md ├── index.js ├── package.json └── yarn.lock ├── order-confirmation-sms ├── README.md ├── index.js ├── package.json └── yarn.lock ├── shipping-confirmation-email ├── README.md ├── index.js ├── package.json └── yarn.lock ├── shipping-confirmation-sms ├── README.md ├── index.js ├── package.json └── yarn.lock ├── short-order-id ├── README.md ├── index.js ├── package.json └── yarn.lock ├── sync-catalog-to-algolia ├── README.md ├── index.js ├── package.json └── yarn.lock └── sync-orders-to-big-query ├── README.md ├── bq-helper.js ├── decrypt-helper.js ├── index.js ├── mapping.js ├── package.json ├── serverless.yml └── yarn.lock /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # dotenv environment variables file 55 | .env 56 | 57 | # gatsby files 58 | .cache/ 59 | public 60 | 61 | # Next files 62 | /out 63 | 64 | # Mac files 65 | .DS_Store 66 | 67 | # Yarn 68 | yarn-error.log 69 | .pnp/ 70 | .pnp.js 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # Serverless 76 | .serverless 77 | 78 | # Dependencies 79 | localStorage 80 | vendor -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "semi": false, 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Moltin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Moltin Examples 2 | 3 | [](https://spectrum.chat/moltin) 4 | 5 | Here you will find example demo stores and serverless functions that can be used with [Moltin webhooks](https://docs.moltin.com/advanced/events). Pick an example and follow the `README` for usage instructions. 6 | 7 | **They are not to be treated as production-ready.** 8 | 9 | ## Storefronts 10 | 11 | Discover how to connect popular frontend frameworks and static site generators with Moltin. 12 | 13 | | Example | Demo | Description | 14 | | ------------------------------- | ------------- | ------------------------------ | 15 | | [Next.js](/storefronts/nextjs) | _Coming soon_ | An example store using Next.js | 16 | | [Express](/storefronts/express) | _Coming soon_ | An example store using Express | 17 | 18 | ## Webhooks (aka "integrations") 19 | 20 | Integrate with Moltin using 3rd party services with AWS Lambda, Zeit Now, Netlify Functions & more. [Learn more](https://docs.moltin.com/api/advanced/events). 21 | 22 | | Example | SDK | Description | 23 | | ------------------------------------------------------------------------ | ------------------------------------------------------------- | ------------------------------------------------------------- | 24 | | [Order Confirmation via Email](/webhooks/order-confirmation-email) | [`@moltin/request`](https://github.com/moltin/moltin-request) | Order confirmation email with Postmark. | 25 | | [Order Confirmation via SMS](/webhooks/order-confirmation-sms) | [`@moltin/request`](https://github.com/moltin/moltin-request) | Order confirmation SMS via Twilio. | 26 | | [Shipping Confirmation via Email](/webhooks/shipping-confirmation-email) | [`@moltin/request`](https://github.com/moltin/moltin-request) | Shipping confirmation email with Postmark. | 27 | | [Shipping Confirmation via SMS](/webhooks/shipping-confirmation-sms) | [`@moltin/request`](https://github.com/moltin/moltin-request) | Shipping confirmation SMS via Twilio. | 28 | | [Short Order ID](/webhooks/short-order-id) | [`@moltin/request`](https://github.com/moltin/moltin-request) | Assign a short random ID to new orders. | 29 | | [Sync catalog to Algolia](/webhooks/sync-catalog-to-algolia) | [`@moltin/request`](https://github.com/moltin/moltin-request) | Sync products, brands, categories and collections to Algolia. | 30 | | [Sync Orders to BigQuery](/webhooks/sync-orders-to-big-query) | [`@moltin/request`](https://github.com/moltin/moltin-request) | Sync order + order items to Google BigQuery. | 31 | 32 | ## Misc 33 | 34 | | Example | Demo | Description | 35 | | ------------------------------------ | ------------- | ------------------------------------- | 36 | | [Apollo Server](/misc/apollo-server) | _Coming soon_ | An example GraphQL server with Moltin | 37 | | [CLI](/misc/cli-app) | _N/A_ | An example CLI that queries products | 38 | 39 | ## Reference applications 40 | 41 | If you're looking for more real world examples using Moltin, check out any of the following examples: 42 | 43 | | Example | Description | 44 | | ----------------------------------------------------------------- | ---------------------------------------------- | 45 | | [Gatsby Demo Store](https://github.com/moltin/gatsby-demo-store) | Built using the `gatsby-source-moltin` plugin. | 46 | | [Next.js Demo Store](https://github.com/moltin/nextjs-demo-store) | React supercharged with Next.js + Moltin | 47 | | [Vue Demo Store](https://github.com/moltin/vue-demo-store) | Plain old Vue + Moltin | 48 | -------------------------------------------------------------------------------- /misc/apollo-server/README.md: -------------------------------------------------------------------------------- 1 | # Moltin + Apollo Server 2 | 3 | You can run this example by cloning the repo, installing the dependencies with `yarn install`, running `yarn start` and then going to [`http://localhost:4000`](http://localhost:4000) where you will be able to run a basic Product Query. 4 | -------------------------------------------------------------------------------- /misc/apollo-server/index.js: -------------------------------------------------------------------------------- 1 | const { ApolloServer, gql } = require('apollo-server') 2 | const { MoltinClient } = require('@moltin/request') 3 | 4 | const moltin = new MoltinClient({ 5 | client_id: 'h93GLWVTdw3EUd9ev7g8Z7ROq54s5JVAzivz9ZrIe1' 6 | }) 7 | 8 | const typeDefs = gql` 9 | type Query { 10 | products: [Product] 11 | } 12 | 13 | type Product { 14 | id: ID 15 | name: String 16 | slug: String 17 | description: String 18 | price: [ProductPrice] 19 | } 20 | 21 | type ProductPrice { 22 | amount: Int 23 | currency: String 24 | includes_tax: Boolean 25 | } 26 | ` 27 | 28 | const resolvers = { 29 | Query: { 30 | products: async (_, args, { moltin }) => { 31 | const { data: products } = await moltin.get('products') 32 | 33 | return products 34 | } 35 | } 36 | } 37 | 38 | const server = new ApolloServer({ 39 | typeDefs, 40 | resolvers, 41 | context: { 42 | moltin 43 | } 44 | }) 45 | 46 | server.listen().then(({ url }) => console.log(`🚀 Server ready at ${url}`)) 47 | -------------------------------------------------------------------------------- /misc/apollo-server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "node index.js" 5 | }, 6 | "dependencies": { 7 | "@moltin/request": "latest", 8 | "apollo-server": "latest", 9 | "graphql": "latest" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /misc/cli-app/README.md: -------------------------------------------------------------------------------- 1 | # Moltin + CLI 2 | 3 | You can run this example by cloning the repo, installing the dependencies with `yarn install`, running `node index.js` and executing an available command. 4 | -------------------------------------------------------------------------------- /misc/cli-app/index.js: -------------------------------------------------------------------------------- 1 | const meow = require('meow') 2 | const { MoltinClient } = require('@moltin/request') 3 | const ora = require('ora') 4 | 5 | const moltin = new MoltinClient({ 6 | client_id: 'h93GLWVTdw3EUd9ev7g8Z7ROq54s5JVAzivz9ZrIe1' 7 | }) 8 | 9 | const cli = meow( 10 | ` 11 | Usage 12 | $ moltin [command] 13 | 14 | Examples 15 | $ moltin products 16 | $ moltin categories 17 | $ moltin brands 18 | ` 19 | ) 20 | 21 | async function main(cli) { 22 | const [command] = cli.input 23 | 24 | const spinner = ora().start() 25 | 26 | switch (command) { 27 | case 'products': 28 | const { data: products } = await moltin.get('products') 29 | return spinner.succeed(JSON.stringify(products)) 30 | 31 | case 'categories': 32 | const { data: categories } = await moltin.get('categories') 33 | return spinner.succeed(JSON.stringify(categories)) 34 | 35 | case 'brands': 36 | const { data: brands } = await moltin.get('brands') 37 | return spinner.succeed(JSON.stringify(brands)) 38 | 39 | default: 40 | spinner.fail('no valid command specified') 41 | return cli.showHelp() 42 | } 43 | } 44 | 45 | main(cli).catch(console.error) 46 | -------------------------------------------------------------------------------- /misc/cli-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "bin": { 4 | "moltin": "index.js" 5 | }, 6 | "scripts": { 7 | "cli": "node index.js" 8 | }, 9 | "dependencies": { 10 | "@moltin/request": "latest", 11 | "meow": "latest", 12 | "ora": "latest" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /misc/cli-app/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@moltin/request@latest": 6 | version "1.6.0" 7 | resolved "https://registry.yarnpkg.com/@moltin/request/-/request-1.6.0.tgz#5eea1954add2cc9553d15d512341389dd15ec016" 8 | integrity sha512-xgAfoiysAc7S48hYRNjPOptL0Xrw4tkfjveO1hgcIy9Q+XPbcW+NcWYvM8LQbRnQMMMs6Uzg0qoh2f/0LR9tBg== 9 | dependencies: 10 | cross-fetch "3.0.2" 11 | 12 | ansi-regex@^4.1.0: 13 | version "4.1.0" 14 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" 15 | integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== 16 | 17 | ansi-styles@^3.2.1: 18 | version "3.2.1" 19 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" 20 | integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== 21 | dependencies: 22 | color-convert "^1.9.0" 23 | 24 | array-find-index@^1.0.1: 25 | version "1.0.2" 26 | resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" 27 | integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= 28 | 29 | arrify@^1.0.1: 30 | version "1.0.1" 31 | resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" 32 | integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= 33 | 34 | builtin-modules@^1.0.0: 35 | version "1.1.1" 36 | resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" 37 | integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= 38 | 39 | camelcase-keys@^4.0.0: 40 | version "4.2.0" 41 | resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-4.2.0.tgz#a2aa5fb1af688758259c32c141426d78923b9b77" 42 | integrity sha1-oqpfsa9oh1glnDLBQUJteJI7m3c= 43 | dependencies: 44 | camelcase "^4.1.0" 45 | map-obj "^2.0.0" 46 | quick-lru "^1.0.0" 47 | 48 | camelcase@^4.1.0: 49 | version "4.1.0" 50 | resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" 51 | integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= 52 | 53 | chalk@^2.0.1: 54 | version "2.4.1" 55 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" 56 | integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== 57 | dependencies: 58 | ansi-styles "^3.2.1" 59 | escape-string-regexp "^1.0.5" 60 | supports-color "^5.3.0" 61 | 62 | chalk@^2.4.2: 63 | version "2.4.2" 64 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" 65 | integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== 66 | dependencies: 67 | ansi-styles "^3.2.1" 68 | escape-string-regexp "^1.0.5" 69 | supports-color "^5.3.0" 70 | 71 | cli-cursor@^2.1.0: 72 | version "2.1.0" 73 | resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" 74 | integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= 75 | dependencies: 76 | restore-cursor "^2.0.0" 77 | 78 | cli-spinners@^2.0.0: 79 | version "2.1.0" 80 | resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.1.0.tgz#22c34b4d51f573240885b201efda4e4ec9fff3c7" 81 | integrity sha512-8B00fJOEh1HPrx4fo5eW16XmE1PcL1tGpGrxy63CXGP9nHdPBN63X75hA1zhvQuhVztJWLqV58Roj2qlNM7cAA== 82 | 83 | clone@^1.0.2: 84 | version "1.0.4" 85 | resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" 86 | integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= 87 | 88 | color-convert@^1.9.0: 89 | version "1.9.3" 90 | resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" 91 | integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== 92 | dependencies: 93 | color-name "1.1.3" 94 | 95 | color-name@1.1.3: 96 | version "1.1.3" 97 | resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" 98 | integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= 99 | 100 | cross-fetch@3.0.2: 101 | version "3.0.2" 102 | resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.2.tgz#b7136491967031949c7f86b15903aef4fa3f1768" 103 | integrity sha512-a4Z0EJ5Nck6QtMy9ZqloLfpvu2uMV3sBfMCR+CgSBCZc6z5KR4bfEiD3dkepH8iZgJMXQpTqf8FjMmvu/GMFkg== 104 | dependencies: 105 | node-fetch "2.3.0" 106 | whatwg-fetch "3.0.0" 107 | 108 | currently-unhandled@^0.4.1: 109 | version "0.4.1" 110 | resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" 111 | integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= 112 | dependencies: 113 | array-find-index "^1.0.1" 114 | 115 | decamelize-keys@^1.0.0: 116 | version "1.1.0" 117 | resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" 118 | integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= 119 | dependencies: 120 | decamelize "^1.1.0" 121 | map-obj "^1.0.0" 122 | 123 | decamelize@^1.1.0: 124 | version "1.2.0" 125 | resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" 126 | integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= 127 | 128 | defaults@^1.0.3: 129 | version "1.0.3" 130 | resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" 131 | integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= 132 | dependencies: 133 | clone "^1.0.2" 134 | 135 | error-ex@^1.3.1: 136 | version "1.3.2" 137 | resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" 138 | integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== 139 | dependencies: 140 | is-arrayish "^0.2.1" 141 | 142 | escape-string-regexp@^1.0.5: 143 | version "1.0.5" 144 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 145 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= 146 | 147 | find-up@^2.0.0: 148 | version "2.1.0" 149 | resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" 150 | integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= 151 | dependencies: 152 | locate-path "^2.0.0" 153 | 154 | graceful-fs@^4.1.2: 155 | version "4.1.15" 156 | resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" 157 | integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== 158 | 159 | has-flag@^3.0.0: 160 | version "3.0.0" 161 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" 162 | integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= 163 | 164 | hosted-git-info@^2.1.4: 165 | version "2.7.1" 166 | resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" 167 | integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== 168 | 169 | indent-string@^3.0.0: 170 | version "3.2.0" 171 | resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" 172 | integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= 173 | 174 | is-arrayish@^0.2.1: 175 | version "0.2.1" 176 | resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" 177 | integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= 178 | 179 | is-builtin-module@^1.0.0: 180 | version "1.0.0" 181 | resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" 182 | integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= 183 | dependencies: 184 | builtin-modules "^1.0.0" 185 | 186 | is-plain-obj@^1.1.0: 187 | version "1.1.0" 188 | resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" 189 | integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= 190 | 191 | json-parse-better-errors@^1.0.1: 192 | version "1.0.2" 193 | resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" 194 | integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== 195 | 196 | load-json-file@^4.0.0: 197 | version "4.0.0" 198 | resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" 199 | integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= 200 | dependencies: 201 | graceful-fs "^4.1.2" 202 | parse-json "^4.0.0" 203 | pify "^3.0.0" 204 | strip-bom "^3.0.0" 205 | 206 | locate-path@^2.0.0: 207 | version "2.0.0" 208 | resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" 209 | integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= 210 | dependencies: 211 | p-locate "^2.0.0" 212 | path-exists "^3.0.0" 213 | 214 | log-symbols@^2.2.0: 215 | version "2.2.0" 216 | resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" 217 | integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== 218 | dependencies: 219 | chalk "^2.0.1" 220 | 221 | loud-rejection@^1.0.0: 222 | version "1.6.0" 223 | resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" 224 | integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= 225 | dependencies: 226 | currently-unhandled "^0.4.1" 227 | signal-exit "^3.0.0" 228 | 229 | map-obj@^1.0.0: 230 | version "1.0.1" 231 | resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" 232 | integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= 233 | 234 | map-obj@^2.0.0: 235 | version "2.0.0" 236 | resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-2.0.0.tgz#a65cd29087a92598b8791257a523e021222ac1f9" 237 | integrity sha1-plzSkIepJZi4eRJXpSPgISIqwfk= 238 | 239 | meow@latest: 240 | version "5.0.0" 241 | resolved "https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" 242 | integrity sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig== 243 | dependencies: 244 | camelcase-keys "^4.0.0" 245 | decamelize-keys "^1.0.0" 246 | loud-rejection "^1.0.0" 247 | minimist-options "^3.0.1" 248 | normalize-package-data "^2.3.4" 249 | read-pkg-up "^3.0.0" 250 | redent "^2.0.0" 251 | trim-newlines "^2.0.0" 252 | yargs-parser "^10.0.0" 253 | 254 | mimic-fn@^1.0.0: 255 | version "1.2.0" 256 | resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" 257 | integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== 258 | 259 | minimist-options@^3.0.1: 260 | version "3.0.2" 261 | resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-3.0.2.tgz#fba4c8191339e13ecf4d61beb03f070103f3d954" 262 | integrity sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ== 263 | dependencies: 264 | arrify "^1.0.1" 265 | is-plain-obj "^1.1.0" 266 | 267 | node-fetch@2.3.0: 268 | version "2.3.0" 269 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" 270 | integrity sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA== 271 | 272 | normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: 273 | version "2.4.0" 274 | resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" 275 | integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== 276 | dependencies: 277 | hosted-git-info "^2.1.4" 278 | is-builtin-module "^1.0.0" 279 | semver "2 || 3 || 4 || 5" 280 | validate-npm-package-license "^3.0.1" 281 | 282 | onetime@^2.0.0: 283 | version "2.0.1" 284 | resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" 285 | integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= 286 | dependencies: 287 | mimic-fn "^1.0.0" 288 | 289 | ora@latest: 290 | version "3.4.0" 291 | resolved "https://registry.yarnpkg.com/ora/-/ora-3.4.0.tgz#bf0752491059a3ef3ed4c85097531de9fdbcd318" 292 | integrity sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg== 293 | dependencies: 294 | chalk "^2.4.2" 295 | cli-cursor "^2.1.0" 296 | cli-spinners "^2.0.0" 297 | log-symbols "^2.2.0" 298 | strip-ansi "^5.2.0" 299 | wcwidth "^1.0.1" 300 | 301 | p-limit@^1.1.0: 302 | version "1.3.0" 303 | resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" 304 | integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== 305 | dependencies: 306 | p-try "^1.0.0" 307 | 308 | p-locate@^2.0.0: 309 | version "2.0.0" 310 | resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" 311 | integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= 312 | dependencies: 313 | p-limit "^1.1.0" 314 | 315 | p-try@^1.0.0: 316 | version "1.0.0" 317 | resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" 318 | integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= 319 | 320 | parse-json@^4.0.0: 321 | version "4.0.0" 322 | resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" 323 | integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= 324 | dependencies: 325 | error-ex "^1.3.1" 326 | json-parse-better-errors "^1.0.1" 327 | 328 | path-exists@^3.0.0: 329 | version "3.0.0" 330 | resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" 331 | integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= 332 | 333 | path-type@^3.0.0: 334 | version "3.0.0" 335 | resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" 336 | integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== 337 | dependencies: 338 | pify "^3.0.0" 339 | 340 | pify@^3.0.0: 341 | version "3.0.0" 342 | resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" 343 | integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= 344 | 345 | quick-lru@^1.0.0: 346 | version "1.1.0" 347 | resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" 348 | integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= 349 | 350 | read-pkg-up@^3.0.0: 351 | version "3.0.0" 352 | resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" 353 | integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= 354 | dependencies: 355 | find-up "^2.0.0" 356 | read-pkg "^3.0.0" 357 | 358 | read-pkg@^3.0.0: 359 | version "3.0.0" 360 | resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" 361 | integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= 362 | dependencies: 363 | load-json-file "^4.0.0" 364 | normalize-package-data "^2.3.2" 365 | path-type "^3.0.0" 366 | 367 | redent@^2.0.0: 368 | version "2.0.0" 369 | resolved "https://registry.yarnpkg.com/redent/-/redent-2.0.0.tgz#c1b2007b42d57eb1389079b3c8333639d5e1ccaa" 370 | integrity sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo= 371 | dependencies: 372 | indent-string "^3.0.0" 373 | strip-indent "^2.0.0" 374 | 375 | restore-cursor@^2.0.0: 376 | version "2.0.0" 377 | resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" 378 | integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= 379 | dependencies: 380 | onetime "^2.0.0" 381 | signal-exit "^3.0.2" 382 | 383 | "semver@2 || 3 || 4 || 5": 384 | version "5.6.0" 385 | resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" 386 | integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== 387 | 388 | signal-exit@^3.0.0, signal-exit@^3.0.2: 389 | version "3.0.2" 390 | resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" 391 | integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= 392 | 393 | spdx-correct@^3.0.0: 394 | version "3.1.0" 395 | resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" 396 | integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== 397 | dependencies: 398 | spdx-expression-parse "^3.0.0" 399 | spdx-license-ids "^3.0.0" 400 | 401 | spdx-exceptions@^2.1.0: 402 | version "2.2.0" 403 | resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" 404 | integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== 405 | 406 | spdx-expression-parse@^3.0.0: 407 | version "3.0.0" 408 | resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" 409 | integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== 410 | dependencies: 411 | spdx-exceptions "^2.1.0" 412 | spdx-license-ids "^3.0.0" 413 | 414 | spdx-license-ids@^3.0.0: 415 | version "3.0.2" 416 | resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz#a59efc09784c2a5bada13cfeaf5c75dd214044d2" 417 | integrity sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg== 418 | 419 | strip-ansi@^5.2.0: 420 | version "5.2.0" 421 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" 422 | integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== 423 | dependencies: 424 | ansi-regex "^4.1.0" 425 | 426 | strip-bom@^3.0.0: 427 | version "3.0.0" 428 | resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" 429 | integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= 430 | 431 | strip-indent@^2.0.0: 432 | version "2.0.0" 433 | resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" 434 | integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= 435 | 436 | supports-color@^5.3.0: 437 | version "5.5.0" 438 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" 439 | integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== 440 | dependencies: 441 | has-flag "^3.0.0" 442 | 443 | trim-newlines@^2.0.0: 444 | version "2.0.0" 445 | resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20" 446 | integrity sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA= 447 | 448 | validate-npm-package-license@^3.0.1: 449 | version "3.0.4" 450 | resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" 451 | integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== 452 | dependencies: 453 | spdx-correct "^3.0.0" 454 | spdx-expression-parse "^3.0.0" 455 | 456 | wcwidth@^1.0.1: 457 | version "1.0.1" 458 | resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" 459 | integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= 460 | dependencies: 461 | defaults "^1.0.3" 462 | 463 | whatwg-fetch@3.0.0: 464 | version "3.0.0" 465 | resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" 466 | integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== 467 | 468 | yargs-parser@^10.0.0: 469 | version "10.1.0" 470 | resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" 471 | integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== 472 | dependencies: 473 | camelcase "^4.1.0" 474 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["config:base", ":skipStatusChecks", "docker:disable", "schedule:weekly"], 3 | "automerge": true, 4 | "major": { 5 | "automerge": false 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /storefronts/express/README.md: -------------------------------------------------------------------------------- 1 | # Moltin + Express 2 | 3 | You can run this example by cloning the repo, installing the dependencies with `yarn install` and running `yarn dev`. 4 | -------------------------------------------------------------------------------- /storefronts/express/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const { MoltinClient } = require('@moltin/request') 3 | 4 | const app = express() 5 | 6 | const moltin = new MoltinClient({ 7 | client_id: 'h93GLWVTdw3EUd9ev7g8Z7ROq54s5JVAzivz9ZrIe1', 8 | }) 9 | 10 | app.set('view engine', 'pug') 11 | 12 | app.get('/', async (req, res) => { 13 | const { data: products } = await moltin.get('products') 14 | 15 | res.render('index', { products }) 16 | }) 17 | 18 | app.get('/products/:id', async (req, res) => { 19 | const { id } = req.params 20 | const { data: product } = await moltin.get(`products/${id}`) 21 | 22 | res.render('product', { product }) 23 | }) 24 | 25 | app.listen(3000) 26 | -------------------------------------------------------------------------------- /storefronts/express/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "node index.js" 5 | }, 6 | "dependencies": { 7 | "@moltin/request": "latest", 8 | "express": "latest", 9 | "pug": "latest" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /storefronts/express/views/index.pug: -------------------------------------------------------------------------------- 1 | ul 2 | each product in products 3 | li 4 | a(href=`/products/${product.id}`) #{product.name} -------------------------------------------------------------------------------- /storefronts/express/views/product.pug: -------------------------------------------------------------------------------- 1 | h1= product.name 2 | p= product.description -------------------------------------------------------------------------------- /storefronts/express/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@moltin/request@latest": 6 | version "1.6.0" 7 | resolved "https://registry.yarnpkg.com/@moltin/request/-/request-1.6.0.tgz#5eea1954add2cc9553d15d512341389dd15ec016" 8 | integrity sha512-xgAfoiysAc7S48hYRNjPOptL0Xrw4tkfjveO1hgcIy9Q+XPbcW+NcWYvM8LQbRnQMMMs6Uzg0qoh2f/0LR9tBg== 9 | dependencies: 10 | cross-fetch "3.0.2" 11 | 12 | "@types/babel-types@*", "@types/babel-types@^7.0.0": 13 | version "7.0.4" 14 | resolved "https://registry.yarnpkg.com/@types/babel-types/-/babel-types-7.0.4.tgz#bfd5b0d0d1ba13e351dff65b6e52783b816826c8" 15 | integrity sha512-WiZhq3SVJHFRgRYLXvpf65XnV6ipVHhnNaNvE8yCimejrGglkg38kEj0JcizqwSHxmPSjcTlig/6JouxLGEhGw== 16 | 17 | "@types/babylon@^6.16.2": 18 | version "6.16.4" 19 | resolved "https://registry.yarnpkg.com/@types/babylon/-/babylon-6.16.4.tgz#d3df72518b34a6a015d0dc58745cd238b5bb8ad2" 20 | integrity sha512-8dZMcGPno3g7pJ/d0AyJERo+lXh9i1JhDuCUs+4lNIN9eUe5Yh6UCLrpgSEi05Ve2JMLauL2aozdvKwNL0px1Q== 21 | dependencies: 22 | "@types/babel-types" "*" 23 | 24 | accepts@~1.3.5: 25 | version "1.3.5" 26 | resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" 27 | integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= 28 | dependencies: 29 | mime-types "~2.1.18" 30 | negotiator "0.6.1" 31 | 32 | acorn-globals@^3.0.0: 33 | version "3.1.0" 34 | resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" 35 | integrity sha1-/YJw9x+7SZawBPqIDuXUZXOnMb8= 36 | dependencies: 37 | acorn "^4.0.4" 38 | 39 | acorn@^3.1.0: 40 | version "3.3.0" 41 | resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" 42 | integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= 43 | 44 | acorn@^4.0.4, acorn@~4.0.2: 45 | version "4.0.13" 46 | resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" 47 | integrity sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c= 48 | 49 | align-text@^0.1.1, align-text@^0.1.3: 50 | version "0.1.4" 51 | resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" 52 | integrity sha1-DNkKVhCT810KmSVsIrcGlDP60Rc= 53 | dependencies: 54 | kind-of "^3.0.2" 55 | longest "^1.0.1" 56 | repeat-string "^1.5.2" 57 | 58 | array-flatten@1.1.1: 59 | version "1.1.1" 60 | resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" 61 | integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= 62 | 63 | asap@~2.0.3: 64 | version "2.0.6" 65 | resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" 66 | integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= 67 | 68 | babel-runtime@^6.26.0: 69 | version "6.26.0" 70 | resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" 71 | integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= 72 | dependencies: 73 | core-js "^2.4.0" 74 | regenerator-runtime "^0.11.0" 75 | 76 | babel-types@^6.26.0: 77 | version "6.26.0" 78 | resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" 79 | integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= 80 | dependencies: 81 | babel-runtime "^6.26.0" 82 | esutils "^2.0.2" 83 | lodash "^4.17.4" 84 | to-fast-properties "^1.0.3" 85 | 86 | babylon@^6.18.0: 87 | version "6.18.0" 88 | resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" 89 | integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== 90 | 91 | body-parser@1.18.3: 92 | version "1.18.3" 93 | resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" 94 | integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= 95 | dependencies: 96 | bytes "3.0.0" 97 | content-type "~1.0.4" 98 | debug "2.6.9" 99 | depd "~1.1.2" 100 | http-errors "~1.6.3" 101 | iconv-lite "0.4.23" 102 | on-finished "~2.3.0" 103 | qs "6.5.2" 104 | raw-body "2.3.3" 105 | type-is "~1.6.16" 106 | 107 | bytes@3.0.0: 108 | version "3.0.0" 109 | resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" 110 | integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= 111 | 112 | camelcase@^1.0.2: 113 | version "1.2.1" 114 | resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" 115 | integrity sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk= 116 | 117 | center-align@^0.1.1: 118 | version "0.1.3" 119 | resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" 120 | integrity sha1-qg0yYptu6XIgBBHL1EYckHvCt60= 121 | dependencies: 122 | align-text "^0.1.3" 123 | lazy-cache "^1.0.3" 124 | 125 | character-parser@^2.1.1: 126 | version "2.2.0" 127 | resolved "https://registry.yarnpkg.com/character-parser/-/character-parser-2.2.0.tgz#c7ce28f36d4bcd9744e5ffc2c5fcde1c73261fc0" 128 | integrity sha1-x84o821LzZdE5f/CxfzeHHMmH8A= 129 | dependencies: 130 | is-regex "^1.0.3" 131 | 132 | clean-css@^4.1.11: 133 | version "4.2.1" 134 | resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.1.tgz#2d411ef76b8569b6d0c84068dabe85b0aa5e5c17" 135 | integrity sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g== 136 | dependencies: 137 | source-map "~0.6.0" 138 | 139 | cliui@^2.1.0: 140 | version "2.1.0" 141 | resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" 142 | integrity sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE= 143 | dependencies: 144 | center-align "^0.1.1" 145 | right-align "^0.1.1" 146 | wordwrap "0.0.2" 147 | 148 | constantinople@^3.0.1: 149 | version "3.1.2" 150 | resolved "https://registry.yarnpkg.com/constantinople/-/constantinople-3.1.2.tgz#d45ed724f57d3d10500017a7d3a889c1381ae647" 151 | integrity sha512-yePcBqEFhLOqSBtwYOGGS1exHo/s1xjekXiinh4itpNQGCu4KA1euPh1fg07N2wMITZXQkBz75Ntdt1ctGZouw== 152 | dependencies: 153 | "@types/babel-types" "^7.0.0" 154 | "@types/babylon" "^6.16.2" 155 | babel-types "^6.26.0" 156 | babylon "^6.18.0" 157 | 158 | content-disposition@0.5.2: 159 | version "0.5.2" 160 | resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" 161 | integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= 162 | 163 | content-type@~1.0.4: 164 | version "1.0.4" 165 | resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" 166 | integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== 167 | 168 | cookie-signature@1.0.6: 169 | version "1.0.6" 170 | resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" 171 | integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= 172 | 173 | cookie@0.3.1: 174 | version "0.3.1" 175 | resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" 176 | integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= 177 | 178 | core-js@^2.4.0: 179 | version "2.6.0" 180 | resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.0.tgz#1e30793e9ee5782b307e37ffa22da0eacddd84d4" 181 | integrity sha512-kLRC6ncVpuEW/1kwrOXYX6KQASCVtrh1gQr/UiaVgFlf9WE5Vp+lNe5+h3LuMr5PAucWnnEXwH0nQHRH/gpGtw== 182 | 183 | cross-fetch@3.0.2: 184 | version "3.0.2" 185 | resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.2.tgz#b7136491967031949c7f86b15903aef4fa3f1768" 186 | integrity sha512-a4Z0EJ5Nck6QtMy9ZqloLfpvu2uMV3sBfMCR+CgSBCZc6z5KR4bfEiD3dkepH8iZgJMXQpTqf8FjMmvu/GMFkg== 187 | dependencies: 188 | node-fetch "2.3.0" 189 | whatwg-fetch "3.0.0" 190 | 191 | debug@2.6.9: 192 | version "2.6.9" 193 | resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" 194 | integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== 195 | dependencies: 196 | ms "2.0.0" 197 | 198 | decamelize@^1.0.0: 199 | version "1.2.0" 200 | resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" 201 | integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= 202 | 203 | depd@~1.1.2: 204 | version "1.1.2" 205 | resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" 206 | integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= 207 | 208 | destroy@~1.0.4: 209 | version "1.0.4" 210 | resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" 211 | integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= 212 | 213 | doctypes@^1.1.0: 214 | version "1.1.0" 215 | resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9" 216 | integrity sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk= 217 | 218 | ee-first@1.1.1: 219 | version "1.1.1" 220 | resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" 221 | integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= 222 | 223 | encodeurl@~1.0.2: 224 | version "1.0.2" 225 | resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" 226 | integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= 227 | 228 | escape-html@~1.0.3: 229 | version "1.0.3" 230 | resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" 231 | integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= 232 | 233 | esutils@^2.0.2: 234 | version "2.0.2" 235 | resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" 236 | integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= 237 | 238 | etag@~1.8.1: 239 | version "1.8.1" 240 | resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" 241 | integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= 242 | 243 | express@latest: 244 | version "4.16.4" 245 | resolved "https://registry.yarnpkg.com/express/-/express-4.16.4.tgz#fddef61926109e24c515ea97fd2f1bdbf62df12e" 246 | integrity sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg== 247 | dependencies: 248 | accepts "~1.3.5" 249 | array-flatten "1.1.1" 250 | body-parser "1.18.3" 251 | content-disposition "0.5.2" 252 | content-type "~1.0.4" 253 | cookie "0.3.1" 254 | cookie-signature "1.0.6" 255 | debug "2.6.9" 256 | depd "~1.1.2" 257 | encodeurl "~1.0.2" 258 | escape-html "~1.0.3" 259 | etag "~1.8.1" 260 | finalhandler "1.1.1" 261 | fresh "0.5.2" 262 | merge-descriptors "1.0.1" 263 | methods "~1.1.2" 264 | on-finished "~2.3.0" 265 | parseurl "~1.3.2" 266 | path-to-regexp "0.1.7" 267 | proxy-addr "~2.0.4" 268 | qs "6.5.2" 269 | range-parser "~1.2.0" 270 | safe-buffer "5.1.2" 271 | send "0.16.2" 272 | serve-static "1.13.2" 273 | setprototypeof "1.1.0" 274 | statuses "~1.4.0" 275 | type-is "~1.6.16" 276 | utils-merge "1.0.1" 277 | vary "~1.1.2" 278 | 279 | finalhandler@1.1.1: 280 | version "1.1.1" 281 | resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" 282 | integrity sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg== 283 | dependencies: 284 | debug "2.6.9" 285 | encodeurl "~1.0.2" 286 | escape-html "~1.0.3" 287 | on-finished "~2.3.0" 288 | parseurl "~1.3.2" 289 | statuses "~1.4.0" 290 | unpipe "~1.0.0" 291 | 292 | forwarded@~0.1.2: 293 | version "0.1.2" 294 | resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" 295 | integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= 296 | 297 | fresh@0.5.2: 298 | version "0.5.2" 299 | resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" 300 | integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= 301 | 302 | function-bind@^1.1.1: 303 | version "1.1.1" 304 | resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" 305 | integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== 306 | 307 | has@^1.0.1: 308 | version "1.0.3" 309 | resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" 310 | integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== 311 | dependencies: 312 | function-bind "^1.1.1" 313 | 314 | http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: 315 | version "1.6.3" 316 | resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" 317 | integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= 318 | dependencies: 319 | depd "~1.1.2" 320 | inherits "2.0.3" 321 | setprototypeof "1.1.0" 322 | statuses ">= 1.4.0 < 2" 323 | 324 | iconv-lite@0.4.23: 325 | version "0.4.23" 326 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" 327 | integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== 328 | dependencies: 329 | safer-buffer ">= 2.1.2 < 3" 330 | 331 | inherits@2.0.3: 332 | version "2.0.3" 333 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 334 | integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= 335 | 336 | ipaddr.js@1.8.0: 337 | version "1.8.0" 338 | resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.0.tgz#eaa33d6ddd7ace8f7f6fe0c9ca0440e706738b1e" 339 | integrity sha1-6qM9bd16zo9/b+DJygRA5wZzix4= 340 | 341 | is-buffer@^1.1.5: 342 | version "1.1.6" 343 | resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" 344 | integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== 345 | 346 | is-expression@^3.0.0: 347 | version "3.0.0" 348 | resolved "https://registry.yarnpkg.com/is-expression/-/is-expression-3.0.0.tgz#39acaa6be7fd1f3471dc42c7416e61c24317ac9f" 349 | integrity sha1-Oayqa+f9HzRx3ELHQW5hwkMXrJ8= 350 | dependencies: 351 | acorn "~4.0.2" 352 | object-assign "^4.0.1" 353 | 354 | is-promise@^2.0.0: 355 | version "2.1.0" 356 | resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" 357 | integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= 358 | 359 | is-regex@^1.0.3: 360 | version "1.0.4" 361 | resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" 362 | integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= 363 | dependencies: 364 | has "^1.0.1" 365 | 366 | js-stringify@^1.0.1: 367 | version "1.0.2" 368 | resolved "https://registry.yarnpkg.com/js-stringify/-/js-stringify-1.0.2.tgz#1736fddfd9724f28a3682adc6230ae7e4e9679db" 369 | integrity sha1-Fzb939lyTyijaCrcYjCufk6Weds= 370 | 371 | jstransformer@1.0.0: 372 | version "1.0.0" 373 | resolved "https://registry.yarnpkg.com/jstransformer/-/jstransformer-1.0.0.tgz#ed8bf0921e2f3f1ed4d5c1a44f68709ed24722c3" 374 | integrity sha1-7Yvwkh4vPx7U1cGkT2hwntJHIsM= 375 | dependencies: 376 | is-promise "^2.0.0" 377 | promise "^7.0.1" 378 | 379 | kind-of@^3.0.2: 380 | version "3.2.2" 381 | resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" 382 | integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= 383 | dependencies: 384 | is-buffer "^1.1.5" 385 | 386 | lazy-cache@^1.0.3: 387 | version "1.0.4" 388 | resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" 389 | integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= 390 | 391 | lodash@^4.17.4: 392 | version "4.17.11" 393 | resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" 394 | integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== 395 | 396 | longest@^1.0.1: 397 | version "1.0.1" 398 | resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" 399 | integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc= 400 | 401 | media-typer@0.3.0: 402 | version "0.3.0" 403 | resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" 404 | integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= 405 | 406 | merge-descriptors@1.0.1: 407 | version "1.0.1" 408 | resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" 409 | integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= 410 | 411 | methods@~1.1.2: 412 | version "1.1.2" 413 | resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" 414 | integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= 415 | 416 | mime-db@~1.37.0: 417 | version "1.37.0" 418 | resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" 419 | integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== 420 | 421 | mime-types@~2.1.18: 422 | version "2.1.21" 423 | resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" 424 | integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== 425 | dependencies: 426 | mime-db "~1.37.0" 427 | 428 | mime@1.4.1: 429 | version "1.4.1" 430 | resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" 431 | integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== 432 | 433 | ms@2.0.0: 434 | version "2.0.0" 435 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" 436 | integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= 437 | 438 | negotiator@0.6.1: 439 | version "0.6.1" 440 | resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" 441 | integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= 442 | 443 | node-fetch@2.3.0: 444 | version "2.3.0" 445 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" 446 | integrity sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA== 447 | 448 | object-assign@^4.0.1, object-assign@^4.1.0: 449 | version "4.1.1" 450 | resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" 451 | integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= 452 | 453 | on-finished@~2.3.0: 454 | version "2.3.0" 455 | resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" 456 | integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= 457 | dependencies: 458 | ee-first "1.1.1" 459 | 460 | parseurl@~1.3.2: 461 | version "1.3.2" 462 | resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" 463 | integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= 464 | 465 | path-parse@^1.0.5: 466 | version "1.0.6" 467 | resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" 468 | integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== 469 | 470 | path-to-regexp@0.1.7: 471 | version "0.1.7" 472 | resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" 473 | integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= 474 | 475 | promise@^7.0.1: 476 | version "7.3.1" 477 | resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" 478 | integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg== 479 | dependencies: 480 | asap "~2.0.3" 481 | 482 | proxy-addr@~2.0.4: 483 | version "2.0.4" 484 | resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93" 485 | integrity sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA== 486 | dependencies: 487 | forwarded "~0.1.2" 488 | ipaddr.js "1.8.0" 489 | 490 | pug-attrs@^2.0.3: 491 | version "2.0.3" 492 | resolved "https://registry.yarnpkg.com/pug-attrs/-/pug-attrs-2.0.3.tgz#a3095f970e64151f7bdad957eef55fb5d7905d15" 493 | integrity sha1-owlflw5kFR972tlX7vVftdeQXRU= 494 | dependencies: 495 | constantinople "^3.0.1" 496 | js-stringify "^1.0.1" 497 | pug-runtime "^2.0.4" 498 | 499 | pug-code-gen@^2.0.1: 500 | version "2.0.1" 501 | resolved "https://registry.yarnpkg.com/pug-code-gen/-/pug-code-gen-2.0.1.tgz#0951ec83225d74d8cfc476a7f99a259b5f7d050c" 502 | integrity sha1-CVHsgyJddNjPxHan+Zolm199BQw= 503 | dependencies: 504 | constantinople "^3.0.1" 505 | doctypes "^1.1.0" 506 | js-stringify "^1.0.1" 507 | pug-attrs "^2.0.3" 508 | pug-error "^1.3.2" 509 | pug-runtime "^2.0.4" 510 | void-elements "^2.0.1" 511 | with "^5.0.0" 512 | 513 | pug-error@^1.3.2: 514 | version "1.3.2" 515 | resolved "https://registry.yarnpkg.com/pug-error/-/pug-error-1.3.2.tgz#53ae7d9d29bb03cf564493a026109f54c47f5f26" 516 | integrity sha1-U659nSm7A89WRJOgJhCfVMR/XyY= 517 | 518 | pug-filters@^3.1.0: 519 | version "3.1.0" 520 | resolved "https://registry.yarnpkg.com/pug-filters/-/pug-filters-3.1.0.tgz#27165555bc04c236e4aa2b0366246dfa021b626e" 521 | integrity sha1-JxZVVbwEwjbkqisDZiRt+gIbYm4= 522 | dependencies: 523 | clean-css "^4.1.11" 524 | constantinople "^3.0.1" 525 | jstransformer "1.0.0" 526 | pug-error "^1.3.2" 527 | pug-walk "^1.1.7" 528 | resolve "^1.1.6" 529 | uglify-js "^2.6.1" 530 | 531 | pug-lexer@^4.0.0: 532 | version "4.0.0" 533 | resolved "https://registry.yarnpkg.com/pug-lexer/-/pug-lexer-4.0.0.tgz#210c18457ef2e1760242740c5e647bd794cec278" 534 | integrity sha1-IQwYRX7y4XYCQnQMXmR715TOwng= 535 | dependencies: 536 | character-parser "^2.1.1" 537 | is-expression "^3.0.0" 538 | pug-error "^1.3.2" 539 | 540 | pug-linker@^3.0.5: 541 | version "3.0.5" 542 | resolved "https://registry.yarnpkg.com/pug-linker/-/pug-linker-3.0.5.tgz#9e9a7ae4005682d027deeb96b000f88eeb83a02f" 543 | integrity sha1-npp65ABWgtAn3uuWsAD4juuDoC8= 544 | dependencies: 545 | pug-error "^1.3.2" 546 | pug-walk "^1.1.7" 547 | 548 | pug-load@^2.0.11: 549 | version "2.0.11" 550 | resolved "https://registry.yarnpkg.com/pug-load/-/pug-load-2.0.11.tgz#e648e57ed113fe2c1f45d57858ea2bad6bc01527" 551 | integrity sha1-5kjlftET/iwfRdV4WOorrWvAFSc= 552 | dependencies: 553 | object-assign "^4.1.0" 554 | pug-walk "^1.1.7" 555 | 556 | pug-parser@^5.0.0: 557 | version "5.0.0" 558 | resolved "https://registry.yarnpkg.com/pug-parser/-/pug-parser-5.0.0.tgz#e394ad9b3fca93123940aff885c06e44ab7e68e4" 559 | integrity sha1-45Stmz/KkxI5QK/4hcBuRKt+aOQ= 560 | dependencies: 561 | pug-error "^1.3.2" 562 | token-stream "0.0.1" 563 | 564 | pug-runtime@^2.0.4: 565 | version "2.0.4" 566 | resolved "https://registry.yarnpkg.com/pug-runtime/-/pug-runtime-2.0.4.tgz#e178e1bda68ab2e8c0acfc9bced2c54fd88ceb58" 567 | integrity sha1-4XjhvaaKsujArPybztLFT9iM61g= 568 | 569 | pug-strip-comments@^1.0.3: 570 | version "1.0.3" 571 | resolved "https://registry.yarnpkg.com/pug-strip-comments/-/pug-strip-comments-1.0.3.tgz#f1559592206edc6f85310dacf4afb48a025af59f" 572 | integrity sha1-8VWVkiBu3G+FMQ2s9K+0igJa9Z8= 573 | dependencies: 574 | pug-error "^1.3.2" 575 | 576 | pug-walk@^1.1.7: 577 | version "1.1.7" 578 | resolved "https://registry.yarnpkg.com/pug-walk/-/pug-walk-1.1.7.tgz#c00d5c5128bac5806bec15d2b7e7cdabe42531f3" 579 | integrity sha1-wA1cUSi6xYBr7BXSt+fNq+QlMfM= 580 | 581 | pug@latest: 582 | version "2.0.3" 583 | resolved "https://registry.yarnpkg.com/pug/-/pug-2.0.3.tgz#71cba82537c95a5eab7ed04696e4221f53aa878e" 584 | integrity sha1-ccuoJTfJWl6rftBGluQiH1Oqh44= 585 | dependencies: 586 | pug-code-gen "^2.0.1" 587 | pug-filters "^3.1.0" 588 | pug-lexer "^4.0.0" 589 | pug-linker "^3.0.5" 590 | pug-load "^2.0.11" 591 | pug-parser "^5.0.0" 592 | pug-runtime "^2.0.4" 593 | pug-strip-comments "^1.0.3" 594 | 595 | qs@6.5.2: 596 | version "6.5.2" 597 | resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" 598 | integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== 599 | 600 | range-parser@~1.2.0: 601 | version "1.2.0" 602 | resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" 603 | integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= 604 | 605 | raw-body@2.3.3: 606 | version "2.3.3" 607 | resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" 608 | integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== 609 | dependencies: 610 | bytes "3.0.0" 611 | http-errors "1.6.3" 612 | iconv-lite "0.4.23" 613 | unpipe "1.0.0" 614 | 615 | regenerator-runtime@^0.11.0: 616 | version "0.11.1" 617 | resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" 618 | integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== 619 | 620 | repeat-string@^1.5.2: 621 | version "1.6.1" 622 | resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" 623 | integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= 624 | 625 | resolve@^1.1.6: 626 | version "1.8.1" 627 | resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" 628 | integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== 629 | dependencies: 630 | path-parse "^1.0.5" 631 | 632 | right-align@^0.1.1: 633 | version "0.1.3" 634 | resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" 635 | integrity sha1-YTObci/mo1FWiSENJOFMlhSGE+8= 636 | dependencies: 637 | align-text "^0.1.1" 638 | 639 | safe-buffer@5.1.2: 640 | version "5.1.2" 641 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" 642 | integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== 643 | 644 | "safer-buffer@>= 2.1.2 < 3": 645 | version "2.1.2" 646 | resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" 647 | integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== 648 | 649 | send@0.16.2: 650 | version "0.16.2" 651 | resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" 652 | integrity sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw== 653 | dependencies: 654 | debug "2.6.9" 655 | depd "~1.1.2" 656 | destroy "~1.0.4" 657 | encodeurl "~1.0.2" 658 | escape-html "~1.0.3" 659 | etag "~1.8.1" 660 | fresh "0.5.2" 661 | http-errors "~1.6.2" 662 | mime "1.4.1" 663 | ms "2.0.0" 664 | on-finished "~2.3.0" 665 | range-parser "~1.2.0" 666 | statuses "~1.4.0" 667 | 668 | serve-static@1.13.2: 669 | version "1.13.2" 670 | resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" 671 | integrity sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw== 672 | dependencies: 673 | encodeurl "~1.0.2" 674 | escape-html "~1.0.3" 675 | parseurl "~1.3.2" 676 | send "0.16.2" 677 | 678 | setprototypeof@1.1.0: 679 | version "1.1.0" 680 | resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" 681 | integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== 682 | 683 | source-map@~0.5.1: 684 | version "0.5.7" 685 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" 686 | integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= 687 | 688 | source-map@~0.6.0: 689 | version "0.6.1" 690 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" 691 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== 692 | 693 | "statuses@>= 1.4.0 < 2": 694 | version "1.5.0" 695 | resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" 696 | integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= 697 | 698 | statuses@~1.4.0: 699 | version "1.4.0" 700 | resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" 701 | integrity sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew== 702 | 703 | to-fast-properties@^1.0.3: 704 | version "1.0.3" 705 | resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" 706 | integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= 707 | 708 | token-stream@0.0.1: 709 | version "0.0.1" 710 | resolved "https://registry.yarnpkg.com/token-stream/-/token-stream-0.0.1.tgz#ceeefc717a76c4316f126d0b9dbaa55d7e7df01a" 711 | integrity sha1-zu78cXp2xDFvEm0LnbqlXX598Bo= 712 | 713 | type-is@~1.6.16: 714 | version "1.6.16" 715 | resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" 716 | integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== 717 | dependencies: 718 | media-typer "0.3.0" 719 | mime-types "~2.1.18" 720 | 721 | uglify-js@^2.6.1: 722 | version "2.8.29" 723 | resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" 724 | integrity sha1-KcVzMUgFe7Th913zW3qcty5qWd0= 725 | dependencies: 726 | source-map "~0.5.1" 727 | yargs "~3.10.0" 728 | optionalDependencies: 729 | uglify-to-browserify "~1.0.0" 730 | 731 | uglify-to-browserify@~1.0.0: 732 | version "1.0.2" 733 | resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" 734 | integrity sha1-bgkk1r2mta/jSeOabWMoUKD4grc= 735 | 736 | unpipe@1.0.0, unpipe@~1.0.0: 737 | version "1.0.0" 738 | resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" 739 | integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= 740 | 741 | utils-merge@1.0.1: 742 | version "1.0.1" 743 | resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" 744 | integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= 745 | 746 | vary@~1.1.2: 747 | version "1.1.2" 748 | resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" 749 | integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= 750 | 751 | void-elements@^2.0.1: 752 | version "2.0.1" 753 | resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" 754 | integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= 755 | 756 | whatwg-fetch@3.0.0: 757 | version "3.0.0" 758 | resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" 759 | integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== 760 | 761 | window-size@0.1.0: 762 | version "0.1.0" 763 | resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" 764 | integrity sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0= 765 | 766 | with@^5.0.0: 767 | version "5.1.1" 768 | resolved "https://registry.yarnpkg.com/with/-/with-5.1.1.tgz#fa4daa92daf32c4ea94ed453c81f04686b575dfe" 769 | integrity sha1-+k2qktrzLE6pTtRTyB8EaGtXXf4= 770 | dependencies: 771 | acorn "^3.1.0" 772 | acorn-globals "^3.0.0" 773 | 774 | wordwrap@0.0.2: 775 | version "0.0.2" 776 | resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" 777 | integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8= 778 | 779 | yargs@~3.10.0: 780 | version "3.10.0" 781 | resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" 782 | integrity sha1-9+572FfdfB0tOMDnTvvWgdFDH9E= 783 | dependencies: 784 | camelcase "^1.0.2" 785 | cliui "^2.1.0" 786 | decamelize "^1.0.0" 787 | window-size "0.1.0" 788 | -------------------------------------------------------------------------------- /storefronts/nextjs/.gitignore: -------------------------------------------------------------------------------- 1 | .next -------------------------------------------------------------------------------- /storefronts/nextjs/README.md: -------------------------------------------------------------------------------- 1 | # Moltin + Next.js 2 | 3 | You can run this example by cloning the repo, installing the dependencies with `yarn install` and running `yarn dev`. 4 | -------------------------------------------------------------------------------- /storefronts/nextjs/lib/moltin.js: -------------------------------------------------------------------------------- 1 | import { MoltinClient } from '@moltin/request' 2 | 3 | export default new MoltinClient({ 4 | client_id: 'h93GLWVTdw3EUd9ev7g8Z7ROq54s5JVAzivz9ZrIe1' 5 | }) 6 | -------------------------------------------------------------------------------- /storefronts/nextjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "next", 5 | "build": "next build", 6 | "start": "next start" 7 | }, 8 | "dependencies": { 9 | "@moltin/request": "latest", 10 | "next": "latest", 11 | "react": "latest", 12 | "react-dom": "latest" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /storefronts/nextjs/pages/index.js: -------------------------------------------------------------------------------- 1 | import Link from 'next/link' 2 | 3 | import moltin from '../lib/moltin' 4 | 5 | export default class Homepage extends React.Component { 6 | static async getInitialProps() { 7 | const { data: products } = await moltin.get('products') 8 | 9 | return { products } 10 | } 11 | 12 | render() { 13 | const { products } = this.props 14 | 15 | return ( 16 |
{product.description}
18 |43 | Thank you for your order {{customer_name}}. The total for your order was 44 | {{order_total}} 45 |
46 |Name | 50 |Quantity | 51 |Total | 52 |
---|---|---|
{{name}} | 58 |{{quantity}} x {{meta.display_price.with_tax.unit.formatted}} | 59 |{{meta.display_price.with_tax.value.formatted}} | 60 |
43 | Hey, {{customer_name}}! Your order {{order_ref}} has been shipped to 44 | {{shipping_line_1}}, {{shipping_postcode}} 45 |
46 | 47 | 48 | ``` 49 | 50 | This template is just an example, but anything you provide inside the `templateModel` object you will have access to inside this template. 51 | 52 | Once you've saved the template, you will need to make a note the ID of the template: 53 | 54 |  55 | 56 | Next you will need a Server API token from the **Credentials** tab. 57 | 58 |  59 | 60 | ### 3. Configure your ENV variables 61 | 62 | You will want to create an `.env` inside the directory `/shipping-confirmation-email` containing all the keys for the below: 63 | 64 | ```shell 65 | POSTMARK_API_KEY= 66 | MOLTIN_WEBHOOK_SECRET= 67 | POSTMARK_FROM_ADDRESS= 68 | POSTMARK_SHIPPED_TEMPLATE_ID= 69 | ``` 70 | 71 | `MOLTIN_WEBHOOK_SECRET` can be anything you want. 72 | 73 | ### 4. Start the server and ngrok 74 | 75 | Start the development server 76 | 77 | ```bash 78 | yarn dev 79 | ``` 80 | 81 | The server will typically start on PORT `3000`, if not, make a note for the next step. 82 | 83 | Start ngrok 84 | 85 | ```bash 86 | ngrok http 3000 87 | ``` 88 | 89 | This will expose PORT `3000` to the outside world. Make a note of the `http` URL ngrok provides. 90 | 91 | ### 5. Create a new Moltin integration 92 | 93 | You must now tell Moltin the ngrok URL above. Head to the [Moltin Dashboard](https://dashboard.moltin.com/app/settings/integrations), login and go to `Settings > Integrations` and click `Create`. 94 | 95 | Enter a name and description for your Integration. We recommend you prefix the name with `DEVELOPMENT:`. 96 | 97 | Next, enter the `URL` and `Secret Key` that match those inside `.env`. 98 | 99 |  100 | 101 | Now finally you'll want to configure when this webhook will be invoked, in this example check the `Fulfilled` box. 102 | 103 |  104 | 105 | That's it! Click Save 106 | -------------------------------------------------------------------------------- /webhooks/shipping-confirmation-email/index.js: -------------------------------------------------------------------------------- 1 | const { json, send } = require('micro') 2 | const cors = require('micro-cors')() 3 | const { ServerClient: PostmarkClient } = require('postmark') 4 | 5 | const postmark = new PostmarkClient(process.env.POSTMARK_API_KEY) 6 | 7 | module.exports = cors(async (req, res) => { 8 | if ( 9 | (await req.headers['x-moltin-secret-key']) != 10 | process.env.MOLTIN_WEBHOOK_SECRET 11 | ) 12 | return send(res, 401) 13 | 14 | const data = await json(req) 15 | 16 | const resource = JSON.parse(data.resources) 17 | 18 | try { 19 | const { 20 | data: { 21 | id, 22 | customer: { email: to, name }, 23 | shipping_address: { line_1, postcode }, 24 | }, 25 | } = resource 26 | 27 | await postmark.sendEmailWithTemplate({ 28 | from: process.env.POSTMARK_FROM_ADDRESS, 29 | to, 30 | templateId: process.env.POSTMARK_SHIPPED_TEMPLATE_ID, 31 | templateModel: { 32 | customer_name: name, 33 | order_ref: id, 34 | shipping_line_1: line_1, 35 | shipping_postcode: postcode, 36 | }, 37 | }) 38 | 39 | send(res, 201) 40 | } catch ({ errors }) { 41 | send(res, 500, errors) 42 | } 43 | }) 44 | -------------------------------------------------------------------------------- /webhooks/shipping-confirmation-email/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "micro-dev", 5 | "start": "micro" 6 | }, 7 | "devDependencies": { 8 | "micro-dev": "3.1.0" 9 | }, 10 | "dependencies": { 11 | "micro": "9.4.1", 12 | "micro-cors": "0.1.1", 13 | "postmark": "2.9.5" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /webhooks/shipping-confirmation-email/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | ansi-align@^2.0.0: 6 | version "2.0.0" 7 | resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" 8 | integrity sha1-w2rsy6VjuJzrVW82kPCx2eNUf38= 9 | dependencies: 10 | string-width "^2.0.0" 11 | 12 | ansi-regex@^2.0.0: 13 | version "2.1.1" 14 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" 15 | integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= 16 | 17 | ansi-regex@^3.0.0: 18 | version "3.0.0" 19 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" 20 | integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= 21 | 22 | ansi-regex@^5.0.1: 23 | version "5.0.1" 24 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" 25 | integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== 26 | 27 | ansi-styles@^3.2.1: 28 | version "3.2.1" 29 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" 30 | integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== 31 | dependencies: 32 | color-convert "^1.9.0" 33 | 34 | anymatch@~3.1.2: 35 | version "3.1.3" 36 | resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" 37 | integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== 38 | dependencies: 39 | normalize-path "^3.0.0" 40 | picomatch "^2.0.4" 41 | 42 | arch@^2.1.0: 43 | version "2.1.1" 44 | resolved "https://registry.yarnpkg.com/arch/-/arch-2.1.1.tgz#8f5c2731aa35a30929221bb0640eed65175ec84e" 45 | integrity sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg== 46 | 47 | arg@4.1.0: 48 | version "4.1.0" 49 | resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.0.tgz#583c518199419e0037abb74062c37f8519e575f0" 50 | integrity sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg== 51 | 52 | astral-regex@^1.0.0: 53 | version "1.0.0" 54 | resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" 55 | integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== 56 | 57 | axios@^0.25.0: 58 | version "0.25.0" 59 | resolved "https://registry.yarnpkg.com/axios/-/axios-0.25.0.tgz#349cfbb31331a9b4453190791760a8d35b093e0a" 60 | integrity sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g== 61 | dependencies: 62 | follow-redirects "^1.14.7" 63 | 64 | binary-extensions@^2.0.0: 65 | version "2.2.0" 66 | resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" 67 | integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== 68 | 69 | boolbase@^1.0.0: 70 | version "1.0.0" 71 | resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" 72 | integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== 73 | 74 | boxen@1.3.0: 75 | version "1.3.0" 76 | resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" 77 | integrity sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw== 78 | dependencies: 79 | ansi-align "^2.0.0" 80 | camelcase "^4.0.0" 81 | chalk "^2.0.1" 82 | cli-boxes "^1.0.0" 83 | string-width "^2.0.0" 84 | term-size "^1.2.0" 85 | widest-line "^2.0.0" 86 | 87 | braces@~3.0.2: 88 | version "3.0.2" 89 | resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" 90 | integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== 91 | dependencies: 92 | fill-range "^7.0.1" 93 | 94 | bytes@3.0.0: 95 | version "3.0.0" 96 | resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" 97 | integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= 98 | 99 | camelcase@^4.0.0, camelcase@^4.1.0: 100 | version "4.1.0" 101 | resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" 102 | integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= 103 | 104 | chalk@2.4.1: 105 | version "2.4.1" 106 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" 107 | integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== 108 | dependencies: 109 | ansi-styles "^3.2.1" 110 | escape-string-regexp "^1.0.5" 111 | supports-color "^5.3.0" 112 | 113 | chalk@^2.0.1, chalk@^2.3.0: 114 | version "2.4.2" 115 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" 116 | integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== 117 | dependencies: 118 | ansi-styles "^3.2.1" 119 | escape-string-regexp "^1.0.5" 120 | supports-color "^5.3.0" 121 | 122 | chokidar@3.5.3: 123 | version "3.5.3" 124 | resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" 125 | integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== 126 | dependencies: 127 | anymatch "~3.1.2" 128 | braces "~3.0.2" 129 | glob-parent "~5.1.2" 130 | is-binary-path "~2.1.0" 131 | is-glob "~4.0.1" 132 | normalize-path "~3.0.0" 133 | readdirp "~3.6.0" 134 | optionalDependencies: 135 | fsevents "~2.3.2" 136 | 137 | cli-boxes@^1.0.0: 138 | version "1.0.0" 139 | resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" 140 | integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= 141 | 142 | clipboardy@1.2.3: 143 | version "1.2.3" 144 | resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-1.2.3.tgz#0526361bf78724c1f20be248d428e365433c07ef" 145 | integrity sha512-2WNImOvCRe6r63Gk9pShfkwXsVtKCroMAevIbiae021mS850UkWPbevxsBz3tnvjZIEGvlwaqCPsw+4ulzNgJA== 146 | dependencies: 147 | arch "^2.1.0" 148 | execa "^0.8.0" 149 | 150 | cliui@^4.0.0: 151 | version "4.1.0" 152 | resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" 153 | integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== 154 | dependencies: 155 | string-width "^2.1.1" 156 | strip-ansi "^4.0.0" 157 | wrap-ansi "^2.0.0" 158 | 159 | code-point-at@^1.0.0: 160 | version "1.1.0" 161 | resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" 162 | integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= 163 | 164 | color-convert@^1.9.0: 165 | version "1.9.3" 166 | resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" 167 | integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== 168 | dependencies: 169 | color-name "1.1.3" 170 | 171 | color-name@1.1.3: 172 | version "1.1.3" 173 | resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" 174 | integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= 175 | 176 | content-type@1.0.4: 177 | version "1.0.4" 178 | resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" 179 | integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== 180 | 181 | cross-spawn@^5.0.1: 182 | version "5.1.0" 183 | resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" 184 | integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= 185 | dependencies: 186 | lru-cache "^4.0.1" 187 | shebang-command "^1.2.0" 188 | which "^1.2.9" 189 | 190 | css-select@^4.1.3: 191 | version "4.3.0" 192 | resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.3.0.tgz#db7129b2846662fd8628cfc496abb2b59e41529b" 193 | integrity sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ== 194 | dependencies: 195 | boolbase "^1.0.0" 196 | css-what "^6.0.1" 197 | domhandler "^4.3.1" 198 | domutils "^2.8.0" 199 | nth-check "^2.0.1" 200 | 201 | css-what@^6.0.1: 202 | version "6.1.0" 203 | resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" 204 | integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== 205 | 206 | debounce@1.1.0: 207 | version "1.1.0" 208 | resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.1.0.tgz#6a1a4ee2a9dc4b7c24bb012558dbcdb05b37f408" 209 | integrity sha512-ZQVKfRVlwRfD150ndzEK8M90ABT+Y/JQKs4Y7U4MXdpuoUkkrr4DwKbVux3YjylA5bUMUj0Nc3pMxPJX6N2QQQ== 210 | 211 | decamelize@^1.1.1: 212 | version "1.2.0" 213 | resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" 214 | integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= 215 | 216 | depd@1.1.1: 217 | version "1.1.1" 218 | resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" 219 | integrity sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k= 220 | 221 | dom-converter@^0.2.0: 222 | version "0.2.0" 223 | resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" 224 | integrity sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA== 225 | dependencies: 226 | utila "~0.4" 227 | 228 | dom-serializer@^1.0.1: 229 | version "1.4.1" 230 | resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30" 231 | integrity sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag== 232 | dependencies: 233 | domelementtype "^2.0.1" 234 | domhandler "^4.2.0" 235 | entities "^2.0.0" 236 | 237 | domelementtype@^2.0.1, domelementtype@^2.2.0: 238 | version "2.3.0" 239 | resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" 240 | integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== 241 | 242 | domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.3.1: 243 | version "4.3.1" 244 | resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" 245 | integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== 246 | dependencies: 247 | domelementtype "^2.2.0" 248 | 249 | domutils@^2.5.2, domutils@^2.8.0: 250 | version "2.8.0" 251 | resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" 252 | integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== 253 | dependencies: 254 | dom-serializer "^1.0.1" 255 | domelementtype "^2.2.0" 256 | domhandler "^4.2.0" 257 | 258 | dotenv@5.0.1: 259 | version "5.0.1" 260 | resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef" 261 | integrity sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow== 262 | 263 | entities@^2.0.0: 264 | version "2.2.0" 265 | resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" 266 | integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== 267 | 268 | escape-string-regexp@^1.0.5: 269 | version "1.0.5" 270 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 271 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= 272 | 273 | execa@^0.7.0: 274 | version "0.7.0" 275 | resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" 276 | integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= 277 | dependencies: 278 | cross-spawn "^5.0.1" 279 | get-stream "^3.0.0" 280 | is-stream "^1.1.0" 281 | npm-run-path "^2.0.0" 282 | p-finally "^1.0.0" 283 | signal-exit "^3.0.0" 284 | strip-eof "^1.0.0" 285 | 286 | execa@^0.8.0: 287 | version "0.8.0" 288 | resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" 289 | integrity sha1-2NdrvBtVIX7RkP1t1J08d07PyNo= 290 | dependencies: 291 | cross-spawn "^5.0.1" 292 | get-stream "^3.0.0" 293 | is-stream "^1.1.0" 294 | npm-run-path "^2.0.0" 295 | p-finally "^1.0.0" 296 | signal-exit "^3.0.0" 297 | strip-eof "^1.0.0" 298 | 299 | fill-range@^7.0.1: 300 | version "7.0.1" 301 | resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" 302 | integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== 303 | dependencies: 304 | to-regex-range "^5.0.1" 305 | 306 | find-up@^2.1.0: 307 | version "2.1.0" 308 | resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" 309 | integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= 310 | dependencies: 311 | locate-path "^2.0.0" 312 | 313 | follow-redirects@^1.14.7: 314 | version "1.14.9" 315 | resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" 316 | integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== 317 | 318 | fsevents@~2.3.2: 319 | version "2.3.2" 320 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" 321 | integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== 322 | 323 | get-caller-file@^1.0.1: 324 | version "1.0.3" 325 | resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" 326 | integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== 327 | 328 | get-port@3.2.0: 329 | version "3.2.0" 330 | resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" 331 | integrity sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw= 332 | 333 | get-stream@^3.0.0: 334 | version "3.0.0" 335 | resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" 336 | integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= 337 | 338 | glob-parent@~5.1.2: 339 | version "5.1.2" 340 | resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" 341 | integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== 342 | dependencies: 343 | is-glob "^4.0.1" 344 | 345 | has-flag@^3.0.0: 346 | version "3.0.0" 347 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" 348 | integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= 349 | 350 | htmlparser2@^6.1.0: 351 | version "6.1.0" 352 | resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" 353 | integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A== 354 | dependencies: 355 | domelementtype "^2.0.1" 356 | domhandler "^4.0.0" 357 | domutils "^2.5.2" 358 | entities "^2.0.0" 359 | 360 | http-errors@1.6.2: 361 | version "1.6.2" 362 | resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" 363 | integrity sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY= 364 | dependencies: 365 | depd "1.1.1" 366 | inherits "2.0.3" 367 | setprototypeof "1.0.3" 368 | statuses ">= 1.3.1 < 2" 369 | 370 | iconv-lite@0.4.19: 371 | version "0.4.19" 372 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" 373 | integrity sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ== 374 | 375 | inherits@2.0.3: 376 | version "2.0.3" 377 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 378 | integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= 379 | 380 | invert-kv@^1.0.0: 381 | version "1.0.0" 382 | resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" 383 | integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= 384 | 385 | ip@1.1.5: 386 | version "1.1.5" 387 | resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" 388 | integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= 389 | 390 | is-binary-path@~2.1.0: 391 | version "2.1.0" 392 | resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" 393 | integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== 394 | dependencies: 395 | binary-extensions "^2.0.0" 396 | 397 | is-extglob@^2.1.1: 398 | version "2.1.1" 399 | resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" 400 | integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= 401 | 402 | is-fullwidth-code-point@^1.0.0: 403 | version "1.0.0" 404 | resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" 405 | integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= 406 | dependencies: 407 | number-is-nan "^1.0.0" 408 | 409 | is-fullwidth-code-point@^2.0.0: 410 | version "2.0.0" 411 | resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" 412 | integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= 413 | 414 | is-glob@^4.0.1, is-glob@~4.0.1: 415 | version "4.0.3" 416 | resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" 417 | integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== 418 | dependencies: 419 | is-extglob "^2.1.1" 420 | 421 | is-number@^7.0.0: 422 | version "7.0.0" 423 | resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" 424 | integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== 425 | 426 | is-stream@1.1.0, is-stream@^1.1.0: 427 | version "1.1.0" 428 | resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" 429 | integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= 430 | 431 | isexe@^2.0.0: 432 | version "2.0.0" 433 | resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" 434 | integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= 435 | 436 | jsome@2.5.0: 437 | version "2.5.0" 438 | resolved "https://registry.yarnpkg.com/jsome/-/jsome-2.5.0.tgz#5e417eef4341ffeb83ee8bfa9265b36d56fe49ed" 439 | integrity sha1-XkF+70NB/+uD7ov6kmWzbVb+Se0= 440 | dependencies: 441 | chalk "^2.3.0" 442 | json-stringify-safe "^5.0.1" 443 | yargs "^11.0.0" 444 | 445 | json-stringify-safe@^5.0.1: 446 | version "5.0.1" 447 | resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" 448 | integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= 449 | 450 | lcid@^1.0.0: 451 | version "1.0.0" 452 | resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" 453 | integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= 454 | dependencies: 455 | invert-kv "^1.0.0" 456 | 457 | locate-path@^2.0.0: 458 | version "2.0.0" 459 | resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" 460 | integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= 461 | dependencies: 462 | p-locate "^2.0.0" 463 | path-exists "^3.0.0" 464 | 465 | lodash@^4.17.20, lodash@^4.17.21: 466 | version "4.17.21" 467 | resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" 468 | integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== 469 | 470 | lru-cache@^4.0.1: 471 | version "4.1.5" 472 | resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" 473 | integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== 474 | dependencies: 475 | pseudomap "^1.0.2" 476 | yallist "^2.1.2" 477 | 478 | mem@^1.1.0: 479 | version "1.1.0" 480 | resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" 481 | integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= 482 | dependencies: 483 | mimic-fn "^1.0.0" 484 | 485 | micro-cors@0.1.1: 486 | version "0.1.1" 487 | resolved "https://registry.yarnpkg.com/micro-cors/-/micro-cors-0.1.1.tgz#af7a480182c114ffd1ada84ad9dffc52bb4f4054" 488 | integrity sha512-6WqIahA5sbQR1Gjexp1VuWGFDKbZZleJb/gy1khNGk18a6iN1FdTcr3Q8twaxkV5H94RjxIBjirYbWCehpMBFw== 489 | 490 | micro-dev@3.1.0: 491 | version "3.1.0" 492 | resolved "https://registry.yarnpkg.com/micro-dev/-/micro-dev-3.1.0.tgz#e0344ed9af02d251305c77b8342df1d943dbbbe0" 493 | integrity sha512-LntYVIReq6qqUa0/Cxe6a4OD8p/Z9N9khM4sQkBal1rR3ZdOnb61eqRxoaj7w2D9IDJs3tCpphM1DpXVB2XlsQ== 494 | dependencies: 495 | boxen "1.3.0" 496 | chalk "2.4.1" 497 | chokidar "3.5.3" 498 | clipboardy "1.2.3" 499 | debounce "1.1.0" 500 | dotenv "5.0.1" 501 | get-port "3.2.0" 502 | ip "1.1.5" 503 | jsome "2.5.0" 504 | mri "1.1.1" 505 | pkg-up "2.0.0" 506 | pretty-error "4.0.0" 507 | string-length "2.0.0" 508 | 509 | micro@9.3.4: 510 | version "9.3.4" 511 | resolved "https://registry.yarnpkg.com/micro/-/micro-9.3.4.tgz#745a494e53c8916f64fb6a729f8cbf2a506b35ad" 512 | integrity sha512-smz9naZwTG7qaFnEZ2vn248YZq9XR+XoOH3auieZbkhDL4xLOxiE+KqG8qqnBeKfXA9c1uEFGCxPN1D+nT6N7w== 513 | dependencies: 514 | arg "4.1.0" 515 | content-type "1.0.4" 516 | is-stream "1.1.0" 517 | raw-body "2.3.2" 518 | 519 | mimic-fn@^1.0.0: 520 | version "1.2.0" 521 | resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" 522 | integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== 523 | 524 | mri@1.1.1: 525 | version "1.1.1" 526 | resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.1.tgz#85aa26d3daeeeedf80dc5984af95cc5ca5cad9f1" 527 | integrity sha1-haom09ru7t+A3FmEr5XMXKXK2fE= 528 | 529 | normalize-path@^3.0.0, normalize-path@~3.0.0: 530 | version "3.0.0" 531 | resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" 532 | integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== 533 | 534 | npm-run-path@^2.0.0: 535 | version "2.0.2" 536 | resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" 537 | integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= 538 | dependencies: 539 | path-key "^2.0.0" 540 | 541 | nth-check@^2.0.1: 542 | version "2.1.1" 543 | resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" 544 | integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== 545 | dependencies: 546 | boolbase "^1.0.0" 547 | 548 | number-is-nan@^1.0.0: 549 | version "1.0.1" 550 | resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" 551 | integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= 552 | 553 | os-locale@^2.0.0: 554 | version "2.1.0" 555 | resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" 556 | integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== 557 | dependencies: 558 | execa "^0.7.0" 559 | lcid "^1.0.0" 560 | mem "^1.1.0" 561 | 562 | p-finally@^1.0.0: 563 | version "1.0.0" 564 | resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" 565 | integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= 566 | 567 | p-limit@^1.1.0: 568 | version "1.3.0" 569 | resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" 570 | integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== 571 | dependencies: 572 | p-try "^1.0.0" 573 | 574 | p-locate@^2.0.0: 575 | version "2.0.0" 576 | resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" 577 | integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= 578 | dependencies: 579 | p-limit "^1.1.0" 580 | 581 | p-try@^1.0.0: 582 | version "1.0.0" 583 | resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" 584 | integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= 585 | 586 | path-exists@^3.0.0: 587 | version "3.0.0" 588 | resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" 589 | integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= 590 | 591 | path-key@^2.0.0: 592 | version "2.0.1" 593 | resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" 594 | integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= 595 | 596 | picomatch@^2.0.4, picomatch@^2.2.1: 597 | version "2.3.1" 598 | resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" 599 | integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== 600 | 601 | pkg-up@2.0.0: 602 | version "2.0.0" 603 | resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" 604 | integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= 605 | dependencies: 606 | find-up "^2.1.0" 607 | 608 | postmark@2.9.5: 609 | version "2.9.5" 610 | resolved "https://registry.yarnpkg.com/postmark/-/postmark-2.9.5.tgz#d863f3cea6242c1531ace3c53756f706f32d3eeb" 611 | integrity sha512-F27gc6wrxdn7GADodGpECoWez7FK2Pdach7A9ni5vVZiYz1YUY7T68nvVCzxrbWCjOS7ZujyclYlq1C0a4ar1w== 612 | dependencies: 613 | axios "^0.25.0" 614 | 615 | pretty-error@4.0.0: 616 | version "4.0.0" 617 | resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-4.0.0.tgz#90a703f46dd7234adb46d0f84823e9d1cb8f10d6" 618 | integrity sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw== 619 | dependencies: 620 | lodash "^4.17.20" 621 | renderkid "^3.0.0" 622 | 623 | pseudomap@^1.0.2: 624 | version "1.0.2" 625 | resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" 626 | integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= 627 | 628 | raw-body@2.3.2: 629 | version "2.3.2" 630 | resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89" 631 | integrity sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k= 632 | dependencies: 633 | bytes "3.0.0" 634 | http-errors "1.6.2" 635 | iconv-lite "0.4.19" 636 | unpipe "1.0.0" 637 | 638 | readdirp@~3.6.0: 639 | version "3.6.0" 640 | resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" 641 | integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== 642 | dependencies: 643 | picomatch "^2.2.1" 644 | 645 | renderkid@^3.0.0: 646 | version "3.0.0" 647 | resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-3.0.0.tgz#5fd823e4d6951d37358ecc9a58b1f06836b6268a" 648 | integrity sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg== 649 | dependencies: 650 | css-select "^4.1.3" 651 | dom-converter "^0.2.0" 652 | htmlparser2 "^6.1.0" 653 | lodash "^4.17.21" 654 | strip-ansi "^6.0.1" 655 | 656 | require-directory@^2.1.1: 657 | version "2.1.1" 658 | resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" 659 | integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= 660 | 661 | require-main-filename@^1.0.1: 662 | version "1.0.1" 663 | resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" 664 | integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= 665 | 666 | set-blocking@^2.0.0: 667 | version "2.0.0" 668 | resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" 669 | integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= 670 | 671 | setprototypeof@1.0.3: 672 | version "1.0.3" 673 | resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" 674 | integrity sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ= 675 | 676 | shebang-command@^1.2.0: 677 | version "1.2.0" 678 | resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" 679 | integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= 680 | dependencies: 681 | shebang-regex "^1.0.0" 682 | 683 | shebang-regex@^1.0.0: 684 | version "1.0.0" 685 | resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" 686 | integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= 687 | 688 | signal-exit@^3.0.0: 689 | version "3.0.2" 690 | resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" 691 | integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= 692 | 693 | "statuses@>= 1.3.1 < 2": 694 | version "1.5.0" 695 | resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" 696 | integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= 697 | 698 | string-length@2.0.0: 699 | version "2.0.0" 700 | resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" 701 | integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= 702 | dependencies: 703 | astral-regex "^1.0.0" 704 | strip-ansi "^4.0.0" 705 | 706 | string-width@^1.0.1: 707 | version "1.0.2" 708 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" 709 | integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= 710 | dependencies: 711 | code-point-at "^1.0.0" 712 | is-fullwidth-code-point "^1.0.0" 713 | strip-ansi "^3.0.0" 714 | 715 | string-width@^2.0.0, string-width@^2.1.1: 716 | version "2.1.1" 717 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" 718 | integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== 719 | dependencies: 720 | is-fullwidth-code-point "^2.0.0" 721 | strip-ansi "^4.0.0" 722 | 723 | strip-ansi@^3.0.0, strip-ansi@^3.0.1: 724 | version "3.0.1" 725 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" 726 | integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= 727 | dependencies: 728 | ansi-regex "^2.0.0" 729 | 730 | strip-ansi@^4.0.0: 731 | version "4.0.0" 732 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" 733 | integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= 734 | dependencies: 735 | ansi-regex "^3.0.0" 736 | 737 | strip-ansi@^6.0.1: 738 | version "6.0.1" 739 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" 740 | integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== 741 | dependencies: 742 | ansi-regex "^5.0.1" 743 | 744 | strip-eof@^1.0.0: 745 | version "1.0.0" 746 | resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" 747 | integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= 748 | 749 | supports-color@^5.3.0: 750 | version "5.5.0" 751 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" 752 | integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== 753 | dependencies: 754 | has-flag "^3.0.0" 755 | 756 | term-size@^1.2.0: 757 | version "1.2.0" 758 | resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" 759 | integrity sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk= 760 | dependencies: 761 | execa "^0.7.0" 762 | 763 | to-regex-range@^5.0.1: 764 | version "5.0.1" 765 | resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" 766 | integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== 767 | dependencies: 768 | is-number "^7.0.0" 769 | 770 | unpipe@1.0.0: 771 | version "1.0.0" 772 | resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" 773 | integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= 774 | 775 | utila@~0.4: 776 | version "0.4.0" 777 | resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" 778 | integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= 779 | 780 | which-module@^2.0.0: 781 | version "2.0.0" 782 | resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" 783 | integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= 784 | 785 | which@^1.2.9: 786 | version "1.3.1" 787 | resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" 788 | integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== 789 | dependencies: 790 | isexe "^2.0.0" 791 | 792 | widest-line@^2.0.0: 793 | version "2.0.1" 794 | resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" 795 | integrity sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA== 796 | dependencies: 797 | string-width "^2.1.1" 798 | 799 | wrap-ansi@^2.0.0: 800 | version "2.1.0" 801 | resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" 802 | integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= 803 | dependencies: 804 | string-width "^1.0.1" 805 | strip-ansi "^3.0.1" 806 | 807 | y18n@^3.2.1: 808 | version "3.2.1" 809 | resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" 810 | integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= 811 | 812 | yallist@^2.1.2: 813 | version "2.1.2" 814 | resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" 815 | integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= 816 | 817 | yargs-parser@^9.0.2: 818 | version "9.0.2" 819 | resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" 820 | integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= 821 | dependencies: 822 | camelcase "^4.1.0" 823 | 824 | yargs@^11.0.0: 825 | version "11.1.0" 826 | resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" 827 | integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== 828 | dependencies: 829 | cliui "^4.0.0" 830 | decamelize "^1.1.1" 831 | find-up "^2.1.0" 832 | get-caller-file "^1.0.1" 833 | os-locale "^2.0.0" 834 | require-directory "^2.1.1" 835 | require-main-filename "^1.0.1" 836 | set-blocking "^2.0.0" 837 | string-width "^2.0.0" 838 | which-module "^2.0.0" 839 | y18n "^3.2.1" 840 | yargs-parser "^9.0.2" 841 | -------------------------------------------------------------------------------- /webhooks/shipping-confirmation-sms/README.md: -------------------------------------------------------------------------------- 1 | # Shipping Confirmation SMS 2 | 3 | This example demonstrates how you can send an shipping confirmation SMS via Twilio using Moltin webhooks. 4 | 5 | ## How to use locally 6 | 7 | When running this example locally it's recommended you use a service like [ngrok](https://ngrok.com) to tunnel your dev environment to the outside world. 8 | 9 | Once you have the repo running locally, you'll want to add the integration via the [Moltin Dashboard](https://dashboard.moltin.com/app/settings/integrations). The `URL` will be the one provided by ngrok. 10 | 11 | ### 1. Download the example 12 | 13 | Clone the repository: 14 | 15 | ```bash 16 | git clone git@github.com:moltin/integration-examples.git 17 | ``` 18 | 19 | Install dependencies with Yarn 20 | 21 | ```bash 22 | cd integration-examples/shipping-confirmation-sms 23 | yarn 24 | ``` 25 | 26 | ### 2. Configure Twilio 27 | 28 | In this example we will send our shipping confirmation via [Twilio](https://www.twilio.com). You will need an account an account to continue. 29 | 30 | Once you've signed up, head over to their [Programmable SMS](https://www.twilio.com/console/sms/dashboard) page and **Get a number**. You'll have to enter your address to comply with local regulations but once done, you'll have a new phone number. 31 | 32 | Next you will need to get your `Account SID` and `Auth Token`. You can get these by clicking on the `Show API credentials` dropdown. 33 | 34 |  35 | 36 | ### 3. Configure your ENV variables 37 | 38 | You will want to create an `.env` inside the directory `/shipping-confirmation-sms` containing all the keys for the below: 39 | 40 | ```shell 41 | TWILIO_ACCOUNT_SID= 42 | TWILIO_AUTH_TOKEN= 43 | TWILIO_FROM_NUMBER= 44 | MOLTIN_CLIENT_ID= 45 | MOLTIN_CLIENT_SECRET= 46 | MOLTIN_WEBHOOK_SECRET= 47 | ``` 48 | 49 | `MOLTIN_WEBHOOK_SECRET` can be anything you want. 50 | 51 | ### 4. Start the server and ngrok 52 | 53 | Start the development server 54 | 55 | ```bash 56 | yarn dev 57 | ``` 58 | 59 | The server will typically start on PORT `3000`, if not, make a note for the next step. 60 | 61 | Start ngrok 62 | 63 | ```bash 64 | ngrok http 3000 65 | ``` 66 | 67 | This will expose PORT `3000` to the outside world. Make a note of the `http` URL ngrok provides. 68 | 69 | ### 5. Create a new Moltin integration 70 | 71 | You must now tell Moltin the ngrok URL above. Head to the [Moltin Dashboard](https://dashboard.moltin.com/app/settings/integrations), login and go to `Settings > Integrations` and click `Create`. 72 | 73 | Enter a name and description for your Integration. We recommend you prefix the name with `DEVELOPMENT:`. 74 | 75 | Next, enter the `URL` and `Secret Key` that match those inside `.env`. 76 | 77 |  78 | 79 | Now finally you'll want to configure when this webhook will be invoked, in this example check the `Fulfilled` box. 80 | 81 |  82 | 83 | That's it! Click Save 84 | 85 | ### 6. How to use 86 | 87 | Now that our integration is setup and configured, you will need to update the Order after Checkout to include the customers phone number. 88 | -------------------------------------------------------------------------------- /webhooks/shipping-confirmation-sms/index.js: -------------------------------------------------------------------------------- 1 | const { json, send } = require('micro') 2 | const cors = require('micro-cors')() 3 | const { createClient } = require('@moltin/request') 4 | const twilio = require('twilio') 5 | 6 | const twilioClient = new twilio( 7 | process.env.TWILIO_ACCOUNT_SID, 8 | process.env.TWILIO_AUTH_TOKEN 9 | ) 10 | 11 | const moltin = new createClient({ 12 | client_id: process.env.MOLTIN_CLIENT_ID, 13 | client_secret: MOLTIN_CLIENT_SECRET, 14 | application: 'example-order-confirmation-sms', 15 | }) 16 | 17 | module.exports = cors(async (req, res) => { 18 | if ( 19 | (await req.headers['x-moltin-secret-key']) != 20 | process.env.MOLTIN_WEBHOOK_SECRET 21 | ) 22 | return send(res, 401) 23 | 24 | const payload = await json(req) 25 | 26 | const { 27 | data: { id }, 28 | } = JSON.parse(payload.resources) 29 | 30 | try { 31 | // We need to make a call to Moltin to get number 32 | // as Flows aren't sent with the webhook 33 | const { 34 | data: { phone_number: to }, 35 | } = await moltin.get(`orders/${id}`) 36 | 37 | const body = await twilioClient.messages.create({ 38 | to, 39 | from: process.env.TWILIO_FROM_NUMBER, 40 | body: `Your order ${id} is on the way!`, 41 | }) 42 | 43 | send(res, 200, body) 44 | } catch (errors) { 45 | send(res, 500, errors) 46 | } 47 | }) 48 | -------------------------------------------------------------------------------- /webhooks/shipping-confirmation-sms/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "order-confirmation-sms", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "dependencies": { 7 | "@moltin/request": "^1.4.3", 8 | "micro": "^9.3.3", 9 | "micro-cors": "^0.1.1", 10 | "twilio": "^3.28.0" 11 | }, 12 | "devDependencies": { 13 | "micro-dev": "3.1.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /webhooks/short-order-id/README.md: -------------------------------------------------------------------------------- 1 | # Short Order ID 2 | 3 | This example demonstrates how you can create short order IDs using Moltin webhooks. 4 | 5 | ## How to use locally 6 | 7 | When running this example locally it's recommended you use a service like [ngrok](https://ngrok.com) to tunnel your dev environment to the outside world. 8 | 9 | Once you have the repo running locally, you'll want to add the integration via the [Moltin Dashboard](https://dashboard.moltin.com/app/settings/integrations). The `URL` will be the one provided by ngrok. 10 | 11 | ### 1. Download the example 12 | 13 | Clone the repository: 14 | 15 | ```bash 16 | git clone git@github.com:moltin/integration-examples.git 17 | ``` 18 | 19 | Install dependencies with Yarn 20 | 21 | ```bash 22 | cd integration-examples/short-order-id 23 | yarn 24 | ``` 25 | 26 | ### 2. Configure Flows 27 | 28 | Moltin provides you the ability to extend core resources with the Flows feature. Go to the [Moltin Dashboard](https://dashboard.moltin.com/app/settings/flows) and navigate to `Settings > Flows`. 29 | 30 | Here you will want to create a new Flow (or edit if it already exists) for extending Orders. Give it a name and description you will recognise, but **make sure** the `slug` is set to `orders`. 31 | 32 |  33 | 34 | Next you will want to create a new Field for the Flow you just created. 35 | 36 |  37 | 38 | Give the new Field a name and description you will recognise. **Make sure** the `slug` is set to `short_id` as this is what the serverless function expects. 39 | 40 |  41 | 42 | Save this Field 43 | 44 | ### 3. Configure your ENV variables 45 | 46 | You will want to create an `.env` inside the directory `/short-order-id` containing all the keys for the below: 47 | 48 | ```shell 49 | MOLTIN_CLIENT_ID= 50 | MOLTIN_CLIENT_SECRET= 51 | MOLTIN_WEBHOOK_SECRET= 52 | ``` 53 | 54 | `MOLTIN_WEBHOOK_SECRET` can be anything you want. 55 | 56 | ### 4. Start the server and ngrok 57 | 58 | Start the development server 59 | 60 | ```bash 61 | yarn dev 62 | ``` 63 | 64 | The server will typically start on PORT `3000`, if not, make a note for the next step. 65 | 66 | Start ngrok 67 | 68 | ```bash 69 | ngrok http 3000 70 | ``` 71 | 72 | This will expose PORT `3000` to the outside world. Make a note of the `http` URL ngrok provides. 73 | 74 | ### 5. Create a new Moltin integration 75 | 76 | You must now tell Moltin the ngrok URL above. Head to the [Moltin Dashboard](https://dashboard.moltin.com/app/settings/integrations), login and go to `Settings > Integrations` and click `Create`. 77 | 78 | Enter a name and description for your Integration. We recommend you prefix the name with `DEVELOPMENT:`. 79 | 80 | Next, enter the `URL` and `Secret Key` that match those inside `.env`. 81 | 82 |  83 | 84 | Now finally you'll want to configure when this webhook will be invoked, in this example check the `Created` box. 85 | 86 |  87 | 88 | That's it! Click Save 89 | -------------------------------------------------------------------------------- /webhooks/short-order-id/index.js: -------------------------------------------------------------------------------- 1 | const { json, send } = require('micro') 2 | const cors = require('micro-cors')() 3 | const { createClient } = require('@moltin/request') 4 | const cuid = require('cuid') 5 | 6 | const moltin = new createClient({ 7 | client_id: process.env.MOLTIN_CLIENT_ID, 8 | client_secret: MOLTIN_CLIENT_SECRET, 9 | application: 'example-short-order-id', 10 | }) 11 | 12 | module.exports = cors(async (req, res) => { 13 | if ( 14 | (await req.headers['x-moltin-secret-key']) != 15 | process.env.MOLTIN_WEBHOOK_SECRET 16 | ) 17 | return send(res, 401) 18 | 19 | const payload = await json(req) 20 | 21 | const { 22 | data: { id }, 23 | } = JSON.parse(payload.resources) 24 | 25 | try { 26 | const short_id = cuid.slug().toUpperCase() 27 | 28 | await moltin.put(`orders/${id}`, { 29 | type: 'order', 30 | short_id, 31 | }) 32 | 33 | send(res, 200) 34 | } catch (errors) { 35 | send(res, 500, errors) 36 | } 37 | }) 38 | -------------------------------------------------------------------------------- /webhooks/short-order-id/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "micro-dev", 5 | "start": "micro" 6 | }, 7 | "devDependencies": { 8 | "micro-dev": "3.1.0" 9 | }, 10 | "dependencies": { 11 | "@moltin/request": "1.6.2", 12 | "cuid": "2.1.8", 13 | "micro": "9.4.1", 14 | "micro-cors": "0.1.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /webhooks/short-order-id/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@moltin/request@1.6.2": 6 | version "1.6.2" 7 | resolved "https://registry.yarnpkg.com/@moltin/request/-/request-1.6.2.tgz#080c5726d7c78b9cfdc5a36b420c96eaccdbb1db" 8 | integrity sha512-BFX6SgBjH3WlM+zo8+RgDYbkxCl3uAjqSDFE3Xh0gRpJ0KZeuLN4mR319z3OCRh2k1L83NfHwwH9GLKM/3ruAg== 9 | dependencies: 10 | cross-fetch "3.0.3" 11 | 12 | ansi-align@^2.0.0: 13 | version "2.0.0" 14 | resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" 15 | integrity sha1-w2rsy6VjuJzrVW82kPCx2eNUf38= 16 | dependencies: 17 | string-width "^2.0.0" 18 | 19 | ansi-regex@^2.0.0: 20 | version "2.1.1" 21 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" 22 | integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= 23 | 24 | ansi-regex@^3.0.0: 25 | version "3.0.0" 26 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" 27 | integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= 28 | 29 | ansi-regex@^5.0.1: 30 | version "5.0.1" 31 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" 32 | integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== 33 | 34 | ansi-styles@^3.2.1: 35 | version "3.2.1" 36 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" 37 | integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== 38 | dependencies: 39 | color-convert "^1.9.0" 40 | 41 | anymatch@~3.1.2: 42 | version "3.1.3" 43 | resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" 44 | integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== 45 | dependencies: 46 | normalize-path "^3.0.0" 47 | picomatch "^2.0.4" 48 | 49 | arch@^2.1.0: 50 | version "2.1.1" 51 | resolved "https://registry.yarnpkg.com/arch/-/arch-2.1.1.tgz#8f5c2731aa35a30929221bb0640eed65175ec84e" 52 | integrity sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg== 53 | 54 | arg@4.1.0: 55 | version "4.1.0" 56 | resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.0.tgz#583c518199419e0037abb74062c37f8519e575f0" 57 | integrity sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg== 58 | 59 | astral-regex@^1.0.0: 60 | version "1.0.0" 61 | resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" 62 | integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== 63 | 64 | binary-extensions@^2.0.0: 65 | version "2.2.0" 66 | resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" 67 | integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== 68 | 69 | boolbase@^1.0.0: 70 | version "1.0.0" 71 | resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" 72 | integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== 73 | 74 | boxen@1.3.0: 75 | version "1.3.0" 76 | resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" 77 | integrity sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw== 78 | dependencies: 79 | ansi-align "^2.0.0" 80 | camelcase "^4.0.0" 81 | chalk "^2.0.1" 82 | cli-boxes "^1.0.0" 83 | string-width "^2.0.0" 84 | term-size "^1.2.0" 85 | widest-line "^2.0.0" 86 | 87 | braces@~3.0.2: 88 | version "3.0.2" 89 | resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" 90 | integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== 91 | dependencies: 92 | fill-range "^7.0.1" 93 | 94 | bytes@3.0.0: 95 | version "3.0.0" 96 | resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" 97 | integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= 98 | 99 | camelcase@^4.0.0, camelcase@^4.1.0: 100 | version "4.1.0" 101 | resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" 102 | integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= 103 | 104 | chalk@2.4.1: 105 | version "2.4.1" 106 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" 107 | integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== 108 | dependencies: 109 | ansi-styles "^3.2.1" 110 | escape-string-regexp "^1.0.5" 111 | supports-color "^5.3.0" 112 | 113 | chalk@^2.0.1, chalk@^2.3.0: 114 | version "2.4.2" 115 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" 116 | integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== 117 | dependencies: 118 | ansi-styles "^3.2.1" 119 | escape-string-regexp "^1.0.5" 120 | supports-color "^5.3.0" 121 | 122 | chokidar@3.5.3: 123 | version "3.5.3" 124 | resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" 125 | integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== 126 | dependencies: 127 | anymatch "~3.1.2" 128 | braces "~3.0.2" 129 | glob-parent "~5.1.2" 130 | is-binary-path "~2.1.0" 131 | is-glob "~4.0.1" 132 | normalize-path "~3.0.0" 133 | readdirp "~3.6.0" 134 | optionalDependencies: 135 | fsevents "~2.3.2" 136 | 137 | cli-boxes@^1.0.0: 138 | version "1.0.0" 139 | resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" 140 | integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= 141 | 142 | clipboardy@1.2.3: 143 | version "1.2.3" 144 | resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-1.2.3.tgz#0526361bf78724c1f20be248d428e365433c07ef" 145 | integrity sha512-2WNImOvCRe6r63Gk9pShfkwXsVtKCroMAevIbiae021mS850UkWPbevxsBz3tnvjZIEGvlwaqCPsw+4ulzNgJA== 146 | dependencies: 147 | arch "^2.1.0" 148 | execa "^0.8.0" 149 | 150 | cliui@^4.0.0: 151 | version "4.1.0" 152 | resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" 153 | integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== 154 | dependencies: 155 | string-width "^2.1.1" 156 | strip-ansi "^4.0.0" 157 | wrap-ansi "^2.0.0" 158 | 159 | code-point-at@^1.0.0: 160 | version "1.1.0" 161 | resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" 162 | integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= 163 | 164 | color-convert@^1.9.0: 165 | version "1.9.3" 166 | resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" 167 | integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== 168 | dependencies: 169 | color-name "1.1.3" 170 | 171 | color-name@1.1.3: 172 | version "1.1.3" 173 | resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" 174 | integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= 175 | 176 | content-type@1.0.4: 177 | version "1.0.4" 178 | resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" 179 | integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== 180 | 181 | cross-fetch@3.0.3: 182 | version "3.0.3" 183 | resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.3.tgz#b988beab275939cb77ad4e362c873f7fa8a221a5" 184 | integrity sha512-mplYkc4CopHu+AdHK8wxjJcPskUxp5CvPTdtDij3MUgVNBa0xOb9CQqbbn1zO23qISM4WLxIBociyEVQL7WQAg== 185 | dependencies: 186 | node-fetch "2.6.0" 187 | whatwg-fetch "3.0.0" 188 | 189 | cross-spawn@^5.0.1: 190 | version "5.1.0" 191 | resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" 192 | integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= 193 | dependencies: 194 | lru-cache "^4.0.1" 195 | shebang-command "^1.2.0" 196 | which "^1.2.9" 197 | 198 | css-select@^4.1.3: 199 | version "4.3.0" 200 | resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.3.0.tgz#db7129b2846662fd8628cfc496abb2b59e41529b" 201 | integrity sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ== 202 | dependencies: 203 | boolbase "^1.0.0" 204 | css-what "^6.0.1" 205 | domhandler "^4.3.1" 206 | domutils "^2.8.0" 207 | nth-check "^2.0.1" 208 | 209 | css-what@^6.0.1: 210 | version "6.1.0" 211 | resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" 212 | integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== 213 | 214 | cuid@2.1.8: 215 | version "2.1.8" 216 | resolved "https://registry.yarnpkg.com/cuid/-/cuid-2.1.8.tgz#cbb88f954171e0d5747606c0139fb65c5101eac0" 217 | integrity sha512-xiEMER6E7TlTPnDxrM4eRiC6TRgjNX9xzEZ5U/Se2YJKr7Mq4pJn/2XEHjl3STcSh96GmkHPcBXLES8M29wyyg== 218 | 219 | debounce@1.1.0: 220 | version "1.1.0" 221 | resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.1.0.tgz#6a1a4ee2a9dc4b7c24bb012558dbcdb05b37f408" 222 | integrity sha512-ZQVKfRVlwRfD150ndzEK8M90ABT+Y/JQKs4Y7U4MXdpuoUkkrr4DwKbVux3YjylA5bUMUj0Nc3pMxPJX6N2QQQ== 223 | 224 | decamelize@^1.1.1: 225 | version "1.2.0" 226 | resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" 227 | integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= 228 | 229 | depd@1.1.1: 230 | version "1.1.1" 231 | resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" 232 | integrity sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k= 233 | 234 | dom-converter@^0.2.0: 235 | version "0.2.0" 236 | resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" 237 | integrity sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA== 238 | dependencies: 239 | utila "~0.4" 240 | 241 | dom-serializer@^1.0.1: 242 | version "1.4.1" 243 | resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30" 244 | integrity sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag== 245 | dependencies: 246 | domelementtype "^2.0.1" 247 | domhandler "^4.2.0" 248 | entities "^2.0.0" 249 | 250 | domelementtype@^2.0.1, domelementtype@^2.2.0: 251 | version "2.3.0" 252 | resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" 253 | integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== 254 | 255 | domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.3.1: 256 | version "4.3.1" 257 | resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" 258 | integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== 259 | dependencies: 260 | domelementtype "^2.2.0" 261 | 262 | domutils@^2.5.2, domutils@^2.8.0: 263 | version "2.8.0" 264 | resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" 265 | integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== 266 | dependencies: 267 | dom-serializer "^1.0.1" 268 | domelementtype "^2.2.0" 269 | domhandler "^4.2.0" 270 | 271 | dotenv@5.0.1: 272 | version "5.0.1" 273 | resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef" 274 | integrity sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow== 275 | 276 | entities@^2.0.0: 277 | version "2.2.0" 278 | resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" 279 | integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== 280 | 281 | escape-string-regexp@^1.0.5: 282 | version "1.0.5" 283 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 284 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= 285 | 286 | execa@^0.7.0: 287 | version "0.7.0" 288 | resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" 289 | integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= 290 | dependencies: 291 | cross-spawn "^5.0.1" 292 | get-stream "^3.0.0" 293 | is-stream "^1.1.0" 294 | npm-run-path "^2.0.0" 295 | p-finally "^1.0.0" 296 | signal-exit "^3.0.0" 297 | strip-eof "^1.0.0" 298 | 299 | execa@^0.8.0: 300 | version "0.8.0" 301 | resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" 302 | integrity sha1-2NdrvBtVIX7RkP1t1J08d07PyNo= 303 | dependencies: 304 | cross-spawn "^5.0.1" 305 | get-stream "^3.0.0" 306 | is-stream "^1.1.0" 307 | npm-run-path "^2.0.0" 308 | p-finally "^1.0.0" 309 | signal-exit "^3.0.0" 310 | strip-eof "^1.0.0" 311 | 312 | fill-range@^7.0.1: 313 | version "7.0.1" 314 | resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" 315 | integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== 316 | dependencies: 317 | to-regex-range "^5.0.1" 318 | 319 | find-up@^2.1.0: 320 | version "2.1.0" 321 | resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" 322 | integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= 323 | dependencies: 324 | locate-path "^2.0.0" 325 | 326 | fsevents@~2.3.2: 327 | version "2.3.2" 328 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" 329 | integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== 330 | 331 | get-caller-file@^1.0.1: 332 | version "1.0.3" 333 | resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" 334 | integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== 335 | 336 | get-port@3.2.0: 337 | version "3.2.0" 338 | resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" 339 | integrity sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw= 340 | 341 | get-stream@^3.0.0: 342 | version "3.0.0" 343 | resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" 344 | integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= 345 | 346 | glob-parent@~5.1.2: 347 | version "5.1.2" 348 | resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" 349 | integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== 350 | dependencies: 351 | is-glob "^4.0.1" 352 | 353 | has-flag@^3.0.0: 354 | version "3.0.0" 355 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" 356 | integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= 357 | 358 | htmlparser2@^6.1.0: 359 | version "6.1.0" 360 | resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" 361 | integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A== 362 | dependencies: 363 | domelementtype "^2.0.1" 364 | domhandler "^4.0.0" 365 | domutils "^2.5.2" 366 | entities "^2.0.0" 367 | 368 | http-errors@1.6.2: 369 | version "1.6.2" 370 | resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" 371 | integrity sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY= 372 | dependencies: 373 | depd "1.1.1" 374 | inherits "2.0.3" 375 | setprototypeof "1.0.3" 376 | statuses ">= 1.3.1 < 2" 377 | 378 | iconv-lite@0.4.19: 379 | version "0.4.19" 380 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" 381 | integrity sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ== 382 | 383 | inherits@2.0.3: 384 | version "2.0.3" 385 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 386 | integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= 387 | 388 | invert-kv@^1.0.0: 389 | version "1.0.0" 390 | resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" 391 | integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= 392 | 393 | ip@1.1.5: 394 | version "1.1.5" 395 | resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" 396 | integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= 397 | 398 | is-binary-path@~2.1.0: 399 | version "2.1.0" 400 | resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" 401 | integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== 402 | dependencies: 403 | binary-extensions "^2.0.0" 404 | 405 | is-extglob@^2.1.1: 406 | version "2.1.1" 407 | resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" 408 | integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= 409 | 410 | is-fullwidth-code-point@^1.0.0: 411 | version "1.0.0" 412 | resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" 413 | integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= 414 | dependencies: 415 | number-is-nan "^1.0.0" 416 | 417 | is-fullwidth-code-point@^2.0.0: 418 | version "2.0.0" 419 | resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" 420 | integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= 421 | 422 | is-glob@^4.0.1, is-glob@~4.0.1: 423 | version "4.0.3" 424 | resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" 425 | integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== 426 | dependencies: 427 | is-extglob "^2.1.1" 428 | 429 | is-number@^7.0.0: 430 | version "7.0.0" 431 | resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" 432 | integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== 433 | 434 | is-stream@1.1.0, is-stream@^1.1.0: 435 | version "1.1.0" 436 | resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" 437 | integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= 438 | 439 | isexe@^2.0.0: 440 | version "2.0.0" 441 | resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" 442 | integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= 443 | 444 | jsome@2.5.0: 445 | version "2.5.0" 446 | resolved "https://registry.yarnpkg.com/jsome/-/jsome-2.5.0.tgz#5e417eef4341ffeb83ee8bfa9265b36d56fe49ed" 447 | integrity sha1-XkF+70NB/+uD7ov6kmWzbVb+Se0= 448 | dependencies: 449 | chalk "^2.3.0" 450 | json-stringify-safe "^5.0.1" 451 | yargs "^11.0.0" 452 | 453 | json-stringify-safe@^5.0.1: 454 | version "5.0.1" 455 | resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" 456 | integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= 457 | 458 | lcid@^1.0.0: 459 | version "1.0.0" 460 | resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" 461 | integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= 462 | dependencies: 463 | invert-kv "^1.0.0" 464 | 465 | locate-path@^2.0.0: 466 | version "2.0.0" 467 | resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" 468 | integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= 469 | dependencies: 470 | p-locate "^2.0.0" 471 | path-exists "^3.0.0" 472 | 473 | lodash@^4.17.20, lodash@^4.17.21: 474 | version "4.17.21" 475 | resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" 476 | integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== 477 | 478 | lru-cache@^4.0.1: 479 | version "4.1.5" 480 | resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" 481 | integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== 482 | dependencies: 483 | pseudomap "^1.0.2" 484 | yallist "^2.1.2" 485 | 486 | mem@^1.1.0: 487 | version "1.1.0" 488 | resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" 489 | integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= 490 | dependencies: 491 | mimic-fn "^1.0.0" 492 | 493 | micro-cors@0.1.1: 494 | version "0.1.1" 495 | resolved "https://registry.yarnpkg.com/micro-cors/-/micro-cors-0.1.1.tgz#af7a480182c114ffd1ada84ad9dffc52bb4f4054" 496 | integrity sha512-6WqIahA5sbQR1Gjexp1VuWGFDKbZZleJb/gy1khNGk18a6iN1FdTcr3Q8twaxkV5H94RjxIBjirYbWCehpMBFw== 497 | 498 | micro-dev@3.1.0: 499 | version "3.1.0" 500 | resolved "https://registry.yarnpkg.com/micro-dev/-/micro-dev-3.1.0.tgz#e0344ed9af02d251305c77b8342df1d943dbbbe0" 501 | integrity sha512-LntYVIReq6qqUa0/Cxe6a4OD8p/Z9N9khM4sQkBal1rR3ZdOnb61eqRxoaj7w2D9IDJs3tCpphM1DpXVB2XlsQ== 502 | dependencies: 503 | boxen "1.3.0" 504 | chalk "2.4.1" 505 | chokidar "3.5.3" 506 | clipboardy "1.2.3" 507 | debounce "1.1.0" 508 | dotenv "5.0.1" 509 | get-port "3.2.0" 510 | ip "1.1.5" 511 | jsome "2.5.0" 512 | mri "1.1.1" 513 | pkg-up "2.0.0" 514 | pretty-error "4.0.0" 515 | string-length "2.0.0" 516 | 517 | micro@9.3.4: 518 | version "9.3.4" 519 | resolved "https://registry.yarnpkg.com/micro/-/micro-9.3.4.tgz#745a494e53c8916f64fb6a729f8cbf2a506b35ad" 520 | integrity sha512-smz9naZwTG7qaFnEZ2vn248YZq9XR+XoOH3auieZbkhDL4xLOxiE+KqG8qqnBeKfXA9c1uEFGCxPN1D+nT6N7w== 521 | dependencies: 522 | arg "4.1.0" 523 | content-type "1.0.4" 524 | is-stream "1.1.0" 525 | raw-body "2.3.2" 526 | 527 | mimic-fn@^1.0.0: 528 | version "1.2.0" 529 | resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" 530 | integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== 531 | 532 | mri@1.1.1: 533 | version "1.1.1" 534 | resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.1.tgz#85aa26d3daeeeedf80dc5984af95cc5ca5cad9f1" 535 | integrity sha1-haom09ru7t+A3FmEr5XMXKXK2fE= 536 | 537 | node-fetch@2.6.0: 538 | version "2.6.0" 539 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" 540 | integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== 541 | 542 | normalize-path@^3.0.0, normalize-path@~3.0.0: 543 | version "3.0.0" 544 | resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" 545 | integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== 546 | 547 | npm-run-path@^2.0.0: 548 | version "2.0.2" 549 | resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" 550 | integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= 551 | dependencies: 552 | path-key "^2.0.0" 553 | 554 | nth-check@^2.0.1: 555 | version "2.1.1" 556 | resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" 557 | integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== 558 | dependencies: 559 | boolbase "^1.0.0" 560 | 561 | number-is-nan@^1.0.0: 562 | version "1.0.1" 563 | resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" 564 | integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= 565 | 566 | os-locale@^2.0.0: 567 | version "2.1.0" 568 | resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" 569 | integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== 570 | dependencies: 571 | execa "^0.7.0" 572 | lcid "^1.0.0" 573 | mem "^1.1.0" 574 | 575 | p-finally@^1.0.0: 576 | version "1.0.0" 577 | resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" 578 | integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= 579 | 580 | p-limit@^1.1.0: 581 | version "1.3.0" 582 | resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" 583 | integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== 584 | dependencies: 585 | p-try "^1.0.0" 586 | 587 | p-locate@^2.0.0: 588 | version "2.0.0" 589 | resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" 590 | integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= 591 | dependencies: 592 | p-limit "^1.1.0" 593 | 594 | p-try@^1.0.0: 595 | version "1.0.0" 596 | resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" 597 | integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= 598 | 599 | path-exists@^3.0.0: 600 | version "3.0.0" 601 | resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" 602 | integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= 603 | 604 | path-key@^2.0.0: 605 | version "2.0.1" 606 | resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" 607 | integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= 608 | 609 | picomatch@^2.0.4, picomatch@^2.2.1: 610 | version "2.3.1" 611 | resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" 612 | integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== 613 | 614 | pkg-up@2.0.0: 615 | version "2.0.0" 616 | resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" 617 | integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= 618 | dependencies: 619 | find-up "^2.1.0" 620 | 621 | pretty-error@4.0.0: 622 | version "4.0.0" 623 | resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-4.0.0.tgz#90a703f46dd7234adb46d0f84823e9d1cb8f10d6" 624 | integrity sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw== 625 | dependencies: 626 | lodash "^4.17.20" 627 | renderkid "^3.0.0" 628 | 629 | pseudomap@^1.0.2: 630 | version "1.0.2" 631 | resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" 632 | integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= 633 | 634 | raw-body@2.3.2: 635 | version "2.3.2" 636 | resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89" 637 | integrity sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k= 638 | dependencies: 639 | bytes "3.0.0" 640 | http-errors "1.6.2" 641 | iconv-lite "0.4.19" 642 | unpipe "1.0.0" 643 | 644 | readdirp@~3.6.0: 645 | version "3.6.0" 646 | resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" 647 | integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== 648 | dependencies: 649 | picomatch "^2.2.1" 650 | 651 | renderkid@^3.0.0: 652 | version "3.0.0" 653 | resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-3.0.0.tgz#5fd823e4d6951d37358ecc9a58b1f06836b6268a" 654 | integrity sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg== 655 | dependencies: 656 | css-select "^4.1.3" 657 | dom-converter "^0.2.0" 658 | htmlparser2 "^6.1.0" 659 | lodash "^4.17.21" 660 | strip-ansi "^6.0.1" 661 | 662 | require-directory@^2.1.1: 663 | version "2.1.1" 664 | resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" 665 | integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= 666 | 667 | require-main-filename@^1.0.1: 668 | version "1.0.1" 669 | resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" 670 | integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= 671 | 672 | set-blocking@^2.0.0: 673 | version "2.0.0" 674 | resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" 675 | integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= 676 | 677 | setprototypeof@1.0.3: 678 | version "1.0.3" 679 | resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" 680 | integrity sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ= 681 | 682 | shebang-command@^1.2.0: 683 | version "1.2.0" 684 | resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" 685 | integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= 686 | dependencies: 687 | shebang-regex "^1.0.0" 688 | 689 | shebang-regex@^1.0.0: 690 | version "1.0.0" 691 | resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" 692 | integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= 693 | 694 | signal-exit@^3.0.0: 695 | version "3.0.2" 696 | resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" 697 | integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= 698 | 699 | "statuses@>= 1.3.1 < 2": 700 | version "1.5.0" 701 | resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" 702 | integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= 703 | 704 | string-length@2.0.0: 705 | version "2.0.0" 706 | resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" 707 | integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= 708 | dependencies: 709 | astral-regex "^1.0.0" 710 | strip-ansi "^4.0.0" 711 | 712 | string-width@^1.0.1: 713 | version "1.0.2" 714 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" 715 | integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= 716 | dependencies: 717 | code-point-at "^1.0.0" 718 | is-fullwidth-code-point "^1.0.0" 719 | strip-ansi "^3.0.0" 720 | 721 | string-width@^2.0.0, string-width@^2.1.1: 722 | version "2.1.1" 723 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" 724 | integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== 725 | dependencies: 726 | is-fullwidth-code-point "^2.0.0" 727 | strip-ansi "^4.0.0" 728 | 729 | strip-ansi@^3.0.0, strip-ansi@^3.0.1: 730 | version "3.0.1" 731 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" 732 | integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= 733 | dependencies: 734 | ansi-regex "^2.0.0" 735 | 736 | strip-ansi@^4.0.0: 737 | version "4.0.0" 738 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" 739 | integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= 740 | dependencies: 741 | ansi-regex "^3.0.0" 742 | 743 | strip-ansi@^6.0.1: 744 | version "6.0.1" 745 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" 746 | integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== 747 | dependencies: 748 | ansi-regex "^5.0.1" 749 | 750 | strip-eof@^1.0.0: 751 | version "1.0.0" 752 | resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" 753 | integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= 754 | 755 | supports-color@^5.3.0: 756 | version "5.5.0" 757 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" 758 | integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== 759 | dependencies: 760 | has-flag "^3.0.0" 761 | 762 | term-size@^1.2.0: 763 | version "1.2.0" 764 | resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" 765 | integrity sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk= 766 | dependencies: 767 | execa "^0.7.0" 768 | 769 | to-regex-range@^5.0.1: 770 | version "5.0.1" 771 | resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" 772 | integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== 773 | dependencies: 774 | is-number "^7.0.0" 775 | 776 | unpipe@1.0.0: 777 | version "1.0.0" 778 | resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" 779 | integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= 780 | 781 | utila@~0.4: 782 | version "0.4.0" 783 | resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" 784 | integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= 785 | 786 | whatwg-fetch@3.0.0: 787 | version "3.0.0" 788 | resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" 789 | integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== 790 | 791 | which-module@^2.0.0: 792 | version "2.0.0" 793 | resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" 794 | integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= 795 | 796 | which@^1.2.9: 797 | version "1.3.1" 798 | resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" 799 | integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== 800 | dependencies: 801 | isexe "^2.0.0" 802 | 803 | widest-line@^2.0.0: 804 | version "2.0.1" 805 | resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" 806 | integrity sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA== 807 | dependencies: 808 | string-width "^2.1.1" 809 | 810 | wrap-ansi@^2.0.0: 811 | version "2.1.0" 812 | resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" 813 | integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= 814 | dependencies: 815 | string-width "^1.0.1" 816 | strip-ansi "^3.0.1" 817 | 818 | y18n@^3.2.1: 819 | version "3.2.1" 820 | resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" 821 | integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= 822 | 823 | yallist@^2.1.2: 824 | version "2.1.2" 825 | resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" 826 | integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= 827 | 828 | yargs-parser@^9.0.2: 829 | version "9.0.2" 830 | resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" 831 | integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= 832 | dependencies: 833 | camelcase "^4.1.0" 834 | 835 | yargs@^11.0.0: 836 | version "11.1.0" 837 | resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" 838 | integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== 839 | dependencies: 840 | cliui "^4.0.0" 841 | decamelize "^1.1.1" 842 | find-up "^2.1.0" 843 | get-caller-file "^1.0.1" 844 | os-locale "^2.0.0" 845 | require-directory "^2.1.1" 846 | require-main-filename "^1.0.1" 847 | set-blocking "^2.0.0" 848 | string-width "^2.0.0" 849 | which-module "^2.0.0" 850 | y18n "^3.2.1" 851 | yargs-parser "^9.0.2" 852 | -------------------------------------------------------------------------------- /webhooks/sync-catalog-to-algolia/README.md: -------------------------------------------------------------------------------- 1 | # Sync catalog to Algolia 2 | 3 | This example demonstrates how you can sync products, collections, categories and brands to Algolia using Moltin webhooks. 4 | 5 | ## How to use locally 6 | 7 | When running this example locally it's recommended you use a service like [ngrok](https://ngrok.com) to tunnel your dev environment to the outside world. 8 | 9 | Once you have the repo running locally, you'll want to add the integration via the [Moltin Dashboard](https://dashboard.moltin.com/app/settings/integrations). The `URL` will be the one provided by ngrok. 10 | 11 | ### 1. Download the example 12 | 13 | Clone the repository: 14 | 15 | ```bash 16 | git clone git@github.com:moltin/integration-examples.git 17 | ``` 18 | 19 | Install dependencies with Yarn 20 | 21 | ```bash 22 | cd integration-examples/sync-catalog-to-algolia 23 | yarn 24 | ``` 25 | 26 | ### 2. Configure Algolia 27 | 28 | In this example we will sync data to [Algolia](https://www.algolia.com). You will need an account an account to continue. 29 | 30 | Once you've signed up to Algolia, create a new app and give it a name. 31 | 32 | Next head to the `API keys` section and make a note of your `Application ID` and `Admin API Key`, we will need these next. 33 | 34 | ### 3. Configure your ENV variables 35 | 36 | You will want to create an `.env` inside the directory `/sync-catalog-to-algolia` containing all the keys for the below: 37 | 38 | ```shell 39 | ALGOLIA_APP_ID= 40 | ALGOLIA_API_KEY= 41 | MOLTIN_WEBHOOK_SECRET= 42 | ``` 43 | 44 | `MOLTIN_WEBHOOK_SECRET` can be anything you want. 45 | 46 | ### 4. Start the server and ngrok 47 | 48 | Start the development server 49 | 50 | ```bash 51 | yarn dev 52 | ``` 53 | 54 | The server will typically start on PORT `3000`, if not, make a note for the next step. 55 | 56 | Start ngrok 57 | 58 | ```bash 59 | ngrok http 3000 60 | ``` 61 | 62 | This will expose PORT `3000` to the outside world. Make a note of the `http` URL ngrok provides. 63 | 64 | ### 5. Create a new Moltin integration 65 | 66 | You must now tell Moltin the ngrok URL above. Head to the [Moltin Dashboard](https://dashboard.moltin.com/app/settings/integrations), login and go to `Settings > Integrations` and click `Create`. 67 | 68 | Enter a name and description for your Integration. We recommend you prefix the name with `DEVELOPMENT:`. 69 | 70 | Next, enter the `URL` and `Secret Key` that match those inside `.env`. 71 | 72 |  73 | 74 | Now finally you'll want to configure when this webhook will be invoked, in this example check any of `created`/`updated`/`deleted` observables for Product, Collection, Category or Brand. 75 | 76 |  77 | 78 | That's it! Click Save 79 | -------------------------------------------------------------------------------- /webhooks/sync-catalog-to-algolia/index.js: -------------------------------------------------------------------------------- 1 | const { json, send } = require('micro') 2 | const cors = require('micro-cors')() 3 | const algoliasearch = require('algoliasearch') 4 | 5 | const client = algoliasearch( 6 | process.env.ALGOLIA_APP_ID, 7 | process.env.ALGOLIA_API_KEY 8 | ) 9 | 10 | module.exports = cors(async (req, res) => { 11 | if ( 12 | (await req.headers['x-moltin-secret-key']) != 13 | process.env.MOLTIN_WEBHOOK_SECRET 14 | ) 15 | return send(res, 401) 16 | 17 | const { triggered_by, resources } = await json(req) 18 | const [type, trigger] = triggered_by.split('.') 19 | 20 | try { 21 | const index = client.initIndex(type) 22 | 23 | let body 24 | 25 | if (trigger === 'deleted') { 26 | body = await index.deleteObject(resources.id) 27 | return send(res, 202, body) 28 | } 29 | 30 | const { 31 | data: { id: objectID, ...rest }, 32 | } = JSON.parse(resources) 33 | const object = { objectID, ...rest } 34 | 35 | if (trigger === 'created') { 36 | body = await index.addObject(object) 37 | } else if (trigger === 'updated') { 38 | body = await index.saveObject(object) 39 | } else { 40 | throw new Error(`'${trigger}' is not a valid trigger`) 41 | } 42 | 43 | send(res, 200, body) 44 | } catch (errors) { 45 | send(res, 500, errors) 46 | } 47 | }) 48 | -------------------------------------------------------------------------------- /webhooks/sync-catalog-to-algolia/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "micro-dev", 5 | "start": "micro" 6 | }, 7 | "dependencies": { 8 | "algoliasearch": "3.35.1", 9 | "micro": "9.4.1", 10 | "micro-cors": "0.1.1" 11 | }, 12 | "devDependencies": { 13 | "micro-dev": "3.1.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /webhooks/sync-orders-to-big-query/README.md: -------------------------------------------------------------------------------- 1 | # Moltin -> BigQuery 2 | 3 | > A simple serverless integration to help you send Moltin order data (including order items) to Google BigQuery. 4 | 5 | 📚 [Moltin API reference](https://docs.moltin.com/) — 📚 [BigQuery API reference](https://cloud.google.com/bigquery/docs/reference/rest/) 6 | 7 | ## Pre-requisites 8 | 9 | 1. A Google project with a dataset and two tables created. One table will receive orders and the other, order items. Your orders table should have a schema matching the field names in the `filterOrderJson` function in `mapping.js`, your order items table schema should match the field names in the `filterItemJson` in the same mapping file. 10 | 11 | 2. A Google KMS keyring and key. 12 | 13 | 3. Serverless CLI installed (`npm install -g serverless`) 14 | 15 | ## Usage 16 | 17 | ### 1. Download the example 18 | 19 | Clone the repository: 20 | 21 | ```bash 22 | git clone git@github.com:moltin/integration-examples.git 23 | ``` 24 | 25 | Install dependencies with Yarn 26 | 27 | ```bash 28 | cd integration-examples/sync-orders-to-bigQuery 29 | yarn 30 | ``` 31 | 32 | ### 3. Configure your ENV variables 33 | 34 | Using your Google keyring and key, encrypt your Moltin client secret. You can find the reference for KMS encryption [here](https://cloud.google.com/sdk/gcloud/reference/kms/encrypt) 35 | 36 | In the file `serverless.yml`, add values to the `environment` section, make sure you add the encrypted version of the Moltin Client Secret. 37 | 38 | ### 3. Configure Serverless 39 | 40 | Make sure you have Serverless [configured to work with Google](https://serverless.com/framework/docs/providers/google/guide/credentials/) but when creating the service account, add KMS permissions too. You will end up with a JSON file. Create a folder in the root of this project called `.gcloud` and add the JSON file there. 41 | 42 | Make sure the `stage` in the `provider` section of `serverless.yml` is set to `DEV` or `PROD` depending on whether you are testing or deploying to production. [This blog post](https://serverless-stack.com/chapters/stages-in-serverless-framework.html) covers the purpose of stages. 43 | 44 | ### 4. Deploy to Google Cloud Functions 45 | 46 | Run `sls deploy` and note the deployed endpoint logged out by the CLI. 47 | 48 | ### 5. How to use 49 | 50 | There is a single handler function in this repository. It's called `updateOrders` and is found in `index.js`. It takes no arguments, and will push new and updated orders within the last day from Moltin to BigQuery. It will delete any orders already in BigQuery that might cause duplicates after the new batch is pushed. 51 | 52 | When the deployed endpoint is called via GET, `updateOrders` will run for you. Should you want to automate this, in https://console.cloud.google.com/cloudscheduler, you can set up a job to GET the deployed endpoint at a frequency of your choosing! 53 | -------------------------------------------------------------------------------- /webhooks/sync-orders-to-big-query/bq-helper.js: -------------------------------------------------------------------------------- 1 | const { BigQuery } = require('@google-cloud/bigquery') 2 | const fs = require('fs') 3 | 4 | let bigquery 5 | 6 | async function deleteObjects(filter, dataset, table) { 7 | return new Promise(async (resolve, reject) => { 8 | try { 9 | filter = filter.substring(0, filter.length - 1) 10 | const query = `delete from ${dataset}.${table} where id in (${filter})` 11 | const options = { query, location: 'US' } 12 | // Wait for all rows to delete 13 | const deletes = await bigquery.query(options) 14 | resolve(deletes) 15 | } catch (e) { 16 | reject(e) 17 | } 18 | }) 19 | } 20 | 21 | async function writeObjectUpdates(objects, table) { 22 | return new Promise(async (resolve, reject) => { 23 | try { 24 | // insert updates 25 | const file = fs.createWriteStream(`/tmp/${table}.json`, { 26 | flags: 'a', 27 | }) 28 | file.on('error', err => { 29 | console.error('error writeObjectUpdates', err) 30 | }) 31 | objects.forEach(v => { 32 | file.write(`${JSON.stringify(v)}\r\n`) 33 | }) 34 | file.end() 35 | resolve(true) 36 | } catch (e) { 37 | reject(e) 38 | } 39 | }) 40 | } 41 | 42 | module.exports = { 43 | async createBigQueryClient() { 44 | bigquery = new BigQuery({ 45 | projectId: process.env.GOOGLE_PROJECT_ID, 46 | }) 47 | }, 48 | 49 | async cleanGoogleCredentials() { 50 | bigquery = null 51 | fs.unlinkSync(process.env.GOOGLE_APPLICATION_CREDENTIALS) 52 | }, 53 | 54 | loadObjects(dataset, table) { 55 | return new Promise(async (resolve, reject) => { 56 | try { 57 | await bigquery 58 | .dataset(dataset) 59 | .table(table) 60 | .load(`/tmp/${table}.json`) 61 | fs.unlink(`/tmp/${table}.json`, err => { 62 | if (err) throw err 63 | console.log(`${table}.json was deleted`) 64 | }) 65 | resolve() 66 | } catch (e) { 67 | reject(e) 68 | } 69 | }) 70 | }, 71 | async generateUpdates(objects, filterJson, dataset, table) { 72 | return new Promise(async (resolve, reject) => { 73 | try { 74 | // Need to delete previous records of the orders and then update. 75 | let objectsToDelete = '' 76 | const objectsToInsert = [] 77 | objects.forEach(object => { 78 | objectsToDelete += `"${object.id}",` 79 | objectsToInsert.push(filterJson(object)) 80 | }) 81 | resolve( 82 | deleteObjects(objectsToDelete, dataset, table).then(() => { 83 | writeObjectUpdates(objectsToInsert, table) 84 | }) 85 | ) 86 | } catch (e) { 87 | reject(e) 88 | } 89 | }) 90 | }, 91 | async retrieveObjects(filter, dataset, table) { 92 | return new Promise(async (resolve, reject) => { 93 | try { 94 | const query = `select * from ${dataset}.${table} where ${filter}` 95 | const options = { query, location: 'US' } 96 | const results = await bigquery.query(options) 97 | resolve(results) 98 | } catch (e) { 99 | reject(e) 100 | } 101 | }) 102 | }, 103 | } 104 | -------------------------------------------------------------------------------- /webhooks/sync-orders-to-big-query/decrypt-helper.js: -------------------------------------------------------------------------------- 1 | const GoogleKMS = require('@google-cloud/kms').KeyManagementServiceClient 2 | 3 | const decrypt = async ciphertext => { 4 | const client = new GoogleKMS() 5 | const locationId = process.env.GOOGLE_LOCATION_ID 6 | const keyRingId = process.env.GOOGLE_KEYRING_ID 7 | const cryptoKeyId = process.env.GOOGLE_KEY_ID 8 | const projectId = process.env.GOOGLE_PROJECT_ID 9 | 10 | const name = client.cryptoKeyPath( 11 | projectId, 12 | locationId, 13 | keyRingId, 14 | cryptoKeyId 15 | ) 16 | 17 | return new Promise(async (resolve, reject) => { 18 | try { 19 | ciphertext = ciphertext.toString('base64') 20 | 21 | const [result] = await client.decrypt({ name, ciphertext }) 22 | 23 | const buff = Buffer.from(result.plaintext, 'base64') 24 | const text = buff.toString('ascii') 25 | 26 | resolve(text) 27 | } catch (e) { 28 | reject(JSON.stringify(e)) 29 | } 30 | }) 31 | } 32 | 33 | module.exports.decryptVars = async () => 34 | new Promise(async (resolve, reject) => { 35 | try { 36 | process.env.MOLTIN_CLIENT_SECRET = await decrypt( 37 | Buffer.from(process.env.MOLTIN_CLIENT_SECRET, 'base64') 38 | ) 39 | resolve() 40 | } catch (e) { 41 | reject(e) 42 | } 43 | }) 44 | -------------------------------------------------------------------------------- /webhooks/sync-orders-to-big-query/index.js: -------------------------------------------------------------------------------- 1 | const { MoltinClient } = require('@moltin/request') 2 | const moment = require('moment') 3 | const datahelper = require('./bq-helper') 4 | const decryptHelper = require('./decrypt-helper') 5 | const mapping = require('./mapping') 6 | 7 | async function getUpdatedOrders(moltin, date, offset = 0, limit = 1) { 8 | return new Promise(async (resolve, reject) => { 9 | moltin 10 | .get( 11 | `orders?include=items&page[limit]=${limit}&filter=ge(updated_at,${date})&page[offset]=${offset}` 12 | ) 13 | .then(resolve) 14 | .catch(reject) 15 | }) 16 | } 17 | 18 | module.exports.updateOrders = async (request, response) => { 19 | try { 20 | await datahelper.createBigQueryClient() 21 | await decryptHelper.decryptVars() 22 | 23 | const moltin = new MoltinClient({ 24 | client_id: process.env.MOLTIN_CLIENT_ID, 25 | client_secret: process.env.MOLTIN_CLIENT_SECRET, 26 | }) 27 | 28 | const date = moment() 29 | .subtract(1, 'days') 30 | .format('YYYY-MM-DD') 31 | 32 | const limit = 100 33 | let offset = 0 34 | let resultSize = 0 35 | let result 36 | 37 | do { 38 | // Get Order Updates and delete older versions 39 | const orders = await getUpdatedOrders(moltin, date, offset, limit) 40 | if (orders.data && orders.data.length > 0) { 41 | resultSize = orders.data.length 42 | offset += resultSize 43 | // Order Updates 44 | result = await datahelper.generateUpdates( 45 | orders.data, 46 | mapping.filterOrderJson, 47 | process.env.ORDERS_DATASET, 48 | process.env.ORDERS_TABLE 49 | ) 50 | 51 | // Update items 52 | await datahelper.generateUpdates( 53 | orders.included.items, 54 | mapping.filterItemJson, 55 | process.env.ORDERS_DATASET, 56 | process.env.ORDER_ITEMS_TABLE 57 | ) 58 | } else { 59 | resultSize = -1 60 | } 61 | } while (resultSize === limit) 62 | // Load new Orders 63 | await datahelper.loadObjects( 64 | process.env.ORDERS_DATASET, 65 | process.env.ORDERS_TABLE 66 | ) 67 | // Load new Items 68 | await datahelper.loadObjects( 69 | process.env.ORDERS_DATASET, 70 | process.env.ORDER_ITEMS_TABLE 71 | ) 72 | 73 | return response.status(200).send('success') 74 | } catch (e) { 75 | console.log(e) 76 | return response.status(500).send(JSON.stringify(e)) 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /webhooks/sync-orders-to-big-query/mapping.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | filterOrderJson: order => ({ 3 | id: order.id, // string 4 | created_at: order.meta.timestamps.created_at, // string 5 | updated_at: order.meta.timestamps.updated_at, // string 6 | customer_id: order.relationships.customer 7 | ? order.relationships.customer.data.id 8 | : null, // string 9 | customer_email: order.customer.email, // string 10 | payment: order.payment, // string 11 | shipping: order.shipping, // string 12 | status_value: order.status, // string 13 | subtotal: order.meta.display_price.without_tax.amount, // float 14 | total: order.meta.display_price.with_tax.amount, // float 15 | currency_code: order.meta.display_price.without_tax.currency, // string 16 | ship_to_first_name: order.shipping_address.first_name, // string 17 | ship_to_last_name: order.shipping_address.last_name, // string 18 | ship_to_address_1: order.shipping_address.line_1, // string 19 | ship_to_address_2: order.shipping_address.line_2, // string 20 | ship_to_postcode: order.shipping_address.postcode, // string 21 | ship_to_country_code: order.shipping_address.country, // string 22 | ship_to_company: order.shipping_address.company_name, // string 23 | ship_to_city: order.shipping_address.city, // string 24 | ship_to_phone: order.shipping_address.phone_number, // string 25 | ship_to_county: order.shipping_address.county, // string 26 | bill_to_first_name: order.billing_address.first_name, // string 27 | bill_to_last_name: order.billing_address.last_name, // string 28 | bill_to_address_1: order.billing_address.line_1, // string 29 | bill_to_address_2: order.billing_address.line_2, // string 30 | bill_to_postcode: order.billing_address.postcode, // string 31 | bill_to_country_code: order.billing_address.country, // string 32 | bill_to_company: order.billing_address.company_name, // string 33 | bill_to_city: order.billing_address.city, // string 34 | bill_to_county: order.billing_address.county, // string 35 | totals_raw_subtotal: order.meta.display_price.without_tax.amount, // float 36 | totals_raw_total: order.meta.display_price.with_tax.amount, // float 37 | }), 38 | 39 | filterItemJson: item => ({ 40 | id: item.id, // string 41 | created_at: item.meta.timestamps.created_at, // string 42 | updated_at: item.meta.timestamps.updated_at, // string 43 | quantity: item.quantity, // integer 44 | cart_identifier: item.relationships.cart_item.data.id, // string 45 | title: item.name, // string 46 | sku: item.sku, // string 47 | unit_price: item.meta.display_price.without_tax.unit.formatted, // string 48 | total_retail: item.meta.display_price.without_tax.value.formatted, // string 49 | product_id: item.product_id, // string 50 | type: item.type, // string 51 | }), 52 | } 53 | -------------------------------------------------------------------------------- /webhooks/sync-orders-to-big-query/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "devDependencies": { 4 | "serverless-google-cloudfunctions": "*" 5 | }, 6 | "dependencies": { 7 | "@google-cloud/bigquery": "4.7.0", 8 | "@google-cloud/kms": "1.6.3", 9 | "@moltin/request": "2.0.1", 10 | "fs": "0.0.2", 11 | "moment": "2.30.1", 12 | "util": "0.12.5" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /webhooks/sync-orders-to-big-query/serverless.yml: -------------------------------------------------------------------------------- 1 | service: moltin-bigquery-sync 2 | 3 | provider: 4 | name: google 5 | stage: dev 6 | runtime: nodejs8 7 | region: us-central1 8 | project: 9 | credentials: ./.gcloud/google.json 10 | timeout: 15s 11 | 12 | plugins: 13 | - serverless-google-cloudfunctions 14 | 15 | package: 16 | include: 17 | - bq-helper.js 18 | - handler.js 19 | - aws-helper.js 20 | - google-helper.js 21 | 22 | exclude: 23 | - .git/** 24 | - node_modules/** 25 | - .gitignore 26 | 27 | functions: 28 | updateOrders: 29 | handler: updateOrders 30 | description: Sends orders to Google BigQuery 31 | environment: 32 | MOLTIN_CLIENT_ID: 33 | MOLTIN_CLIENT_SECRET: 34 | ORDERS_DATASET: 35 | ORDERS_TABLE: 36 | ORDER_ITEMS_TABLE: 37 | GOOGLE_APPLICATION_CREDENTIALS: './.gcloud/google.json' 38 | GOOGLE_LOCATION_ID: 39 | GOOGLE_KEYRING_ID: 40 | GOOGLE_KEY_ID: 41 | GOOGLE_PROJECT_ID: 42 | 43 | events: 44 | - http: foo --------------------------------------------------------------------------------