@thera-hr/api-sdk 0.0.1246 → 0.0.1284

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 (29) 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/resources/authentication/resources/gustoAuthentication/client/Client.js +1 -1
  9. package/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.js +1 -1
  10. package/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.js +1 -1
  11. package/dist/api/resources/api/resources/services/resources/file/client/Client.d.ts +1 -0
  12. package/dist/api/resources/api/resources/services/resources/file/client/Client.js +44 -3
  13. package/dist/api/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.d.ts +6 -0
  14. package/dist/api/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.js +5 -0
  15. package/dist/api/resources/api/resources/services/resources/file/types/index.d.ts +1 -0
  16. package/dist/api/resources/api/resources/services/resources/file/types/index.js +1 -0
  17. package/dist/api/resources/api/resources/test/resources/invoices/client/Client.js +1 -1
  18. package/dist/api/resources/api/resources/thera/resources/authentication/resources/gustoAuthentication/client/Client.js +1 -1
  19. package/dist/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.js +1 -1
  20. package/dist/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.js +1 -1
  21. package/dist/serialization/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.d.ts +12 -0
  22. package/dist/serialization/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.js +33 -0
  23. package/dist/serialization/resources/api/resources/services/resources/file/types/index.d.ts +1 -0
  24. package/dist/serialization/resources/api/resources/services/resources/file/types/index.js +1 -0
  25. package/package.json +1 -1
  26. package/serialization/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.d.ts +12 -0
  27. package/serialization/resources/api/resources/services/resources/file/types/LoadPayslipForEorEmployeeResponse.js +33 -0
  28. package/serialization/resources/api/resources/services/resources/file/types/index.d.ts +1 -0
  29. package/serialization/resources/api/resources/services/resources/file/types/index.js +1 -0
@@ -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.1284",
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.1284",
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.1284",
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.1284",
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.1284",
51
51
  },
52
52
  contentType: "application/json",
53
53
  body: await serializers.api.test.VoidInvoiceRequest.jsonOrThrow(request, {
@@ -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.1284",
51
51
  },
52
52
  contentType: "application/json",
53
53
  timeoutMs: 60000,
@@ -50,7 +50,7 @@ class CompanyW2PayrollApi {
50
50
  Authorization: await this._getAuthorizationHeader(),
51
51
  "X-Fern-Language": "JavaScript",
52
52
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
53
- "X-Fern-SDK-Version": "0.0.1246",
53
+ "X-Fern-SDK-Version": "0.0.1284",
54
54
  },
55
55
  contentType: "application/json",
56
56
  body: await serializers.api.thera.company.OnboardW2PayrollRequest.jsonOrThrow(request, {
@@ -50,7 +50,7 @@ class OncycleApi {
50
50
  Authorization: await this._getAuthorizationHeader(),
51
51
  "X-Fern-Language": "JavaScript",
52
52
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
53
- "X-Fern-SDK-Version": "0.0.1246",
53
+ "X-Fern-SDK-Version": "0.0.1284",
54
54
  },
55
55
  contentType: "application/json",
56
56
  timeoutMs: 60000,
@@ -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.1284",
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.1284",
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.1284",
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.1284",
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.1284",
51
51
  },
52
52
  contentType: "application/json",
53
53
  body: await serializers.api.test.VoidInvoiceRequest.jsonOrThrow(request, {
@@ -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.1284",
51
51
  },
52
52
  contentType: "application/json",
53
53
  timeoutMs: 60000,
@@ -50,7 +50,7 @@ class CompanyW2PayrollApi {
50
50
  Authorization: await this._getAuthorizationHeader(),
51
51
  "X-Fern-Language": "JavaScript",
52
52
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
53
- "X-Fern-SDK-Version": "0.0.1246",
53
+ "X-Fern-SDK-Version": "0.0.1284",
54
54
  },
55
55
  contentType: "application/json",
56
56
  body: await serializers.api.thera.company.OnboardW2PayrollRequest.jsonOrThrow(request, {
@@ -50,7 +50,7 @@ class OncycleApi {
50
50
  Authorization: await this._getAuthorizationHeader(),
51
51
  "X-Fern-Language": "JavaScript",
52
52
  "X-Fern-SDK-Name": "@thera-hr/api-sdk",
53
- "X-Fern-SDK-Version": "0.0.1246",
53
+ "X-Fern-SDK-Version": "0.0.1284",
54
54
  },
55
55
  contentType: "application/json",
56
56
  timeoutMs: 60000,
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../../../../..";
5
+ import * as TheraApi from "../../../../../../../../api";
6
+ import * as core from "../../../../../../../../core";
7
+ export declare const LoadPayslipForEorEmployeeResponse: core.serialization.ObjectSchema<serializers.api.services.LoadPayslipForEorEmployeeResponse.Raw, TheraApi.api.services.LoadPayslipForEorEmployeeResponse>;
8
+ export declare namespace LoadPayslipForEorEmployeeResponse {
9
+ interface Raw {
10
+ url: string;
11
+ }
12
+ }
@@ -0,0 +1,33 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.LoadPayslipForEorEmployeeResponse = void 0;
30
+ const core = __importStar(require("../../../../../../../../core"));
31
+ exports.LoadPayslipForEorEmployeeResponse = core.serialization.object({
32
+ url: core.serialization.string(),
33
+ });
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thera-hr/api-sdk",
3
- "version": "0.0.1246",
3
+ "version": "0.0.1284",
4
4
  "private": false,
5
5
  "repository": "https://github.com/CarbonNYC/thera-typescript-sdk",
6
6
  "main": "./index.js",
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../../../../..";
5
+ import * as TheraApi from "../../../../../../../../api";
6
+ import * as core from "../../../../../../../../core";
7
+ export declare const LoadPayslipForEorEmployeeResponse: core.serialization.ObjectSchema<serializers.api.services.LoadPayslipForEorEmployeeResponse.Raw, TheraApi.api.services.LoadPayslipForEorEmployeeResponse>;
8
+ export declare namespace LoadPayslipForEorEmployeeResponse {
9
+ interface Raw {
10
+ url: string;
11
+ }
12
+ }
@@ -0,0 +1,33 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.LoadPayslipForEorEmployeeResponse = void 0;
30
+ const core = __importStar(require("../../../../../../../../core"));
31
+ exports.LoadPayslipForEorEmployeeResponse = core.serialization.object({
32
+ url: core.serialization.string(),
33
+ });
@@ -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);