1.8.29 • Published 5 years ago

barong_sdk v1.8.29

Weekly downloads
2
License
Unlicense
Repository
github
Last release
5 years ago

barong_sdk

BarongSdk - JavaScript client for barong_sdk API for barong OAuth server This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.8.29
  • Package version: 1.8.29
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen

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 barong_sdk --save
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

Finally, switch to the directory you want to use your barong_sdk from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('barong_sdk') in javascript files from the directory you ran the last command above from.

git

If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/barong_sdk then install it via:

    npm install YOUR_USERNAME/barong_sdk --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, that's to say your javascript file where you actually use this library):

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 BarongSdk = require('barong_sdk');

var defaultClient = BarongSdk.ApiClient.instance;

// Configure API key authorization: BearerToken
var BearerToken = defaultClient.authentications['BearerToken'];
BearerToken.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//BearerToken.apiKeyPrefix['Authorization'] = "Token"

var api = new BarongSdk.AccountsApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.getV1AccountsMe(callback);

Documentation for API Endpoints

All URIs are relative to https://account.oboltrade.com/api

ClassMethodHTTP requestDescription
BarongSdk.AccountsApigetV1AccountsMeGET /v1/accounts/meReturn information about current resource owner
BarongSdk.AccountsApipostV1AccountsPOST /v1/accountsCreates new account(no auth)
BarongSdk.AccountsApipostV1AccountsConfirmPOST /v1/accounts/confirmConfirms an account(no auth)
BarongSdk.AccountsApipostV1AccountsSendConfirmationInstructionsPOST /v1/accounts/send_confirmation_instructionsSend confirmations instructions
BarongSdk.AccountsApipostV1AccountsSendUnlockInstructionsPOST /v1/accounts/send_unlock_instructionsSend unlock instructions
BarongSdk.AccountsApipostV1AccountsUnlockPOST /v1/accounts/unlockUnlocks an account(no auth)
BarongSdk.AccountsApiputV1AccountsPasswordPUT /v1/accounts/passwordChange account password
BarongSdk.ApiKeysApideleteV1ApiKeysUidDELETE /v1/api_keys/{uid}Delete an api key
BarongSdk.ApiKeysApigetV1ApiKeysGET /v1/api_keysList all api keys for current account.
BarongSdk.ApiKeysApigetV1ApiKeysUidGET /v1/api_keys/{uid}Return an api key by uid
BarongSdk.ApiKeysApipatchV1ApiKeysUidPATCH /v1/api_keys/{uid}Updates an api key
BarongSdk.ApiKeysApipostV1ApiKeysPOST /v1/api_keysCreate an api key
BarongSdk.DocumentsApigetV1DocumentsGET /v1/documentsReturn current user documents list
BarongSdk.DocumentsApipostV1DocumentsPOST /v1/documentsUpload a new document for current user
BarongSdk.LabelsApideleteV1LabelsKeyDELETE /v1/labels/{key}Delete a label with 'public' scope.
BarongSdk.LabelsApigetV1LabelsGET /v1/labelsList all labels for current account.
BarongSdk.LabelsApigetV1LabelsKeyGET /v1/labels/{key}Return a label by key.
BarongSdk.LabelsApipatchV1LabelsKeyPATCH /v1/labels/{key}Update a label with 'public' scope.
BarongSdk.LabelsApipostV1LabelsPOST /v1/labelsCreate a label with 'public' scope.
BarongSdk.PhonesApipostV1PhonesPOST /v1/phonesAdd new phone
BarongSdk.PhonesApipostV1PhonesSendCodePOST /v1/phones/send_codeResend activation code
BarongSdk.PhonesApipostV1PhonesVerifyPOST /v1/phones/verifyVerify a phone
BarongSdk.ProfilesApigetV1ProfilesMeGET /v1/profiles/meReturn profile of current resource owner
BarongSdk.ProfilesApipostV1ProfilesPOST /v1/profilesCreate a profile for current_account
BarongSdk.SecurityApipostV1SecurityEnable2faPOST /v1/security/enable_2faEnable 2FA
BarongSdk.SecurityApipostV1SecurityGenerateQrcodePOST /v1/security/generate_qrcodeGenerate qr code for 2FA
BarongSdk.SecurityApipostV1SecurityRenewPOST /v1/security/renewRenews JWT if current JWT is valid
BarongSdk.SecurityApipostV1SecurityResetPasswordPOST /v1/security/reset_passwordSend reset password instructions(no auth)
BarongSdk.SecurityApipostV1SecurityVerifyApiKeyPOST /v1/security/verify_api_keyVerify API key
BarongSdk.SecurityApipostV1SecurityVerifyCodePOST /v1/security/verify_codeVerify 2FA code
BarongSdk.SecurityApiputV1SecurityResetPasswordPUT /v1/security/reset_passwordSets new account password(no auth)
BarongSdk.SessionsApipostV1SessionsPOST /v1/sessionsStart a new session
BarongSdk.SessionsApipostV1SessionsGenerateJwtPOST /v1/sessions/generate_jwtValidates client jwt and generates peatio session jwt

Documentation for Models

Documentation for Authorization

BearerToken

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header
1.8.29

5 years ago