Socket
Socket
Sign inDemoInstall

zinc-client

Package Overview
Dependencies
118
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    zinc-client

Zinc Search engine API documents


Version published
Maintainers
1
Created

Readme

Source

zinc-client

ZincClient - JavaScript client for zinc-client Zinc Search engine API documents https://docs.zincsearch.com This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 0.2.4
  • Package version: 0.2.4
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen For more information, please visit https://www.zincsearch.com

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install zinc-client --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your zinc-client from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build
git

If the library is hosted at a git repository, e.g.https://github.com/zinclabs/client-js then install it via:

    npm install zinclabs/client-js --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var ZincClient = require('zinc-client');

var defaultClient = ZincClient.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

var api = new ZincClient.Default()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.healthz(callback);

Documentation for API Endpoints

All URIs are relative to http://localhost:4080

ClassMethodHTTP requestDescription
ZincClient.DefaulthealthzGET /healthzGet healthz
ZincClient.DefaultversionGET /versionGet version
ZincClient.DocumentbulkPOST /api/_bulkBulk documents
ZincClient.DocumentdeleteDELETE /api/{index}/_doc/{id}Delete document
ZincClient.DocumentesBulkPOST /es/_bulkES bulk documents
ZincClient.DocumentindexPOST /api/{index}/_docCreate or update document
ZincClient.DocumentindexWithIDPUT /api/{index}/_doc/{id}Create or update document with id
ZincClient.DocumentupdatePOST /api/{index}/_update/{id}Update document with id
ZincClient.IndexanalyzePOST /api/_analyzeAnalyze
ZincClient.IndexanalyzeIndexPOST /api/{index}/_analyzeAnalyze
ZincClient.IndexdeleteDELETE /api/index/{index}Delete index
ZincClient.IndexcreatePOST /api/indexCreate index
ZincClient.IndexcreateTemplatePOST /es/_index_templateCreate update index template
ZincClient.IndexdeleteTemplateDELETE /es/_index_template/{name}Delete template
ZincClient.IndexgetMappingGET /api/{index}/_mappingGet index mappings
ZincClient.IndexgetSettingsGET /api/{index}/_settingsGet index settings
ZincClient.IndexgetTemplateGET /es/_index_template/{name}Get index template
ZincClient.IndexlistGET /api/indexList indexes
ZincClient.IndexlistTemplatesGET /es/_index_templateList index teplates
ZincClient.IndexrefreshPOST /api/index/{index}/refreshResfresh index
ZincClient.IndexsetMappingPUT /api/{index}/_mappingSet index mappings
ZincClient.IndexsetSettingsPUT /api/{index}/_settingsSet index Settings
ZincClient.IndexupdateTemplatePUT /es/_index_template/{name}Create update index template
ZincClient.SearchmSearchPOST /es/_msearchSearch V2 MultipleSearch for compatible ES
ZincClient.SearchsearchPOST /es/{index}/_searchSearch V2 DSL for compatible ES
ZincClient.SearchsearchV1POST /api/{index}/_searchSearch V1
ZincClient.UserdeleteDELETE /api/user/{id}Delete user
ZincClient.UsercreatePOST /api/userCreate user
ZincClient.UserlistGET /api/userList user
ZincClient.UserloginPOST /api/loginLogin
ZincClient.UserupdatePUT /api/userUpdate user

Documentation for Models

Documentation for Authorization

basicAuth

  • Type: HTTP basic authentication

FAQs

Last updated on 23 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc