@thera-hr/api-sdk 0.0.1774 → 0.0.1805
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/api/resources/api/resources/services/resources/file/client/Client.js +4 -4
- package/api/resources/api/resources/test/resources/invoices/client/Client.js +1 -1
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.d.ts +3 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.js +138 -6
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/DeleteWithdrawalMethodResponse.d.ts +7 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/DeleteWithdrawalMethodResponse.js +5 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetWorkerBalancesResponse.d.ts +7 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetWorkerBalancesResponse.js +5 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalRequest.d.ts +8 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalRequest.js +5 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalResponse.d.ts +5 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalResponse.js +5 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/WorkerBalance.d.ts +8 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/WorkerBalance.js +5 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +5 -0
- package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +5 -0
- package/api/resources/api/resources/thera/resources/company/resources/companyApi/client/Client.js +1 -1
- package/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.js +1 -1
- package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementApi/client/Client.js +2 -2
- package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/Client.js +1 -1
- package/api/resources/api/resources/thera/resources/employment/resources/employmentApi/client/Client.js +2 -2
- package/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.js +1 -1
- package/api/resources/db/resources/user/types/CompanySettings.d.ts +6 -0
- package/api/resources/db/resources/user/types/CompanySettings.js +5 -0
- package/api/resources/db/resources/user/types/EmployeeInformation.d.ts +3 -0
- package/api/resources/db/resources/user/types/index.d.ts +1 -0
- package/api/resources/db/resources/user/types/index.js +1 -0
- package/dist/api/resources/api/resources/services/resources/file/client/Client.js +4 -4
- package/dist/api/resources/api/resources/test/resources/invoices/client/Client.js +1 -1
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.d.ts +3 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.js +138 -6
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/DeleteWithdrawalMethodResponse.d.ts +7 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/DeleteWithdrawalMethodResponse.js +5 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetWorkerBalancesResponse.d.ts +7 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetWorkerBalancesResponse.js +5 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalRequest.d.ts +8 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalRequest.js +5 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalResponse.d.ts +5 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalResponse.js +5 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/WorkerBalance.d.ts +8 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/WorkerBalance.js +5 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +5 -0
- package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +5 -0
- package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/client/Client.js +1 -1
- package/dist/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.js +1 -1
- package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementApi/client/Client.js +2 -2
- package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/Client.js +1 -1
- package/dist/api/resources/api/resources/thera/resources/employment/resources/employmentApi/client/Client.js +2 -2
- package/dist/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.js +1 -1
- package/dist/api/resources/db/resources/user/types/CompanySettings.d.ts +6 -0
- package/dist/api/resources/db/resources/user/types/CompanySettings.js +5 -0
- package/dist/api/resources/db/resources/user/types/EmployeeInformation.d.ts +3 -0
- package/dist/api/resources/db/resources/user/types/index.d.ts +1 -0
- package/dist/api/resources/db/resources/user/types/index.js +1 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/DeleteWithdrawalMethodResponse.d.ts +12 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/DeleteWithdrawalMethodResponse.js +42 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetWorkerBalancesResponse.d.ts +12 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetWorkerBalancesResponse.js +42 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalRequest.d.ts +14 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalRequest.js +35 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalResponse.d.ts +11 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalResponse.js +31 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/WorkerBalance.d.ts +14 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/WorkerBalance.js +35 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +5 -0
- package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +5 -0
- package/dist/serialization/resources/db/resources/user/types/CompanySettings.d.ts +12 -0
- package/dist/serialization/resources/db/resources/user/types/CompanySettings.js +33 -0
- package/dist/serialization/resources/db/resources/user/types/EmployeeInformation.d.ts +2 -0
- package/dist/serialization/resources/db/resources/user/types/EmployeeInformation.js +2 -0
- package/dist/serialization/resources/db/resources/user/types/index.d.ts +1 -0
- package/dist/serialization/resources/db/resources/user/types/index.js +1 -0
- package/package.json +1 -1
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/DeleteWithdrawalMethodResponse.d.ts +12 -0
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/DeleteWithdrawalMethodResponse.js +42 -0
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetWorkerBalancesResponse.d.ts +12 -0
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetWorkerBalancesResponse.js +42 -0
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalRequest.d.ts +14 -0
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalRequest.js +35 -0
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalResponse.d.ts +11 -0
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/InitiateWorkerWithdrawalResponse.js +31 -0
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/WorkerBalance.d.ts +14 -0
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/WorkerBalance.js +35 -0
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +5 -0
- package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +5 -0
- package/serialization/resources/db/resources/user/types/CompanySettings.d.ts +12 -0
- package/serialization/resources/db/resources/user/types/CompanySettings.js +33 -0
- package/serialization/resources/db/resources/user/types/EmployeeInformation.d.ts +2 -0
- package/serialization/resources/db/resources/user/types/EmployeeInformation.js +2 -0
- package/serialization/resources/db/resources/user/types/index.d.ts +1 -0
- package/serialization/resources/db/resources/user/types/index.js +1 -0
|
@@ -56,7 +56,7 @@ class File_ {
|
|
|
56
56
|
Authorization: yield this._getAuthorizationHeader(),
|
|
57
57
|
"X-Fern-Language": "JavaScript",
|
|
58
58
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
59
|
-
"X-Fern-SDK-Version": "0.0.
|
|
59
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
60
60
|
},
|
|
61
61
|
contentType: "application/json",
|
|
62
62
|
body: yield serializers.api.services.AttachDocumentToEmploymentRequest.jsonOrThrow(request, {
|
|
@@ -97,7 +97,7 @@ class File_ {
|
|
|
97
97
|
Authorization: yield this._getAuthorizationHeader(),
|
|
98
98
|
"X-Fern-Language": "JavaScript",
|
|
99
99
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
100
|
-
"X-Fern-SDK-Version": "0.0.
|
|
100
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
101
101
|
},
|
|
102
102
|
contentType: "application/json",
|
|
103
103
|
body: yield serializers.api.services.DeleteDocumentFromEmploymentRequest.jsonOrThrow(request, {
|
|
@@ -138,7 +138,7 @@ class File_ {
|
|
|
138
138
|
Authorization: yield this._getAuthorizationHeader(),
|
|
139
139
|
"X-Fern-Language": "JavaScript",
|
|
140
140
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
141
|
-
"X-Fern-SDK-Version": "0.0.
|
|
141
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
142
142
|
},
|
|
143
143
|
contentType: "application/json",
|
|
144
144
|
timeoutMs: 60000,
|
|
@@ -181,7 +181,7 @@ class File_ {
|
|
|
181
181
|
Authorization: yield this._getAuthorizationHeader(),
|
|
182
182
|
"X-Fern-Language": "JavaScript",
|
|
183
183
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
184
|
-
"X-Fern-SDK-Version": "0.0.
|
|
184
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
185
185
|
},
|
|
186
186
|
contentType: "application/json",
|
|
187
187
|
timeoutMs: 60000,
|
|
@@ -56,7 +56,7 @@ class Invoices {
|
|
|
56
56
|
Authorization: yield this._getAuthorizationHeader(),
|
|
57
57
|
"X-Fern-Language": "JavaScript",
|
|
58
58
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
59
|
-
"X-Fern-SDK-Version": "0.0.
|
|
59
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
60
60
|
},
|
|
61
61
|
contentType: "application/json",
|
|
62
62
|
body: yield serializers.api.test.VoidInvoiceRequest.jsonOrThrow(request, {
|
package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.d.ts
CHANGED
|
@@ -36,5 +36,8 @@ export declare class BankApi {
|
|
|
36
36
|
* After gathering all the dynamic fields required for the `Get Supported Withdrawal Methods`, they should be submitted here in order to save the payment method.
|
|
37
37
|
*/
|
|
38
38
|
saveWithdrawalMethod(userId: string, request: TheraApi.api.thera.bank.WithdrawalMethodsRequest): Promise<TheraApi.api.thera.bank.SaveWithdrawalMethodResponse>;
|
|
39
|
+
deleteWithdrawalMethod(userId: string, withdrawalMethodId: string): Promise<TheraApi.api.thera.bank.DeleteWithdrawalMethodResponse>;
|
|
40
|
+
initiateWorkerWithdrawal(userId: string, companyId: string, request: TheraApi.api.thera.bank.InitiateWorkerWithdrawalRequest): Promise<TheraApi.api.thera.bank.InitiateWorkerWithdrawalResponse>;
|
|
41
|
+
getWorkerBalance(userId: string, companyId: string): Promise<TheraApi.api.thera.bank.GetWorkerBalancesResponse>;
|
|
39
42
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
40
43
|
}
|
|
@@ -65,7 +65,7 @@ class BankApi {
|
|
|
65
65
|
Authorization: yield this._getAuthorizationHeader(),
|
|
66
66
|
"X-Fern-Language": "JavaScript",
|
|
67
67
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
68
|
-
"X-Fern-SDK-Version": "0.0.
|
|
68
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
69
69
|
},
|
|
70
70
|
contentType: "application/json",
|
|
71
71
|
queryParameters: _queryParams,
|
|
@@ -112,7 +112,7 @@ class BankApi {
|
|
|
112
112
|
Authorization: yield this._getAuthorizationHeader(),
|
|
113
113
|
"X-Fern-Language": "JavaScript",
|
|
114
114
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
115
|
-
"X-Fern-SDK-Version": "0.0.
|
|
115
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
116
116
|
},
|
|
117
117
|
contentType: "application/json",
|
|
118
118
|
body: yield serializers.api.thera.bank.VerifyAccountSignupRequest.jsonOrThrow(request, {
|
|
@@ -156,7 +156,7 @@ class BankApi {
|
|
|
156
156
|
Authorization: yield this._getAuthorizationHeader(),
|
|
157
157
|
"X-Fern-Language": "JavaScript",
|
|
158
158
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
159
|
-
"X-Fern-SDK-Version": "0.0.
|
|
159
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
160
160
|
},
|
|
161
161
|
contentType: "application/json",
|
|
162
162
|
timeoutMs: 60000,
|
|
@@ -197,7 +197,7 @@ class BankApi {
|
|
|
197
197
|
Authorization: yield this._getAuthorizationHeader(),
|
|
198
198
|
"X-Fern-Language": "JavaScript",
|
|
199
199
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
200
|
-
"X-Fern-SDK-Version": "0.0.
|
|
200
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
201
201
|
},
|
|
202
202
|
contentType: "application/json",
|
|
203
203
|
body: yield serializers.api.thera.bank.VerifyMicrodepositRequest.jsonOrThrow(request, {
|
|
@@ -241,7 +241,7 @@ class BankApi {
|
|
|
241
241
|
Authorization: yield this._getAuthorizationHeader(),
|
|
242
242
|
"X-Fern-Language": "JavaScript",
|
|
243
243
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
244
|
-
"X-Fern-SDK-Version": "0.0.
|
|
244
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
245
245
|
},
|
|
246
246
|
contentType: "application/json",
|
|
247
247
|
body: yield serializers.api.thera.bank.WithdrawalMethodsRequest.jsonOrThrow(request, {
|
|
@@ -290,7 +290,7 @@ class BankApi {
|
|
|
290
290
|
Authorization: yield this._getAuthorizationHeader(),
|
|
291
291
|
"X-Fern-Language": "JavaScript",
|
|
292
292
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
293
|
-
"X-Fern-SDK-Version": "0.0.
|
|
293
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
294
294
|
},
|
|
295
295
|
contentType: "application/json",
|
|
296
296
|
body: yield serializers.api.thera.bank.WithdrawalMethodsRequest.jsonOrThrow(request, {
|
|
@@ -327,6 +327,138 @@ class BankApi {
|
|
|
327
327
|
}
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
+
deleteWithdrawalMethod(userId, withdrawalMethodId) {
|
|
331
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
332
|
+
const _response = yield core.fetcher({
|
|
333
|
+
url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `worker/${userId}/withdrawal-method/${withdrawalMethodId}`),
|
|
334
|
+
method: "DELETE",
|
|
335
|
+
headers: {
|
|
336
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
337
|
+
"X-Fern-Language": "JavaScript",
|
|
338
|
+
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
339
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
340
|
+
},
|
|
341
|
+
contentType: "application/json",
|
|
342
|
+
timeoutMs: 60000,
|
|
343
|
+
});
|
|
344
|
+
if (_response.ok) {
|
|
345
|
+
return yield serializers.api.thera.bank.DeleteWithdrawalMethodResponse.parseOrThrow(_response.body, {
|
|
346
|
+
unrecognizedObjectKeys: "passthrough",
|
|
347
|
+
allowUnrecognizedUnionMembers: true,
|
|
348
|
+
allowUnrecognizedEnumValues: true,
|
|
349
|
+
breadcrumbsPrefix: ["response"],
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
if (_response.error.reason === "status-code") {
|
|
353
|
+
throw new errors.TheraApiError({
|
|
354
|
+
statusCode: _response.error.statusCode,
|
|
355
|
+
body: _response.error.body,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
switch (_response.error.reason) {
|
|
359
|
+
case "non-json":
|
|
360
|
+
throw new errors.TheraApiError({
|
|
361
|
+
statusCode: _response.error.statusCode,
|
|
362
|
+
body: _response.error.rawBody,
|
|
363
|
+
});
|
|
364
|
+
case "timeout":
|
|
365
|
+
throw new errors.TheraApiTimeoutError();
|
|
366
|
+
case "unknown":
|
|
367
|
+
throw new errors.TheraApiError({
|
|
368
|
+
message: _response.error.errorMessage,
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
initiateWorkerWithdrawal(userId, companyId, request) {
|
|
374
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
375
|
+
const _response = yield core.fetcher({
|
|
376
|
+
url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `companies/${companyId}/workers/${userId}/payout`),
|
|
377
|
+
method: "POST",
|
|
378
|
+
headers: {
|
|
379
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
380
|
+
"X-Fern-Language": "JavaScript",
|
|
381
|
+
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
382
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
383
|
+
},
|
|
384
|
+
contentType: "application/json",
|
|
385
|
+
body: yield serializers.api.thera.bank.InitiateWorkerWithdrawalRequest.jsonOrThrow(request, {
|
|
386
|
+
unrecognizedObjectKeys: "strip",
|
|
387
|
+
}),
|
|
388
|
+
timeoutMs: 60000,
|
|
389
|
+
});
|
|
390
|
+
if (_response.ok) {
|
|
391
|
+
return yield serializers.api.thera.bank.InitiateWorkerWithdrawalResponse.parseOrThrow(_response.body, {
|
|
392
|
+
unrecognizedObjectKeys: "passthrough",
|
|
393
|
+
allowUnrecognizedUnionMembers: true,
|
|
394
|
+
allowUnrecognizedEnumValues: true,
|
|
395
|
+
breadcrumbsPrefix: ["response"],
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
if (_response.error.reason === "status-code") {
|
|
399
|
+
throw new errors.TheraApiError({
|
|
400
|
+
statusCode: _response.error.statusCode,
|
|
401
|
+
body: _response.error.body,
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
switch (_response.error.reason) {
|
|
405
|
+
case "non-json":
|
|
406
|
+
throw new errors.TheraApiError({
|
|
407
|
+
statusCode: _response.error.statusCode,
|
|
408
|
+
body: _response.error.rawBody,
|
|
409
|
+
});
|
|
410
|
+
case "timeout":
|
|
411
|
+
throw new errors.TheraApiTimeoutError();
|
|
412
|
+
case "unknown":
|
|
413
|
+
throw new errors.TheraApiError({
|
|
414
|
+
message: _response.error.errorMessage,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
getWorkerBalance(userId, companyId) {
|
|
420
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
421
|
+
const _response = yield core.fetcher({
|
|
422
|
+
url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `companies/${companyId}/workers/${userId}/balances`),
|
|
423
|
+
method: "GET",
|
|
424
|
+
headers: {
|
|
425
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
426
|
+
"X-Fern-Language": "JavaScript",
|
|
427
|
+
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
428
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
429
|
+
},
|
|
430
|
+
contentType: "application/json",
|
|
431
|
+
timeoutMs: 60000,
|
|
432
|
+
});
|
|
433
|
+
if (_response.ok) {
|
|
434
|
+
return yield serializers.api.thera.bank.GetWorkerBalancesResponse.parseOrThrow(_response.body, {
|
|
435
|
+
unrecognizedObjectKeys: "passthrough",
|
|
436
|
+
allowUnrecognizedUnionMembers: true,
|
|
437
|
+
allowUnrecognizedEnumValues: true,
|
|
438
|
+
breadcrumbsPrefix: ["response"],
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
if (_response.error.reason === "status-code") {
|
|
442
|
+
throw new errors.TheraApiError({
|
|
443
|
+
statusCode: _response.error.statusCode,
|
|
444
|
+
body: _response.error.body,
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
switch (_response.error.reason) {
|
|
448
|
+
case "non-json":
|
|
449
|
+
throw new errors.TheraApiError({
|
|
450
|
+
statusCode: _response.error.statusCode,
|
|
451
|
+
body: _response.error.rawBody,
|
|
452
|
+
});
|
|
453
|
+
case "timeout":
|
|
454
|
+
throw new errors.TheraApiTimeoutError();
|
|
455
|
+
case "unknown":
|
|
456
|
+
throw new errors.TheraApiError({
|
|
457
|
+
message: _response.error.errorMessage,
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
}
|
|
330
462
|
_getAuthorizationHeader() {
|
|
331
463
|
return __awaiter(this, void 0, void 0, function* () {
|
|
332
464
|
const bearer = yield core.Supplier.get(this._options.token);
|
|
@@ -10,3 +10,8 @@ export * from "./WithdrawalMethodValidationAsync";
|
|
|
10
10
|
export * from "./ValidationAsyncParam";
|
|
11
11
|
export * from "./WithdrawalMethodValuesAllowed";
|
|
12
12
|
export * from "./SaveWithdrawalMethodResponse";
|
|
13
|
+
export * from "./DeleteWithdrawalMethodResponse";
|
|
14
|
+
export * from "./InitiateWorkerWithdrawalRequest";
|
|
15
|
+
export * from "./InitiateWorkerWithdrawalResponse";
|
|
16
|
+
export * from "./GetWorkerBalancesResponse";
|
|
17
|
+
export * from "./WorkerBalance";
|
|
@@ -26,3 +26,8 @@ __exportStar(require("./WithdrawalMethodValidationAsync"), exports);
|
|
|
26
26
|
__exportStar(require("./ValidationAsyncParam"), exports);
|
|
27
27
|
__exportStar(require("./WithdrawalMethodValuesAllowed"), exports);
|
|
28
28
|
__exportStar(require("./SaveWithdrawalMethodResponse"), exports);
|
|
29
|
+
__exportStar(require("./DeleteWithdrawalMethodResponse"), exports);
|
|
30
|
+
__exportStar(require("./InitiateWorkerWithdrawalRequest"), exports);
|
|
31
|
+
__exportStar(require("./InitiateWorkerWithdrawalResponse"), exports);
|
|
32
|
+
__exportStar(require("./GetWorkerBalancesResponse"), exports);
|
|
33
|
+
__exportStar(require("./WorkerBalance"), exports);
|
package/api/resources/api/resources/thera/resources/company/resources/companyApi/client/Client.js
CHANGED
|
@@ -65,7 +65,7 @@ class CompanyApi {
|
|
|
65
65
|
Authorization: yield this._getAuthorizationHeader(),
|
|
66
66
|
"X-Fern-Language": "JavaScript",
|
|
67
67
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
68
|
-
"X-Fern-SDK-Version": "0.0.
|
|
68
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
69
69
|
},
|
|
70
70
|
contentType: "application/json",
|
|
71
71
|
queryParameters: _queryParams,
|
|
@@ -59,7 +59,7 @@ class CompanyW2PayrollApi {
|
|
|
59
59
|
Authorization: yield this._getAuthorizationHeader(),
|
|
60
60
|
"X-Fern-Language": "JavaScript",
|
|
61
61
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
62
|
-
"X-Fern-SDK-Version": "0.0.
|
|
62
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
63
63
|
},
|
|
64
64
|
contentType: "application/json",
|
|
65
65
|
body: yield serializers.api.thera.company.OnboardW2PayrollRequest.jsonOrThrow(request, {
|
|
@@ -59,7 +59,7 @@ class DisbursementApi {
|
|
|
59
59
|
Authorization: yield this._getAuthorizationHeader(),
|
|
60
60
|
"X-Fern-Language": "JavaScript",
|
|
61
61
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
62
|
-
"X-Fern-SDK-Version": "0.0.
|
|
62
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
63
63
|
},
|
|
64
64
|
contentType: "application/json",
|
|
65
65
|
body: yield serializers.api.thera.disbursement.CreateDisbursementRequest.jsonOrThrow(request, {
|
|
@@ -103,7 +103,7 @@ class DisbursementApi {
|
|
|
103
103
|
Authorization: yield this._getAuthorizationHeader(),
|
|
104
104
|
"X-Fern-Language": "JavaScript",
|
|
105
105
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
106
|
-
"X-Fern-SDK-Version": "0.0.
|
|
106
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
107
107
|
},
|
|
108
108
|
contentType: "application/json",
|
|
109
109
|
timeoutMs: 60000,
|
|
@@ -60,7 +60,7 @@ class DisbursementWebhookApi {
|
|
|
60
60
|
Authorization: yield this._getAuthorizationHeader(),
|
|
61
61
|
"X-Fern-Language": "JavaScript",
|
|
62
62
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
63
|
-
"X-Fern-SDK-Version": "0.0.
|
|
63
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
64
64
|
"Thera-Webhook-Signature-Header": theraWebhookSignatureHeader,
|
|
65
65
|
},
|
|
66
66
|
contentType: "application/json",
|
|
@@ -59,7 +59,7 @@ class EmploymentApi {
|
|
|
59
59
|
Authorization: yield this._getAuthorizationHeader(),
|
|
60
60
|
"X-Fern-Language": "JavaScript",
|
|
61
61
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
62
|
-
"X-Fern-SDK-Version": "0.0.
|
|
62
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
63
63
|
},
|
|
64
64
|
contentType: "application/json",
|
|
65
65
|
body: yield serializers.api.thera.employment.CreateContractEstimateRequest.jsonOrThrow(request, {
|
|
@@ -108,7 +108,7 @@ class EmploymentApi {
|
|
|
108
108
|
Authorization: yield this._getAuthorizationHeader(),
|
|
109
109
|
"X-Fern-Language": "JavaScript",
|
|
110
110
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
111
|
-
"X-Fern-SDK-Version": "0.0.
|
|
111
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
112
112
|
},
|
|
113
113
|
contentType: "application/json",
|
|
114
114
|
timeoutMs: 60000,
|
package/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.js
CHANGED
|
@@ -59,7 +59,7 @@ class OncycleApi {
|
|
|
59
59
|
Authorization: yield this._getAuthorizationHeader(),
|
|
60
60
|
"X-Fern-Language": "JavaScript",
|
|
61
61
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
62
|
-
"X-Fern-SDK-Version": "0.0.
|
|
62
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
63
63
|
},
|
|
64
64
|
contentType: "application/json",
|
|
65
65
|
timeoutMs: 60000,
|
|
@@ -11,4 +11,7 @@ export interface EmployeeInformation {
|
|
|
11
11
|
complianceInformation: TheraApi.db.ComplianceInformation;
|
|
12
12
|
w8BenFileS3Key: string;
|
|
13
13
|
withdrawalMethods: Record<string, TheraApi.db.WithdrawalMethod>;
|
|
14
|
+
/** The Thera payment system that the user will using. 1 is Stripe Express, 2 is Payments V2 (Wise, etc.). This will match the `paymentsVersion` of the `Company` that invites the contractor to the platform. */
|
|
15
|
+
paymentsVersion: number;
|
|
16
|
+
settingsByCompanyId: Record<string, TheraApi.db.CompanySettings>;
|
|
14
17
|
}
|
|
@@ -3,6 +3,7 @@ export * from "./ComplianceDocument";
|
|
|
3
3
|
export * from "./ComplianceInformation";
|
|
4
4
|
export * from "./EmployeeOnboardingStatus";
|
|
5
5
|
export * from "./EmployeeInformation";
|
|
6
|
+
export * from "./CompanySettings";
|
|
6
7
|
export * from "./WithdrawalMethod";
|
|
7
8
|
export * from "./BankTransfer";
|
|
8
9
|
export * from "./User";
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./ComplianceDocument"), exports);
|
|
|
19
19
|
__exportStar(require("./ComplianceInformation"), exports);
|
|
20
20
|
__exportStar(require("./EmployeeOnboardingStatus"), exports);
|
|
21
21
|
__exportStar(require("./EmployeeInformation"), exports);
|
|
22
|
+
__exportStar(require("./CompanySettings"), exports);
|
|
22
23
|
__exportStar(require("./WithdrawalMethod"), exports);
|
|
23
24
|
__exportStar(require("./BankTransfer"), exports);
|
|
24
25
|
__exportStar(require("./User"), exports);
|
|
@@ -56,7 +56,7 @@ class File_ {
|
|
|
56
56
|
Authorization: yield this._getAuthorizationHeader(),
|
|
57
57
|
"X-Fern-Language": "JavaScript",
|
|
58
58
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
59
|
-
"X-Fern-SDK-Version": "0.0.
|
|
59
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
60
60
|
},
|
|
61
61
|
contentType: "application/json",
|
|
62
62
|
body: yield serializers.api.services.AttachDocumentToEmploymentRequest.jsonOrThrow(request, {
|
|
@@ -97,7 +97,7 @@ class File_ {
|
|
|
97
97
|
Authorization: yield this._getAuthorizationHeader(),
|
|
98
98
|
"X-Fern-Language": "JavaScript",
|
|
99
99
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
100
|
-
"X-Fern-SDK-Version": "0.0.
|
|
100
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
101
101
|
},
|
|
102
102
|
contentType: "application/json",
|
|
103
103
|
body: yield serializers.api.services.DeleteDocumentFromEmploymentRequest.jsonOrThrow(request, {
|
|
@@ -138,7 +138,7 @@ class File_ {
|
|
|
138
138
|
Authorization: yield this._getAuthorizationHeader(),
|
|
139
139
|
"X-Fern-Language": "JavaScript",
|
|
140
140
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
141
|
-
"X-Fern-SDK-Version": "0.0.
|
|
141
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
142
142
|
},
|
|
143
143
|
contentType: "application/json",
|
|
144
144
|
timeoutMs: 60000,
|
|
@@ -181,7 +181,7 @@ class File_ {
|
|
|
181
181
|
Authorization: yield this._getAuthorizationHeader(),
|
|
182
182
|
"X-Fern-Language": "JavaScript",
|
|
183
183
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
184
|
-
"X-Fern-SDK-Version": "0.0.
|
|
184
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
185
185
|
},
|
|
186
186
|
contentType: "application/json",
|
|
187
187
|
timeoutMs: 60000,
|
|
@@ -56,7 +56,7 @@ class Invoices {
|
|
|
56
56
|
Authorization: yield this._getAuthorizationHeader(),
|
|
57
57
|
"X-Fern-Language": "JavaScript",
|
|
58
58
|
"X-Fern-SDK-Name": "@thera-hr/api-sdk",
|
|
59
|
-
"X-Fern-SDK-Version": "0.0.
|
|
59
|
+
"X-Fern-SDK-Version": "0.0.1805",
|
|
60
60
|
},
|
|
61
61
|
contentType: "application/json",
|
|
62
62
|
body: yield serializers.api.test.VoidInvoiceRequest.jsonOrThrow(request, {
|
package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.d.ts
CHANGED
|
@@ -36,5 +36,8 @@ export declare class BankApi {
|
|
|
36
36
|
* After gathering all the dynamic fields required for the `Get Supported Withdrawal Methods`, they should be submitted here in order to save the payment method.
|
|
37
37
|
*/
|
|
38
38
|
saveWithdrawalMethod(userId: string, request: TheraApi.api.thera.bank.WithdrawalMethodsRequest): Promise<TheraApi.api.thera.bank.SaveWithdrawalMethodResponse>;
|
|
39
|
+
deleteWithdrawalMethod(userId: string, withdrawalMethodId: string): Promise<TheraApi.api.thera.bank.DeleteWithdrawalMethodResponse>;
|
|
40
|
+
initiateWorkerWithdrawal(userId: string, companyId: string, request: TheraApi.api.thera.bank.InitiateWorkerWithdrawalRequest): Promise<TheraApi.api.thera.bank.InitiateWorkerWithdrawalResponse>;
|
|
41
|
+
getWorkerBalance(userId: string, companyId: string): Promise<TheraApi.api.thera.bank.GetWorkerBalancesResponse>;
|
|
39
42
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
40
43
|
}
|