@thera-hr/api-sdk 0.0.2154 → 0.0.2176

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/api/resources/api/resources/aiprise/resources/aipriseWebhookApi/client/Client.js +1 -1
  2. package/api/resources/api/resources/services/resources/file/client/Client.js +4 -4
  3. package/api/resources/api/resources/test/resources/invoices/client/Client.js +1 -1
  4. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.d.ts +1 -0
  5. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.js +57 -11
  6. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/EditWithdrawalMethodRequest.d.ts +7 -0
  7. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/EditWithdrawalMethodRequest.js +5 -0
  8. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/index.d.ts +1 -0
  9. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/EditWithdrawalMethodResponse.d.ts +5 -0
  10. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/EditWithdrawalMethodResponse.js +5 -0
  11. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/WithdrawalMethodsRequest.d.ts +2 -0
  12. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +1 -0
  13. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +1 -0
  14. package/api/resources/api/resources/thera/resources/company/resources/companyApi/client/Client.js +1 -1
  15. package/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.js +1 -1
  16. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementApi/client/Client.js +2 -2
  17. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/Client.js +1 -1
  18. package/api/resources/api/resources/thera/resources/employment/resources/employmentApi/client/Client.js +3 -3
  19. package/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.js +1 -1
  20. package/api/resources/api/resources/thera/resources/user/resources/userApi/client/Client.js +1 -1
  21. package/api/resources/db/resources/user/types/EmployeeInformation.d.ts +1 -0
  22. package/dist/api/resources/api/resources/aiprise/resources/aipriseWebhookApi/client/Client.js +1 -1
  23. package/dist/api/resources/api/resources/services/resources/file/client/Client.js +4 -4
  24. package/dist/api/resources/api/resources/test/resources/invoices/client/Client.js +1 -1
  25. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.d.ts +1 -0
  26. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.js +57 -11
  27. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/EditWithdrawalMethodRequest.d.ts +7 -0
  28. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/EditWithdrawalMethodRequest.js +5 -0
  29. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/index.d.ts +1 -0
  30. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/EditWithdrawalMethodResponse.d.ts +5 -0
  31. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/EditWithdrawalMethodResponse.js +5 -0
  32. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/WithdrawalMethodsRequest.d.ts +2 -0
  33. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +1 -0
  34. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +1 -0
  35. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/client/Client.js +1 -1
  36. package/dist/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.js +1 -1
  37. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementApi/client/Client.js +2 -2
  38. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/Client.js +1 -1
  39. package/dist/api/resources/api/resources/thera/resources/employment/resources/employmentApi/client/Client.js +3 -3
  40. package/dist/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.js +1 -1
  41. package/dist/api/resources/api/resources/thera/resources/user/resources/userApi/client/Client.js +1 -1
  42. package/dist/api/resources/db/resources/user/types/EmployeeInformation.d.ts +1 -0
  43. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/index.d.ts +1 -0
  44. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/index.js +4 -0
  45. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/EditWithdrawalMethodRequest.d.ts +12 -0
  46. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/EditWithdrawalMethodRequest.js +33 -0
  47. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/index.d.ts +1 -0
  48. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/index.js +5 -0
  49. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/EditWithdrawalMethodResponse.d.ts +11 -0
  50. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/EditWithdrawalMethodResponse.js +31 -0
  51. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/WithdrawalMethodsRequest.d.ts +1 -0
  52. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/WithdrawalMethodsRequest.js +1 -0
  53. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +1 -0
  54. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +1 -0
  55. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/index.d.ts +1 -0
  56. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/index.js +1 -0
  57. package/dist/serialization/resources/db/resources/user/types/EmployeeInformation.d.ts +1 -0
  58. package/dist/serialization/resources/db/resources/user/types/EmployeeInformation.js +1 -0
  59. package/package.json +1 -1
  60. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/index.d.ts +1 -0
  61. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/index.js +4 -0
  62. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/EditWithdrawalMethodRequest.d.ts +12 -0
  63. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/EditWithdrawalMethodRequest.js +33 -0
  64. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/index.d.ts +1 -0
  65. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/index.js +5 -0
  66. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/EditWithdrawalMethodResponse.d.ts +11 -0
  67. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/EditWithdrawalMethodResponse.js +31 -0
  68. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/WithdrawalMethodsRequest.d.ts +1 -0
  69. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/WithdrawalMethodsRequest.js +1 -0
  70. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +1 -0
  71. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +1 -0
  72. package/serialization/resources/api/resources/thera/resources/bank/resources/index.d.ts +1 -0
  73. package/serialization/resources/api/resources/thera/resources/bank/resources/index.js +1 -0
  74. package/serialization/resources/db/resources/user/types/EmployeeInformation.d.ts +1 -0
  75. package/serialization/resources/db/resources/user/types/EmployeeInformation.js +1 -0
@@ -59,7 +59,7 @@ class AipriseWebhookApi {
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.2154",
62
+ "X-Fern-SDK-Version": "0.0.2176",
63
63
  },
64
64
  contentType: "application/json",
65
65
  body: yield serializers.api.aiprise.AiPriseVerificationCallback.jsonOrThrow(request, {
@@ -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.2154",
59
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
100
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
141
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
184
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
59
+ "X-Fern-SDK-Version": "0.0.2176",
60
60
  },
61
61
  contentType: "application/json",
62
62
  body: yield serializers.api.test.VoidInvoiceRequest.jsonOrThrow(request, {
@@ -41,6 +41,7 @@ export declare class BankApi {
41
41
  */
42
42
  saveWithdrawalMethod(userId: string, request: TheraApi.api.thera.bank.WithdrawalMethodsRequest): Promise<TheraApi.api.thera.bank.SaveWithdrawalMethodResponse>;
43
43
  deleteWithdrawalMethod(userId: string, withdrawalMethodId: string): Promise<TheraApi.api.thera.bank.DeleteWithdrawalMethodResponse>;
44
+ editWithdrawalMethod(userId: string, withdrawalMethodId: string, request: TheraApi.api.thera.bank.EditWithdrawalMethodRequest): Promise<TheraApi.api.thera.bank.EditWithdrawalMethodResponse>;
44
45
  initiateWorkerWithdrawal(userId: string, companyId: string, request: TheraApi.api.thera.bank.InitiateWorkerWithdrawalRequest): Promise<TheraApi.api.thera.bank.InitiateWorkerWithdrawalResponse>;
45
46
  getWorkerBalance(userId: string, companyId: string): Promise<TheraApi.api.thera.bank.GetWorkerBalancesResponse>;
46
47
  getWorkerTransactions(userId: string, companyId: string): Promise<TheraApi.api.thera.bank.GetWorkerTransactionsResponse>;
@@ -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.2154",
68
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
115
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
159
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
200
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
244
+ "X-Fern-SDK-Version": "0.0.2176",
245
245
  },
246
246
  contentType: "application/json",
247
247
  timeoutMs: 60000,
@@ -287,7 +287,7 @@ class BankApi {
287
287
  Authorization: yield this._getAuthorizationHeader(),
288
288
  "X-Fern-Language": "JavaScript",
289
289
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
290
- "X-Fern-SDK-Version": "0.0.2154",
290
+ "X-Fern-SDK-Version": "0.0.2176",
291
291
  },
292
292
  contentType: "application/json",
293
293
  body: yield serializers.api.thera.bank.WithdrawalMethodsRequest.jsonOrThrow(request, {
@@ -336,7 +336,7 @@ class BankApi {
336
336
  Authorization: yield this._getAuthorizationHeader(),
337
337
  "X-Fern-Language": "JavaScript",
338
338
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
339
- "X-Fern-SDK-Version": "0.0.2154",
339
+ "X-Fern-SDK-Version": "0.0.2176",
340
340
  },
341
341
  contentType: "application/json",
342
342
  body: yield serializers.api.thera.bank.WithdrawalMethodsRequest.jsonOrThrow(request, {
@@ -382,7 +382,7 @@ class BankApi {
382
382
  Authorization: yield this._getAuthorizationHeader(),
383
383
  "X-Fern-Language": "JavaScript",
384
384
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
385
- "X-Fern-SDK-Version": "0.0.2154",
385
+ "X-Fern-SDK-Version": "0.0.2176",
386
386
  },
387
387
  contentType: "application/json",
388
388
  timeoutMs: 60000,
@@ -416,6 +416,52 @@ class BankApi {
416
416
  }
417
417
  });
418
418
  }
419
+ editWithdrawalMethod(userId, withdrawalMethodId, request) {
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), `worker/${userId}/withdrawal-method/${withdrawalMethodId}`),
423
+ method: "PATCH",
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.2176",
429
+ },
430
+ contentType: "application/json",
431
+ body: yield serializers.api.thera.bank.EditWithdrawalMethodRequest.jsonOrThrow(request, {
432
+ unrecognizedObjectKeys: "strip",
433
+ }),
434
+ timeoutMs: 60000,
435
+ });
436
+ if (_response.ok) {
437
+ return yield serializers.api.thera.bank.EditWithdrawalMethodResponse.parseOrThrow(_response.body, {
438
+ unrecognizedObjectKeys: "passthrough",
439
+ allowUnrecognizedUnionMembers: true,
440
+ allowUnrecognizedEnumValues: true,
441
+ breadcrumbsPrefix: ["response"],
442
+ });
443
+ }
444
+ if (_response.error.reason === "status-code") {
445
+ throw new errors.TheraApiError({
446
+ statusCode: _response.error.statusCode,
447
+ body: _response.error.body,
448
+ });
449
+ }
450
+ switch (_response.error.reason) {
451
+ case "non-json":
452
+ throw new errors.TheraApiError({
453
+ statusCode: _response.error.statusCode,
454
+ body: _response.error.rawBody,
455
+ });
456
+ case "timeout":
457
+ throw new errors.TheraApiTimeoutError();
458
+ case "unknown":
459
+ throw new errors.TheraApiError({
460
+ message: _response.error.errorMessage,
461
+ });
462
+ }
463
+ });
464
+ }
419
465
  initiateWorkerWithdrawal(userId, companyId, request) {
420
466
  return __awaiter(this, void 0, void 0, function* () {
421
467
  const _response = yield core.fetcher({
@@ -425,7 +471,7 @@ class BankApi {
425
471
  Authorization: yield this._getAuthorizationHeader(),
426
472
  "X-Fern-Language": "JavaScript",
427
473
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
428
- "X-Fern-SDK-Version": "0.0.2154",
474
+ "X-Fern-SDK-Version": "0.0.2176",
429
475
  },
430
476
  contentType: "application/json",
431
477
  body: yield serializers.api.thera.bank.InitiateWorkerWithdrawalRequest.jsonOrThrow(request, {
@@ -471,7 +517,7 @@ class BankApi {
471
517
  Authorization: yield this._getAuthorizationHeader(),
472
518
  "X-Fern-Language": "JavaScript",
473
519
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
474
- "X-Fern-SDK-Version": "0.0.2154",
520
+ "X-Fern-SDK-Version": "0.0.2176",
475
521
  },
476
522
  contentType: "application/json",
477
523
  timeoutMs: 60000,
@@ -514,7 +560,7 @@ class BankApi {
514
560
  Authorization: yield this._getAuthorizationHeader(),
515
561
  "X-Fern-Language": "JavaScript",
516
562
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
517
- "X-Fern-SDK-Version": "0.0.2154",
563
+ "X-Fern-SDK-Version": "0.0.2176",
518
564
  },
519
565
  contentType: "application/json",
520
566
  timeoutMs: 60000,
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface EditWithdrawalMethodRequest {
5
+ /** For now, exception is thrown if this is set to false; you can't remove a preferred payment method without setting a new one. */
6
+ preferred: boolean;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
1
  export { GenerateBankSignupRequest } from "./GenerateBankSignupRequest";
2
+ export { EditWithdrawalMethodRequest } from "./EditWithdrawalMethodRequest";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface EditWithdrawalMethodResponse {
5
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,4 +9,6 @@ export interface WithdrawalMethodsRequest {
9
9
  type?: string;
10
10
  title?: string;
11
11
  details: Record<string, string>;
12
+ /** If true, sets this withdrawal method the default payment method. If this is false and there is no preferred payment method, it will be set to preferred method anyways. */
13
+ preferred: boolean;
12
14
  }
@@ -5,6 +5,7 @@ export * from "./GetBankAccountSignupKey";
5
5
  export * from "./GetWithdrawalMethodCurrenciesResponse";
6
6
  export * from "./WithdrawalMethodCurrency";
7
7
  export * from "./WithdrawalMethodsRequest";
8
+ export * from "./EditWithdrawalMethodResponse";
8
9
  export * from "./SingleWithdrawalMethodResponse";
9
10
  export * from "./WithdrawalMethodField";
10
11
  export * from "./WithdrawalMethodGroup";
@@ -21,6 +21,7 @@ __exportStar(require("./GetBankAccountSignupKey"), exports);
21
21
  __exportStar(require("./GetWithdrawalMethodCurrenciesResponse"), exports);
22
22
  __exportStar(require("./WithdrawalMethodCurrency"), exports);
23
23
  __exportStar(require("./WithdrawalMethodsRequest"), exports);
24
+ __exportStar(require("./EditWithdrawalMethodResponse"), exports);
24
25
  __exportStar(require("./SingleWithdrawalMethodResponse"), exports);
25
26
  __exportStar(require("./WithdrawalMethodField"), exports);
26
27
  __exportStar(require("./WithdrawalMethodGroup"), exports);
@@ -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.2154",
68
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
62
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
62
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
106
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
63
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
62
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
111
+ "X-Fern-SDK-Version": "0.0.2176",
112
112
  },
113
113
  contentType: "application/json",
114
114
  timeoutMs: 60000,
@@ -154,7 +154,7 @@ class EmploymentApi {
154
154
  Authorization: yield this._getAuthorizationHeader(),
155
155
  "X-Fern-Language": "JavaScript",
156
156
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
157
- "X-Fern-SDK-Version": "0.0.2154",
157
+ "X-Fern-SDK-Version": "0.0.2176",
158
158
  },
159
159
  contentType: "application/json",
160
160
  timeoutMs: 60000,
@@ -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.2154",
62
+ "X-Fern-SDK-Version": "0.0.2176",
63
63
  },
64
64
  contentType: "application/json",
65
65
  timeoutMs: 60000,
@@ -63,7 +63,7 @@ class UserApi {
63
63
  Authorization: yield this._getAuthorizationHeader(),
64
64
  "X-Fern-Language": "JavaScript",
65
65
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
66
- "X-Fern-SDK-Version": "0.0.2154",
66
+ "X-Fern-SDK-Version": "0.0.2176",
67
67
  },
68
68
  contentType: "application/json",
69
69
  queryParameters: _queryParams,
@@ -11,6 +11,7 @@ export interface EmployeeInformation {
11
11
  complianceInformation: TheraApi.db.ComplianceInformation;
12
12
  w8BenFileS3Key: string;
13
13
  withdrawalMethods: Record<string, TheraApi.db.WithdrawalMethod>;
14
+ preferredWithdrawalMethod: string;
14
15
  /** 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
16
  paymentsVersion: number;
16
17
  settingsByCompanyId: Record<string, TheraApi.db.CompanySettings>;
@@ -59,7 +59,7 @@ class AipriseWebhookApi {
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.2154",
62
+ "X-Fern-SDK-Version": "0.0.2176",
63
63
  },
64
64
  contentType: "application/json",
65
65
  body: yield serializers.api.aiprise.AiPriseVerificationCallback.jsonOrThrow(request, {
@@ -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.2154",
59
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
100
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
141
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
184
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
59
+ "X-Fern-SDK-Version": "0.0.2176",
60
60
  },
61
61
  contentType: "application/json",
62
62
  body: yield serializers.api.test.VoidInvoiceRequest.jsonOrThrow(request, {
@@ -41,6 +41,7 @@ export declare class BankApi {
41
41
  */
42
42
  saveWithdrawalMethod(userId: string, request: TheraApi.api.thera.bank.WithdrawalMethodsRequest): Promise<TheraApi.api.thera.bank.SaveWithdrawalMethodResponse>;
43
43
  deleteWithdrawalMethod(userId: string, withdrawalMethodId: string): Promise<TheraApi.api.thera.bank.DeleteWithdrawalMethodResponse>;
44
+ editWithdrawalMethod(userId: string, withdrawalMethodId: string, request: TheraApi.api.thera.bank.EditWithdrawalMethodRequest): Promise<TheraApi.api.thera.bank.EditWithdrawalMethodResponse>;
44
45
  initiateWorkerWithdrawal(userId: string, companyId: string, request: TheraApi.api.thera.bank.InitiateWorkerWithdrawalRequest): Promise<TheraApi.api.thera.bank.InitiateWorkerWithdrawalResponse>;
45
46
  getWorkerBalance(userId: string, companyId: string): Promise<TheraApi.api.thera.bank.GetWorkerBalancesResponse>;
46
47
  getWorkerTransactions(userId: string, companyId: string): Promise<TheraApi.api.thera.bank.GetWorkerTransactionsResponse>;
@@ -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.2154",
68
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
115
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
159
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
200
+ "X-Fern-SDK-Version": "0.0.2176",
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.2154",
244
+ "X-Fern-SDK-Version": "0.0.2176",
245
245
  },
246
246
  contentType: "application/json",
247
247
  timeoutMs: 60000,
@@ -287,7 +287,7 @@ class BankApi {
287
287
  Authorization: yield this._getAuthorizationHeader(),
288
288
  "X-Fern-Language": "JavaScript",
289
289
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
290
- "X-Fern-SDK-Version": "0.0.2154",
290
+ "X-Fern-SDK-Version": "0.0.2176",
291
291
  },
292
292
  contentType: "application/json",
293
293
  body: yield serializers.api.thera.bank.WithdrawalMethodsRequest.jsonOrThrow(request, {
@@ -336,7 +336,7 @@ class BankApi {
336
336
  Authorization: yield this._getAuthorizationHeader(),
337
337
  "X-Fern-Language": "JavaScript",
338
338
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
339
- "X-Fern-SDK-Version": "0.0.2154",
339
+ "X-Fern-SDK-Version": "0.0.2176",
340
340
  },
341
341
  contentType: "application/json",
342
342
  body: yield serializers.api.thera.bank.WithdrawalMethodsRequest.jsonOrThrow(request, {
@@ -382,7 +382,7 @@ class BankApi {
382
382
  Authorization: yield this._getAuthorizationHeader(),
383
383
  "X-Fern-Language": "JavaScript",
384
384
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
385
- "X-Fern-SDK-Version": "0.0.2154",
385
+ "X-Fern-SDK-Version": "0.0.2176",
386
386
  },
387
387
  contentType: "application/json",
388
388
  timeoutMs: 60000,
@@ -416,6 +416,52 @@ class BankApi {
416
416
  }
417
417
  });
418
418
  }
419
+ editWithdrawalMethod(userId, withdrawalMethodId, request) {
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), `worker/${userId}/withdrawal-method/${withdrawalMethodId}`),
423
+ method: "PATCH",
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.2176",
429
+ },
430
+ contentType: "application/json",
431
+ body: yield serializers.api.thera.bank.EditWithdrawalMethodRequest.jsonOrThrow(request, {
432
+ unrecognizedObjectKeys: "strip",
433
+ }),
434
+ timeoutMs: 60000,
435
+ });
436
+ if (_response.ok) {
437
+ return yield serializers.api.thera.bank.EditWithdrawalMethodResponse.parseOrThrow(_response.body, {
438
+ unrecognizedObjectKeys: "passthrough",
439
+ allowUnrecognizedUnionMembers: true,
440
+ allowUnrecognizedEnumValues: true,
441
+ breadcrumbsPrefix: ["response"],
442
+ });
443
+ }
444
+ if (_response.error.reason === "status-code") {
445
+ throw new errors.TheraApiError({
446
+ statusCode: _response.error.statusCode,
447
+ body: _response.error.body,
448
+ });
449
+ }
450
+ switch (_response.error.reason) {
451
+ case "non-json":
452
+ throw new errors.TheraApiError({
453
+ statusCode: _response.error.statusCode,
454
+ body: _response.error.rawBody,
455
+ });
456
+ case "timeout":
457
+ throw new errors.TheraApiTimeoutError();
458
+ case "unknown":
459
+ throw new errors.TheraApiError({
460
+ message: _response.error.errorMessage,
461
+ });
462
+ }
463
+ });
464
+ }
419
465
  initiateWorkerWithdrawal(userId, companyId, request) {
420
466
  return __awaiter(this, void 0, void 0, function* () {
421
467
  const _response = yield core.fetcher({
@@ -425,7 +471,7 @@ class BankApi {
425
471
  Authorization: yield this._getAuthorizationHeader(),
426
472
  "X-Fern-Language": "JavaScript",
427
473
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
428
- "X-Fern-SDK-Version": "0.0.2154",
474
+ "X-Fern-SDK-Version": "0.0.2176",
429
475
  },
430
476
  contentType: "application/json",
431
477
  body: yield serializers.api.thera.bank.InitiateWorkerWithdrawalRequest.jsonOrThrow(request, {
@@ -471,7 +517,7 @@ class BankApi {
471
517
  Authorization: yield this._getAuthorizationHeader(),
472
518
  "X-Fern-Language": "JavaScript",
473
519
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
474
- "X-Fern-SDK-Version": "0.0.2154",
520
+ "X-Fern-SDK-Version": "0.0.2176",
475
521
  },
476
522
  contentType: "application/json",
477
523
  timeoutMs: 60000,
@@ -514,7 +560,7 @@ class BankApi {
514
560
  Authorization: yield this._getAuthorizationHeader(),
515
561
  "X-Fern-Language": "JavaScript",
516
562
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
517
- "X-Fern-SDK-Version": "0.0.2154",
563
+ "X-Fern-SDK-Version": "0.0.2176",
518
564
  },
519
565
  contentType: "application/json",
520
566
  timeoutMs: 60000,
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface EditWithdrawalMethodRequest {
5
+ /** For now, exception is thrown if this is set to false; you can't remove a preferred payment method without setting a new one. */
6
+ preferred: boolean;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
1
  export { GenerateBankSignupRequest } from "./GenerateBankSignupRequest";
2
+ export { EditWithdrawalMethodRequest } from "./EditWithdrawalMethodRequest";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface EditWithdrawalMethodResponse {
5
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });