@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,159 @@
|
|
|
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 _CustomTokenObtainPair = _interopRequireDefault(require("../model/CustomTokenObtainPair"));
|
|
9
|
+
var _JWTGeneration = _interopRequireDefault(require("../model/JWTGeneration"));
|
|
10
|
+
var _JWTResponse = _interopRequireDefault(require("../model/JWTResponse"));
|
|
11
|
+
var _TokenRefresh = _interopRequireDefault(require("../model/TokenRefresh"));
|
|
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
|
+
* Authentication service.
|
|
32
|
+
* @module api/AuthenticationApi
|
|
33
|
+
* @version 0.0.5
|
|
34
|
+
*/
|
|
35
|
+
var AuthenticationApi = exports["default"] = /*#__PURE__*/function () {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new AuthenticationApi.
|
|
38
|
+
* @alias module:api/AuthenticationApi
|
|
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 AuthenticationApi(apiClient) {
|
|
44
|
+
_classCallCheck(this, AuthenticationApi);
|
|
45
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Log in with email + password. Returns a JWT pair scoped to the organization or division specified by organisation_id/division_id (defaults to your current org). For a plain login, use POST /api/jwt/.
|
|
50
|
+
* @param {module:model/JWTGeneration} jWTGeneration
|
|
51
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/JWTResponse} and HTTP response
|
|
52
|
+
*/
|
|
53
|
+
return _createClass(AuthenticationApi, [{
|
|
54
|
+
key: "generateJWTToken2WithHttpInfo",
|
|
55
|
+
value: function generateJWTToken2WithHttpInfo(jWTGeneration) {
|
|
56
|
+
var postBody = jWTGeneration;
|
|
57
|
+
// verify the required parameter 'jWTGeneration' is set
|
|
58
|
+
if (jWTGeneration === undefined || jWTGeneration === null) {
|
|
59
|
+
throw new Error("Missing the required parameter 'jWTGeneration' when calling generateJWTToken2");
|
|
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 = _JWTResponse["default"];
|
|
69
|
+
return this.apiClient.callApi('/api/v2/jwt/generate/', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Log in with email + password. Returns a JWT pair scoped to the organization or division specified by organisation_id/division_id (defaults to your current org). For a plain login, use POST /api/jwt/.
|
|
74
|
+
* @param {module:model/JWTGeneration} jWTGeneration
|
|
75
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/JWTResponse}
|
|
76
|
+
*/
|
|
77
|
+
}, {
|
|
78
|
+
key: "generateJWTToken2",
|
|
79
|
+
value: function generateJWTToken2(jWTGeneration) {
|
|
80
|
+
return this.generateJWTToken2WithHttpInfo(jWTGeneration).then(function (response_and_data) {
|
|
81
|
+
return response_and_data.data;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Log in with email + password. Returns a JWT pair scoped to your current organization (last viewed, or first available). For a token scoped to a specific org or division, use POST /api/v2/jwt/generate/.
|
|
87
|
+
* @param {module:model/CustomTokenObtainPair} customTokenObtainPair
|
|
88
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CustomTokenObtainPair} and HTTP response
|
|
89
|
+
*/
|
|
90
|
+
}, {
|
|
91
|
+
key: "jwtCreateWithHttpInfo",
|
|
92
|
+
value: function jwtCreateWithHttpInfo(customTokenObtainPair) {
|
|
93
|
+
var postBody = customTokenObtainPair;
|
|
94
|
+
// verify the required parameter 'customTokenObtainPair' is set
|
|
95
|
+
if (customTokenObtainPair === undefined || customTokenObtainPair === null) {
|
|
96
|
+
throw new Error("Missing the required parameter 'customTokenObtainPair' when calling jwtCreate");
|
|
97
|
+
}
|
|
98
|
+
var pathParams = {};
|
|
99
|
+
var queryParams = {};
|
|
100
|
+
var headerParams = {};
|
|
101
|
+
var formParams = {};
|
|
102
|
+
var authNames = ['oauth2'];
|
|
103
|
+
var contentTypes = ['application/json', 'multipart/form-data'];
|
|
104
|
+
var accepts = ['application/json'];
|
|
105
|
+
var returnType = _CustomTokenObtainPair["default"];
|
|
106
|
+
return this.apiClient.callApi('/api/jwt/', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Log in with email + password. Returns a JWT pair scoped to your current organization (last viewed, or first available). For a token scoped to a specific org or division, use POST /api/v2/jwt/generate/.
|
|
111
|
+
* @param {module:model/CustomTokenObtainPair} customTokenObtainPair
|
|
112
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CustomTokenObtainPair}
|
|
113
|
+
*/
|
|
114
|
+
}, {
|
|
115
|
+
key: "jwtCreate",
|
|
116
|
+
value: function jwtCreate(customTokenObtainPair) {
|
|
117
|
+
return this.jwtCreateWithHttpInfo(customTokenObtainPair).then(function (response_and_data) {
|
|
118
|
+
return response_and_data.data;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
124
|
+
* @param {module:model/TokenRefresh} tokenRefresh
|
|
125
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TokenRefresh} and HTTP response
|
|
126
|
+
*/
|
|
127
|
+
}, {
|
|
128
|
+
key: "jwtRefreshCreateWithHttpInfo",
|
|
129
|
+
value: function jwtRefreshCreateWithHttpInfo(tokenRefresh) {
|
|
130
|
+
var postBody = tokenRefresh;
|
|
131
|
+
// verify the required parameter 'tokenRefresh' is set
|
|
132
|
+
if (tokenRefresh === undefined || tokenRefresh === null) {
|
|
133
|
+
throw new Error("Missing the required parameter 'tokenRefresh' when calling jwtRefreshCreate");
|
|
134
|
+
}
|
|
135
|
+
var pathParams = {};
|
|
136
|
+
var queryParams = {};
|
|
137
|
+
var headerParams = {};
|
|
138
|
+
var formParams = {};
|
|
139
|
+
var authNames = ['oauth2'];
|
|
140
|
+
var contentTypes = ['application/json', 'multipart/form-data'];
|
|
141
|
+
var accepts = ['application/json'];
|
|
142
|
+
var returnType = _TokenRefresh["default"];
|
|
143
|
+
return this.apiClient.callApi('/api/jwt/refresh/', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
148
|
+
* @param {module:model/TokenRefresh} tokenRefresh
|
|
149
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TokenRefresh}
|
|
150
|
+
*/
|
|
151
|
+
}, {
|
|
152
|
+
key: "jwtRefreshCreate",
|
|
153
|
+
value: function jwtRefreshCreate(tokenRefresh) {
|
|
154
|
+
return this.jwtRefreshCreateWithHttpInfo(tokenRefresh).then(function (response_and_data) {
|
|
155
|
+
return response_and_data.data;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}]);
|
|
159
|
+
}();
|
|
@@ -0,0 +1,120 @@
|
|
|
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 _V2CheckInfo = _interopRequireDefault(require("../model/V2CheckInfo"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
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); }
|
|
11
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
12
|
+
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); } }
|
|
13
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
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); } /**
|
|
16
|
+
* Pescheck API
|
|
17
|
+
* 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.
|
|
18
|
+
*
|
|
19
|
+
* The version of the OpenAPI document: 2.0.0
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
23
|
+
* https://openapi-generator.tech
|
|
24
|
+
* Do not edit the class manually.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Checks service.
|
|
29
|
+
* @module api/ChecksApi
|
|
30
|
+
* @version 0.0.5
|
|
31
|
+
*/
|
|
32
|
+
var ChecksApi = exports["default"] = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new ChecksApi.
|
|
35
|
+
* @alias module:api/ChecksApi
|
|
36
|
+
* @class
|
|
37
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
|
38
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
|
39
|
+
*/
|
|
40
|
+
function ChecksApi(apiClient) {
|
|
41
|
+
_classCallCheck(this, ChecksApi);
|
|
42
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* List the check types this API supports. The list is bounded metadata about the available check types (not a paginated collection), so the response is a flat array.
|
|
47
|
+
* @param {Object} opts Optional parameters
|
|
48
|
+
* @param {String} [checkType] Restrict the list to a single check type.
|
|
49
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/V2CheckInfo>} and HTTP response
|
|
50
|
+
*/
|
|
51
|
+
return _createClass(ChecksApi, [{
|
|
52
|
+
key: "v2ChecksListWithHttpInfo",
|
|
53
|
+
value: function v2ChecksListWithHttpInfo(opts) {
|
|
54
|
+
opts = opts || {};
|
|
55
|
+
var postBody = null;
|
|
56
|
+
var pathParams = {};
|
|
57
|
+
var queryParams = {
|
|
58
|
+
'check_type': opts['checkType']
|
|
59
|
+
};
|
|
60
|
+
var headerParams = {};
|
|
61
|
+
var formParams = {};
|
|
62
|
+
var authNames = ['oauth2'];
|
|
63
|
+
var contentTypes = [];
|
|
64
|
+
var accepts = ['application/json'];
|
|
65
|
+
var returnType = [_V2CheckInfo["default"]];
|
|
66
|
+
return this.apiClient.callApi('/api/v2/checks/', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* List the check types this API supports. The list is bounded metadata about the available check types (not a paginated collection), so the response is a flat array.
|
|
71
|
+
* @param {Object} opts Optional parameters
|
|
72
|
+
* @param {String} opts.checkType Restrict the list to a single check type.
|
|
73
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/V2CheckInfo>}
|
|
74
|
+
*/
|
|
75
|
+
}, {
|
|
76
|
+
key: "v2ChecksList",
|
|
77
|
+
value: function v2ChecksList(opts) {
|
|
78
|
+
return this.v2ChecksListWithHttpInfo(opts).then(function (response_and_data) {
|
|
79
|
+
return response_and_data.data;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @param {String} checkType
|
|
85
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/V2CheckInfo} and HTTP response
|
|
86
|
+
*/
|
|
87
|
+
}, {
|
|
88
|
+
key: "v2ChecksRetrieveWithHttpInfo",
|
|
89
|
+
value: function v2ChecksRetrieveWithHttpInfo(checkType) {
|
|
90
|
+
var postBody = null;
|
|
91
|
+
// verify the required parameter 'checkType' is set
|
|
92
|
+
if (checkType === undefined || checkType === null) {
|
|
93
|
+
throw new Error("Missing the required parameter 'checkType' when calling v2ChecksRetrieve");
|
|
94
|
+
}
|
|
95
|
+
var pathParams = {
|
|
96
|
+
'check_type': checkType
|
|
97
|
+
};
|
|
98
|
+
var queryParams = {};
|
|
99
|
+
var headerParams = {};
|
|
100
|
+
var formParams = {};
|
|
101
|
+
var authNames = ['oauth2'];
|
|
102
|
+
var contentTypes = [];
|
|
103
|
+
var accepts = ['application/json'];
|
|
104
|
+
var returnType = _V2CheckInfo["default"];
|
|
105
|
+
return this.apiClient.callApi('/api/v2/checks/{check_type}/', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @param {String} checkType
|
|
110
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/V2CheckInfo}
|
|
111
|
+
*/
|
|
112
|
+
}, {
|
|
113
|
+
key: "v2ChecksRetrieve",
|
|
114
|
+
value: function v2ChecksRetrieve(checkType) {
|
|
115
|
+
return this.v2ChecksRetrieveWithHttpInfo(checkType).then(function (response_and_data) {
|
|
116
|
+
return response_and_data.data;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}]);
|
|
120
|
+
}();
|
|
@@ -0,0 +1,257 @@
|
|
|
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 _DivisionReadOnly = _interopRequireDefault(require("../model/DivisionReadOnly"));
|
|
9
|
+
var _DivisionWrite = _interopRequireDefault(require("../model/DivisionWrite"));
|
|
10
|
+
var _PaginatedDivisionReadOnlyList = _interopRequireDefault(require("../model/PaginatedDivisionReadOnlyList"));
|
|
11
|
+
var _PatchedDivisionWrite = _interopRequireDefault(require("../model/PatchedDivisionWrite"));
|
|
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
|
+
* Divisions service.
|
|
32
|
+
* @module api/DivisionsApi
|
|
33
|
+
* @version 0.0.5
|
|
34
|
+
*/
|
|
35
|
+
var DivisionsApi = exports["default"] = /*#__PURE__*/function () {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new DivisionsApi.
|
|
38
|
+
* @alias module:api/DivisionsApi
|
|
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 DivisionsApi(apiClient) {
|
|
44
|
+
_classCallCheck(this, DivisionsApi);
|
|
45
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Create a division (a child organisation under the current parent org). Divisions are an advanced, rarely-needed feature: create one ONLY when the user has clearly stated they want to manage a separate business unit, location, or legal entity under their account. Do NOT create a division just to organise screenings, for a single-person or single-member organisation, or without an explicit request to do so. When in doubt, ask the user to confirm before calling this tool.
|
|
50
|
+
* @param {module:model/DivisionWrite} divisionWrite
|
|
51
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DivisionWrite} and HTTP response
|
|
52
|
+
*/
|
|
53
|
+
return _createClass(DivisionsApi, [{
|
|
54
|
+
key: "v2OrganisationsDivisionsCreateWithHttpInfo",
|
|
55
|
+
value: function v2OrganisationsDivisionsCreateWithHttpInfo(divisionWrite) {
|
|
56
|
+
var postBody = divisionWrite;
|
|
57
|
+
// verify the required parameter 'divisionWrite' is set
|
|
58
|
+
if (divisionWrite === undefined || divisionWrite === null) {
|
|
59
|
+
throw new Error("Missing the required parameter 'divisionWrite' when calling v2OrganisationsDivisionsCreate");
|
|
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 = _DivisionWrite["default"];
|
|
69
|
+
return this.apiClient.callApi('/api/v2/organisations/divisions/', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Create a division (a child organisation under the current parent org). Divisions are an advanced, rarely-needed feature: create one ONLY when the user has clearly stated they want to manage a separate business unit, location, or legal entity under their account. Do NOT create a division just to organise screenings, for a single-person or single-member organisation, or without an explicit request to do so. When in doubt, ask the user to confirm before calling this tool.
|
|
74
|
+
* @param {module:model/DivisionWrite} divisionWrite
|
|
75
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DivisionWrite}
|
|
76
|
+
*/
|
|
77
|
+
}, {
|
|
78
|
+
key: "v2OrganisationsDivisionsCreate",
|
|
79
|
+
value: function v2OrganisationsDivisionsCreate(divisionWrite) {
|
|
80
|
+
return this.v2OrganisationsDivisionsCreateWithHttpInfo(divisionWrite).then(function (response_and_data) {
|
|
81
|
+
return response_and_data.data;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* List method that handles both paginated and unpaginated responses and enforces the max_total_records limit (500).
|
|
87
|
+
* @param {Object} opts Optional parameters
|
|
88
|
+
* @param {Number} [page = 1)] A page number within the paginated result set.
|
|
89
|
+
* @param {Number} [pageSize = 50)] Number of results to return per page.
|
|
90
|
+
* @param {Boolean} [paginate = true)] Enable/disable pagination. When false, max 500 records returned.
|
|
91
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/PaginatedDivisionReadOnlyList} and HTTP response
|
|
92
|
+
*/
|
|
93
|
+
}, {
|
|
94
|
+
key: "v2OrganisationsDivisionsListWithHttpInfo",
|
|
95
|
+
value: function v2OrganisationsDivisionsListWithHttpInfo(opts) {
|
|
96
|
+
opts = opts || {};
|
|
97
|
+
var postBody = null;
|
|
98
|
+
var pathParams = {};
|
|
99
|
+
var queryParams = {
|
|
100
|
+
'page': opts['page'],
|
|
101
|
+
'page_size': opts['pageSize'],
|
|
102
|
+
'paginate': opts['paginate']
|
|
103
|
+
};
|
|
104
|
+
var headerParams = {};
|
|
105
|
+
var formParams = {};
|
|
106
|
+
var authNames = ['oauth2'];
|
|
107
|
+
var contentTypes = [];
|
|
108
|
+
var accepts = ['application/json'];
|
|
109
|
+
var returnType = _PaginatedDivisionReadOnlyList["default"];
|
|
110
|
+
return this.apiClient.callApi('/api/v2/organisations/divisions/', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* List method that handles both paginated and unpaginated responses and enforces the max_total_records limit (500).
|
|
115
|
+
* @param {Object} opts Optional parameters
|
|
116
|
+
* @param {Number} opts.page A page number within the paginated result set. (default to 1)
|
|
117
|
+
* @param {Number} opts.pageSize Number of results to return per page. (default to 50)
|
|
118
|
+
* @param {Boolean} opts.paginate Enable/disable pagination. When false, max 500 records returned. (default to true)
|
|
119
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PaginatedDivisionReadOnlyList}
|
|
120
|
+
*/
|
|
121
|
+
}, {
|
|
122
|
+
key: "v2OrganisationsDivisionsList",
|
|
123
|
+
value: function v2OrganisationsDivisionsList(opts) {
|
|
124
|
+
return this.v2OrganisationsDivisionsListWithHttpInfo(opts).then(function (response_and_data) {
|
|
125
|
+
return response_and_data.data;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
131
|
+
* @param {String} id A UUID string identifying this organisation.
|
|
132
|
+
* @param {Object} opts Optional parameters
|
|
133
|
+
* @param {module:model/PatchedDivisionWrite} [patchedDivisionWrite]
|
|
134
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DivisionWrite} and HTTP response
|
|
135
|
+
*/
|
|
136
|
+
}, {
|
|
137
|
+
key: "v2OrganisationsDivisionsPartialUpdateWithHttpInfo",
|
|
138
|
+
value: function v2OrganisationsDivisionsPartialUpdateWithHttpInfo(id, opts) {
|
|
139
|
+
opts = opts || {};
|
|
140
|
+
var postBody = opts['patchedDivisionWrite'];
|
|
141
|
+
// verify the required parameter 'id' is set
|
|
142
|
+
if (id === undefined || id === null) {
|
|
143
|
+
throw new Error("Missing the required parameter 'id' when calling v2OrganisationsDivisionsPartialUpdate");
|
|
144
|
+
}
|
|
145
|
+
var pathParams = {
|
|
146
|
+
'id': id
|
|
147
|
+
};
|
|
148
|
+
var queryParams = {};
|
|
149
|
+
var headerParams = {};
|
|
150
|
+
var formParams = {};
|
|
151
|
+
var authNames = ['oauth2'];
|
|
152
|
+
var contentTypes = ['application/json', 'multipart/form-data'];
|
|
153
|
+
var accepts = ['application/json'];
|
|
154
|
+
var returnType = _DivisionWrite["default"];
|
|
155
|
+
return this.apiClient.callApi('/api/v2/organisations/divisions/{id}/', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
160
|
+
* @param {String} id A UUID string identifying this organisation.
|
|
161
|
+
* @param {Object} opts Optional parameters
|
|
162
|
+
* @param {module:model/PatchedDivisionWrite} opts.patchedDivisionWrite
|
|
163
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DivisionWrite}
|
|
164
|
+
*/
|
|
165
|
+
}, {
|
|
166
|
+
key: "v2OrganisationsDivisionsPartialUpdate",
|
|
167
|
+
value: function v2OrganisationsDivisionsPartialUpdate(id, opts) {
|
|
168
|
+
return this.v2OrganisationsDivisionsPartialUpdateWithHttpInfo(id, opts).then(function (response_and_data) {
|
|
169
|
+
return response_and_data.data;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
175
|
+
* @param {String} id A UUID string identifying this organisation.
|
|
176
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DivisionReadOnly} and HTTP response
|
|
177
|
+
*/
|
|
178
|
+
}, {
|
|
179
|
+
key: "v2OrganisationsDivisionsRetrieveWithHttpInfo",
|
|
180
|
+
value: function v2OrganisationsDivisionsRetrieveWithHttpInfo(id) {
|
|
181
|
+
var postBody = null;
|
|
182
|
+
// verify the required parameter 'id' is set
|
|
183
|
+
if (id === undefined || id === null) {
|
|
184
|
+
throw new Error("Missing the required parameter 'id' when calling v2OrganisationsDivisionsRetrieve");
|
|
185
|
+
}
|
|
186
|
+
var pathParams = {
|
|
187
|
+
'id': id
|
|
188
|
+
};
|
|
189
|
+
var queryParams = {};
|
|
190
|
+
var headerParams = {};
|
|
191
|
+
var formParams = {};
|
|
192
|
+
var authNames = ['oauth2'];
|
|
193
|
+
var contentTypes = [];
|
|
194
|
+
var accepts = ['application/json'];
|
|
195
|
+
var returnType = _DivisionReadOnly["default"];
|
|
196
|
+
return this.apiClient.callApi('/api/v2/organisations/divisions/{id}/', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
201
|
+
* @param {String} id A UUID string identifying this organisation.
|
|
202
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DivisionReadOnly}
|
|
203
|
+
*/
|
|
204
|
+
}, {
|
|
205
|
+
key: "v2OrganisationsDivisionsRetrieve",
|
|
206
|
+
value: function v2OrganisationsDivisionsRetrieve(id) {
|
|
207
|
+
return this.v2OrganisationsDivisionsRetrieveWithHttpInfo(id).then(function (response_and_data) {
|
|
208
|
+
return response_and_data.data;
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Update an existing division's contact, billing, and address details. Override also triggers a webhook on successful PUT and PATCH requests.
|
|
214
|
+
* @param {String} id A UUID string identifying this organisation.
|
|
215
|
+
* @param {module:model/DivisionWrite} divisionWrite
|
|
216
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DivisionWrite} and HTTP response
|
|
217
|
+
*/
|
|
218
|
+
}, {
|
|
219
|
+
key: "v2OrganisationsDivisionsUpdateWithHttpInfo",
|
|
220
|
+
value: function v2OrganisationsDivisionsUpdateWithHttpInfo(id, divisionWrite) {
|
|
221
|
+
var postBody = divisionWrite;
|
|
222
|
+
// verify the required parameter 'id' is set
|
|
223
|
+
if (id === undefined || id === null) {
|
|
224
|
+
throw new Error("Missing the required parameter 'id' when calling v2OrganisationsDivisionsUpdate");
|
|
225
|
+
}
|
|
226
|
+
// verify the required parameter 'divisionWrite' is set
|
|
227
|
+
if (divisionWrite === undefined || divisionWrite === null) {
|
|
228
|
+
throw new Error("Missing the required parameter 'divisionWrite' when calling v2OrganisationsDivisionsUpdate");
|
|
229
|
+
}
|
|
230
|
+
var pathParams = {
|
|
231
|
+
'id': id
|
|
232
|
+
};
|
|
233
|
+
var queryParams = {};
|
|
234
|
+
var headerParams = {};
|
|
235
|
+
var formParams = {};
|
|
236
|
+
var authNames = ['oauth2'];
|
|
237
|
+
var contentTypes = ['application/json', 'multipart/form-data'];
|
|
238
|
+
var accepts = ['application/json'];
|
|
239
|
+
var returnType = _DivisionWrite["default"];
|
|
240
|
+
return this.apiClient.callApi('/api/v2/organisations/divisions/{id}/', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Update an existing division's contact, billing, and address details. Override also triggers a webhook on successful PUT and PATCH requests.
|
|
245
|
+
* @param {String} id A UUID string identifying this organisation.
|
|
246
|
+
* @param {module:model/DivisionWrite} divisionWrite
|
|
247
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DivisionWrite}
|
|
248
|
+
*/
|
|
249
|
+
}, {
|
|
250
|
+
key: "v2OrganisationsDivisionsUpdate",
|
|
251
|
+
value: function v2OrganisationsDivisionsUpdate(id, divisionWrite) {
|
|
252
|
+
return this.v2OrganisationsDivisionsUpdateWithHttpInfo(id, divisionWrite).then(function (response_and_data) {
|
|
253
|
+
return response_and_data.data;
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}]);
|
|
257
|
+
}();
|