@tryfinch/finch-api 1.0.0

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 (266) hide show
  1. package/.eslintrc.js +10 -0
  2. package/.github/workflows/publish-npm.yml +28 -0
  3. package/.github/workflows/release-doctor.yml +20 -0
  4. package/.github/workflows/release.yml +38 -0
  5. package/.prettierrc +6 -0
  6. package/.release-please-manifest.json +3 -0
  7. package/.stats.yml +1 -0
  8. package/CHANGELOG.md +7 -0
  9. package/LICENSE +201 -0
  10. package/README.md +220 -0
  11. package/api.md +186 -0
  12. package/bin/check-release-environment +25 -0
  13. package/bin/check-test-server +50 -0
  14. package/bin/publish-npm +6 -0
  15. package/build +12 -0
  16. package/check-version.ts +18 -0
  17. package/core.ts +926 -0
  18. package/dist/cjs/check-version.d.ts +2 -0
  19. package/dist/cjs/check-version.d.ts.map +1 -0
  20. package/dist/cjs/check-version.js +23 -0
  21. package/dist/cjs/check-version.js.map +1 -0
  22. package/dist/cjs/core.d.ts +268 -0
  23. package/dist/cjs/core.d.ts.map +1 -0
  24. package/dist/cjs/core.js +994 -0
  25. package/dist/cjs/core.js.map +1 -0
  26. package/dist/cjs/fetch-polyfill.d.ts +6 -0
  27. package/dist/cjs/fetch-polyfill.d.ts.map +1 -0
  28. package/dist/cjs/fetch-polyfill.js +57 -0
  29. package/dist/cjs/fetch-polyfill.js.map +1 -0
  30. package/dist/cjs/index.d.ts +115 -0
  31. package/dist/cjs/index.d.ts.map +1 -0
  32. package/dist/cjs/index.js +198 -0
  33. package/dist/cjs/index.js.map +1 -0
  34. package/dist/cjs/pagination.d.ts +166 -0
  35. package/dist/cjs/pagination.d.ts.map +1 -0
  36. package/dist/cjs/pagination.js +215 -0
  37. package/dist/cjs/pagination.js.map +1 -0
  38. package/dist/cjs/resource.d.ts +12 -0
  39. package/dist/cjs/resource.d.ts.map +1 -0
  40. package/dist/cjs/resource.js +17 -0
  41. package/dist/cjs/resource.js.map +1 -0
  42. package/dist/cjs/resources/account.d.ts +49 -0
  43. package/dist/cjs/resources/account.d.ts.map +1 -0
  44. package/dist/cjs/resources/account.js +23 -0
  45. package/dist/cjs/resources/account.js.map +1 -0
  46. package/dist/cjs/resources/ats/applications.d.ts +31 -0
  47. package/dist/cjs/resources/ats/applications.d.ts.map +1 -0
  48. package/dist/cjs/resources/ats/applications.js +27 -0
  49. package/dist/cjs/resources/ats/applications.js.map +1 -0
  50. package/dist/cjs/resources/ats/ats.d.ts +14 -0
  51. package/dist/cjs/resources/ats/ats.d.ts.map +1 -0
  52. package/dist/cjs/resources/ats/ats.js +22 -0
  53. package/dist/cjs/resources/ats/ats.js.map +1 -0
  54. package/dist/cjs/resources/ats/candidates.d.ts +45 -0
  55. package/dist/cjs/resources/ats/candidates.d.ts.map +1 -0
  56. package/dist/cjs/resources/ats/candidates.js +24 -0
  57. package/dist/cjs/resources/ats/candidates.js.map +1 -0
  58. package/dist/cjs/resources/ats/index.d.ts +6 -0
  59. package/dist/cjs/resources/ats/index.d.ts.map +1 -0
  60. package/dist/cjs/resources/ats/index.js +12 -0
  61. package/dist/cjs/resources/ats/index.js.map +1 -0
  62. package/dist/cjs/resources/ats/jobs.d.ts +42 -0
  63. package/dist/cjs/resources/ats/jobs.d.ts.map +1 -0
  64. package/dist/cjs/resources/ats/jobs.js +23 -0
  65. package/dist/cjs/resources/ats/jobs.js.map +1 -0
  66. package/dist/cjs/resources/ats/offers.d.ts +34 -0
  67. package/dist/cjs/resources/ats/offers.d.ts.map +1 -0
  68. package/dist/cjs/resources/ats/offers.js +23 -0
  69. package/dist/cjs/resources/ats/offers.js.map +1 -0
  70. package/dist/cjs/resources/ats/stages.d.ts +23 -0
  71. package/dist/cjs/resources/ats/stages.d.ts.map +1 -0
  72. package/dist/cjs/resources/ats/stages.js +21 -0
  73. package/dist/cjs/resources/ats/stages.js.map +1 -0
  74. package/dist/cjs/resources/hris/benefits/benefits.d.ts +155 -0
  75. package/dist/cjs/resources/hris/benefits/benefits.d.ts.map +1 -0
  76. package/dist/cjs/resources/hris/benefits/benefits.js +57 -0
  77. package/dist/cjs/resources/hris/benefits/benefits.js.map +1 -0
  78. package/dist/cjs/resources/hris/benefits/index.d.ts +26 -0
  79. package/dist/cjs/resources/hris/benefits/index.d.ts.map +1 -0
  80. package/dist/cjs/resources/hris/benefits/index.js +42 -0
  81. package/dist/cjs/resources/hris/benefits/index.js.map +1 -0
  82. package/dist/cjs/resources/hris/benefits/individuals.d.ts +163 -0
  83. package/dist/cjs/resources/hris/benefits/individuals.d.ts.map +1 -0
  84. package/dist/cjs/resources/hris/benefits/individuals.js +68 -0
  85. package/dist/cjs/resources/hris/benefits/individuals.js.map +1 -0
  86. package/dist/cjs/resources/hris/company.d.ts +104 -0
  87. package/dist/cjs/resources/hris/company.d.ts.map +1 -0
  88. package/dist/cjs/resources/hris/company.js +15 -0
  89. package/dist/cjs/resources/hris/company.js.map +1 -0
  90. package/dist/cjs/resources/hris/directory.d.ts +65 -0
  91. package/dist/cjs/resources/hris/directory.d.ts.map +1 -0
  92. package/dist/cjs/resources/hris/directory.js +21 -0
  93. package/dist/cjs/resources/hris/directory.js.map +1 -0
  94. package/dist/cjs/resources/hris/hris.d.ts +95 -0
  95. package/dist/cjs/resources/hris/hris.d.ts.map +1 -0
  96. package/dist/cjs/resources/hris/hris.js +24 -0
  97. package/dist/cjs/resources/hris/hris.js.map +1 -0
  98. package/dist/cjs/resources/hris/index.d.ts +31 -0
  99. package/dist/cjs/resources/hris/index.d.ts.map +1 -0
  100. package/dist/cjs/resources/hris/index.js +44 -0
  101. package/dist/cjs/resources/hris/index.js.map +1 -0
  102. package/dist/cjs/resources/hris/individuals/employment-data.d.ts +151 -0
  103. package/dist/cjs/resources/hris/individuals/employment-data.d.ts.map +1 -0
  104. package/dist/cjs/resources/hris/individuals/employment-data.js +26 -0
  105. package/dist/cjs/resources/hris/individuals/employment-data.js.map +1 -0
  106. package/dist/cjs/resources/hris/individuals/index.d.ts +13 -0
  107. package/dist/cjs/resources/hris/individuals/index.d.ts.map +1 -0
  108. package/dist/cjs/resources/hris/individuals/index.js +28 -0
  109. package/dist/cjs/resources/hris/individuals/index.js.map +1 -0
  110. package/dist/cjs/resources/hris/individuals/individuals.d.ts +86 -0
  111. package/dist/cjs/resources/hris/individuals/individuals.d.ts.map +1 -0
  112. package/dist/cjs/resources/hris/individuals/individuals.js +28 -0
  113. package/dist/cjs/resources/hris/individuals/individuals.js.map +1 -0
  114. package/dist/cjs/resources/hris/pay-statements.d.ts +201 -0
  115. package/dist/cjs/resources/hris/pay-statements.d.ts.map +1 -0
  116. package/dist/cjs/resources/hris/pay-statements.js +25 -0
  117. package/dist/cjs/resources/hris/pay-statements.js.map +1 -0
  118. package/dist/cjs/resources/hris/payments.d.ts +54 -0
  119. package/dist/cjs/resources/hris/payments.d.ts.map +1 -0
  120. package/dist/cjs/resources/hris/payments.js +18 -0
  121. package/dist/cjs/resources/hris/payments.js.map +1 -0
  122. package/dist/cjs/resources/index.d.ts +5 -0
  123. package/dist/cjs/resources/index.d.ts.map +1 -0
  124. package/dist/cjs/resources/index.js +39 -0
  125. package/dist/cjs/resources/index.js.map +1 -0
  126. package/dist/cjs/resources/providers.d.ts +46 -0
  127. package/dist/cjs/resources/providers.d.ts.map +1 -0
  128. package/dist/cjs/resources/providers.js +18 -0
  129. package/dist/cjs/resources/providers.js.map +1 -0
  130. package/dist/cjs/resources/top-level.d.ts +2 -0
  131. package/dist/cjs/resources/top-level.d.ts.map +1 -0
  132. package/dist/cjs/resources/top-level.js +4 -0
  133. package/dist/cjs/resources/top-level.js.map +1 -0
  134. package/dist/cjs/tests/api-resources/account.test.d.ts +2 -0
  135. package/dist/cjs/tests/api-resources/account.test.d.ts.map +1 -0
  136. package/dist/cjs/tests/api-resources/account.test.js +66 -0
  137. package/dist/cjs/tests/api-resources/account.test.js.map +1 -0
  138. package/dist/cjs/tests/api-resources/ats/applications.test.d.ts +2 -0
  139. package/dist/cjs/tests/api-resources/ats/applications.test.d.ts.map +1 -0
  140. package/dist/cjs/tests/api-resources/ats/applications.test.js +73 -0
  141. package/dist/cjs/tests/api-resources/ats/applications.test.js.map +1 -0
  142. package/dist/cjs/tests/api-resources/ats/candidates.test.d.ts +2 -0
  143. package/dist/cjs/tests/api-resources/ats/candidates.test.d.ts.map +1 -0
  144. package/dist/cjs/tests/api-resources/ats/candidates.test.js +73 -0
  145. package/dist/cjs/tests/api-resources/ats/candidates.test.js.map +1 -0
  146. package/dist/cjs/tests/api-resources/ats/jobs.test.d.ts +2 -0
  147. package/dist/cjs/tests/api-resources/ats/jobs.test.d.ts.map +1 -0
  148. package/dist/cjs/tests/api-resources/ats/jobs.test.js +73 -0
  149. package/dist/cjs/tests/api-resources/ats/jobs.test.js.map +1 -0
  150. package/dist/cjs/tests/api-resources/ats/offers.test.d.ts +2 -0
  151. package/dist/cjs/tests/api-resources/ats/offers.test.d.ts.map +1 -0
  152. package/dist/cjs/tests/api-resources/ats/offers.test.js +73 -0
  153. package/dist/cjs/tests/api-resources/ats/offers.test.js.map +1 -0
  154. package/dist/cjs/tests/api-resources/ats/stages.test.d.ts +2 -0
  155. package/dist/cjs/tests/api-resources/ats/stages.test.d.ts.map +1 -0
  156. package/dist/cjs/tests/api-resources/ats/stages.test.js +55 -0
  157. package/dist/cjs/tests/api-resources/ats/stages.test.js.map +1 -0
  158. package/dist/cjs/tests/api-resources/hris/benefits/benefits.test.d.ts +2 -0
  159. package/dist/cjs/tests/api-resources/hris/benefits/benefits.test.d.ts.map +1 -0
  160. package/dist/cjs/tests/api-resources/hris/benefits/benefits.test.js +116 -0
  161. package/dist/cjs/tests/api-resources/hris/benefits/benefits.test.js.map +1 -0
  162. package/dist/cjs/tests/api-resources/hris/benefits/individuals.test.d.ts +2 -0
  163. package/dist/cjs/tests/api-resources/hris/benefits/individuals.test.d.ts.map +1 -0
  164. package/dist/cjs/tests/api-resources/hris/benefits/individuals.test.js +103 -0
  165. package/dist/cjs/tests/api-resources/hris/benefits/individuals.test.js.map +1 -0
  166. package/dist/cjs/tests/api-resources/hris/company.test.d.ts +2 -0
  167. package/dist/cjs/tests/api-resources/hris/company.test.d.ts.map +1 -0
  168. package/dist/cjs/tests/api-resources/hris/company.test.js +55 -0
  169. package/dist/cjs/tests/api-resources/hris/company.test.js.map +1 -0
  170. package/dist/cjs/tests/api-resources/hris/directory.test.d.ts +2 -0
  171. package/dist/cjs/tests/api-resources/hris/directory.test.d.ts.map +1 -0
  172. package/dist/cjs/tests/api-resources/hris/directory.test.js +62 -0
  173. package/dist/cjs/tests/api-resources/hris/directory.test.js.map +1 -0
  174. package/dist/cjs/tests/api-resources/hris/individuals/employment-data.test.d.ts +2 -0
  175. package/dist/cjs/tests/api-resources/hris/individuals/employment-data.test.d.ts.map +1 -0
  176. package/dist/cjs/tests/api-resources/hris/individuals/employment-data.test.js +56 -0
  177. package/dist/cjs/tests/api-resources/hris/individuals/employment-data.test.js.map +1 -0
  178. package/dist/cjs/tests/api-resources/hris/individuals/individuals.test.d.ts +2 -0
  179. package/dist/cjs/tests/api-resources/hris/individuals/individuals.test.d.ts.map +1 -0
  180. package/dist/cjs/tests/api-resources/hris/individuals/individuals.test.js +68 -0
  181. package/dist/cjs/tests/api-resources/hris/individuals/individuals.test.js.map +1 -0
  182. package/dist/cjs/tests/api-resources/hris/pay-statements.test.d.ts +2 -0
  183. package/dist/cjs/tests/api-resources/hris/pay-statements.test.d.ts.map +1 -0
  184. package/dist/cjs/tests/api-resources/hris/pay-statements.test.js +64 -0
  185. package/dist/cjs/tests/api-resources/hris/pay-statements.test.js.map +1 -0
  186. package/dist/cjs/tests/api-resources/hris/payments.test.d.ts +2 -0
  187. package/dist/cjs/tests/api-resources/hris/payments.test.d.ts.map +1 -0
  188. package/dist/cjs/tests/api-resources/hris/payments.test.js +52 -0
  189. package/dist/cjs/tests/api-resources/hris/payments.test.js.map +1 -0
  190. package/dist/cjs/tests/api-resources/providers.test.d.ts +2 -0
  191. package/dist/cjs/tests/api-resources/providers.test.d.ts.map +1 -0
  192. package/dist/cjs/tests/api-resources/providers.test.js +55 -0
  193. package/dist/cjs/tests/api-resources/providers.test.js.map +1 -0
  194. package/dist/cjs/tests/api-resources/top-level.test.d.ts +2 -0
  195. package/dist/cjs/tests/api-resources/top-level.test.d.ts.map +1 -0
  196. package/dist/cjs/tests/api-resources/top-level.test.js +52 -0
  197. package/dist/cjs/tests/api-resources/top-level.test.js.map +1 -0
  198. package/dist/cjs/tests/form.test.d.ts +2 -0
  199. package/dist/cjs/tests/form.test.d.ts.map +1 -0
  200. package/dist/cjs/tests/form.test.js +61 -0
  201. package/dist/cjs/tests/form.test.js.map +1 -0
  202. package/dist/cjs/tests/index.test.d.ts +2 -0
  203. package/dist/cjs/tests/index.test.d.ts.map +1 -0
  204. package/dist/cjs/tests/index.test.js +34 -0
  205. package/dist/cjs/tests/index.test.js.map +1 -0
  206. package/dist/cjs/tests/responses.test.d.ts +2 -0
  207. package/dist/cjs/tests/responses.test.d.ts.map +1 -0
  208. package/dist/cjs/tests/responses.test.js +60 -0
  209. package/dist/cjs/tests/responses.test.js.map +1 -0
  210. package/dist/cjs/version.d.ts +2 -0
  211. package/dist/cjs/version.d.ts.map +1 -0
  212. package/dist/cjs/version.js +5 -0
  213. package/dist/cjs/version.js.map +1 -0
  214. package/fetch-polyfill.ts +69 -0
  215. package/index.ts +212 -0
  216. package/jest.config.js +8 -0
  217. package/package.json +47 -0
  218. package/pagination.ts +401 -0
  219. package/release-please-config.json +12 -0
  220. package/resource.ts +24 -0
  221. package/resources/account.ts +63 -0
  222. package/resources/ats/applications.ts +55 -0
  223. package/resources/ats/ats.ts +16 -0
  224. package/resources/ats/candidates.ts +74 -0
  225. package/resources/ats/index.ts +7 -0
  226. package/resources/ats/jobs.ts +70 -0
  227. package/resources/ats/offers.ts +57 -0
  228. package/resources/ats/stages.ts +31 -0
  229. package/resources/hris/benefits/benefits.ts +214 -0
  230. package/resources/hris/benefits/index.ts +27 -0
  231. package/resources/hris/benefits/individuals.ts +234 -0
  232. package/resources/hris/company.ts +127 -0
  233. package/resources/hris/directory.ts +87 -0
  234. package/resources/hris/hris.ts +113 -0
  235. package/resources/hris/index.ts +32 -0
  236. package/resources/hris/individuals/employment-data.ts +188 -0
  237. package/resources/hris/individuals/index.ts +14 -0
  238. package/resources/hris/individuals/individuals.ts +128 -0
  239. package/resources/hris/pay-statements.ts +251 -0
  240. package/resources/hris/payments.ts +73 -0
  241. package/resources/index.ts +6 -0
  242. package/resources/providers.ts +59 -0
  243. package/resources/top-level.ts +3 -0
  244. package/tests/api-resources/account.test.ts +29 -0
  245. package/tests/api-resources/ats/applications.test.ts +36 -0
  246. package/tests/api-resources/ats/candidates.test.ts +36 -0
  247. package/tests/api-resources/ats/jobs.test.ts +36 -0
  248. package/tests/api-resources/ats/offers.test.ts +36 -0
  249. package/tests/api-resources/ats/stages.test.ts +18 -0
  250. package/tests/api-resources/hris/benefits/benefits.test.ts +79 -0
  251. package/tests/api-resources/hris/benefits/individuals.test.ts +66 -0
  252. package/tests/api-resources/hris/company.test.ts +18 -0
  253. package/tests/api-resources/hris/directory.test.ts +25 -0
  254. package/tests/api-resources/hris/individuals/employment-data.test.ts +19 -0
  255. package/tests/api-resources/hris/individuals/individuals.test.ts +31 -0
  256. package/tests/api-resources/hris/pay-statements.test.ts +27 -0
  257. package/tests/api-resources/hris/payments.test.ts +15 -0
  258. package/tests/api-resources/providers.test.ts +18 -0
  259. package/tests/api-resources/top-level.test.ts +15 -0
  260. package/tests/form.test.ts +27 -0
  261. package/tests/index.test.ts +34 -0
  262. package/tests/responses.test.ts +25 -0
  263. package/tsconfig.cjs.json +8 -0
  264. package/tsconfig.json +39 -0
  265. package/typings/digest-fetch/index.d.ts +33 -0
  266. package/version.ts +1 -0
@@ -0,0 +1,251 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import * as Core from '~/core';
4
+ import { APIResource } from '~/resource';
5
+ import * as HRIS from '~/resources/hris';
6
+ import * as Benefits from '~/resources/hris/benefits';
7
+ import { ResponsesPage } from '~/pagination';
8
+
9
+ export class PayStatements extends APIResource {
10
+ /**
11
+ * Read detailed pay statements for each individual.
12
+ *
13
+ * Deduction and contribution types are supported by the payroll systems that
14
+ * support Benefits.
15
+ */
16
+ retrieveMany(
17
+ body: PayStatementRetrieveManyParams,
18
+ options?: Core.RequestOptions,
19
+ ): Core.PagePromise<PayStatementResponsesResponsesPage> {
20
+ return this.getAPIList('/employer/pay-statement', PayStatementResponsesResponsesPage, {
21
+ body,
22
+ method: 'post',
23
+ ...options,
24
+ });
25
+ }
26
+ }
27
+
28
+ export class PayStatementResponsesResponsesPage extends ResponsesPage<PayStatementResponse> {}
29
+
30
+ export interface PayStatement {
31
+ /**
32
+ * The array of earnings objects associated with this pay statement
33
+ */
34
+ earnings?: Array<PayStatement.Earnings | null> | null;
35
+
36
+ /**
37
+ * The array of deductions objects associated with this pay statement.
38
+ */
39
+ employee_deductions?: Array<PayStatement.EmployeeDeductions | null> | null;
40
+
41
+ employer_contributions?: Array<PayStatement.EmployerContributions | null> | null;
42
+
43
+ gross_pay?: HRIS.Money | null;
44
+
45
+ /**
46
+ * A stable Finch `id` (UUID v4) for an individual in the company
47
+ */
48
+ individual_id?: string;
49
+
50
+ net_pay?: HRIS.Money | null;
51
+
52
+ /**
53
+ * The payment method.
54
+ */
55
+ payment_method?: 'check' | 'direct_deposit' | null;
56
+
57
+ /**
58
+ * The array of taxes objects associated with this pay statement.
59
+ */
60
+ taxes?: Array<PayStatement.Taxes | null> | null;
61
+
62
+ /**
63
+ * The number of hours worked for this pay period
64
+ */
65
+ total_hours?: number | null;
66
+
67
+ /**
68
+ * The type of the payment associated with the pay statement.
69
+ */
70
+ type?: 'regular_payroll' | 'off_cycle_payroll' | 'one_time_payment' | null;
71
+ }
72
+
73
+ export namespace PayStatement {
74
+ export interface Earnings {
75
+ /**
76
+ * The earnings amount in cents.
77
+ */
78
+ amount?: number | null;
79
+
80
+ /**
81
+ * The earnings currency code.
82
+ */
83
+ currency?: string | null;
84
+
85
+ /**
86
+ * The number of hours associated with this earning. (For salaried employees, this
87
+ * could be hours per pay period, `0` or `null`, depending on the provider).
88
+ */
89
+ hours?: number | null;
90
+
91
+ /**
92
+ * The exact name of the deduction from the pay statement.
93
+ */
94
+ name?: string | null;
95
+
96
+ /**
97
+ * The type of earning.
98
+ */
99
+ type?:
100
+ | 'salary'
101
+ | 'wage'
102
+ | 'reimbursement'
103
+ | 'overtime'
104
+ | 'severance'
105
+ | 'double_overtime'
106
+ | 'pto'
107
+ | 'sick'
108
+ | 'bonus'
109
+ | 'commission'
110
+ | 'tips'
111
+ | '1099'
112
+ | 'other'
113
+ | null;
114
+ }
115
+
116
+ export interface Taxes {
117
+ /**
118
+ * The tax amount in cents.
119
+ */
120
+ amount?: number | null;
121
+
122
+ /**
123
+ * The currency code.
124
+ */
125
+ currency?: string | null;
126
+
127
+ /**
128
+ * `true` if the amount is paid by the employers.
129
+ */
130
+ employer?: boolean | null;
131
+
132
+ /**
133
+ * The exact name of tax from the pay statement.
134
+ */
135
+ name?: string | null;
136
+
137
+ /**
138
+ * The type of taxes.
139
+ */
140
+ type?: 'state' | 'federal' | 'local' | 'fica' | null;
141
+ }
142
+
143
+ export interface EmployeeDeductions {
144
+ /**
145
+ * The deduction amount in cents.
146
+ */
147
+ amount?: number | null;
148
+
149
+ /**
150
+ * The deduction currency.
151
+ */
152
+ currency?: string | null;
153
+
154
+ /**
155
+ * The deduction name from the pay statement.
156
+ */
157
+ name?: string | null;
158
+
159
+ /**
160
+ * Boolean indicating if the deduction is pre-tax.
161
+ */
162
+ pre_tax?: boolean | null;
163
+
164
+ /**
165
+ * Type of benefit.
166
+ */
167
+ type?: Benefits.BenefitType | null;
168
+ }
169
+
170
+ export interface EmployerContributions {
171
+ /**
172
+ * The contribution amount in cents.
173
+ */
174
+ amount?: number | null;
175
+
176
+ /**
177
+ * The contribution currency.
178
+ */
179
+ currency?: string | null;
180
+
181
+ /**
182
+ * The contribution name from the pay statement.
183
+ */
184
+ name?: string | null;
185
+
186
+ /**
187
+ * Type of benefit.
188
+ */
189
+ type?: Benefits.BenefitType | null;
190
+ }
191
+ }
192
+
193
+ export interface PayStatementResponse {
194
+ body?: PayStatementResponseBody;
195
+
196
+ code?: number;
197
+
198
+ payment_id?: string;
199
+ }
200
+
201
+ export interface PayStatementResponseBody {
202
+ paging?: HRIS.Paging;
203
+
204
+ /**
205
+ * The array of pay statements for the current payment.
206
+ */
207
+ pay_statements?: Array<PayStatement>;
208
+ }
209
+
210
+ export interface PayStatementRetrieveManyParams {
211
+ /**
212
+ * The array of batch requests.
213
+ */
214
+ requests: Array<PayStatementRetrieveManyParams.Requests>;
215
+ }
216
+
217
+ export namespace PayStatementRetrieveManyParams {
218
+ export interface Requests {
219
+ /**
220
+ * A stable Finch `id` (UUID v4) for a payment.
221
+ */
222
+ payment_id: string;
223
+
224
+ /**
225
+ * Number of pay statements to return (defaults to all).
226
+ */
227
+ limit?: number;
228
+
229
+ /**
230
+ * Index to start from.
231
+ */
232
+ offset?: number;
233
+ }
234
+
235
+ export interface Requests {
236
+ /**
237
+ * A stable Finch `id` (UUID v4) for a payment.
238
+ */
239
+ payment_id: string;
240
+
241
+ /**
242
+ * Number of pay statements to return (defaults to all).
243
+ */
244
+ limit?: number;
245
+
246
+ /**
247
+ * Index to start from.
248
+ */
249
+ offset?: number;
250
+ }
251
+ }
@@ -0,0 +1,73 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import * as Core from '~/core';
4
+ import { APIResource } from '~/resource';
5
+ import * as HRIS from '~/resources/hris';
6
+ import { SinglePage } from '~/pagination';
7
+
8
+ export class Payments extends APIResource {
9
+ /**
10
+ * Read payroll and contractor related payments by the company.
11
+ */
12
+ list(query: PaymentListParams, options?: Core.RequestOptions): Core.PagePromise<PaymentsSinglePage> {
13
+ return this.getAPIList('/employer/payment', PaymentsSinglePage, { query, ...options });
14
+ }
15
+ }
16
+
17
+ export class PaymentsSinglePage extends SinglePage<Payment> {}
18
+
19
+ export interface Payment {
20
+ company_debit?: HRIS.Money | null;
21
+
22
+ debit_date?: string | null;
23
+
24
+ employee_taxes?: HRIS.Money | null;
25
+
26
+ employer_taxes?: HRIS.Money | null;
27
+
28
+ gross_pay?: HRIS.Money | null;
29
+
30
+ /**
31
+ * The unique id for the payment.
32
+ */
33
+ id?: string;
34
+
35
+ /**
36
+ * Array of every individual on this payment.
37
+ */
38
+ individual_ids?: Array<string> | null;
39
+
40
+ net_pay?: HRIS.Money | null;
41
+
42
+ pay_date?: string | null;
43
+
44
+ /**
45
+ * The pay period object.
46
+ */
47
+ pay_period?: Payment.PayPeriod | null;
48
+ }
49
+
50
+ export namespace Payment {
51
+ /**
52
+ * The pay period object.
53
+ */
54
+ export interface PayPeriod {
55
+ end_date?: string | null;
56
+
57
+ start_date?: string | null;
58
+ }
59
+ }
60
+
61
+ export interface PaymentListParams {
62
+ /**
63
+ * The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD`
64
+ * format.
65
+ */
66
+ end_date: string;
67
+
68
+ /**
69
+ * The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD`
70
+ * format.
71
+ */
72
+ start_date: string;
73
+ }
@@ -0,0 +1,6 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ export { ATS } from './ats/ats';
4
+ export { DisconnectResponse, Introspection, Account } from './account';
5
+ export { Income, Location, Money, Paging, HRIS } from './hris/hris';
6
+ export { Provider, ProvidersSinglePage, Providers } from './providers';
@@ -0,0 +1,59 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import * as Core from '~/core';
4
+ import { APIResource } from '~/resource';
5
+ import { SinglePage } from '~/pagination';
6
+
7
+ export class Providers extends APIResource {
8
+ /**
9
+ * Return details on all available payroll and HR systems.
10
+ */
11
+ list(options?: Core.RequestOptions): Core.PagePromise<ProvidersSinglePage> {
12
+ return this.getAPIList('/providers', ProvidersSinglePage, options);
13
+ }
14
+ }
15
+
16
+ export class ProvidersSinglePage extends SinglePage<Provider> {}
17
+
18
+ export interface Provider {
19
+ /**
20
+ * The display name of the payroll provider.
21
+ */
22
+ display_name?: string;
23
+
24
+ /**
25
+ * The url to the official icon of the payroll provider.
26
+ */
27
+ icon?: string;
28
+
29
+ /**
30
+ * The id of the payroll provider used in Connect.
31
+ */
32
+ id?: string;
33
+
34
+ /**
35
+ * The url to the official logo of the payroll provider.
36
+ */
37
+ logo?: string;
38
+
39
+ /**
40
+ * Whether the Finch integration with this provider uses the Assisted Connect Flow
41
+ * by default.
42
+ */
43
+ manual?: boolean;
44
+
45
+ /**
46
+ * whether MFA is required for the provider.
47
+ */
48
+ mfa_required?: boolean;
49
+
50
+ /**
51
+ * The hex code for the primary color of the payroll provider.
52
+ */
53
+ primary_color?: string;
54
+
55
+ /**
56
+ * The list of Finch products supported on this payroll provider.
57
+ */
58
+ products?: Array<string>;
59
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ export {};
@@ -0,0 +1,29 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import Finch from '~/index';
4
+
5
+ const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
6
+
7
+ describe('resource account', () => {
8
+ test('disconnect', async () => {
9
+ const response = await finch.account.disconnect();
10
+ });
11
+
12
+ test('disconnect: request options instead of params are passed correctly', async () => {
13
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
14
+ await expect(finch.account.disconnect({ path: '/_stainless_unknown_path' })).rejects.toThrow(
15
+ Finch.NotFoundError,
16
+ );
17
+ });
18
+
19
+ test('introspect', async () => {
20
+ const response = await finch.account.introspect();
21
+ });
22
+
23
+ test('introspect: request options instead of params are passed correctly', async () => {
24
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
25
+ await expect(finch.account.introspect({ path: '/_stainless_unknown_path' })).rejects.toThrow(
26
+ Finch.NotFoundError,
27
+ );
28
+ });
29
+ });
@@ -0,0 +1,36 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import Finch from '~/index';
4
+
5
+ const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
6
+
7
+ describe('resource applications', () => {
8
+ test('retrieve', async () => {
9
+ const response = await finch.ats.applications.retrieve('string');
10
+ });
11
+
12
+ test('retrieve: request options instead of params are passed correctly', async () => {
13
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
14
+ await expect(
15
+ finch.ats.applications.retrieve('string', { path: '/_stainless_unknown_path' }),
16
+ ).rejects.toThrow(Finch.NotFoundError);
17
+ });
18
+
19
+ test('list', async () => {
20
+ const response = await finch.ats.applications.list();
21
+ });
22
+
23
+ test('list: request options instead of params are passed correctly', async () => {
24
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
25
+ await expect(finch.ats.applications.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
26
+ Finch.NotFoundError,
27
+ );
28
+ });
29
+
30
+ test('list: request options and params are passed correctly', async () => {
31
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
32
+ await expect(
33
+ finch.ats.applications.list({ limit: 0, offset: 0 }, { path: '/_stainless_unknown_path' }),
34
+ ).rejects.toThrow(Finch.NotFoundError);
35
+ });
36
+ });
@@ -0,0 +1,36 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import Finch from '~/index';
4
+
5
+ const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
6
+
7
+ describe('resource candidates', () => {
8
+ test('retrieve', async () => {
9
+ const response = await finch.ats.candidates.retrieve('string');
10
+ });
11
+
12
+ test('retrieve: request options instead of params are passed correctly', async () => {
13
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
14
+ await expect(
15
+ finch.ats.candidates.retrieve('string', { path: '/_stainless_unknown_path' }),
16
+ ).rejects.toThrow(Finch.NotFoundError);
17
+ });
18
+
19
+ test('list', async () => {
20
+ const response = await finch.ats.candidates.list();
21
+ });
22
+
23
+ test('list: request options instead of params are passed correctly', async () => {
24
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
25
+ await expect(finch.ats.candidates.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
26
+ Finch.NotFoundError,
27
+ );
28
+ });
29
+
30
+ test('list: request options and params are passed correctly', async () => {
31
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
32
+ await expect(
33
+ finch.ats.candidates.list({ limit: 0, offset: 0 }, { path: '/_stainless_unknown_path' }),
34
+ ).rejects.toThrow(Finch.NotFoundError);
35
+ });
36
+ });
@@ -0,0 +1,36 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import Finch from '~/index';
4
+
5
+ const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
6
+
7
+ describe('resource jobs', () => {
8
+ test('retrieve', async () => {
9
+ const response = await finch.ats.jobs.retrieve('string');
10
+ });
11
+
12
+ test('retrieve: request options instead of params are passed correctly', async () => {
13
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
14
+ await expect(finch.ats.jobs.retrieve('string', { path: '/_stainless_unknown_path' })).rejects.toThrow(
15
+ Finch.NotFoundError,
16
+ );
17
+ });
18
+
19
+ test('list', async () => {
20
+ const response = await finch.ats.jobs.list();
21
+ });
22
+
23
+ test('list: request options instead of params are passed correctly', async () => {
24
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
25
+ await expect(finch.ats.jobs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
26
+ Finch.NotFoundError,
27
+ );
28
+ });
29
+
30
+ test('list: request options and params are passed correctly', async () => {
31
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
32
+ await expect(
33
+ finch.ats.jobs.list({ limit: 0, offset: 0 }, { path: '/_stainless_unknown_path' }),
34
+ ).rejects.toThrow(Finch.NotFoundError);
35
+ });
36
+ });
@@ -0,0 +1,36 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import Finch from '~/index';
4
+
5
+ const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
6
+
7
+ describe('resource offers', () => {
8
+ test('retrieve', async () => {
9
+ const response = await finch.ats.offers.retrieve('string');
10
+ });
11
+
12
+ test('retrieve: request options instead of params are passed correctly', async () => {
13
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
14
+ await expect(finch.ats.offers.retrieve('string', { path: '/_stainless_unknown_path' })).rejects.toThrow(
15
+ Finch.NotFoundError,
16
+ );
17
+ });
18
+
19
+ test('list', async () => {
20
+ const response = await finch.ats.offers.list();
21
+ });
22
+
23
+ test('list: request options instead of params are passed correctly', async () => {
24
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
25
+ await expect(finch.ats.offers.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
26
+ Finch.NotFoundError,
27
+ );
28
+ });
29
+
30
+ test('list: request options and params are passed correctly', async () => {
31
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
32
+ await expect(
33
+ finch.ats.offers.list({ limit: 0, offset: 0 }, { path: '/_stainless_unknown_path' }),
34
+ ).rejects.toThrow(Finch.NotFoundError);
35
+ });
36
+ });
@@ -0,0 +1,18 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import Finch from '~/index';
4
+
5
+ const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
6
+
7
+ describe('resource stages', () => {
8
+ test('list', async () => {
9
+ const response = await finch.ats.stages.list();
10
+ });
11
+
12
+ test('list: request options instead of params are passed correctly', async () => {
13
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
14
+ await expect(finch.ats.stages.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
15
+ Finch.NotFoundError,
16
+ );
17
+ });
18
+ });
@@ -0,0 +1,79 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import Finch from '~/index';
4
+
5
+ const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
6
+
7
+ describe('resource benefits', () => {
8
+ test('create', async () => {
9
+ const response = await finch.hris.benefits.create();
10
+ });
11
+
12
+ test('create: request options instead of params are passed correctly', async () => {
13
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
14
+ await expect(finch.hris.benefits.create({ path: '/_stainless_unknown_path' })).rejects.toThrow(
15
+ Finch.NotFoundError,
16
+ );
17
+ });
18
+
19
+ test('create: request options and params are passed correctly', async () => {
20
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
21
+ await expect(
22
+ finch.hris.benefits.create(
23
+ { description: 'string', frequency: 'one_time', type: '401k' },
24
+ { path: '/_stainless_unknown_path' },
25
+ ),
26
+ ).rejects.toThrow(Finch.NotFoundError);
27
+ });
28
+
29
+ test('retrieve', async () => {
30
+ const response = await finch.hris.benefits.retrieve('string');
31
+ });
32
+
33
+ test('retrieve: request options instead of params are passed correctly', async () => {
34
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
35
+ await expect(
36
+ finch.hris.benefits.retrieve('string', { path: '/_stainless_unknown_path' }),
37
+ ).rejects.toThrow(Finch.NotFoundError);
38
+ });
39
+
40
+ test('update', async () => {
41
+ const response = await finch.hris.benefits.update('string');
42
+ });
43
+
44
+ test('update: request options instead of params are passed correctly', async () => {
45
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
46
+ await expect(finch.hris.benefits.update('string', { path: '/_stainless_unknown_path' })).rejects.toThrow(
47
+ Finch.NotFoundError,
48
+ );
49
+ });
50
+
51
+ test('update: request options and params are passed correctly', async () => {
52
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
53
+ await expect(
54
+ finch.hris.benefits.update('string', { description: 'string' }, { path: '/_stainless_unknown_path' }),
55
+ ).rejects.toThrow(Finch.NotFoundError);
56
+ });
57
+
58
+ test('list', async () => {
59
+ const response = await finch.hris.benefits.list();
60
+ });
61
+
62
+ test('list: request options instead of params are passed correctly', async () => {
63
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
64
+ await expect(finch.hris.benefits.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
65
+ Finch.NotFoundError,
66
+ );
67
+ });
68
+
69
+ test('listSupportedBenefits', async () => {
70
+ const response = await finch.hris.benefits.listSupportedBenefits();
71
+ });
72
+
73
+ test('listSupportedBenefits: request options instead of params are passed correctly', async () => {
74
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
75
+ await expect(
76
+ finch.hris.benefits.listSupportedBenefits({ path: '/_stainless_unknown_path' }),
77
+ ).rejects.toThrow(Finch.NotFoundError);
78
+ });
79
+ });