{"id":13879585,"url":"https://github.com/workarea-commerce/workarea-api","last_synced_at":"2025-04-19T18:51:17.795Z","repository":{"id":55992425,"uuid":"203668842","full_name":"workarea-commerce/workarea-api","owner":"workarea-commerce","description":"Adds JSON REST APIs to the Workarea Commerce Platform","archived":false,"fork":false,"pushed_at":"2020-12-02T13:48:32.000Z","size":1094,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-31T13:45:30.273Z","etag":null,"topics":["ecommerce","json-api","rest-api","workarea","workarea-commerce"],"latest_commit_sha":null,"homepage":"https://www.workarea.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/workarea-commerce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-21T21:44:20.000Z","updated_at":"2023-12-13T10:15:47.000Z","dependencies_parsed_at":"2022-08-15T11:00:37.307Z","dependency_job_id":null,"html_url":"https://github.com/workarea-commerce/workarea-api","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fworkarea-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fworkarea-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fworkarea-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fworkarea-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workarea-commerce","download_url":"https://codeload.github.com/workarea-commerce/workarea-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224970208,"owners_count":17400292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecommerce","json-api","rest-api","workarea","workarea-commerce"],"created_at":"2024-08-06T08:02:25.941Z","updated_at":"2024-11-16T20:31:47.141Z","avatar_url":"https://github.com/workarea-commerce.png","language":"Ruby","readme":"# Workarea API\n[![CI Status](https://github.com/workarea-commerce/workarea-api/workflows/CI/badge.svg)](https://github.com/workarea-commerce/workarea-api/actions)\n\n**workarea-api** defines an HTTP API, using JSON as a data format, for\nprogrammatic access to your Workarea application. The Workarea API is\nused for many purposes, such as integration with external services, or\nproviding an alternative user interface to your web store (like an\non-premises kiosk or mobile application). As such, Workarea provides two\nseparate APIs for different purposes:\n\n- The [Admin API][] is only available to admin users with the necessary\n  \"API Access\" permissions, and provides CRUD operations on all data models\n  in the application. It's primarily used for integration with external\n  service providers, such as an OMS or ERP.\n- The [Storefront API][] has a slightly more complex authentication\n  scheme, because it's used by end-users to browse and purchase items on\n  the storefront. This API is suitable for building alternative user\n  interfaces to Workarea\n\n## Getting Started\n\nTo begin using the Workarea API, add the following to your **Gemfile**:\n\n```ruby\n  gem 'workarea-api'\n```\n\nNext, mount the API engines into **config/routes.rb**.\n\nYou can either use a path prefix:\n\n```ruby\nRails.application.routes.draw do\n  # ...all your other absolutely fabulous Workarea routes...\n  mount Workarea::Api::Engine =\u003e '/api', as: :api\n\n# ...except this one. Make sure it's last to correctly handle errors and redirects.\n  mount Workarea::Storefront::Engine =\u003e '/', as: :storefront\nend\n```\n\nOr, a subdomain. To use a subdomain for your API, create a file at\n**app/routing_constraints/api_subdomain_constraint.rb** with the\nfollowing contents:\n\n```ruby\nclass ApiSubdomainConstraint\n  def self.matches?(request)\n    request.subdomain =~ /^api/\n  end\nend\n```\n\nThen, wrap your `mount` statement with a `constraints` block:\n\n```ruby\nconstraints ApiSubdomainConstraint do\n  mount Workarea::Api::Engine =\u003e '/', as: :api\nend\n```\n\nThat will allow clients to access your API at https://api.yourtotallyamazingstore.com\n\nIf you use a routing constraint for your API, be sure to add the\nfollowing to **test/test_helper.rb** in your application to use the\ncorrect domain for API requests:\n\n```ruby\nclass Workarea::IntegrationTest\n  setup do\n    host! host.gsub(/www/, 'api') if self.class.name.include?('Api::')\n  end\nend\n```\n\n## Configuration\n\nThis plugin provides a number of options for configuring its usage...\n\n- **config.api_product_image_jobs_blacklist** configures the Dragonfly\n  processor jobs whose URLs are omitted from image JSON responses in the\n  Storefront API. Default is `:convert`, `:encode`, `:rotate`, `:optim`,\n  `:avatar`, and `:thumb`.\n- **config.authentication_token_expiration** sets how long Storefront API auth\n  tokens last before they are expired. Default is `1.week`\n- **config.max_api_bulk_data_size** configures the max amount of items which\n  may be included in a `Workarea::Api::Admin::BulkUpsert`\n- **config.api_admin_ignore_definitions** prevents certain models from\n  being considered when Swagger JSON is being generated\n\n## Documentation\n\nDocumentation for API endpoints is available wherever the\n`Workarea::Api::Engine` has been mounted, at the relative path `/docs`.\nBy default, this path is `/api/docs`. This documentation is loaded from\nthe gem source by default, but if you customize API endpoints, you'll\nneed to generate customized documentation with the following command:\n\n```bash\nGENERATE_API_DOCS=true bin/rails workarea:test\n```\n\nDocumentation for the API is built using [documentation tests][], which\ndescribe how each controller and action is to be documented. Look in the\naforementioned link to see some examples of documentation built using\nthe documentation tests.\n\nLicense\n--------------------------------------------------------------------------------\nWorkarea Commerce Platform is released under the [Business Software License](https://github.com/workarea-commerce/workarea/blob/master/LICENSE)\n\n[Admin API]: https://github.com/workarea-commerce/workarea-api/tree/master/admin\n[Storefront API]: https://github.com/workarea-commerce/workarea-api/tree/master/storefront\n[documentation tests]: https://github.com/workarea-commerce/workarea-api/blob/master/storefront/test/documentation/workarea/api/storefront/products_documentation_test.rb\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkarea-commerce%2Fworkarea-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkarea-commerce%2Fworkarea-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkarea-commerce%2Fworkarea-api/lists"}