@pescheckit/pescheck-client-js 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +220 -0
- package/dist/ApiClient.js +730 -0
- package/dist/api/AuthenticationApi.js +159 -0
- package/dist/api/ChecksApi.js +120 -0
- package/dist/api/DivisionsApi.js +257 -0
- package/dist/api/OAuthApi.js +153 -0
- package/dist/api/ProfilesApi.js +301 -0
- package/dist/api/ScreeningsApi.js +213 -0
- package/dist/api/WebhooksApi.js +210 -0
- package/dist/index.js +314 -0
- package/dist/model/CustomTokenObtainPair.js +127 -0
- package/dist/model/DivisionReadOnly.js +266 -0
- package/dist/model/DivisionWrite.js +246 -0
- package/dist/model/JWTGeneration.js +155 -0
- package/dist/model/JWTResponse.js +184 -0
- package/dist/model/OAuthApplication.js +221 -0
- package/dist/model/OAuthApplicationResponse.js +252 -0
- package/dist/model/PaginatedDivisionReadOnlyList.js +168 -0
- package/dist/model/PaginatedV2ProfileListItemList.js +168 -0
- package/dist/model/PaginatedV2ScreeningListItemList.js +168 -0
- package/dist/model/PatchedDivisionWrite.js +209 -0
- package/dist/model/PatchedV2ProfilePartialUpdate.js +102 -0
- package/dist/model/TokenRefresh.js +124 -0
- package/dist/model/V2Candidate.js +1474 -0
- package/dist/model/V2CheckField.js +168 -0
- package/dist/model/V2CheckInfo.js +316 -0
- package/dist/model/V2Document.js +302 -0
- package/dist/model/V2DocumentContent.js +126 -0
- package/dist/model/V2Money.js +126 -0
- package/dist/model/V2ProfileCheck.js +222 -0
- package/dist/model/V2ProfileCheckEntry.js +311 -0
- package/dist/model/V2ProfileCreate.js +158 -0
- package/dist/model/V2ProfileDetail.js +258 -0
- package/dist/model/V2ProfileListItem.js +182 -0
- package/dist/model/V2ProfileUpdate.js +159 -0
- package/dist/model/V2ProfileUpdateCheck.js +254 -0
- package/dist/model/V2ScreeningCheck.js +243 -0
- package/dist/model/V2ScreeningCheckEntry.js +338 -0
- package/dist/model/V2ScreeningCheckListItem.js +260 -0
- package/dist/model/V2ScreeningCreate.js +158 -0
- package/dist/model/V2ScreeningDetail.js +240 -0
- package/dist/model/V2ScreeningDetailProfile.js +101 -0
- package/dist/model/V2ScreeningListItem.js +237 -0
- package/dist/model/VerifyWebhook.js +114 -0
- package/dist/model/Webhook.js +221 -0
- package/dist/model/WebhookResponse.js +215 -0
- package/package.json +54 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
18
|
+
* Pescheck API
|
|
19
|
+
* 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.
|
|
20
|
+
*
|
|
21
|
+
* The version of the OpenAPI document: 2.0.0
|
|
22
|
+
*
|
|
23
|
+
*
|
|
24
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
25
|
+
* https://openapi-generator.tech
|
|
26
|
+
* Do not edit the class manually.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* The WebhookResponse model module.
|
|
31
|
+
* @module model/WebhookResponse
|
|
32
|
+
* @version 0.0.5
|
|
33
|
+
*/
|
|
34
|
+
var WebhookResponse = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a new <code>WebhookResponse</code>.
|
|
37
|
+
* Serializer for webhook responses
|
|
38
|
+
* @alias module:model/WebhookResponse
|
|
39
|
+
* @extends Object
|
|
40
|
+
* @param id {String}
|
|
41
|
+
* @param name {String}
|
|
42
|
+
* @param url {String}
|
|
43
|
+
* @param events {Object}
|
|
44
|
+
* @param verified {Boolean}
|
|
45
|
+
* @param createdAt {Date}
|
|
46
|
+
* @param updatedAt {Date}
|
|
47
|
+
*/
|
|
48
|
+
function WebhookResponse(id, name, url, events, verified, createdAt, updatedAt) {
|
|
49
|
+
_classCallCheck(this, WebhookResponse);
|
|
50
|
+
WebhookResponse.initialize(this, id, name, url, events, verified, createdAt, updatedAt);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Initializes the fields of this object.
|
|
55
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
56
|
+
* Only for internal use.
|
|
57
|
+
*/
|
|
58
|
+
return _createClass(WebhookResponse, null, [{
|
|
59
|
+
key: "initialize",
|
|
60
|
+
value: function initialize(obj, id, name, url, events, verified, createdAt, updatedAt) {
|
|
61
|
+
obj['id'] = id;
|
|
62
|
+
obj['name'] = name;
|
|
63
|
+
obj['url'] = url;
|
|
64
|
+
obj['events'] = events;
|
|
65
|
+
obj['verified'] = verified;
|
|
66
|
+
obj['created_at'] = createdAt;
|
|
67
|
+
obj['updated_at'] = updatedAt;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Constructs a <code>WebhookResponse</code> from a plain JavaScript object, optionally creating a new instance.
|
|
72
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
73
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
74
|
+
* @param {module:model/WebhookResponse} obj Optional instance to populate.
|
|
75
|
+
* @return {module:model/WebhookResponse} The populated <code>WebhookResponse</code> instance.
|
|
76
|
+
*/
|
|
77
|
+
}, {
|
|
78
|
+
key: "constructFromObject",
|
|
79
|
+
value: function constructFromObject(data, obj) {
|
|
80
|
+
if (data) {
|
|
81
|
+
obj = obj || new WebhookResponse();
|
|
82
|
+
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
83
|
+
if (data.hasOwnProperty('id')) {
|
|
84
|
+
obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
|
|
85
|
+
}
|
|
86
|
+
if (data.hasOwnProperty('name')) {
|
|
87
|
+
obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
|
|
88
|
+
}
|
|
89
|
+
if (data.hasOwnProperty('url')) {
|
|
90
|
+
obj['url'] = _ApiClient["default"].convertToType(data['url'], 'String');
|
|
91
|
+
}
|
|
92
|
+
if (data.hasOwnProperty('events')) {
|
|
93
|
+
obj['events'] = _ApiClient["default"].convertToType(data['events'], Object);
|
|
94
|
+
}
|
|
95
|
+
if (data.hasOwnProperty('active')) {
|
|
96
|
+
obj['active'] = _ApiClient["default"].convertToType(data['active'], 'Boolean');
|
|
97
|
+
}
|
|
98
|
+
if (data.hasOwnProperty('verified')) {
|
|
99
|
+
obj['verified'] = _ApiClient["default"].convertToType(data['verified'], 'Boolean');
|
|
100
|
+
}
|
|
101
|
+
if (data.hasOwnProperty('token')) {
|
|
102
|
+
obj['token'] = _ApiClient["default"].convertToType(data['token'], 'String');
|
|
103
|
+
}
|
|
104
|
+
if (data.hasOwnProperty('organisation_name')) {
|
|
105
|
+
obj['organisation_name'] = _ApiClient["default"].convertToType(data['organisation_name'], 'String');
|
|
106
|
+
}
|
|
107
|
+
if (data.hasOwnProperty('created_at')) {
|
|
108
|
+
obj['created_at'] = _ApiClient["default"].convertToType(data['created_at'], 'Date');
|
|
109
|
+
}
|
|
110
|
+
if (data.hasOwnProperty('updated_at')) {
|
|
111
|
+
obj['updated_at'] = _ApiClient["default"].convertToType(data['updated_at'], 'Date');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return obj;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Validates the JSON data with respect to <code>WebhookResponse</code>.
|
|
119
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
120
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>WebhookResponse</code>.
|
|
121
|
+
*/
|
|
122
|
+
}, {
|
|
123
|
+
key: "validateJSON",
|
|
124
|
+
value: function validateJSON(data) {
|
|
125
|
+
// check to make sure all required properties are present in the JSON string
|
|
126
|
+
var _iterator = _createForOfIteratorHelper(WebhookResponse.RequiredProperties),
|
|
127
|
+
_step;
|
|
128
|
+
try {
|
|
129
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
130
|
+
var property = _step.value;
|
|
131
|
+
if (!data.hasOwnProperty(property)) {
|
|
132
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// ensure the json data is a string
|
|
136
|
+
} catch (err) {
|
|
137
|
+
_iterator.e(err);
|
|
138
|
+
} finally {
|
|
139
|
+
_iterator.f();
|
|
140
|
+
}
|
|
141
|
+
if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
|
|
142
|
+
throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
|
|
143
|
+
}
|
|
144
|
+
// ensure the json data is a string
|
|
145
|
+
if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
|
|
146
|
+
throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
|
|
147
|
+
}
|
|
148
|
+
// ensure the json data is a string
|
|
149
|
+
if (data['url'] && !(typeof data['url'] === 'string' || data['url'] instanceof String)) {
|
|
150
|
+
throw new Error("Expected the field `url` to be a primitive type in the JSON string but got " + data['url']);
|
|
151
|
+
}
|
|
152
|
+
// ensure the json data is a string
|
|
153
|
+
if (data['token'] && !(typeof data['token'] === 'string' || data['token'] instanceof String)) {
|
|
154
|
+
throw new Error("Expected the field `token` to be a primitive type in the JSON string but got " + data['token']);
|
|
155
|
+
}
|
|
156
|
+
// ensure the json data is a string
|
|
157
|
+
if (data['organisation_name'] && !(typeof data['organisation_name'] === 'string' || data['organisation_name'] instanceof String)) {
|
|
158
|
+
throw new Error("Expected the field `organisation_name` to be a primitive type in the JSON string but got " + data['organisation_name']);
|
|
159
|
+
}
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
}]);
|
|
163
|
+
}();
|
|
164
|
+
WebhookResponse.RequiredProperties = ["id", "name", "url", "events", "verified", "created_at", "updated_at"];
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @member {String} id
|
|
168
|
+
*/
|
|
169
|
+
WebhookResponse.prototype['id'] = undefined;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @member {String} name
|
|
173
|
+
*/
|
|
174
|
+
WebhookResponse.prototype['name'] = undefined;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @member {String} url
|
|
178
|
+
*/
|
|
179
|
+
WebhookResponse.prototype['url'] = undefined;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @member {Object} events
|
|
183
|
+
*/
|
|
184
|
+
WebhookResponse.prototype['events'] = undefined;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @member {Boolean} active
|
|
188
|
+
*/
|
|
189
|
+
WebhookResponse.prototype['active'] = undefined;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* @member {Boolean} verified
|
|
193
|
+
*/
|
|
194
|
+
WebhookResponse.prototype['verified'] = undefined;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @member {String} token
|
|
198
|
+
*/
|
|
199
|
+
WebhookResponse.prototype['token'] = undefined;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @member {String} organisation_name
|
|
203
|
+
*/
|
|
204
|
+
WebhookResponse.prototype['organisation_name'] = undefined;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @member {Date} created_at
|
|
208
|
+
*/
|
|
209
|
+
WebhookResponse.prototype['created_at'] = undefined;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @member {Date} updated_at
|
|
213
|
+
*/
|
|
214
|
+
WebhookResponse.prototype['updated_at'] = undefined;
|
|
215
|
+
var _default = exports["default"] = WebhookResponse;
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pescheckit/pescheck-client-js",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "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.",
|
|
5
|
+
"license": "Unlicense",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "babel src -d dist",
|
|
9
|
+
"prepare": "npm run build",
|
|
10
|
+
"test": "mocha --require @babel/register --recursive"
|
|
11
|
+
},
|
|
12
|
+
"browser": {
|
|
13
|
+
"fs": false
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@babel/cli": "^7.0.0",
|
|
17
|
+
"superagent": "^5.3.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@babel/core": "^7.0.0",
|
|
21
|
+
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
|
22
|
+
"@babel/plugin-proposal-decorators": "^7.0.0",
|
|
23
|
+
"@babel/plugin-proposal-do-expressions": "^7.0.0",
|
|
24
|
+
"@babel/plugin-proposal-export-default-from": "^7.0.0",
|
|
25
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
|
|
26
|
+
"@babel/plugin-proposal-function-bind": "^7.0.0",
|
|
27
|
+
"@babel/plugin-proposal-function-sent": "^7.0.0",
|
|
28
|
+
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
|
29
|
+
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
|
|
30
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
|
|
31
|
+
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
|
|
32
|
+
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
|
|
33
|
+
"@babel/plugin-proposal-pipeline-operator": "^7.0.0",
|
|
34
|
+
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
|
|
35
|
+
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
|
36
|
+
"@babel/plugin-syntax-import-meta": "^7.0.0",
|
|
37
|
+
"@babel/preset-env": "^7.0.0",
|
|
38
|
+
"@babel/register": "^7.0.0",
|
|
39
|
+
"expect.js": "^0.3.1",
|
|
40
|
+
"mocha": "^8.0.1",
|
|
41
|
+
"sinon": "^7.2.0"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist"
|
|
45
|
+
],
|
|
46
|
+
"homepage": "https://pescheck.io",
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "git+https://github.com/pescheckit/pescheck-clients.git"
|
|
50
|
+
},
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/pescheckit/pescheck-clients/issues"
|
|
53
|
+
}
|
|
54
|
+
}
|