@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,168 @@
|
|
|
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 V2CheckField model module.
|
|
31
|
+
* @module model/V2CheckField
|
|
32
|
+
* @version 0.0.5
|
|
33
|
+
*/
|
|
34
|
+
var V2CheckField = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a new <code>V2CheckField</code>.
|
|
37
|
+
* One config or input field a check accepts via the API.
|
|
38
|
+
* @alias module:model/V2CheckField
|
|
39
|
+
* @param name {String}
|
|
40
|
+
* @param type {String} \"string\" | \"integer\" | \"number\" | \"boolean\" | \"array\" | \"object\"
|
|
41
|
+
* @param required {Boolean} Whether the request body must include this field.
|
|
42
|
+
* @param choices {Array.<String>} Allowed values, or null if the field isn't constrained to a set.
|
|
43
|
+
* @param helpText {String}
|
|
44
|
+
*/
|
|
45
|
+
function V2CheckField(name, type, required, choices, helpText) {
|
|
46
|
+
_classCallCheck(this, V2CheckField);
|
|
47
|
+
V2CheckField.initialize(this, name, type, required, choices, helpText);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Initializes the fields of this object.
|
|
52
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
53
|
+
* Only for internal use.
|
|
54
|
+
*/
|
|
55
|
+
return _createClass(V2CheckField, null, [{
|
|
56
|
+
key: "initialize",
|
|
57
|
+
value: function initialize(obj, name, type, required, choices, helpText) {
|
|
58
|
+
obj['name'] = name;
|
|
59
|
+
obj['type'] = type;
|
|
60
|
+
obj['required'] = required;
|
|
61
|
+
obj['choices'] = choices;
|
|
62
|
+
obj['help_text'] = helpText;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Constructs a <code>V2CheckField</code> from a plain JavaScript object, optionally creating a new instance.
|
|
67
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
68
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
69
|
+
* @param {module:model/V2CheckField} obj Optional instance to populate.
|
|
70
|
+
* @return {module:model/V2CheckField} The populated <code>V2CheckField</code> instance.
|
|
71
|
+
*/
|
|
72
|
+
}, {
|
|
73
|
+
key: "constructFromObject",
|
|
74
|
+
value: function constructFromObject(data, obj) {
|
|
75
|
+
if (data) {
|
|
76
|
+
obj = obj || new V2CheckField();
|
|
77
|
+
if (data.hasOwnProperty('name')) {
|
|
78
|
+
obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('type')) {
|
|
81
|
+
obj['type'] = _ApiClient["default"].convertToType(data['type'], 'String');
|
|
82
|
+
}
|
|
83
|
+
if (data.hasOwnProperty('required')) {
|
|
84
|
+
obj['required'] = _ApiClient["default"].convertToType(data['required'], 'Boolean');
|
|
85
|
+
}
|
|
86
|
+
if (data.hasOwnProperty('choices')) {
|
|
87
|
+
obj['choices'] = _ApiClient["default"].convertToType(data['choices'], ['String']);
|
|
88
|
+
}
|
|
89
|
+
if (data.hasOwnProperty('help_text')) {
|
|
90
|
+
obj['help_text'] = _ApiClient["default"].convertToType(data['help_text'], 'String');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return obj;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Validates the JSON data with respect to <code>V2CheckField</code>.
|
|
98
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
99
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>V2CheckField</code>.
|
|
100
|
+
*/
|
|
101
|
+
}, {
|
|
102
|
+
key: "validateJSON",
|
|
103
|
+
value: function validateJSON(data) {
|
|
104
|
+
// check to make sure all required properties are present in the JSON string
|
|
105
|
+
var _iterator = _createForOfIteratorHelper(V2CheckField.RequiredProperties),
|
|
106
|
+
_step;
|
|
107
|
+
try {
|
|
108
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
109
|
+
var property = _step.value;
|
|
110
|
+
if (!data.hasOwnProperty(property)) {
|
|
111
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// ensure the json data is a string
|
|
115
|
+
} catch (err) {
|
|
116
|
+
_iterator.e(err);
|
|
117
|
+
} finally {
|
|
118
|
+
_iterator.f();
|
|
119
|
+
}
|
|
120
|
+
if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
|
|
121
|
+
throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
|
|
122
|
+
}
|
|
123
|
+
// ensure the json data is a string
|
|
124
|
+
if (data['type'] && !(typeof data['type'] === 'string' || data['type'] instanceof String)) {
|
|
125
|
+
throw new Error("Expected the field `type` to be a primitive type in the JSON string but got " + data['type']);
|
|
126
|
+
}
|
|
127
|
+
// ensure the json data is an array
|
|
128
|
+
if (!Array.isArray(data['choices'])) {
|
|
129
|
+
throw new Error("Expected the field `choices` to be an array in the JSON data but got " + data['choices']);
|
|
130
|
+
}
|
|
131
|
+
// ensure the json data is a string
|
|
132
|
+
if (data['help_text'] && !(typeof data['help_text'] === 'string' || data['help_text'] instanceof String)) {
|
|
133
|
+
throw new Error("Expected the field `help_text` to be a primitive type in the JSON string but got " + data['help_text']);
|
|
134
|
+
}
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
}]);
|
|
138
|
+
}();
|
|
139
|
+
V2CheckField.RequiredProperties = ["name", "type", "required", "choices", "help_text"];
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @member {String} name
|
|
143
|
+
*/
|
|
144
|
+
V2CheckField.prototype['name'] = undefined;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* \"string\" | \"integer\" | \"number\" | \"boolean\" | \"array\" | \"object\"
|
|
148
|
+
* @member {String} type
|
|
149
|
+
*/
|
|
150
|
+
V2CheckField.prototype['type'] = undefined;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Whether the request body must include this field.
|
|
154
|
+
* @member {Boolean} required
|
|
155
|
+
*/
|
|
156
|
+
V2CheckField.prototype['required'] = undefined;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Allowed values, or null if the field isn't constrained to a set.
|
|
160
|
+
* @member {Array.<String>} choices
|
|
161
|
+
*/
|
|
162
|
+
V2CheckField.prototype['choices'] = undefined;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @member {String} help_text
|
|
166
|
+
*/
|
|
167
|
+
V2CheckField.prototype['help_text'] = undefined;
|
|
168
|
+
var _default = exports["default"] = V2CheckField;
|
|
@@ -0,0 +1,316 @@
|
|
|
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
|
+
var _V2CheckField = _interopRequireDefault(require("./V2CheckField"));
|
|
9
|
+
var _V2Money = _interopRequireDefault(require("./V2Money"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
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); }
|
|
12
|
+
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; } } }; }
|
|
13
|
+
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; } }
|
|
14
|
+
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; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
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); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
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); } /**
|
|
20
|
+
* Pescheck API
|
|
21
|
+
* 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.
|
|
22
|
+
*
|
|
23
|
+
* The version of the OpenAPI document: 2.0.0
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
27
|
+
* https://openapi-generator.tech
|
|
28
|
+
* Do not edit the class manually.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* The V2CheckInfo model module.
|
|
33
|
+
* @module model/V2CheckInfo
|
|
34
|
+
* @version 0.0.5
|
|
35
|
+
*/
|
|
36
|
+
var V2CheckInfo = /*#__PURE__*/function () {
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new <code>V2CheckInfo</code>.
|
|
39
|
+
* Everything a client needs to know to use a check type via the API.
|
|
40
|
+
* @alias module:model/V2CheckInfo
|
|
41
|
+
* @param checkType {String}
|
|
42
|
+
* @param displayName {String}
|
|
43
|
+
* @param description {String}
|
|
44
|
+
* @param hasConfig {Boolean}
|
|
45
|
+
* @param isSystemManaged {Boolean} True for checks added automatically (e.g. as a dependency) - clients neither add nor configure these.
|
|
46
|
+
* @param requiresChecks {Array.<String>} Other check types this check pulls in automatically when added.
|
|
47
|
+
* @param supportedCountriesOfWork {Array.<String>}
|
|
48
|
+
* @param supportedCountriesOfResidence {Array.<String>}
|
|
49
|
+
* @param defaultPrice {module:model/V2Money}
|
|
50
|
+
* @param configFields {Array.<module:model/V2CheckField>}
|
|
51
|
+
* @param inputFields {Array.<module:model/V2CheckField>}
|
|
52
|
+
* @param candidateFields {Array.<module:model/V2CheckField>} Screening-level candidate facts this check needs (name, email, sometimes date of birth, etc.).
|
|
53
|
+
*/
|
|
54
|
+
function V2CheckInfo(checkType, displayName, description, hasConfig, isSystemManaged, requiresChecks, supportedCountriesOfWork, supportedCountriesOfResidence, defaultPrice, configFields, inputFields, candidateFields) {
|
|
55
|
+
_classCallCheck(this, V2CheckInfo);
|
|
56
|
+
V2CheckInfo.initialize(this, checkType, displayName, description, hasConfig, isSystemManaged, requiresChecks, supportedCountriesOfWork, supportedCountriesOfResidence, defaultPrice, configFields, inputFields, candidateFields);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Initializes the fields of this object.
|
|
61
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
62
|
+
* Only for internal use.
|
|
63
|
+
*/
|
|
64
|
+
return _createClass(V2CheckInfo, null, [{
|
|
65
|
+
key: "initialize",
|
|
66
|
+
value: function initialize(obj, checkType, displayName, description, hasConfig, isSystemManaged, requiresChecks, supportedCountriesOfWork, supportedCountriesOfResidence, defaultPrice, configFields, inputFields, candidateFields) {
|
|
67
|
+
obj['check_type'] = checkType;
|
|
68
|
+
obj['display_name'] = displayName;
|
|
69
|
+
obj['description'] = description;
|
|
70
|
+
obj['has_config'] = hasConfig;
|
|
71
|
+
obj['is_system_managed'] = isSystemManaged;
|
|
72
|
+
obj['requires_checks'] = requiresChecks;
|
|
73
|
+
obj['supported_countries_of_work'] = supportedCountriesOfWork;
|
|
74
|
+
obj['supported_countries_of_residence'] = supportedCountriesOfResidence;
|
|
75
|
+
obj['default_price'] = defaultPrice;
|
|
76
|
+
obj['config_fields'] = configFields;
|
|
77
|
+
obj['input_fields'] = inputFields;
|
|
78
|
+
obj['candidate_fields'] = candidateFields;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Constructs a <code>V2CheckInfo</code> from a plain JavaScript object, optionally creating a new instance.
|
|
83
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
84
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
85
|
+
* @param {module:model/V2CheckInfo} obj Optional instance to populate.
|
|
86
|
+
* @return {module:model/V2CheckInfo} The populated <code>V2CheckInfo</code> instance.
|
|
87
|
+
*/
|
|
88
|
+
}, {
|
|
89
|
+
key: "constructFromObject",
|
|
90
|
+
value: function constructFromObject(data, obj) {
|
|
91
|
+
if (data) {
|
|
92
|
+
obj = obj || new V2CheckInfo();
|
|
93
|
+
if (data.hasOwnProperty('check_type')) {
|
|
94
|
+
obj['check_type'] = _ApiClient["default"].convertToType(data['check_type'], 'String');
|
|
95
|
+
}
|
|
96
|
+
if (data.hasOwnProperty('display_name')) {
|
|
97
|
+
obj['display_name'] = _ApiClient["default"].convertToType(data['display_name'], 'String');
|
|
98
|
+
}
|
|
99
|
+
if (data.hasOwnProperty('description')) {
|
|
100
|
+
obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
|
|
101
|
+
}
|
|
102
|
+
if (data.hasOwnProperty('has_config')) {
|
|
103
|
+
obj['has_config'] = _ApiClient["default"].convertToType(data['has_config'], 'Boolean');
|
|
104
|
+
}
|
|
105
|
+
if (data.hasOwnProperty('is_system_managed')) {
|
|
106
|
+
obj['is_system_managed'] = _ApiClient["default"].convertToType(data['is_system_managed'], 'Boolean');
|
|
107
|
+
}
|
|
108
|
+
if (data.hasOwnProperty('requires_checks')) {
|
|
109
|
+
obj['requires_checks'] = _ApiClient["default"].convertToType(data['requires_checks'], ['String']);
|
|
110
|
+
}
|
|
111
|
+
if (data.hasOwnProperty('supported_countries_of_work')) {
|
|
112
|
+
obj['supported_countries_of_work'] = _ApiClient["default"].convertToType(data['supported_countries_of_work'], ['String']);
|
|
113
|
+
}
|
|
114
|
+
if (data.hasOwnProperty('supported_countries_of_residence')) {
|
|
115
|
+
obj['supported_countries_of_residence'] = _ApiClient["default"].convertToType(data['supported_countries_of_residence'], ['String']);
|
|
116
|
+
}
|
|
117
|
+
if (data.hasOwnProperty('default_price')) {
|
|
118
|
+
obj['default_price'] = _ApiClient["default"].convertToType(data['default_price'], _V2Money["default"]);
|
|
119
|
+
}
|
|
120
|
+
if (data.hasOwnProperty('config_fields')) {
|
|
121
|
+
obj['config_fields'] = _ApiClient["default"].convertToType(data['config_fields'], [_V2CheckField["default"]]);
|
|
122
|
+
}
|
|
123
|
+
if (data.hasOwnProperty('input_fields')) {
|
|
124
|
+
obj['input_fields'] = _ApiClient["default"].convertToType(data['input_fields'], [_V2CheckField["default"]]);
|
|
125
|
+
}
|
|
126
|
+
if (data.hasOwnProperty('candidate_fields')) {
|
|
127
|
+
obj['candidate_fields'] = _ApiClient["default"].convertToType(data['candidate_fields'], [_V2CheckField["default"]]);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return obj;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Validates the JSON data with respect to <code>V2CheckInfo</code>.
|
|
135
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
136
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>V2CheckInfo</code>.
|
|
137
|
+
*/
|
|
138
|
+
}, {
|
|
139
|
+
key: "validateJSON",
|
|
140
|
+
value: function validateJSON(data) {
|
|
141
|
+
// check to make sure all required properties are present in the JSON string
|
|
142
|
+
var _iterator = _createForOfIteratorHelper(V2CheckInfo.RequiredProperties),
|
|
143
|
+
_step;
|
|
144
|
+
try {
|
|
145
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
146
|
+
var property = _step.value;
|
|
147
|
+
if (!data.hasOwnProperty(property)) {
|
|
148
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// ensure the json data is a string
|
|
152
|
+
} catch (err) {
|
|
153
|
+
_iterator.e(err);
|
|
154
|
+
} finally {
|
|
155
|
+
_iterator.f();
|
|
156
|
+
}
|
|
157
|
+
if (data['check_type'] && !(typeof data['check_type'] === 'string' || data['check_type'] instanceof String)) {
|
|
158
|
+
throw new Error("Expected the field `check_type` to be a primitive type in the JSON string but got " + data['check_type']);
|
|
159
|
+
}
|
|
160
|
+
// ensure the json data is a string
|
|
161
|
+
if (data['display_name'] && !(typeof data['display_name'] === 'string' || data['display_name'] instanceof String)) {
|
|
162
|
+
throw new Error("Expected the field `display_name` to be a primitive type in the JSON string but got " + data['display_name']);
|
|
163
|
+
}
|
|
164
|
+
// ensure the json data is a string
|
|
165
|
+
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
|
|
166
|
+
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
|
|
167
|
+
}
|
|
168
|
+
// ensure the json data is an array
|
|
169
|
+
if (!Array.isArray(data['requires_checks'])) {
|
|
170
|
+
throw new Error("Expected the field `requires_checks` to be an array in the JSON data but got " + data['requires_checks']);
|
|
171
|
+
}
|
|
172
|
+
// ensure the json data is an array
|
|
173
|
+
if (!Array.isArray(data['supported_countries_of_work'])) {
|
|
174
|
+
throw new Error("Expected the field `supported_countries_of_work` to be an array in the JSON data but got " + data['supported_countries_of_work']);
|
|
175
|
+
}
|
|
176
|
+
// ensure the json data is an array
|
|
177
|
+
if (!Array.isArray(data['supported_countries_of_residence'])) {
|
|
178
|
+
throw new Error("Expected the field `supported_countries_of_residence` to be an array in the JSON data but got " + data['supported_countries_of_residence']);
|
|
179
|
+
}
|
|
180
|
+
// validate the optional field `default_price`
|
|
181
|
+
if (data['default_price']) {
|
|
182
|
+
// data not null
|
|
183
|
+
_V2Money["default"].validateJSON(data['default_price']);
|
|
184
|
+
}
|
|
185
|
+
if (data['config_fields']) {
|
|
186
|
+
// data not null
|
|
187
|
+
// ensure the json data is an array
|
|
188
|
+
if (!Array.isArray(data['config_fields'])) {
|
|
189
|
+
throw new Error("Expected the field `config_fields` to be an array in the JSON data but got " + data['config_fields']);
|
|
190
|
+
}
|
|
191
|
+
// validate the optional field `config_fields` (array)
|
|
192
|
+
var _iterator2 = _createForOfIteratorHelper(data['config_fields']),
|
|
193
|
+
_step2;
|
|
194
|
+
try {
|
|
195
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
196
|
+
var item = _step2.value;
|
|
197
|
+
_V2CheckField["default"].validateJSON(item);
|
|
198
|
+
}
|
|
199
|
+
} catch (err) {
|
|
200
|
+
_iterator2.e(err);
|
|
201
|
+
} finally {
|
|
202
|
+
_iterator2.f();
|
|
203
|
+
}
|
|
204
|
+
;
|
|
205
|
+
}
|
|
206
|
+
if (data['input_fields']) {
|
|
207
|
+
// data not null
|
|
208
|
+
// ensure the json data is an array
|
|
209
|
+
if (!Array.isArray(data['input_fields'])) {
|
|
210
|
+
throw new Error("Expected the field `input_fields` to be an array in the JSON data but got " + data['input_fields']);
|
|
211
|
+
}
|
|
212
|
+
// validate the optional field `input_fields` (array)
|
|
213
|
+
var _iterator3 = _createForOfIteratorHelper(data['input_fields']),
|
|
214
|
+
_step3;
|
|
215
|
+
try {
|
|
216
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
217
|
+
var _item = _step3.value;
|
|
218
|
+
_V2CheckField["default"].validateJSON(_item);
|
|
219
|
+
}
|
|
220
|
+
} catch (err) {
|
|
221
|
+
_iterator3.e(err);
|
|
222
|
+
} finally {
|
|
223
|
+
_iterator3.f();
|
|
224
|
+
}
|
|
225
|
+
;
|
|
226
|
+
}
|
|
227
|
+
if (data['candidate_fields']) {
|
|
228
|
+
// data not null
|
|
229
|
+
// ensure the json data is an array
|
|
230
|
+
if (!Array.isArray(data['candidate_fields'])) {
|
|
231
|
+
throw new Error("Expected the field `candidate_fields` to be an array in the JSON data but got " + data['candidate_fields']);
|
|
232
|
+
}
|
|
233
|
+
// validate the optional field `candidate_fields` (array)
|
|
234
|
+
var _iterator4 = _createForOfIteratorHelper(data['candidate_fields']),
|
|
235
|
+
_step4;
|
|
236
|
+
try {
|
|
237
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
238
|
+
var _item2 = _step4.value;
|
|
239
|
+
_V2CheckField["default"].validateJSON(_item2);
|
|
240
|
+
}
|
|
241
|
+
} catch (err) {
|
|
242
|
+
_iterator4.e(err);
|
|
243
|
+
} finally {
|
|
244
|
+
_iterator4.f();
|
|
245
|
+
}
|
|
246
|
+
;
|
|
247
|
+
}
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
}]);
|
|
251
|
+
}();
|
|
252
|
+
V2CheckInfo.RequiredProperties = ["check_type", "display_name", "description", "has_config", "is_system_managed", "requires_checks", "supported_countries_of_work", "supported_countries_of_residence", "default_price", "config_fields", "input_fields", "candidate_fields"];
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @member {String} check_type
|
|
256
|
+
*/
|
|
257
|
+
V2CheckInfo.prototype['check_type'] = undefined;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @member {String} display_name
|
|
261
|
+
*/
|
|
262
|
+
V2CheckInfo.prototype['display_name'] = undefined;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @member {String} description
|
|
266
|
+
*/
|
|
267
|
+
V2CheckInfo.prototype['description'] = undefined;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @member {Boolean} has_config
|
|
271
|
+
*/
|
|
272
|
+
V2CheckInfo.prototype['has_config'] = undefined;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* True for checks added automatically (e.g. as a dependency) - clients neither add nor configure these.
|
|
276
|
+
* @member {Boolean} is_system_managed
|
|
277
|
+
*/
|
|
278
|
+
V2CheckInfo.prototype['is_system_managed'] = undefined;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Other check types this check pulls in automatically when added.
|
|
282
|
+
* @member {Array.<String>} requires_checks
|
|
283
|
+
*/
|
|
284
|
+
V2CheckInfo.prototype['requires_checks'] = undefined;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* @member {Array.<String>} supported_countries_of_work
|
|
288
|
+
*/
|
|
289
|
+
V2CheckInfo.prototype['supported_countries_of_work'] = undefined;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @member {Array.<String>} supported_countries_of_residence
|
|
293
|
+
*/
|
|
294
|
+
V2CheckInfo.prototype['supported_countries_of_residence'] = undefined;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* @member {module:model/V2Money} default_price
|
|
298
|
+
*/
|
|
299
|
+
V2CheckInfo.prototype['default_price'] = undefined;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @member {Array.<module:model/V2CheckField>} config_fields
|
|
303
|
+
*/
|
|
304
|
+
V2CheckInfo.prototype['config_fields'] = undefined;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* @member {Array.<module:model/V2CheckField>} input_fields
|
|
308
|
+
*/
|
|
309
|
+
V2CheckInfo.prototype['input_fields'] = undefined;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Screening-level candidate facts this check needs (name, email, sometimes date of birth, etc.).
|
|
313
|
+
* @member {Array.<module:model/V2CheckField>} candidate_fields
|
|
314
|
+
*/
|
|
315
|
+
V2CheckInfo.prototype['candidate_fields'] = undefined;
|
|
316
|
+
var _default = exports["default"] = V2CheckInfo;
|