@unified-api/typescript-sdk 1.0.35 → 1.0.36
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/dist/sdk/company.d.ts +24 -0
- package/dist/sdk/company.js +402 -0
- package/dist/sdk/hris.d.ts +24 -0
- package/dist/sdk/hris.js +402 -0
- package/dist/sdk/models/operations/createhriscompany.d.ts +28 -0
- package/dist/sdk/models/operations/createhriscompany.js +95 -0
- package/dist/sdk/models/operations/gethriscompany.d.ts +35 -0
- package/dist/sdk/models/operations/gethriscompany.js +99 -0
- package/dist/sdk/models/operations/getunifiedintegrationauth.d.ts +2 -0
- package/dist/sdk/models/operations/getunifiedintegrationauth.js +2 -0
- package/dist/sdk/models/operations/index.d.ts +6 -0
- package/dist/sdk/models/operations/index.js +6 -0
- package/dist/sdk/models/operations/listhriscompanies.d.ts +43 -0
- package/dist/sdk/models/operations/listhriscompanies.js +119 -0
- package/dist/sdk/models/operations/listhrisemployees.d.ts +1 -0
- package/dist/sdk/models/operations/listhrisemployees.js +4 -0
- package/dist/sdk/models/operations/listhrisgroups.d.ts +1 -0
- package/dist/sdk/models/operations/listhrisgroups.js +4 -0
- package/dist/sdk/models/operations/patchhriscompany.d.ts +32 -0
- package/dist/sdk/models/operations/patchhriscompany.js +99 -0
- package/dist/sdk/models/operations/removehriscompany.d.ts +30 -0
- package/dist/sdk/models/operations/removehriscompany.js +71 -0
- package/dist/sdk/models/operations/updatehriscompany.d.ts +32 -0
- package/dist/sdk/models/operations/updatehriscompany.js +99 -0
- package/dist/sdk/models/shared/hriscompany.d.ts +11 -0
- package/dist/sdk/models/shared/hriscompany.js +85 -0
- package/dist/sdk/models/shared/hrisemployee.d.ts +1 -0
- package/dist/sdk/models/shared/hrisemployee.js +5 -0
- package/dist/sdk/models/shared/hrisgroup.d.ts +1 -0
- package/dist/sdk/models/shared/hrisgroup.js +5 -0
- package/dist/sdk/models/shared/index.d.ts +2 -0
- package/dist/sdk/models/shared/index.js +2 -0
- package/dist/sdk/models/shared/propertyconnectionpermissions.d.ts +2 -0
- package/dist/sdk/models/shared/propertyconnectionpermissions.js +2 -0
- package/dist/sdk/models/shared/propertyhriscompanyaddress.d.ts +11 -0
- package/dist/sdk/models/shared/propertyhriscompanyaddress.js +80 -0
- package/dist/sdk/models/shared/webhook.d.ts +1 -0
- package/dist/sdk/models/shared/webhook.js +1 -0
- package/dist/sdk/sdk.js +2 -2
- package/docs/sdk/models/operations/createhriscompanyrequest.md +9 -0
- package/docs/sdk/models/operations/createhriscompanyresponse.md +11 -0
- package/docs/sdk/models/operations/gethriscompanyrequest.md +10 -0
- package/docs/sdk/models/operations/gethriscompanyresponse.md +11 -0
- package/docs/sdk/models/operations/listhriscompaniesrequest.md +15 -0
- package/docs/sdk/models/operations/listhriscompaniesresponse.md +11 -0
- package/docs/sdk/models/operations/listhrisemployeesrequest.md +1 -0
- package/docs/sdk/models/operations/listhrisgroupsrequest.md +1 -0
- package/docs/sdk/models/operations/patchhriscompanyrequest.md +10 -0
- package/docs/sdk/models/operations/patchhriscompanyresponse.md +11 -0
- package/docs/sdk/models/operations/removehriscompanyrequest.md +9 -0
- package/docs/sdk/models/operations/removehriscompanyresponse.md +11 -0
- package/docs/sdk/models/operations/scopes.md +2 -0
- package/docs/sdk/models/operations/updatehriscompanyrequest.md +10 -0
- package/docs/sdk/models/operations/updatehriscompanyresponse.md +11 -0
- package/docs/sdk/models/shared/hriscompany.md +14 -0
- package/docs/sdk/models/shared/hrisemployee.md +1 -0
- package/docs/sdk/models/shared/hrisgroup.md +1 -0
- package/docs/sdk/models/shared/objecttype.md +1 -0
- package/docs/sdk/models/shared/propertyconnectionpermissions.md +2 -0
- package/docs/sdk/models/shared/propertyhriscompanyaddress.md +15 -0
- package/package.json +1 -1
package/dist/sdk/hris.js
CHANGED
|
@@ -98,6 +98,77 @@ var Hris = /** @class */ (function () {
|
|
|
98
98
|
function Hris(sdkConfig) {
|
|
99
99
|
this.sdkConfiguration = sdkConfig;
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Create a company
|
|
103
|
+
*/
|
|
104
|
+
Hris.prototype.createHrisCompany = function (req, config) {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
107
|
+
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
108
|
+
var _d;
|
|
109
|
+
return __generator(this, function (_e) {
|
|
110
|
+
switch (_e.label) {
|
|
111
|
+
case 0:
|
|
112
|
+
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
113
|
+
req = new operations.CreateHrisCompanyRequest(req);
|
|
114
|
+
}
|
|
115
|
+
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
116
|
+
operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company", req);
|
|
117
|
+
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
118
|
+
try {
|
|
119
|
+
_d = __read(utils.serializeRequestBody(req, "hrisCompany", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
if (e instanceof Error) {
|
|
123
|
+
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
client = this.sdkConfiguration.defaultClient;
|
|
127
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
128
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
129
|
+
return [4 /*yield*/, globalSecurity()];
|
|
130
|
+
case 1:
|
|
131
|
+
globalSecurity = _e.sent();
|
|
132
|
+
_e.label = 2;
|
|
133
|
+
case 2:
|
|
134
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
135
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
136
|
+
}
|
|
137
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
138
|
+
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
139
|
+
headers["Accept"] = "application/json";
|
|
140
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
141
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
142
|
+
case 3:
|
|
143
|
+
httpRes = _e.sent();
|
|
144
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
145
|
+
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
146
|
+
throw new Error("status code not found in response: ".concat(httpRes));
|
|
147
|
+
}
|
|
148
|
+
res = new operations.CreateHrisCompanyResponse({
|
|
149
|
+
statusCode: httpRes.status,
|
|
150
|
+
contentType: responseContentType,
|
|
151
|
+
rawResponse: httpRes,
|
|
152
|
+
});
|
|
153
|
+
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
154
|
+
switch (true) {
|
|
155
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
156
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
157
|
+
res.hrisCompany = utils.objectToClass(JSON.parse(decodedRes), shared.HrisCompany);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
161
|
+
}
|
|
162
|
+
break;
|
|
163
|
+
case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
164
|
+
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
165
|
+
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
166
|
+
}
|
|
167
|
+
return [2 /*return*/, res];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
};
|
|
101
172
|
/**
|
|
102
173
|
* Create an employee
|
|
103
174
|
*/
|
|
@@ -240,6 +311,68 @@ var Hris = /** @class */ (function () {
|
|
|
240
311
|
});
|
|
241
312
|
});
|
|
242
313
|
};
|
|
314
|
+
/**
|
|
315
|
+
* Retrieve a company
|
|
316
|
+
*/
|
|
317
|
+
Hris.prototype.getHrisCompany = function (req, config) {
|
|
318
|
+
var _a, _b;
|
|
319
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
320
|
+
var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes;
|
|
321
|
+
return __generator(this, function (_c) {
|
|
322
|
+
switch (_c.label) {
|
|
323
|
+
case 0:
|
|
324
|
+
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
325
|
+
req = new operations.GetHrisCompanyRequest(req);
|
|
326
|
+
}
|
|
327
|
+
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
328
|
+
operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company/{id}", req);
|
|
329
|
+
client = this.sdkConfiguration.defaultClient;
|
|
330
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
331
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
332
|
+
return [4 /*yield*/, globalSecurity()];
|
|
333
|
+
case 1:
|
|
334
|
+
globalSecurity = _c.sent();
|
|
335
|
+
_c.label = 2;
|
|
336
|
+
case 2:
|
|
337
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
338
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
339
|
+
}
|
|
340
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
341
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
342
|
+
queryParams = utils.serializeQueryParams(req);
|
|
343
|
+
headers["Accept"] = "application/json";
|
|
344
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
345
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
346
|
+
case 3:
|
|
347
|
+
httpRes = _c.sent();
|
|
348
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
349
|
+
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
350
|
+
throw new Error("status code not found in response: ".concat(httpRes));
|
|
351
|
+
}
|
|
352
|
+
res = new operations.GetHrisCompanyResponse({
|
|
353
|
+
statusCode: httpRes.status,
|
|
354
|
+
contentType: responseContentType,
|
|
355
|
+
rawResponse: httpRes,
|
|
356
|
+
});
|
|
357
|
+
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
358
|
+
switch (true) {
|
|
359
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
360
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
361
|
+
res.hrisCompany = utils.objectToClass(JSON.parse(decodedRes), shared.HrisCompany);
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
365
|
+
}
|
|
366
|
+
break;
|
|
367
|
+
case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
368
|
+
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
369
|
+
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
370
|
+
}
|
|
371
|
+
return [2 /*return*/, res];
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
};
|
|
243
376
|
/**
|
|
244
377
|
* Retrieve an employee
|
|
245
378
|
*/
|
|
@@ -488,6 +621,70 @@ var Hris = /** @class */ (function () {
|
|
|
488
621
|
});
|
|
489
622
|
});
|
|
490
623
|
};
|
|
624
|
+
/**
|
|
625
|
+
* List all companies
|
|
626
|
+
*/
|
|
627
|
+
Hris.prototype.listHrisCompanies = function (req, config) {
|
|
628
|
+
var _a, _b;
|
|
629
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
630
|
+
var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
|
|
631
|
+
return __generator(this, function (_c) {
|
|
632
|
+
switch (_c.label) {
|
|
633
|
+
case 0:
|
|
634
|
+
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
635
|
+
req = new operations.ListHrisCompaniesRequest(req);
|
|
636
|
+
}
|
|
637
|
+
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
638
|
+
operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company", req);
|
|
639
|
+
client = this.sdkConfiguration.defaultClient;
|
|
640
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
641
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
642
|
+
return [4 /*yield*/, globalSecurity()];
|
|
643
|
+
case 1:
|
|
644
|
+
globalSecurity = _c.sent();
|
|
645
|
+
_c.label = 2;
|
|
646
|
+
case 2:
|
|
647
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
648
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
649
|
+
}
|
|
650
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
651
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
652
|
+
queryParams = utils.serializeQueryParams(req);
|
|
653
|
+
headers["Accept"] = "application/json";
|
|
654
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
655
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
656
|
+
case 3:
|
|
657
|
+
httpRes = _c.sent();
|
|
658
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
659
|
+
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
660
|
+
throw new Error("status code not found in response: ".concat(httpRes));
|
|
661
|
+
}
|
|
662
|
+
res = new operations.ListHrisCompaniesResponse({
|
|
663
|
+
statusCode: httpRes.status,
|
|
664
|
+
contentType: responseContentType,
|
|
665
|
+
rawResponse: httpRes,
|
|
666
|
+
});
|
|
667
|
+
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
668
|
+
switch (true) {
|
|
669
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
670
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
671
|
+
res.hrisCompanies = [];
|
|
672
|
+
resFieldDepth = utils.getResFieldDepth(res);
|
|
673
|
+
res.hrisCompanies = utils.objectToClass(JSON.parse(decodedRes), shared.HrisCompany, resFieldDepth);
|
|
674
|
+
}
|
|
675
|
+
else {
|
|
676
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
677
|
+
}
|
|
678
|
+
break;
|
|
679
|
+
case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
680
|
+
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
681
|
+
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
682
|
+
}
|
|
683
|
+
return [2 /*return*/, res];
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
});
|
|
687
|
+
};
|
|
491
688
|
/**
|
|
492
689
|
* List all employees
|
|
493
690
|
*/
|
|
@@ -744,6 +941,77 @@ var Hris = /** @class */ (function () {
|
|
|
744
941
|
});
|
|
745
942
|
});
|
|
746
943
|
};
|
|
944
|
+
/**
|
|
945
|
+
* Update a company
|
|
946
|
+
*/
|
|
947
|
+
Hris.prototype.patchHrisCompany = function (req, config) {
|
|
948
|
+
var _a, _b;
|
|
949
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
950
|
+
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
951
|
+
var _d;
|
|
952
|
+
return __generator(this, function (_e) {
|
|
953
|
+
switch (_e.label) {
|
|
954
|
+
case 0:
|
|
955
|
+
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
956
|
+
req = new operations.PatchHrisCompanyRequest(req);
|
|
957
|
+
}
|
|
958
|
+
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
959
|
+
operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company/{id}", req);
|
|
960
|
+
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
961
|
+
try {
|
|
962
|
+
_d = __read(utils.serializeRequestBody(req, "hrisCompany", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
963
|
+
}
|
|
964
|
+
catch (e) {
|
|
965
|
+
if (e instanceof Error) {
|
|
966
|
+
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
client = this.sdkConfiguration.defaultClient;
|
|
970
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
971
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
972
|
+
return [4 /*yield*/, globalSecurity()];
|
|
973
|
+
case 1:
|
|
974
|
+
globalSecurity = _e.sent();
|
|
975
|
+
_e.label = 2;
|
|
976
|
+
case 2:
|
|
977
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
978
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
979
|
+
}
|
|
980
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
981
|
+
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
982
|
+
headers["Accept"] = "application/json";
|
|
983
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
984
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "patch", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
985
|
+
case 3:
|
|
986
|
+
httpRes = _e.sent();
|
|
987
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
988
|
+
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
989
|
+
throw new Error("status code not found in response: ".concat(httpRes));
|
|
990
|
+
}
|
|
991
|
+
res = new operations.PatchHrisCompanyResponse({
|
|
992
|
+
statusCode: httpRes.status,
|
|
993
|
+
contentType: responseContentType,
|
|
994
|
+
rawResponse: httpRes,
|
|
995
|
+
});
|
|
996
|
+
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
997
|
+
switch (true) {
|
|
998
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
999
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
1000
|
+
res.hrisCompany = utils.objectToClass(JSON.parse(decodedRes), shared.HrisCompany);
|
|
1001
|
+
}
|
|
1002
|
+
else {
|
|
1003
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
1004
|
+
}
|
|
1005
|
+
break;
|
|
1006
|
+
case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
1007
|
+
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
1008
|
+
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
1009
|
+
}
|
|
1010
|
+
return [2 /*return*/, res];
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
1013
|
+
});
|
|
1014
|
+
};
|
|
747
1015
|
/**
|
|
748
1016
|
* Update an employee
|
|
749
1017
|
*/
|
|
@@ -886,6 +1154,69 @@ var Hris = /** @class */ (function () {
|
|
|
886
1154
|
});
|
|
887
1155
|
});
|
|
888
1156
|
};
|
|
1157
|
+
/**
|
|
1158
|
+
* Remove a company
|
|
1159
|
+
*/
|
|
1160
|
+
Hris.prototype.removeHrisCompany = function (req, config) {
|
|
1161
|
+
var _a, _b;
|
|
1162
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1163
|
+
var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
1164
|
+
return __generator(this, function (_c) {
|
|
1165
|
+
switch (_c.label) {
|
|
1166
|
+
case 0:
|
|
1167
|
+
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
1168
|
+
req = new operations.RemoveHrisCompanyRequest(req);
|
|
1169
|
+
}
|
|
1170
|
+
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
1171
|
+
operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company/{id}", req);
|
|
1172
|
+
client = this.sdkConfiguration.defaultClient;
|
|
1173
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
1174
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
1175
|
+
return [4 /*yield*/, globalSecurity()];
|
|
1176
|
+
case 1:
|
|
1177
|
+
globalSecurity = _c.sent();
|
|
1178
|
+
_c.label = 2;
|
|
1179
|
+
case 2:
|
|
1180
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
1181
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
1182
|
+
}
|
|
1183
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
1184
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
1185
|
+
headers["Accept"] = "application/json";
|
|
1186
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
1187
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
|
|
1188
|
+
case 3:
|
|
1189
|
+
httpRes = _c.sent();
|
|
1190
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
1191
|
+
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
1192
|
+
throw new Error("status code not found in response: ".concat(httpRes));
|
|
1193
|
+
}
|
|
1194
|
+
res = new operations.RemoveHrisCompanyResponse({
|
|
1195
|
+
statusCode: httpRes.status,
|
|
1196
|
+
contentType: responseContentType,
|
|
1197
|
+
rawResponse: httpRes,
|
|
1198
|
+
});
|
|
1199
|
+
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
1200
|
+
switch (true) {
|
|
1201
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 200 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 300:
|
|
1202
|
+
break;
|
|
1203
|
+
case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
1204
|
+
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
1205
|
+
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
1206
|
+
default:
|
|
1207
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
1208
|
+
res.string = JSON.parse(decodedRes);
|
|
1209
|
+
}
|
|
1210
|
+
else {
|
|
1211
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
1212
|
+
}
|
|
1213
|
+
break;
|
|
1214
|
+
}
|
|
1215
|
+
return [2 /*return*/, res];
|
|
1216
|
+
}
|
|
1217
|
+
});
|
|
1218
|
+
});
|
|
1219
|
+
};
|
|
889
1220
|
/**
|
|
890
1221
|
* Remove an employee
|
|
891
1222
|
*/
|
|
@@ -1012,6 +1343,77 @@ var Hris = /** @class */ (function () {
|
|
|
1012
1343
|
});
|
|
1013
1344
|
});
|
|
1014
1345
|
};
|
|
1346
|
+
/**
|
|
1347
|
+
* Update a company
|
|
1348
|
+
*/
|
|
1349
|
+
Hris.prototype.updateHrisCompany = function (req, config) {
|
|
1350
|
+
var _a, _b;
|
|
1351
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1352
|
+
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
1353
|
+
var _d;
|
|
1354
|
+
return __generator(this, function (_e) {
|
|
1355
|
+
switch (_e.label) {
|
|
1356
|
+
case 0:
|
|
1357
|
+
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
1358
|
+
req = new operations.UpdateHrisCompanyRequest(req);
|
|
1359
|
+
}
|
|
1360
|
+
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
1361
|
+
operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company/{id}", req);
|
|
1362
|
+
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
1363
|
+
try {
|
|
1364
|
+
_d = __read(utils.serializeRequestBody(req, "hrisCompany", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
1365
|
+
}
|
|
1366
|
+
catch (e) {
|
|
1367
|
+
if (e instanceof Error) {
|
|
1368
|
+
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
client = this.sdkConfiguration.defaultClient;
|
|
1372
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
1373
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
1374
|
+
return [4 /*yield*/, globalSecurity()];
|
|
1375
|
+
case 1:
|
|
1376
|
+
globalSecurity = _e.sent();
|
|
1377
|
+
_e.label = 2;
|
|
1378
|
+
case 2:
|
|
1379
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
1380
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
1381
|
+
}
|
|
1382
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
1383
|
+
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
1384
|
+
headers["Accept"] = "application/json";
|
|
1385
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
1386
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
1387
|
+
case 3:
|
|
1388
|
+
httpRes = _e.sent();
|
|
1389
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
1390
|
+
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
1391
|
+
throw new Error("status code not found in response: ".concat(httpRes));
|
|
1392
|
+
}
|
|
1393
|
+
res = new operations.UpdateHrisCompanyResponse({
|
|
1394
|
+
statusCode: httpRes.status,
|
|
1395
|
+
contentType: responseContentType,
|
|
1396
|
+
rawResponse: httpRes,
|
|
1397
|
+
});
|
|
1398
|
+
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
1399
|
+
switch (true) {
|
|
1400
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
1401
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
1402
|
+
res.hrisCompany = utils.objectToClass(JSON.parse(decodedRes), shared.HrisCompany);
|
|
1403
|
+
}
|
|
1404
|
+
else {
|
|
1405
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
1406
|
+
}
|
|
1407
|
+
break;
|
|
1408
|
+
case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
1409
|
+
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
1410
|
+
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
1411
|
+
}
|
|
1412
|
+
return [2 /*return*/, res];
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
});
|
|
1416
|
+
};
|
|
1015
1417
|
/**
|
|
1016
1418
|
* Update an employee
|
|
1017
1419
|
*/
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SpeakeasyBase } from "../../../internal/utils";
|
|
2
|
+
import * as shared from "../../../sdk/models/shared";
|
|
3
|
+
import { AxiosResponse } from "axios";
|
|
4
|
+
export declare class CreateHrisCompanyRequest extends SpeakeasyBase {
|
|
5
|
+
hrisCompany?: shared.HrisCompany;
|
|
6
|
+
/**
|
|
7
|
+
* ID of the connection
|
|
8
|
+
*/
|
|
9
|
+
connectionId: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class CreateHrisCompanyResponse extends SpeakeasyBase {
|
|
12
|
+
/**
|
|
13
|
+
* HTTP response content type for this operation
|
|
14
|
+
*/
|
|
15
|
+
contentType: string;
|
|
16
|
+
/**
|
|
17
|
+
* Successful
|
|
18
|
+
*/
|
|
19
|
+
hrisCompany?: shared.HrisCompany;
|
|
20
|
+
/**
|
|
21
|
+
* HTTP response status code for this operation
|
|
22
|
+
*/
|
|
23
|
+
statusCode: number;
|
|
24
|
+
/**
|
|
25
|
+
* Raw HTTP response; suitable for custom response parsing
|
|
26
|
+
*/
|
|
27
|
+
rawResponse: AxiosResponse;
|
|
28
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __extends = (this && this.__extends) || (function () {
|
|
6
|
+
var extendStatics = function (d, b) {
|
|
7
|
+
extendStatics = Object.setPrototypeOf ||
|
|
8
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
9
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
10
|
+
return extendStatics(d, b);
|
|
11
|
+
};
|
|
12
|
+
return function (d, b) {
|
|
13
|
+
if (typeof b !== "function" && b !== null)
|
|
14
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
15
|
+
extendStatics(d, b);
|
|
16
|
+
function __() { this.constructor = d; }
|
|
17
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(o, k2, desc);
|
|
27
|
+
}) : (function(o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
}));
|
|
31
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
32
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
33
|
+
}) : function(o, v) {
|
|
34
|
+
o["default"] = v;
|
|
35
|
+
});
|
|
36
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
37
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
38
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
39
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
40
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
41
|
+
};
|
|
42
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
43
|
+
if (mod && mod.__esModule) return mod;
|
|
44
|
+
var result = {};
|
|
45
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
46
|
+
__setModuleDefault(result, mod);
|
|
47
|
+
return result;
|
|
48
|
+
};
|
|
49
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
50
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.CreateHrisCompanyResponse = exports.CreateHrisCompanyRequest = void 0;
|
|
54
|
+
var utils_1 = require("../../../internal/utils");
|
|
55
|
+
var shared = __importStar(require("../../../sdk/models/shared"));
|
|
56
|
+
var CreateHrisCompanyRequest = /** @class */ (function (_super) {
|
|
57
|
+
__extends(CreateHrisCompanyRequest, _super);
|
|
58
|
+
function CreateHrisCompanyRequest() {
|
|
59
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
60
|
+
}
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, utils_1.SpeakeasyMetadata)({ data: "request, media_type=application/json" }),
|
|
63
|
+
__metadata("design:type", shared.HrisCompany)
|
|
64
|
+
], CreateHrisCompanyRequest.prototype, "hrisCompany", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, utils_1.SpeakeasyMetadata)({ data: "pathParam, style=simple;explode=false;name=connection_id" }),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], CreateHrisCompanyRequest.prototype, "connectionId", void 0);
|
|
69
|
+
return CreateHrisCompanyRequest;
|
|
70
|
+
}(utils_1.SpeakeasyBase));
|
|
71
|
+
exports.CreateHrisCompanyRequest = CreateHrisCompanyRequest;
|
|
72
|
+
var CreateHrisCompanyResponse = /** @class */ (function (_super) {
|
|
73
|
+
__extends(CreateHrisCompanyResponse, _super);
|
|
74
|
+
function CreateHrisCompanyResponse() {
|
|
75
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
76
|
+
}
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], CreateHrisCompanyResponse.prototype, "contentType", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
83
|
+
__metadata("design:type", shared.HrisCompany)
|
|
84
|
+
], CreateHrisCompanyResponse.prototype, "hrisCompany", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
87
|
+
__metadata("design:type", Number)
|
|
88
|
+
], CreateHrisCompanyResponse.prototype, "statusCode", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], CreateHrisCompanyResponse.prototype, "rawResponse", void 0);
|
|
93
|
+
return CreateHrisCompanyResponse;
|
|
94
|
+
}(utils_1.SpeakeasyBase));
|
|
95
|
+
exports.CreateHrisCompanyResponse = CreateHrisCompanyResponse;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SpeakeasyBase } from "../../../internal/utils";
|
|
2
|
+
import * as shared from "../../../sdk/models/shared";
|
|
3
|
+
import { AxiosResponse } from "axios";
|
|
4
|
+
export declare class GetHrisCompanyRequest extends SpeakeasyBase {
|
|
5
|
+
/**
|
|
6
|
+
* ID of the connection
|
|
7
|
+
*/
|
|
8
|
+
connectionId: string;
|
|
9
|
+
/**
|
|
10
|
+
* Comma-delimited fields to return
|
|
11
|
+
*/
|
|
12
|
+
fields?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* ID of the Company
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class GetHrisCompanyResponse extends SpeakeasyBase {
|
|
19
|
+
/**
|
|
20
|
+
* HTTP response content type for this operation
|
|
21
|
+
*/
|
|
22
|
+
contentType: string;
|
|
23
|
+
/**
|
|
24
|
+
* Successful
|
|
25
|
+
*/
|
|
26
|
+
hrisCompany?: shared.HrisCompany;
|
|
27
|
+
/**
|
|
28
|
+
* HTTP response status code for this operation
|
|
29
|
+
*/
|
|
30
|
+
statusCode: number;
|
|
31
|
+
/**
|
|
32
|
+
* Raw HTTP response; suitable for custom response parsing
|
|
33
|
+
*/
|
|
34
|
+
rawResponse: AxiosResponse;
|
|
35
|
+
}
|