Skip to content

brand4impact/brand4impact-javascript-sdk

Repository files navigation

brand4impact-javascript-client

Brand4impactJavascriptClient - JavaScript client for brand4impact-javascript-client Este contrato se usara para generar los clientes con todos los servicios necesarios.

!Uso exclusivo interno!


This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 0.0.1
  • Package version: 0.0.1
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen For more information, please visit http://www.brand4impact.com

Installation

npm

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

Then install it via:

npm install brand4impact-javascript-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 brand4impact-javascript-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/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --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 Brand4impactJavascriptClient = require('brand4impact-javascript-client');

var defaultClient = Brand4impactJavascriptClient.ApiClient.instance;
// Configure Bearer access token for authorization: BearerAuthentication
var BearerAuthentication = defaultClient.authentications['BearerAuthentication'];
BearerAuthentication.accessToken = "YOUR ACCESS TOKEN"

var api = new Brand4impactJavascriptClient.AssetApi()
var token = "token_example"; // {String} The unique token for the asset.
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getAsset(token, callback);

Documentation for API Endpoints

All URIs are relative to http://localhost:8080/backend

Class Method HTTP request Description
Brand4impactJavascriptClient.AssetApi getAsset GET /rest/platform/asset/{token} Get a single asset
Brand4impactJavascriptClient.AssetApi getAssets GET /rest/platform/asset Get a set of assets
Brand4impactJavascriptClient.CampaignApi createCampaign POST /rest/platform/campaign Create a new campaign
Brand4impactJavascriptClient.CampaignApi getCampaign GET /rest/platform/campaign/{token} Get a single campaign
Brand4impactJavascriptClient.CampaignApi getCampaigns GET /rest/platform/campaign Get a set of campaigns
Brand4impactJavascriptClient.CampaignApi switchCampaign PUT /rest/platform/campaign/{token}/switch Switch campaign status
Brand4impactJavascriptClient.CampaignApi updateCampaign PUT /rest/platform/campaign/{token} Update a campaign
Brand4impactJavascriptClient.CompanyApi createCompany POST /rest/platform/company Create a new Company
Brand4impactJavascriptClient.CompanyApi getCompany GET /rest/platform/company Get your Company
Brand4impactJavascriptClient.CompanyApi updateCompany PUT /rest/platform/company Update Company data
Brand4impactJavascriptClient.CompanyApi updateCompanyLegal PUT /rest/platform/company/legal Update legal Company info
Brand4impactJavascriptClient.CompanyApi updateCompanyTopic PUT /rest/platform/company/topic Update selected topics for your Company
Brand4impactJavascriptClient.InvoiceApi getInvoice GET /rest/platform/invoice/{token} Get a single invoice
Brand4impactJavascriptClient.InvoiceApi getInvoices GET /rest/platform/invoice Get a set of invoices
Brand4impactJavascriptClient.NgoApi createNgo POST /rest/platform/ngo Create a new NGO
Brand4impactJavascriptClient.NgoApi getNgo GET /rest/platform/ngo Get your NGO
Brand4impactJavascriptClient.NgoApi updateNgo PUT /rest/platform/ngo Update NGO data
Brand4impactJavascriptClient.NgoApi updateNgoBank PUT /rest/platform/ngo/bank Update bank NGO info
Brand4impactJavascriptClient.NgoApi updateNgoLegal PUT /rest/platform/ngo/legal Update legal NGO info
Brand4impactJavascriptClient.NgoApi uploadNgoFiles PUT /rest/platform/ngo/upload Upload NGO files
Brand4impactJavascriptClient.ProjectApi createProject POST /rest/platform/project Create a new project
Brand4impactJavascriptClient.ProjectApi getProject GET /rest/platform/project/{token} Get a single project
Brand4impactJavascriptClient.ProjectApi getProjects GET /rest/platform/project Get a set of projects
Brand4impactJavascriptClient.ProjectApi switchProject PUT /rest/platform/project/{token}/switch Switch project status
Brand4impactJavascriptClient.ProjectApi updateProject PUT /rest/platform/project/{token} Update a project
Brand4impactJavascriptClient.SectorApi getSector GET /rest/platform/sector/{token} Get a single sector
Brand4impactJavascriptClient.SectorApi getSectors GET /rest/platform/sector Get a set of sectors
Brand4impactJavascriptClient.SecurityApi getJWTToken GET /security/jwt get JWT token
Brand4impactJavascriptClient.TopicApi getTopic GET /rest/platform/topic/{token} Get a single topic
Brand4impactJavascriptClient.TopicApi getTopics GET /rest/platform/topic Get a set of topics
Brand4impactJavascriptClient.UserApi changeUserPassword PUT /rest/platform/user/{token}/changepassword Change user's password
Brand4impactJavascriptClient.UserApi confirmUser POST /rest/platform/user/{token} Activate a user
Brand4impactJavascriptClient.UserApi getUser GET /rest/platform/user/{token} Get a single user
Brand4impactJavascriptClient.UserApi getUsers GET /rest/platform/user Get a set of users
Brand4impactJavascriptClient.UserApi inviteUser POST /rest/platform/user/invite Invite a new user
Brand4impactJavascriptClient.UserApi resetUserPassword PUT /rest/platform/user/resetpassword Reset user's password
Brand4impactJavascriptClient.UserApi switchUser PUT /rest/platform/user/{token}/switch Switch user's status
Brand4impactJavascriptClient.UserApi updateUser PUT /rest/platform/user/{token} Update user data
Brand4impactJavascriptClient.UserApi updateUserExt PUT /rest/platform/user/{token}/ext Update sensitive user data
Brand4impactJavascriptClient.UtilsApi getCountries GET /rest/platform/utils/country Get countries
Brand4impactJavascriptClient.UtilsApi getCurrencies GET /rest/platform/utils/currency Get currencies
Brand4impactJavascriptClient.UtilsApi getLanguages GET /rest/platform/utils/language Get languages
Brand4impactJavascriptClient.UtilsApi getRoles GET /rest/platform/utils/roles Get roles
Brand4impactJavascriptClient.UtilsApi getZones GET /rest/platform/utils/zone Get zones
Brand4impactJavascriptClient.VoucherApi downloadVoucherQr GET /rest/platform/voucher/{token}/qr Download the voucher QR image
Brand4impactJavascriptClient.VoucherApi downloadVouchersFile GET /rest/platform/voucher/campaign/{campaignToken}/file Download a set of voucher's links file
Brand4impactJavascriptClient.VoucherApi downloadVouchersQr GET /rest/platform/voucher/campaign/{campaignToken}/qr Download a set of voucher QR images
Brand4impactJavascriptClient.VoucherApi getVoucher GET /rest/platform/voucher/{token} Get a single voucher
Brand4impactJavascriptClient.VoucherApi getVouchers GET /rest/platform/voucher/campaign/{campaignToken} Get a set of vouchers

Documentation for Models

Documentation for Authorization

BasicAuthentication

  • Type: HTTP basic authentication

BearerAuthentication

  • Type: Bearer authentication

About

Javascript SDK for Brand4Impact

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published