@tryfinch/finch-api 5.4.2 → 5.5.1

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 (155) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +15 -18
  3. package/_shims/auto/types.d.ts +3 -1
  4. package/_shims/index.d.ts +2 -0
  5. package/_shims/node-runtime.d.ts.map +1 -1
  6. package/_shims/node-runtime.js +3 -0
  7. package/_shims/node-runtime.js.map +1 -1
  8. package/_shims/node-runtime.mjs +2 -0
  9. package/_shims/node-runtime.mjs.map +1 -1
  10. package/_shims/node-types.d.ts +1 -1
  11. package/_shims/registry.d.ts +2 -0
  12. package/_shims/registry.d.ts.map +1 -1
  13. package/_shims/registry.js +3 -1
  14. package/_shims/registry.js.map +1 -1
  15. package/_shims/registry.mjs +2 -0
  16. package/_shims/registry.mjs.map +1 -1
  17. package/_shims/web-runtime.d.ts.map +1 -1
  18. package/_shims/web-runtime.js +8 -0
  19. package/_shims/web-runtime.js.map +1 -1
  20. package/_shims/web-runtime.mjs +8 -0
  21. package/_shims/web-runtime.mjs.map +1 -1
  22. package/_shims/web-types.d.ts +2 -1
  23. package/core.d.ts +1 -1
  24. package/core.d.ts.map +1 -1
  25. package/core.js +26 -13
  26. package/core.js.map +1 -1
  27. package/core.mjs +24 -11
  28. package/core.mjs.map +1 -1
  29. package/error.d.ts.map +1 -1
  30. package/error.js +14 -4
  31. package/error.js.map +1 -1
  32. package/error.mjs +14 -4
  33. package/error.mjs.map +1 -1
  34. package/index.d.mts +19 -13
  35. package/index.d.ts +19 -13
  36. package/index.d.ts.map +1 -1
  37. package/index.js +5 -5
  38. package/index.js.map +1 -1
  39. package/index.mjs +5 -5
  40. package/index.mjs.map +1 -1
  41. package/package.json +3 -2
  42. package/pagination.d.ts +8 -7
  43. package/pagination.d.ts.map +1 -1
  44. package/pagination.js.map +1 -1
  45. package/pagination.mjs.map +1 -1
  46. package/resources/account.d.ts +3 -3
  47. package/resources/account.d.ts.map +1 -1
  48. package/resources/hris/benefits/benefits.d.ts +41 -36
  49. package/resources/hris/benefits/benefits.d.ts.map +1 -1
  50. package/resources/hris/benefits/benefits.js +9 -7
  51. package/resources/hris/benefits/benefits.js.map +1 -1
  52. package/resources/hris/benefits/benefits.mjs +9 -7
  53. package/resources/hris/benefits/benefits.mjs.map +1 -1
  54. package/resources/hris/benefits/index.d.ts +1 -1
  55. package/resources/hris/benefits/index.d.ts.map +1 -1
  56. package/resources/hris/benefits/index.js.map +1 -1
  57. package/resources/hris/benefits/index.mjs.map +1 -1
  58. package/resources/hris/benefits/individuals.d.ts +14 -18
  59. package/resources/hris/benefits/individuals.d.ts.map +1 -1
  60. package/resources/hris/benefits/individuals.js +27 -0
  61. package/resources/hris/benefits/individuals.js.map +1 -1
  62. package/resources/hris/benefits/individuals.mjs +4 -0
  63. package/resources/hris/benefits/individuals.mjs.map +1 -1
  64. package/resources/hris/company.d.ts +4 -4
  65. package/resources/hris/company.d.ts.map +1 -1
  66. package/resources/hris/directory.d.ts +16 -6
  67. package/resources/hris/directory.d.ts.map +1 -1
  68. package/resources/hris/directory.js +9 -2
  69. package/resources/hris/directory.js.map +1 -1
  70. package/resources/hris/directory.mjs +9 -2
  71. package/resources/hris/directory.mjs.map +1 -1
  72. package/resources/hris/employments.d.ts +9 -11
  73. package/resources/hris/employments.d.ts.map +1 -1
  74. package/resources/hris/employments.js +25 -0
  75. package/resources/hris/employments.js.map +1 -1
  76. package/resources/hris/employments.mjs +2 -0
  77. package/resources/hris/employments.mjs.map +1 -1
  78. package/resources/hris/hris.d.ts +61 -56
  79. package/resources/hris/hris.d.ts.map +1 -1
  80. package/resources/hris/hris.js +27 -28
  81. package/resources/hris/hris.js.map +1 -1
  82. package/resources/hris/hris.mjs +27 -28
  83. package/resources/hris/hris.mjs.map +1 -1
  84. package/resources/hris/index.d.ts +2 -2
  85. package/resources/hris/index.d.ts.map +1 -1
  86. package/resources/hris/index.js.map +1 -1
  87. package/resources/hris/index.mjs +1 -1
  88. package/resources/hris/index.mjs.map +1 -1
  89. package/resources/hris/individuals.d.ts +7 -9
  90. package/resources/hris/individuals.d.ts.map +1 -1
  91. package/resources/hris/individuals.js +25 -0
  92. package/resources/hris/individuals.js.map +1 -1
  93. package/resources/hris/individuals.mjs +2 -0
  94. package/resources/hris/individuals.mjs.map +1 -1
  95. package/resources/hris/pay-statements.d.ts +13 -15
  96. package/resources/hris/pay-statements.d.ts.map +1 -1
  97. package/resources/hris/pay-statements.js +25 -0
  98. package/resources/hris/pay-statements.js.map +1 -1
  99. package/resources/hris/pay-statements.mjs +2 -0
  100. package/resources/hris/pay-statements.mjs.map +1 -1
  101. package/resources/hris/payments.d.ts +10 -12
  102. package/resources/hris/payments.d.ts.map +1 -1
  103. package/resources/hris/payments.js +25 -0
  104. package/resources/hris/payments.js.map +1 -1
  105. package/resources/hris/payments.mjs +2 -0
  106. package/resources/hris/payments.mjs.map +1 -1
  107. package/resources/providers.d.ts +3 -5
  108. package/resources/providers.d.ts.map +1 -1
  109. package/resources/providers.js +25 -0
  110. package/resources/providers.js.map +1 -1
  111. package/resources/providers.mjs +2 -0
  112. package/resources/providers.mjs.map +1 -1
  113. package/resources/request-forwarding.d.ts +3 -3
  114. package/resources/request-forwarding.d.ts.map +1 -1
  115. package/resources/webhooks.d.ts.map +1 -1
  116. package/resources/webhooks.js +3 -12
  117. package/resources/webhooks.js.map +1 -1
  118. package/resources/webhooks.mjs +4 -13
  119. package/resources/webhooks.mjs.map +1 -1
  120. package/shims/node.d.ts +1 -1
  121. package/shims/node.d.ts.map +1 -1
  122. package/shims/web.d.ts +1 -1
  123. package/shims/web.d.ts.map +1 -1
  124. package/src/_shims/auto/types.d.ts +3 -1
  125. package/src/_shims/index.d.ts +2 -0
  126. package/src/_shims/node-runtime.ts +4 -0
  127. package/src/_shims/node-types.d.ts +1 -1
  128. package/src/_shims/registry.ts +3 -0
  129. package/src/_shims/web-runtime.ts +12 -0
  130. package/src/_shims/web-types.d.ts +2 -1
  131. package/src/core.ts +26 -9
  132. package/src/error.ts +15 -5
  133. package/src/index.ts +22 -16
  134. package/src/pagination.ts +8 -7
  135. package/src/resources/account.ts +3 -3
  136. package/src/resources/hris/benefits/benefits.ts +47 -43
  137. package/src/resources/hris/benefits/index.ts +1 -0
  138. package/src/resources/hris/benefits/individuals.ts +14 -20
  139. package/src/resources/hris/company.ts +4 -4
  140. package/src/resources/hris/directory.ts +18 -10
  141. package/src/resources/hris/employments.ts +9 -11
  142. package/src/resources/hris/hris.ts +61 -63
  143. package/src/resources/hris/index.ts +7 -1
  144. package/src/resources/hris/individuals.ts +7 -9
  145. package/src/resources/hris/pay-statements.ts +13 -15
  146. package/src/resources/hris/payments.ts +10 -12
  147. package/src/resources/providers.ts +3 -5
  148. package/src/resources/request-forwarding.ts +3 -3
  149. package/src/resources/webhooks.ts +4 -15
  150. package/src/shims/node.ts +1 -1
  151. package/src/shims/web.ts +1 -1
  152. package/src/version.ts +1 -1
  153. package/version.d.ts +1 -1
  154. package/version.js +1 -1
  155. package/version.mjs +1 -1
@@ -3,8 +3,8 @@
3
3
  import * as Core from "../../../ch/finch-api/core";
4
4
  import { APIResource } from "../../../ch/finch-api/resource";
5
5
  import { isRequestOptions } from "../../../ch/finch-api/core";
6
- import * as Benefits from "../../../ch/finch-api/resources/hris/benefits/index";
7
- import * as API from './index';
6
+ import * as IndividualsAPI from "../../../ch/finch-api/resources/hris/benefits/individuals";
7
+ import * as BenefitsAPI from "../../../ch/finch-api/resources/hris/benefits/benefits";
8
8
  import { SinglePage } from "../../../ch/finch-api/pagination";
9
9
 
10
10
  export class Individuals extends APIResource {
@@ -103,16 +103,10 @@ export class Individuals extends APIResource {
103
103
  }
104
104
 
105
105
  export class EnrolledIndividualsSinglePage extends SinglePage<EnrolledIndividual> {}
106
- // alias so we can export it in the namespace
107
- type _EnrolledIndividualsSinglePage = EnrolledIndividualsSinglePage;
108
106
 
109
107
  export class IndividualBenefitsSinglePage extends SinglePage<IndividualBenefit> {}
110
- // alias so we can export it in the namespace
111
- type _IndividualBenefitsSinglePage = IndividualBenefitsSinglePage;
112
108
 
113
109
  export class UnenrolledIndividualsSinglePage extends SinglePage<UnenrolledIndividual> {}
114
- // alias so we can export it in the namespace
115
- type _UnenrolledIndividualsSinglePage = UnenrolledIndividualsSinglePage;
116
110
 
117
111
  export interface EnrolledIndividual {
118
112
  body?: EnrolledIndividual.Body;
@@ -165,9 +159,9 @@ export namespace IndividualBenefit {
165
159
  */
166
160
  catch_up?: boolean | null;
167
161
 
168
- company_contribution?: Benefits.BenfitContribution | null;
162
+ company_contribution?: BenefitsAPI.BenefitContribution | null;
169
163
 
170
- employee_deduction?: Benefits.BenfitContribution | null;
164
+ employee_deduction?: BenefitsAPI.BenefitContribution | null;
171
165
 
172
166
  /**
173
167
  * Type for HSA contribution limit if the benefit is a HSA.
@@ -241,14 +235,14 @@ export interface IndividualUnenrollManyParams {
241
235
  }
242
236
 
243
237
  export namespace Individuals {
244
- export import EnrolledIndividual = API.EnrolledIndividual;
245
- export import IndividualBenefit = API.IndividualBenefit;
246
- export import UnenrolledIndividual = API.UnenrolledIndividual;
247
- export import IndividualEnrolledIDsResponse = API.IndividualEnrolledIDsResponse;
248
- export type EnrolledIndividualsSinglePage = _EnrolledIndividualsSinglePage;
249
- export type IndividualBenefitsSinglePage = _IndividualBenefitsSinglePage;
250
- export type UnenrolledIndividualsSinglePage = _UnenrolledIndividualsSinglePage;
251
- export import IndividualEnrollManyParams = API.IndividualEnrollManyParams;
252
- export import IndividualRetrieveManyBenefitsParams = API.IndividualRetrieveManyBenefitsParams;
253
- export import IndividualUnenrollManyParams = API.IndividualUnenrollManyParams;
238
+ export import EnrolledIndividual = IndividualsAPI.EnrolledIndividual;
239
+ export import IndividualBenefit = IndividualsAPI.IndividualBenefit;
240
+ export import UnenrolledIndividual = IndividualsAPI.UnenrolledIndividual;
241
+ export import IndividualEnrolledIDsResponse = IndividualsAPI.IndividualEnrolledIDsResponse;
242
+ export import EnrolledIndividualsSinglePage = IndividualsAPI.EnrolledIndividualsSinglePage;
243
+ export import IndividualBenefitsSinglePage = IndividualsAPI.IndividualBenefitsSinglePage;
244
+ export import UnenrolledIndividualsSinglePage = IndividualsAPI.UnenrolledIndividualsSinglePage;
245
+ export import IndividualEnrollManyParams = IndividualsAPI.IndividualEnrollManyParams;
246
+ export import IndividualRetrieveManyBenefitsParams = IndividualsAPI.IndividualRetrieveManyBenefitsParams;
247
+ export import IndividualUnenrollManyParams = IndividualsAPI.IndividualUnenrollManyParams;
254
248
  }
@@ -2,8 +2,8 @@
2
2
 
3
3
  import * as Core from "../../ch/finch-api/core";
4
4
  import { APIResource } from "../../ch/finch-api/resource";
5
- import * as HRIS from "../../ch/finch-api/resources/hris/index";
6
- import * as API from './index';
5
+ import * as CompanyAPI from "../../ch/finch-api/resources/hris/company";
6
+ import * as HRISAPI from "../../ch/finch-api/resources/hris/hris";
7
7
 
8
8
  export class CompanyResource extends APIResource {
9
9
  /**
@@ -45,7 +45,7 @@ export interface Company {
45
45
  */
46
46
  legal_name: string | null;
47
47
 
48
- locations: Array<HRIS.Location | null> | null;
48
+ locations: Array<HRISAPI.Location | null> | null;
49
49
 
50
50
  /**
51
51
  * The email of the main administrator on the account.
@@ -128,5 +128,5 @@ export namespace Company {
128
128
  }
129
129
 
130
130
  export namespace CompanyResource {
131
- export import Company = API.Company;
131
+ export import Company = CompanyAPI.Company;
132
132
  }
@@ -3,27 +3,32 @@
3
3
  import * as Core from "../../ch/finch-api/core";
4
4
  import { APIResource } from "../../ch/finch-api/resource";
5
5
  import { isRequestOptions } from "../../ch/finch-api/core";
6
- import * as API from './index';
7
- import { IndividualsPage, IndividualsPageParams } from "../../ch/finch-api/pagination";
6
+ import * as DirectoryAPI from "../../ch/finch-api/resources/hris/directory";
7
+ import { IndividualsPage, type IndividualsPageParams } from "../../ch/finch-api/pagination";
8
8
 
9
9
  export class Directory extends APIResource {
10
10
  /**
11
11
  * Read company directory and organization structure
12
12
  */
13
- listIndividuals(
14
- query?: DirectoryListIndividualsParams,
13
+ list(
14
+ query?: DirectoryListParams,
15
15
  options?: Core.RequestOptions,
16
16
  ): Core.PagePromise<IndividualsPage, IndividualInDirectory>;
17
- listIndividuals(options?: Core.RequestOptions): Core.PagePromise<IndividualsPage, IndividualInDirectory>;
18
- listIndividuals(
19
- query: DirectoryListIndividualsParams | Core.RequestOptions = {},
17
+ list(options?: Core.RequestOptions): Core.PagePromise<IndividualsPage, IndividualInDirectory>;
18
+ list(
19
+ query: DirectoryListParams | Core.RequestOptions = {},
20
20
  options?: Core.RequestOptions,
21
21
  ): Core.PagePromise<IndividualsPage, IndividualInDirectory> {
22
22
  if (isRequestOptions(query)) {
23
- return this.listIndividuals({}, query);
23
+ return this.list({}, query);
24
24
  }
25
25
  return this.getAPIList('/employer/directory', IndividualsPage, { query, ...options });
26
26
  }
27
+
28
+ /**
29
+ * @deprecated use `list` instead
30
+ */
31
+ listIndividuals = this.list;
27
32
  }
28
33
 
29
34
  export interface IndividualInDirectory {
@@ -85,9 +90,12 @@ export namespace IndividualInDirectory {
85
90
  }
86
91
  }
87
92
 
93
+ export interface DirectoryListParams extends IndividualsPageParams {}
94
+
88
95
  export interface DirectoryListIndividualsParams extends IndividualsPageParams {}
89
96
 
90
97
  export namespace Directory {
91
- export import IndividualInDirectory = API.IndividualInDirectory;
92
- export import DirectoryListIndividualsParams = API.DirectoryListIndividualsParams;
98
+ export import IndividualInDirectory = DirectoryAPI.IndividualInDirectory;
99
+ export import DirectoryListParams = DirectoryAPI.DirectoryListParams;
100
+ export import DirectoryListIndividualsParams = DirectoryAPI.DirectoryListIndividualsParams;
93
101
  }
@@ -2,8 +2,8 @@
2
2
 
3
3
  import * as Core from "../../ch/finch-api/core";
4
4
  import { APIResource } from "../../ch/finch-api/resource";
5
- import * as HRIS from "../../ch/finch-api/resources/hris/index";
6
- import * as API from './index';
5
+ import * as EmploymentsAPI from "../../ch/finch-api/resources/hris/employments";
6
+ import * as HRISAPI from "../../ch/finch-api/resources/hris/hris";
7
7
  import { ResponsesPage } from "../../ch/finch-api/pagination";
8
8
 
9
9
  export class Employments extends APIResource {
@@ -27,8 +27,6 @@ export class Employments extends APIResource {
27
27
  }
28
28
 
29
29
  export class EmploymentDataResponsesPage extends ResponsesPage<EmploymentDataResponse> {}
30
- // alias so we can export it in the namespace
31
- type _EmploymentDataResponsesPage = EmploymentDataResponsesPage;
32
30
 
33
31
  export interface EmploymentData {
34
32
  /**
@@ -63,12 +61,12 @@ export interface EmploymentData {
63
61
  * annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc,
64
62
  * depending on what information the provider returns.
65
63
  */
66
- income?: HRIS.Income | null;
64
+ income?: HRISAPI.Income | null;
67
65
 
68
66
  /**
69
67
  * The array of income history.
70
68
  */
71
- income_history?: Array<HRIS.Income | null> | null;
69
+ income_history?: Array<HRISAPI.Income | null> | null;
72
70
 
73
71
  /**
74
72
  * `true` if the individual an an active employee or contractor at the company.
@@ -80,7 +78,7 @@ export interface EmploymentData {
80
78
  */
81
79
  last_name?: string | null;
82
80
 
83
- location?: HRIS.Location | null;
81
+ location?: HRISAPI.Location | null;
84
82
 
85
83
  /**
86
84
  * The manager object representing the manager of the individual within the org.
@@ -187,8 +185,8 @@ export namespace EmploymentRetrieveManyParams {
187
185
  }
188
186
 
189
187
  export namespace Employments {
190
- export import EmploymentData = API.EmploymentData;
191
- export import EmploymentDataResponse = API.EmploymentDataResponse;
192
- export type EmploymentDataResponsesPage = _EmploymentDataResponsesPage;
193
- export import EmploymentRetrieveManyParams = API.EmploymentRetrieveManyParams;
188
+ export import EmploymentData = EmploymentsAPI.EmploymentData;
189
+ export import EmploymentDataResponse = EmploymentsAPI.EmploymentDataResponse;
190
+ export import EmploymentDataResponsesPage = EmploymentsAPI.EmploymentDataResponsesPage;
191
+ export import EmploymentRetrieveManyParams = EmploymentsAPI.EmploymentRetrieveManyParams;
194
192
  }
@@ -1,23 +1,23 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
3
  import { APIResource } from "../../ch/finch-api/resource";
4
- import { CompanyResource } from './company';
5
- import { Directory } from './directory';
6
- import { Individuals } from './individuals';
7
- import { Employments } from './employments';
8
- import { Payments } from './payments';
9
- import { PayStatements } from './pay-statements';
10
- import { Benefits } from './benefits/benefits';
11
- import * as API from './index';
4
+ import * as HRISAPI from "../../ch/finch-api/resources/hris/hris";
5
+ import * as CompanyAPI from "../../ch/finch-api/resources/hris/company";
6
+ import * as DirectoryAPI from "../../ch/finch-api/resources/hris/directory";
7
+ import * as EmploymentsAPI from "../../ch/finch-api/resources/hris/employments";
8
+ import * as IndividualsAPI from "../../ch/finch-api/resources/hris/individuals";
9
+ import * as PayStatementsAPI from "../../ch/finch-api/resources/hris/pay-statements";
10
+ import * as PaymentsAPI from "../../ch/finch-api/resources/hris/payments";
11
+ import * as BenefitsAPI from "../../ch/finch-api/resources/hris/benefits/benefits";
12
12
 
13
13
  export class HRIS extends APIResource {
14
- company: CompanyResource = new CompanyResource(this.client);
15
- directory: Directory = new Directory(this.client);
16
- individuals: Individuals = new Individuals(this.client);
17
- employments: Employments = new Employments(this.client);
18
- payments: Payments = new Payments(this.client);
19
- payStatements: PayStatements = new PayStatements(this.client);
20
- benefits: Benefits = new Benefits(this.client);
14
+ company: CompanyAPI.CompanyResource = new CompanyAPI.CompanyResource(this.client);
15
+ directory: DirectoryAPI.Directory = new DirectoryAPI.Directory(this.client);
16
+ individuals: IndividualsAPI.Individuals = new IndividualsAPI.Individuals(this.client);
17
+ employments: EmploymentsAPI.Employments = new EmploymentsAPI.Employments(this.client);
18
+ payments: PaymentsAPI.Payments = new PaymentsAPI.Payments(this.client);
19
+ payStatements: PayStatementsAPI.PayStatements = new PayStatementsAPI.PayStatements(this.client);
20
+ benefits: BenefitsAPI.Benefits = new BenefitsAPI.Benefits(this.client);
21
21
  }
22
22
 
23
23
  /**
@@ -116,52 +116,50 @@ export interface Paging {
116
116
  }
117
117
 
118
118
  export namespace HRIS {
119
- export import Income = API.Income;
120
- export import Location = API.Location;
121
- export import Money = API.Money;
122
- export import Paging = API.Paging;
123
-
124
- export import CompanyResource = API.CompanyResource;
125
- export import Company = API.Company;
126
-
127
- export import Directory = API.Directory;
128
- export import IndividualInDirectory = API.IndividualInDirectory;
129
- export import DirectoryListIndividualsParams = API.DirectoryListIndividualsParams;
130
-
131
- export import Individuals = API.Individuals;
132
- export import Individual = API.Individual;
133
- export import IndividualResponse = API.IndividualResponse;
134
- export import IndividualResponsesPage = API.IndividualResponsesPage;
135
- export import IndividualRetrieveManyParams = API.IndividualRetrieveManyParams;
136
-
137
- export import Employments = API.Employments;
138
- export import EmploymentData = API.EmploymentData;
139
- export import EmploymentDataResponse = API.EmploymentDataResponse;
140
- export import EmploymentDataResponsesPage = API.EmploymentDataResponsesPage;
141
- export import EmploymentRetrieveManyParams = API.EmploymentRetrieveManyParams;
142
-
143
- export import Payments = API.Payments;
144
- export import Payment = API.Payment;
145
- export import PaymentsSinglePage = API.PaymentsSinglePage;
146
- export import PaymentListParams = API.PaymentListParams;
147
-
148
- export import PayStatements = API.PayStatements;
149
- export import PayStatement = API.PayStatement;
150
- export import PayStatementResponse = API.PayStatementResponse;
151
- export import PayStatementResponseBody = API.PayStatementResponseBody;
152
- export import PayStatementResponsesPage = API.PayStatementResponsesPage;
153
- export import PayStatementRetrieveManyParams = API.PayStatementRetrieveManyParams;
154
-
155
- export import Benefits = API.Benefits;
156
- export import BenefitFrequency = API.BenefitFrequency;
157
- export import BenefitType = API.BenefitType;
158
- export import BenfitContribution = API.BenfitContribution;
159
- export import CompanyBenefit = API.CompanyBenefit;
160
- export import CreateCompanyBenefitsResponse = API.CreateCompanyBenefitsResponse;
161
- export import SupportedBenefit = API.SupportedBenefit;
162
- export import UpdateCompanyBenefitResponse = API.UpdateCompanyBenefitResponse;
163
- export import CompanyBenefitsSinglePage = API.CompanyBenefitsSinglePage;
164
- export import SupportedBenefitsSinglePage = API.SupportedBenefitsSinglePage;
165
- export import BenefitCreateParams = API.BenefitCreateParams;
166
- export import BenefitUpdateParams = API.BenefitUpdateParams;
119
+ export import Income = HRISAPI.Income;
120
+ export import Location = HRISAPI.Location;
121
+ export import Money = HRISAPI.Money;
122
+ export import Paging = HRISAPI.Paging;
123
+ export import CompanyResource = CompanyAPI.CompanyResource;
124
+ export import Company = CompanyAPI.Company;
125
+ export import Directory = DirectoryAPI.Directory;
126
+ export import IndividualInDirectory = DirectoryAPI.IndividualInDirectory;
127
+ export import DirectoryListParams = DirectoryAPI.DirectoryListParams;
128
+ export import DirectoryListIndividualsParams = DirectoryAPI.DirectoryListIndividualsParams;
129
+ export import Individuals = IndividualsAPI.Individuals;
130
+ export import Individual = IndividualsAPI.Individual;
131
+ export import IndividualResponse = IndividualsAPI.IndividualResponse;
132
+ export import IndividualResponsesPage = IndividualsAPI.IndividualResponsesPage;
133
+ export import IndividualRetrieveManyParams = IndividualsAPI.IndividualRetrieveManyParams;
134
+ export import Employments = EmploymentsAPI.Employments;
135
+ export import EmploymentData = EmploymentsAPI.EmploymentData;
136
+ export import EmploymentDataResponse = EmploymentsAPI.EmploymentDataResponse;
137
+ export import EmploymentDataResponsesPage = EmploymentsAPI.EmploymentDataResponsesPage;
138
+ export import EmploymentRetrieveManyParams = EmploymentsAPI.EmploymentRetrieveManyParams;
139
+ export import Payments = PaymentsAPI.Payments;
140
+ export import Payment = PaymentsAPI.Payment;
141
+ export import PaymentsSinglePage = PaymentsAPI.PaymentsSinglePage;
142
+ export import PaymentListParams = PaymentsAPI.PaymentListParams;
143
+ export import PayStatements = PayStatementsAPI.PayStatements;
144
+ export import PayStatement = PayStatementsAPI.PayStatement;
145
+ export import PayStatementResponse = PayStatementsAPI.PayStatementResponse;
146
+ export import PayStatementResponseBody = PayStatementsAPI.PayStatementResponseBody;
147
+ export import PayStatementResponsesPage = PayStatementsAPI.PayStatementResponsesPage;
148
+ export import PayStatementRetrieveManyParams = PayStatementsAPI.PayStatementRetrieveManyParams;
149
+ export import Benefits = BenefitsAPI.Benefits;
150
+ export import BenefitContribution = BenefitsAPI.BenefitContribution;
151
+ export import BenefitFrequency = BenefitsAPI.BenefitFrequency;
152
+ export import BenefitType = BenefitsAPI.BenefitType;
153
+ /**
154
+ * @deprecated use `BenefitContribution` instead
155
+ */
156
+ export import BenfitContribution = BenefitsAPI.BenfitContribution;
157
+ export import CompanyBenefit = BenefitsAPI.CompanyBenefit;
158
+ export import CreateCompanyBenefitsResponse = BenefitsAPI.CreateCompanyBenefitsResponse;
159
+ export import SupportedBenefit = BenefitsAPI.SupportedBenefit;
160
+ export import UpdateCompanyBenefitResponse = BenefitsAPI.UpdateCompanyBenefitResponse;
161
+ export import CompanyBenefitsSinglePage = BenefitsAPI.CompanyBenefitsSinglePage;
162
+ export import SupportedBenefitsSinglePage = BenefitsAPI.SupportedBenefitsSinglePage;
163
+ export import BenefitCreateParams = BenefitsAPI.BenefitCreateParams;
164
+ export import BenefitUpdateParams = BenefitsAPI.BenefitUpdateParams;
167
165
  }
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
3
  export {
4
+ BenefitContribution,
4
5
  BenefitFrequency,
5
6
  BenefitType,
6
7
  BenfitContribution,
@@ -30,7 +31,12 @@ export {
30
31
  IndividualResponsesPage,
31
32
  Individuals,
32
33
  } from './individuals';
33
- export { IndividualInDirectory, DirectoryListIndividualsParams, Directory } from './directory';
34
+ export {
35
+ IndividualInDirectory,
36
+ DirectoryListParams,
37
+ DirectoryListIndividualsParams,
38
+ Directory,
39
+ } from './directory';
34
40
  export {
35
41
  PayStatement,
36
42
  PayStatementResponse,
@@ -3,8 +3,8 @@
3
3
  import * as Core from "../../ch/finch-api/core";
4
4
  import { APIResource } from "../../ch/finch-api/resource";
5
5
  import { isRequestOptions } from "../../ch/finch-api/core";
6
- import * as HRIS from "../../ch/finch-api/resources/hris/index";
7
- import * as API from './index';
6
+ import * as IndividualsAPI from "../../ch/finch-api/resources/hris/individuals";
7
+ import * as HRISAPI from "../../ch/finch-api/resources/hris/hris";
8
8
  import { ResponsesPage } from "../../ch/finch-api/pagination";
9
9
 
10
10
  export class Individuals extends APIResource {
@@ -32,8 +32,6 @@ export class Individuals extends APIResource {
32
32
  }
33
33
 
34
34
  export class IndividualResponsesPage extends ResponsesPage<IndividualResponse> {}
35
- // alias so we can export it in the namespace
36
- type _IndividualResponsesPage = IndividualResponsesPage;
37
35
 
38
36
  export interface Individual {
39
37
  /**
@@ -72,7 +70,7 @@ export interface Individual {
72
70
  */
73
71
  preferred_name?: string | null;
74
72
 
75
- residence?: HRIS.Location | null;
73
+ residence?: HRISAPI.Location | null;
76
74
 
77
75
  /**
78
76
  * Note: This property is only available if enabled for your account. Please reach
@@ -120,8 +118,8 @@ export namespace IndividualRetrieveManyParams {
120
118
  }
121
119
 
122
120
  export namespace Individuals {
123
- export import Individual = API.Individual;
124
- export import IndividualResponse = API.IndividualResponse;
125
- export type IndividualResponsesPage = _IndividualResponsesPage;
126
- export import IndividualRetrieveManyParams = API.IndividualRetrieveManyParams;
121
+ export import Individual = IndividualsAPI.Individual;
122
+ export import IndividualResponse = IndividualsAPI.IndividualResponse;
123
+ export import IndividualResponsesPage = IndividualsAPI.IndividualResponsesPage;
124
+ export import IndividualRetrieveManyParams = IndividualsAPI.IndividualRetrieveManyParams;
127
125
  }
@@ -2,9 +2,9 @@
2
2
 
3
3
  import * as Core from "../../ch/finch-api/core";
4
4
  import { APIResource } from "../../ch/finch-api/resource";
5
- import * as HRIS from "../../ch/finch-api/resources/hris/index";
6
- import * as Benefits from "../../ch/finch-api/resources/hris/benefits/index";
7
- import * as API from './index';
5
+ import * as PayStatementsAPI from "../../ch/finch-api/resources/hris/pay-statements";
6
+ import * as HRISAPI from "../../ch/finch-api/resources/hris/hris";
7
+ import * as BenefitsAPI from "../../ch/finch-api/resources/hris/benefits/benefits";
8
8
  import { ResponsesPage } from "../../ch/finch-api/pagination";
9
9
 
10
10
  export class PayStatements extends APIResource {
@@ -27,8 +27,6 @@ export class PayStatements extends APIResource {
27
27
  }
28
28
 
29
29
  export class PayStatementResponsesPage extends ResponsesPage<PayStatementResponse> {}
30
- // alias so we can export it in the namespace
31
- type _PayStatementResponsesPage = PayStatementResponsesPage;
32
30
 
33
31
  export interface PayStatement {
34
32
  /**
@@ -43,14 +41,14 @@ export interface PayStatement {
43
41
 
44
42
  employer_contributions?: Array<PayStatement.EmployerContribution | null> | null;
45
43
 
46
- gross_pay?: HRIS.Money | null;
44
+ gross_pay?: HRISAPI.Money | null;
47
45
 
48
46
  /**
49
47
  * A stable Finch `id` (UUID v4) for an individual in the company
50
48
  */
51
49
  individual_id?: string;
52
50
 
53
- net_pay?: HRIS.Money | null;
51
+ net_pay?: HRISAPI.Money | null;
54
52
 
55
53
  /**
56
54
  * The payment method.
@@ -140,7 +138,7 @@ export namespace PayStatement {
140
138
  /**
141
139
  * Type of benefit.
142
140
  */
143
- type?: Benefits.BenefitType | null;
141
+ type?: BenefitsAPI.BenefitType | null;
144
142
  }
145
143
 
146
144
  export interface EmployerContribution {
@@ -162,7 +160,7 @@ export namespace PayStatement {
162
160
  /**
163
161
  * Type of benefit.
164
162
  */
165
- type?: Benefits.BenefitType | null;
163
+ type?: BenefitsAPI.BenefitType | null;
166
164
  }
167
165
 
168
166
  export interface Tax {
@@ -202,7 +200,7 @@ export interface PayStatementResponse {
202
200
  }
203
201
 
204
202
  export interface PayStatementResponseBody {
205
- paging?: HRIS.Paging;
203
+ paging?: HRISAPI.Paging;
206
204
 
207
205
  /**
208
206
  * The array of pay statements for the current payment.
@@ -237,9 +235,9 @@ export namespace PayStatementRetrieveManyParams {
237
235
  }
238
236
 
239
237
  export namespace PayStatements {
240
- export import PayStatement = API.PayStatement;
241
- export import PayStatementResponse = API.PayStatementResponse;
242
- export import PayStatementResponseBody = API.PayStatementResponseBody;
243
- export type PayStatementResponsesPage = _PayStatementResponsesPage;
244
- export import PayStatementRetrieveManyParams = API.PayStatementRetrieveManyParams;
238
+ export import PayStatement = PayStatementsAPI.PayStatement;
239
+ export import PayStatementResponse = PayStatementsAPI.PayStatementResponse;
240
+ export import PayStatementResponseBody = PayStatementsAPI.PayStatementResponseBody;
241
+ export import PayStatementResponsesPage = PayStatementsAPI.PayStatementResponsesPage;
242
+ export import PayStatementRetrieveManyParams = PayStatementsAPI.PayStatementRetrieveManyParams;
245
243
  }
@@ -2,8 +2,8 @@
2
2
 
3
3
  import * as Core from "../../ch/finch-api/core";
4
4
  import { APIResource } from "../../ch/finch-api/resource";
5
- import * as HRIS from "../../ch/finch-api/resources/hris/index";
6
- import * as API from './index';
5
+ import * as PaymentsAPI from "../../ch/finch-api/resources/hris/payments";
6
+ import * as HRISAPI from "../../ch/finch-api/resources/hris/hris";
7
7
  import { SinglePage } from "../../ch/finch-api/pagination";
8
8
 
9
9
  export class Payments extends APIResource {
@@ -19,8 +19,6 @@ export class Payments extends APIResource {
19
19
  }
20
20
 
21
21
  export class PaymentsSinglePage extends SinglePage<Payment> {}
22
- // alias so we can export it in the namespace
23
- type _PaymentsSinglePage = PaymentsSinglePage;
24
22
 
25
23
  export interface Payment {
26
24
  /**
@@ -28,22 +26,22 @@ export interface Payment {
28
26
  */
29
27
  id?: string;
30
28
 
31
- company_debit?: HRIS.Money | null;
29
+ company_debit?: HRISAPI.Money | null;
32
30
 
33
31
  debit_date?: string | null;
34
32
 
35
- employee_taxes?: HRIS.Money | null;
33
+ employee_taxes?: HRISAPI.Money | null;
36
34
 
37
- employer_taxes?: HRIS.Money | null;
35
+ employer_taxes?: HRISAPI.Money | null;
38
36
 
39
- gross_pay?: HRIS.Money | null;
37
+ gross_pay?: HRISAPI.Money | null;
40
38
 
41
39
  /**
42
40
  * Array of every individual on this payment.
43
41
  */
44
42
  individual_ids?: Array<string> | null;
45
43
 
46
- net_pay?: HRIS.Money | null;
44
+ net_pay?: HRISAPI.Money | null;
47
45
 
48
46
  pay_date?: string | null;
49
47
 
@@ -79,7 +77,7 @@ export interface PaymentListParams {
79
77
  }
80
78
 
81
79
  export namespace Payments {
82
- export import Payment = API.Payment;
83
- export type PaymentsSinglePage = _PaymentsSinglePage;
84
- export import PaymentListParams = API.PaymentListParams;
80
+ export import Payment = PaymentsAPI.Payment;
81
+ export import PaymentsSinglePage = PaymentsAPI.PaymentsSinglePage;
82
+ export import PaymentListParams = PaymentsAPI.PaymentListParams;
85
83
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as Core from "../ch/finch-api/core";
4
4
  import { APIResource } from "../ch/finch-api/resource";
5
- import * as API from './index';
5
+ import * as ProvidersAPI from "../ch/finch-api/resources/providers";
6
6
  import { SinglePage } from "../ch/finch-api/pagination";
7
7
 
8
8
  export class Providers extends APIResource {
@@ -15,8 +15,6 @@ export class Providers extends APIResource {
15
15
  }
16
16
 
17
17
  export class ProvidersSinglePage extends SinglePage<Provider> {}
18
- // alias so we can export it in the namespace
19
- type _ProvidersSinglePage = ProvidersSinglePage;
20
18
 
21
19
  export interface Provider {
22
20
  /**
@@ -62,6 +60,6 @@ export interface Provider {
62
60
  }
63
61
 
64
62
  export namespace Providers {
65
- export import Provider = API.Provider;
66
- export type ProvidersSinglePage = _ProvidersSinglePage;
63
+ export import Provider = ProvidersAPI.Provider;
64
+ export import ProvidersSinglePage = ProvidersAPI.ProvidersSinglePage;
67
65
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as Core from "../ch/finch-api/core";
4
4
  import { APIResource } from "../ch/finch-api/resource";
5
- import * as API from './index';
5
+ import * as RequestForwardingAPI from "../ch/finch-api/resources/request-forwarding";
6
6
 
7
7
  export class RequestForwarding extends APIResource {
8
8
  /**
@@ -116,6 +116,6 @@ export interface RequestForwardingForwardParams {
116
116
  }
117
117
 
118
118
  export namespace RequestForwarding {
119
- export import RequestForwardingForwardResponse = API.RequestForwardingForwardResponse;
120
- export import RequestForwardingForwardParams = API.RequestForwardingForwardParams;
119
+ export import RequestForwardingForwardResponse = RequestForwardingAPI.RequestForwardingForwardResponse;
120
+ export import RequestForwardingForwardParams = RequestForwardingAPI.RequestForwardingForwardParams;
121
121
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { APIResource } from "../ch/finch-api/resource";
4
4
  import { createHmac } from 'crypto';
5
- import { getHeader, HeadersLike } from "../ch/finch-api/core";
5
+ import { getRequiredHeader, HeadersLike } from "../ch/finch-api/core";
6
6
 
7
7
  export class Webhooks extends APIResource {
8
8
  /**
@@ -90,20 +90,9 @@ export class Webhooks extends APIResource {
90
90
  ): void {
91
91
  const parsedSecret = this.parseSecret(secret);
92
92
 
93
- const eventId = getHeader(headers, 'finch-event-id');
94
- if (!eventId) {
95
- throw new Error('Could not find finch-event-id header');
96
- }
97
-
98
- const msgTimestamp = getHeader(headers, 'finch-timestamp');
99
- if (!msgTimestamp) {
100
- throw new Error('Could not find finch-timestamp header');
101
- }
102
-
103
- const msgSignature = getHeader(headers, 'finch-signature');
104
- if (!msgSignature) {
105
- throw new Error('Could not find finch-signature header');
106
- }
93
+ const eventId = getRequiredHeader(headers, 'finch-event-id');
94
+ const msgTimestamp = getRequiredHeader(headers, 'finch-timestamp');
95
+ const msgSignature = getRequiredHeader(headers, 'finch-signature');
107
96
 
108
97
  const now = Math.floor(Date.now() / 1000);
109
98
  const timestampSeconds = parseInt(msgTimestamp, 10);
package/src/shims/node.ts CHANGED
@@ -45,6 +45,6 @@ declare module '../_shims/manual-types' {
45
45
  // @ts-ignore
46
46
  export type FsReadStream = types.FsReadStream;
47
47
  // @ts-ignore
48
- export type ReadableStream = types.ReadableStream;
48
+ export import ReadableStream = types.ReadableStream;
49
49
  }
50
50
  }
package/src/shims/web.ts CHANGED
@@ -45,6 +45,6 @@ declare module '../_shims/manual-types' {
45
45
  // @ts-ignore
46
46
  export type FsReadStream = types.FsReadStream;
47
47
  // @ts-ignore
48
- export type ReadableStream = types.ReadableStream;
48
+ export import ReadableStream = types.ReadableStream;
49
49
  }
50
50
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '5.4.2'; // x-release-please-version
1
+ export const VERSION = '5.5.1'; // x-release-please-version