{"id":22052689,"url":"https://github.com/digitalnz/supplejack_client","last_synced_at":"2025-05-11T07:09:49.117Z","repository":{"id":38146486,"uuid":"21263167","full_name":"DigitalNZ/supplejack_client","owner":"DigitalNZ","description":"Library to abstract the interaction with the Supplejack API","archived":false,"fork":false,"pushed_at":"2025-02-20T11:46:21.000Z","size":488,"stargazers_count":5,"open_issues_count":4,"forks_count":4,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-11T07:09:42.964Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DigitalNZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-27T03:48:08.000Z","updated_at":"2025-02-20T11:44:40.000Z","dependencies_parsed_at":"2024-02-26T20:53:00.549Z","dependency_job_id":"96ea2d0d-4fd9-431b-86f9-c3a81a6992d5","html_url":"https://github.com/DigitalNZ/supplejack_client","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalNZ%2Fsupplejack_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalNZ%2Fsupplejack_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalNZ%2Fsupplejack_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalNZ%2Fsupplejack_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DigitalNZ","download_url":"https://codeload.github.com/DigitalNZ/supplejack_client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253528976,"owners_count":21922636,"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":[],"created_at":"2024-11-30T15:13:57.927Z","updated_at":"2025-05-11T07:09:49.091Z","avatar_url":"https://github.com/DigitalNZ.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Supplejack Logo](https://raw.githubusercontent.com/DigitalNZ/supplejack_manager/master/app/assets/images/logo.png)\n\n# Supplejack Client [![Gem Version](https://badge.fury.io/rb/supplejack_client.svg)](https://badge.fury.io/rb/supplejack_client)\n\nThe Supplejack Client is a library to abstract the interaction with the Supplejack API. It connects to the Supplejack API, and allows you to treat models as if they were in a local database.\n\nFor more information on how to configure and use this application refer to the [documentation](http://digitalnz.github.io/supplejack).\n\n## Installation\n\nAdd it to your Gemfile:\n\n```ruby\ngem 'supplejack_client', git: 'git@github.com:DigitalNZ/supplejack_client.git'\n```\n\nRun bundle install:\n\n```ruby\nbundle install\n```\n\nRun the installation generator:\n\n```ruby\nrails g supplejack:install\n```\n\nAn initializer was created at `config/initializers/supplejack_client.rb`\n\nYou should set the variables needed by the Supplejack API:\n- Api Key\n- Api URL\n\nTo start using Supplejack gem you have add the following line to any plain ruby class\n\n```ruby\nclass Item\n  include Supplejack::Record\nend\n```\n\nThen do `Search.new(params)` or `Item.find(id)`\n\n## Configuration\n\nModify the initializer at `config/initializers/supplejack_client.rb`.\n\n```ruby\nSupplejack.configure do |config|\n\n  # ===\u003e Credentials\n  # Use the api_key for your Supplejack user\n  # Please replace XXXX with your own api key\n  config.api_key = \"XXXX\"\n  #\n  # ===\u003e End point\n  # For production use default url which is http://api.youapihost.org\n  config.api_url = \"http://youapihost.org\"\n  #\n  # ===\u003e URL Format\n  # This is the format use for the url's in the application\n  # The default is the item hash which looks like: \"text='dog'\u0026i[content_partner]=NLNZ\u0026i[category]=Images\"\n  config.url_format = :item_hash\n  #\n  # ===\u003e Facets\n  # The is the list of facets that are going to be requested to the api\n  # When you ask for the facets, they are going to be ordered in the\n  # order presented here\n  config.facets = [\n    :name,\n    :description,\n    :age\n  ]\n  #\n  # ===\u003e Facet values sorting\n  # By default facet values are sorted by whatever solr returns.\n  # The sorting options are :index and :count\n  # :index means lexical sorting (Alphabetical)\n  # :count means is ordered by the number of results for each facet value\n  config.facets_sort = nil\n  #\n  # ===\u003e Fields\n  # This is a list of fields/groups that will be requested to the API for every\n  # record. :default will return the default set of fields.\n  #\n  config.fields = [\n    :default\n  ]\n\n  # ===\u003e Number of facet values\n  # This will limit the number of facet values returned for each facet\n  # Be carefull not to make it too high for performance reasons\n  config.facets_per_page = 10\n  #\n  # ===\u003e Per Page\n  # Number of results returned per page\n  config.per_page = 20\n  #\n  # ===\u003e Timeout\n  # By default the request to the API will timeout after 30 seconds\n  config.timeout = 30\n  #\n  # ===\u003e Single value methods\n  # Some of the values returned by the API are actually multiple values\n  # so they are returned as a array. But most of the time we are only intereseted\n  # in one of those values. Here you can define which values would you like to\n  # be converted to a string.\n  config.single_value_methods = [\n    :email\n  ]\n  #\n  # ===\u003e Search attributes\n  # The search object can store any number of attributes which are actually\n  # the filters passed to the search\n  # Here you can define which attributes you want the search to accept.\n  # This is going to allow you to do:\n  #   search = Search.new(text: 'dog', i: {category: 'Images'})\n  #   search.category\n  #\n  config.search_attributes = [\n    :category\n  ]\n  #\n  # ===\u003e Record klass\n  # Name of the main model throught which you interact with the Supplejack API\n  # This is used to initialize objects of this class when the list of\n  # favourites is fetched.\n  #\n  config.record_klass = \"Record\"\n  #\n  # ===\u003e Enable Debugging\n  # Set this flag to true in order to get display errors and the actual SOLR requests \n  # in the logs generated by the API.\n  #\n  config.enable_debugging = true\n  #\n  # ===\u003e Enable Caching\n  # Set this flag to true in order to cache the facet_value response and the search counts\n  #\n  config.enable_caching = true  \nend\n```\n\n## COPYRIGHT AND LICENSING\u2028\u2028\n\n### SUPPLEJACK CODE - GNU GENERAL PUBLIC LICENCE, VERSION 3\u2028\u2028\n\nSupplejack is a tool for aggregating, searching and sharing metadata records. Supplejack Client is a component of Supplejack. The Supplejack Client code is Crown copyright (C) 2014, New Zealand Government. Supplejack was created by DigitalNZ at the National Library of NZ and the Department of Internal Affairs. http://digitalnz.org/supplejack\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses / http://www.gnu.org/licenses/gpl-3.0.txt\u2028\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalnz%2Fsupplejack_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalnz%2Fsupplejack_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalnz%2Fsupplejack_client/lists"}