@pescheckit/pescheck-client-js
v0.4.2
Published
Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck
Downloads
1,269
Readme
Official Pescheck API client - part of the pescheck-clients SDKs.
@pescheckit/pescheck-client-js
PescheckApi - JavaScript client for @pescheckit/pescheck-client-js Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage. This SDK is automatically generated by the OpenAPI Generator project:
- API version: 2.0.0
- Package version: 0.1.0
- Generator version: 7.23.0
- Build package: org.openapitools.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 @pescheckit/pescheck-client-js --saveFinally, you need to build the module:
npm run buildLocal 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 installNext, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:
npm linkTo use the link you just defined in your project, switch to the directory you want to use your @pescheckit/pescheck-client-js from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>Finally, you need to build the module:
npm run buildgit
If the library is hosted at a git repository, e.g.https://github.com/pescheckit/pescheck-clients then install it via:
npm install pescheckit/pescheck-clients --saveFor 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.jsThen 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 PescheckApi = require('@pescheckit/pescheck-client-js');
var defaultClient = PescheckApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"
var api = new PescheckApi.AuthenticationApi()
var jWTGeneration = new PescheckApi.JWTGeneration(); // {JWTGeneration}
api.generateJWTToken2(jWTGeneration).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Documentation for API Endpoints
All URIs are relative to https://api.pescheck.io
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- PescheckApi.AuthenticationApi | generateJWTToken2 | POST /api/v2/jwt/generate/ | PescheckApi.AuthenticationApi | jwtCreate | POST /api/jwt/ | PescheckApi.AuthenticationApi | jwtRefreshCreate | POST /api/jwt/refresh/ | PescheckApi.ChecksApi | v2ChecksList | GET /api/v2/checks/ | PescheckApi.ChecksApi | v2ChecksRetrieve | GET /api/v2/checks/{check_type}/ | PescheckApi.DivisionsApi | v2OrganisationsDivisionsCreate | POST /api/v2/organisations/divisions/ | PescheckApi.DivisionsApi | v2OrganisationsDivisionsList | GET /api/v2/organisations/divisions/ | PescheckApi.DivisionsApi | v2OrganisationsDivisionsPartialUpdate | PATCH /api/v2/organisations/divisions/{id}/ | PescheckApi.DivisionsApi | v2OrganisationsDivisionsRetrieve | GET /api/v2/organisations/divisions/{id}/ | PescheckApi.DivisionsApi | v2OrganisationsDivisionsUpdate | PUT /api/v2/organisations/divisions/{id}/ | PescheckApi.OAuthApi | createOAuthApplication2 | POST /api/v2/oauth/applications/ | PescheckApi.OAuthApi | deleteOAuthApplication2 | DELETE /api/v2/oauth/applications/{application_id}/ | PescheckApi.OAuthApi | listOAuthApplications2 | GET /api/v2/oauth/applications/list/ | PescheckApi.ProfilesApi | v2ProfilesCreate | POST /api/v2/profiles/ | PescheckApi.ProfilesApi | v2ProfilesDestroy | DELETE /api/v2/profiles/{id}/ | PescheckApi.ProfilesApi | v2ProfilesList | GET /api/v2/profiles/ | PescheckApi.ProfilesApi | v2ProfilesPartialUpdate | PATCH /api/v2/profiles/{id}/ | PescheckApi.ProfilesApi | v2ProfilesRetrieve | GET /api/v2/profiles/{id}/ | PescheckApi.ProfilesApi | v2ProfilesUpdate | PUT /api/v2/profiles/{id}/ | PescheckApi.ScreeningsApi | v2ScreeningsCreate | POST /api/v2/screenings/ | PescheckApi.ScreeningsApi | v2ScreeningsDocumentsList | GET /api/v2/screenings/{id}/documents/ | Retrieve screening documents PescheckApi.ScreeningsApi | v2ScreeningsList | GET /api/v2/screenings/ | PescheckApi.ScreeningsApi | v2ScreeningsRetrieve | GET /api/v2/screenings/{id}/ | PescheckApi.WebhooksApi | createWebhook2 | POST /api/v2/webhooks/ | PescheckApi.WebhooksApi | deleteWebhook2 | DELETE /api/v2/webhooks/{webhook_id}/ | PescheckApi.WebhooksApi | listWebhooks2 | GET /api/v2/webhooks/list/ | PescheckApi.WebhooksApi | verifyWebhook2 | POST /api/v2/webhooks/{webhook_id}/verify/ |
Documentation for Models
- PescheckApi.CustomTokenObtainPair
- PescheckApi.DivisionReadOnly
- PescheckApi.DivisionWrite
- PescheckApi.JWTGeneration
- PescheckApi.JWTResponse
- PescheckApi.OAuthApplication
- PescheckApi.OAuthApplicationResponse
- PescheckApi.PaginatedDivisionReadOnlyList
- PescheckApi.PaginatedV2ProfileListItemList
- PescheckApi.PaginatedV2ScreeningListItemList
- PescheckApi.PatchedDivisionWrite
- PescheckApi.PatchedV2ProfilePartialUpdate
- PescheckApi.TokenRefresh
- PescheckApi.V2Candidate
- PescheckApi.V2CheckField
- PescheckApi.V2CheckInfo
- PescheckApi.V2Document
- PescheckApi.V2DocumentContent
- PescheckApi.V2Money
- PescheckApi.V2ProfileCheck
- PescheckApi.V2ProfileCheckEntry
- PescheckApi.V2ProfileCreate
- PescheckApi.V2ProfileDetail
- PescheckApi.V2ProfileListItem
- PescheckApi.V2ProfileUpdate
- PescheckApi.V2ProfileUpdateCheck
- PescheckApi.V2ScreeningCheck
- PescheckApi.V2ScreeningCheckEntry
- PescheckApi.V2ScreeningCheckListItem
- PescheckApi.V2ScreeningCreate
- PescheckApi.V2ScreeningDetail
- PescheckApi.V2ScreeningDetailProfile
- PescheckApi.V2ScreeningListItem
- PescheckApi.VerifyWebhook
- PescheckApi.Webhook
- PescheckApi.WebhookResponse
Documentation for Authorization
Authentication schemes defined for the API:
cookieAuth
- Type: API key
- API key parameter name: __Secure-sessionid
- Location:
jwtAuth
- Type: Bearer authentication (JWT)
oauth2
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes:
- read:api: read groups
- create:api: create groups
- update:api: update groups
