@kombo-api/sdk 0.2.3 → 0.3.2

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 (244) hide show
  1. package/README.md +7 -7
  2. package/_speakeasy/.github/action-inputs-config.json +53 -0
  3. package/_speakeasy/.github/action-security-config.json +88 -0
  4. package/esm/funcs/assessmentGetOpenOrders.js +1 -1
  5. package/esm/funcs/assessmentGetOpenOrders.js.map +1 -1
  6. package/esm/funcs/atsGetApplicationStages.js +1 -1
  7. package/esm/funcs/atsGetApplicationStages.js.map +1 -1
  8. package/esm/funcs/atsGetApplications.js +1 -1
  9. package/esm/funcs/atsGetApplications.js.map +1 -1
  10. package/esm/funcs/atsGetCandidates.js +1 -1
  11. package/esm/funcs/atsGetCandidates.js.map +1 -1
  12. package/esm/funcs/atsGetInterviews.js +1 -1
  13. package/esm/funcs/atsGetInterviews.js.map +1 -1
  14. package/esm/funcs/atsGetJobs.js +1 -1
  15. package/esm/funcs/atsGetJobs.js.map +1 -1
  16. package/esm/funcs/atsGetOffers.js +1 -1
  17. package/esm/funcs/atsGetOffers.js.map +1 -1
  18. package/esm/funcs/atsGetRejectionReasons.js +1 -1
  19. package/esm/funcs/atsGetRejectionReasons.js.map +1 -1
  20. package/esm/funcs/atsGetTags.js +1 -1
  21. package/esm/funcs/atsGetTags.js.map +1 -1
  22. package/esm/funcs/atsGetUsers.js +1 -1
  23. package/esm/funcs/atsGetUsers.js.map +1 -1
  24. package/esm/funcs/generalGetCustomFields.js +1 -1
  25. package/esm/funcs/generalGetCustomFields.js.map +1 -1
  26. package/esm/funcs/generalGetIntegrationFields.js +1 -1
  27. package/esm/funcs/generalGetIntegrationFields.js.map +1 -1
  28. package/esm/funcs/generalSendPassthroughRequest.d.ts +9 -1
  29. package/esm/funcs/generalSendPassthroughRequest.d.ts.map +1 -1
  30. package/esm/funcs/generalSendPassthroughRequest.js +9 -1
  31. package/esm/funcs/generalSendPassthroughRequest.js.map +1 -1
  32. package/esm/funcs/hrisGetAbsenceTypes.js +1 -1
  33. package/esm/funcs/hrisGetAbsenceTypes.js.map +1 -1
  34. package/esm/funcs/hrisGetAbsences.js +1 -1
  35. package/esm/funcs/hrisGetAbsences.js.map +1 -1
  36. package/esm/funcs/hrisGetEmployeeDocumentCategories.js +1 -1
  37. package/esm/funcs/hrisGetEmployeeDocumentCategories.js.map +1 -1
  38. package/esm/funcs/hrisGetEmployees.js +1 -1
  39. package/esm/funcs/hrisGetEmployees.js.map +1 -1
  40. package/esm/funcs/hrisGetEmployments.js +1 -1
  41. package/esm/funcs/hrisGetEmployments.js.map +1 -1
  42. package/esm/funcs/hrisGetGroups.js +1 -1
  43. package/esm/funcs/hrisGetGroups.js.map +1 -1
  44. package/esm/funcs/hrisGetLegalEntities.js +1 -1
  45. package/esm/funcs/hrisGetLegalEntities.js.map +1 -1
  46. package/esm/funcs/hrisGetLocations.js +1 -1
  47. package/esm/funcs/hrisGetLocations.js.map +1 -1
  48. package/esm/funcs/hrisGetPerformanceReviewCycles.js +1 -1
  49. package/esm/funcs/hrisGetPerformanceReviewCycles.js.map +1 -1
  50. package/esm/funcs/hrisGetPerformanceReviews.js +1 -1
  51. package/esm/funcs/hrisGetPerformanceReviews.js.map +1 -1
  52. package/esm/funcs/hrisGetTimeOffBalances.js +1 -1
  53. package/esm/funcs/hrisGetTimeOffBalances.js.map +1 -1
  54. package/esm/funcs/hrisGetTimesheets.js +1 -1
  55. package/esm/funcs/hrisGetTimesheets.js.map +1 -1
  56. package/esm/funcs/validateWebhook.d.ts +13 -0
  57. package/esm/funcs/validateWebhook.d.ts.map +1 -0
  58. package/esm/funcs/validateWebhook.js +34 -0
  59. package/esm/funcs/validateWebhook.js.map +1 -0
  60. package/esm/lib/config.d.ts +3 -3
  61. package/esm/lib/config.js +3 -3
  62. package/esm/lib/encodings.d.ts +1 -0
  63. package/esm/lib/encodings.d.ts.map +1 -1
  64. package/esm/lib/encodings.js +12 -1
  65. package/esm/lib/encodings.js.map +1 -1
  66. package/esm/models/assessmentorderreceivedwebhookpayload.d.ts +5 -5
  67. package/esm/models/assessmentorderreceivedwebhookpayload.d.ts.map +1 -1
  68. package/esm/models/assessmentorderreceivedwebhookpayload.js +2 -2
  69. package/esm/models/assessmentorderreceivedwebhookpayload.js.map +1 -1
  70. package/esm/models/connectionflowfailedwebhookpayload.d.ts +4 -3
  71. package/esm/models/connectionflowfailedwebhookpayload.d.ts.map +1 -1
  72. package/esm/models/connectionflowfailedwebhookpayload.js +2 -1
  73. package/esm/models/connectionflowfailedwebhookpayload.js.map +1 -1
  74. package/esm/models/datachangedwebhookpayload.d.ts +11 -3
  75. package/esm/models/datachangedwebhookpayload.d.ts.map +1 -1
  76. package/esm/models/datachangedwebhookpayload.js +9 -1
  77. package/esm/models/datachangedwebhookpayload.js.map +1 -1
  78. package/esm/models/getassessmentordersopenpositiveresponse.d.ts +4 -4
  79. package/esm/models/getassessmentordersopenpositiveresponse.d.ts.map +1 -1
  80. package/esm/models/getassessmentordersopenpositiveresponse.js +1 -1
  81. package/esm/models/getassessmentordersopenpositiveresponse.js.map +1 -1
  82. package/esm/models/getatsjobspositiveresponse.d.ts +3 -3
  83. package/esm/models/getatsjobspositiveresponse.d.ts.map +1 -1
  84. package/esm/models/getatsjobspositiveresponse.js +4 -4
  85. package/esm/models/getatsjobspositiveresponse.js.map +1 -1
  86. package/esm/models/gethrisemployeesformpositiveresponse.d.ts +2 -2
  87. package/esm/models/gethrisemployeesformpositiveresponse.d.ts.map +1 -1
  88. package/esm/models/gethrisemployeesformpositiveresponse.js +8 -8
  89. package/esm/models/gethrisemployeesformpositiveresponse.js.map +1 -1
  90. package/esm/models/getintegrationsintegrationidpositiveresponse.d.ts +158 -16
  91. package/esm/models/getintegrationsintegrationidpositiveresponse.d.ts.map +1 -1
  92. package/esm/models/getintegrationsintegrationidpositiveresponse.js +87 -13
  93. package/esm/models/getintegrationsintegrationidpositiveresponse.js.map +1 -1
  94. package/esm/models/gettoolscategoryparametercategory.d.ts +1 -0
  95. package/esm/models/gettoolscategoryparametercategory.d.ts.map +1 -1
  96. package/esm/models/gettoolscategoryparametercategory.js +1 -0
  97. package/esm/models/gettoolscategoryparametercategory.js.map +1 -1
  98. package/esm/models/gettoolscategorypositiveresponse.d.ts +66 -16
  99. package/esm/models/gettoolscategorypositiveresponse.d.ts.map +1 -1
  100. package/esm/models/gettoolscategorypositiveresponse.js +41 -14
  101. package/esm/models/gettoolscategorypositiveresponse.js.map +1 -1
  102. package/esm/models/inlineassessmentorderreceivedwebhookpayload.d.ts +5 -5
  103. package/esm/models/inlineassessmentorderreceivedwebhookpayload.d.ts.map +1 -1
  104. package/esm/models/inlineassessmentorderreceivedwebhookpayload.js +2 -2
  105. package/esm/models/inlineassessmentorderreceivedwebhookpayload.js.map +1 -1
  106. package/esm/models/integrationcreatedwebhookpayload.d.ts +1 -0
  107. package/esm/models/integrationcreatedwebhookpayload.d.ts.map +1 -1
  108. package/esm/models/integrationcreatedwebhookpayload.js +1 -0
  109. package/esm/models/integrationcreatedwebhookpayload.js.map +1 -1
  110. package/esm/models/integrationdeletedwebhookpayload.d.ts +1 -0
  111. package/esm/models/integrationdeletedwebhookpayload.d.ts.map +1 -1
  112. package/esm/models/integrationdeletedwebhookpayload.js +1 -0
  113. package/esm/models/integrationdeletedwebhookpayload.js.map +1 -1
  114. package/esm/models/integrationstatechangedwebhookpayload.d.ts +4 -3
  115. package/esm/models/integrationstatechangedwebhookpayload.d.ts.map +1 -1
  116. package/esm/models/integrationstatechangedwebhookpayload.js +2 -1
  117. package/esm/models/integrationstatechangedwebhookpayload.js.map +1 -1
  118. package/esm/models/kombohriserror.d.ts +1 -0
  119. package/esm/models/kombohriserror.d.ts.map +1 -1
  120. package/esm/models/kombohriserror.js +1 -0
  121. package/esm/models/kombohriserror.js.map +1 -1
  122. package/esm/models/postatscandidatesrequestbody.d.ts +27 -0
  123. package/esm/models/postatscandidatesrequestbody.d.ts.map +1 -1
  124. package/esm/models/postatscandidatesrequestbody.js +10 -0
  125. package/esm/models/postatscandidatesrequestbody.js.map +1 -1
  126. package/esm/models/postatsjobsjobidapplicationsrequestbody.d.ts +27 -0
  127. package/esm/models/postatsjobsjobidapplicationsrequestbody.d.ts.map +1 -1
  128. package/esm/models/postatsjobsjobidapplicationsrequestbody.js +9 -0
  129. package/esm/models/postatsjobsjobidapplicationsrequestbody.js.map +1 -1
  130. package/esm/models/postconnectcreatelinkrequestbody.d.ts +5 -0
  131. package/esm/models/postconnectcreatelinkrequestbody.d.ts.map +1 -1
  132. package/esm/models/postconnectcreatelinkrequestbody.js +5 -0
  133. package/esm/models/postconnectcreatelinkrequestbody.js.map +1 -1
  134. package/esm/models/posthrisemployeesformpositiveresponse.d.ts +15 -3
  135. package/esm/models/posthrisemployeesformpositiveresponse.d.ts.map +1 -1
  136. package/esm/models/posthrisemployeesformpositiveresponse.js +8 -1
  137. package/esm/models/posthrisemployeesformpositiveresponse.js.map +1 -1
  138. package/esm/models/putassessmentordersassessmentorderidresultrequestbody.d.ts +4 -4
  139. package/esm/models/putassessmentordersassessmentorderidresultrequestbody.d.ts.map +1 -1
  140. package/esm/models/putassessmentordersassessmentorderidresultrequestbody.js +2 -2
  141. package/esm/models/putassessmentordersassessmentorderidresultrequestbody.js.map +1 -1
  142. package/esm/models/schema1union1.d.ts +1 -1
  143. package/esm/models/schema1union1.d.ts.map +1 -1
  144. package/esm/models/schema1union1.js +4 -4
  145. package/esm/models/schema1union1.js.map +1 -1
  146. package/esm/models/schema1union2.d.ts +1 -1
  147. package/esm/models/schema1union2.d.ts.map +1 -1
  148. package/esm/models/schema1union2.js +4 -4
  149. package/esm/models/schema1union2.js.map +1 -1
  150. package/esm/models/schema2union1.d.ts +2 -2
  151. package/esm/models/schema2union1.d.ts.map +1 -1
  152. package/esm/models/schema2union1.js +8 -8
  153. package/esm/models/schema2union1.js.map +1 -1
  154. package/esm/models/schema2union2.d.ts +2 -2
  155. package/esm/models/schema2union2.d.ts.map +1 -1
  156. package/esm/models/schema2union2.js +8 -8
  157. package/esm/models/schema2union2.js.map +1 -1
  158. package/esm/models/syncfinishedwebhookpayload.d.ts +4 -3
  159. package/esm/models/syncfinishedwebhookpayload.d.ts.map +1 -1
  160. package/esm/models/syncfinishedwebhookpayload.js +2 -1
  161. package/esm/models/syncfinishedwebhookpayload.js.map +1 -1
  162. package/esm/sdk/general.d.ts +9 -1
  163. package/esm/sdk/general.d.ts.map +1 -1
  164. package/esm/sdk/general.js +9 -1
  165. package/esm/sdk/general.js.map +1 -1
  166. package/esm/sdk/sdk.d.ts +9 -0
  167. package/esm/sdk/sdk.d.ts.map +1 -1
  168. package/esm/sdk/sdk.js +5 -0
  169. package/esm/sdk/sdk.js.map +1 -1
  170. package/esm/types/enums.d.ts +1 -8
  171. package/esm/types/enums.d.ts.map +1 -1
  172. package/esm/types/enums.js +1 -18
  173. package/esm/types/enums.js.map +1 -1
  174. package/esm/types/index.d.ts +2 -1
  175. package/esm/types/index.d.ts.map +1 -1
  176. package/esm/types/index.js +1 -0
  177. package/esm/types/index.js.map +1 -1
  178. package/esm/types/unrecognized.d.ts +16 -0
  179. package/esm/types/unrecognized.d.ts.map +1 -0
  180. package/esm/types/unrecognized.js +31 -0
  181. package/esm/types/unrecognized.js.map +1 -0
  182. package/examples/package-lock.json +1 -1
  183. package/jsr.json +1 -1
  184. package/package.json +1 -1
  185. package/src/funcs/assessmentGetOpenOrders.ts +1 -1
  186. package/src/funcs/atsGetApplicationStages.ts +1 -1
  187. package/src/funcs/atsGetApplications.ts +1 -1
  188. package/src/funcs/atsGetCandidates.ts +1 -1
  189. package/src/funcs/atsGetInterviews.ts +1 -1
  190. package/src/funcs/atsGetJobs.ts +1 -1
  191. package/src/funcs/atsGetOffers.ts +1 -1
  192. package/src/funcs/atsGetRejectionReasons.ts +1 -1
  193. package/src/funcs/atsGetTags.ts +1 -1
  194. package/src/funcs/atsGetUsers.ts +1 -1
  195. package/src/funcs/generalGetCustomFields.ts +1 -1
  196. package/src/funcs/generalGetIntegrationFields.ts +1 -1
  197. package/src/funcs/generalSendPassthroughRequest.ts +9 -1
  198. package/src/funcs/hrisGetAbsenceTypes.ts +1 -1
  199. package/src/funcs/hrisGetAbsences.ts +1 -1
  200. package/src/funcs/hrisGetEmployeeDocumentCategories.ts +1 -1
  201. package/src/funcs/hrisGetEmployees.ts +1 -1
  202. package/src/funcs/hrisGetEmployments.ts +1 -1
  203. package/src/funcs/hrisGetGroups.ts +1 -1
  204. package/src/funcs/hrisGetLegalEntities.ts +1 -1
  205. package/src/funcs/hrisGetLocations.ts +1 -1
  206. package/src/funcs/hrisGetPerformanceReviewCycles.ts +1 -1
  207. package/src/funcs/hrisGetPerformanceReviews.ts +1 -1
  208. package/src/funcs/hrisGetTimeOffBalances.ts +1 -1
  209. package/src/funcs/hrisGetTimesheets.ts +1 -1
  210. package/src/funcs/validateWebhook.ts +74 -0
  211. package/src/lib/config.ts +3 -3
  212. package/src/lib/encodings.ts +17 -3
  213. package/src/models/assessmentorderreceivedwebhookpayload.ts +7 -7
  214. package/src/models/connectionflowfailedwebhookpayload.ts +4 -3
  215. package/src/models/datachangedwebhookpayload.ts +11 -3
  216. package/src/models/getassessmentordersopenpositiveresponse.ts +5 -5
  217. package/src/models/getatsjobspositiveresponse.ts +9 -9
  218. package/src/models/gethrisemployeesformpositiveresponse.ts +18 -18
  219. package/src/models/getintegrationsintegrationidpositiveresponse.ts +292 -44
  220. package/src/models/gettoolscategoryparametercategory.ts +1 -0
  221. package/src/models/gettoolscategorypositiveresponse.ts +160 -48
  222. package/src/models/inlineassessmentorderreceivedwebhookpayload.ts +7 -7
  223. package/src/models/integrationcreatedwebhookpayload.ts +1 -0
  224. package/src/models/integrationdeletedwebhookpayload.ts +1 -0
  225. package/src/models/integrationstatechangedwebhookpayload.ts +4 -3
  226. package/src/models/kombohriserror.ts +1 -0
  227. package/src/models/postatscandidatesrequestbody.ts +44 -0
  228. package/src/models/postatsjobsjobidapplicationsrequestbody.ts +49 -0
  229. package/src/models/postconnectcreatelinkrequestbody.ts +5 -0
  230. package/src/models/posthrisemployeesformpositiveresponse.ts +30 -4
  231. package/src/models/putassessmentordersassessmentorderidresultrequestbody.ts +7 -7
  232. package/src/models/schema1union1.ts +9 -9
  233. package/src/models/schema1union2.ts +9 -9
  234. package/src/models/schema2union1.ts +18 -18
  235. package/src/models/schema2union2.ts +18 -18
  236. package/src/models/syncfinishedwebhookpayload.ts +4 -3
  237. package/src/sdk/general.ts +9 -1
  238. package/src/sdk/sdk.ts +28 -0
  239. package/src/types/enums.ts +1 -21
  240. package/src/types/index.ts +2 -1
  241. package/src/types/unrecognized.ts +35 -0
  242. package/tests/basic-behavior.spec.ts +355 -2
  243. package/tests/helpers/test-context.ts +5 -2
  244. package/tsconfig.json +1 -2
@@ -1,7 +1,6 @@
1
- import { it, expect } from "vitest";
1
+ import { it, expect, describe } from "vitest";
2
2
  import { TestContext, describeSdkSuite } from "./helpers/test-context";
3
3
 
4
- // TODO: test basic error handling behavior
5
4
  describeSdkSuite("Basic SDK Behavior", () => {
6
5
  it("should include API key in Authorization header", async () => {
7
6
  const ctx = new TestContext({ apiKey: "my-custom-api-key" });
@@ -159,4 +158,358 @@ describeSdkSuite("Basic SDK Behavior", () => {
159
158
  const requestWithoutDeleted = ctx.getLastRequest();
160
159
  expect(requestWithoutDeleted.path).toContain("include_deleted=false");
161
160
  });
161
+
162
+ describe("Pagination Behavior", () => {
163
+ it("should iterate through multiple pages", async () => {
164
+ const ctx = new TestContext();
165
+
166
+ // Mock 3 pages of results
167
+ ctx.mockEndpoint({
168
+ method: "GET",
169
+ path: "/v1/ats/tags",
170
+ response: {
171
+ body: {
172
+ status: "success",
173
+ data: {
174
+ results: [
175
+ {
176
+ id: "tag1",
177
+ remote_id: null,
178
+ name: "Tag 1",
179
+ changed_at: "2024-01-01T00:00:00.000Z",
180
+ remote_deleted_at: null,
181
+ },
182
+ {
183
+ id: "tag2",
184
+ remote_id: null,
185
+ name: "Tag 2",
186
+ changed_at: "2024-01-01T00:00:00.000Z",
187
+ remote_deleted_at: null,
188
+ },
189
+ ],
190
+ next: "cursor_page2",
191
+ },
192
+ },
193
+ },
194
+ });
195
+
196
+ ctx.mockEndpoint({
197
+ method: "GET",
198
+ path: "/v1/ats/tags",
199
+ response: {
200
+ body: {
201
+ status: "success",
202
+ data: {
203
+ results: [
204
+ {
205
+ id: "tag3",
206
+ remote_id: null,
207
+ name: "Tag 3",
208
+ changed_at: "2024-01-01T00:00:00.000Z",
209
+ remote_deleted_at: null,
210
+ },
211
+ {
212
+ id: "tag4",
213
+ remote_id: null,
214
+ name: "Tag 4",
215
+ changed_at: "2024-01-01T00:00:00.000Z",
216
+ remote_deleted_at: null,
217
+ },
218
+ ],
219
+ next: "cursor_page3",
220
+ },
221
+ },
222
+ },
223
+ });
224
+
225
+ ctx.mockEndpoint({
226
+ method: "GET",
227
+ path: "/v1/ats/tags",
228
+ response: {
229
+ body: {
230
+ status: "success",
231
+ data: {
232
+ results: [
233
+ {
234
+ id: "tag5",
235
+ remote_id: null,
236
+ name: "Tag 5",
237
+ changed_at: "2024-01-01T00:00:00.000Z",
238
+ remote_deleted_at: null,
239
+ },
240
+ ],
241
+ next: null,
242
+ },
243
+ },
244
+ },
245
+ });
246
+
247
+ const tags = await ctx.kombo.ats.getTags({});
248
+ const allResults: unknown[] = [];
249
+
250
+ for await (const page of tags) {
251
+ allResults.push(...page.result.data.results);
252
+ }
253
+
254
+ // Verify all 5 tags were collected
255
+ expect(allResults).toHaveLength(5);
256
+ expect(allResults.map((r: any) => r.id)).toEqual([
257
+ "tag1",
258
+ "tag2",
259
+ "tag3",
260
+ "tag4",
261
+ "tag5",
262
+ ]);
263
+
264
+ // Verify 3 HTTP requests were made
265
+ const requests = ctx.getRequests();
266
+ expect(requests).toHaveLength(3);
267
+ });
268
+
269
+ it("should pass cursor parameter to subsequent requests", async () => {
270
+ const ctx = new TestContext();
271
+
272
+ ctx.mockEndpoint({
273
+ method: "GET",
274
+ path: "/v1/ats/tags",
275
+ response: {
276
+ body: {
277
+ status: "success",
278
+ data: {
279
+ results: [
280
+ {
281
+ id: "tag1",
282
+ remote_id: null,
283
+ name: "Tag 1",
284
+ changed_at: "2024-01-01T00:00:00.000Z",
285
+ remote_deleted_at: null,
286
+ },
287
+ ],
288
+ next: "test_cursor_abc123",
289
+ },
290
+ },
291
+ },
292
+ });
293
+
294
+ ctx.mockEndpoint({
295
+ method: "GET",
296
+ path: "/v1/ats/tags",
297
+ response: {
298
+ body: {
299
+ status: "success",
300
+ data: {
301
+ results: [
302
+ {
303
+ id: "tag2",
304
+ remote_id: null,
305
+ name: "Tag 2",
306
+ changed_at: "2024-01-01T00:00:00.000Z",
307
+ remote_deleted_at: null,
308
+ },
309
+ ],
310
+ next: null,
311
+ },
312
+ },
313
+ },
314
+ });
315
+
316
+ const tags = await ctx.kombo.ats.getTags({});
317
+ for await (const _page of tags) {
318
+ // Iterate through all pages
319
+ }
320
+
321
+ const requests = ctx.getRequests();
322
+ expect(requests).toHaveLength(2);
323
+
324
+ // First request should NOT include cursor
325
+ expect(requests[0].path).not.toContain("cursor=");
326
+
327
+ // Second request SHOULD include cursor
328
+ expect(requests[1].path).toContain("cursor=test_cursor_abc123");
329
+ });
330
+
331
+ it("should stop pagination when next is null", async () => {
332
+ const ctx = new TestContext();
333
+
334
+ ctx.mockEndpoint({
335
+ method: "GET",
336
+ path: "/v1/ats/tags",
337
+ response: {
338
+ body: {
339
+ status: "success",
340
+ data: {
341
+ results: [
342
+ {
343
+ id: "tag1",
344
+ remote_id: null,
345
+ name: "Tag 1",
346
+ changed_at: "2024-01-01T00:00:00.000Z",
347
+ remote_deleted_at: null,
348
+ },
349
+ {
350
+ id: "tag2",
351
+ remote_id: null,
352
+ name: "Tag 2",
353
+ changed_at: "2024-01-01T00:00:00.000Z",
354
+ remote_deleted_at: null,
355
+ },
356
+ ],
357
+ next: null,
358
+ },
359
+ },
360
+ },
361
+ });
362
+
363
+ const tags = await ctx.kombo.ats.getTags({});
364
+ const pageCount: number[] = [];
365
+
366
+ for await (const _page of tags) {
367
+ pageCount.push(1);
368
+ }
369
+
370
+ // Verify only 1 page was returned
371
+ expect(pageCount).toHaveLength(1);
372
+
373
+ // Verify only 1 HTTP request was made
374
+ const requests = ctx.getRequests();
375
+ expect(requests).toHaveLength(1);
376
+ });
377
+
378
+ it("should preserve query parameters across paginated requests", async () => {
379
+ const ctx = new TestContext();
380
+
381
+ ctx.mockEndpoint({
382
+ method: "GET",
383
+ path: "/v1/ats/tags",
384
+ response: {
385
+ body: {
386
+ status: "success",
387
+ data: {
388
+ results: [
389
+ {
390
+ id: "tag1",
391
+ remote_id: null,
392
+ name: "Tag 1",
393
+ changed_at: "2024-01-01T00:00:00.000Z",
394
+ remote_deleted_at: null,
395
+ },
396
+ ],
397
+ next: "cursor_for_page2",
398
+ },
399
+ },
400
+ },
401
+ });
402
+
403
+ ctx.mockEndpoint({
404
+ method: "GET",
405
+ path: "/v1/ats/tags",
406
+ response: {
407
+ body: {
408
+ status: "success",
409
+ data: {
410
+ results: [
411
+ {
412
+ id: "tag2",
413
+ remote_id: null,
414
+ name: "Tag 2",
415
+ changed_at: "2024-01-01T00:00:00.000Z",
416
+ remote_deleted_at: null,
417
+ },
418
+ ],
419
+ next: null,
420
+ },
421
+ },
422
+ },
423
+ });
424
+
425
+ const tags = await ctx.kombo.ats.getTags({
426
+ updated_after: new Date("2024-01-01T00:00:00.000Z"),
427
+ });
428
+
429
+ for await (const _page of tags) {
430
+ // Iterate through all pages
431
+ }
432
+
433
+ const requests = ctx.getRequests();
434
+ expect(requests).toHaveLength(2);
435
+
436
+ // Both requests should include the original query parameters
437
+ // Check that updated_after parameter is present (URL encoded)
438
+ expect(requests[0].path).toMatch(/updated_after=2024-01-01T00%3A00%3A00\.000Z/);
439
+ expect(requests[0].path).not.toContain("cursor=");
440
+
441
+ expect(requests[1].path).toMatch(/updated_after=2024-01-01T00%3A00%3A00\.000Z/);
442
+ expect(requests[1].path).toContain("cursor=cursor_for_page2");
443
+ });
444
+
445
+ it("should support manual pagination with next()", async () => {
446
+ const ctx = new TestContext();
447
+
448
+ ctx.mockEndpoint({
449
+ method: "GET",
450
+ path: "/v1/ats/tags",
451
+ response: {
452
+ body: {
453
+ status: "success",
454
+ data: {
455
+ results: [
456
+ {
457
+ id: "tag1",
458
+ remote_id: null,
459
+ name: "Tag 1",
460
+ changed_at: "2024-01-01T00:00:00.000Z",
461
+ remote_deleted_at: null,
462
+ },
463
+ ],
464
+ next: "manual_cursor_xyz",
465
+ },
466
+ },
467
+ },
468
+ });
469
+
470
+ ctx.mockEndpoint({
471
+ method: "GET",
472
+ path: "/v1/ats/tags",
473
+ response: {
474
+ body: {
475
+ status: "success",
476
+ data: {
477
+ results: [
478
+ {
479
+ id: "tag2",
480
+ remote_id: null,
481
+ name: "Tag 2",
482
+ changed_at: "2024-01-01T00:00:00.000Z",
483
+ remote_deleted_at: null,
484
+ },
485
+ ],
486
+ next: null,
487
+ },
488
+ },
489
+ },
490
+ });
491
+
492
+ const page1 = await ctx.kombo.ats.getTags({});
493
+
494
+ // Verify first page was fetched
495
+ expect(page1.result.data.results).toBeDefined();
496
+ expect(page1.result.data.results).toHaveLength(1);
497
+
498
+ // Manually call next()
499
+ const page2Result = await page1.next();
500
+
501
+ // Verify second page was fetched (should not be null if cursor was read correctly)
502
+ // This will fail if cursor extraction bug exists
503
+ expect(page2Result).not.toBeNull();
504
+ if (page2Result) {
505
+ expect(page2Result.result.data.results).toHaveLength(1);
506
+ expect(page2Result.result.data.results[0].id).toBe("tag2");
507
+ }
508
+
509
+ // Verify 2 HTTP requests were made
510
+ const requests = ctx.getRequests();
511
+ expect(requests).toHaveLength(2);
512
+ expect(requests[1].path).toContain("cursor=manual_cursor_xyz");
513
+ });
514
+ });
162
515
  });
@@ -1,4 +1,4 @@
1
- import { describe, beforeAll, afterAll } from "vitest";
1
+ import { describe, beforeAll, afterAll, afterEach } from "vitest";
2
2
  import nock from "nock";
3
3
  import { Kombo } from "../../src/index";
4
4
 
@@ -137,8 +137,11 @@ export function describeSdkSuite(name: string, fn: () => void) {
137
137
  nock.disableNetConnect();
138
138
  });
139
139
 
140
- afterAll(() => {
140
+ afterEach(() => {
141
141
  nock.cleanAll();
142
+ });
143
+
144
+ afterAll(() => {
142
145
  nock.enableNetConnect();
143
146
  });
144
147
 
package/tsconfig.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "incremental": true,
4
- "tsBuildInfoFile": ".tsbuildinfo",
3
+ "incremental": false,
5
4
  "target": "ES2020",
6
5
  "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
6
  "jsx": "react-jsx",