polytomic 1.16.1 → 1.18.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 (394) hide show
  1. package/Client.d.ts +14 -19
  2. package/api/errors/BadRequestError.js +7 -17
  3. package/api/errors/ConflictError.js +7 -17
  4. package/api/errors/ForbiddenError.js +7 -17
  5. package/api/errors/InternalServerError.js +7 -17
  6. package/api/errors/NotFoundError.js +7 -17
  7. package/api/errors/UnauthorizedError.js +7 -17
  8. package/api/errors/UnprocessableEntityError.js +7 -17
  9. package/api/resources/bulkSync/client/Client.d.ts +173 -24
  10. package/api/resources/bulkSync/client/Client.js +339 -118
  11. package/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +3 -0
  12. package/api/resources/bulkSync/client/requests/BulkSyncListRequest.d.ts +3 -0
  13. package/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +1 -1
  14. package/api/resources/bulkSync/client/requests/StartBulkSyncRequest.d.ts +4 -0
  15. package/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +1 -1
  16. package/api/resources/bulkSync/resources/executions/client/Client.d.ts +77 -12
  17. package/api/resources/bulkSync/resources/executions/client/Client.js +168 -66
  18. package/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +12 -0
  19. package/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListStatusRequest.d.ts +3 -3
  20. package/api/resources/bulkSync/resources/index.js +7 -17
  21. package/api/resources/bulkSync/resources/schedules/client/Client.d.ts +44 -15
  22. package/api/resources/bulkSync/resources/schedules/client/Client.js +116 -57
  23. package/api/resources/bulkSync/resources/schedules/client/requests/CreateScheduleRequest.d.ts +1 -1
  24. package/api/resources/bulkSync/resources/schedules/client/requests/UpdateScheduleRequest.d.ts +1 -1
  25. package/api/resources/bulkSync/resources/schemas/client/Client.d.ts +71 -11
  26. package/api/resources/bulkSync/resources/schemas/client/Client.js +150 -61
  27. package/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.d.ts +1 -0
  28. package/api/resources/bulkSync/resources/schemas/client/requests/SchemasListRequest.d.ts +3 -0
  29. package/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.d.ts +7 -0
  30. package/api/resources/bulkSync/types/V2CreateBulkSyncRequestSchemasItem.d.ts +1 -1
  31. package/api/resources/bulkSync/types/V2UpdateBulkSyncRequestSchemasItem.d.ts +1 -1
  32. package/api/resources/connections/client/Client.d.ts +134 -18
  33. package/api/resources/connections/client/Client.js +359 -104
  34. package/api/resources/connections/client/requests/ApiRequest.d.ts +2 -2
  35. package/api/resources/events/client/Client.d.ts +20 -7
  36. package/api/resources/events/client/Client.js +55 -33
  37. package/api/resources/events/client/requests/EventsListRequest.d.ts +17 -2
  38. package/api/resources/identity/client/Client.d.ts +11 -6
  39. package/api/resources/identity/client/Client.js +31 -24
  40. package/api/resources/index.js +7 -17
  41. package/api/resources/jobs/client/Client.d.ts +15 -8
  42. package/api/resources/jobs/client/Client.js +35 -26
  43. package/api/resources/modelSync/client/Client.d.ts +110 -19
  44. package/api/resources/modelSync/client/Client.js +287 -118
  45. package/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +1 -1
  46. package/api/resources/modelSync/client/requests/ModelSyncGetSourceFieldsRequest.d.ts +3 -0
  47. package/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.d.ts +3 -0
  48. package/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +1 -1
  49. package/api/resources/modelSync/resources/executions/client/Client.d.ts +41 -12
  50. package/api/resources/modelSync/resources/executions/client/Client.js +115 -56
  51. package/api/resources/modelSync/resources/executions/client/requests/UpdateExecutionRequest.d.ts +1 -1
  52. package/api/resources/modelSync/resources/index.js +7 -17
  53. package/api/resources/modelSync/resources/targets/client/Client.d.ts +28 -11
  54. package/api/resources/modelSync/resources/targets/client/Client.js +89 -49
  55. package/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetFieldsRequest.d.ts +6 -0
  56. package/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetRequest.d.ts +6 -0
  57. package/api/resources/models/client/Client.d.ts +79 -8
  58. package/api/resources/models/client/Client.js +214 -86
  59. package/api/resources/models/client/requests/ModelsGetEnrichmentSourceRequest.d.ts +3 -0
  60. package/api/resources/notifications/client/Client.d.ts +13 -5
  61. package/api/resources/notifications/client/Client.js +48 -31
  62. package/api/resources/notifications/client/requests/V4GlobalErrorSubscribersRequest.d.ts +1 -0
  63. package/api/resources/organization/client/Client.d.ts +31 -13
  64. package/api/resources/organization/client/Client.js +109 -55
  65. package/api/resources/organization/client/requests/CreateOrganizationRequestSchema.d.ts +6 -0
  66. package/api/resources/organization/client/requests/UpdateOrganizationRequestSchema.d.ts +6 -0
  67. package/api/resources/permissions/client/Client.d.ts +2 -7
  68. package/api/resources/permissions/resources/index.js +7 -17
  69. package/api/resources/permissions/resources/policies/client/Client.d.ts +33 -5
  70. package/api/resources/permissions/resources/policies/client/Client.js +105 -47
  71. package/api/resources/permissions/resources/roles/client/Client.d.ts +38 -5
  72. package/api/resources/permissions/resources/roles/client/Client.js +110 -47
  73. package/api/resources/queryRunner/client/Client.d.ts +26 -7
  74. package/api/resources/queryRunner/client/Client.js +63 -35
  75. package/api/resources/queryRunner/client/requests/QueryRunnerGetQueryRequest.d.ts +3 -0
  76. package/api/resources/schemas/client/Client.d.ts +118 -23
  77. package/api/resources/schemas/client/Client.js +232 -86
  78. package/api/resources/schemas/client/requests/SetPrimaryKeysRequest.d.ts +1 -0
  79. package/api/resources/schemas/client/requests/UpsertSchemaFieldRequest.d.ts +1 -0
  80. package/api/resources/users/client/Client.d.ts +44 -16
  81. package/api/resources/users/client/Client.js +133 -66
  82. package/api/resources/users/client/requests/CreateUserRequestSchema.d.ts +3 -0
  83. package/api/resources/users/client/requests/UpdateUserRequestSchema.d.ts +3 -0
  84. package/api/resources/users/client/requests/UsersCreateApiKeyRequest.d.ts +3 -0
  85. package/api/resources/webhooks/client/Client.d.ts +67 -21
  86. package/api/resources/webhooks/client/Client.js +165 -75
  87. package/api/types/ApiKeyResponse.d.ts +1 -0
  88. package/api/types/BulkBulkSyncSchedule.d.ts +1 -0
  89. package/api/types/BulkDiscover.d.ts +1 -1
  90. package/api/types/BulkExecutionStatus.d.ts +1 -1
  91. package/api/types/BulkFetchMode.d.ts +1 -1
  92. package/api/types/BulkNormalizeNames.d.ts +1 -1
  93. package/api/types/BulkOutputDisposition.d.ts +9 -0
  94. package/api/types/BulkOutputDisposition.js +11 -0
  95. package/api/types/BulkResyncMode.d.ts +9 -0
  96. package/api/types/BulkResyncMode.js +11 -0
  97. package/api/types/BulkScheduleSyncMode.d.ts +1 -1
  98. package/api/types/BulkSchema.d.ts +2 -0
  99. package/api/types/BulkSchemaExecutionStatus.d.ts +2 -1
  100. package/api/types/BulkSchemaExecutionStatus.js +1 -0
  101. package/api/types/BulkSelectiveMode.d.ts +1 -1
  102. package/api/types/BulkSyncDest.d.ts +2 -0
  103. package/api/types/BulkSyncExecution.d.ts +1 -0
  104. package/api/types/BulkSyncExecutionStatus.d.ts +3 -0
  105. package/api/types/BulkSyncIngestionStatus.d.ts +14 -0
  106. package/api/types/BulkSyncMode.d.ts +1 -1
  107. package/api/types/BulkSyncResponse.d.ts +2 -2
  108. package/api/types/BulkSyncSchemaExecutionStatus.d.ts +7 -0
  109. package/api/types/BulkSyncSource.d.ts +1 -0
  110. package/api/types/BulkSyncStatusResponse.d.ts +1 -0
  111. package/api/types/ConnectCardResponse.d.ts +1 -0
  112. package/api/types/ConnectionResponseSchema.d.ts +2 -2
  113. package/api/types/Event.d.ts +4 -0
  114. package/api/types/EventBody.d.ts +1 -1
  115. package/api/types/ExecutionStatus.d.ts +1 -1
  116. package/api/types/FilterFieldReferenceType.d.ts +1 -1
  117. package/api/types/FilterFunction.d.ts +1 -1
  118. package/api/types/GetIdentityResponseSchema.d.ts +2 -0
  119. package/api/types/IngestionStatusLevel.d.ts +12 -0
  120. package/api/types/IngestionStatusLevel.js +11 -0
  121. package/api/types/JobResponse.d.ts +3 -0
  122. package/api/types/JsonschemaDefinitions.d.ts +1 -1
  123. package/api/types/JsonschemaForm.d.ts +1 -1
  124. package/api/types/LabelLabel.d.ts +1 -1
  125. package/api/types/ModelField.d.ts +1 -1
  126. package/api/types/ModelResponse.d.ts +2 -2
  127. package/api/types/ModelSyncMode.d.ts +2 -1
  128. package/api/types/ModelSyncMode.js +1 -0
  129. package/api/types/ModelSyncResponse.d.ts +2 -2
  130. package/api/types/ModelSyncSourceMetaResponse.d.ts +3 -0
  131. package/api/types/Organization.d.ts +5 -0
  132. package/api/types/{CommonOutputActor.d.ts → OutputActor.d.ts} +1 -1
  133. package/api/types/ScheduleFrequency.d.ts +1 -1
  134. package/api/types/SchemaIdentityFunction.d.ts +1 -1
  135. package/api/types/SourceMeta.d.ts +3 -0
  136. package/api/types/TypesType.d.ts +1 -1
  137. package/api/types/User.d.ts +5 -0
  138. package/api/types/UtilFieldType.d.ts +1 -1
  139. package/api/types/V2EnricherConfiguration.d.ts +1 -1
  140. package/api/types/V2EnricherMapping.d.ts +1 -1
  141. package/api/types/V2ExecutionLogType.d.ts +1 -1
  142. package/api/types/V2OrderedMapStringGithubComInvopopJsonschemaSchema.d.ts +1 -1
  143. package/api/types/V2SampleRecord.d.ts +1 -1
  144. package/api/types/V2SchemaConfigurationFieldsItem.d.ts +1 -1
  145. package/api/types/V3BulkSyncSourceCapabilities.d.ts +6 -0
  146. package/{dist/version.js → api/types/V3BulkSyncSourceCapabilities.js} +3 -2
  147. package/api/types/V4BulkSyncExecutionLogs.d.ts +6 -1
  148. package/api/types/V4BulkSyncScheduleApi.d.ts +5 -0
  149. package/api/types/V4ExportSyncLogsResponse.d.ts +1 -0
  150. package/api/types/V4GlobalErrorSubscribersResponse.d.ts +1 -0
  151. package/api/types/V4RunQueryResult.d.ts +2 -1
  152. package/api/types/V4UserFieldRequest.d.ts +4 -0
  153. package/api/types/WorkTaskStatus.d.ts +1 -1
  154. package/api/types/index.d.ts +11 -6
  155. package/api/types/index.js +11 -6
  156. package/core/auth/BearerToken.d.ts +1 -1
  157. package/core/fetcher/APIResponse.d.ts +1 -1
  158. package/core/fetcher/Fetcher.d.ts +3 -6
  159. package/core/fetcher/Fetcher.js +189 -20
  160. package/core/fetcher/Supplier.d.ts +1 -1
  161. package/core/fetcher/getHeader.js +2 -1
  162. package/core/runtime/runtime.d.ts +1 -2
  163. package/core/runtime/runtime.js +41 -52
  164. package/dist/Client.d.ts +14 -19
  165. package/dist/api/errors/BadRequestError.js +7 -17
  166. package/dist/api/errors/ConflictError.js +7 -17
  167. package/dist/api/errors/ForbiddenError.js +7 -17
  168. package/dist/api/errors/InternalServerError.js +7 -17
  169. package/dist/api/errors/NotFoundError.js +7 -17
  170. package/dist/api/errors/UnauthorizedError.js +7 -17
  171. package/dist/api/errors/UnprocessableEntityError.js +7 -17
  172. package/dist/api/resources/bulkSync/client/Client.d.ts +173 -24
  173. package/dist/api/resources/bulkSync/client/Client.js +339 -118
  174. package/dist/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +3 -0
  175. package/dist/api/resources/bulkSync/client/requests/BulkSyncListRequest.d.ts +3 -0
  176. package/dist/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +1 -1
  177. package/dist/api/resources/bulkSync/client/requests/StartBulkSyncRequest.d.ts +4 -0
  178. package/dist/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +1 -1
  179. package/dist/api/resources/bulkSync/resources/executions/client/Client.d.ts +77 -12
  180. package/dist/api/resources/bulkSync/resources/executions/client/Client.js +168 -66
  181. package/dist/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +12 -0
  182. package/dist/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListStatusRequest.d.ts +3 -3
  183. package/dist/api/resources/bulkSync/resources/index.js +7 -17
  184. package/dist/api/resources/bulkSync/resources/schedules/client/Client.d.ts +44 -15
  185. package/dist/api/resources/bulkSync/resources/schedules/client/Client.js +116 -57
  186. package/dist/api/resources/bulkSync/resources/schedules/client/requests/CreateScheduleRequest.d.ts +1 -1
  187. package/dist/api/resources/bulkSync/resources/schedules/client/requests/UpdateScheduleRequest.d.ts +1 -1
  188. package/dist/api/resources/bulkSync/resources/schemas/client/Client.d.ts +71 -11
  189. package/dist/api/resources/bulkSync/resources/schemas/client/Client.js +150 -61
  190. package/dist/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.d.ts +1 -0
  191. package/dist/api/resources/bulkSync/resources/schemas/client/requests/SchemasListRequest.d.ts +3 -0
  192. package/dist/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.d.ts +7 -0
  193. package/dist/api/resources/bulkSync/types/V2CreateBulkSyncRequestSchemasItem.d.ts +1 -1
  194. package/dist/api/resources/bulkSync/types/V2UpdateBulkSyncRequestSchemasItem.d.ts +1 -1
  195. package/dist/api/resources/connections/client/Client.d.ts +134 -18
  196. package/dist/api/resources/connections/client/Client.js +359 -104
  197. package/dist/api/resources/connections/client/requests/ApiRequest.d.ts +2 -2
  198. package/dist/api/resources/events/client/Client.d.ts +20 -7
  199. package/dist/api/resources/events/client/Client.js +55 -33
  200. package/dist/api/resources/events/client/requests/EventsListRequest.d.ts +17 -2
  201. package/dist/api/resources/identity/client/Client.d.ts +11 -6
  202. package/dist/api/resources/identity/client/Client.js +31 -24
  203. package/dist/api/resources/index.js +7 -17
  204. package/dist/api/resources/jobs/client/Client.d.ts +15 -8
  205. package/dist/api/resources/jobs/client/Client.js +35 -26
  206. package/dist/api/resources/modelSync/client/Client.d.ts +110 -19
  207. package/dist/api/resources/modelSync/client/Client.js +287 -118
  208. package/dist/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +1 -1
  209. package/dist/api/resources/modelSync/client/requests/ModelSyncGetSourceFieldsRequest.d.ts +3 -0
  210. package/dist/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.d.ts +3 -0
  211. package/dist/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +1 -1
  212. package/dist/api/resources/modelSync/resources/executions/client/Client.d.ts +41 -12
  213. package/dist/api/resources/modelSync/resources/executions/client/Client.js +115 -56
  214. package/dist/api/resources/modelSync/resources/executions/client/requests/UpdateExecutionRequest.d.ts +1 -1
  215. package/dist/api/resources/modelSync/resources/index.js +7 -17
  216. package/dist/api/resources/modelSync/resources/targets/client/Client.d.ts +28 -11
  217. package/dist/api/resources/modelSync/resources/targets/client/Client.js +89 -49
  218. package/dist/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetFieldsRequest.d.ts +6 -0
  219. package/dist/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetRequest.d.ts +6 -0
  220. package/dist/api/resources/models/client/Client.d.ts +79 -8
  221. package/dist/api/resources/models/client/Client.js +214 -86
  222. package/dist/api/resources/models/client/requests/ModelsGetEnrichmentSourceRequest.d.ts +3 -0
  223. package/dist/api/resources/notifications/client/Client.d.ts +13 -5
  224. package/dist/api/resources/notifications/client/Client.js +48 -31
  225. package/dist/api/resources/notifications/client/requests/V4GlobalErrorSubscribersRequest.d.ts +1 -0
  226. package/dist/api/resources/organization/client/Client.d.ts +31 -13
  227. package/dist/api/resources/organization/client/Client.js +109 -55
  228. package/dist/api/resources/organization/client/requests/CreateOrganizationRequestSchema.d.ts +6 -0
  229. package/dist/api/resources/organization/client/requests/UpdateOrganizationRequestSchema.d.ts +6 -0
  230. package/dist/api/resources/permissions/client/Client.d.ts +2 -7
  231. package/dist/api/resources/permissions/resources/index.js +7 -17
  232. package/dist/api/resources/permissions/resources/policies/client/Client.d.ts +33 -5
  233. package/dist/api/resources/permissions/resources/policies/client/Client.js +105 -47
  234. package/dist/api/resources/permissions/resources/roles/client/Client.d.ts +38 -5
  235. package/dist/api/resources/permissions/resources/roles/client/Client.js +110 -47
  236. package/dist/api/resources/queryRunner/client/Client.d.ts +26 -7
  237. package/dist/api/resources/queryRunner/client/Client.js +63 -35
  238. package/dist/api/resources/queryRunner/client/requests/QueryRunnerGetQueryRequest.d.ts +3 -0
  239. package/dist/api/resources/schemas/client/Client.d.ts +118 -23
  240. package/dist/api/resources/schemas/client/Client.js +232 -86
  241. package/dist/api/resources/schemas/client/requests/SetPrimaryKeysRequest.d.ts +1 -0
  242. package/dist/api/resources/schemas/client/requests/UpsertSchemaFieldRequest.d.ts +1 -0
  243. package/dist/api/resources/users/client/Client.d.ts +44 -16
  244. package/dist/api/resources/users/client/Client.js +133 -66
  245. package/dist/api/resources/users/client/requests/CreateUserRequestSchema.d.ts +3 -0
  246. package/dist/api/resources/users/client/requests/UpdateUserRequestSchema.d.ts +3 -0
  247. package/dist/api/resources/users/client/requests/UsersCreateApiKeyRequest.d.ts +3 -0
  248. package/dist/api/resources/webhooks/client/Client.d.ts +67 -21
  249. package/dist/api/resources/webhooks/client/Client.js +165 -75
  250. package/dist/api/types/ApiKeyResponse.d.ts +1 -0
  251. package/dist/api/types/BulkBulkSyncSchedule.d.ts +1 -0
  252. package/dist/api/types/BulkDiscover.d.ts +1 -1
  253. package/dist/api/types/BulkExecutionStatus.d.ts +1 -1
  254. package/dist/api/types/BulkFetchMode.d.ts +1 -1
  255. package/dist/api/types/BulkNormalizeNames.d.ts +1 -1
  256. package/dist/api/types/BulkOutputDisposition.d.ts +9 -0
  257. package/dist/api/types/BulkOutputDisposition.js +11 -0
  258. package/dist/api/types/BulkResyncMode.d.ts +9 -0
  259. package/dist/api/types/BulkResyncMode.js +11 -0
  260. package/dist/api/types/BulkScheduleSyncMode.d.ts +1 -1
  261. package/dist/api/types/BulkSchema.d.ts +2 -0
  262. package/dist/api/types/BulkSchemaExecutionStatus.d.ts +2 -1
  263. package/dist/api/types/BulkSchemaExecutionStatus.js +1 -0
  264. package/dist/api/types/BulkSelectiveMode.d.ts +1 -1
  265. package/dist/api/types/BulkSyncDest.d.ts +2 -0
  266. package/dist/api/types/BulkSyncExecution.d.ts +1 -0
  267. package/dist/api/types/BulkSyncExecutionStatus.d.ts +3 -0
  268. package/dist/api/types/BulkSyncIngestionStatus.d.ts +14 -0
  269. package/{version.js → dist/api/types/BulkSyncIngestionStatus.js} +3 -2
  270. package/dist/api/types/BulkSyncMode.d.ts +1 -1
  271. package/dist/api/types/BulkSyncResponse.d.ts +2 -2
  272. package/dist/api/types/BulkSyncSchemaExecutionStatus.d.ts +7 -0
  273. package/dist/api/types/BulkSyncSource.d.ts +1 -0
  274. package/dist/api/types/BulkSyncStatusResponse.d.ts +1 -0
  275. package/dist/api/types/ConnectCardResponse.d.ts +1 -0
  276. package/dist/api/types/ConnectionResponseSchema.d.ts +2 -2
  277. package/dist/api/types/Event.d.ts +4 -0
  278. package/dist/api/types/EventBody.d.ts +1 -1
  279. package/dist/api/types/ExecutionStatus.d.ts +1 -1
  280. package/dist/api/types/FilterFieldReferenceType.d.ts +1 -1
  281. package/dist/api/types/FilterFunction.d.ts +1 -1
  282. package/dist/api/types/GetIdentityResponseSchema.d.ts +2 -0
  283. package/dist/api/types/IngestionStatusLevel.d.ts +12 -0
  284. package/dist/api/types/IngestionStatusLevel.js +11 -0
  285. package/dist/api/types/JobResponse.d.ts +3 -0
  286. package/dist/api/types/JsonschemaDefinitions.d.ts +1 -1
  287. package/dist/api/types/JsonschemaForm.d.ts +1 -1
  288. package/dist/api/types/LabelLabel.d.ts +1 -1
  289. package/dist/api/types/ModelField.d.ts +1 -1
  290. package/dist/api/types/ModelResponse.d.ts +2 -2
  291. package/dist/api/types/ModelSyncMode.d.ts +2 -1
  292. package/dist/api/types/ModelSyncMode.js +1 -0
  293. package/dist/api/types/ModelSyncResponse.d.ts +2 -2
  294. package/dist/api/types/ModelSyncSourceMetaResponse.d.ts +3 -0
  295. package/dist/api/types/Organization.d.ts +5 -0
  296. package/dist/api/types/{CommonOutputActor.d.ts → OutputActor.d.ts} +1 -1
  297. package/dist/api/types/OutputActor.js +5 -0
  298. package/dist/api/types/ScheduleFrequency.d.ts +1 -1
  299. package/dist/api/types/SchemaIdentityFunction.d.ts +1 -1
  300. package/dist/api/types/SourceMeta.d.ts +3 -0
  301. package/dist/api/types/TypesType.d.ts +1 -1
  302. package/dist/api/types/User.d.ts +5 -0
  303. package/dist/api/types/UtilFieldType.d.ts +1 -1
  304. package/dist/api/types/V2EnricherConfiguration.d.ts +1 -1
  305. package/dist/api/types/V2EnricherMapping.d.ts +1 -1
  306. package/dist/api/types/V2ExecutionLogType.d.ts +1 -1
  307. package/dist/api/types/V2OrderedMapStringGithubComInvopopJsonschemaSchema.d.ts +1 -1
  308. package/dist/api/types/V2SampleRecord.d.ts +1 -1
  309. package/dist/api/types/V2SchemaConfigurationFieldsItem.d.ts +1 -1
  310. package/dist/api/types/V3BulkSyncSourceCapabilities.d.ts +6 -0
  311. package/dist/api/types/V3BulkSyncSourceCapabilities.js +5 -0
  312. package/dist/api/types/V4BulkSyncExecutionLogs.d.ts +6 -1
  313. package/dist/api/types/V4BulkSyncScheduleApi.d.ts +5 -0
  314. package/dist/api/types/V4ExportSyncLogsResponse.d.ts +1 -0
  315. package/dist/api/types/V4GlobalErrorSubscribersResponse.d.ts +1 -0
  316. package/dist/api/types/V4RunQueryResult.d.ts +2 -1
  317. package/dist/api/types/V4UserFieldRequest.d.ts +4 -0
  318. package/dist/api/types/WorkTaskStatus.d.ts +1 -1
  319. package/dist/api/types/index.d.ts +11 -6
  320. package/dist/api/types/index.js +11 -6
  321. package/dist/core/auth/BearerToken.d.ts +1 -1
  322. package/dist/core/fetcher/APIResponse.d.ts +1 -1
  323. package/dist/core/fetcher/Fetcher.d.ts +3 -6
  324. package/dist/core/fetcher/Fetcher.js +189 -20
  325. package/dist/core/fetcher/Supplier.d.ts +1 -1
  326. package/dist/core/fetcher/getHeader.js +2 -1
  327. package/dist/core/runtime/runtime.d.ts +1 -2
  328. package/dist/core/runtime/runtime.js +41 -52
  329. package/dist/environments.d.ts +1 -1
  330. package/dist/errors/PolytomicError.js +1 -2
  331. package/dist/errors/PolytomicTimeoutError.d.ts +1 -1
  332. package/dist/errors/PolytomicTimeoutError.js +2 -2
  333. package/dist/index.js +7 -17
  334. package/environments.d.ts +1 -1
  335. package/errors/PolytomicError.js +1 -2
  336. package/errors/PolytomicTimeoutError.d.ts +1 -1
  337. package/errors/PolytomicTimeoutError.js +2 -2
  338. package/index.js +7 -17
  339. package/{jest.config.mjs → jest.config.js} +1 -4
  340. package/package.json +17 -18
  341. package/core/fetcher/createRequestUrl.d.ts +0 -1
  342. package/core/fetcher/createRequestUrl.js +0 -12
  343. package/core/fetcher/getFetchFn.d.ts +0 -4
  344. package/core/fetcher/getFetchFn.js +0 -68
  345. package/core/fetcher/getRequestBody.d.ts +0 -7
  346. package/core/fetcher/getRequestBody.js +0 -23
  347. package/core/fetcher/getResponseBody.d.ts +0 -1
  348. package/core/fetcher/getResponseBody.js +0 -54
  349. package/core/fetcher/makeRequest.d.ts +0 -1
  350. package/core/fetcher/makeRequest.js +0 -42
  351. package/core/fetcher/requestWithRetries.d.ts +0 -1
  352. package/core/fetcher/requestWithRetries.js +0 -40
  353. package/core/fetcher/signals.d.ts +0 -11
  354. package/core/fetcher/signals.js +0 -36
  355. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -30
  356. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -247
  357. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -21
  358. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -126
  359. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -31
  360. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -229
  361. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -18
  362. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -59
  363. package/core/json.d.ts +0 -15
  364. package/core/json.js +0 -24
  365. package/dist/core/fetcher/createRequestUrl.d.ts +0 -1
  366. package/dist/core/fetcher/createRequestUrl.js +0 -12
  367. package/dist/core/fetcher/getFetchFn.d.ts +0 -4
  368. package/dist/core/fetcher/getFetchFn.js +0 -68
  369. package/dist/core/fetcher/getRequestBody.d.ts +0 -7
  370. package/dist/core/fetcher/getRequestBody.js +0 -23
  371. package/dist/core/fetcher/getResponseBody.d.ts +0 -1
  372. package/dist/core/fetcher/getResponseBody.js +0 -54
  373. package/dist/core/fetcher/makeRequest.d.ts +0 -1
  374. package/dist/core/fetcher/makeRequest.js +0 -42
  375. package/dist/core/fetcher/requestWithRetries.d.ts +0 -1
  376. package/dist/core/fetcher/requestWithRetries.js +0 -40
  377. package/dist/core/fetcher/signals.d.ts +0 -11
  378. package/dist/core/fetcher/signals.js +0 -36
  379. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -30
  380. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -247
  381. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -21
  382. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -126
  383. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -31
  384. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -229
  385. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -18
  386. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -59
  387. package/dist/core/json.d.ts +0 -15
  388. package/dist/core/json.js +0 -24
  389. package/dist/version.d.ts +0 -1
  390. package/reference.md +0 -6663
  391. package/scripts/rename-to-esm-files.js +0 -115
  392. package/version.d.ts +0 -1
  393. /package/api/types/{CommonOutputActor.js → BulkSyncIngestionStatus.js} +0 -0
  394. /package/{dist/api/types/CommonOutputActor.js → api/types/OutputActor.js} +0 -0
@@ -18,23 +18,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
18
18
  }) : function(o, v) {
19
19
  o["default"] = v;
20
20
  });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
38
28
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
29
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
30
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -59,8 +49,20 @@ class Schemas {
59
49
  this._options = _options;
60
50
  }
61
51
  /**
62
- * @param {string} connectionId
63
- * @param {string} schemaId
52
+ * Creates or updates user-defined fields on a schema, matched by field_id.
53
+ *
54
+ * Fields are matched by `field_id`. Reusing an existing `field_id` updates that
55
+ * field; using a new `field_id` creates a new user-defined field.
56
+ *
57
+ * This makes the endpoint safe to retry when you are intentionally upserting the
58
+ * same field definitions. It is not a patch-by-position operation.
59
+ *
60
+ * If some fields succeed and others fail, the endpoint can return a partial
61
+ * success response. Validate the response status and message rather than assuming
62
+ * the whole batch was applied uniformly.
63
+ *
64
+ * @param {string} connectionId - Unique identifier of the connection.
65
+ * @param {string} schemaId - Identifier of the schema the fields belong to.
64
66
  * @param {Polytomic.UpsertSchemaFieldRequest} request
65
67
  * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration.
66
68
  *
@@ -72,17 +74,24 @@ class Schemas {
72
74
  * @example
73
75
  * await client.schemas.upsertField("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users")
74
76
  */
75
- upsertField(connectionId_1, schemaId_1) {
76
- return __awaiter(this, arguments, void 0, function* (connectionId, schemaId, request = {}, requestOptions) {
77
- var _a, _b;
77
+ upsertField(connectionId, schemaId, request = {}, requestOptions) {
78
+ var _a;
79
+ return __awaiter(this, void 0, void 0, function* () {
78
80
  const _response = yield core.fetcher({
79
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(connectionId)}/schemas/${encodeURIComponent(schemaId)}/fields`),
81
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(connectionId)}/schemas/${encodeURIComponent(schemaId)}/fields`),
80
82
  method: "POST",
81
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
83
+ headers: {
84
+ Authorization: yield this._getAuthorizationHeader(),
85
+ "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
82
86
  ? yield core.Supplier.get(this._options.version)
83
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
+ : undefined,
88
+ "X-Fern-Language": "JavaScript",
89
+ "X-Fern-SDK-Name": "polytomic",
90
+ "X-Fern-SDK-Version": "1.18.1",
91
+ "X-Fern-Runtime": core.RUNTIME.type,
92
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
93
+ },
84
94
  contentType: "application/json",
85
- requestType: "json",
86
95
  body: request,
87
96
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
88
97
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -115,7 +124,7 @@ class Schemas {
115
124
  body: _response.error.rawBody,
116
125
  });
117
126
  case "timeout":
118
- throw new errors.PolytomicTimeoutError("Timeout exceeded when calling POST /api/connections/{connection_id}/schemas/{schema_id}/fields.");
127
+ throw new errors.PolytomicTimeoutError();
119
128
  case "unknown":
120
129
  throw new errors.PolytomicError({
121
130
  message: _response.error.errorMessage,
@@ -124,9 +133,20 @@ class Schemas {
124
133
  });
125
134
  }
126
135
  /**
127
- * @param {string} connectionId
128
- * @param {string} schemaId
129
- * @param {string} fieldId
136
+ * Removes a user-defined field from a schema.
137
+ *
138
+ * Only user-defined fields — those created via
139
+ * [`POST /api/connections/{connection_id}/schemas/{schema_id}/fields`](../../../../../../../api-reference/schemas/upsert-field)
140
+ * — can be removed through this endpoint. Fields detected automatically from
141
+ * the source cannot be deleted here; they are managed through schema refresh.
142
+ *
143
+ * > 🚧 Deleting a field that is referenced in an active sync mapping may cause
144
+ * > that sync to error on its next execution. Remove or update any dependent
145
+ * > mappings before deleting the field.
146
+ *
147
+ * @param {string} connectionId - Unique identifier of the connection.
148
+ * @param {string} schemaId - Identifier of the schema the field belongs to.
149
+ * @param {string} fieldId - Identifier of the user-defined field to delete.
130
150
  * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration.
131
151
  *
132
152
  * @throws {@link Polytomic.BadRequestError}
@@ -138,16 +158,23 @@ class Schemas {
138
158
  * await client.schemas.deleteField("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users", "first_name")
139
159
  */
140
160
  deleteField(connectionId, schemaId, fieldId, requestOptions) {
161
+ var _a;
141
162
  return __awaiter(this, void 0, void 0, function* () {
142
- var _a, _b;
143
163
  const _response = yield core.fetcher({
144
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(connectionId)}/schemas/${encodeURIComponent(schemaId)}/fields/${encodeURIComponent(fieldId)}`),
164
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(connectionId)}/schemas/${encodeURIComponent(schemaId)}/fields/${encodeURIComponent(fieldId)}`),
145
165
  method: "DELETE",
146
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
166
+ headers: {
167
+ Authorization: yield this._getAuthorizationHeader(),
168
+ "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
147
169
  ? yield core.Supplier.get(this._options.version)
148
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
170
+ : undefined,
171
+ "X-Fern-Language": "JavaScript",
172
+ "X-Fern-SDK-Name": "polytomic",
173
+ "X-Fern-SDK-Version": "1.18.1",
174
+ "X-Fern-Runtime": core.RUNTIME.type,
175
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
176
+ },
149
177
  contentType: "application/json",
150
- requestType: "json",
151
178
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
152
179
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
153
180
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -179,7 +206,7 @@ class Schemas {
179
206
  body: _response.error.rawBody,
180
207
  });
181
208
  case "timeout":
182
- throw new errors.PolytomicTimeoutError("Timeout exceeded when calling DELETE /api/connections/{connection_id}/schemas/{schema_id}/fields/{field_id}.");
209
+ throw new errors.PolytomicTimeoutError();
183
210
  case "unknown":
184
211
  throw new errors.PolytomicError({
185
212
  message: _response.error.errorMessage,
@@ -188,8 +215,21 @@ class Schemas {
188
215
  });
189
216
  }
190
217
  /**
191
- * @param {string} connectionId
192
- * @param {string} schemaId
218
+ * Overrides the primary key detected on a schema.
219
+ *
220
+ * This is a full replacement: the keys you supply become the complete override
221
+ * set, replacing any previously configured overrides. Omitting a key that was
222
+ * previously set removes it.
223
+ *
224
+ * Primary key overrides are useful when the source does not expose a primary
225
+ * key or when the source-detected key is not the correct deduplication
226
+ * identifier for your use case.
227
+ *
228
+ * > 📘 To revert to the source-detected primary keys and remove all overrides,
229
+ * > use [`DELETE /api/connections/{connection_id}/schemas/{schema_id}/primary_keys`](../../../../../../api-reference/schemas/reset-primary-keys).
230
+ *
231
+ * @param {string} connectionId - Unique identifier of the connection.
232
+ * @param {string} schemaId - Identifier of the schema whose primary keys are being overridden.
193
233
  * @param {Polytomic.SetPrimaryKeysRequest} request
194
234
  * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration.
195
235
  *
@@ -201,17 +241,24 @@ class Schemas {
201
241
  * @example
202
242
  * await client.schemas.setPrimaryKeys("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users")
203
243
  */
204
- setPrimaryKeys(connectionId_1, schemaId_1) {
205
- return __awaiter(this, arguments, void 0, function* (connectionId, schemaId, request = {}, requestOptions) {
206
- var _a, _b;
244
+ setPrimaryKeys(connectionId, schemaId, request = {}, requestOptions) {
245
+ var _a;
246
+ return __awaiter(this, void 0, void 0, function* () {
207
247
  const _response = yield core.fetcher({
208
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(connectionId)}/schemas/${encodeURIComponent(schemaId)}/primary_keys`),
248
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(connectionId)}/schemas/${encodeURIComponent(schemaId)}/primary_keys`),
209
249
  method: "PUT",
210
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
250
+ headers: {
251
+ Authorization: yield this._getAuthorizationHeader(),
252
+ "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
211
253
  ? yield core.Supplier.get(this._options.version)
212
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
254
+ : undefined,
255
+ "X-Fern-Language": "JavaScript",
256
+ "X-Fern-SDK-Name": "polytomic",
257
+ "X-Fern-SDK-Version": "1.18.1",
258
+ "X-Fern-Runtime": core.RUNTIME.type,
259
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
260
+ },
213
261
  contentType: "application/json",
214
- requestType: "json",
215
262
  body: request,
216
263
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
217
264
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -244,7 +291,7 @@ class Schemas {
244
291
  body: _response.error.rawBody,
245
292
  });
246
293
  case "timeout":
247
- throw new errors.PolytomicTimeoutError("Timeout exceeded when calling PUT /api/connections/{connection_id}/schemas/{schema_id}/primary_keys.");
294
+ throw new errors.PolytomicTimeoutError();
248
295
  case "unknown":
249
296
  throw new errors.PolytomicError({
250
297
  message: _response.error.errorMessage,
@@ -253,10 +300,14 @@ class Schemas {
253
300
  });
254
301
  }
255
302
  /**
256
- * Delete all primary key overrides for a schema. After this call the schema will use the primary keys detected from the source connection, if any.
303
+ * Deletes all primary key overrides for a schema, reverting to the primary keys detected from the source.
257
304
  *
258
- * @param {string} connectionId
259
- * @param {string} schemaId
305
+ * To replace the overrides with a new set rather than clearing them entirely,
306
+ * use [`PUT /api/connections/{connection_id}/schemas/{schema_id}/primary_keys`](../../../../../../api-reference/schemas/set-primary-keys)
307
+ * instead.
308
+ *
309
+ * @param {string} connectionId - Unique identifier of the connection.
310
+ * @param {string} schemaId - Identifier of the schema whose primary key override should be cleared.
260
311
  * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration.
261
312
  *
262
313
  * @throws {@link Polytomic.BadRequestError}
@@ -268,16 +319,23 @@ class Schemas {
268
319
  * await client.schemas.resetPrimaryKeys("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users")
269
320
  */
270
321
  resetPrimaryKeys(connectionId, schemaId, requestOptions) {
322
+ var _a;
271
323
  return __awaiter(this, void 0, void 0, function* () {
272
- var _a, _b;
273
324
  const _response = yield core.fetcher({
274
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(connectionId)}/schemas/${encodeURIComponent(schemaId)}/primary_keys`),
325
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(connectionId)}/schemas/${encodeURIComponent(schemaId)}/primary_keys`),
275
326
  method: "DELETE",
276
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
327
+ headers: {
328
+ Authorization: yield this._getAuthorizationHeader(),
329
+ "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
277
330
  ? yield core.Supplier.get(this._options.version)
278
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
331
+ : undefined,
332
+ "X-Fern-Language": "JavaScript",
333
+ "X-Fern-SDK-Name": "polytomic",
334
+ "X-Fern-SDK-Version": "1.18.1",
335
+ "X-Fern-Runtime": core.RUNTIME.type,
336
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
337
+ },
279
338
  contentType: "application/json",
280
- requestType: "json",
281
339
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
282
340
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
283
341
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -309,7 +367,7 @@ class Schemas {
309
367
  body: _response.error.rawBody,
310
368
  });
311
369
  case "timeout":
312
- throw new errors.PolytomicTimeoutError("Timeout exceeded when calling DELETE /api/connections/{connection_id}/schemas/{schema_id}/primary_keys.");
370
+ throw new errors.PolytomicTimeoutError();
313
371
  case "unknown":
314
372
  throw new errors.PolytomicError({
315
373
  message: _response.error.errorMessage,
@@ -318,7 +376,28 @@ class Schemas {
318
376
  });
319
377
  }
320
378
  /**
321
- * @param {string} id
379
+ * Refreshes a connection's cached schemas.
380
+ *
381
+ * Call this when the upstream source has added, removed, or changed tables,
382
+ * objects, or fields and you need Polytomic to re-inspect the connection before
383
+ * creating or updating sync configuration.
384
+ *
385
+ * This endpoint does not return the refreshed schemas directly. Follow the
386
+ * `Location` header or poll [`GET /api/connections/{id}/schemas/status`](../../../../../api-reference/schemas/get-status)
387
+ * until the refresh completes, then fetch the schemas you need.
388
+ *
389
+ * > 📘 Schema refresh is asynchronous
390
+ * >
391
+ * > This endpoint kicks off a background refresh of the connection's cached
392
+ * > schemas and returns a `Location` header pointing at
393
+ * > [`GET /api/connections/{id}/schemas/status`](../../../../../api-reference/schemas/get-status).
394
+ * > Poll that endpoint until `cache_status` transitions from `refreshing` to
395
+ * > `fresh` (or until `last_refresh_finished` advances past
396
+ * > `last_refresh_started`) to observe completion.
397
+ * >
398
+ * > Only connections whose current health status is healthy may be refreshed.
399
+ *
400
+ * @param {string} id - Unique identifier of the connection whose schema cache should be refreshed.
322
401
  * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration.
323
402
  *
324
403
  * @throws {@link Polytomic.BadRequestError}
@@ -330,16 +409,23 @@ class Schemas {
330
409
  * await client.schemas.refresh("248df4b7-aa70-47b8-a036-33ac447e668d")
331
410
  */
332
411
  refresh(id, requestOptions) {
412
+ var _a;
333
413
  return __awaiter(this, void 0, void 0, function* () {
334
- var _a, _b;
335
414
  const _response = yield core.fetcher({
336
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/schemas/refresh`),
415
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/schemas/refresh`),
337
416
  method: "POST",
338
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
417
+ headers: {
418
+ Authorization: yield this._getAuthorizationHeader(),
419
+ "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
339
420
  ? yield core.Supplier.get(this._options.version)
340
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
421
+ : undefined,
422
+ "X-Fern-Language": "JavaScript",
423
+ "X-Fern-SDK-Name": "polytomic",
424
+ "X-Fern-SDK-Version": "1.18.1",
425
+ "X-Fern-Runtime": core.RUNTIME.type,
426
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
427
+ },
341
428
  contentType: "application/json",
342
- requestType: "json",
343
429
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
344
430
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
345
431
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -371,7 +457,7 @@ class Schemas {
371
457
  body: _response.error.rawBody,
372
458
  });
373
459
  case "timeout":
374
- throw new errors.PolytomicTimeoutError("Timeout exceeded when calling POST /api/connections/{id}/schemas/refresh.");
460
+ throw new errors.PolytomicTimeoutError();
375
461
  case "unknown":
376
462
  throw new errors.PolytomicError({
377
463
  message: _response.error.errorMessage,
@@ -380,9 +466,25 @@ class Schemas {
380
466
  });
381
467
  }
382
468
  /**
383
- * Polytomic periodically inspects the schemas for connections to discover new fields and update metadata. This endpoint returns the current inspection status.
469
+ * Returns the current schema inspection status for a connection.
470
+ *
471
+ * Poll this endpoint after calling
472
+ * [`POST /api/connections/{id}/schemas/refresh`](../../../../../api-reference/schemas/refresh) to track
473
+ * progress. When `status` transitions to `completed`, the refreshed schemas
474
+ * are available for use in sync configuration.
475
+ *
476
+ * > 📘 Schema refresh is asynchronous
477
+ * >
478
+ * > This endpoint kicks off a background refresh of the connection's cached
479
+ * > schemas and returns a `Location` header pointing at
480
+ * > [`GET /api/connections/{id}/schemas/status`](../../../../../api-reference/schemas/get-status).
481
+ * > Poll that endpoint until `cache_status` transitions from `refreshing` to
482
+ * > `fresh` (or until `last_refresh_finished` advances past
483
+ * > `last_refresh_started`) to observe completion.
484
+ * >
485
+ * > Only connections whose current health status is healthy may be refreshed.
384
486
  *
385
- * @param {string} id
487
+ * @param {string} id - Unique identifier of the connection whose schema cache status should be returned.
386
488
  * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration.
387
489
  *
388
490
  * @throws {@link Polytomic.BadRequestError}
@@ -394,16 +496,23 @@ class Schemas {
394
496
  * await client.schemas.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d")
395
497
  */
396
498
  getStatus(id, requestOptions) {
499
+ var _a;
397
500
  return __awaiter(this, void 0, void 0, function* () {
398
- var _a, _b;
399
501
  const _response = yield core.fetcher({
400
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/schemas/status`),
502
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/schemas/status`),
401
503
  method: "GET",
402
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
504
+ headers: {
505
+ Authorization: yield this._getAuthorizationHeader(),
506
+ "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
403
507
  ? yield core.Supplier.get(this._options.version)
404
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
508
+ : undefined,
509
+ "X-Fern-Language": "JavaScript",
510
+ "X-Fern-SDK-Name": "polytomic",
511
+ "X-Fern-SDK-Version": "1.18.1",
512
+ "X-Fern-Runtime": core.RUNTIME.type,
513
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
514
+ },
405
515
  contentType: "application/json",
406
- requestType: "json",
407
516
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
408
517
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
409
518
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -435,7 +544,7 @@ class Schemas {
435
544
  body: _response.error.rawBody,
436
545
  });
437
546
  case "timeout":
438
- throw new errors.PolytomicTimeoutError("Timeout exceeded when calling GET /api/connections/{id}/schemas/status.");
547
+ throw new errors.PolytomicTimeoutError();
439
548
  case "unknown":
440
549
  throw new errors.PolytomicError({
441
550
  message: _response.error.errorMessage,
@@ -444,8 +553,18 @@ class Schemas {
444
553
  });
445
554
  }
446
555
  /**
447
- * @param {string} id
448
- * @param {string} schemaId
556
+ * Returns a single schema on a connection.
557
+ *
558
+ * The schema is returned from the connection's cached schema set. If the
559
+ * upstream source has changed since the last inspection, the result may be
560
+ * stale.
561
+ *
562
+ * > 📘 Trigger [`POST /api/connections/{id}/schemas/refresh`](../../../../../api-reference/schemas/refresh)
563
+ * > and wait for it to complete before fetching this endpoint if you need
564
+ * > up-to-date field definitions.
565
+ *
566
+ * @param {string} id - Unique identifier of the connection.
567
+ * @param {string} schemaId - Identifier of the schema within the connection. Format depends on the connection type (e.g. schema.table for databases, object name for SaaS backends).
449
568
  * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration.
450
569
  *
451
570
  * @throws {@link Polytomic.BadRequestError}
@@ -457,16 +576,23 @@ class Schemas {
457
576
  * await client.schemas.get("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users")
458
577
  */
459
578
  get(id, schemaId, requestOptions) {
579
+ var _a;
460
580
  return __awaiter(this, void 0, void 0, function* () {
461
- var _a, _b;
462
581
  const _response = yield core.fetcher({
463
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/schemas/${encodeURIComponent(schemaId)}`),
582
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/schemas/${encodeURIComponent(schemaId)}`),
464
583
  method: "GET",
465
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
584
+ headers: {
585
+ Authorization: yield this._getAuthorizationHeader(),
586
+ "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
466
587
  ? yield core.Supplier.get(this._options.version)
467
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
588
+ : undefined,
589
+ "X-Fern-Language": "JavaScript",
590
+ "X-Fern-SDK-Name": "polytomic",
591
+ "X-Fern-SDK-Version": "1.18.1",
592
+ "X-Fern-Runtime": core.RUNTIME.type,
593
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
594
+ },
468
595
  contentType: "application/json",
469
- requestType: "json",
470
596
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
471
597
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
472
598
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -498,7 +624,7 @@ class Schemas {
498
624
  body: _response.error.rawBody,
499
625
  });
500
626
  case "timeout":
501
- throw new errors.PolytomicTimeoutError("Timeout exceeded when calling GET /api/connections/{id}/schemas/{schema_id}.");
627
+ throw new errors.PolytomicTimeoutError();
502
628
  case "unknown":
503
629
  throw new errors.PolytomicError({
504
630
  message: _response.error.errorMessage,
@@ -507,8 +633,21 @@ class Schemas {
507
633
  });
508
634
  }
509
635
  /**
510
- * @param {string} id
511
- * @param {string} schemaId
636
+ * Returns a sample of records from a schema on a connection.
637
+ *
638
+ * The sample is intended for previewing the shape and values of data before
639
+ * committing to a sync configuration, not for full data export.
640
+ *
641
+ * > 🚧 The sample is not guaranteed to be representative of the full dataset.
642
+ * > Row selection is implementation-defined and may differ across connection
643
+ * > types.
644
+ *
645
+ * > 📘 If the schema's field definitions are stale, refresh them first with
646
+ * > [`POST /api/connections/{id}/schemas/refresh`](../../../../../../api-reference/schemas/refresh) to ensure
647
+ * > the sample aligns with the current schema structure.
648
+ *
649
+ * @param {string} id - Unique identifier of the connection.
650
+ * @param {string} schemaId - Identifier of the schema within the connection.
512
651
  * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration.
513
652
  *
514
653
  * @throws {@link Polytomic.BadRequestError}
@@ -521,16 +660,23 @@ class Schemas {
521
660
  * await client.schemas.getRecords("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users")
522
661
  */
523
662
  getRecords(id, schemaId, requestOptions) {
663
+ var _a;
524
664
  return __awaiter(this, void 0, void 0, function* () {
525
- var _a, _b;
526
665
  const _response = yield core.fetcher({
527
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/schemas/${encodeURIComponent(schemaId)}/records`),
666
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/schemas/${encodeURIComponent(schemaId)}/records`),
528
667
  method: "GET",
529
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
668
+ headers: {
669
+ Authorization: yield this._getAuthorizationHeader(),
670
+ "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
530
671
  ? yield core.Supplier.get(this._options.version)
531
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
672
+ : undefined,
673
+ "X-Fern-Language": "JavaScript",
674
+ "X-Fern-SDK-Name": "polytomic",
675
+ "X-Fern-SDK-Version": "1.18.1",
676
+ "X-Fern-Runtime": core.RUNTIME.type,
677
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
678
+ },
532
679
  contentType: "application/json",
533
- requestType: "json",
534
680
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
535
681
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
536
682
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -564,7 +710,7 @@ class Schemas {
564
710
  body: _response.error.rawBody,
565
711
  });
566
712
  case "timeout":
567
- throw new errors.PolytomicTimeoutError("Timeout exceeded when calling GET /api/connections/{id}/schemas/{schema_id}/records.");
713
+ throw new errors.PolytomicTimeoutError();
568
714
  case "unknown":
569
715
  throw new errors.PolytomicError({
570
716
  message: _response.error.errorMessage,
@@ -7,5 +7,6 @@ import * as Polytomic from "../../../../index";
7
7
  * {}
8
8
  */
9
9
  export interface SetPrimaryKeysRequest {
10
+ /** Ordered list of source fields that together form the primary key. Replaces any existing override; supply an empty list to clear. */
10
11
  fields?: Polytomic.SchemaPrimaryKeyOverrideInput[];
11
12
  }
@@ -7,5 +7,6 @@ import * as Polytomic from "../../../../index";
7
7
  * {}
8
8
  */
9
9
  export interface UpsertSchemaFieldRequest {
10
+ /** Fields to create or update on the schema. Existing user-defined fields with the same field_id are replaced. */
10
11
  fields?: Polytomic.V4UserFieldRequest[];
11
12
  }