workarea-api 4.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +20 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
- data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.gitignore +24 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +807 -0
- data/CODE_OF_CONDUCT.md +3 -0
- data/CONTRIBUTING.md +3 -0
- data/Gemfile +21 -0
- data/LICENSE +52 -0
- data/README.md +107 -0
- data/Rakefile +121 -0
- data/admin/.gitignore +12 -0
- data/admin/README.md +82 -0
- data/admin/Rakefile +10 -0
- data/admin/app/assets/images/workarea/api/admin/icons/api.svg +1 -0
- data/admin/app/controllers/workarea/api/admin/application_controller.rb +73 -0
- data/admin/app/controllers/workarea/api/admin/categories_controller.rb +305 -0
- data/admin/app/controllers/workarea/api/admin/category_product_rules_controller.rb +232 -0
- data/admin/app/controllers/workarea/api/admin/content_assets_controller.rb +299 -0
- data/admin/app/controllers/workarea/api/admin/content_controller.rb +268 -0
- data/admin/app/controllers/workarea/api/admin/discounts_controller.rb +271 -0
- data/admin/app/controllers/workarea/api/admin/email_signups_controller.rb +108 -0
- data/admin/app/controllers/workarea/api/admin/fulfillments_controller.rb +268 -0
- data/admin/app/controllers/workarea/api/admin/inventory_skus_controller.rb +305 -0
- data/admin/app/controllers/workarea/api/admin/navigation_menus_controller.rb +267 -0
- data/admin/app/controllers/workarea/api/admin/navigation_taxons_controller.rb +305 -0
- data/admin/app/controllers/workarea/api/admin/orders_controller.rb +160 -0
- data/admin/app/controllers/workarea/api/admin/pages_controller.rb +305 -0
- data/admin/app/controllers/workarea/api/admin/payment_profiles_controller.rb +305 -0
- data/admin/app/controllers/workarea/api/admin/payment_transactions_controller.rb +108 -0
- data/admin/app/controllers/workarea/api/admin/payments_controller.rb +115 -0
- data/admin/app/controllers/workarea/api/admin/prices_controller.rb +232 -0
- data/admin/app/controllers/workarea/api/admin/pricing_skus_controller.rb +305 -0
- data/admin/app/controllers/workarea/api/admin/product_images_controller.rb +232 -0
- data/admin/app/controllers/workarea/api/admin/products_controller.rb +305 -0
- data/admin/app/controllers/workarea/api/admin/promo_code_lists_controller.rb +305 -0
- data/admin/app/controllers/workarea/api/admin/recommendation_settings_controller.rb +122 -0
- data/admin/app/controllers/workarea/api/admin/redirects_controller.rb +305 -0
- data/admin/app/controllers/workarea/api/admin/releases_controller.rb +304 -0
- data/admin/app/controllers/workarea/api/admin/saved_addresses_controller.rb +232 -0
- data/admin/app/controllers/workarea/api/admin/saved_credit_cards_controller.rb +256 -0
- data/admin/app/controllers/workarea/api/admin/shipping_rates_controller.rb +232 -0
- data/admin/app/controllers/workarea/api/admin/shipping_services_controller.rb +299 -0
- data/admin/app/controllers/workarea/api/admin/shippings_controller.rb +105 -0
- data/admin/app/controllers/workarea/api/admin/swagger_controller.rb +41 -0
- data/admin/app/controllers/workarea/api/admin/tax_categories_controller.rb +242 -0
- data/admin/app/controllers/workarea/api/admin/tax_rates_controller.rb +292 -0
- data/admin/app/controllers/workarea/api/admin/users_controller.rb +296 -0
- data/admin/app/controllers/workarea/api/admin/variants_controller.rb +232 -0
- data/admin/app/models/workarea/api/admin/bulk_upsert.rb +74 -0
- data/admin/app/models/workarea/user.decorator +7 -0
- data/admin/app/views/workarea/admin/users/_api_permissions.html.haml +6 -0
- data/admin/app/workers/workarea/perform_api_bulk_upsert.rb +15 -0
- data/admin/bin/rails +18 -0
- data/admin/config/initializers/append_points.rb +4 -0
- data/admin/config/initializers/config.rb +15 -0
- data/admin/config/locales/en.yml +9 -0
- data/admin/config/routes.rb +81 -0
- data/admin/lib/workarea/api/admin/engine.rb +14 -0
- data/admin/lib/workarea/api/admin/swagger.rb +106 -0
- data/admin/lib/workarea/api/admin.rb +21 -0
- data/admin/test/documentation/workarea/api/admin/categories_documentation_test.rb +106 -0
- data/admin/test/documentation/workarea/api/admin/category_product_rules_documentation_test.rb +78 -0
- data/admin/test/documentation/workarea/api/admin/content_assets_documentation_test.rb +94 -0
- data/admin/test/documentation/workarea/api/admin/content_documentation_test.rb +87 -0
- data/admin/test/documentation/workarea/api/admin/discounts_documentation_test.rb +85 -0
- data/admin/test/documentation/workarea/api/admin/email_signups_documentation_test.rb +41 -0
- data/admin/test/documentation/workarea/api/admin/fulfillment_documentation_test.rb +84 -0
- data/admin/test/documentation/workarea/api/admin/inventory_skus_documentation_test.rb +95 -0
- data/admin/test/documentation/workarea/api/admin/navigation_menus_documentation_test.rb +81 -0
- data/admin/test/documentation/workarea/api/admin/navigation_taxons_documentation_test.rb +94 -0
- data/admin/test/documentation/workarea/api/admin/orders_documentation_test.rb +65 -0
- data/admin/test/documentation/workarea/api/admin/pages_documentation_test.rb +93 -0
- data/admin/test/documentation/workarea/api/admin/payment_profiles_documentation_test.rb +98 -0
- data/admin/test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb +43 -0
- data/admin/test/documentation/workarea/api/admin/payments_documentation_test.rb +41 -0
- data/admin/test/documentation/workarea/api/admin/prices_documentation_test.rb +82 -0
- data/admin/test/documentation/workarea/api/admin/pricing_skus_documentation_test.rb +95 -0
- data/admin/test/documentation/workarea/api/admin/product_images_documentation_test.rb +101 -0
- data/admin/test/documentation/workarea/api/admin/products_documentation_test.rb +96 -0
- data/admin/test/documentation/workarea/api/admin/promo_code_lists_documentation_test.rb +94 -0
- data/admin/test/documentation/workarea/api/admin/recommendation_settings_documentation_test.rb +37 -0
- data/admin/test/documentation/workarea/api/admin/redirects_documentation_test.rb +96 -0
- data/admin/test/documentation/workarea/api/admin/release_changes_documentation_test.rb +32 -0
- data/admin/test/documentation/workarea/api/admin/releases_documentation_test.rb +93 -0
- data/admin/test/documentation/workarea/api/admin/saved_addresses_documentation_test.rb +92 -0
- data/admin/test/documentation/workarea/api/admin/saved_credit_cards_documentation_test.rb +86 -0
- data/admin/test/documentation/workarea/api/admin/shipping_rates_documentation_test.rb +78 -0
- data/admin/test/documentation/workarea/api/admin/shipping_services_documentation_test.rb +93 -0
- data/admin/test/documentation/workarea/api/admin/shippings_documentation_test.rb +41 -0
- data/admin/test/documentation/workarea/api/admin/tax_categories_documentation_test.rb +95 -0
- data/admin/test/documentation/workarea/api/admin/tax_rates_documentation_test.rb +78 -0
- data/admin/test/documentation/workarea/api/admin/users_documentation_test.rb +99 -0
- data/admin/test/documentation/workarea/api/admin/variants_documentation_test.rb +80 -0
- data/admin/test/dummy/Rakefile +7 -0
- data/admin/test/dummy/app/assets/config/manifest.js +4 -0
- data/admin/test/dummy/app/assets/images/.keep +0 -0
- data/admin/test/dummy/app/assets/javascripts/application.js +13 -0
- data/admin/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/admin/test/dummy/app/controllers/application_controller.rb +3 -0
- data/admin/test/dummy/app/controllers/concerns/.keep +0 -0
- data/admin/test/dummy/app/helpers/application_helper.rb +2 -0
- data/admin/test/dummy/app/jobs/application_job.rb +2 -0
- data/admin/test/dummy/app/mailers/.keep +0 -0
- data/admin/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/admin/test/dummy/app/models/.keep +0 -0
- data/admin/test/dummy/app/models/concerns/.keep +0 -0
- data/admin/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/admin/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/admin/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/admin/test/dummy/bin/bundle +3 -0
- data/admin/test/dummy/bin/rails +4 -0
- data/admin/test/dummy/bin/rake +4 -0
- data/admin/test/dummy/bin/setup +34 -0
- data/admin/test/dummy/bin/update +29 -0
- data/admin/test/dummy/config/application.rb +25 -0
- data/admin/test/dummy/config/boot.rb +5 -0
- data/admin/test/dummy/config/cable.yml +9 -0
- data/admin/test/dummy/config/environment.rb +5 -0
- data/admin/test/dummy/config/environments/development.rb +55 -0
- data/admin/test/dummy/config/environments/production.rb +86 -0
- data/admin/test/dummy/config/environments/test.rb +43 -0
- data/admin/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/admin/test/dummy/config/initializers/assets.rb +11 -0
- data/admin/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/admin/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/admin/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/admin/test/dummy/config/initializers/inflections.rb +16 -0
- data/admin/test/dummy/config/initializers/mime_types.rb +4 -0
- data/admin/test/dummy/config/initializers/new_framework_defaults.rb +21 -0
- data/admin/test/dummy/config/initializers/session_store.rb +3 -0
- data/admin/test/dummy/config/initializers/workarea.rb +8 -0
- data/admin/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/admin/test/dummy/config/locales/en.yml +23 -0
- data/admin/test/dummy/config/puma.rb +47 -0
- data/admin/test/dummy/config/routes.rb +6 -0
- data/admin/test/dummy/config/secrets.yml +22 -0
- data/admin/test/dummy/config/spring.rb +6 -0
- data/admin/test/dummy/config.ru +4 -0
- data/admin/test/dummy/db/seeds.rb +2 -0
- data/admin/test/dummy/log/.keep +0 -0
- data/admin/test/dummy/public/404.html +67 -0
- data/admin/test/dummy/public/422.html +67 -0
- data/admin/test/dummy/public/500.html +66 -0
- data/admin/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/admin/test/dummy/public/apple-touch-icon.png +0 -0
- data/admin/test/dummy/public/favicon.ico +1 -0
- data/admin/test/integration/workarea/api/admin/audit_log_integration_test.rb +20 -0
- data/admin/test/integration/workarea/api/admin/authentication_integration_test.rb +61 -0
- data/admin/test/integration/workarea/api/admin/categories_integration_test.rb +64 -0
- data/admin/test/integration/workarea/api/admin/category_product_rules_integration_test.rb +58 -0
- data/admin/test/integration/workarea/api/admin/content_assets_integration_test.rb +65 -0
- data/admin/test/integration/workarea/api/admin/content_integration_test.rb +59 -0
- data/admin/test/integration/workarea/api/admin/discounts_integration_test.rb +64 -0
- data/admin/test/integration/workarea/api/admin/email_signups_integration_test.rb +32 -0
- data/admin/test/integration/workarea/api/admin/error_handling_integration_test.rb +16 -0
- data/admin/test/integration/workarea/api/admin/fulfillments_integration_test.rb +62 -0
- data/admin/test/integration/workarea/api/admin/inventory_skus_integration_test.rb +70 -0
- data/admin/test/integration/workarea/api/admin/navigation_menus_integration_test.rb +54 -0
- data/admin/test/integration/workarea/api/admin/navigation_taxons_integration_test.rb +63 -0
- data/admin/test/integration/workarea/api/admin/orders_integration_test.rb +53 -0
- data/admin/test/integration/workarea/api/admin/pages_integration_test.rb +64 -0
- data/admin/test/integration/workarea/api/admin/payment_profiles_integration_test.rb +75 -0
- data/admin/test/integration/workarea/api/admin/payment_transactions_integration_test.rb +45 -0
- data/admin/test/integration/workarea/api/admin/payments_integration_test.rb +29 -0
- data/admin/test/integration/workarea/api/admin/prices_integration_test.rb +55 -0
- data/admin/test/integration/workarea/api/admin/pricing_skus_integration_test.rb +72 -0
- data/admin/test/integration/workarea/api/admin/product_images_integration_test.rb +56 -0
- data/admin/test/integration/workarea/api/admin/products_integration_test.rb +66 -0
- data/admin/test/integration/workarea/api/admin/promo_code_lists_integration_test.rb +70 -0
- data/admin/test/integration/workarea/api/admin/recommendation_settings_integration_test.rb +41 -0
- data/admin/test/integration/workarea/api/admin/redirects_integration_test.rb +69 -0
- data/admin/test/integration/workarea/api/admin/release_changes_integration_test.rb +32 -0
- data/admin/test/integration/workarea/api/admin/releases_integration_test.rb +60 -0
- data/admin/test/integration/workarea/api/admin/saved_addresses_integration_test.rb +70 -0
- data/admin/test/integration/workarea/api/admin/saved_credit_cards_integration_test.rb +76 -0
- data/admin/test/integration/workarea/api/admin/shipping_rates_integration_test.rb +54 -0
- data/admin/test/integration/workarea/api/admin/shipping_services_integration_test.rb +64 -0
- data/admin/test/integration/workarea/api/admin/shippings_integration_test.rb +34 -0
- data/admin/test/integration/workarea/api/admin/tax_categories_integration_test.rb +64 -0
- data/admin/test/integration/workarea/api/admin/tax_rates_integration_test.rb +66 -0
- data/admin/test/integration/workarea/api/admin/users_integration_test.rb +67 -0
- data/admin/test/integration/workarea/api/admin/variants_integration_test.rb +59 -0
- data/admin/test/models/workarea/api/admin/bulk_upsert_test.rb +79 -0
- data/admin/test/test_helper.rb +10 -0
- data/admin/test/vcr_cassettes/product_image_from_url.yml +43 -0
- data/admin/workarea-api-admin.gemspec +18 -0
- data/app/views/workarea/api/docs/engine_index.haml +1 -0
- data/app/views/workarea/api/docs/example.haml +114 -0
- data/app/views/workarea/api/docs/index.haml +28 -0
- data/app/views/workarea/api/docs/javascripts.haml +31 -0
- data/app/views/workarea/api/docs/javascripts_head.haml +5 -0
- data/app/views/workarea/api/docs/layout.haml +32 -0
- data/app/views/workarea/api/docs/logo.haml +1 -0
- data/app/views/workarea/api/docs/nav.haml +7 -0
- data/app/views/workarea/api/docs/stylesheets.haml +278 -0
- data/config/initializers/raddocs.rb +12 -0
- data/config/initializers/workarea.rb +3 -0
- data/config/routes.rb +5 -0
- data/doc/api/admin/categories/bulk_upserting_categories.json +42 -0
- data/doc/api/admin/categories/creating_a_category.json +46 -0
- data/doc/api/admin/categories/listing_categories.json +58 -0
- data/doc/api/admin/categories/removing_a_category.json +42 -0
- data/doc/api/admin/categories/showing_a_category.json +44 -0
- data/doc/api/admin/categories/updating_a_category.json +42 -0
- data/doc/api/admin/category_product_rules/creating_a_category_product_rule.json +46 -0
- data/doc/api/admin/category_product_rules/listing_category_product_rules.json +44 -0
- data/doc/api/admin/category_product_rules/removing_a_category_product_rule.json +42 -0
- data/doc/api/admin/category_product_rules/updating_a_category_product_rule.json +42 -0
- data/doc/api/admin/content/bulk_upserting_content.json +42 -0
- data/doc/api/admin/content/creating_content.json +46 -0
- data/doc/api/admin/content/listing_content.json +57 -0
- data/doc/api/admin/content/showing_content.json +44 -0
- data/doc/api/admin/content/updating_content.json +42 -0
- data/doc/api/admin/content_assets/bulk_upserting_content_assets.json +42 -0
- data/doc/api/admin/content_assets/creating_a_content_asset.json +46 -0
- data/doc/api/admin/content_assets/listing_content_assets.json +58 -0
- data/doc/api/admin/content_assets/removing_a_content_asset.json +42 -0
- data/doc/api/admin/content_assets/showing_a_content_asset.json +44 -0
- data/doc/api/admin/content_assets/updating_a_content_asset.json +42 -0
- data/doc/api/admin/discounts/creating_a_discount.json +46 -0
- data/doc/api/admin/discounts/listing_discounts.json +58 -0
- data/doc/api/admin/discounts/removing_a_discount.json +42 -0
- data/doc/api/admin/discounts/showing_a_discount.json +44 -0
- data/doc/api/admin/discounts/updating_discounts.json +42 -0
- data/doc/api/admin/email_signups/listing_email_signups.json +58 -0
- data/doc/api/admin/email_signups/showing_an_email_signup.json +44 -0
- data/doc/api/admin/fulfillment/listing_fulfillments.json +55 -0
- data/doc/api/admin/fulfillment/marking_items_as_canceled.json +46 -0
- data/doc/api/admin/fulfillment/marking_items_as_shipped.json +46 -0
- data/doc/api/admin/fulfillment/showing_fulfillment.json +44 -0
- data/doc/api/admin/index.json +1219 -0
- data/doc/api/admin/inventory_skus/bulk_upserting_inventory_skus.json +42 -0
- data/doc/api/admin/inventory_skus/creating_an_inventory_sku.json +46 -0
- data/doc/api/admin/inventory_skus/listing_inventory_skus.json +58 -0
- data/doc/api/admin/inventory_skus/removing_an_inventory_sku.json +42 -0
- data/doc/api/admin/inventory_skus/showing_an_inventory_sku.json +44 -0
- data/doc/api/admin/inventory_skus/updating_an_inventory_sku.json +42 -0
- data/doc/api/admin/navigation_menus/creating_a_menu.json +46 -0
- data/doc/api/admin/navigation_menus/listing_menus.json +58 -0
- data/doc/api/admin/navigation_menus/removing_a_navigation_menu.json +42 -0
- data/doc/api/admin/navigation_menus/showing_a_navigation_menu.json +44 -0
- data/doc/api/admin/navigation_menus/updating_a_navigation_menus.json +42 -0
- data/doc/api/admin/navigation_taxonomy/bulk_upserting_navigation_taxons.json +42 -0
- data/doc/api/admin/navigation_taxonomy/creating_a_taxon.json +46 -0
- data/doc/api/admin/navigation_taxonomy/listing_taxons.json +58 -0
- data/doc/api/admin/navigation_taxonomy/removing_a_navigation_taxon.json +42 -0
- data/doc/api/admin/navigation_taxonomy/showing_a_navigation_taxon.json +44 -0
- data/doc/api/admin/navigation_taxonomy/updating_a_navigation_taxons.json +42 -0
- data/doc/api/admin/orders/listing_orders.json +58 -0
- data/doc/api/admin/orders/showing_an_order.json +44 -0
- data/doc/api/admin/orders/viewing_orders_by_date_range.json +68 -0
- data/doc/api/admin/pages/bulk_upserting_pages.json +42 -0
- data/doc/api/admin/pages/creating_a_page.json +46 -0
- data/doc/api/admin/pages/listing_pages.json +58 -0
- data/doc/api/admin/pages/removing_a_page.json +42 -0
- data/doc/api/admin/pages/showing_a_page.json +44 -0
- data/doc/api/admin/pages/updating_a_page.json +42 -0
- data/doc/api/admin/payment_profiles/bulk_upserting_payment_profiles.json +42 -0
- data/doc/api/admin/payment_profiles/creating_a_payment_profile.json +46 -0
- data/doc/api/admin/payment_profiles/listing_payment_profiles.json +58 -0
- data/doc/api/admin/payment_profiles/removing_a_payment_profile.json +42 -0
- data/doc/api/admin/payment_profiles/showing_a_payment_profile.json +44 -0
- data/doc/api/admin/payment_profiles/updating_a_payment_profiles.json +42 -0
- data/doc/api/admin/payment_transactions/listing_payment_transactions.json +58 -0
- data/doc/api/admin/payment_transactions/showing_a_payment_transaction.json +44 -0
- data/doc/api/admin/payments/listing_payments.json +58 -0
- data/doc/api/admin/payments/showing_an_payment.json +44 -0
- data/doc/api/admin/prices/creating_a_pricing_sku_price.json +46 -0
- data/doc/api/admin/prices/listing_pricing_sku_prices.json +58 -0
- data/doc/api/admin/prices/removing_a_pricing_sku_price.json +42 -0
- data/doc/api/admin/prices/updating_a_pricing_sku_price.json +42 -0
- data/doc/api/admin/pricing_skus/bulk_upserting_pricing_skus.json +42 -0
- data/doc/api/admin/pricing_skus/creating_an_pricing_sku.json +46 -0
- data/doc/api/admin/pricing_skus/listing_pricing_skus.json +58 -0
- data/doc/api/admin/pricing_skus/removing_an_pricing_sku.json +42 -0
- data/doc/api/admin/pricing_skus/showing_an_pricing_sku.json +44 -0
- data/doc/api/admin/pricing_skus/updating_an_pricing_sku.json +42 -0
- data/doc/api/admin/product_images/creating_a_product_image_from_base64.json +46 -0
- data/doc/api/admin/product_images/creating_a_product_image_from_url.json +46 -0
- data/doc/api/admin/product_images/listing_product_images.json +44 -0
- data/doc/api/admin/product_images/removing_a_product_image.json +42 -0
- data/doc/api/admin/product_images/updating_a_product_image.json +42 -0
- data/doc/api/admin/products/bulk_upserting_products.json +42 -0
- data/doc/api/admin/products/creating_a_product.json +46 -0
- data/doc/api/admin/products/listing_products.json +58 -0
- data/doc/api/admin/products/removing_a_product.json +42 -0
- data/doc/api/admin/products/showing_a_product.json +44 -0
- data/doc/api/admin/products/updating_a_product.json +42 -0
- data/doc/api/admin/promo_code_lists/bulk_upserting_promo_code_lists.json +42 -0
- data/doc/api/admin/promo_code_lists/creating_a_promo_code_list.json +46 -0
- data/doc/api/admin/promo_code_lists/listing_promo_code_lists.json +58 -0
- data/doc/api/admin/promo_code_lists/removing_a_promo_code_list.json +42 -0
- data/doc/api/admin/promo_code_lists/showing_a_promo_code_list.json +44 -0
- data/doc/api/admin/promo_code_lists/updating_a_promo_code_list.json +42 -0
- data/doc/api/admin/recommendation_settings/showing_recommendation_settings.json +44 -0
- data/doc/api/admin/recommendation_settings/updating_recommendation_settings.json +42 -0
- data/doc/api/admin/redirects/bulk_upserting_redirects.json +42 -0
- data/doc/api/admin/redirects/creating_a_redirect.json +46 -0
- data/doc/api/admin/redirects/listing_redirects.json +58 -0
- data/doc/api/admin/redirects/removing_a_redirect.json +42 -0
- data/doc/api/admin/redirects/showing_a_redirect.json +44 -0
- data/doc/api/admin/redirects/updating_a_redirects.json +42 -0
- data/doc/api/admin/release_changes/adding_changes_to_a_release.json +43 -0
- data/doc/api/admin/releases/bulk_upserting_releases.json +42 -0
- data/doc/api/admin/releases/creating_a_release.json +46 -0
- data/doc/api/admin/releases/listing_releases.json +58 -0
- data/doc/api/admin/releases/removing_a_release.json +42 -0
- data/doc/api/admin/releases/showing_a_release.json +44 -0
- data/doc/api/admin/releases/updating_a_release.json +42 -0
- data/doc/api/admin/saved_addresses/creating_a_saved_address.json +46 -0
- data/doc/api/admin/saved_addresses/listing_saved_address.json +44 -0
- data/doc/api/admin/saved_addresses/removing_a_saved_address.json +42 -0
- data/doc/api/admin/saved_addresses/updating_a_saved_address.json +42 -0
- data/doc/api/admin/saved_credit_cards/creating_a_saved_credit_card.json +46 -0
- data/doc/api/admin/saved_credit_cards/listing_saved_credit_cards.json +55 -0
- data/doc/api/admin/saved_credit_cards/removing_a_saved_credit_card.json +42 -0
- data/doc/api/admin/saved_credit_cards/updating_a_saved_credit_card.json +42 -0
- data/doc/api/admin/shipping/listing_shipments.json +58 -0
- data/doc/api/admin/shipping/showing_a_shipment.json +44 -0
- data/doc/api/admin/shipping_rates/creating_a_shipping_rate.json +46 -0
- data/doc/api/admin/shipping_rates/listing_shipping_rates.json +44 -0
- data/doc/api/admin/shipping_rates/removing_a_shipping_rate.json +42 -0
- data/doc/api/admin/shipping_rates/updating_a_shipping_rate.json +42 -0
- data/doc/api/admin/shipping_services/bulk_upserting_shipping_services.json +42 -0
- data/doc/api/admin/shipping_services/creating_a_shipping_service.json +46 -0
- data/doc/api/admin/shipping_services/listing_shipping_services.json +58 -0
- data/doc/api/admin/shipping_services/removing_a_shipping_service.json +42 -0
- data/doc/api/admin/shipping_services/showing_a_shipping_service.json +44 -0
- data/doc/api/admin/shipping_services/updating_a_shipping_service.json +42 -0
- data/doc/api/admin/tax_categories/bulk_upserting_tax_categories.json +42 -0
- data/doc/api/admin/tax_categories/creating_a_tax_category.json +46 -0
- data/doc/api/admin/tax_categories/listing_tax_categories.json +55 -0
- data/doc/api/admin/tax_categories/removing_a_tax_category.json +42 -0
- data/doc/api/admin/tax_categories/showing_a_tax_category.json +44 -0
- data/doc/api/admin/tax_categories/updating_a_tax_categories.json +42 -0
- data/doc/api/admin/tax_rates/creating_a_tax_rate.json +46 -0
- data/doc/api/admin/tax_rates/listing_tax_rates.json +44 -0
- data/doc/api/admin/tax_rates/removing_a_tax_rate.json +42 -0
- data/doc/api/admin/tax_rates/updating_a_tax_rate.json +42 -0
- data/doc/api/admin/users/bulk_upserting_users.json +42 -0
- data/doc/api/admin/users/creating_a_user.json +46 -0
- data/doc/api/admin/users/listing_users.json +58 -0
- data/doc/api/admin/users/removing_a_user.json +42 -0
- data/doc/api/admin/users/showing_a_user.json +44 -0
- data/doc/api/admin/users/updating_a_user.json +42 -0
- data/doc/api/admin/variants/creating_a_product_variant.json +46 -0
- data/doc/api/admin/variants/listing_product_variants.json +44 -0
- data/doc/api/admin/variants/removing_a_product_variant.json +42 -0
- data/doc/api/admin/variants/updating_a_product_variant.json +42 -0
- data/doc/api/storefront/accounts/creating_an_account.json +51 -0
- data/doc/api/storefront/accounts/getting_account_details.json +50 -0
- data/doc/api/storefront/accounts/updating_an_account.json +52 -0
- data/doc/api/storefront/analytics/saving_a_category_view.json +39 -0
- data/doc/api/storefront/analytics/saving_a_product_view.json +39 -0
- data/doc/api/storefront/analytics/saving_a_search.json +39 -0
- data/doc/api/storefront/analytics/saving_a_search_abandonment.json +38 -0
- data/doc/api/storefront/analytics/saving_filters.json +38 -0
- data/doc/api/storefront/assets/showing_an_asset.json +50 -0
- data/doc/api/storefront/authentication/creating_an_authentication_token.json +51 -0
- data/doc/api/storefront/authentication/refreshing_an_authentication_token.json +52 -0
- data/doc/api/storefront/authentication/using_an_authentication_token.json +51 -0
- data/doc/api/storefront/cart/adding_a_promo_code.json +52 -0
- data/doc/api/storefront/cart/adding_an_item.json +52 -0
- data/doc/api/storefront/cart/creating_a_new_cart_for_a_user.json +52 -0
- data/doc/api/storefront/cart/creating_a_new_guest_cart.json +51 -0
- data/doc/api/storefront/cart/delete_an_item.json +52 -0
- data/doc/api/storefront/cart/listing_user_s_carts.json +51 -0
- data/doc/api/storefront/cart/showing_cart.json +51 -0
- data/doc/api/storefront/cart/updating_an_item.json +52 -0
- data/doc/api/storefront/categories/showing_a_category.json +64 -0
- data/doc/api/storefront/categories/showing_a_listing_of_categories.json +55 -0
- data/doc/api/storefront/checkout/completing_a_checkout.json +51 -0
- data/doc/api/storefront/checkout/showing_a_checkout.json +50 -0
- data/doc/api/storefront/checkout/updating_a_checkout.json +51 -0
- data/doc/api/storefront/contacts/creating_a_contact.json +51 -0
- data/doc/api/storefront/email_signups/creating_an_email_signup.json +51 -0
- data/doc/api/storefront/email_signups/showing_an_email_signup_content.json +50 -0
- data/doc/api/storefront/index.json +527 -0
- data/doc/api/storefront/menus/listing_menus.json +51 -0
- data/doc/api/storefront/menus/showing_a_menu.json +51 -0
- data/doc/api/storefront/orders/listing_the_user_s_orders.json +51 -0
- data/doc/api/storefront/orders/showing_an_order.json +51 -0
- data/doc/api/storefront/pages/showing_a_page.json +51 -0
- data/doc/api/storefront/password_resets/sending_a_forgot_password_email.json +50 -0
- data/doc/api/storefront/personalized_recommendations/showing_recommendations_with_a_session_id.json +55 -0
- data/doc/api/storefront/personalized_recommendations/showing_recommendations_with_authentication.json +51 -0
- data/doc/api/storefront/products/showing_a_product.json +51 -0
- data/doc/api/storefront/products/showing_a_product_with_a_specific_sku_selected.json +55 -0
- data/doc/api/storefront/recent_views/showing_recent_views_from_authentication.json +51 -0
- data/doc/api/storefront/recent_views/showing_recent_views_with_a_session_id.json +55 -0
- data/doc/api/storefront/recent_views/updating_recent_views_with_a_session_id.json +53 -0
- data/doc/api/storefront/recent_views/updating_recent_views_with_authentication.json +51 -0
- data/doc/api/storefront/saved_addresses/creating_a_saved_address.json +51 -0
- data/doc/api/storefront/saved_addresses/deleting_a_saved_address.json +48 -0
- data/doc/api/storefront/saved_addresses/listing_the_user_s_saved_addresses.json +51 -0
- data/doc/api/storefront/saved_addresses/showing_a_saved_address.json +50 -0
- data/doc/api/storefront/saved_addresses/updating_a_saved_address.json +51 -0
- data/doc/api/storefront/saved_credit_cards/creating_a_saved_credit_card.json +51 -0
- data/doc/api/storefront/saved_credit_cards/deleting_a_saved_credit_card.json +48 -0
- data/doc/api/storefront/saved_credit_cards/listing_the_user_s_saved_credit_cards.json +51 -0
- data/doc/api/storefront/saved_credit_cards/showing_a_saved_credit_card.json +50 -0
- data/doc/api/storefront/saved_credit_cards/updating_a_saved_credit_card.json +51 -0
- data/doc/api/storefront/searches/showing_search_autocomplete_suggestions.json +52 -0
- data/doc/api/storefront/searches/showing_search_results.json +69 -0
- data/doc/api/storefront/system_content/showing_system_content.json +51 -0
- data/doc/api/storefront/system_content/showing_the_home_page.json +51 -0
- data/doc/api/storefront/taxons/showing_a_taxon.json +51 -0
- data/doc/api/storefront/validation_errors/checkout_validation_errors.json +51 -0
- data/doc/api/storefront/validation_errors/general_validation_errors.json +45 -0
- data/lib/workarea/api/curl.rb +86 -0
- data/lib/workarea/api/documentation.rb +61 -0
- data/lib/workarea/api/documentation_test.rb +210 -0
- data/lib/workarea/api/engine.rb +8 -0
- data/lib/workarea/api/version.rb +5 -0
- data/lib/workarea/api.rb +18 -0
- data/storefront/.gitignore +12 -0
- data/storefront/README.md +58 -0
- data/storefront/Rakefile +10 -0
- data/storefront/app/controllers/workarea/api/storefront/accounts_controller.rb +31 -0
- data/storefront/app/controllers/workarea/api/storefront/analytics_controller.rb +41 -0
- data/storefront/app/controllers/workarea/api/storefront/application_controller.rb +65 -0
- data/storefront/app/controllers/workarea/api/storefront/assets_controller.rb +11 -0
- data/storefront/app/controllers/workarea/api/storefront/authentication.rb +30 -0
- data/storefront/app/controllers/workarea/api/storefront/authentication_tokens_controller.rb +50 -0
- data/storefront/app/controllers/workarea/api/storefront/cart_items_controller.rb +100 -0
- data/storefront/app/controllers/workarea/api/storefront/carts_controller.rb +47 -0
- data/storefront/app/controllers/workarea/api/storefront/categories_controller.rb +25 -0
- data/storefront/app/controllers/workarea/api/storefront/checkouts_controller.rb +117 -0
- data/storefront/app/controllers/workarea/api/storefront/contacts_controller.rb +20 -0
- data/storefront/app/controllers/workarea/api/storefront/current_checkout.rb +60 -0
- data/storefront/app/controllers/workarea/api/storefront/email_signups_controller.rb +15 -0
- data/storefront/app/controllers/workarea/api/storefront/menus_controller.rb +19 -0
- data/storefront/app/controllers/workarea/api/storefront/orders_controller.rb +32 -0
- data/storefront/app/controllers/workarea/api/storefront/pages_controller.rb +14 -0
- data/storefront/app/controllers/workarea/api/storefront/password_resets_controller.rb +17 -0
- data/storefront/app/controllers/workarea/api/storefront/products_controller.rb +17 -0
- data/storefront/app/controllers/workarea/api/storefront/recent_views_controller.rb +46 -0
- data/storefront/app/controllers/workarea/api/storefront/recommendations_controller.rb +22 -0
- data/storefront/app/controllers/workarea/api/storefront/saved_addresses_controller.rb +38 -0
- data/storefront/app/controllers/workarea/api/storefront/saved_credit_cards_controller.rb +54 -0
- data/storefront/app/controllers/workarea/api/storefront/searches_controller.rb +29 -0
- data/storefront/app/controllers/workarea/api/storefront/system_content_controller.rb +16 -0
- data/storefront/app/controllers/workarea/api/storefront/taxons_controller.rb +20 -0
- data/storefront/app/controllers/workarea/api/storefront/user_activity.rb +36 -0
- data/storefront/app/controllers/workarea/storefront/application_controller.decorator +12 -0
- data/storefront/app/helpers/workarea/api/storefront/application_helper.rb +15 -0
- data/storefront/app/helpers/workarea/api/storefront/checkouts_helper.rb +11 -0
- data/storefront/app/helpers/workarea/api/storefront/content_blocks_helper.rb +38 -0
- data/storefront/app/models/workarea/catalog/category.decorator +7 -0
- data/storefront/app/models/workarea/user/authentication_token.rb +33 -0
- data/storefront/app/models/workarea/user.decorator +8 -0
- data/storefront/app/view_models/workarea/api/storefront/search_suggestion_view_model.rb +21 -0
- data/storefront/app/views/workarea/api/storefront/accounts/_account.json.jbuilder +7 -0
- data/storefront/app/views/workarea/api/storefront/accounts/create.json.jbuilder +7 -0
- data/storefront/app/views/workarea/api/storefront/accounts/show.json.jbuilder +1 -0
- data/storefront/app/views/workarea/api/storefront/assets/show.json.jbuilder +4 -0
- data/storefront/app/views/workarea/api/storefront/authentication_tokens/_authentication_token.json.jbuilder +2 -0
- data/storefront/app/views/workarea/api/storefront/authentication_tokens/create.json.jbuilder +1 -0
- data/storefront/app/views/workarea/api/storefront/authentication_tokens/update.json.jbuilder +1 -0
- data/storefront/app/views/workarea/api/storefront/cart_items/item.json.jbuilder +9 -0
- data/storefront/app/views/workarea/api/storefront/carts/index.json.jbuilder +4 -0
- data/storefront/app/views/workarea/api/storefront/carts/show.json.jbuilder +1 -0
- data/storefront/app/views/workarea/api/storefront/categories/_category.json.jbuilder +4 -0
- data/storefront/app/views/workarea/api/storefront/categories/index.json.jbuilder +3 -0
- data/storefront/app/views/workarea/api/storefront/categories/show.json.jbuilder +30 -0
- data/storefront/app/views/workarea/api/storefront/checkouts/_shipping_options.json.jbuilder +4 -0
- data/storefront/app/views/workarea/api/storefront/checkouts/show.json.jbuilder +17 -0
- data/storefront/app/views/workarea/api/storefront/checkouts/steps/_addresses.json.jbuilder +19 -0
- data/storefront/app/views/workarea/api/storefront/checkouts/steps/_payment.json.jbuilder +9 -0
- data/storefront/app/views/workarea/api/storefront/checkouts/steps/_shipping.json.jbuilder +9 -0
- data/storefront/app/views/workarea/api/storefront/content_blocks/_block.json.jbuilder +7 -0
- data/storefront/app/views/workarea/api/storefront/email_signups/create.json.jbuilder +2 -0
- data/storefront/app/views/workarea/api/storefront/email_signups/show.json.jbuilder +4 -0
- data/storefront/app/views/workarea/api/storefront/facets/_range.json.jbuilder +8 -0
- data/storefront/app/views/workarea/api/storefront/facets/_terms.json.jbuilder +8 -0
- data/storefront/app/views/workarea/api/storefront/fulfillments/_fulfillment.json.jbuilder +18 -0
- data/storefront/app/views/workarea/api/storefront/menus/_menu.json.jbuilder +11 -0
- data/storefront/app/views/workarea/api/storefront/menus/index.json.jbuilder +3 -0
- data/storefront/app/views/workarea/api/storefront/menus/show.json.jbuilder +1 -0
- data/storefront/app/views/workarea/api/storefront/orders/_item.json.jbuilder +26 -0
- data/storefront/app/views/workarea/api/storefront/orders/_order.json.jbuilder +42 -0
- data/storefront/app/views/workarea/api/storefront/orders/index.json.jbuilder +4 -0
- data/storefront/app/views/workarea/api/storefront/orders/show.json.jbuilder +7 -0
- data/storefront/app/views/workarea/api/storefront/orders/tenders/_credit_card.json.jbuilder +6 -0
- data/storefront/app/views/workarea/api/storefront/orders/tenders/_store_credit.json.jbuilder +2 -0
- data/storefront/app/views/workarea/api/storefront/pages/show.json.jbuilder +16 -0
- data/storefront/app/views/workarea/api/storefront/products/_image_urls.json.jbuilder +5 -0
- data/storefront/app/views/workarea/api/storefront/products/_product.json.jbuilder +41 -0
- data/storefront/app/views/workarea/api/storefront/products/show.json.jbuilder +9 -0
- data/storefront/app/views/workarea/api/storefront/recent_views/show.json.jbuilder +8 -0
- data/storefront/app/views/workarea/api/storefront/recommendations/show.json.jbuilder +3 -0
- data/storefront/app/views/workarea/api/storefront/saved_addresses/_saved_address.json.jbuilder +2 -0
- data/storefront/app/views/workarea/api/storefront/saved_addresses/index.json.jbuilder +4 -0
- data/storefront/app/views/workarea/api/storefront/saved_addresses/show.json.jbuilder +2 -0
- data/storefront/app/views/workarea/api/storefront/saved_credit_cards/_card.json.jbuilder +9 -0
- data/storefront/app/views/workarea/api/storefront/saved_credit_cards/index.json.jbuilder +4 -0
- data/storefront/app/views/workarea/api/storefront/saved_credit_cards/show.json.jbuilder +2 -0
- data/storefront/app/views/workarea/api/storefront/searches/index.json.jbuilder +1 -0
- data/storefront/app/views/workarea/api/storefront/searches/show.json.jbuilder +19 -0
- data/storefront/app/views/workarea/api/storefront/shared/_address.json.jbuilder +12 -0
- data/storefront/app/views/workarea/api/storefront/shared/_pagination.json.jbuilder +11 -0
- data/storefront/app/views/workarea/api/storefront/system_content/show.json.jbuilder +12 -0
- data/storefront/app/views/workarea/api/storefront/taxons/_taxon.json.jbuilder +10 -0
- data/storefront/app/views/workarea/api/storefront/taxons/show.json.jbuilder +7 -0
- data/storefront/app/workers/workarea/remove_authentication_tokens_on_password_changes.rb +19 -0
- data/storefront/bin/rails +18 -0
- data/storefront/config/initializers/config.rb +2 -0
- data/storefront/config/locales/en.yml +13 -0
- data/storefront/config/routes.rb +41 -0
- data/storefront/lib/workarea/api/storefront/engine.rb +10 -0
- data/storefront/lib/workarea/api/storefront.rb +15 -0
- data/storefront/test/documentation/workarea/api/storefront/accounts_documentation_test.rb +70 -0
- data/storefront/test/documentation/workarea/api/storefront/analytics_documentation_test.rb +51 -0
- data/storefront/test/documentation/workarea/api/storefront/assets_documentation_test.rb +32 -0
- data/storefront/test/documentation/workarea/api/storefront/authentication_documentation_test.rb +84 -0
- data/storefront/test/documentation/workarea/api/storefront/cart_items_documentation_test.rb +104 -0
- data/storefront/test/documentation/workarea/api/storefront/carts_documentation_test.rb +121 -0
- data/storefront/test/documentation/workarea/api/storefront/categories_documentation_test.rb +90 -0
- data/storefront/test/documentation/workarea/api/storefront/checkouts_documentation_test.rb +142 -0
- data/storefront/test/documentation/workarea/api/storefront/contacts_documentation_test.rb +39 -0
- data/storefront/test/documentation/workarea/api/storefront/email_signups_documentation_test.rb +53 -0
- data/storefront/test/documentation/workarea/api/storefront/menus_documentation_test.rb +67 -0
- data/storefront/test/documentation/workarea/api/storefront/orders_documentation_test.rb +127 -0
- data/storefront/test/documentation/workarea/api/storefront/pages_documentation_test.rb +66 -0
- data/storefront/test/documentation/workarea/api/storefront/password_resets_documentation_test.rb +30 -0
- data/storefront/test/documentation/workarea/api/storefront/products_documentation_test.rb +64 -0
- data/storefront/test/documentation/workarea/api/storefront/recent_views_documentation_test.rb +116 -0
- data/storefront/test/documentation/workarea/api/storefront/recommendations_documentation_test.rb +68 -0
- data/storefront/test/documentation/workarea/api/storefront/saved_addresses_documentation_test.rb +129 -0
- data/storefront/test/documentation/workarea/api/storefront/saved_credit_cards_documentation_test.rb +129 -0
- data/storefront/test/documentation/workarea/api/storefront/searches_documentation_test.rb +88 -0
- data/storefront/test/documentation/workarea/api/storefront/system_content_documentation_test.rb +66 -0
- data/storefront/test/documentation/workarea/api/storefront/taxons_documentation_test.rb +37 -0
- data/storefront/test/documentation/workarea/api/storefront/validation_documentation_test.rb +81 -0
- data/storefront/test/dummy/Rakefile +7 -0
- data/storefront/test/dummy/app/assets/config/manifest.js +4 -0
- data/storefront/test/dummy/app/assets/images/.keep +0 -0
- data/storefront/test/dummy/app/assets/javascripts/application.js +13 -0
- data/storefront/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/storefront/test/dummy/app/controllers/application_controller.rb +3 -0
- data/storefront/test/dummy/app/controllers/concerns/.keep +0 -0
- data/storefront/test/dummy/app/helpers/application_helper.rb +2 -0
- data/storefront/test/dummy/app/jobs/application_job.rb +2 -0
- data/storefront/test/dummy/app/mailers/.keep +0 -0
- data/storefront/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/storefront/test/dummy/app/models/.keep +0 -0
- data/storefront/test/dummy/app/models/concerns/.keep +0 -0
- data/storefront/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/storefront/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/storefront/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/storefront/test/dummy/bin/bundle +3 -0
- data/storefront/test/dummy/bin/rails +4 -0
- data/storefront/test/dummy/bin/rake +4 -0
- data/storefront/test/dummy/bin/setup +34 -0
- data/storefront/test/dummy/bin/update +29 -0
- data/storefront/test/dummy/config/application.rb +25 -0
- data/storefront/test/dummy/config/boot.rb +5 -0
- data/storefront/test/dummy/config/cable.yml +9 -0
- data/storefront/test/dummy/config/environment.rb +5 -0
- data/storefront/test/dummy/config/environments/development.rb +55 -0
- data/storefront/test/dummy/config/environments/production.rb +86 -0
- data/storefront/test/dummy/config/environments/test.rb +43 -0
- data/storefront/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/storefront/test/dummy/config/initializers/assets.rb +11 -0
- data/storefront/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/storefront/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/storefront/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/storefront/test/dummy/config/initializers/inflections.rb +16 -0
- data/storefront/test/dummy/config/initializers/mime_types.rb +4 -0
- data/storefront/test/dummy/config/initializers/new_framework_defaults.rb +21 -0
- data/storefront/test/dummy/config/initializers/session_store.rb +3 -0
- data/storefront/test/dummy/config/initializers/workarea.rb +8 -0
- data/storefront/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/storefront/test/dummy/config/locales/en.yml +23 -0
- data/storefront/test/dummy/config/puma.rb +47 -0
- data/storefront/test/dummy/config/routes.rb +6 -0
- data/storefront/test/dummy/config/secrets.yml +22 -0
- data/storefront/test/dummy/config/spring.rb +6 -0
- data/storefront/test/dummy/config.ru +4 -0
- data/storefront/test/dummy/db/seeds.rb +2 -0
- data/storefront/test/dummy/log/.keep +0 -0
- data/storefront/test/dummy/public/404.html +67 -0
- data/storefront/test/dummy/public/422.html +67 -0
- data/storefront/test/dummy/public/500.html +66 -0
- data/storefront/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/storefront/test/dummy/public/apple-touch-icon.png +0 -0
- data/storefront/test/dummy/public/favicon.ico +1 -0
- data/storefront/test/integration/workarea/api/storefront/accounts_integration_test.rb +49 -0
- data/storefront/test/integration/workarea/api/storefront/analytics_integration_test.rb +36 -0
- data/storefront/test/integration/workarea/api/storefront/assets_integration_test.rb +24 -0
- data/storefront/test/integration/workarea/api/storefront/authentication_integration_test.rb +50 -0
- data/storefront/test/integration/workarea/api/storefront/authentication_tokens_integration_test.rb +87 -0
- data/storefront/test/integration/workarea/api/storefront/cart_items_integration_test.rb +149 -0
- data/storefront/test/integration/workarea/api/storefront/carts_integration_test.rb +114 -0
- data/storefront/test/integration/workarea/api/storefront/categories_integration_test.rb +84 -0
- data/storefront/test/integration/workarea/api/storefront/checkouts_integration_test.rb +203 -0
- data/storefront/test/integration/workarea/api/storefront/contacts_integration_test.rb +28 -0
- data/storefront/test/integration/workarea/api/storefront/email_signups_integration_test.rb +35 -0
- data/storefront/test/integration/workarea/api/storefront/menus_integration_test.rb +53 -0
- data/storefront/test/integration/workarea/api/storefront/orders_integration_test.rb +115 -0
- data/storefront/test/integration/workarea/api/storefront/pages_integration_test.rb +57 -0
- data/storefront/test/integration/workarea/api/storefront/password_resets_integration_test.rb +20 -0
- data/storefront/test/integration/workarea/api/storefront/products_integration_test.rb +50 -0
- data/storefront/test/integration/workarea/api/storefront/recent_views_integration_test.rb +118 -0
- data/storefront/test/integration/workarea/api/storefront/recommendations_integration_test.rb +51 -0
- data/storefront/test/integration/workarea/api/storefront/saved_addresses_integration_test.rb +100 -0
- data/storefront/test/integration/workarea/api/storefront/saved_credit_cards_integration_test.rb +107 -0
- data/storefront/test/integration/workarea/api/storefront/searches_integration_test.rb +128 -0
- data/storefront/test/integration/workarea/api/storefront/system_content_integration_test.rb +35 -0
- data/storefront/test/integration/workarea/api/storefront/taxons_integration_test.rb +44 -0
- data/storefront/test/integration/workarea/api/storefront/user_carts_integration_test.rb +55 -0
- data/storefront/test/models/workarea/user/authentication_token_test.rb +30 -0
- data/storefront/test/support/authentication_test.rb +25 -0
- data/storefront/test/support/orders_test.rb +18 -0
- data/storefront/test/test_helper.rb +10 -0
- data/storefront/workarea-api-storefront.gemspec +18 -0
- data/workarea-api.gemspec +25 -0
- metadata +741 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
module Workarea
|
2
|
+
module Api
|
3
|
+
class Documentation < Raddocs::App
|
4
|
+
set :views, Workarea::Api.root.join(
|
5
|
+
'app',
|
6
|
+
'views',
|
7
|
+
'workarea',
|
8
|
+
'api',
|
9
|
+
'docs'
|
10
|
+
)
|
11
|
+
|
12
|
+
helpers do
|
13
|
+
def index_path
|
14
|
+
if request.path_info.starts_with?('/admin')
|
15
|
+
'/admin'
|
16
|
+
elsif request.path_info.starts_with?('/storefront')
|
17
|
+
'/storefront'
|
18
|
+
else
|
19
|
+
'/'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def markdown
|
24
|
+
Redcarpet::Markdown.new(
|
25
|
+
Redcarpet::Render::HTML,
|
26
|
+
autolink: true,
|
27
|
+
fenced_code_blocks: true,
|
28
|
+
no_intra_emphasis: true
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
get '/' do
|
34
|
+
content = File.read("#{Workarea::Api::Engine.root}/README.md")
|
35
|
+
haml :index, layout: false, locals: { content: content }
|
36
|
+
end
|
37
|
+
|
38
|
+
get '/admin' do
|
39
|
+
index = Raddocs::Index.new(File.join(docs_dir, 'admin', 'index.json'))
|
40
|
+
content = File.read("#{Workarea::Api::Admin::Engine.root}/README.md")
|
41
|
+
haml :engine_index, locals: { index: index, content: content }
|
42
|
+
end
|
43
|
+
|
44
|
+
get '/storefront' do
|
45
|
+
index = Raddocs::Index.new(File.join(docs_dir, 'storefront', 'index.json'))
|
46
|
+
content = File.read("#{Workarea::Api::Storefront::Engine.root}/README.md")
|
47
|
+
haml :engine_index, locals: { index: index, content: content }
|
48
|
+
end
|
49
|
+
|
50
|
+
get '/*' do
|
51
|
+
file = File.join(docs_dir, "#{params[:splat][0]}.json")
|
52
|
+
raise Sinatra::NotFound unless File.exists?(file)
|
53
|
+
|
54
|
+
index = Raddocs::Index.new(File.join(docs_dir, index_path, 'index.json'))
|
55
|
+
example = Raddocs::Example.new(file)
|
56
|
+
|
57
|
+
haml :example, locals: { index: index, example: example }
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,210 @@
|
|
1
|
+
require 'workarea/api/curl'
|
2
|
+
|
3
|
+
if ENV['GENERATE_API_DOCS']
|
4
|
+
MiniTest.after_run do
|
5
|
+
Workarea::Api::DocumentationTest.build_index('admin')
|
6
|
+
Workarea::Api::DocumentationTest.build_index('storefront')
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
module Workarea
|
11
|
+
module Api
|
12
|
+
class DocumentationTest < Workarea::IntegrationTest
|
13
|
+
IGNORED_HEADERS = %w(Host Accept)
|
14
|
+
|
15
|
+
class Example
|
16
|
+
attr_accessor :resource, :http_method, :route, :description,
|
17
|
+
:explanation, :parameters, :response_fields, :requests
|
18
|
+
|
19
|
+
def initialize
|
20
|
+
@parameters = []
|
21
|
+
@response_fields = []
|
22
|
+
@requests = []
|
23
|
+
end
|
24
|
+
|
25
|
+
def file_name
|
26
|
+
name = @description.presence || "#{@http_method} #{@route}"
|
27
|
+
"#{name.systemize}.json"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class Request
|
32
|
+
attr_accessor :request_method, :request_path, :request_body,
|
33
|
+
:request_headers, :request_query_parameters,
|
34
|
+
:request_content_type, :response_status,
|
35
|
+
:response_status_text, :response_body,
|
36
|
+
:response_headers, :response_content_type, :curl
|
37
|
+
|
38
|
+
def initialize
|
39
|
+
@request_headers = {}
|
40
|
+
@request_query_parameters = {}
|
41
|
+
@response_headers = {}
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class << self
|
46
|
+
def resource(val = nil)
|
47
|
+
@resource = val || @resource
|
48
|
+
end
|
49
|
+
|
50
|
+
def docs_root
|
51
|
+
@docs_root ||= if running_in_gem?
|
52
|
+
Workarea::Api.root.join('doc', 'api')
|
53
|
+
else
|
54
|
+
Rails.root.join('doc', 'api')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def running_in_gem?
|
59
|
+
Rails.root.to_s.include?('test/dummy')
|
60
|
+
end
|
61
|
+
|
62
|
+
def docs_dir
|
63
|
+
docs_root.join(engine, resource.systemize)
|
64
|
+
end
|
65
|
+
|
66
|
+
def engine
|
67
|
+
name.split('::')[-2].downcase
|
68
|
+
end
|
69
|
+
|
70
|
+
def build_index(engine)
|
71
|
+
results = { 'resources' => [] }
|
72
|
+
root = docs_root.join(engine)
|
73
|
+
|
74
|
+
FileUtils.mkdir_p(root)
|
75
|
+
begin
|
76
|
+
FileUtils.rm(root.join('index.json'))
|
77
|
+
rescue
|
78
|
+
nil
|
79
|
+
end
|
80
|
+
|
81
|
+
Dir.glob(root.join('**/*.json')) do |file|
|
82
|
+
example = JSON.parse(File.read(file))
|
83
|
+
|
84
|
+
existing_resource = results['resources'].detect do |resource|
|
85
|
+
resource['name'] == example['resource']
|
86
|
+
end
|
87
|
+
|
88
|
+
index_example = {
|
89
|
+
'description' => example['description'],
|
90
|
+
'link' => file.to_s.gsub("#{docs_root}/", ''),
|
91
|
+
'groups' => 'all',
|
92
|
+
'route' => example['route'],
|
93
|
+
'method' => example['http_method']
|
94
|
+
}
|
95
|
+
|
96
|
+
if existing_resource.present?
|
97
|
+
existing_resource['examples'] << index_example
|
98
|
+
else
|
99
|
+
results['resources'] << {
|
100
|
+
'name' => example['resource'],
|
101
|
+
'examples' => [index_example]
|
102
|
+
}
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
File.open(root.join('index.json'), 'w') do |file|
|
107
|
+
file.write(JSON.pretty_generate(results))
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
setup :setup_example
|
113
|
+
teardown :save_example
|
114
|
+
|
115
|
+
def parameter(name, description)
|
116
|
+
@example.parameters << { name: name, description: description }
|
117
|
+
end
|
118
|
+
|
119
|
+
def method_missing(method_name, *args, &block)
|
120
|
+
if @example.respond_to?("#{method_name}=")
|
121
|
+
@example.send("#{method_name}=", *args)
|
122
|
+
else
|
123
|
+
super
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
def respond_to?(method_name, include_private = false)
|
128
|
+
@example.respond_to?("#{method_name}=") || super
|
129
|
+
end
|
130
|
+
|
131
|
+
def record_request
|
132
|
+
yield
|
133
|
+
|
134
|
+
@example.http_method = request.method.upcase if @example.http_method.blank?
|
135
|
+
headers = env_to_headers(request.env)
|
136
|
+
request_body = read_request_body
|
137
|
+
|
138
|
+
doc_request = Request.new
|
139
|
+
doc_request.request_method = request.method
|
140
|
+
doc_request.request_path = request.fullpath
|
141
|
+
doc_request.request_body = request_body.empty? ? nil : request_body.force_encoding('UTF-8')
|
142
|
+
doc_request.request_headers = headers
|
143
|
+
doc_request.request_query_parameters = request.query_parameters
|
144
|
+
doc_request.request_content_type = headers['Content-Type']
|
145
|
+
doc_request.response_status = response.status
|
146
|
+
doc_request.response_status_text = response.message
|
147
|
+
doc_request.response_body = formatted_response_body
|
148
|
+
doc_request.response_headers = filtered_response_headers
|
149
|
+
doc_request.response_content_type = response.content_type
|
150
|
+
|
151
|
+
curl = Curl.new(request.method, request.fullpath, request_body, headers)
|
152
|
+
doc_request.curl = curl.output("https://#{Workarea.config.host}")
|
153
|
+
|
154
|
+
@example.requests << doc_request
|
155
|
+
end
|
156
|
+
|
157
|
+
private
|
158
|
+
|
159
|
+
def setup_example
|
160
|
+
@example = Example.new
|
161
|
+
@example.resource = self.class.resource
|
162
|
+
end
|
163
|
+
|
164
|
+
def save_example
|
165
|
+
if passed? && ENV['GENERATE_API_DOCS']
|
166
|
+
FileUtils.mkdir_p(self.class.docs_dir)
|
167
|
+
File.open(self.class.docs_dir.join(@example.file_name), 'w') do |file|
|
168
|
+
file.write(JSON.pretty_generate(JSON.parse(@example.to_json)))
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
def read_request_body
|
174
|
+
input = request.env['rack.input']
|
175
|
+
input.rewind
|
176
|
+
input.read
|
177
|
+
end
|
178
|
+
|
179
|
+
def formatted_response_body
|
180
|
+
return nil if response.body.empty?
|
181
|
+
|
182
|
+
if response.body.encoding == Encoding::ASCII_8BIT
|
183
|
+
'[binary data]'
|
184
|
+
elsif response.content_type =~ %r{application/json}
|
185
|
+
JSON.pretty_generate(JSON.parse(response.body))
|
186
|
+
else
|
187
|
+
response.body
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
def filtered_response_headers
|
192
|
+
response.headers.except(*Workarea.config.suppress_api_response_headers)
|
193
|
+
end
|
194
|
+
|
195
|
+
def env_to_headers(env)
|
196
|
+
headers = {}
|
197
|
+
env.each do |key, value|
|
198
|
+
if key =~ /^(HTTP_|CONTENT_TYPE)/
|
199
|
+
header = key.gsub(/^HTTP_/, '').split('_').map { |s| s.titleize }.join('-')
|
200
|
+
|
201
|
+
if value.present? && !IGNORED_HEADERS.include?(header)
|
202
|
+
headers[header] = value
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
headers
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
data/lib/workarea/api.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'responders'
|
2
|
+
require 'raddocs'
|
3
|
+
|
4
|
+
require 'workarea'
|
5
|
+
require 'workarea/storefront'
|
6
|
+
require 'workarea/admin'
|
7
|
+
|
8
|
+
module Workarea
|
9
|
+
module Api
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'workarea/api/engine'
|
14
|
+
require 'workarea/api/version'
|
15
|
+
|
16
|
+
require 'workarea/api/admin'
|
17
|
+
require 'workarea/api/storefront'
|
18
|
+
require 'workarea/api/documentation'
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Workarea Storefront API
|
2
|
+
|
3
|
+
Part of the [Workarea API][], the Storefront API provides programmatic
|
4
|
+
access to operations and resources to alternative user interfaces to
|
5
|
+
your Workarea application, like on-premises kiosks, mobile applications,
|
6
|
+
and client-side storefront implementations.
|
7
|
+
|
8
|
+
## Getting Started
|
9
|
+
|
10
|
+
To use this plugin, install the **workarea-api** gem.
|
11
|
+
|
12
|
+
For more information on the API as a whole, and to learn how to set up
|
13
|
+
the API plugin, consult the [main README][Workarea API].
|
14
|
+
|
15
|
+
## Authenticating
|
16
|
+
|
17
|
+
The Storefront API requires the use of a temporary authentication token,
|
18
|
+
analogous to the user ID in the session, which tells the backend of
|
19
|
+
Workarea whether a User is authenticated. It uses the
|
20
|
+
`Workarea::UrlToken` mixin from core to generate this token.
|
21
|
+
|
22
|
+
To obtain an authentication token, make a POST request like so:
|
23
|
+
|
24
|
+
```bash
|
25
|
+
curl \
|
26
|
+
--request POST \
|
27
|
+
--data '{ "email": "your@email.address", "password": "Password1!" }' \
|
28
|
+
"http://yourincredibleheadlesscommercesolution.biz/api/authentication_tokens.json"
|
29
|
+
```
|
30
|
+
|
31
|
+
You should get a response that looks like this:
|
32
|
+
|
33
|
+
```json
|
34
|
+
{
|
35
|
+
"token": "tL6Scp6ubsufq76FZHLbhLWs",
|
36
|
+
"expires_at": "2018-12-25T11:58:43.674-05:00"
|
37
|
+
}
|
38
|
+
```
|
39
|
+
|
40
|
+
Use the `token` in this response to make further authenticated requests
|
41
|
+
to the API:
|
42
|
+
|
43
|
+
|
44
|
+
```bash
|
45
|
+
curl \
|
46
|
+
--request GET \
|
47
|
+
--header 'Authorization: Token token="tL6Scp6ubsufq76FZHLbhLWs"' \
|
48
|
+
"http://yourincredibleheadlesscommercesolution.biz/api/carts.json"
|
49
|
+
```
|
50
|
+
|
51
|
+
## Copyright & Licensing
|
52
|
+
|
53
|
+
Copyright Workarea 2017-2019. All rights reserved.
|
54
|
+
|
55
|
+
For licensing, contact [sales@workarea.com][].
|
56
|
+
|
57
|
+
[Workarea API]: https://homebase.weblinc.com/plugins/workarea-api-admin
|
58
|
+
[sales@workarea.com]: mailto:sales@workarea.com
|
data/storefront/Rakefile
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
|
8
|
+
# Load the dummy app's rake tasks
|
9
|
+
APP_RAKEFILE = File.expand_path('../test/dummy/Rakefile', __FILE__)
|
10
|
+
load 'rails/tasks/engine.rake'
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Workarea
|
2
|
+
module Api
|
3
|
+
module Storefront
|
4
|
+
class AccountsController < Api::Storefront::ApplicationController
|
5
|
+
def show
|
6
|
+
end
|
7
|
+
|
8
|
+
def create
|
9
|
+
@user = User.create!(user_params)
|
10
|
+
|
11
|
+
Workarea::Storefront::AccountMailer
|
12
|
+
.creation(@user.id.to_s)
|
13
|
+
.deliver_later
|
14
|
+
|
15
|
+
@authentication_token = @user.authentication_tokens.create!
|
16
|
+
end
|
17
|
+
|
18
|
+
def update
|
19
|
+
current_user.update_attributes!(user_params)
|
20
|
+
render :show
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def user_params
|
26
|
+
params.permit(:email, :password, :first_name, :last_name)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Workarea
|
2
|
+
module Api
|
3
|
+
module Storefront
|
4
|
+
class AnalyticsController < ActionController::Metal
|
5
|
+
include ActionController::Head
|
6
|
+
include ActionController::Instrumentation
|
7
|
+
|
8
|
+
def category_view
|
9
|
+
Metrics::CategoryByDay.inc(key: { category_id: params[:category_id] }, views: 1)
|
10
|
+
head :ok
|
11
|
+
end
|
12
|
+
|
13
|
+
def product_view
|
14
|
+
Metrics::ProductByDay.inc(key: { product_id: params[:product_id] }, views: 1)
|
15
|
+
head :ok
|
16
|
+
end
|
17
|
+
|
18
|
+
def search
|
19
|
+
Metrics::SearchByDay.save_search(params[:q], params[:total_results])
|
20
|
+
head :ok
|
21
|
+
end
|
22
|
+
|
23
|
+
def search_abandonment
|
24
|
+
warn <<~eos
|
25
|
+
DEPRECATION WARNING: Search abandonment tracking is deprecated and will be removed \
|
26
|
+
in Workarea 3.5.
|
27
|
+
eos
|
28
|
+
head :ok
|
29
|
+
end
|
30
|
+
|
31
|
+
def filters
|
32
|
+
warn <<~eos
|
33
|
+
DEPRECATION WARNING: Filter analytics tracking is deprecated and will be removed \
|
34
|
+
in Workarea 3.5.
|
35
|
+
eos
|
36
|
+
head :ok
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
module Workarea
|
2
|
+
module Api
|
3
|
+
module Storefront
|
4
|
+
class ApplicationController < Workarea::ApplicationController
|
5
|
+
include Workarea::Storefront::HttpCaching
|
6
|
+
include Api::Storefront::Authentication
|
7
|
+
include Api::Storefront::UserActivity
|
8
|
+
|
9
|
+
respond_to :json
|
10
|
+
|
11
|
+
before_action :set_json_format
|
12
|
+
before_action :skip_session
|
13
|
+
before_action { params.permit! }
|
14
|
+
after_action :disable_cors_protection
|
15
|
+
|
16
|
+
rescue_from Mongoid::Errors::DocumentNotFound, with: :handle_not_found
|
17
|
+
rescue_from Mongoid::Errors::Validations, with: :handle_invalid
|
18
|
+
rescue_from Mongoid::Errors::UnknownAttribute, with: :handle_unknown_attribute
|
19
|
+
rescue_from Authentication::InvalidError, with: :handle_invalid_auth
|
20
|
+
|
21
|
+
helper :all
|
22
|
+
|
23
|
+
def cache_page
|
24
|
+
expires_in Workarea.config.page_cache_ttl, public: true
|
25
|
+
end
|
26
|
+
|
27
|
+
def skip_session
|
28
|
+
request.session_options[:skip] = true
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def set_json_format
|
34
|
+
request.format = :json
|
35
|
+
end
|
36
|
+
|
37
|
+
def handle_not_found(e)
|
38
|
+
payload = { params: e.params, problem: e.problem }
|
39
|
+
render json: payload, status: :not_found
|
40
|
+
end
|
41
|
+
|
42
|
+
def handle_invalid(e)
|
43
|
+
render(
|
44
|
+
json: { problems: e.document.errors.full_messages },
|
45
|
+
status: :unprocessable_entity
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
def handle_unknown_attribute(e)
|
50
|
+
render json: e.as_json.slice('problem'), status: :unprocessable_entity
|
51
|
+
end
|
52
|
+
|
53
|
+
def handle_invalid_auth
|
54
|
+
request_http_token_authentication
|
55
|
+
end
|
56
|
+
|
57
|
+
def disable_cors_protection
|
58
|
+
headers['Access-Control-Allow-Origin'] = '*'
|
59
|
+
headers['Access-Control-Allow-Headers'] = '*'
|
60
|
+
headers['Access-Control-Allow-Methods'] = 'GET, POST, PATCH, PUT, DELETE, OPTIONS'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Workarea
|
2
|
+
module Api
|
3
|
+
module Storefront
|
4
|
+
module Authentication
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
class InvalidError < RuntimeError; end
|
8
|
+
|
9
|
+
included do
|
10
|
+
helper_method :current_user
|
11
|
+
end
|
12
|
+
|
13
|
+
def current_user
|
14
|
+
return @current_user if defined?(@current_user)
|
15
|
+
|
16
|
+
user = authenticate_with_http_token do |token, options|
|
17
|
+
User::AuthenticationToken.authenticate(token, options).try(:user)
|
18
|
+
end
|
19
|
+
|
20
|
+
@current_user = user || raise(InvalidError)
|
21
|
+
end
|
22
|
+
|
23
|
+
def authentication?
|
24
|
+
regex = ActionController::HttpAuthentication::Token::TOKEN_REGEX
|
25
|
+
request.authorization.to_s[regex].present?
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Workarea
|
2
|
+
module Api
|
3
|
+
module Storefront
|
4
|
+
class AuthenticationTokensController < Api::Storefront::ApplicationController
|
5
|
+
before_action :ensure_not_locked, only: :create
|
6
|
+
|
7
|
+
def create
|
8
|
+
user = User.find_for_login(params[:email], params[:password])
|
9
|
+
|
10
|
+
if user.blank?
|
11
|
+
render(
|
12
|
+
json: { problem: t('workarea.api.storefront.authentication_tokens.error') },
|
13
|
+
status: :unprocessable_entity
|
14
|
+
)
|
15
|
+
else
|
16
|
+
@authentication_token = User::AuthenticationToken.create!(user: user)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def update
|
21
|
+
@authentication_token = authenticate_with_http_token do |token, options|
|
22
|
+
User::AuthenticationToken.refresh!(token, options)
|
23
|
+
end
|
24
|
+
|
25
|
+
if @authentication_token.blank?
|
26
|
+
render(
|
27
|
+
json: { problem: t('workarea.api.storefront.authentication_tokens.error') },
|
28
|
+
status: :unprocessable_entity
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def ensure_not_locked
|
36
|
+
if User.login_locked?(params[:email])
|
37
|
+
render(
|
38
|
+
json: {
|
39
|
+
problem: t('workarea.api.storefront.authentication_tokens.login_locked')
|
40
|
+
},
|
41
|
+
status: :unprocessable_entity
|
42
|
+
)
|
43
|
+
|
44
|
+
return false
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|