@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,153 @@
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 _OAuthApplication = _interopRequireDefault(require("../model/OAuthApplication"));
9
+ var _OAuthApplicationResponse = _interopRequireDefault(require("../model/OAuthApplicationResponse"));
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13
+ 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); } }
14
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16
+ 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); } /**
17
+ * Pescheck API
18
+ * 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.
19
+ *
20
+ * The version of the OpenAPI document: 2.0.0
21
+ *
22
+ *
23
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24
+ * https://openapi-generator.tech
25
+ * Do not edit the class manually.
26
+ *
27
+ */
28
+ /**
29
+ * OAuth service.
30
+ * @module api/OAuthApi
31
+ * @version 0.0.5
32
+ */
33
+ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
34
+ /**
35
+ * Constructs a new OAuthApi.
36
+ * @alias module:api/OAuthApi
37
+ * @class
38
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
39
+ * default to {@link module:ApiClient#instance} if unspecified.
40
+ */
41
+ function OAuthApi(apiClient) {
42
+ _classCallCheck(this, OAuthApi);
43
+ this.apiClient = apiClient || _ApiClient["default"].instance;
44
+ }
45
+
46
+ /**
47
+ * Create OAuth application for API access
48
+ * @param {module:model/OAuthApplication} oAuthApplication
49
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OAuthApplicationResponse} and HTTP response
50
+ */
51
+ return _createClass(OAuthApi, [{
52
+ key: "createOAuthApplication2WithHttpInfo",
53
+ value: function createOAuthApplication2WithHttpInfo(oAuthApplication) {
54
+ var postBody = oAuthApplication;
55
+ // verify the required parameter 'oAuthApplication' is set
56
+ if (oAuthApplication === undefined || oAuthApplication === null) {
57
+ throw new Error("Missing the required parameter 'oAuthApplication' when calling createOAuthApplication2");
58
+ }
59
+ var pathParams = {};
60
+ var queryParams = {};
61
+ var headerParams = {};
62
+ var formParams = {};
63
+ var authNames = ['oauth2'];
64
+ var contentTypes = ['application/json', 'multipart/form-data'];
65
+ var accepts = ['application/json'];
66
+ var returnType = _OAuthApplicationResponse["default"];
67
+ return this.apiClient.callApi('/api/v2/oauth/applications/', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
68
+ }
69
+
70
+ /**
71
+ * Create OAuth application for API access
72
+ * @param {module:model/OAuthApplication} oAuthApplication
73
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OAuthApplicationResponse}
74
+ */
75
+ }, {
76
+ key: "createOAuthApplication2",
77
+ value: function createOAuthApplication2(oAuthApplication) {
78
+ return this.createOAuthApplication2WithHttpInfo(oAuthApplication).then(function (response_and_data) {
79
+ return response_and_data.data;
80
+ });
81
+ }
82
+
83
+ /**
84
+ * Delete an OAuth application
85
+ * @param {String} applicationId Application ID to delete
86
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
87
+ */
88
+ }, {
89
+ key: "deleteOAuthApplication2WithHttpInfo",
90
+ value: function deleteOAuthApplication2WithHttpInfo(applicationId) {
91
+ var postBody = null;
92
+ // verify the required parameter 'applicationId' is set
93
+ if (applicationId === undefined || applicationId === null) {
94
+ throw new Error("Missing the required parameter 'applicationId' when calling deleteOAuthApplication2");
95
+ }
96
+ var pathParams = {
97
+ 'application_id': applicationId
98
+ };
99
+ var queryParams = {};
100
+ var headerParams = {};
101
+ var formParams = {};
102
+ var authNames = ['oauth2'];
103
+ var contentTypes = [];
104
+ var accepts = [];
105
+ var returnType = null;
106
+ return this.apiClient.callApi('/api/v2/oauth/applications/{application_id}/', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
107
+ }
108
+
109
+ /**
110
+ * Delete an OAuth application
111
+ * @param {String} applicationId Application ID to delete
112
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
113
+ */
114
+ }, {
115
+ key: "deleteOAuthApplication2",
116
+ value: function deleteOAuthApplication2(applicationId) {
117
+ return this.deleteOAuthApplication2WithHttpInfo(applicationId).then(function (response_and_data) {
118
+ return response_and_data.data;
119
+ });
120
+ }
121
+
122
+ /**
123
+ * List OAuth applications for the organization
124
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/OAuthApplicationResponse>} and HTTP response
125
+ */
126
+ }, {
127
+ key: "listOAuthApplications2WithHttpInfo",
128
+ value: function listOAuthApplications2WithHttpInfo() {
129
+ var postBody = null;
130
+ var pathParams = {};
131
+ var queryParams = {};
132
+ var headerParams = {};
133
+ var formParams = {};
134
+ var authNames = ['oauth2'];
135
+ var contentTypes = [];
136
+ var accepts = ['application/json'];
137
+ var returnType = [_OAuthApplicationResponse["default"]];
138
+ return this.apiClient.callApi('/api/v2/oauth/applications/list/', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
139
+ }
140
+
141
+ /**
142
+ * List OAuth applications for the organization
143
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/OAuthApplicationResponse>}
144
+ */
145
+ }, {
146
+ key: "listOAuthApplications2",
147
+ value: function listOAuthApplications2() {
148
+ return this.listOAuthApplications2WithHttpInfo().then(function (response_and_data) {
149
+ return response_and_data.data;
150
+ });
151
+ }
152
+ }]);
153
+ }();
@@ -0,0 +1,301 @@
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 _PaginatedV2ProfileListItemList = _interopRequireDefault(require("../model/PaginatedV2ProfileListItemList"));
9
+ var _PatchedV2ProfilePartialUpdate = _interopRequireDefault(require("../model/PatchedV2ProfilePartialUpdate"));
10
+ var _V2ProfileCreate = _interopRequireDefault(require("../model/V2ProfileCreate"));
11
+ var _V2ProfileDetail = _interopRequireDefault(require("../model/V2ProfileDetail"));
12
+ var _V2ProfileUpdate = _interopRequireDefault(require("../model/V2ProfileUpdate"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
14
+ 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); }
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
+ * Profiles service.
33
+ * @module api/ProfilesApi
34
+ * @version 0.0.5
35
+ */
36
+ var ProfilesApi = exports["default"] = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new ProfilesApi.
39
+ * @alias module:api/ProfilesApi
40
+ * @class
41
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
42
+ * default to {@link module:ApiClient#instance} if unspecified.
43
+ */
44
+ function ProfilesApi(apiClient) {
45
+ _classCallCheck(this, ProfilesApi);
46
+ this.apiClient = apiClient || _ApiClient["default"].instance;
47
+ }
48
+
49
+ /**
50
+ * @param {module:model/V2ProfileCreate} v2ProfileCreate
51
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/V2ProfileDetail} and HTTP response
52
+ */
53
+ return _createClass(ProfilesApi, [{
54
+ key: "v2ProfilesCreateWithHttpInfo",
55
+ value: function v2ProfilesCreateWithHttpInfo(v2ProfileCreate) {
56
+ var postBody = v2ProfileCreate;
57
+ // verify the required parameter 'v2ProfileCreate' is set
58
+ if (v2ProfileCreate === undefined || v2ProfileCreate === null) {
59
+ throw new Error("Missing the required parameter 'v2ProfileCreate' when calling v2ProfilesCreate");
60
+ }
61
+ var pathParams = {};
62
+ var queryParams = {};
63
+ var headerParams = {};
64
+ var formParams = {};
65
+ var authNames = ['oauth2'];
66
+ var contentTypes = ['application/json', 'multipart/form-data'];
67
+ var accepts = ['application/json'];
68
+ var returnType = _V2ProfileDetail["default"];
69
+ return this.apiClient.callApi('/api/v2/profiles/', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
70
+ }
71
+
72
+ /**
73
+ * @param {module:model/V2ProfileCreate} v2ProfileCreate
74
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/V2ProfileDetail}
75
+ */
76
+ }, {
77
+ key: "v2ProfilesCreate",
78
+ value: function v2ProfilesCreate(v2ProfileCreate) {
79
+ return this.v2ProfilesCreateWithHttpInfo(v2ProfileCreate).then(function (response_and_data) {
80
+ return response_and_data.data;
81
+ });
82
+ }
83
+
84
+ /**
85
+ * @param {String} id A UUID string identifying this profile.
86
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
87
+ */
88
+ }, {
89
+ key: "v2ProfilesDestroyWithHttpInfo",
90
+ value: function v2ProfilesDestroyWithHttpInfo(id) {
91
+ var postBody = null;
92
+ // verify the required parameter 'id' is set
93
+ if (id === undefined || id === null) {
94
+ throw new Error("Missing the required parameter 'id' when calling v2ProfilesDestroy");
95
+ }
96
+ var pathParams = {
97
+ 'id': id
98
+ };
99
+ var queryParams = {};
100
+ var headerParams = {};
101
+ var formParams = {};
102
+ var authNames = ['oauth2'];
103
+ var contentTypes = [];
104
+ var accepts = [];
105
+ var returnType = null;
106
+ return this.apiClient.callApi('/api/v2/profiles/{id}/', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
107
+ }
108
+
109
+ /**
110
+ * @param {String} id A UUID string identifying this profile.
111
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
112
+ */
113
+ }, {
114
+ key: "v2ProfilesDestroy",
115
+ value: function v2ProfilesDestroy(id) {
116
+ return this.v2ProfilesDestroyWithHttpInfo(id).then(function (response_and_data) {
117
+ return response_and_data.data;
118
+ });
119
+ }
120
+
121
+ /**
122
+ * @param {Object} opts Optional parameters
123
+ * @param {module:model/String} [checkType] Restrict to profiles containing at least one check of this type.
124
+ * @param {Boolean} [isCustom] Restrict to custom (true) or system (false) profiles.
125
+ * @param {String} [name] Restrict to profiles whose name contains this value (case-insensitive).
126
+ * @param {Number} [page = 1)] A page number within the paginated result set.
127
+ * @param {Number} [pageSize = 50)] Number of results to return per page.
128
+ * @param {Boolean} [paginate = true)] Enable/disable pagination. When false, max 500 records returned.
129
+ * @param {String} [sort] Which field to use when ordering the results.
130
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/PaginatedV2ProfileListItemList} and HTTP response
131
+ */
132
+ }, {
133
+ key: "v2ProfilesListWithHttpInfo",
134
+ value: function v2ProfilesListWithHttpInfo(opts) {
135
+ opts = opts || {};
136
+ var postBody = null;
137
+ var pathParams = {};
138
+ var queryParams = {
139
+ 'check_type': opts['checkType'],
140
+ 'is_custom': opts['isCustom'],
141
+ 'name': opts['name'],
142
+ 'page': opts['page'],
143
+ 'page_size': opts['pageSize'],
144
+ 'paginate': opts['paginate'],
145
+ 'sort': opts['sort']
146
+ };
147
+ var headerParams = {};
148
+ var formParams = {};
149
+ var authNames = ['oauth2'];
150
+ var contentTypes = [];
151
+ var accepts = ['application/json'];
152
+ var returnType = _PaginatedV2ProfileListItemList["default"];
153
+ return this.apiClient.callApi('/api/v2/profiles/', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
154
+ }
155
+
156
+ /**
157
+ * @param {Object} opts Optional parameters
158
+ * @param {module:model/String} opts.checkType Restrict to profiles containing at least one check of this type.
159
+ * @param {Boolean} opts.isCustom Restrict to custom (true) or system (false) profiles.
160
+ * @param {String} opts.name Restrict to profiles whose name contains this value (case-insensitive).
161
+ * @param {Number} opts.page A page number within the paginated result set. (default to 1)
162
+ * @param {Number} opts.pageSize Number of results to return per page. (default to 50)
163
+ * @param {Boolean} opts.paginate Enable/disable pagination. When false, max 500 records returned. (default to true)
164
+ * @param {String} opts.sort Which field to use when ordering the results.
165
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PaginatedV2ProfileListItemList}
166
+ */
167
+ }, {
168
+ key: "v2ProfilesList",
169
+ value: function v2ProfilesList(opts) {
170
+ return this.v2ProfilesListWithHttpInfo(opts).then(function (response_and_data) {
171
+ return response_and_data.data;
172
+ });
173
+ }
174
+
175
+ /**
176
+ * Update name and/or description only. Use PUT to change the check list.
177
+ * @param {String} id A UUID string identifying this profile.
178
+ * @param {Object} opts Optional parameters
179
+ * @param {module:model/PatchedV2ProfilePartialUpdate} [patchedV2ProfilePartialUpdate]
180
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/V2ProfileDetail} and HTTP response
181
+ */
182
+ }, {
183
+ key: "v2ProfilesPartialUpdateWithHttpInfo",
184
+ value: function v2ProfilesPartialUpdateWithHttpInfo(id, opts) {
185
+ opts = opts || {};
186
+ var postBody = opts['patchedV2ProfilePartialUpdate'];
187
+ // verify the required parameter 'id' is set
188
+ if (id === undefined || id === null) {
189
+ throw new Error("Missing the required parameter 'id' when calling v2ProfilesPartialUpdate");
190
+ }
191
+ var pathParams = {
192
+ 'id': id
193
+ };
194
+ var queryParams = {};
195
+ var headerParams = {};
196
+ var formParams = {};
197
+ var authNames = ['oauth2'];
198
+ var contentTypes = ['application/json', 'multipart/form-data'];
199
+ var accepts = ['application/json'];
200
+ var returnType = _V2ProfileDetail["default"];
201
+ return this.apiClient.callApi('/api/v2/profiles/{id}/', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
202
+ }
203
+
204
+ /**
205
+ * Update name and/or description only. Use PUT to change the check list.
206
+ * @param {String} id A UUID string identifying this profile.
207
+ * @param {Object} opts Optional parameters
208
+ * @param {module:model/PatchedV2ProfilePartialUpdate} opts.patchedV2ProfilePartialUpdate
209
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/V2ProfileDetail}
210
+ */
211
+ }, {
212
+ key: "v2ProfilesPartialUpdate",
213
+ value: function v2ProfilesPartialUpdate(id, opts) {
214
+ return this.v2ProfilesPartialUpdateWithHttpInfo(id, opts).then(function (response_and_data) {
215
+ return response_and_data.data;
216
+ });
217
+ }
218
+
219
+ /**
220
+ * @param {String} id A UUID string identifying this profile.
221
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/V2ProfileDetail} and HTTP response
222
+ */
223
+ }, {
224
+ key: "v2ProfilesRetrieveWithHttpInfo",
225
+ value: function v2ProfilesRetrieveWithHttpInfo(id) {
226
+ var postBody = null;
227
+ // verify the required parameter 'id' is set
228
+ if (id === undefined || id === null) {
229
+ throw new Error("Missing the required parameter 'id' when calling v2ProfilesRetrieve");
230
+ }
231
+ var pathParams = {
232
+ 'id': id
233
+ };
234
+ var queryParams = {};
235
+ var headerParams = {};
236
+ var formParams = {};
237
+ var authNames = ['oauth2'];
238
+ var contentTypes = [];
239
+ var accepts = ['application/json'];
240
+ var returnType = _V2ProfileDetail["default"];
241
+ return this.apiClient.callApi('/api/v2/profiles/{id}/', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
242
+ }
243
+
244
+ /**
245
+ * @param {String} id A UUID string identifying this profile.
246
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/V2ProfileDetail}
247
+ */
248
+ }, {
249
+ key: "v2ProfilesRetrieve",
250
+ value: function v2ProfilesRetrieve(id) {
251
+ return this.v2ProfilesRetrieveWithHttpInfo(id).then(function (response_and_data) {
252
+ return response_and_data.data;
253
+ });
254
+ }
255
+
256
+ /**
257
+ * Replace the profile. Checks matched by profile_check_id are updated in place; entries without one are added; existing checks not referenced in the request are removed.
258
+ * @param {String} id A UUID string identifying this profile.
259
+ * @param {module:model/V2ProfileUpdate} v2ProfileUpdate
260
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/V2ProfileDetail} and HTTP response
261
+ */
262
+ }, {
263
+ key: "v2ProfilesUpdateWithHttpInfo",
264
+ value: function v2ProfilesUpdateWithHttpInfo(id, v2ProfileUpdate) {
265
+ var postBody = v2ProfileUpdate;
266
+ // verify the required parameter 'id' is set
267
+ if (id === undefined || id === null) {
268
+ throw new Error("Missing the required parameter 'id' when calling v2ProfilesUpdate");
269
+ }
270
+ // verify the required parameter 'v2ProfileUpdate' is set
271
+ if (v2ProfileUpdate === undefined || v2ProfileUpdate === null) {
272
+ throw new Error("Missing the required parameter 'v2ProfileUpdate' when calling v2ProfilesUpdate");
273
+ }
274
+ var pathParams = {
275
+ 'id': id
276
+ };
277
+ var queryParams = {};
278
+ var headerParams = {};
279
+ var formParams = {};
280
+ var authNames = ['oauth2'];
281
+ var contentTypes = ['application/json', 'multipart/form-data'];
282
+ var accepts = ['application/json'];
283
+ var returnType = _V2ProfileDetail["default"];
284
+ return this.apiClient.callApi('/api/v2/profiles/{id}/', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
285
+ }
286
+
287
+ /**
288
+ * Replace the profile. Checks matched by profile_check_id are updated in place; entries without one are added; existing checks not referenced in the request are removed.
289
+ * @param {String} id A UUID string identifying this profile.
290
+ * @param {module:model/V2ProfileUpdate} v2ProfileUpdate
291
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/V2ProfileDetail}
292
+ */
293
+ }, {
294
+ key: "v2ProfilesUpdate",
295
+ value: function v2ProfilesUpdate(id, v2ProfileUpdate) {
296
+ return this.v2ProfilesUpdateWithHttpInfo(id, v2ProfileUpdate).then(function (response_and_data) {
297
+ return response_and_data.data;
298
+ });
299
+ }
300
+ }]);
301
+ }();
@@ -0,0 +1,213 @@
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 _PaginatedV2ScreeningListItemList = _interopRequireDefault(require("../model/PaginatedV2ScreeningListItemList"));
9
+ var _V2Document = _interopRequireDefault(require("../model/V2Document"));
10
+ var _V2ScreeningCreate = _interopRequireDefault(require("../model/V2ScreeningCreate"));
11
+ var _V2ScreeningDetail = _interopRequireDefault(require("../model/V2ScreeningDetail"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
+ 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); }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ 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); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ 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); } /**
19
+ * Pescheck API
20
+ * 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.
21
+ *
22
+ * The version of the OpenAPI document: 2.0.0
23
+ *
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * Screenings service.
32
+ * @module api/ScreeningsApi
33
+ * @version 0.0.5
34
+ */
35
+ var ScreeningsApi = exports["default"] = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new ScreeningsApi.
38
+ * @alias module:api/ScreeningsApi
39
+ * @class
40
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
41
+ * default to {@link module:ApiClient#instance} if unspecified.
42
+ */
43
+ function ScreeningsApi(apiClient) {
44
+ _classCallCheck(this, ScreeningsApi);
45
+ this.apiClient = apiClient || _ApiClient["default"].instance;
46
+ }
47
+
48
+ /**
49
+ * @param {module:model/V2ScreeningCreate} v2ScreeningCreate
50
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/V2ScreeningDetail} and HTTP response
51
+ */
52
+ return _createClass(ScreeningsApi, [{
53
+ key: "v2ScreeningsCreateWithHttpInfo",
54
+ value: function v2ScreeningsCreateWithHttpInfo(v2ScreeningCreate) {
55
+ var postBody = v2ScreeningCreate;
56
+ // verify the required parameter 'v2ScreeningCreate' is set
57
+ if (v2ScreeningCreate === undefined || v2ScreeningCreate === null) {
58
+ throw new Error("Missing the required parameter 'v2ScreeningCreate' when calling v2ScreeningsCreate");
59
+ }
60
+ var pathParams = {};
61
+ var queryParams = {};
62
+ var headerParams = {};
63
+ var formParams = {};
64
+ var authNames = ['oauth2'];
65
+ var contentTypes = ['application/json', 'multipart/form-data'];
66
+ var accepts = ['application/json'];
67
+ var returnType = _V2ScreeningDetail["default"];
68
+ return this.apiClient.callApi('/api/v2/screenings/', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
69
+ }
70
+
71
+ /**
72
+ * @param {module:model/V2ScreeningCreate} v2ScreeningCreate
73
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/V2ScreeningDetail}
74
+ */
75
+ }, {
76
+ key: "v2ScreeningsCreate",
77
+ value: function v2ScreeningsCreate(v2ScreeningCreate) {
78
+ return this.v2ScreeningsCreateWithHttpInfo(v2ScreeningCreate).then(function (response_and_data) {
79
+ return response_and_data.data;
80
+ });
81
+ }
82
+
83
+ /**
84
+ * Retrieve screening documents
85
+ * Documents attached to the screening's checks. Files are delivered inline as Base64 in `content`. Narrow the result with `check_id` or `check_type`.
86
+ * @param {String} id
87
+ * @param {Object} opts Optional parameters
88
+ * @param {String} [checkId] Only documents from the check with this id.
89
+ * @param {String} [checkType] Only documents from checks of this type.
90
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/V2Document>} and HTTP response
91
+ */
92
+ }, {
93
+ key: "v2ScreeningsDocumentsListWithHttpInfo",
94
+ value: function v2ScreeningsDocumentsListWithHttpInfo(id, opts) {
95
+ opts = opts || {};
96
+ var postBody = null;
97
+ // verify the required parameter 'id' is set
98
+ if (id === undefined || id === null) {
99
+ throw new Error("Missing the required parameter 'id' when calling v2ScreeningsDocumentsList");
100
+ }
101
+ var pathParams = {
102
+ 'id': id
103
+ };
104
+ var queryParams = {
105
+ 'check_id': opts['checkId'],
106
+ 'check_type': opts['checkType']
107
+ };
108
+ var headerParams = {};
109
+ var formParams = {};
110
+ var authNames = ['oauth2'];
111
+ var contentTypes = [];
112
+ var accepts = ['application/json'];
113
+ var returnType = [_V2Document["default"]];
114
+ return this.apiClient.callApi('/api/v2/screenings/{id}/documents/', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
115
+ }
116
+
117
+ /**
118
+ * Retrieve screening documents
119
+ * Documents attached to the screening's checks. Files are delivered inline as Base64 in `content`. Narrow the result with `check_id` or `check_type`.
120
+ * @param {String} id
121
+ * @param {Object} opts Optional parameters
122
+ * @param {String} opts.checkId Only documents from the check with this id.
123
+ * @param {String} opts.checkType Only documents from checks of this type.
124
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/V2Document>}
125
+ */
126
+ }, {
127
+ key: "v2ScreeningsDocumentsList",
128
+ value: function v2ScreeningsDocumentsList(id, opts) {
129
+ return this.v2ScreeningsDocumentsListWithHttpInfo(id, opts).then(function (response_and_data) {
130
+ return response_and_data.data;
131
+ });
132
+ }
133
+
134
+ /**
135
+ * @param {Object} opts Optional parameters
136
+ * @param {Number} [page = 1)] A page number within the paginated result set.
137
+ * @param {Number} [pageSize = 50)] Number of results to return per page.
138
+ * @param {Boolean} [paginate = true)] Enable/disable pagination. When false, max 500 records returned.
139
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/PaginatedV2ScreeningListItemList} and HTTP response
140
+ */
141
+ }, {
142
+ key: "v2ScreeningsListWithHttpInfo",
143
+ value: function v2ScreeningsListWithHttpInfo(opts) {
144
+ opts = opts || {};
145
+ var postBody = null;
146
+ var pathParams = {};
147
+ var queryParams = {
148
+ 'page': opts['page'],
149
+ 'page_size': opts['pageSize'],
150
+ 'paginate': opts['paginate']
151
+ };
152
+ var headerParams = {};
153
+ var formParams = {};
154
+ var authNames = ['oauth2'];
155
+ var contentTypes = [];
156
+ var accepts = ['application/json'];
157
+ var returnType = _PaginatedV2ScreeningListItemList["default"];
158
+ return this.apiClient.callApi('/api/v2/screenings/', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
159
+ }
160
+
161
+ /**
162
+ * @param {Object} opts Optional parameters
163
+ * @param {Number} opts.page A page number within the paginated result set. (default to 1)
164
+ * @param {Number} opts.pageSize Number of results to return per page. (default to 50)
165
+ * @param {Boolean} opts.paginate Enable/disable pagination. When false, max 500 records returned. (default to true)
166
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PaginatedV2ScreeningListItemList}
167
+ */
168
+ }, {
169
+ key: "v2ScreeningsList",
170
+ value: function v2ScreeningsList(opts) {
171
+ return this.v2ScreeningsListWithHttpInfo(opts).then(function (response_and_data) {
172
+ return response_and_data.data;
173
+ });
174
+ }
175
+
176
+ /**
177
+ * @param {String} id A UUID string identifying this screening.
178
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/V2ScreeningDetail} and HTTP response
179
+ */
180
+ }, {
181
+ key: "v2ScreeningsRetrieveWithHttpInfo",
182
+ value: function v2ScreeningsRetrieveWithHttpInfo(id) {
183
+ var postBody = null;
184
+ // verify the required parameter 'id' is set
185
+ if (id === undefined || id === null) {
186
+ throw new Error("Missing the required parameter 'id' when calling v2ScreeningsRetrieve");
187
+ }
188
+ var pathParams = {
189
+ 'id': id
190
+ };
191
+ var queryParams = {};
192
+ var headerParams = {};
193
+ var formParams = {};
194
+ var authNames = ['oauth2'];
195
+ var contentTypes = [];
196
+ var accepts = ['application/json'];
197
+ var returnType = _V2ScreeningDetail["default"];
198
+ return this.apiClient.callApi('/api/v2/screenings/{id}/', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
199
+ }
200
+
201
+ /**
202
+ * @param {String} id A UUID string identifying this screening.
203
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/V2ScreeningDetail}
204
+ */
205
+ }, {
206
+ key: "v2ScreeningsRetrieve",
207
+ value: function v2ScreeningsRetrieve(id) {
208
+ return this.v2ScreeningsRetrieveWithHttpInfo(id).then(function (response_and_data) {
209
+ return response_and_data.data;
210
+ });
211
+ }
212
+ }]);
213
+ }();