@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.
Files changed (47) hide show
  1. package/README.md +220 -0
  2. package/dist/ApiClient.js +730 -0
  3. package/dist/api/AuthenticationApi.js +159 -0
  4. package/dist/api/ChecksApi.js +120 -0
  5. package/dist/api/DivisionsApi.js +257 -0
  6. package/dist/api/OAuthApi.js +153 -0
  7. package/dist/api/ProfilesApi.js +301 -0
  8. package/dist/api/ScreeningsApi.js +213 -0
  9. package/dist/api/WebhooksApi.js +210 -0
  10. package/dist/index.js +314 -0
  11. package/dist/model/CustomTokenObtainPair.js +127 -0
  12. package/dist/model/DivisionReadOnly.js +266 -0
  13. package/dist/model/DivisionWrite.js +246 -0
  14. package/dist/model/JWTGeneration.js +155 -0
  15. package/dist/model/JWTResponse.js +184 -0
  16. package/dist/model/OAuthApplication.js +221 -0
  17. package/dist/model/OAuthApplicationResponse.js +252 -0
  18. package/dist/model/PaginatedDivisionReadOnlyList.js +168 -0
  19. package/dist/model/PaginatedV2ProfileListItemList.js +168 -0
  20. package/dist/model/PaginatedV2ScreeningListItemList.js +168 -0
  21. package/dist/model/PatchedDivisionWrite.js +209 -0
  22. package/dist/model/PatchedV2ProfilePartialUpdate.js +102 -0
  23. package/dist/model/TokenRefresh.js +124 -0
  24. package/dist/model/V2Candidate.js +1474 -0
  25. package/dist/model/V2CheckField.js +168 -0
  26. package/dist/model/V2CheckInfo.js +316 -0
  27. package/dist/model/V2Document.js +302 -0
  28. package/dist/model/V2DocumentContent.js +126 -0
  29. package/dist/model/V2Money.js +126 -0
  30. package/dist/model/V2ProfileCheck.js +222 -0
  31. package/dist/model/V2ProfileCheckEntry.js +311 -0
  32. package/dist/model/V2ProfileCreate.js +158 -0
  33. package/dist/model/V2ProfileDetail.js +258 -0
  34. package/dist/model/V2ProfileListItem.js +182 -0
  35. package/dist/model/V2ProfileUpdate.js +159 -0
  36. package/dist/model/V2ProfileUpdateCheck.js +254 -0
  37. package/dist/model/V2ScreeningCheck.js +243 -0
  38. package/dist/model/V2ScreeningCheckEntry.js +338 -0
  39. package/dist/model/V2ScreeningCheckListItem.js +260 -0
  40. package/dist/model/V2ScreeningCreate.js +158 -0
  41. package/dist/model/V2ScreeningDetail.js +240 -0
  42. package/dist/model/V2ScreeningDetailProfile.js +101 -0
  43. package/dist/model/V2ScreeningListItem.js +237 -0
  44. package/dist/model/VerifyWebhook.js +114 -0
  45. package/dist/model/Webhook.js +221 -0
  46. package/dist/model/WebhookResponse.js +215 -0
  47. package/package.json +54 -0
@@ -0,0 +1,184 @@
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 JWTResponse model module.
31
+ * @module model/JWTResponse
32
+ * @version 0.0.5
33
+ */
34
+ var JWTResponse = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>JWTResponse</code>.
37
+ * Serializer for JWT token response
38
+ * @alias module:model/JWTResponse
39
+ * @param accessToken {String} JWT access token
40
+ * @param refreshToken {String} JWT refresh token
41
+ * @param expiresIn {Number} Access token expiration in seconds
42
+ * @param organisation {String} Organization name
43
+ * @param organisationId {String} Organization ID
44
+ */
45
+ function JWTResponse(accessToken, refreshToken, expiresIn, organisation, organisationId) {
46
+ _classCallCheck(this, JWTResponse);
47
+ JWTResponse.initialize(this, accessToken, refreshToken, expiresIn, organisation, organisationId);
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(JWTResponse, null, [{
56
+ key: "initialize",
57
+ value: function initialize(obj, accessToken, refreshToken, expiresIn, organisation, organisationId) {
58
+ obj['access_token'] = accessToken;
59
+ obj['refresh_token'] = refreshToken;
60
+ obj['token_type'] = 'Bearer';
61
+ obj['expires_in'] = expiresIn;
62
+ obj['organisation'] = organisation;
63
+ obj['organisation_id'] = organisationId;
64
+ }
65
+
66
+ /**
67
+ * Constructs a <code>JWTResponse</code> from a plain JavaScript object, optionally creating a new instance.
68
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
69
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
70
+ * @param {module:model/JWTResponse} obj Optional instance to populate.
71
+ * @return {module:model/JWTResponse} The populated <code>JWTResponse</code> instance.
72
+ */
73
+ }, {
74
+ key: "constructFromObject",
75
+ value: function constructFromObject(data, obj) {
76
+ if (data) {
77
+ obj = obj || new JWTResponse();
78
+ if (data.hasOwnProperty('access_token')) {
79
+ obj['access_token'] = _ApiClient["default"].convertToType(data['access_token'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('refresh_token')) {
82
+ obj['refresh_token'] = _ApiClient["default"].convertToType(data['refresh_token'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('token_type')) {
85
+ obj['token_type'] = _ApiClient["default"].convertToType(data['token_type'], 'String');
86
+ }
87
+ if (data.hasOwnProperty('expires_in')) {
88
+ obj['expires_in'] = _ApiClient["default"].convertToType(data['expires_in'], 'Number');
89
+ }
90
+ if (data.hasOwnProperty('organisation')) {
91
+ obj['organisation'] = _ApiClient["default"].convertToType(data['organisation'], 'String');
92
+ }
93
+ if (data.hasOwnProperty('organisation_id')) {
94
+ obj['organisation_id'] = _ApiClient["default"].convertToType(data['organisation_id'], 'String');
95
+ }
96
+ }
97
+ return obj;
98
+ }
99
+
100
+ /**
101
+ * Validates the JSON data with respect to <code>JWTResponse</code>.
102
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
103
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>JWTResponse</code>.
104
+ */
105
+ }, {
106
+ key: "validateJSON",
107
+ value: function validateJSON(data) {
108
+ // check to make sure all required properties are present in the JSON string
109
+ var _iterator = _createForOfIteratorHelper(JWTResponse.RequiredProperties),
110
+ _step;
111
+ try {
112
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
113
+ var property = _step.value;
114
+ if (!data.hasOwnProperty(property)) {
115
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
116
+ }
117
+ }
118
+ // ensure the json data is a string
119
+ } catch (err) {
120
+ _iterator.e(err);
121
+ } finally {
122
+ _iterator.f();
123
+ }
124
+ if (data['access_token'] && !(typeof data['access_token'] === 'string' || data['access_token'] instanceof String)) {
125
+ throw new Error("Expected the field `access_token` to be a primitive type in the JSON string but got " + data['access_token']);
126
+ }
127
+ // ensure the json data is a string
128
+ if (data['refresh_token'] && !(typeof data['refresh_token'] === 'string' || data['refresh_token'] instanceof String)) {
129
+ throw new Error("Expected the field `refresh_token` to be a primitive type in the JSON string but got " + data['refresh_token']);
130
+ }
131
+ // ensure the json data is a string
132
+ if (data['token_type'] && !(typeof data['token_type'] === 'string' || data['token_type'] instanceof String)) {
133
+ throw new Error("Expected the field `token_type` to be a primitive type in the JSON string but got " + data['token_type']);
134
+ }
135
+ // ensure the json data is a string
136
+ if (data['organisation'] && !(typeof data['organisation'] === 'string' || data['organisation'] instanceof String)) {
137
+ throw new Error("Expected the field `organisation` to be a primitive type in the JSON string but got " + data['organisation']);
138
+ }
139
+ // ensure the json data is a string
140
+ if (data['organisation_id'] && !(typeof data['organisation_id'] === 'string' || data['organisation_id'] instanceof String)) {
141
+ throw new Error("Expected the field `organisation_id` to be a primitive type in the JSON string but got " + data['organisation_id']);
142
+ }
143
+ return true;
144
+ }
145
+ }]);
146
+ }();
147
+ JWTResponse.RequiredProperties = ["access_token", "refresh_token", "expires_in", "organisation", "organisation_id"];
148
+
149
+ /**
150
+ * JWT access token
151
+ * @member {String} access_token
152
+ */
153
+ JWTResponse.prototype['access_token'] = undefined;
154
+
155
+ /**
156
+ * JWT refresh token
157
+ * @member {String} refresh_token
158
+ */
159
+ JWTResponse.prototype['refresh_token'] = undefined;
160
+
161
+ /**
162
+ * @member {String} token_type
163
+ * @default 'Bearer'
164
+ */
165
+ JWTResponse.prototype['token_type'] = 'Bearer';
166
+
167
+ /**
168
+ * Access token expiration in seconds
169
+ * @member {Number} expires_in
170
+ */
171
+ JWTResponse.prototype['expires_in'] = undefined;
172
+
173
+ /**
174
+ * Organization name
175
+ * @member {String} organisation
176
+ */
177
+ JWTResponse.prototype['organisation'] = undefined;
178
+
179
+ /**
180
+ * Organization ID
181
+ * @member {String} organisation_id
182
+ */
183
+ JWTResponse.prototype['organisation_id'] = undefined;
184
+ var _default = exports["default"] = JWTResponse;
@@ -0,0 +1,221 @@
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 OAuthApplication model module.
31
+ * @module model/OAuthApplication
32
+ * @version 0.0.5
33
+ */
34
+ var OAuthApplication = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>OAuthApplication</code>.
37
+ * Serializer for OAuth application creation requests
38
+ * @alias module:model/OAuthApplication
39
+ * @param name {String} Name for the OAuth application
40
+ */
41
+ function OAuthApplication(name) {
42
+ _classCallCheck(this, OAuthApplication);
43
+ OAuthApplication.initialize(this, name);
44
+ }
45
+
46
+ /**
47
+ * Initializes the fields of this object.
48
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49
+ * Only for internal use.
50
+ */
51
+ return _createClass(OAuthApplication, null, [{
52
+ key: "initialize",
53
+ value: function initialize(obj, name) {
54
+ obj['name'] = name;
55
+ obj['client_type'] = 'confidential';
56
+ obj['authorization_grant_type'] = 'client-credentials';
57
+ }
58
+
59
+ /**
60
+ * Constructs a <code>OAuthApplication</code> from a plain JavaScript object, optionally creating a new instance.
61
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
62
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
63
+ * @param {module:model/OAuthApplication} obj Optional instance to populate.
64
+ * @return {module:model/OAuthApplication} The populated <code>OAuthApplication</code> instance.
65
+ */
66
+ }, {
67
+ key: "constructFromObject",
68
+ value: function constructFromObject(data, obj) {
69
+ if (data) {
70
+ obj = obj || new OAuthApplication();
71
+ if (data.hasOwnProperty('name')) {
72
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
73
+ }
74
+ if (data.hasOwnProperty('client_type')) {
75
+ obj['client_type'] = _ApiClient["default"].convertToType(data['client_type'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('authorization_grant_type')) {
78
+ obj['authorization_grant_type'] = _ApiClient["default"].convertToType(data['authorization_grant_type'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('redirect_uris')) {
81
+ obj['redirect_uris'] = _ApiClient["default"].convertToType(data['redirect_uris'], 'String');
82
+ }
83
+ if (data.hasOwnProperty('division_id')) {
84
+ obj['division_id'] = _ApiClient["default"].convertToType(data['division_id'], 'String');
85
+ }
86
+ }
87
+ return obj;
88
+ }
89
+
90
+ /**
91
+ * Validates the JSON data with respect to <code>OAuthApplication</code>.
92
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
93
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>OAuthApplication</code>.
94
+ */
95
+ }, {
96
+ key: "validateJSON",
97
+ value: function validateJSON(data) {
98
+ // check to make sure all required properties are present in the JSON string
99
+ var _iterator = _createForOfIteratorHelper(OAuthApplication.RequiredProperties),
100
+ _step;
101
+ try {
102
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
103
+ var property = _step.value;
104
+ if (!data.hasOwnProperty(property)) {
105
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
106
+ }
107
+ }
108
+ // ensure the json data is a string
109
+ } catch (err) {
110
+ _iterator.e(err);
111
+ } finally {
112
+ _iterator.f();
113
+ }
114
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
115
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
116
+ }
117
+ // ensure the json data is a string
118
+ if (data['client_type'] && !(typeof data['client_type'] === 'string' || data['client_type'] instanceof String)) {
119
+ throw new Error("Expected the field `client_type` to be a primitive type in the JSON string but got " + data['client_type']);
120
+ }
121
+ // ensure the json data is a string
122
+ if (data['authorization_grant_type'] && !(typeof data['authorization_grant_type'] === 'string' || data['authorization_grant_type'] instanceof String)) {
123
+ throw new Error("Expected the field `authorization_grant_type` to be a primitive type in the JSON string but got " + data['authorization_grant_type']);
124
+ }
125
+ // ensure the json data is a string
126
+ if (data['redirect_uris'] && !(typeof data['redirect_uris'] === 'string' || data['redirect_uris'] instanceof String)) {
127
+ throw new Error("Expected the field `redirect_uris` to be a primitive type in the JSON string but got " + data['redirect_uris']);
128
+ }
129
+ // ensure the json data is a string
130
+ if (data['division_id'] && !(typeof data['division_id'] === 'string' || data['division_id'] instanceof String)) {
131
+ throw new Error("Expected the field `division_id` to be a primitive type in the JSON string but got " + data['division_id']);
132
+ }
133
+ return true;
134
+ }
135
+ }]);
136
+ }();
137
+ OAuthApplication.RequiredProperties = ["name"];
138
+
139
+ /**
140
+ * Name for the OAuth application
141
+ * @member {String} name
142
+ */
143
+ OAuthApplication.prototype['name'] = undefined;
144
+
145
+ /**
146
+ * Client type (confidential recommended for server-to-server) * `confidential` - Confidential * `public` - Public
147
+ * @member {module:model/OAuthApplication.ClientTypeEnum} client_type
148
+ * @default 'confidential'
149
+ */
150
+ OAuthApplication.prototype['client_type'] = 'confidential';
151
+
152
+ /**
153
+ * Grant type (client_credentials for API access) * `authorization-code` - Authorization code * `implicit` - Implicit * `password` - Resource owner password-based * `client-credentials` - Client credentials * `openid-hybrid` - OpenID connect hybrid
154
+ * @member {module:model/OAuthApplication.AuthorizationGrantTypeEnum} authorization_grant_type
155
+ * @default 'client-credentials'
156
+ */
157
+ OAuthApplication.prototype['authorization_grant_type'] = 'client-credentials';
158
+
159
+ /**
160
+ * Space-separated redirect URIs (optional for client_credentials)
161
+ * @member {String} redirect_uris
162
+ */
163
+ OAuthApplication.prototype['redirect_uris'] = undefined;
164
+
165
+ /**
166
+ * Division ID to create application for (optional)
167
+ * @member {String} division_id
168
+ */
169
+ OAuthApplication.prototype['division_id'] = undefined;
170
+
171
+ /**
172
+ * Allowed values for the <code>client_type</code> property.
173
+ * @enum {String}
174
+ * @readonly
175
+ */
176
+ OAuthApplication['ClientTypeEnum'] = {
177
+ /**
178
+ * value: "confidential"
179
+ * @const
180
+ */
181
+ "confidential": "confidential",
182
+ /**
183
+ * value: "public"
184
+ * @const
185
+ */
186
+ "public": "public"
187
+ };
188
+
189
+ /**
190
+ * Allowed values for the <code>authorization_grant_type</code> property.
191
+ * @enum {String}
192
+ * @readonly
193
+ */
194
+ OAuthApplication['AuthorizationGrantTypeEnum'] = {
195
+ /**
196
+ * value: "authorization-code"
197
+ * @const
198
+ */
199
+ "authorization-code": "authorization-code",
200
+ /**
201
+ * value: "implicit"
202
+ * @const
203
+ */
204
+ "implicit": "implicit",
205
+ /**
206
+ * value: "password"
207
+ * @const
208
+ */
209
+ "password": "password",
210
+ /**
211
+ * value: "client-credentials"
212
+ * @const
213
+ */
214
+ "client-credentials": "client-credentials",
215
+ /**
216
+ * value: "openid-hybrid"
217
+ * @const
218
+ */
219
+ "openid-hybrid": "openid-hybrid"
220
+ };
221
+ var _default = exports["default"] = OAuthApplication;
@@ -0,0 +1,252 @@
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 OAuthApplicationResponse model module.
31
+ * @module model/OAuthApplicationResponse
32
+ * @version 0.0.5
33
+ */
34
+ var OAuthApplicationResponse = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>OAuthApplicationResponse</code>.
37
+ * Serializer for OAuth application responses
38
+ * @alias module:model/OAuthApplicationResponse
39
+ * @param id {String}
40
+ * @param clientSecret {String}
41
+ * @param clientType {module:model/OAuthApplicationResponse.ClientTypeEnum} * `confidential` - Confidential * `public` - Public
42
+ * @param authorizationGrantType {module:model/OAuthApplicationResponse.AuthorizationGrantTypeEnum} * `authorization-code` - Authorization code * `implicit` - Implicit * `password` - Resource owner password-based * `client-credentials` - Client credentials * `openid-hybrid` - OpenID connect hybrid
43
+ * @param created {Date}
44
+ * @param updated {Date}
45
+ */
46
+ function OAuthApplicationResponse(id, clientSecret, clientType, authorizationGrantType, created, updated) {
47
+ _classCallCheck(this, OAuthApplicationResponse);
48
+ OAuthApplicationResponse.initialize(this, id, clientSecret, clientType, authorizationGrantType, created, updated);
49
+ }
50
+
51
+ /**
52
+ * Initializes the fields of this object.
53
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
54
+ * Only for internal use.
55
+ */
56
+ return _createClass(OAuthApplicationResponse, null, [{
57
+ key: "initialize",
58
+ value: function initialize(obj, id, clientSecret, clientType, authorizationGrantType, created, updated) {
59
+ obj['id'] = id;
60
+ obj['client_secret'] = clientSecret;
61
+ obj['client_type'] = clientType;
62
+ obj['authorization_grant_type'] = authorizationGrantType;
63
+ obj['created'] = created;
64
+ obj['updated'] = updated;
65
+ }
66
+
67
+ /**
68
+ * Constructs a <code>OAuthApplicationResponse</code> from a plain JavaScript object, optionally creating a new instance.
69
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
70
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
71
+ * @param {module:model/OAuthApplicationResponse} obj Optional instance to populate.
72
+ * @return {module:model/OAuthApplicationResponse} The populated <code>OAuthApplicationResponse</code> instance.
73
+ */
74
+ }, {
75
+ key: "constructFromObject",
76
+ value: function constructFromObject(data, obj) {
77
+ if (data) {
78
+ obj = obj || new OAuthApplicationResponse();
79
+ if (data.hasOwnProperty('id')) {
80
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
81
+ }
82
+ if (data.hasOwnProperty('name')) {
83
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
84
+ }
85
+ if (data.hasOwnProperty('client_id')) {
86
+ obj['client_id'] = _ApiClient["default"].convertToType(data['client_id'], 'String');
87
+ }
88
+ if (data.hasOwnProperty('client_secret')) {
89
+ obj['client_secret'] = _ApiClient["default"].convertToType(data['client_secret'], 'String');
90
+ }
91
+ if (data.hasOwnProperty('client_type')) {
92
+ obj['client_type'] = _ApiClient["default"].convertToType(data['client_type'], 'String');
93
+ }
94
+ if (data.hasOwnProperty('authorization_grant_type')) {
95
+ obj['authorization_grant_type'] = _ApiClient["default"].convertToType(data['authorization_grant_type'], 'String');
96
+ }
97
+ if (data.hasOwnProperty('created')) {
98
+ obj['created'] = _ApiClient["default"].convertToType(data['created'], 'Date');
99
+ }
100
+ if (data.hasOwnProperty('updated')) {
101
+ obj['updated'] = _ApiClient["default"].convertToType(data['updated'], 'Date');
102
+ }
103
+ }
104
+ return obj;
105
+ }
106
+
107
+ /**
108
+ * Validates the JSON data with respect to <code>OAuthApplicationResponse</code>.
109
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
110
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>OAuthApplicationResponse</code>.
111
+ */
112
+ }, {
113
+ key: "validateJSON",
114
+ value: function validateJSON(data) {
115
+ // check to make sure all required properties are present in the JSON string
116
+ var _iterator = _createForOfIteratorHelper(OAuthApplicationResponse.RequiredProperties),
117
+ _step;
118
+ try {
119
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
120
+ var property = _step.value;
121
+ if (!data.hasOwnProperty(property)) {
122
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
123
+ }
124
+ }
125
+ // ensure the json data is a string
126
+ } catch (err) {
127
+ _iterator.e(err);
128
+ } finally {
129
+ _iterator.f();
130
+ }
131
+ if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
132
+ throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
133
+ }
134
+ // ensure the json data is a string
135
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
136
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
137
+ }
138
+ // ensure the json data is a string
139
+ if (data['client_id'] && !(typeof data['client_id'] === 'string' || data['client_id'] instanceof String)) {
140
+ throw new Error("Expected the field `client_id` to be a primitive type in the JSON string but got " + data['client_id']);
141
+ }
142
+ // ensure the json data is a string
143
+ if (data['client_secret'] && !(typeof data['client_secret'] === 'string' || data['client_secret'] instanceof String)) {
144
+ throw new Error("Expected the field `client_secret` to be a primitive type in the JSON string but got " + data['client_secret']);
145
+ }
146
+ // ensure the json data is a string
147
+ if (data['client_type'] && !(typeof data['client_type'] === 'string' || data['client_type'] instanceof String)) {
148
+ throw new Error("Expected the field `client_type` to be a primitive type in the JSON string but got " + data['client_type']);
149
+ }
150
+ // ensure the json data is a string
151
+ if (data['authorization_grant_type'] && !(typeof data['authorization_grant_type'] === 'string' || data['authorization_grant_type'] instanceof String)) {
152
+ throw new Error("Expected the field `authorization_grant_type` to be a primitive type in the JSON string but got " + data['authorization_grant_type']);
153
+ }
154
+ return true;
155
+ }
156
+ }]);
157
+ }();
158
+ OAuthApplicationResponse.RequiredProperties = ["id", "client_secret", "client_type", "authorization_grant_type", "created", "updated"];
159
+
160
+ /**
161
+ * @member {String} id
162
+ */
163
+ OAuthApplicationResponse.prototype['id'] = undefined;
164
+
165
+ /**
166
+ * @member {String} name
167
+ */
168
+ OAuthApplicationResponse.prototype['name'] = undefined;
169
+
170
+ /**
171
+ * @member {String} client_id
172
+ */
173
+ OAuthApplicationResponse.prototype['client_id'] = undefined;
174
+
175
+ /**
176
+ * @member {String} client_secret
177
+ */
178
+ OAuthApplicationResponse.prototype['client_secret'] = undefined;
179
+
180
+ /**
181
+ * * `confidential` - Confidential * `public` - Public
182
+ * @member {module:model/OAuthApplicationResponse.ClientTypeEnum} client_type
183
+ */
184
+ OAuthApplicationResponse.prototype['client_type'] = undefined;
185
+
186
+ /**
187
+ * * `authorization-code` - Authorization code * `implicit` - Implicit * `password` - Resource owner password-based * `client-credentials` - Client credentials * `openid-hybrid` - OpenID connect hybrid
188
+ * @member {module:model/OAuthApplicationResponse.AuthorizationGrantTypeEnum} authorization_grant_type
189
+ */
190
+ OAuthApplicationResponse.prototype['authorization_grant_type'] = undefined;
191
+
192
+ /**
193
+ * @member {Date} created
194
+ */
195
+ OAuthApplicationResponse.prototype['created'] = undefined;
196
+
197
+ /**
198
+ * @member {Date} updated
199
+ */
200
+ OAuthApplicationResponse.prototype['updated'] = undefined;
201
+
202
+ /**
203
+ * Allowed values for the <code>client_type</code> property.
204
+ * @enum {String}
205
+ * @readonly
206
+ */
207
+ OAuthApplicationResponse['ClientTypeEnum'] = {
208
+ /**
209
+ * value: "confidential"
210
+ * @const
211
+ */
212
+ "confidential": "confidential",
213
+ /**
214
+ * value: "public"
215
+ * @const
216
+ */
217
+ "public": "public"
218
+ };
219
+
220
+ /**
221
+ * Allowed values for the <code>authorization_grant_type</code> property.
222
+ * @enum {String}
223
+ * @readonly
224
+ */
225
+ OAuthApplicationResponse['AuthorizationGrantTypeEnum'] = {
226
+ /**
227
+ * value: "authorization-code"
228
+ * @const
229
+ */
230
+ "authorization-code": "authorization-code",
231
+ /**
232
+ * value: "implicit"
233
+ * @const
234
+ */
235
+ "implicit": "implicit",
236
+ /**
237
+ * value: "password"
238
+ * @const
239
+ */
240
+ "password": "password",
241
+ /**
242
+ * value: "client-credentials"
243
+ * @const
244
+ */
245
+ "client-credentials": "client-credentials",
246
+ /**
247
+ * value: "openid-hybrid"
248
+ * @const
249
+ */
250
+ "openid-hybrid": "openid-hybrid"
251
+ };
252
+ var _default = exports["default"] = OAuthApplicationResponse;