@thera-hr/api-sdk 0.0.1246 → 0.0.1331

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 (139) hide show
  1. package/api/resources/api/resources/services/resources/file/client/Client.d.ts +1 -0
  2. package/api/resources/api/resources/services/resources/file/client/Client.js +44 -3
  3. package/api/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.d.ts +6 -0
  4. package/api/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.js +5 -0
  5. package/api/resources/api/resources/services/resources/file/types/index.d.ts +1 -0
  6. package/api/resources/api/resources/services/resources/file/types/index.js +1 -0
  7. package/api/resources/api/resources/test/resources/invoices/client/Client.js +1 -1
  8. package/api/resources/api/resources/thera/client/Client.d.ts +3 -0
  9. package/api/resources/api/resources/thera/client/Client.js +9 -4
  10. package/api/resources/api/resources/thera/resources/authentication/resources/gustoAuthentication/client/Client.js +1 -1
  11. package/api/resources/api/resources/thera/resources/bank/client/Client.d.ts +17 -0
  12. package/api/resources/api/resources/thera/resources/bank/client/Client.js +18 -0
  13. package/api/resources/api/resources/thera/resources/bank/client/index.d.ts +1 -0
  14. package/api/resources/api/resources/thera/resources/bank/client/index.js +2 -0
  15. package/api/resources/api/resources/thera/resources/bank/index.d.ts +2 -0
  16. package/api/resources/api/resources/thera/resources/bank/index.js +18 -0
  17. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.d.ts +36 -0
  18. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.js +268 -0
  19. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/index.d.ts +1 -0
  20. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/index.js +17 -0
  21. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/GenerateBankSignupRequest.d.ts +6 -0
  22. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/GenerateBankSignupRequest.js +5 -0
  23. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/index.d.ts +1 -0
  24. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/index.js +2 -0
  25. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/index.d.ts +2 -0
  26. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/index.js +18 -0
  27. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetBankAccountSignupKey.d.ts +6 -0
  28. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetBankAccountSignupKey.js +5 -0
  29. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetSandboxPublicKey.d.ts +6 -0
  30. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetSandboxPublicKey.js +5 -0
  31. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyAccountSignupRequest.d.ts +6 -0
  32. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyAccountSignupRequest.js +5 -0
  33. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyMicrodepositRequest.d.ts +7 -0
  34. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyMicrodepositRequest.js +5 -0
  35. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +4 -0
  36. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +20 -0
  37. package/api/resources/api/resources/thera/resources/bank/resources/index.d.ts +3 -0
  38. package/api/resources/api/resources/thera/resources/bank/resources/index.js +32 -0
  39. package/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.d.ts +1 -1
  40. package/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.js +2 -2
  41. package/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/types/OnboardW2PayrollUpdateCompany.d.ts +0 -2
  42. package/api/resources/api/resources/thera/resources/index.d.ts +1 -0
  43. package/api/resources/api/resources/thera/resources/index.js +2 -1
  44. package/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.d.ts +1 -1
  45. package/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.js +2 -2
  46. package/dist/api/resources/api/resources/services/resources/file/client/Client.d.ts +1 -0
  47. package/dist/api/resources/api/resources/services/resources/file/client/Client.js +44 -3
  48. package/dist/api/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.d.ts +6 -0
  49. package/dist/api/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.js +5 -0
  50. package/dist/api/resources/api/resources/services/resources/file/types/index.d.ts +1 -0
  51. package/dist/api/resources/api/resources/services/resources/file/types/index.js +1 -0
  52. package/dist/api/resources/api/resources/test/resources/invoices/client/Client.js +1 -1
  53. package/dist/api/resources/api/resources/thera/client/Client.d.ts +3 -0
  54. package/dist/api/resources/api/resources/thera/client/Client.js +9 -4
  55. package/dist/api/resources/api/resources/thera/resources/authentication/resources/gustoAuthentication/client/Client.js +1 -1
  56. package/dist/api/resources/api/resources/thera/resources/bank/client/Client.d.ts +17 -0
  57. package/dist/api/resources/api/resources/thera/resources/bank/client/Client.js +18 -0
  58. package/dist/api/resources/api/resources/thera/resources/bank/client/index.d.ts +1 -0
  59. package/dist/api/resources/api/resources/thera/resources/bank/client/index.js +2 -0
  60. package/dist/api/resources/api/resources/thera/resources/bank/index.d.ts +2 -0
  61. package/dist/api/resources/api/resources/thera/resources/bank/index.js +18 -0
  62. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.d.ts +36 -0
  63. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.js +268 -0
  64. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/index.d.ts +1 -0
  65. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/index.js +17 -0
  66. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/GenerateBankSignupRequest.d.ts +6 -0
  67. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/GenerateBankSignupRequest.js +5 -0
  68. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/index.d.ts +1 -0
  69. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/requests/index.js +2 -0
  70. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/index.d.ts +2 -0
  71. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/index.js +18 -0
  72. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetBankAccountSignupKey.d.ts +6 -0
  73. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetBankAccountSignupKey.js +5 -0
  74. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetSandboxPublicKey.d.ts +6 -0
  75. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetSandboxPublicKey.js +5 -0
  76. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyAccountSignupRequest.d.ts +6 -0
  77. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyAccountSignupRequest.js +5 -0
  78. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyMicrodepositRequest.d.ts +7 -0
  79. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyMicrodepositRequest.js +5 -0
  80. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +4 -0
  81. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +20 -0
  82. package/dist/api/resources/api/resources/thera/resources/bank/resources/index.d.ts +3 -0
  83. package/dist/api/resources/api/resources/thera/resources/bank/resources/index.js +32 -0
  84. package/dist/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.d.ts +1 -1
  85. package/dist/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.js +2 -2
  86. package/dist/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/types/OnboardW2PayrollUpdateCompany.d.ts +0 -2
  87. package/dist/api/resources/api/resources/thera/resources/index.d.ts +1 -0
  88. package/dist/api/resources/api/resources/thera/resources/index.js +2 -1
  89. package/dist/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.d.ts +1 -1
  90. package/dist/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.js +2 -2
  91. package/dist/serialization/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.d.ts +12 -0
  92. package/dist/serialization/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.js +33 -0
  93. package/dist/serialization/resources/api/resources/services/resources/file/types/index.d.ts +1 -0
  94. package/dist/serialization/resources/api/resources/services/resources/file/types/index.js +1 -0
  95. package/dist/serialization/resources/api/resources/thera/resources/bank/index.d.ts +1 -0
  96. package/dist/serialization/resources/api/resources/thera/resources/bank/index.js +17 -0
  97. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/index.d.ts +1 -0
  98. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/index.js +17 -0
  99. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetBankAccountSignupKey.d.ts +12 -0
  100. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetBankAccountSignupKey.js +33 -0
  101. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetSandboxPublicKey.d.ts +12 -0
  102. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetSandboxPublicKey.js +33 -0
  103. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyAccountSignupRequest.d.ts +12 -0
  104. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyAccountSignupRequest.js +33 -0
  105. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyMicrodepositRequest.d.ts +13 -0
  106. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyMicrodepositRequest.js +34 -0
  107. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +4 -0
  108. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +20 -0
  109. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/index.d.ts +2 -0
  110. package/dist/serialization/resources/api/resources/thera/resources/bank/resources/index.js +31 -0
  111. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/types/OnboardW2PayrollUpdateCompany.d.ts +0 -1
  112. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/types/OnboardW2PayrollUpdateCompany.js +0 -1
  113. package/dist/serialization/resources/api/resources/thera/resources/index.d.ts +1 -0
  114. package/dist/serialization/resources/api/resources/thera/resources/index.js +2 -1
  115. package/package.json +3 -3
  116. package/serialization/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.d.ts +12 -0
  117. package/serialization/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.js +33 -0
  118. package/serialization/resources/api/resources/services/resources/file/types/index.d.ts +1 -0
  119. package/serialization/resources/api/resources/services/resources/file/types/index.js +1 -0
  120. package/serialization/resources/api/resources/thera/resources/bank/index.d.ts +1 -0
  121. package/serialization/resources/api/resources/thera/resources/bank/index.js +17 -0
  122. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/index.d.ts +1 -0
  123. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/index.js +17 -0
  124. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetBankAccountSignupKey.d.ts +12 -0
  125. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetBankAccountSignupKey.js +33 -0
  126. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetSandboxPublicKey.d.ts +12 -0
  127. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/GetSandboxPublicKey.js +33 -0
  128. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyAccountSignupRequest.d.ts +12 -0
  129. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyAccountSignupRequest.js +33 -0
  130. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyMicrodepositRequest.d.ts +13 -0
  131. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/VerifyMicrodepositRequest.js +34 -0
  132. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.d.ts +4 -0
  133. package/serialization/resources/api/resources/thera/resources/bank/resources/bankApi/types/index.js +20 -0
  134. package/serialization/resources/api/resources/thera/resources/bank/resources/index.d.ts +2 -0
  135. package/serialization/resources/api/resources/thera/resources/bank/resources/index.js +31 -0
  136. package/serialization/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/types/OnboardW2PayrollUpdateCompany.d.ts +0 -1
  137. package/serialization/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/types/OnboardW2PayrollUpdateCompany.js +0 -1
  138. package/serialization/resources/api/resources/thera/resources/index.d.ts +1 -0
  139. package/serialization/resources/api/resources/thera/resources/index.js +2 -1
@@ -15,5 +15,6 @@ export declare class File_ {
15
15
  attachDocumentToEmployment(contractId: string, request: TheraApi.api.services.AttachDocumentToEmploymentRequest): Promise<void>;
16
16
  deleteDocumentFromEmployment(contractId: string, s3Key: string, request: TheraApi.api.services.DeleteDocumentFromEmploymentRequest): Promise<void>;
17
17
  loadGenericDocumentFromEmployment(contractId: string, s3Key: string): Promise<TheraApi.api.services.LoadGenericDocumentFromEmploymentResponse>;
18
+ loadPayslipFromEorEmployment(contractId: string, s3Key: string): Promise<TheraApi.api.services.LoadPayslipForEorEmployeeResponse>;
18
19
  protected _getAuthorizationHeader(): Promise<string | undefined>;
19
20
  }
@@ -47,7 +47,7 @@ class File_ {
47
47
  Authorization: await this._getAuthorizationHeader(),
48
48
  "X-Fern-Language": "JavaScript",
49
49
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
50
- "X-Fern-SDK-Version": "0.0.1246",
50
+ "X-Fern-SDK-Version": "0.0.1331",
51
51
  },
52
52
  contentType: "application/json",
53
53
  body: await serializers.api.services.AttachDocumentToEmploymentRequest.jsonOrThrow(request, {
@@ -86,7 +86,7 @@ class File_ {
86
86
  Authorization: await this._getAuthorizationHeader(),
87
87
  "X-Fern-Language": "JavaScript",
88
88
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
89
- "X-Fern-SDK-Version": "0.0.1246",
89
+ "X-Fern-SDK-Version": "0.0.1331",
90
90
  },
91
91
  contentType: "application/json",
92
92
  body: await serializers.api.services.DeleteDocumentFromEmploymentRequest.jsonOrThrow(request, {
@@ -125,7 +125,7 @@ class File_ {
125
125
  Authorization: await this._getAuthorizationHeader(),
126
126
  "X-Fern-Language": "JavaScript",
127
127
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
128
- "X-Fern-SDK-Version": "0.0.1246",
128
+ "X-Fern-SDK-Version": "0.0.1331",
129
129
  },
130
130
  contentType: "application/json",
131
131
  timeoutMs: 60000,
@@ -158,6 +158,47 @@ class File_ {
158
158
  });
159
159
  }
160
160
  }
161
+ async loadPayslipFromEorEmployment(contractId, s3Key) {
162
+ const _response = await core.fetcher({
163
+ url: (0, url_join_1.default)(this.options.environment, `/contracts/eor/${contractId}/payslips/${s3Key}/fileUrl`),
164
+ method: "GET",
165
+ headers: {
166
+ Authorization: await this._getAuthorizationHeader(),
167
+ "X-Fern-Language": "JavaScript",
168
+ "X-Fern-SDK-Name": "@thera-hr/api-sdk",
169
+ "X-Fern-SDK-Version": "0.0.1331",
170
+ },
171
+ contentType: "application/json",
172
+ timeoutMs: 60000,
173
+ });
174
+ if (_response.ok) {
175
+ return await serializers.api.services.LoadPayslipForEorEmployeeResponse.parseOrThrow(_response.body, {
176
+ unrecognizedObjectKeys: "passthrough",
177
+ allowUnrecognizedUnionMembers: true,
178
+ allowUnrecognizedEnumValues: true,
179
+ breadcrumbsPrefix: ["response"],
180
+ });
181
+ }
182
+ if (_response.error.reason === "status-code") {
183
+ throw new errors.TheraApiError({
184
+ statusCode: _response.error.statusCode,
185
+ body: _response.error.body,
186
+ });
187
+ }
188
+ switch (_response.error.reason) {
189
+ case "non-json":
190
+ throw new errors.TheraApiError({
191
+ statusCode: _response.error.statusCode,
192
+ body: _response.error.rawBody,
193
+ });
194
+ case "timeout":
195
+ throw new errors.TheraApiTimeoutError();
196
+ case "unknown":
197
+ throw new errors.TheraApiError({
198
+ message: _response.error.errorMessage,
199
+ });
200
+ }
201
+ }
161
202
  async _getAuthorizationHeader() {
162
203
  const bearer = await core.Supplier.get(this.options.token);
163
204
  if (bearer != null) {
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface LoadPayslipForEorEmployeeResponse {
5
+ url: string;
6
+ }
@@ -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 * from "./LoadGenericDocumentFromEmploymentResponse";
2
+ export * from "./LoadPayslipForEorEmployeeResponse";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./LoadGenericDocumentFromEmploymentResponse"), exports);
18
+ __exportStar(require("./LoadPayslipForEorEmployeeResponse"), exports);
@@ -47,7 +47,7 @@ class Invoices {
47
47
  Authorization: await this._getAuthorizationHeader(),
48
48
  "X-Fern-Language": "JavaScript",
49
49
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
50
- "X-Fern-SDK-Version": "0.0.1246",
50
+ "X-Fern-SDK-Version": "0.0.1331",
51
51
  },
52
52
  contentType: "application/json",
53
53
  body: await serializers.api.test.VoidInvoiceRequest.jsonOrThrow(request, {
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as core from "../../../../../../core";
5
5
  import { Authentication } from "../resources/authentication/client/Client";
6
+ import { Bank } from "../resources/bank/client/Client";
6
7
  import { Company } from "../resources/company/client/Client";
7
8
  import { Payroll } from "../resources/payroll/client/Client";
8
9
  export declare namespace Thera {
@@ -16,6 +17,8 @@ export declare class Thera {
16
17
  constructor(options: Thera.Options);
17
18
  protected _authentication: Authentication | undefined;
18
19
  get authentication(): Authentication;
20
+ protected _bank: Bank | undefined;
21
+ get bank(): Bank;
19
22
  protected _company: Company | undefined;
20
23
  get company(): Company;
21
24
  protected _payroll: Payroll | undefined;
@@ -5,8 +5,9 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Thera = void 0;
7
7
  const Client_1 = require("../resources/authentication/client/Client");
8
- const Client_2 = require("../resources/company/client/Client");
9
- const Client_3 = require("../resources/payroll/client/Client");
8
+ const Client_2 = require("../resources/bank/client/Client");
9
+ const Client_3 = require("../resources/company/client/Client");
10
+ const Client_4 = require("../resources/payroll/client/Client");
10
11
  class Thera {
11
12
  options;
12
13
  constructor(options) {
@@ -16,13 +17,17 @@ class Thera {
16
17
  get authentication() {
17
18
  return (this._authentication ??= new Client_1.Authentication(this.options));
18
19
  }
20
+ _bank;
21
+ get bank() {
22
+ return (this._bank ??= new Client_2.Bank(this.options));
23
+ }
19
24
  _company;
20
25
  get company() {
21
- return (this._company ??= new Client_2.Company(this.options));
26
+ return (this._company ??= new Client_3.Company(this.options));
22
27
  }
23
28
  _payroll;
24
29
  get payroll() {
25
- return (this._payroll ??= new Client_3.Payroll(this.options));
30
+ return (this._payroll ??= new Client_4.Payroll(this.options));
26
31
  }
27
32
  }
28
33
  exports.Thera = Thera;
@@ -47,7 +47,7 @@ class GustoAuthentication {
47
47
  Authorization: await this._getAuthorizationHeader(),
48
48
  "X-Fern-Language": "JavaScript",
49
49
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
50
- "X-Fern-SDK-Version": "0.0.1246",
50
+ "X-Fern-SDK-Version": "0.0.1331",
51
51
  },
52
52
  contentType: "application/json",
53
53
  timeoutMs: 60000,
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../../../../../core";
5
+ import { BankApi } from "../resources/bankApi/client/Client";
6
+ export declare namespace Bank {
7
+ interface Options {
8
+ environment: string;
9
+ token: core.Supplier<core.BearerToken>;
10
+ }
11
+ }
12
+ export declare class Bank {
13
+ protected readonly options: Bank.Options;
14
+ constructor(options: Bank.Options);
15
+ protected _bankApi: BankApi | undefined;
16
+ get bankApi(): BankApi;
17
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Bank = void 0;
7
+ const Client_1 = require("../resources/bankApi/client/Client");
8
+ class Bank {
9
+ options;
10
+ constructor(options) {
11
+ this.options = options;
12
+ }
13
+ _bankApi;
14
+ get bankApi() {
15
+ return (this._bankApi ??= new Client_1.BankApi(this.options));
16
+ }
17
+ }
18
+ exports.Bank = Bank;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./resources";
2
+ export * from "./client";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./resources"), exports);
18
+ __exportStar(require("./client"), exports);
@@ -0,0 +1,36 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../../../../../../../core";
5
+ import * as TheraApi from "../../../../../../../../..";
6
+ export declare namespace BankApi {
7
+ interface Options {
8
+ environment: string;
9
+ token: core.Supplier<core.BearerToken>;
10
+ }
11
+ }
12
+ export declare class BankApi {
13
+ protected readonly options: BankApi.Options;
14
+ constructor(options: BankApi.Options);
15
+ /**
16
+ * For uses in Production Env only!
17
+ */
18
+ generateBankSignup(request?: TheraApi.api.thera.bank.GenerateBankSignupRequest): Promise<TheraApi.api.thera.bank.GetBankAccountSignupKey>;
19
+ /**
20
+ * For uses in Dev/Staging Env only!
21
+ */
22
+ getPublicTokenSandbox(): Promise<TheraApi.api.thera.bank.GetSandboxPublicKey>;
23
+ /**
24
+ * Verify that company's bank account has been provided to Plaid
25
+ */
26
+ verifyBankSignup(request: TheraApi.api.thera.bank.VerifyAccountSignupRequest): Promise<void>;
27
+ /**
28
+ * Update Zeal's bank account with info from Plaid & send microdeposit to company's bank account during W2 onboarding for Zeal API
29
+ */
30
+ sendMicrodeposit(): Promise<void>;
31
+ /**
32
+ * Verify Microdeposit for company's bank account during W2 onboarding for Zeal API
33
+ */
34
+ verifyMicrodeposit(request: TheraApi.api.thera.bank.VerifyMicrodepositRequest): Promise<void>;
35
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
36
+ }
@@ -0,0 +1,268 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.BankApi = void 0;
33
+ const core = __importStar(require("../../../../../../../../../../core"));
34
+ const url_search_params_1 = __importDefault(require("@ungap/url-search-params"));
35
+ const url_join_1 = __importDefault(require("url-join"));
36
+ const serializers = __importStar(require("../../../../../../../../../../serialization"));
37
+ const errors = __importStar(require("../../../../../../../../../../errors"));
38
+ class BankApi {
39
+ options;
40
+ constructor(options) {
41
+ this.options = options;
42
+ }
43
+ /**
44
+ * For uses in Production Env only!
45
+ */
46
+ async generateBankSignup(request = {}) {
47
+ const { redirectUri } = request;
48
+ const _queryParams = new url_search_params_1.default();
49
+ if (redirectUri != null) {
50
+ _queryParams.append("redirectUri", redirectUri);
51
+ }
52
+ const _response = await core.fetcher({
53
+ url: (0, url_join_1.default)(this.options.environment, "bank/account/signup/link"),
54
+ method: "POST",
55
+ headers: {
56
+ Authorization: await this._getAuthorizationHeader(),
57
+ "X-Fern-Language": "JavaScript",
58
+ "X-Fern-SDK-Name": "@thera-hr/api-sdk",
59
+ "X-Fern-SDK-Version": "0.0.1331",
60
+ },
61
+ contentType: "application/json",
62
+ queryParameters: _queryParams,
63
+ timeoutMs: 60000,
64
+ });
65
+ if (_response.ok) {
66
+ return await serializers.api.thera.bank.GetBankAccountSignupKey.parseOrThrow(_response.body, {
67
+ unrecognizedObjectKeys: "passthrough",
68
+ allowUnrecognizedUnionMembers: true,
69
+ allowUnrecognizedEnumValues: true,
70
+ breadcrumbsPrefix: ["response"],
71
+ });
72
+ }
73
+ if (_response.error.reason === "status-code") {
74
+ throw new errors.TheraApiError({
75
+ statusCode: _response.error.statusCode,
76
+ body: _response.error.body,
77
+ });
78
+ }
79
+ switch (_response.error.reason) {
80
+ case "non-json":
81
+ throw new errors.TheraApiError({
82
+ statusCode: _response.error.statusCode,
83
+ body: _response.error.rawBody,
84
+ });
85
+ case "timeout":
86
+ throw new errors.TheraApiTimeoutError();
87
+ case "unknown":
88
+ throw new errors.TheraApiError({
89
+ message: _response.error.errorMessage,
90
+ });
91
+ }
92
+ }
93
+ /**
94
+ * For uses in Dev/Staging Env only!
95
+ */
96
+ async getPublicTokenSandbox() {
97
+ const _response = await core.fetcher({
98
+ url: (0, url_join_1.default)(this.options.environment, "sandbox/bank/account/publicToken"),
99
+ method: "GET",
100
+ headers: {
101
+ Authorization: await this._getAuthorizationHeader(),
102
+ "X-Fern-Language": "JavaScript",
103
+ "X-Fern-SDK-Name": "@thera-hr/api-sdk",
104
+ "X-Fern-SDK-Version": "0.0.1331",
105
+ },
106
+ contentType: "application/json",
107
+ timeoutMs: 60000,
108
+ });
109
+ if (_response.ok) {
110
+ return await serializers.api.thera.bank.GetSandboxPublicKey.parseOrThrow(_response.body, {
111
+ unrecognizedObjectKeys: "passthrough",
112
+ allowUnrecognizedUnionMembers: true,
113
+ allowUnrecognizedEnumValues: true,
114
+ breadcrumbsPrefix: ["response"],
115
+ });
116
+ }
117
+ if (_response.error.reason === "status-code") {
118
+ throw new errors.TheraApiError({
119
+ statusCode: _response.error.statusCode,
120
+ body: _response.error.body,
121
+ });
122
+ }
123
+ switch (_response.error.reason) {
124
+ case "non-json":
125
+ throw new errors.TheraApiError({
126
+ statusCode: _response.error.statusCode,
127
+ body: _response.error.rawBody,
128
+ });
129
+ case "timeout":
130
+ throw new errors.TheraApiTimeoutError();
131
+ case "unknown":
132
+ throw new errors.TheraApiError({
133
+ message: _response.error.errorMessage,
134
+ });
135
+ }
136
+ }
137
+ /**
138
+ * Verify that company's bank account has been provided to Plaid
139
+ */
140
+ async verifyBankSignup(request) {
141
+ const _response = await core.fetcher({
142
+ url: (0, url_join_1.default)(this.options.environment, "bank/account/signup/verify"),
143
+ method: "POST",
144
+ headers: {
145
+ Authorization: await this._getAuthorizationHeader(),
146
+ "X-Fern-Language": "JavaScript",
147
+ "X-Fern-SDK-Name": "@thera-hr/api-sdk",
148
+ "X-Fern-SDK-Version": "0.0.1331",
149
+ },
150
+ contentType: "application/json",
151
+ body: await serializers.api.thera.bank.VerifyAccountSignupRequest.jsonOrThrow(request, {
152
+ unrecognizedObjectKeys: "strip",
153
+ }),
154
+ timeoutMs: 60000,
155
+ });
156
+ if (_response.ok) {
157
+ return;
158
+ }
159
+ if (_response.error.reason === "status-code") {
160
+ throw new errors.TheraApiError({
161
+ statusCode: _response.error.statusCode,
162
+ body: _response.error.body,
163
+ });
164
+ }
165
+ switch (_response.error.reason) {
166
+ case "non-json":
167
+ throw new errors.TheraApiError({
168
+ statusCode: _response.error.statusCode,
169
+ body: _response.error.rawBody,
170
+ });
171
+ case "timeout":
172
+ throw new errors.TheraApiTimeoutError();
173
+ case "unknown":
174
+ throw new errors.TheraApiError({
175
+ message: _response.error.errorMessage,
176
+ });
177
+ }
178
+ }
179
+ /**
180
+ * Update Zeal's bank account with info from Plaid & send microdeposit to company's bank account during W2 onboarding for Zeal API
181
+ */
182
+ async sendMicrodeposit() {
183
+ const _response = await core.fetcher({
184
+ url: (0, url_join_1.default)(this.options.environment, "bank/account/microdeposit/request"),
185
+ method: "POST",
186
+ headers: {
187
+ Authorization: await this._getAuthorizationHeader(),
188
+ "X-Fern-Language": "JavaScript",
189
+ "X-Fern-SDK-Name": "@thera-hr/api-sdk",
190
+ "X-Fern-SDK-Version": "0.0.1331",
191
+ },
192
+ contentType: "application/json",
193
+ timeoutMs: 60000,
194
+ });
195
+ if (_response.ok) {
196
+ return;
197
+ }
198
+ if (_response.error.reason === "status-code") {
199
+ throw new errors.TheraApiError({
200
+ statusCode: _response.error.statusCode,
201
+ body: _response.error.body,
202
+ });
203
+ }
204
+ switch (_response.error.reason) {
205
+ case "non-json":
206
+ throw new errors.TheraApiError({
207
+ statusCode: _response.error.statusCode,
208
+ body: _response.error.rawBody,
209
+ });
210
+ case "timeout":
211
+ throw new errors.TheraApiTimeoutError();
212
+ case "unknown":
213
+ throw new errors.TheraApiError({
214
+ message: _response.error.errorMessage,
215
+ });
216
+ }
217
+ }
218
+ /**
219
+ * Verify Microdeposit for company's bank account during W2 onboarding for Zeal API
220
+ */
221
+ async verifyMicrodeposit(request) {
222
+ const _response = await core.fetcher({
223
+ url: (0, url_join_1.default)(this.options.environment, "bank/account/microdeposit/verification"),
224
+ method: "POST",
225
+ headers: {
226
+ Authorization: await this._getAuthorizationHeader(),
227
+ "X-Fern-Language": "JavaScript",
228
+ "X-Fern-SDK-Name": "@thera-hr/api-sdk",
229
+ "X-Fern-SDK-Version": "0.0.1331",
230
+ },
231
+ contentType: "application/json",
232
+ body: await serializers.api.thera.bank.VerifyMicrodepositRequest.jsonOrThrow(request, {
233
+ unrecognizedObjectKeys: "strip",
234
+ }),
235
+ timeoutMs: 60000,
236
+ });
237
+ if (_response.ok) {
238
+ return;
239
+ }
240
+ if (_response.error.reason === "status-code") {
241
+ throw new errors.TheraApiError({
242
+ statusCode: _response.error.statusCode,
243
+ body: _response.error.body,
244
+ });
245
+ }
246
+ switch (_response.error.reason) {
247
+ case "non-json":
248
+ throw new errors.TheraApiError({
249
+ statusCode: _response.error.statusCode,
250
+ body: _response.error.rawBody,
251
+ });
252
+ case "timeout":
253
+ throw new errors.TheraApiTimeoutError();
254
+ case "unknown":
255
+ throw new errors.TheraApiError({
256
+ message: _response.error.errorMessage,
257
+ });
258
+ }
259
+ }
260
+ async _getAuthorizationHeader() {
261
+ const bearer = await core.Supplier.get(this.options.token);
262
+ if (bearer != null) {
263
+ return `Bearer ${bearer}`;
264
+ }
265
+ return undefined;
266
+ }
267
+ }
268
+ exports.BankApi = BankApi;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface GenerateBankSignupRequest {
5
+ redirectUri?: string;
6
+ }
@@ -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 });
@@ -0,0 +1 @@
1
+ export { GenerateBankSignupRequest } from "./GenerateBankSignupRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./types";
2
+ export * from "./client";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./client"), exports);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface GetBankAccountSignupKey {
5
+ linkToken: string;
6
+ }
@@ -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 });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface GetSandboxPublicKey {
5
+ sandboxPublicKey: string;
6
+ }
@@ -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 });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface VerifyAccountSignupRequest {
5
+ publicKey: string;
6
+ }