ledger_sync 1.3.5 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +11 -2
- data/.travis.yml +4 -0
- data/Gemfile.lock +13 -13
- data/LICENSE.txt +5 -97
- data/README.md +8 -505
- data/bin/quickbooks_online_oauth_server.rb +10 -9
- data/docs/CNAME +1 -0
- data/docs/assets/css/brands.min.css +5 -0
- data/docs/assets/css/fontawesome.min.css +5 -0
- data/docs/assets/css/main.css +1924 -0
- data/docs/assets/css/monokai.css +441 -0
- data/docs/assets/js/main.js +214 -0
- data/docs/assets/js/plugins.js +22 -0
- data/docs/assets/js/prism.js +9 -0
- data/docs/assets/webfonts/fa-brands-400.eot +0 -0
- data/docs/assets/webfonts/fa-brands-400.svg +3452 -0
- data/docs/assets/webfonts/fa-brands-400.ttf +0 -0
- data/docs/assets/webfonts/fa-brands-400.woff +0 -0
- data/docs/assets/webfonts/fa-brands-400.woff2 +0 -0
- data/docs/blog/index.html +303 -0
- data/docs/guides/architecture/clients/index.html +479 -0
- data/docs/guides/architecture/index.html +456 -0
- data/docs/guides/architecture/operations/index.html +486 -0
- data/docs/guides/architecture/resources/index.html +482 -0
- data/docs/guides/architecture/results/index.html +447 -0
- data/docs/guides/architecture/searchers/index.html +467 -0
- data/docs/guides/architecture/serialization/index.html +497 -0
- data/docs/guides/community/index.html +433 -0
- data/docs/guides/contribute/console/index.html +445 -0
- data/docs/guides/contribute/deployment/index.html +455 -0
- data/docs/guides/contribute/documentation/index.html +471 -0
- data/docs/guides/contribute/index.html +455 -0
- data/docs/guides/contribute/qa/index.html +457 -0
- data/docs/guides/contribute/testing/index.html +445 -0
- data/docs/guides/customization/custom_resources/index.html +482 -0
- data/docs/guides/customization/custom_serializers/index.html +481 -0
- data/docs/guides/customization/index.html +452 -0
- data/docs/guides/customization/resource_converters/index.html +512 -0
- data/docs/guides/getting-started/get-help/index.html +448 -0
- data/docs/guides/getting-started/index.html +442 -0
- data/docs/guides/getting-started/installation/index.html +454 -0
- data/docs/guides/getting-started/quick-start/index.html +552 -0
- data/docs/guides/index.html +449 -0
- data/docs/guides/ledgers/index.html +450 -0
- data/docs/guides/ledgers/netsuite/index.html +445 -0
- data/docs/guides/ledgers/netsuite_soap/index.html +445 -0
- data/docs/guides/ledgers/quickbooks_online/index.html +445 -0
- data/docs/guides/ledgers/stripe/index.html +445 -0
- data/docs/guides/modern-treasury/index.html +432 -0
- data/docs/guides/tips_and_more/index.html +492 -0
- data/docs/images/1.jpg +0 -0
- data/docs/images/10.jpg +0 -0
- data/docs/images/2.jpg +0 -0
- data/docs/images/3.jpg +0 -0
- data/docs/images/4.jpg +0 -0
- data/docs/images/5.jpg +0 -0
- data/docs/images/6.jpg +0 -0
- data/docs/images/7.jpg +0 -0
- data/docs/images/8.jpg +0 -0
- data/docs/images/9.jpg +0 -0
- data/docs/images/logo.svg +8 -0
- data/docs/index.html +400 -0
- data/docs/overview/index.html +430 -0
- data/docs/posts/introducing-docs/index.html +291 -0
- data/docs/posts/netsuite-authentication/index.html +645 -0
- data/docs/reference/architecture/clients/index.html +353 -0
- data/docs/reference/architecture/index.html +332 -0
- data/docs/reference/architecture/operations/index.html +323 -0
- data/docs/reference/architecture/resources/index.html +356 -0
- data/docs/reference/architecture/results/index.html +323 -0
- data/docs/reference/architecture/searchers/index.html +323 -0
- data/docs/reference/architecture/serialization/index.html +323 -0
- data/docs/reference/index.html +302 -0
- data/docs/reference/netsuite/authentication/index.html +413 -0
- data/docs/reference/netsuite/authentication/token_based_authentication/index.html +507 -0
- data/docs/reference/netsuite/index.html +409 -0
- data/docs/reference/netsuite/resources/account/index.html +505 -0
- data/docs/reference/netsuite/resources/check/index.html +513 -0
- data/docs/reference/netsuite/resources/check_line_item/index.html +481 -0
- data/docs/reference/netsuite/resources/currency/index.html +497 -0
- data/docs/reference/netsuite/resources/customer/index.html +509 -0
- data/docs/reference/netsuite/resources/customer_deposit/index.html +501 -0
- data/docs/reference/netsuite/resources/department/index.html +505 -0
- data/docs/reference/netsuite/resources/deposit/index.html +489 -0
- data/docs/reference/netsuite/resources/deposit_line_item/index.html +481 -0
- data/docs/reference/netsuite/resources/index.html +457 -0
- data/docs/reference/netsuite/resources/invoice/index.html +489 -0
- data/docs/reference/netsuite/resources/invoice_line_item/index.html +477 -0
- data/docs/reference/netsuite/resources/item/index.html +465 -0
- data/docs/reference/netsuite/resources/journal_entry/index.html +509 -0
- data/docs/reference/netsuite/resources/journal_entry_line_item/index.html +485 -0
- data/docs/reference/netsuite/resources/ledger_class/index.html +505 -0
- data/docs/reference/netsuite/resources/location/index.html +489 -0
- data/docs/reference/netsuite/resources/resource/index.html +461 -0
- data/docs/reference/netsuite/resources/subsidiary/index.html +469 -0
- data/docs/reference/netsuite/resources/vendor/index.html +513 -0
- data/docs/reference/netsuite_soap/index.html +324 -0
- data/docs/reference/netsuite_soap/resources/customer/index.html +385 -0
- data/docs/reference/netsuite_soap/resources/index.html +337 -0
- data/docs/reference/netsuite_soap/resources/resource/index.html +357 -0
- data/docs/reference/netsuite_soap/resources/subsidiary/index.html +377 -0
- data/docs/reference/quickbooks_online/authentication/index.html +463 -0
- data/docs/reference/quickbooks_online/errors/index.html +416 -0
- data/docs/reference/quickbooks_online/index.html +414 -0
- data/docs/reference/quickbooks_online/resources/account/index.html +551 -0
- data/docs/reference/quickbooks_online/resources/bill/index.html +555 -0
- data/docs/reference/quickbooks_online/resources/bill_line_item/index.html +517 -0
- data/docs/reference/quickbooks_online/resources/bill_payment/index.html +571 -0
- data/docs/reference/quickbooks_online/resources/bill_payment_line_item/index.html +509 -0
- data/docs/reference/quickbooks_online/resources/currency/index.html +513 -0
- data/docs/reference/quickbooks_online/resources/customer/index.html +535 -0
- data/docs/reference/quickbooks_online/resources/department/index.html +539 -0
- data/docs/reference/quickbooks_online/resources/deposit/index.html +547 -0
- data/docs/reference/quickbooks_online/resources/deposit_line_item/index.html +521 -0
- data/docs/reference/quickbooks_online/resources/expense/index.html +559 -0
- data/docs/reference/quickbooks_online/resources/expense_line_item/index.html +517 -0
- data/docs/reference/quickbooks_online/resources/index.html +505 -0
- data/docs/reference/quickbooks_online/resources/invoice/index.html +547 -0
- data/docs/reference/quickbooks_online/resources/invoice_sales_line_item/index.html +517 -0
- data/docs/reference/quickbooks_online/resources/item/index.html +505 -0
- data/docs/reference/quickbooks_online/resources/journal_entry/index.html +539 -0
- data/docs/reference/quickbooks_online/resources/journal_entry_line_item/index.html +525 -0
- data/docs/reference/quickbooks_online/resources/ledger_class/index.html +539 -0
- data/docs/reference/quickbooks_online/resources/payment/index.html +559 -0
- data/docs/reference/quickbooks_online/resources/payment_line_item/index.html +509 -0
- data/docs/reference/quickbooks_online/resources/preferences/index.html +547 -0
- data/docs/reference/quickbooks_online/resources/primary_email_addr/index.html +505 -0
- data/docs/reference/quickbooks_online/resources/primary_phone/index.html +505 -0
- data/docs/reference/quickbooks_online/resources/resource/index.html +501 -0
- data/docs/reference/quickbooks_online/resources/subsidiary/index.html +509 -0
- data/docs/reference/quickbooks_online/resources/transfer/index.html +543 -0
- data/docs/reference/quickbooks_online/resources/vendor/index.html +547 -0
- data/docs/reference/quickbooks_online/webhooks/index.html +448 -0
- data/docs/reference/stripe/index.html +314 -0
- data/docs/reference/stripe/resources/customer/index.html +387 -0
- data/docs/reference/stripe/resources/index.html +330 -0
- data/docs/reference/stripe/resources/resource/index.html +351 -0
- data/docs/style-guide/index.html +396 -0
- data/documentation/build.sh +8 -0
- data/documentation/generate.rb +32 -0
- data/documentation/generators/generator.rb +80 -0
- data/documentation/generators/guides/generator.rb +36 -0
- data/documentation/generators/reference/generator.rb +76 -0
- data/documentation/generators/reference/ledger/generator.rb +74 -0
- data/documentation/generators/template.rb +22 -0
- data/documentation/helper_methods.rb +17 -0
- data/documentation/site/CNAME +1 -0
- data/documentation/site/Gemfile +11 -0
- data/documentation/site/Gemfile.lock +69 -0
- data/documentation/site/LICENSE.md +40 -0
- data/documentation/site/README.md +8 -0
- data/documentation/site/_config.yml +113 -0
- data/documentation/site/_data/guides_sections.yml +10 -0
- data/documentation/site/_data/reference_sections.yml +5 -0
- data/documentation/site/_includes/action_link.html +8 -0
- data/documentation/site/_includes/alerts/base.html +3 -0
- data/documentation/site/_includes/alerts/danger.html +1 -0
- data/documentation/site/_includes/alerts/info.html +1 -0
- data/documentation/site/_includes/alerts/success.html +1 -0
- data/documentation/site/_includes/alerts/warning.html +1 -0
- data/documentation/site/_includes/cta_buttons.html +4 -0
- data/documentation/site/_includes/example.md +8 -0
- data/documentation/site/_includes/footer.html +25 -0
- data/documentation/site/_includes/getting_help.md +8 -0
- data/documentation/site/_includes/guides_menu.html +29 -0
- data/documentation/site/_includes/guides_submenu.html +7 -0
- data/documentation/site/_includes/header.html +35 -0
- data/documentation/site/_includes/installation_instructions.md +17 -0
- data/documentation/site/_includes/ledgers/Stripe_summary.md +1 -0
- data/documentation/site/_includes/ledgers/netsuite_soap_summary.md +1 -0
- data/documentation/site/_includes/ledgers/netsuite_summary.md +1 -0
- data/documentation/site/_includes/ledgers/netsuite_summary_shared.md +1 -0
- data/documentation/site/_includes/ledgers/quickbooks_online_summary.md +1 -0
- data/documentation/site/_includes/reference/netsuite/authentication/_token_based_authentication.md +99 -0
- data/documentation/site/_includes/reference/netsuite/authentication/index.md +15 -0
- data/documentation/site/_includes/reference/netsuite/authentication/token_based_authentication.md +6 -0
- data/documentation/site/_includes/reference/netsuite/index.md +25 -0
- data/documentation/site/_includes/reference/netsuite_soap/index.md +11 -0
- data/documentation/site/_includes/reference/quickbooks_online/authentication/index.md +55 -0
- data/documentation/site/_includes/reference/quickbooks_online/errors/index.md +9 -0
- data/documentation/site/_includes/reference/quickbooks_online/index.md +6 -0
- data/documentation/site/_includes/reference/quickbooks_online/webhooks/index.md +42 -0
- data/documentation/site/_includes/reference/stripe/index.md +6 -0
- data/documentation/site/_includes/section_content.html +34 -0
- data/documentation/site/_includes/section_cta.html +28 -0
- data/documentation/site/_includes/section_grid.html +60 -0
- data/documentation/site/_includes/section_guides.html +35 -0
- data/documentation/site/_includes/section_hero.html +28 -0
- data/documentation/site/_includes/submenu.html +8 -0
- data/documentation/site/_layouts/advanced.html +9 -0
- data/documentation/site/_layouts/base.html +34 -0
- data/documentation/site/_layouts/blog.html +51 -0
- data/documentation/site/_layouts/body.html +11 -0
- data/documentation/site/_layouts/guides.html +46 -0
- data/documentation/site/_layouts/page.html +26 -0
- data/documentation/site/_layouts/post.html +52 -0
- data/documentation/site/_layouts/reference.html +46 -0
- data/documentation/site/_layouts/reference_netsuite.html +46 -0
- data/documentation/site/_layouts/reference_netsuite_soap.html +46 -0
- data/documentation/site/_layouts/reference_quickbooks_online.html +46 -0
- data/documentation/site/_layouts/reference_stripe.html +46 -0
- data/documentation/site/_plugins/filters.rb +122 -0
- data/documentation/site/_plugins/hooks.rb +9 -0
- data/documentation/site/_posts/2020-06-01-introducing-docs.md +17 -0
- data/documentation/site/_posts/2020-06-10-netsuite-authentication.md +382 -0
- data/documentation/site/_sass/imports/_animations.scss +19 -0
- data/documentation/site/_sass/imports/_footer.scss +94 -0
- data/documentation/site/_sass/imports/_functions.scss +69 -0
- data/documentation/site/_sass/imports/_general.scss +687 -0
- data/documentation/site/_sass/imports/_guides.scss +300 -0
- data/documentation/site/_sass/imports/_header.scss +358 -0
- data/documentation/site/_sass/imports/_icons.scss +90 -0
- data/documentation/site/_sass/imports/_post-navigation.scss +67 -0
- data/documentation/site/_sass/imports/_posts-pages.scss +165 -0
- data/documentation/site/_sass/imports/_prism.scss +174 -0
- data/documentation/site/_sass/imports/_reset.scss +210 -0
- data/documentation/site/_sass/imports/_sections.scss +370 -0
- data/documentation/site/_sass/imports/_structure.scss +44 -0
- data/documentation/site/_templates/_layouts/reference_ledger.html.erb +46 -0
- data/documentation/site/_templates/guides/ledger.md.erb +9 -0
- data/documentation/site/_templates/reference/resources/index.md.erb +9 -0
- data/documentation/site/_templates/reference/resources/resource.md.erb +27 -0
- data/documentation/site/assets/css/brands.min.css +5 -0
- data/documentation/site/assets/css/fontawesome.min.css +5 -0
- data/documentation/site/assets/css/main.scss +45 -0
- data/documentation/site/assets/css/monokai.css +441 -0
- data/documentation/site/assets/js/main.js +214 -0
- data/documentation/site/assets/js/plugins.js +22 -0
- data/documentation/site/assets/js/prism.js +9 -0
- data/documentation/site/assets/webfonts/fa-brands-400.eot +0 -0
- data/documentation/site/assets/webfonts/fa-brands-400.svg +3452 -0
- data/documentation/site/assets/webfonts/fa-brands-400.ttf +0 -0
- data/documentation/site/assets/webfonts/fa-brands-400.woff +0 -0
- data/documentation/site/assets/webfonts/fa-brands-400.woff2 +0 -0
- data/documentation/site/blog/index.md +6 -0
- data/documentation/site/guides/architecture/clients.md +35 -0
- data/documentation/site/guides/architecture/index.md +14 -0
- data/documentation/site/guides/architecture/operations.md +45 -0
- data/documentation/site/guides/architecture/resources.md +40 -0
- data/documentation/site/guides/architecture/results.md +6 -0
- data/documentation/site/guides/architecture/searchers.md +28 -0
- data/documentation/site/guides/architecture/serialization.md +59 -0
- data/documentation/site/guides/community/index.md +8 -0
- data/documentation/site/guides/contribute/console.md +6 -0
- data/documentation/site/guides/contribute/deployment.md +17 -0
- data/documentation/site/guides/contribute/documentation.md +37 -0
- data/documentation/site/guides/contribute/index.md +18 -0
- data/documentation/site/guides/contribute/qa.md +16 -0
- data/documentation/site/guides/contribute/testing.md +6 -0
- data/documentation/site/guides/customization/custom_resources.md +50 -0
- data/documentation/site/guides/customization/custom_serializers.md +47 -0
- data/documentation/site/guides/customization/index.md +15 -0
- data/documentation/site/guides/customization/resource_converters.md +79 -0
- data/documentation/site/guides/getting-started/get-help.md +7 -0
- data/documentation/site/guides/getting-started/index.md +8 -0
- data/documentation/site/guides/getting-started/installation.md +7 -0
- data/documentation/site/guides/getting-started/quick-start.md +123 -0
- data/documentation/site/guides/index.md +16 -0
- data/documentation/site/guides/ledgers/index.md +12 -0
- data/documentation/site/guides/ledgers/netsuite.md +9 -0
- data/documentation/site/guides/ledgers/netsuite_soap.md +9 -0
- data/documentation/site/guides/ledgers/quickbooks_online.md +9 -0
- data/documentation/site/guides/ledgers/stripe.md +9 -0
- data/documentation/site/guides/modern-treasury/index.md +14 -0
- data/documentation/site/guides/tips_and_more/index.md +76 -0
- data/documentation/site/images/1.jpg +0 -0
- data/documentation/site/images/10.jpg +0 -0
- data/documentation/site/images/2.jpg +0 -0
- data/documentation/site/images/3.jpg +0 -0
- data/documentation/site/images/4.jpg +0 -0
- data/documentation/site/images/5.jpg +0 -0
- data/documentation/site/images/6.jpg +0 -0
- data/documentation/site/images/7.jpg +0 -0
- data/documentation/site/images/8.jpg +0 -0
- data/documentation/site/images/9.jpg +0 -0
- data/documentation/site/images/logo.svg +8 -0
- data/documentation/site/index.md +99 -0
- data/documentation/site/overview.md +21 -0
- data/documentation/site/reference/architecture/clients.md +33 -0
- data/documentation/site/reference/architecture/index.md +14 -0
- data/documentation/site/reference/architecture/operations.md +6 -0
- data/documentation/site/reference/architecture/resources.md +38 -0
- data/documentation/site/reference/architecture/results.md +6 -0
- data/documentation/site/reference/architecture/searchers.md +6 -0
- data/documentation/site/reference/architecture/serialization.md +6 -0
- data/documentation/site/reference/index.md +6 -0
- data/documentation/site/reference/netsuite/authentication/_token_based_authentication.md +99 -0
- data/documentation/site/reference/netsuite/authentication/index.md +15 -0
- data/documentation/site/reference/netsuite/authentication/token_based_authentication.md +6 -0
- data/documentation/site/reference/netsuite/index.md +25 -0
- data/documentation/site/reference/netsuite/resources/account.md +38 -0
- data/documentation/site/reference/netsuite/resources/check.md +49 -0
- data/documentation/site/reference/netsuite/resources/check_line_item.md +23 -0
- data/documentation/site/reference/netsuite/resources/currency.md +45 -0
- data/documentation/site/reference/netsuite/resources/customer.md +48 -0
- data/documentation/site/reference/netsuite/resources/customer_deposit.md +46 -0
- data/documentation/site/reference/netsuite/resources/department.md +47 -0
- data/documentation/site/reference/netsuite/resources/deposit.md +25 -0
- data/documentation/site/reference/netsuite/resources/deposit_line_item.md +23 -0
- data/documentation/site/reference/netsuite/resources/index.md +25 -0
- data/documentation/site/reference/netsuite/resources/invoice.md +25 -0
- data/documentation/site/reference/netsuite/resources/invoice_line_item.md +22 -0
- data/documentation/site/reference/netsuite/resources/item.md +19 -0
- data/documentation/site/reference/netsuite/resources/journal_entry.md +48 -0
- data/documentation/site/reference/netsuite/resources/journal_entry_line_item.md +24 -0
- data/documentation/site/reference/netsuite/resources/ledger_class.md +47 -0
- data/documentation/site/reference/netsuite/resources/location.md +43 -0
- data/documentation/site/reference/netsuite/resources/resource.md +18 -0
- data/documentation/site/reference/netsuite/resources/subsidiary.md +20 -0
- data/documentation/site/reference/netsuite/resources/vendor.md +49 -0
- data/documentation/site/reference/netsuite_soap/index.md +11 -0
- data/documentation/site/reference/netsuite_soap/resources/customer.md +34 -0
- data/documentation/site/reference/netsuite_soap/resources/index.md +9 -0
- data/documentation/site/reference/netsuite_soap/resources/resource.md +18 -0
- data/documentation/site/reference/netsuite_soap/resources/subsidiary.md +32 -0
- data/documentation/site/reference/quickbooks_online/authentication/index.md +55 -0
- data/documentation/site/reference/quickbooks_online/errors/index.md +9 -0
- data/documentation/site/reference/quickbooks_online/index.md +6 -0
- data/documentation/site/reference/quickbooks_online/resources/account.md +44 -0
- data/documentation/site/reference/quickbooks_online/resources/bill.md +45 -0
- data/documentation/site/reference/quickbooks_online/resources/bill_line_item.md +22 -0
- data/documentation/site/reference/quickbooks_online/resources/bill_payment.md +49 -0
- data/documentation/site/reference/quickbooks_online/resources/bill_payment_line_item.md +20 -0
- data/documentation/site/reference/quickbooks_online/resources/currency.md +21 -0
- data/documentation/site/reference/quickbooks_online/resources/customer.md +40 -0
- data/documentation/site/reference/quickbooks_online/resources/department.md +41 -0
- data/documentation/site/reference/quickbooks_online/resources/deposit.md +43 -0
- data/documentation/site/reference/quickbooks_online/resources/deposit_line_item.md +23 -0
- data/documentation/site/reference/quickbooks_online/resources/expense.md +46 -0
- data/documentation/site/reference/quickbooks_online/resources/expense_line_item.md +22 -0
- data/documentation/site/reference/quickbooks_online/resources/index.md +33 -0
- data/documentation/site/reference/quickbooks_online/resources/invoice.md +43 -0
- data/documentation/site/reference/quickbooks_online/resources/invoice_sales_line_item.md +22 -0
- data/documentation/site/reference/quickbooks_online/resources/item.md +19 -0
- data/documentation/site/reference/quickbooks_online/resources/journal_entry.md +41 -0
- data/documentation/site/reference/quickbooks_online/resources/journal_entry_line_item.md +24 -0
- data/documentation/site/reference/quickbooks_online/resources/ledger_class.md +41 -0
- data/documentation/site/reference/quickbooks_online/resources/payment.md +46 -0
- data/documentation/site/reference/quickbooks_online/resources/payment_line_item.md +20 -0
- data/documentation/site/reference/quickbooks_online/resources/preferences.md +34 -0
- data/documentation/site/reference/quickbooks_online/resources/primary_email_addr.md +19 -0
- data/documentation/site/reference/quickbooks_online/resources/primary_phone.md +19 -0
- data/documentation/site/reference/quickbooks_online/resources/resource.md +18 -0
- data/documentation/site/reference/quickbooks_online/resources/subsidiary.md +20 -0
- data/documentation/site/reference/quickbooks_online/resources/transfer.md +42 -0
- data/documentation/site/reference/quickbooks_online/resources/vendor.md +43 -0
- data/documentation/site/reference/quickbooks_online/webhooks/index.md +42 -0
- data/documentation/site/reference/stripe/index.md +6 -0
- data/documentation/site/reference/stripe/resources/customer.md +45 -0
- data/documentation/site/reference/stripe/resources/index.md +8 -0
- data/documentation/site/reference/stripe/resources/resource.md +18 -0
- data/documentation/site/style-guide.md +137 -0
- data/ledger_sync.gemspec +1 -1
- data/lib/ledger_sync.rb +40 -65
- data/lib/ledger_sync/core_ext/resonad.rb +2 -2
- data/lib/ledger_sync/deserializer.rb +55 -6
- data/lib/ledger_sync/error.rb +15 -0
- data/lib/ledger_sync/error/ledger_errors.rb +72 -0
- data/lib/ledger_sync/error/resource_errors.rb +34 -4
- data/lib/ledger_sync/ledger_configuration.rb +61 -0
- data/lib/ledger_sync/ledger_configuration_store.rb +56 -0
- data/lib/ledger_sync/ledgers/client.rb +112 -0
- data/lib/ledger_sync/ledgers/contract.rb +16 -0
- data/lib/ledger_sync/ledgers/dashboard_url_helper.rb +23 -0
- data/lib/ledger_sync/ledgers/mixins/infer_client_mixin.rb +28 -0
- data/lib/ledger_sync/ledgers/mixins/infer_resource_class_mixin.rb +25 -0
- data/lib/ledger_sync/ledgers/mixins/infer_serializer_mixin.rb +52 -0
- data/lib/ledger_sync/ledgers/mixins/infer_validation_contract_mixin.rb +27 -0
- data/lib/ledger_sync/ledgers/mixins/offset_and_limit_pagination_searcher_mixin.rb +37 -0
- data/lib/ledger_sync/ledgers/mixins/serialization_mixin.rb +41 -0
- data/lib/ledger_sync/ledgers/netsuite/account/deserializer.rb +23 -0
- data/lib/ledger_sync/ledgers/netsuite/account/operations/create.rb +28 -0
- data/lib/ledger_sync/ledgers/netsuite/account/operations/find.rb +28 -0
- data/lib/ledger_sync/ledgers/netsuite/account/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/account/searcher_deserializer.rb +29 -0
- data/lib/ledger_sync/ledgers/netsuite/account/serializer.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/check/deserializer.rb +29 -0
- data/lib/ledger_sync/ledgers/netsuite/check/operations/create.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/check/operations/delete.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/check/operations/find.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/check/operations/update.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/check/searcher.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/check/searcher_deserializer.rb +16 -0
- data/lib/ledger_sync/ledgers/netsuite/check/serializer.rb +50 -0
- data/lib/ledger_sync/ledgers/netsuite/check_line_item/deserializer.rb +17 -0
- data/lib/ledger_sync/ledgers/netsuite/check_line_item/serializer.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/client.rb +184 -0
- data/lib/ledger_sync/ledgers/netsuite/config.rb +5 -0
- data/lib/ledger_sync/ledgers/netsuite/currency/deserializer.rb +23 -0
- data/lib/ledger_sync/ledgers/netsuite/currency/operations/create.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/currency/operations/delete.rb +23 -0
- data/lib/ledger_sync/ledgers/netsuite/currency/operations/find.rb +23 -0
- data/lib/ledger_sync/ledgers/netsuite/currency/operations/update.rb +23 -0
- data/lib/ledger_sync/ledgers/netsuite/currency/serializer.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/customer/deserializer.rb +22 -0
- data/lib/ledger_sync/ledgers/netsuite/customer/operations/create.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/customer/operations/delete.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/customer/operations/find.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/customer/operations/update.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/customer/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/customer/searcher_deserializer.rb +18 -0
- data/lib/ledger_sync/ledgers/netsuite/customer/serializer.rb +29 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/deserializer.rb +20 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/operations/create.rb +24 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/operations/delete.rb +24 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/operations/find.rb +24 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/operations/update.rb +24 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/searcher_deserializer.rb +16 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/serializer.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/dashboard_url_helper.rb +28 -0
- data/lib/ledger_sync/ledgers/netsuite/department/deserializer.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/department/operations/create.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/department/operations/delete.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/department/operations/find.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/department/operations/update.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/department/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/department/searcher_deserializer.rb +19 -0
- data/lib/ledger_sync/ledgers/netsuite/department/serializer.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/deserializer.rb +18 -0
- data/lib/ledger_sync/ledgers/netsuite/error.rb +18 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/deserializer.rb +31 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/operations/create.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/operations/delete.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/operations/find.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/operations/update.rb +30 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/serializer.rb +36 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry_line_item/deserializer.rb +23 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry_line_item/serializer.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/deserializer.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/operations/create.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/operations/delete.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/operations/find.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/operations/update.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/searcher_deserializer.rb +19 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/serializer.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/location/deserializer.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/location/operations/create.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/location/operations/delete.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/location/operations/find.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/location/operations/update.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/location/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/location/serializer.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/operation.rb +40 -0
- data/lib/ledger_sync/ledgers/netsuite/operation/create.rb +58 -0
- data/lib/ledger_sync/ledgers/netsuite/operation/delete.rb +49 -0
- data/lib/ledger_sync/ledgers/netsuite/operation/find.rb +60 -0
- data/lib/ledger_sync/ledgers/netsuite/operation/update.rb +61 -0
- data/lib/ledger_sync/ledgers/netsuite/record/http_method.rb +33 -0
- data/lib/ledger_sync/ledgers/netsuite/record/metadata.rb +105 -0
- data/lib/ledger_sync/ledgers/netsuite/record/parameter.rb +20 -0
- data/lib/ledger_sync/ledgers/netsuite/record/property.rb +22 -0
- data/lib/ledger_sync/ledgers/netsuite/reference/serializer.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/resource.rb +10 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/account.rb +44 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/check.rb +23 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/check_line_item.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/currency.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/customer.rb +19 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/customer_deposit.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/department.rb +16 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/deposit.rb +28 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/deposit_line_item.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/invoice.rb +28 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/invoice_line_item.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/item.rb +11 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/journal_entry.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/journal_entry_line_item.rb +24 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/ledger_class.rb +16 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/location.rb +11 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/subsidiary.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/vendor.rb +23 -0
- data/lib/ledger_sync/ledgers/netsuite/searcher.rb +64 -0
- data/lib/ledger_sync/ledgers/netsuite/serializer.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/subsidiary/deserializer.rb +17 -0
- data/lib/ledger_sync/ledgers/netsuite/subsidiary/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/subsidiary/searcher_deserializer.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/subsidiary/serializer.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/token.rb +158 -0
- data/lib/ledger_sync/ledgers/netsuite/type/deserializer_active_type.rb +32 -0
- data/lib/ledger_sync/ledgers/netsuite/type/deserializer_customer_type.rb +33 -0
- data/lib/ledger_sync/ledgers/netsuite/type/deserializer_entity_type.rb +30 -0
- data/lib/ledger_sync/ledgers/netsuite/type/deserializer_subsidiary_type.rb +33 -0
- data/lib/ledger_sync/ledgers/netsuite/vendor/deserializer.rb +30 -0
- data/lib/ledger_sync/ledgers/netsuite/vendor/operations/create.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/vendor/operations/delete.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/vendor/operations/find.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/vendor/operations/update.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/vendor/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/vendor/searcher_deserializer.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/vendor/serializer.rb +30 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/client.rb +92 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/config.rb +5 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/customer/operations/create.rb +64 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/customer/operations/find.rb +49 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/operation.rb +40 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/operation/create.rb +29 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/operation/find.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/resource.rb +10 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/resources/customer.rb +29 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/resources/subsidiary.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/subsidiary/operations/create.rb +42 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/subsidiary/operations/find.rb +38 -0
- data/lib/ledger_sync/ledgers/operation.rb +181 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/account/deserializer.rb +43 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/account/operations/create.rb +26 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/account/operations/find.rb +26 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/account/operations/update.rb +30 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/account/searcher.rb +15 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/account/serializer.rb +37 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill/deserializer.rb +45 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill/operations/create.rb +27 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill/operations/find.rb +27 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill/operations/update.rb +27 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill/searcher.rb +14 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill/serializer.rb +44 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_line_item/deserializer.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_line_item/serializer.rb +29 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment/deserializer.rb +59 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment/operations/create.rb +33 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment/operations/find.rb +33 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment/operations/update.rb +33 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment/serializer.rb +77 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment_line_item/deserializer.rb +18 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment_line_item/serializer.rb +18 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/client.rb +258 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/config.rb +8 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/currency/deserializer.rb +17 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/currency/serializer.rb +16 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/customer/deserializer.rb +19 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/customer/operations/create.rb +26 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/customer/operations/find.rb +26 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/customer/operations/update.rb +26 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/customer/searcher.rb +13 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/customer/serializer.rb +19 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/dashboard_url_helper.rb +34 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/department/deserializer.rb +28 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/department/operations/create.rb +23 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/department/operations/find.rb +23 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/department/operations/update.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/department/searcher.rb +17 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/department/serializer.rb +49 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit/deserializer.rb +39 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit/operations/create.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit/operations/find.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit/operations/update.rb +27 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit/searcher.rb +13 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit/serializer.rb +39 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit_line_item/deserializer.rb +38 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit_line_item/serializer.rb +41 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deserializer.rb +98 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/expense/deserializer.rb +58 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/expense/operations/create.rb +28 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/expense/operations/find.rb +28 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/expense/operations/update.rb +28 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/expense/searcher.rb +14 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/expense/serializer.rb +59 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/expense_line_item/deserializer.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/expense_line_item/serializer.rb +27 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/invoice/deserializer.rb +35 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/invoice/operations/create.rb +27 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/invoice/operations/find.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/invoice/operations/update.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/invoice/serializer.rb +35 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/invoice_sales_line_item/deserializer.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/invoice_sales_line_item/serializer.rb +29 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/item/deserializer.rb +13 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/item/serializer.rb +12 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry/deserializer.rb +33 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry/operations/create.rb +23 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry/operations/find.rb +23 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry/operations/update.rb +23 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry/searcher.rb +14 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry/serializer.rb +33 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry_line_item/deserializer.rb +32 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry_line_item/serializer.rb +36 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/ledger_class/deserializer.rb +29 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/ledger_class/operations/create.rb +23 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/ledger_class/operations/find.rb +23 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/ledger_class/operations/update.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/ledger_class/searcher.rb +15 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/ledger_class/serializer.rb +24 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/oauth_client.rb +93 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/operation.rb +61 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/operation/create.rb +26 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/operation/find.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/operation/full_update.rb +44 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/operation/sparse_update.rb +29 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/payment/deserializer.rb +48 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/payment/operations/create.rb +30 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/payment/operations/find.rb +28 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/payment/operations/update.rb +28 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/payment/serializer.rb +48 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/payment_line_item/deserializer.rb +18 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/payment_line_item/serializer.rb +18 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/preferences/deserializer.rb +43 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/preferences/operations/find.rb +30 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/preferences/serializer.rb +43 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/request.rb +98 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resource.rb +10 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/account.rb +355 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/bill.rb +31 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/bill_line_item.rb +21 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/bill_payment.rb +42 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/bill_payment_line_item.rb +19 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/currency.rb +13 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/customer.rb +19 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/department.rb +16 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/deposit.rb +28 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/deposit_line_item.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/expense.rb +40 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/expense_line_item.rb +21 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/invoice.rb +28 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/invoice_sales_line_item.rb +21 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/item.rb +11 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/journal_entry.rb +24 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/journal_entry_line_item.rb +29 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/ledger_class.rb +16 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/payment.rb +31 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/payment_line_item.rb +19 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/preferences.rb +24 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/primary_email_addr.rb +11 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/primary_phone.rb +11 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/subsidiary.rb +12 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/transfer.rb +24 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/vendor.rb +23 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/searcher.rb +60 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/serialization/type/amount_float_to_integer_type.rb +21 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/serialization/type/deserialize_transaction_reference_type.rb +30 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/serialization/type/integer_to_amount_float_type.rb +21 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/serialization/type/serialize_transaction_reference_type.rb +30 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/serializer.rb +71 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/serialziation/type/mapping_type.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/transfer/deserializer.rb +34 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/transfer/operations/create.rb +24 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/transfer/operations/find.rb +24 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/transfer/operations/update.rb +26 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/transfer/serializer.rb +34 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/util/error_matcher.rb +54 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/util/error_parser.rb +27 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/util/ledger_error_parser.rb +103 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/util/operation_error_parser.rb +99 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/vendor/deserializer.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/vendor/operations/create.rb +27 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/vendor/operations/find.rb +27 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/vendor/operations/update.rb +27 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/vendor/searcher.rb +15 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/vendor/serializer.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/webhook.rb +58 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/webhook_event.rb +79 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/webhook_notification.rb +42 -0
- data/lib/ledger_sync/ledgers/request.rb +57 -0
- data/lib/ledger_sync/ledgers/response.rb +55 -0
- data/lib/ledger_sync/ledgers/searcher.rb +73 -0
- data/lib/ledger_sync/ledgers/stripe/client.rb +37 -0
- data/lib/ledger_sync/ledgers/stripe/config.rb +5 -0
- data/lib/ledger_sync/ledgers/stripe/customer/operations/create.rb +44 -0
- data/lib/ledger_sync/ledgers/stripe/customer/operations/delete.rb +35 -0
- data/lib/ledger_sync/ledgers/stripe/customer/operations/find.rb +44 -0
- data/lib/ledger_sync/ledgers/stripe/customer/operations/update.rb +43 -0
- data/lib/ledger_sync/ledgers/stripe/dashboard_url_helper.rb +21 -0
- data/lib/ledger_sync/ledgers/stripe/operation.rb +35 -0
- data/lib/ledger_sync/ledgers/stripe/operation/create.rb +17 -0
- data/lib/ledger_sync/ledgers/stripe/operation/delete.rb +17 -0
- data/lib/ledger_sync/ledgers/stripe/operation/find.rb +15 -0
- data/lib/ledger_sync/ledgers/stripe/operation/update.rb +17 -0
- data/lib/ledger_sync/ledgers/stripe/resource.rb +10 -0
- data/lib/ledger_sync/ledgers/stripe/resources/customer.rb +13 -0
- data/lib/ledger_sync/operation.rb +23 -0
- data/lib/ledger_sync/resource.rb +12 -1
- data/lib/ledger_sync/resource_adaptor.rb +52 -0
- data/lib/ledger_sync/resource_attribute.rb +6 -7
- data/lib/ledger_sync/resource_attribute/dirty_mixin.rb +4 -0
- data/lib/ledger_sync/resource_attribute/mixin.rb +1 -1
- data/lib/ledger_sync/resource_attribute/reference/many.rb +10 -18
- data/lib/ledger_sync/resource_attribute/reference/one.rb +6 -1
- data/lib/ledger_sync/result.rb +3 -3
- data/lib/ledger_sync/serialization/attribute.rb +4 -10
- data/lib/ledger_sync/serialization/attribute_set_mixin.rb +1 -1
- data/lib/ledger_sync/serialization/deserializer_attribute.rb +30 -12
- data/lib/ledger_sync/serialization/deserializer_attribute_set.rb +1 -1
- data/lib/ledger_sync/serialization/mixin.rb +12 -14
- data/lib/ledger_sync/serialization/serializer_attribute.rb +16 -3
- data/lib/ledger_sync/serialization/serializer_attribute_set.rb +1 -1
- data/lib/ledger_sync/serialization/type/deserializer_references_many_type.rb +26 -0
- data/lib/ledger_sync/serialization/type/deserializer_references_one_type.rb +12 -0
- data/lib/ledger_sync/serialization/type/deserializer_type.rb +29 -0
- data/lib/ledger_sync/serialization/type/format_date_type.rb +23 -0
- data/lib/ledger_sync/serialization/type/mapping_type.rb +23 -0
- data/lib/ledger_sync/serialization/type/parse_date_type.rb +23 -0
- data/lib/ledger_sync/serialization/type/serializer_references_many_type.rb +21 -0
- data/lib/ledger_sync/serialization/type/serializer_references_one_type.rb +12 -0
- data/lib/ledger_sync/serialization/type/serializer_type.rb +5 -5
- data/lib/ledger_sync/serializer.rb +49 -0
- data/lib/ledger_sync/type/boolean.rb +2 -0
- data/lib/ledger_sync/type/date.rb +1 -1
- data/lib/ledger_sync/type/float.rb +2 -0
- data/lib/ledger_sync/type/hash.rb +6 -2
- data/lib/ledger_sync/type/id.rb +6 -2
- data/lib/ledger_sync/type/integer.rb +2 -0
- data/lib/ledger_sync/type/reference_many.rb +15 -5
- data/lib/ledger_sync/type/reference_one.rb +9 -22
- data/lib/ledger_sync/type/string.rb +2 -0
- data/lib/ledger_sync/type/string_from_set.rb +43 -0
- data/lib/ledger_sync/type/value_mixin.rb +37 -7
- data/lib/ledger_sync/util/mixins/delegate_iterable_methods_mixin.rb +1 -0
- data/lib/ledger_sync/util/mixins/resource_registerable_mixin.rb +29 -0
- data/lib/ledger_sync/util/resource_converter.rb +113 -0
- data/lib/ledger_sync/util/resource_converter/attribute.rb +131 -0
- data/lib/ledger_sync/util/resource_converter/attribute_set.rb +42 -0
- data/lib/ledger_sync/util/resource_converter/type/references_many_type.rb +27 -0
- data/lib/ledger_sync/util/resource_converter/type/references_one_type.rb +14 -0
- data/lib/ledger_sync/util/resource_converter/type/resource_converter_type.rb +26 -0
- data/lib/ledger_sync/util/resources_builder.rb +19 -11
- data/lib/ledger_sync/util/string_helpers.rb +3 -3
- data/lib/ledger_sync/util/url_helpers.rb +38 -0
- data/lib/ledger_sync/util/validator.rb +3 -1
- data/lib/ledger_sync/version.rb +1 -1
- data/licenses/BSL.txt +97 -0
- data/licenses/documentation_site.txt +7 -0
- metadata +683 -243
- data/.ruby-version +0 -1
- data/_config.yml +0 -1
- data/lib/ledger_sync/adaptor_configuration.rb +0 -61
- data/lib/ledger_sync/adaptor_configuration_store.rb +0 -56
- data/lib/ledger_sync/adaptors/adaptor.rb +0 -100
- data/lib/ledger_sync/adaptors/contract.rb +0 -16
- data/lib/ledger_sync/adaptors/dashboard_url_helper.rb +0 -23
- data/lib/ledger_sync/adaptors/ledger_serializer.rb +0 -143
- data/lib/ledger_sync/adaptors/ledger_serializer_attribute.rb +0 -178
- data/lib/ledger_sync/adaptors/ledger_serializer_attribute_set.rb +0 -56
- data/lib/ledger_sync/adaptors/ledger_serializer_type/mapping_type.rb +0 -41
- data/lib/ledger_sync/adaptors/ledger_serializer_type/references_many_type.rb +0 -24
- data/lib/ledger_sync/adaptors/ledger_serializer_type/references_one_type.rb +0 -22
- data/lib/ledger_sync/adaptors/ledger_serializer_type/value_type.rb +0 -17
- data/lib/ledger_sync/adaptors/mixins/infer_adaptor_class_mixin.rb +0 -24
- data/lib/ledger_sync/adaptors/mixins/infer_ledger_serializer_mixin.rb +0 -61
- data/lib/ledger_sync/adaptors/mixins/infer_resource_class_mixin.rb +0 -22
- data/lib/ledger_sync/adaptors/mixins/infer_validation_contract_mixin.rb +0 -27
- data/lib/ledger_sync/adaptors/mixins/offset_and_limit_pagination_searcher_mixin.rb +0 -37
- data/lib/ledger_sync/adaptors/netsuite/account/ledger_deserializer.rb +0 -24
- data/lib/ledger_sync/adaptors/netsuite/account/ledger_serializer.rb +0 -22
- data/lib/ledger_sync/adaptors/netsuite/account/operations/create.rb +0 -28
- data/lib/ledger_sync/adaptors/netsuite/account/operations/find.rb +0 -28
- data/lib/ledger_sync/adaptors/netsuite/account/searcher.rb +0 -12
- data/lib/ledger_sync/adaptors/netsuite/account/searcher_ledger_deserializer.rb +0 -30
- data/lib/ledger_sync/adaptors/netsuite/adaptor.rb +0 -161
- data/lib/ledger_sync/adaptors/netsuite/config.rb +0 -5
- data/lib/ledger_sync/adaptors/netsuite/currency/deledger_serializer.rb +0 -28
- data/lib/ledger_sync/adaptors/netsuite/currency/ledger_serializer.rb +0 -25
- data/lib/ledger_sync/adaptors/netsuite/currency/operations/create.rb +0 -25
- data/lib/ledger_sync/adaptors/netsuite/currency/operations/delete.rb +0 -23
- data/lib/ledger_sync/adaptors/netsuite/currency/operations/find.rb +0 -23
- data/lib/ledger_sync/adaptors/netsuite/currency/operations/update.rb +0 -23
- data/lib/ledger_sync/adaptors/netsuite/customer/ledger_deserializer.rb +0 -27
- data/lib/ledger_sync/adaptors/netsuite/customer/ledger_serializer.rb +0 -38
- data/lib/ledger_sync/adaptors/netsuite/customer/operations/create.rb +0 -24
- data/lib/ledger_sync/adaptors/netsuite/customer/operations/delete.rb +0 -24
- data/lib/ledger_sync/adaptors/netsuite/customer/operations/find.rb +0 -24
- data/lib/ledger_sync/adaptors/netsuite/customer/operations/update.rb +0 -24
- data/lib/ledger_sync/adaptors/netsuite/customer/searcher.rb +0 -12
- data/lib/ledger_sync/adaptors/netsuite/customer/searcher_ledger_deserializer.rb +0 -23
- data/lib/ledger_sync/adaptors/netsuite/dashboard_url_helper.rb +0 -24
- data/lib/ledger_sync/adaptors/netsuite/department/ledger_serializer.rb +0 -17
- data/lib/ledger_sync/adaptors/netsuite/department/operations/create.rb +0 -25
- data/lib/ledger_sync/adaptors/netsuite/department/operations/delete.rb +0 -25
- data/lib/ledger_sync/adaptors/netsuite/department/operations/find.rb +0 -25
- data/lib/ledger_sync/adaptors/netsuite/department/operations/update.rb +0 -25
- data/lib/ledger_sync/adaptors/netsuite/department/searcher.rb +0 -12
- data/lib/ledger_sync/adaptors/netsuite/department/searcher_ledger_deserializer.rb +0 -21
- data/lib/ledger_sync/adaptors/netsuite/ledger_serializer.rb +0 -30
- data/lib/ledger_sync/adaptors/netsuite/ledger_serializer_type/active_type.rb +0 -26
- data/lib/ledger_sync/adaptors/netsuite/ledger_serializer_type/reference_type.rb +0 -24
- data/lib/ledger_sync/adaptors/netsuite/ledger_serializer_type/subsidiary_type.rb +0 -22
- data/lib/ledger_sync/adaptors/netsuite/location/ledger_serializer.rb +0 -18
- data/lib/ledger_sync/adaptors/netsuite/location/operations/create.rb +0 -21
- data/lib/ledger_sync/adaptors/netsuite/location/operations/delete.rb +0 -21
- data/lib/ledger_sync/adaptors/netsuite/location/operations/find.rb +0 -21
- data/lib/ledger_sync/adaptors/netsuite/location/operations/update.rb +0 -21
- data/lib/ledger_sync/adaptors/netsuite/location/searcher.rb +0 -12
- data/lib/ledger_sync/adaptors/netsuite/operation.rb +0 -19
- data/lib/ledger_sync/adaptors/netsuite/operation/create.rb +0 -65
- data/lib/ledger_sync/adaptors/netsuite/operation/delete.rb +0 -49
- data/lib/ledger_sync/adaptors/netsuite/operation/find.rb +0 -56
- data/lib/ledger_sync/adaptors/netsuite/operation/update.rb +0 -68
- data/lib/ledger_sync/adaptors/netsuite/record/http_method.rb +0 -33
- data/lib/ledger_sync/adaptors/netsuite/record/metadata.rb +0 -105
- data/lib/ledger_sync/adaptors/netsuite/record/parameter.rb +0 -20
- data/lib/ledger_sync/adaptors/netsuite/record/property.rb +0 -22
- data/lib/ledger_sync/adaptors/netsuite/searcher.rb +0 -58
- data/lib/ledger_sync/adaptors/netsuite/token.rb +0 -162
- data/lib/ledger_sync/adaptors/netsuite/vendor/ledger_deserializer.rb +0 -32
- data/lib/ledger_sync/adaptors/netsuite/vendor/ledger_serializer.rb +0 -35
- data/lib/ledger_sync/adaptors/netsuite/vendor/operations/create.rb +0 -27
- data/lib/ledger_sync/adaptors/netsuite/vendor/operations/delete.rb +0 -27
- data/lib/ledger_sync/adaptors/netsuite/vendor/operations/find.rb +0 -27
- data/lib/ledger_sync/adaptors/netsuite/vendor/operations/update.rb +0 -27
- data/lib/ledger_sync/adaptors/netsuite/vendor/searcher.rb +0 -12
- data/lib/ledger_sync/adaptors/netsuite/vendor/searcher_ledger_deserializer.rb +0 -23
- data/lib/ledger_sync/adaptors/netsuite_soap/adaptor.rb +0 -92
- data/lib/ledger_sync/adaptors/netsuite_soap/config.rb +0 -5
- data/lib/ledger_sync/adaptors/netsuite_soap/customer/ledger_serializer.rb +0 -13
- data/lib/ledger_sync/adaptors/netsuite_soap/customer/operations/create.rb +0 -64
- data/lib/ledger_sync/adaptors/netsuite_soap/customer/operations/find.rb +0 -49
- data/lib/ledger_sync/adaptors/netsuite_soap/ledger_serializer.rb +0 -25
- data/lib/ledger_sync/adaptors/netsuite_soap/operation.rb +0 -40
- data/lib/ledger_sync/adaptors/netsuite_soap/operation/create.rb +0 -29
- data/lib/ledger_sync/adaptors/netsuite_soap/operation/find.rb +0 -15
- data/lib/ledger_sync/adaptors/netsuite_soap/subsidiary/operations/create.rb +0 -42
- data/lib/ledger_sync/adaptors/netsuite_soap/subsidiary/operations/find.rb +0 -38
- data/lib/ledger_sync/adaptors/operation.rb +0 -180
- data/lib/ledger_sync/adaptors/quickbooks_online/account/ledger_serializer.rb +0 -37
- data/lib/ledger_sync/adaptors/quickbooks_online/account/operations/create.rb +0 -26
- data/lib/ledger_sync/adaptors/quickbooks_online/account/operations/find.rb +0 -26
- data/lib/ledger_sync/adaptors/quickbooks_online/account/operations/update.rb +0 -30
- data/lib/ledger_sync/adaptors/quickbooks_online/account/searcher.rb +0 -15
- data/lib/ledger_sync/adaptors/quickbooks_online/adaptor.rb +0 -258
- data/lib/ledger_sync/adaptors/quickbooks_online/bill/ledger_serializer.rb +0 -46
- data/lib/ledger_sync/adaptors/quickbooks_online/bill/operations/create.rb +0 -27
- data/lib/ledger_sync/adaptors/quickbooks_online/bill/operations/find.rb +0 -27
- data/lib/ledger_sync/adaptors/quickbooks_online/bill/operations/update.rb +0 -27
- data/lib/ledger_sync/adaptors/quickbooks_online/bill/searcher.rb +0 -14
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_line_item/ledger_serializer.rb +0 -30
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_payment/ledger_serializer.rb +0 -76
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_payment/operations/create.rb +0 -33
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_payment/operations/find.rb +0 -33
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_payment/operations/update.rb +0 -33
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_payment_line_item/ledger_serializer.rb +0 -19
- data/lib/ledger_sync/adaptors/quickbooks_online/config.rb +0 -8
- data/lib/ledger_sync/adaptors/quickbooks_online/currency/ledger_serializer.rb +0 -17
- data/lib/ledger_sync/adaptors/quickbooks_online/customer/ledger_serializer.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/customer/operations/create.rb +0 -22
- data/lib/ledger_sync/adaptors/quickbooks_online/customer/operations/find.rb +0 -22
- data/lib/ledger_sync/adaptors/quickbooks_online/customer/operations/update.rb +0 -24
- data/lib/ledger_sync/adaptors/quickbooks_online/customer/searcher.rb +0 -13
- data/lib/ledger_sync/adaptors/quickbooks_online/dashboard_url_helper.rb +0 -34
- data/lib/ledger_sync/adaptors/quickbooks_online/department/ledger_serializer.rb +0 -41
- data/lib/ledger_sync/adaptors/quickbooks_online/department/operations/create.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/department/operations/find.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/department/operations/update.rb +0 -25
- data/lib/ledger_sync/adaptors/quickbooks_online/department/searcher.rb +0 -17
- data/lib/ledger_sync/adaptors/quickbooks_online/deposit/ledger_serializer.rb +0 -40
- data/lib/ledger_sync/adaptors/quickbooks_online/deposit/operations/create.rb +0 -25
- data/lib/ledger_sync/adaptors/quickbooks_online/deposit/operations/find.rb +0 -25
- data/lib/ledger_sync/adaptors/quickbooks_online/deposit/operations/update.rb +0 -27
- data/lib/ledger_sync/adaptors/quickbooks_online/deposit/searcher.rb +0 -13
- data/lib/ledger_sync/adaptors/quickbooks_online/deposit_line_item/ledger_serializer.rb +0 -34
- data/lib/ledger_sync/adaptors/quickbooks_online/expense/ledger_serializer.rb +0 -52
- data/lib/ledger_sync/adaptors/quickbooks_online/expense/operations/create.rb +0 -28
- data/lib/ledger_sync/adaptors/quickbooks_online/expense/operations/find.rb +0 -28
- data/lib/ledger_sync/adaptors/quickbooks_online/expense/operations/update.rb +0 -28
- data/lib/ledger_sync/adaptors/quickbooks_online/expense/searcher.rb +0 -14
- data/lib/ledger_sync/adaptors/quickbooks_online/expense_line_item/ledger_serializer.rb +0 -30
- data/lib/ledger_sync/adaptors/quickbooks_online/invoice/ledger_serializer.rb +0 -36
- data/lib/ledger_sync/adaptors/quickbooks_online/invoice/operations/create.rb +0 -27
- data/lib/ledger_sync/adaptors/quickbooks_online/invoice/operations/find.rb +0 -25
- data/lib/ledger_sync/adaptors/quickbooks_online/invoice/operations/update.rb +0 -25
- data/lib/ledger_sync/adaptors/quickbooks_online/invoice_sales_line_item/ledger_serializer.rb +0 -30
- data/lib/ledger_sync/adaptors/quickbooks_online/item/ledger_serializer.rb +0 -13
- data/lib/ledger_sync/adaptors/quickbooks_online/journal_entry/ledger_serializer.rb +0 -34
- data/lib/ledger_sync/adaptors/quickbooks_online/journal_entry/operations/create.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/journal_entry/operations/find.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/journal_entry/operations/update.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/journal_entry/searcher.rb +0 -14
- data/lib/ledger_sync/adaptors/quickbooks_online/journal_entry_line_item/ledger_serializer.rb +0 -37
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_class/ledger_serializer.rb +0 -25
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_class/operations/create.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_class/operations/find.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_class/operations/update.rb +0 -25
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_class/searcher.rb +0 -15
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer.rb +0 -131
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/account_sub_type.rb +0 -305
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/account_type.rb +0 -51
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/amount_type.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/classification_type.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/date_type.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/department_reference_type.rb +0 -26
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/entity_reference_type.rb +0 -49
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/journal_entry_line_item_type.rb +0 -20
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/payment_type.rb +0 -21
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/transaction_reference_type.rb +0 -49
- data/lib/ledger_sync/adaptors/quickbooks_online/oauth_client.rb +0 -93
- data/lib/ledger_sync/adaptors/quickbooks_online/operation.rb +0 -60
- data/lib/ledger_sync/adaptors/quickbooks_online/operation/create.rb +0 -26
- data/lib/ledger_sync/adaptors/quickbooks_online/operation/find.rb +0 -25
- data/lib/ledger_sync/adaptors/quickbooks_online/operation/full_update.rb +0 -44
- data/lib/ledger_sync/adaptors/quickbooks_online/operation/sparse_update.rb +0 -29
- data/lib/ledger_sync/adaptors/quickbooks_online/payment/ledger_serializer.rb +0 -50
- data/lib/ledger_sync/adaptors/quickbooks_online/payment/operations/create.rb +0 -30
- data/lib/ledger_sync/adaptors/quickbooks_online/payment/operations/find.rb +0 -28
- data/lib/ledger_sync/adaptors/quickbooks_online/payment/operations/update.rb +0 -28
- data/lib/ledger_sync/adaptors/quickbooks_online/payment_line_item/ledger_serializer.rb +0 -19
- data/lib/ledger_sync/adaptors/quickbooks_online/preferences/ledger_serializer.rb +0 -45
- data/lib/ledger_sync/adaptors/quickbooks_online/preferences/operations/find.rb +0 -38
- data/lib/ledger_sync/adaptors/quickbooks_online/request.rb +0 -98
- data/lib/ledger_sync/adaptors/quickbooks_online/resources/preferences.rb +0 -24
- data/lib/ledger_sync/adaptors/quickbooks_online/searcher.rb +0 -61
- data/lib/ledger_sync/adaptors/quickbooks_online/transfer/ledger_serializer.rb +0 -36
- data/lib/ledger_sync/adaptors/quickbooks_online/transfer/operations/create.rb +0 -24
- data/lib/ledger_sync/adaptors/quickbooks_online/transfer/operations/find.rb +0 -24
- data/lib/ledger_sync/adaptors/quickbooks_online/transfer/operations/update.rb +0 -26
- data/lib/ledger_sync/adaptors/quickbooks_online/util/adaptor_error_parser.rb +0 -103
- data/lib/ledger_sync/adaptors/quickbooks_online/util/error_matcher.rb +0 -54
- data/lib/ledger_sync/adaptors/quickbooks_online/util/error_parser.rb +0 -27
- data/lib/ledger_sync/adaptors/quickbooks_online/util/operation_error_parser.rb +0 -99
- data/lib/ledger_sync/adaptors/quickbooks_online/vendor/ledger_serializer.rb +0 -25
- data/lib/ledger_sync/adaptors/quickbooks_online/vendor/operations/create.rb +0 -27
- data/lib/ledger_sync/adaptors/quickbooks_online/vendor/operations/find.rb +0 -27
- data/lib/ledger_sync/adaptors/quickbooks_online/vendor/operations/update.rb +0 -27
- data/lib/ledger_sync/adaptors/quickbooks_online/vendor/searcher.rb +0 -15
- data/lib/ledger_sync/adaptors/quickbooks_online/webhook.rb +0 -58
- data/lib/ledger_sync/adaptors/quickbooks_online/webhook_event.rb +0 -79
- data/lib/ledger_sync/adaptors/quickbooks_online/webhook_notification.rb +0 -42
- data/lib/ledger_sync/adaptors/request.rb +0 -53
- data/lib/ledger_sync/adaptors/response.rb +0 -55
- data/lib/ledger_sync/adaptors/searcher.rb +0 -72
- data/lib/ledger_sync/adaptors/stripe/adaptor.rb +0 -37
- data/lib/ledger_sync/adaptors/stripe/config.rb +0 -5
- data/lib/ledger_sync/adaptors/stripe/customer/operations/create.rb +0 -44
- data/lib/ledger_sync/adaptors/stripe/customer/operations/delete.rb +0 -35
- data/lib/ledger_sync/adaptors/stripe/customer/operations/find.rb +0 -44
- data/lib/ledger_sync/adaptors/stripe/customer/operations/update.rb +0 -43
- data/lib/ledger_sync/adaptors/stripe/dashboard_url_helper.rb +0 -21
- data/lib/ledger_sync/adaptors/stripe/operation.rb +0 -35
- data/lib/ledger_sync/adaptors/stripe/operation/create.rb +0 -17
- data/lib/ledger_sync/adaptors/stripe/operation/delete.rb +0 -17
- data/lib/ledger_sync/adaptors/stripe/operation/find.rb +0 -15
- data/lib/ledger_sync/adaptors/stripe/operation/update.rb +0 -17
- data/lib/ledger_sync/adaptors/test/customer/ledger_serializer.rb +0 -12
- data/lib/ledger_sync/adaptors/test/ledger_serializer.rb +0 -12
- data/lib/ledger_sync/error/adaptor_errors.rb +0 -72
- data/lib/ledger_sync/resources/account.rb +0 -17
- data/lib/ledger_sync/resources/bill.rb +0 -27
- data/lib/ledger_sync/resources/bill_line_item.rb +0 -17
- data/lib/ledger_sync/resources/bill_payment.rb +0 -32
- data/lib/ledger_sync/resources/bill_payment_line_item.rb +0 -15
- data/lib/ledger_sync/resources/currency.rb +0 -9
- data/lib/ledger_sync/resources/customer.rb +0 -25
- data/lib/ledger_sync/resources/department.rb +0 -14
- data/lib/ledger_sync/resources/deposit.rb +0 -24
- data/lib/ledger_sync/resources/deposit_line_item.rb +0 -22
- data/lib/ledger_sync/resources/expense.rb +0 -33
- data/lib/ledger_sync/resources/expense_line_item.rb +0 -17
- data/lib/ledger_sync/resources/invoice.rb +0 -24
- data/lib/ledger_sync/resources/invoice_sales_line_item.rb +0 -17
- data/lib/ledger_sync/resources/item.rb +0 -5
- data/lib/ledger_sync/resources/journal_entry.rb +0 -20
- data/lib/ledger_sync/resources/journal_entry_line_item.rb +0 -20
- data/lib/ledger_sync/resources/ledger_class.rb +0 -14
- data/lib/ledger_sync/resources/location.rb +0 -7
- data/lib/ledger_sync/resources/payment.rb +0 -27
- data/lib/ledger_sync/resources/payment_line_item.rb +0 -15
- data/lib/ledger_sync/resources/subsidiary.rb +0 -8
- data/lib/ledger_sync/resources/transfer.rb +0 -20
- data/lib/ledger_sync/resources/vendor.rb +0 -19
- data/lib/ledger_sync/serialization/deserializer_delegator.rb +0 -17
- data/lib/ledger_sync/serialization/serializer_delegator.rb +0 -17
- data/lib/ledger_sync/serialization/type/references_many_type.rb +0 -19
- data/lib/ledger_sync/serialization/type/references_one_type.rb +0 -12
- data/lib/ledger_sync/serialization/type/value_type.rb +0 -15
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Jekyll::Hooks.register :site, :pre_render do |site, _payload|
|
4
|
+
site.pages.each do |page|
|
5
|
+
page.data['rel_dir'] = File.dirname(page.path)
|
6
|
+
page.data['basename'] = File.basename(page.path)
|
7
|
+
page.data['filename'] = File.basename(page.path, '.*')
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
title: Introducing Documentation
|
3
|
+
excerpt: >-
|
4
|
+
Completely re-designed the documentation, including guides, ledger references, and the LedgerSync blog.
|
5
|
+
date: '2020-06-01'
|
6
|
+
# thumb_image: images/4.jpg
|
7
|
+
# image: images/3.jpg
|
8
|
+
layout: post
|
9
|
+
---
|
10
|
+
|
11
|
+
LedgerSync has now grown to support three different ledgers! As LedgerSync grows, we want to ensure the library is easy
|
12
|
+
to use and understand. Our README was growing quite unwieldy, so we decided to generate this static website.
|
13
|
+
|
14
|
+
These docs contain a mix of manually and automatically generated content. We have developed scripts that keep our
|
15
|
+
docs in sync with the code. Our goal is to reduce the need to write documentation with each commit.
|
16
|
+
|
17
|
+
If you find any bugs or have any suggestions, please [open an issue on Github](https://github.com/LedgerSync/ledger_sync/issues/new).
|
@@ -0,0 +1,382 @@
|
|
1
|
+
---
|
2
|
+
title: How to authenticate to NetSuite's SuiteTalk REST Web Services API
|
3
|
+
excerpt: >-
|
4
|
+
A step-by-step guide to authenticating to the new NetSuite REST API.
|
5
|
+
date: '2020-06-01'
|
6
|
+
# thumb_image: images/4.jpg
|
7
|
+
# image: images/3.jpg
|
8
|
+
layout: post
|
9
|
+
---
|
10
|
+
|
11
|
+
Earlier this year, NetSuite released their new REST API called SuiteTalk REST Web Services. While still incomplete, this API provides a much friendlier interface for developers than its predecessors— the SOAP API and RESTlets. We chose to use the new REST API, because we believe it is the future for building integrations to NetSuite. The REST standard is much more intuitive, with many resources across many languages and frameworks.
|
12
|
+
|
13
|
+
{% include alerts/info.html title="Tip:" content="We do our best to write comprehensive unit tests for the entire library. Tests are a great resource for examples on inputs, outputs, and usage, not all of which may be documented here." %}
|
14
|
+
|
15
|
+
## Options for Authentication
|
16
|
+
|
17
|
+
The REST API offers two types of authentication: Token-Based Authentication (TBA) and OAuth 2.0. We chose to use TBA for the REST client.
|
18
|
+
|
19
|
+
Simply put, TBA is based on OAuth 1.0. Ultimately, you need to generate a request header that includes a signature created using tokens retrieved from the NetSuite dashboard and the OAuth 1.0 standard. Unfortunately, at the time of development, we hit a few walls trying to authenticate:
|
20
|
+
|
21
|
+
- The NetSuite documentation was only for their SOAP API and RESTlets
|
22
|
+
- There were no examples in Ruby
|
23
|
+
- Code samples relied on libraries or packages, making it hard to understand what was actually happening under the hood.
|
24
|
+
- The nonce and timestamp were not defined in the inputs of examples we found, so outputs would naturally vary given that these values are meant to change in practice.
|
25
|
+
- There were very few examples that had both inputs and signature output to test against.
|
26
|
+
|
27
|
+
In the end, the challenge of authenticating to NetSuite in the REST API was computing the signature. No examples we found worked for us, and regardless, we needed it in Ruby. Frustratingly, the only way to know if we were correct was to try API calls after making tweaks to our signature generation algorithm.
|
28
|
+
|
29
|
+
If you’re reading this post, hopefully this will save you a headache or two. We will clearly lay out our solution, break it down step-by-step, and we will give you some real examples. Let’s get going!
|
30
|
+
|
31
|
+
## Our Solution
|
32
|
+
|
33
|
+
Let’s start with the full solution, which can be found in the LedgerSync library class `LedgerSync::Ledgers::NetSuite::Token` (code can be found here). The Token handles creating the authorization header that will be used to sign the request. The request header looks something like this:
|
34
|
+
|
35
|
+
```
|
36
|
+
Authorization: OAuth realm="TEST_REALM",oauth_consumer_key="ef40afdd8abaac111b13825dd5e5e2ddddb44f86d5a0dd6dcf38c20aae6b67e4",oauth_token="2b0ce516420110bcbd36b69e99196d1b7f6de3c6234c5afb799b73d87569f5cc",oauth_signature_method="HMAC-SHA256",oauth_timestamp="1508242306",oauth_nonce="fjaLirsIcCGVZWzBX0pg",oauth_version="1.0",oauth_signature="i7MEtGwhCTIZbTsTrNGw9LdcERn4wsjt5C7TxmKWIfU%3D"
|
37
|
+
```
|
38
|
+
|
39
|
+
## The Inputs
|
40
|
+
|
41
|
+
To compute a signature, we need a few things first. Let’s walk through each one and how to find it:
|
42
|
+
|
43
|
+
### `method`
|
44
|
+
|
45
|
+
The request method will be one of the following:
|
46
|
+
|
47
|
+
- `POST`
|
48
|
+
- `PUT`
|
49
|
+
- `PATCH`
|
50
|
+
- `GET`
|
51
|
+
- `DELETE`
|
52
|
+
|
53
|
+
### `consumer_key`, `consumer_secret`
|
54
|
+
|
55
|
+
The consumer key and secret can be retrieved from NetSuite by creating an Integration Record. Note that these values are only shown once at the end of creating a new Integration Record. Once you navigate away, you will no longer be able to see these values. You can reset the key and secret on existing Integration Records should you need to generate a new pair.
|
56
|
+
|
57
|
+
### `signature_method`
|
58
|
+
|
59
|
+
NetSuite supports multiple signature methods. Our library uses HMAC-SHA256.
|
60
|
+
|
61
|
+
### `timestamp`
|
62
|
+
|
63
|
+
We need to include a current timestamp in the signature and header.
|
64
|
+
|
65
|
+
### `nonce`
|
66
|
+
|
67
|
+
We need to include a random alphanumeric string to be used in the signature and header.
|
68
|
+
|
69
|
+
### `oauth_version`
|
70
|
+
|
71
|
+
The OAuth Version is defaults to “1.0”
|
72
|
+
|
73
|
+
### `realm`
|
74
|
+
|
75
|
+
The realm is the NetSuite account ID. You can find this in your account or in the URL:
|
76
|
+
|
77
|
+
`https://<ACCOUNT_ID>.app.netsuite.com/app/center/card.nl`
|
78
|
+
|
79
|
+
If you are using a sandbox or test drive account, your account ID will include a hyphen and some other characters. For example, it may look like this: `9876543-sb1`.
|
80
|
+
|
81
|
+
Once you have the account ID, we will need to transform it to the format the API expects. You replace any hyphens with underscores (a.k.a. `_`) and capitalize all letters. So `9876543-sb1` will become `9876543_SB1`.
|
82
|
+
|
83
|
+
### `token_id`, `token_secret`
|
84
|
+
|
85
|
+
These values can be found in NetSuite when you [create an Access Token](https://system.netsuite.com/app/setup/accesstokens.nl). Like the Integration Record, these values are only visible at the end of creating the token and will not be shown again. You can also reset these values on existing Access Tokens.
|
86
|
+
|
87
|
+
### `url`
|
88
|
+
|
89
|
+
This is the URL of the request, which must include any query string parameters you intend to pass.
|
90
|
+
|
91
|
+
## Example Values
|
92
|
+
|
93
|
+
For this guide, we will use the following values:
|
94
|
+
|
95
|
+
<div class="responsive-table">
|
96
|
+
<table>
|
97
|
+
<caption>Input values</caption>
|
98
|
+
<thead>
|
99
|
+
<tr>
|
100
|
+
<th>Variable</th>
|
101
|
+
<th>Value</th>
|
102
|
+
</tr>
|
103
|
+
</thead>
|
104
|
+
<tbody>
|
105
|
+
<tr>
|
106
|
+
<td><code>method</code></td>
|
107
|
+
<td><code>"GET"</code></td>
|
108
|
+
</tr>
|
109
|
+
<tr>
|
110
|
+
<td><code>consumer_key</code></td>
|
111
|
+
<td><code>"CONSUMER_KEY_VALUE"</code></td>
|
112
|
+
</tr>
|
113
|
+
<tr>
|
114
|
+
<td><code>consumer_secret</code></td>
|
115
|
+
<td><code>"CONSUMER_SECRET_VALUE"</code></td>
|
116
|
+
</tr>
|
117
|
+
<tr>
|
118
|
+
<td><code>signature_method</code></td>
|
119
|
+
<td>default, <code>"HMAC-SHA256"</code></td>
|
120
|
+
</tr>
|
121
|
+
<tr>
|
122
|
+
<td><code>timestamp</code></td>
|
123
|
+
<td>Typically, you will leave this empty, but we will use <code>1234567890</code></td>
|
124
|
+
</tr>
|
125
|
+
<tr>
|
126
|
+
<td><code>nonce</code></td>
|
127
|
+
<td>Typically, you will leave this empty, but we will use <code>"asdfasdf"</code></td>
|
128
|
+
</tr>
|
129
|
+
<tr>
|
130
|
+
<td><code>oauth_version</code></td>
|
131
|
+
<td>default, <code>"1.0"</code></td>
|
132
|
+
</tr>
|
133
|
+
<tr>
|
134
|
+
<td><code>realm</code></td>
|
135
|
+
<td><code>"9876543_SB1"</code></td>
|
136
|
+
</tr>
|
137
|
+
<tr>
|
138
|
+
<td><code>token_id</code></td>
|
139
|
+
<td><code>"TOKEN_ID_VALUE"</code></td>
|
140
|
+
</tr>
|
141
|
+
<tr>
|
142
|
+
<td><code>token_secret</code></td>
|
143
|
+
<td><code>"TOKEN_SECRET_VALUE"</code></td>
|
144
|
+
</tr>
|
145
|
+
<tr>
|
146
|
+
<td><code>url</code></td>
|
147
|
+
<td><code>"https://9876543-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customer/123?expandSubResources=true"</code></td>
|
148
|
+
</tr>
|
149
|
+
</tbody>
|
150
|
+
</table>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
{% capture default_values_note %}
|
154
|
+
The values for <code>nonce</code> and <code>timestamp</code> should be left <code>nil</code> or unpassed in practice. They are included here for purposes of having a consistent input and output, where typically they would be generated on the fly.
|
155
|
+
{% endcapture %}
|
156
|
+
|
157
|
+
{% include alerts/info.html title="Note:" content=default_values_note %}
|
158
|
+
|
159
|
+
Throughout this tutorial, examples will appear in the following style. You can copy and paste this code in sequence to get the same results.
|
160
|
+
|
161
|
+
{% capture example_content %}
|
162
|
+
```ruby
|
163
|
+
method = 'GET'
|
164
|
+
consumer_key = 'CONSUMER_KEY_VALUE'
|
165
|
+
consumer_secret = 'CONSUMER_SECRET_VALUE'
|
166
|
+
nonce = 'asdfasdf'
|
167
|
+
oauth_version = '1.0'
|
168
|
+
realm = '9876543_SB1'
|
169
|
+
signature_method = 'HMAC-SHA256'
|
170
|
+
timestamp = 1_234_567_890
|
171
|
+
token_id = 'TOKEN_ID_VALUE'
|
172
|
+
token_secret = 'TOKEN_SECRET_VALUE'
|
173
|
+
url = 'https://9876543-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customer/123?expandSubResources=true'
|
174
|
+
```
|
175
|
+
{% endcapture %}
|
176
|
+
|
177
|
+
{% include example.md content=example_content %}
|
178
|
+
|
179
|
+
|
180
|
+
## Generating the header
|
181
|
+
|
182
|
+
Now that we have our inputs, we can walk through computing the signature and header.
|
183
|
+
|
184
|
+
Before we dive in, please note that many values need to be escaped. If you see `escape(...)` being used below, it is shorthand for the following:
|
185
|
+
|
186
|
+
```ruby
|
187
|
+
def escape(str)
|
188
|
+
CGI.escape(str.to_s).gsub(/\+/, '%20')
|
189
|
+
end
|
190
|
+
```
|
191
|
+
|
192
|
+
Now let's walk through each step:
|
193
|
+
|
194
|
+
### 1. Build data string
|
195
|
+
|
196
|
+
We need to create a string that will be used to compute a digest (a.k.a. signature) from. Using our values above, we can retrieve the string using the following:
|
197
|
+
|
198
|
+
{% capture example_content %}
|
199
|
+
```ruby
|
200
|
+
token = LedgerSync::Ledgers::NetSuite::Token.new(
|
201
|
+
method: method,
|
202
|
+
consumer_key: consumer_key,
|
203
|
+
consumer_secret: consumer_secret,
|
204
|
+
realm: realm,
|
205
|
+
token_id: token_id,
|
206
|
+
token_secret: token_secret,
|
207
|
+
url: url
|
208
|
+
)
|
209
|
+
|
210
|
+
puts token.signature_data_string
|
211
|
+
```
|
212
|
+
{% endcapture %}
|
213
|
+
|
214
|
+
{% capture example_result %}
|
215
|
+
```ruby
|
216
|
+
"GET&https%3A%2F%2F9876543-sb1.suitetalk.api.netsuite.com%2Fservices%2Frest%2Frecord%2Fv1%2Fcustomer%2F123&expandSubResources%3Dtrue%26oauth_consumer_key%3DCONSUMER_KEY_VALUE%26oauth_nonce%3Dasdfasdf%26oauth_signature_method%3DHMAC-SHA256%26oauth_timestamp%3D1234567890%26oauth_token%3DTOKEN_ID_VALUE%26oauth_version%3D1.0"
|
217
|
+
```
|
218
|
+
{% endcapture %}
|
219
|
+
|
220
|
+
{% include example.md content=example_content result=example_result %}
|
221
|
+
|
222
|
+
But how is this created? It is composed of three values that are escaped and joined with `&`. The values are as follows:
|
223
|
+
|
224
|
+
- `method`: Described in the inputs above.
|
225
|
+
- `url_without_params`: The `url` with all query parameters removed. In our example, this would be `https://9876543-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customer/123`
|
226
|
+
- `parameters_string`: A string representation of all URL parameters as well as the oauth parameters.
|
227
|
+
|
228
|
+
Let's dive a level deeper and look into creating the `parameters` string.
|
229
|
+
|
230
|
+
### 1a. Build parameters string
|
231
|
+
|
232
|
+
The parameters string is a sorted list of key/value pairs each joined with an ampersand (`&`). The key/value pairs come from two sources:
|
233
|
+
|
234
|
+
- Query parameters parsed out of the URL, in our case `{ "expandSubResources" => "true }`
|
235
|
+
- OAuth parameters
|
236
|
+
|
237
|
+
For our example, we would have the following:
|
238
|
+
|
239
|
+
{% capture example_content %}
|
240
|
+
```ruby
|
241
|
+
url_params = {
|
242
|
+
"expandSubResources" => "true"
|
243
|
+
}
|
244
|
+
|
245
|
+
oauth_parameters_array = {
|
246
|
+
oauth_consumer_key: consumer_key,
|
247
|
+
oauth_nonce: nonce,
|
248
|
+
oauth_signature_method: signature_method,
|
249
|
+
oauth_timestamp: timestamp,
|
250
|
+
oauth_token: token_id,
|
251
|
+
oauth_version: oauth_version
|
252
|
+
}.to_a
|
253
|
+
|
254
|
+
parameters_string = url_params.to_a
|
255
|
+
.concat(oauth_parameters_array)
|
256
|
+
.map { |k, v| [escape(k), escape(v)] }
|
257
|
+
.sort { |a, b| a <=> b }
|
258
|
+
.map { |e| "#{e[0]}=#{e[1]}" }
|
259
|
+
.join('&')
|
260
|
+
|
261
|
+
puts parameters_string
|
262
|
+
```
|
263
|
+
{% endcapture %}
|
264
|
+
|
265
|
+
{% capture example_result %}
|
266
|
+
```ruby
|
267
|
+
"expandSubResources=true&oauth_consumer_key=CONSUMER_KEY_VALUE&oauth_nonce=asdfasdf&oauth_signature_method=HMAC-SHA256&oauth_timestamp=1234567890&oauth_token=TOKEN_ID_VALUE&oauth_version=1.0"
|
268
|
+
```
|
269
|
+
{% endcapture %}
|
270
|
+
|
271
|
+
{% include example.md content=example_content result=example_result %}
|
272
|
+
|
273
|
+
### 1b. Put it together
|
274
|
+
|
275
|
+
Now that we have our `parameters_string`, we can generate the following:
|
276
|
+
|
277
|
+
{% capture example_content %}
|
278
|
+
```ruby
|
279
|
+
url_without_params = "https://9876543-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/customer/123"
|
280
|
+
|
281
|
+
signature_data_string = [
|
282
|
+
method,
|
283
|
+
escape(url_without_params),
|
284
|
+
escape(parameters_string)
|
285
|
+
].join('&')
|
286
|
+
```
|
287
|
+
{% endcapture %}
|
288
|
+
|
289
|
+
{% capture example_result %}
|
290
|
+
```ruby
|
291
|
+
"GET&https%3A%2F%2F9876543-sb1.suitetalk.api.netsuite.com%2Fservices%2Frest%2Frecord%2Fv1%2Fcustomer%2F123&expandSubResources%3Dtrue%26oauth_consumer_key%3DCONSUMER_KEY_VALUE%26oauth_nonce%3Dasdfasdf%26oauth_signature_method%3DHMAC-SHA256%26oauth_timestamp%3D1234567890%26oauth_token%3DTOKEN_ID_VALUE%26oauth_version%3D1.0"
|
292
|
+
```
|
293
|
+
{% endcapture %}
|
294
|
+
|
295
|
+
{% include example.md content=example_content result=example_result %}
|
296
|
+
|
297
|
+
## 2. Build signature key
|
298
|
+
|
299
|
+
The final piece needed to generate a signature is the key. Our key is made by joining our `consumer_secret` to `token_secret` with an ampersand (`&`):
|
300
|
+
|
301
|
+
{% capture example_content %}
|
302
|
+
```ruby
|
303
|
+
key ||= [
|
304
|
+
consumer_secret,
|
305
|
+
token_secret
|
306
|
+
].join('&')
|
307
|
+
```
|
308
|
+
{% endcapture %}
|
309
|
+
|
310
|
+
{% capture example_result %}
|
311
|
+
```ruby
|
312
|
+
"CONSUMER_SECRET_VALUE&TOKEN_SECRET_VALUE"
|
313
|
+
```
|
314
|
+
{% endcapture %}
|
315
|
+
|
316
|
+
{% include example.md content=example_content result=example_result %}
|
317
|
+
|
318
|
+
## 3. Compute signature
|
319
|
+
|
320
|
+
Now with our `signature_data_string`, we will use the desired `signature_method` to compute a digest. We will assume we are using `HMAC-SHA256`.
|
321
|
+
|
322
|
+
{% capture example_content %}
|
323
|
+
```ruby
|
324
|
+
signature ||= Base64.encode64(
|
325
|
+
OpenSSL::HMAC.digest(
|
326
|
+
OpenSSL::Digest.new('sha256'),
|
327
|
+
key,
|
328
|
+
signature_data_string
|
329
|
+
)
|
330
|
+
).strip
|
331
|
+
```
|
332
|
+
{% endcapture %}
|
333
|
+
|
334
|
+
{% capture example_result %}
|
335
|
+
```ruby
|
336
|
+
"cId0B3hP0sFVQw/gjQ/P6YiOSx76u0WfyO8umOlq3gg="
|
337
|
+
```
|
338
|
+
{% endcapture %}
|
339
|
+
|
340
|
+
{% include example.md content=example_content result=example_result %}
|
341
|
+
|
342
|
+
## 4. Generate Header
|
343
|
+
|
344
|
+
Last but not least, we can now generate our header. The header is made by combining all of the inputs and our signature together in comma-separated, key-value pairs:
|
345
|
+
|
346
|
+
{% capture example_content %}
|
347
|
+
```ruby
|
348
|
+
authorization_parts = [
|
349
|
+
[:realm, realm],
|
350
|
+
[:oauth_consumer_key, escape(consumer_key)],
|
351
|
+
[:oauth_token, escape(token_id)],
|
352
|
+
[:oauth_signature_method, signature_method],
|
353
|
+
[:oauth_timestamp, timestamp],
|
354
|
+
[:oauth_nonce, escape(nonce)],
|
355
|
+
[:oauth_version, oauth_version],
|
356
|
+
[:oauth_signature, escape(signature)]
|
357
|
+
]
|
358
|
+
|
359
|
+
headers = {
|
360
|
+
'Authorization' => "OAuth #{authorization_parts.map { |k, v| "#{k}=\"#{v}\"" }.join(',')}"
|
361
|
+
}
|
362
|
+
|
363
|
+
puts headers
|
364
|
+
```
|
365
|
+
|
366
|
+
{% endcapture %}
|
367
|
+
|
368
|
+
{% capture example_result %}
|
369
|
+
```ruby
|
370
|
+
{"Authorization"=>"OAuth realm=\"9876543_SB1\",oauth_consumer_key=\"CONSUMER_KEY_VALUE\",oauth_token=\"TOKEN_ID_VALUE\",oauth_signature_method=\"HMAC-SHA256\",oauth_timestamp=\"1234567890\",oauth_nonce=\"asdfasdf\",oauth_version=\"1.0\",oauth_signature=\"cId0B3hP0sFVQw%2FgjQ%2FP6YiOSx76u0WfyO8umOlq3gg%3D\""}
|
371
|
+
```
|
372
|
+
{% endcapture %}
|
373
|
+
|
374
|
+
{% include example.md content=example_content result=example_result %}
|
375
|
+
|
376
|
+
## Wrapping up
|
377
|
+
|
378
|
+
All that is left is to use this header in a request. You will need a new signature (and therefore new header) per-request. And that's it!
|
379
|
+
|
380
|
+
While not difficult in practice, it was by trial-and-error we were ultimately able to authenticate to NetSuite. Hopefully this post saves you some time!
|
381
|
+
|
382
|
+
It is highly recommended that you write comprehensive unit tests for this code. We wrote some tests in RSpec. These test are a great resource for examples you can test against.
|
@@ -0,0 +1,94 @@
|
|
1
|
+
/**
|
2
|
+
* Site Footer
|
3
|
+
*/
|
4
|
+
.site-footer {
|
5
|
+
background-color: #fff;
|
6
|
+
padding-bottom: 1.5em;
|
7
|
+
padding-top: 1.5em;
|
8
|
+
|
9
|
+
a:not(.button) {
|
10
|
+
color: inherit;
|
11
|
+
|
12
|
+
&:hover,
|
13
|
+
&:focus {
|
14
|
+
color: _palette(accent);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
.site-info,
|
20
|
+
.social-links {
|
21
|
+
-webkit-box-align: center;
|
22
|
+
-ms-flex-align: center;
|
23
|
+
align-items: center;
|
24
|
+
display: -webkit-box;
|
25
|
+
display: -ms-flexbox;
|
26
|
+
display: flex;
|
27
|
+
-ms-flex-wrap: wrap;
|
28
|
+
flex-wrap: wrap;
|
29
|
+
-webkit-box-pack: center;
|
30
|
+
-ms-flex-pack: center;
|
31
|
+
justify-content: center;
|
32
|
+
font-size: 0.875em;
|
33
|
+
line-height: 1.2;
|
34
|
+
|
35
|
+
.button:not(.button-icon) {
|
36
|
+
font-size: inherit;
|
37
|
+
line-height: 1.2;
|
38
|
+
padding: 0.3em 1em;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
.site-info {
|
43
|
+
margin: 0.25em 0 0;
|
44
|
+
|
45
|
+
.copyright,
|
46
|
+
a {
|
47
|
+
margin: 0 8px 0.5em 0;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
.social-links {
|
52
|
+
margin-top: 0.9375em;
|
53
|
+
|
54
|
+
a {
|
55
|
+
margin: 0 15px 0.5em;
|
56
|
+
}
|
57
|
+
|
58
|
+
.icon {
|
59
|
+
font-size: 18px;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
@media only screen and (min-width: 641px) {
|
64
|
+
.site-footer-inside {
|
65
|
+
-webkit-box-align: start;
|
66
|
+
-ms-flex-align: start;
|
67
|
+
align-items: flex-start;
|
68
|
+
display: -webkit-box;
|
69
|
+
display: -ms-flexbox;
|
70
|
+
display: flex;
|
71
|
+
}
|
72
|
+
|
73
|
+
.site-info,
|
74
|
+
.social-links {
|
75
|
+
-webkit-box-pack: start;
|
76
|
+
-ms-flex-pack: start;
|
77
|
+
justify-content: flex-start;
|
78
|
+
}
|
79
|
+
|
80
|
+
.social-links {
|
81
|
+
-webkit-box-flex: 0;
|
82
|
+
-ms-flex: 0 0 auto;
|
83
|
+
flex: 0 0 auto;
|
84
|
+
-ms-flex-wrap: nowrap;
|
85
|
+
flex-wrap: nowrap;
|
86
|
+
margin-left: auto;
|
87
|
+
margin-top: 0;
|
88
|
+
|
89
|
+
a {
|
90
|
+
margin-left: 30px;
|
91
|
+
margin-right: 0;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|