Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jquery-eclipsefdn-api

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-eclipsefdn-api

Fetch and display data from various Eclipse Foundation APIs.

  • 0.0.46
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

jquery-eclipsefdn-api Build Status

About

A jQuery plugin that fetches and display data from various Eclipse Foundation APIs.

Options

Here's a list of available settings.

$("div").eclipseFdnApi({
  username: "cguindon",
  type: "mpFavoritesCount"
});
AttributeTypeDefaultDescription
apiUrlStringhttps://api.eclipse.orgEclipse Api URL.
gerritUrlStringhttps://git.eclipse.org/rEclipse Gerrit URL.
eventUrlStringhttps://events.eclipse.org/data/EclipseEvents.jsonEclipse event json feed URL.
forumsUrlStringhttps://www.eclipse.org/forumsEclipse Forums URL.
marketplaceUrlStringhttps://marketplace.eclipse.orgEclipse Marketplace URL.
errorMsgString<i class=\"fa red fa-exclamation-triangle\" aria-hidden=\"true\"></i> An unexpected error has occurred.Error message for when the ajax request fails.
gerritUserNotFoundMsgString<i class=\"fa red fa-exclamation-triangle\" aria-hidden=\"true\"></i> An unexpected error has occurred.Error message for when a user is not found on Gerrit.
usernameStringcguindonThe username to fetch Eclipse Favorites or Gerrit reviews for.
currentUsernameString``The user making the request this page. Useful if content changed if the user is viewing his own page.
typeStringValid values are gerritReviews, gerritReviewsCount, mpFavorites, projectsList, forumsMsg and recentEvents.
itemsPerPageInteger20Number of fetched items to display per page.

Contributing

Check CONTRIBUTING.md for more information.

License

MIT License © Christopher Guindon

Thanks to https://github.com/jquery-boilerplate/jquery-boilerplate, MIT License © Zeno Rocha

jquery-eclipsefdn-igc README

About

A jQuery plugin to provide OAUTH2 Implicit Grant Flow authorization functionality for API requests to client scripts and plugins

Options

Here's an example of how to use the client.

// set delayed response handlers

// delayed request was completed after authorization, and these were the results
$(document).on("igcRequestComplete", function(event, eventData) {
  if (eventData.clientName === "myScript") {
    // returned result data will be stored in eventData.data
    // you can determine which request you made by checking eventData.requestOptions
  }
});

// delayed request failed
$(document).on("igcRequestFailed", function(event, eventError) {
  if (eventError.clientName === "myScript") {
    // request failed.  the details ajax response is stored in eventError.jqXHR
  }
});

// authorization failed (ie. authorization was denied or there was a validation failed)
$(document).on("igcAuthFailed", function(event, authError) {
  if (authError.clientName === "myScript") {
    // authError.error will show any status code, if available.
    // authError.error_description will contain a test description of what went wrong
    // authError.error_from will indicate which area in the processes the failure occured
  }
});

// initialize the client - any delayed responses will be triggered during initialization
$(document).eclipseFdnIgc({
  clientName: "myScript",
  authURL: "https://accounts.example.com",
  apiURL: "https://api.example.com",
  username: "darmstrong"
});

// make a request
requestOptions = {
  // api service end-point path
  path: "marketplace/favorites/12345",
  method: "PUT",
  cid: "myClientID",
  scope: "scopeToRequest",
  // callbacks are used for non-delayed responses (client already authorized) 
  // for immediate response without broadcasting to all clients
  successCallback: function(data) {
    // we can do something now and call a function script to process the data
  },
  errorCallback: function(jqXHR) {
    // the request failed.  status code and error message is in the jqXHR object
    // it is important to check the response to determine if this is a soft error (action already performed)
    // or if there is something wrong with the request that needs to be corrected before attempting again.
  }
};
// send the request to the eclipseFdnIgc plugin. If the client does not have an authorization token, or it has become expired,
// it will make a request for a new one.
$(document).eclipseFdnIgc.makeRequest(requestOptions);
AttributeTypeDefaultDescription
clientNameStringunknownIdentifying name for client. Used to separate stored items.
authUrlStringhttps://accounts.eclipse.orgEclipse Authorization base URL.
apiUrlStringhttps://api.eclipse.orgEclipse API base url.
redirectUriString[location.protocol, "//", location.host, "/site_login_implicit_grant"].join("")redirect landing page for authorization response. defaults to current site and path of "/site_login_implicit_grant"
baseStorageNameStringeclipseIGCbase name to build storage name from.
redirectIfValidBooleantrueredirect to originating page after validating authorization response
validateUserBooleantrueValidates authorization token matches currently logged in user
useOpenWinBooleanfalseOpens a new window for authorization flow instead of using current window.
encodeStorageBooleantrueBase64 encode data placed in storage
userNameString''currently logged in username, used for validation purposes and to clear items if user logs out or other account is logged in
completeOnAuthorizationBooleantruefinish the request that triggered authorization after completing validation

License

MIT License © Christopher Guindon

Thanks to https://github.com/jquery-boilerplate/jquery-boilerplate, MIT License © Zeno Rocha

Keywords

FAQs

Package last updated on 12 Mar 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc