polytomic 25.9.12 → 25.9.14

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 (251) hide show
  1. package/BaseClient.js +2 -2
  2. package/Client.d.ts +0 -3
  3. package/Client.js +38 -43
  4. package/api/resources/bulkSync/client/Client.d.ts +42 -18
  5. package/api/resources/bulkSync/client/Client.js +54 -22
  6. package/api/resources/bulkSync/client/requests/BulkSyncGetDestinationRequest.d.ts +10 -0
  7. package/api/resources/bulkSync/client/requests/index.d.ts +1 -0
  8. package/api/resources/bulkSync/resources/executions/client/Client.d.ts +17 -10
  9. package/api/resources/bulkSync/resources/executions/client/Client.js +17 -10
  10. package/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +1 -1
  11. package/api/resources/bulkSync/resources/schedules/client/Client.d.ts +8 -0
  12. package/api/resources/bulkSync/resources/schedules/client/Client.js +8 -0
  13. package/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.d.ts +13 -0
  14. package/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.js +10 -0
  15. package/api/resources/bulkSync/resources/schemas/client/requests/index.d.ts +1 -1
  16. package/api/resources/bulkSync/resources/schemas/client/requests/index.js +3 -0
  17. package/api/resources/connections/client/Client.d.ts +8 -7
  18. package/api/resources/connections/client/Client.js +8 -7
  19. package/api/resources/connections/client/requests/ConnectCardRequest.d.ts +4 -1
  20. package/api/resources/connections/client/requests/GetConnectionTypeParameterValuesRequestSchema.d.ts +5 -1
  21. package/api/resources/connections/resources/proxy/client/Client.d.ts +13 -2
  22. package/api/resources/connections/resources/proxy/client/Client.js +13 -2
  23. package/api/resources/events/client/Client.d.ts +10 -7
  24. package/api/resources/events/client/Client.js +10 -7
  25. package/api/resources/harbors/client/Client.d.ts +73 -1290
  26. package/api/resources/harbors/client/Client.js +108 -3353
  27. package/api/resources/harbors/client/requests/index.d.ts +0 -29
  28. package/api/resources/harbors/resources/actionConfiguration/client/Client.d.ts +267 -0
  29. package/api/resources/harbors/resources/actionConfiguration/client/Client.js +686 -0
  30. package/api/resources/harbors/{client/requests/HarborsListActionConfigurationSchemasRequest.d.ts → resources/actionConfiguration/client/requests/ActionConfigurationListSchemasRequest.d.ts} +1 -1
  31. package/api/resources/harbors/{client/requests/HarborsRemoveActionConfigurationRequest.d.ts → resources/actionConfiguration/client/requests/ActionConfigurationRemoveRequest.d.ts} +1 -1
  32. package/api/resources/harbors/{client → resources/actionConfiguration/client}/requests/SetHarborActionConfigurationRequest.d.ts +1 -1
  33. package/api/resources/harbors/resources/actionConfiguration/client/requests/index.d.ts +3 -0
  34. package/api/resources/harbors/resources/actionConfiguration/exports.d.ts +2 -0
  35. package/api/resources/harbors/resources/actionConfiguration/exports.js +21 -0
  36. package/api/resources/harbors/resources/actionConfiguration/index.d.ts +1 -0
  37. package/api/resources/harbors/resources/actionConfiguration/index.js +17 -0
  38. package/api/resources/harbors/resources/actions/client/Client.d.ts +4 -0
  39. package/api/resources/harbors/resources/actions/client/Client.js +4 -0
  40. package/api/resources/{activity → harbors/resources/activity}/client/Client.d.ts +11 -11
  41. package/api/resources/{activity → harbors/resources/activity}/client/Client.js +12 -12
  42. package/api/resources/harbors/resources/activity/client/index.d.ts +1 -0
  43. package/api/resources/harbors/resources/activity/client/index.js +17 -0
  44. package/api/resources/{activity → harbors/resources/activity}/client/requests/ActivityGetSessionRequest.d.ts +2 -2
  45. package/api/resources/{activity → harbors/resources/activity}/client/requests/ActivityListRequest.d.ts +2 -2
  46. package/api/resources/harbors/resources/activity/client/requests/index.js +2 -0
  47. package/api/resources/harbors/resources/connections/client/Client.d.ts +64 -0
  48. package/api/resources/harbors/resources/connections/client/Client.js +236 -0
  49. package/api/resources/harbors/resources/connections/client/index.d.ts +1 -0
  50. package/api/resources/harbors/resources/connections/client/index.js +17 -0
  51. package/api/resources/harbors/{client/requests/HarborsDeleteContextRequest.d.ts → resources/connections/client/requests/ConnectionsGetSchemaRequest.d.ts} +1 -1
  52. package/api/resources/harbors/{client/requests/HarborsListAuthorizedSchemasRequest.d.ts → resources/connections/client/requests/ConnectionsListRequest.d.ts} +1 -1
  53. package/api/resources/harbors/{client/requests/HarborsListAuthorizedConnectionsRequest.d.ts → resources/connections/client/requests/ConnectionsListSchemasRequest.d.ts} +1 -1
  54. package/api/resources/harbors/resources/connections/client/requests/index.d.ts +3 -0
  55. package/api/resources/harbors/resources/connections/client/requests/index.js +2 -0
  56. package/api/resources/harbors/resources/connections/exports.d.ts +2 -0
  57. package/api/resources/harbors/resources/connections/exports.js +21 -0
  58. package/api/resources/harbors/resources/connections/index.d.ts +1 -0
  59. package/api/resources/harbors/resources/connections/index.js +17 -0
  60. package/api/resources/harbors/resources/contexts/client/Client.d.ts +395 -0
  61. package/api/resources/harbors/resources/contexts/client/Client.js +1142 -0
  62. package/api/resources/harbors/resources/contexts/client/index.d.ts +1 -0
  63. package/api/resources/harbors/resources/contexts/client/index.js +17 -0
  64. package/api/resources/harbors/{client/requests/HarborsGetSavedQueryRequest.d.ts → resources/contexts/client/requests/ContextsDeleteDraftRequest.d.ts} +1 -1
  65. package/api/resources/harbors/{client/requests/HarborsGetContextRequest.d.ts → resources/contexts/client/requests/ContextsDeleteRequest.d.ts} +1 -1
  66. package/api/resources/harbors/{client/requests/HarborsGetContextDraftRequest.d.ts → resources/contexts/client/requests/ContextsGetDraftRequest.d.ts} +1 -1
  67. package/api/resources/harbors/resources/contexts/client/requests/ContextsGetRequest.d.ts +10 -0
  68. package/api/resources/harbors/resources/contexts/client/requests/ContextsGetVersionRequest.d.ts +10 -0
  69. package/api/resources/harbors/{client/requests/HarborsListContextDraftsRequest.d.ts → resources/contexts/client/requests/ContextsListDraftsRequest.d.ts} +1 -1
  70. package/api/resources/harbors/{client/requests/HarborsListContextsRequest.d.ts → resources/contexts/client/requests/ContextsListRequest.d.ts} +1 -1
  71. package/api/resources/harbors/{client/requests/HarborsListContextVersionsRequest.d.ts → resources/contexts/client/requests/ContextsListVersionsRequest.d.ts} +1 -1
  72. package/api/resources/harbors/resources/contexts/client/requests/ContextsPromoteDraftRequest.d.ts +10 -0
  73. package/api/resources/harbors/{client → resources/contexts/client}/requests/ResolveHarborSourceMappingsRequest.d.ts +6 -2
  74. package/api/resources/harbors/resources/contexts/client/requests/index.d.ts +14 -0
  75. package/api/resources/harbors/resources/contexts/client/requests/index.js +2 -0
  76. package/api/resources/harbors/resources/contexts/exports.d.ts +2 -0
  77. package/api/resources/harbors/resources/contexts/exports.js +21 -0
  78. package/api/resources/harbors/resources/contexts/index.d.ts +1 -0
  79. package/api/resources/harbors/resources/contexts/index.js +17 -0
  80. package/api/resources/harbors/resources/index.d.ts +15 -0
  81. package/api/resources/harbors/resources/index.js +16 -1
  82. package/api/resources/harbors/resources/keys/client/Client.d.ts +86 -0
  83. package/api/resources/harbors/resources/keys/client/Client.js +266 -0
  84. package/api/resources/harbors/resources/keys/client/index.d.ts +1 -0
  85. package/api/resources/harbors/resources/keys/client/index.js +17 -0
  86. package/api/resources/harbors/{client/requests/HarborsListKeysRequest.d.ts → resources/keys/client/requests/KeysListRequest.d.ts} +1 -1
  87. package/api/resources/harbors/resources/keys/client/requests/index.d.ts +1 -0
  88. package/api/resources/harbors/resources/keys/client/requests/index.js +2 -0
  89. package/api/resources/harbors/resources/keys/exports.d.ts +2 -0
  90. package/api/resources/harbors/resources/keys/exports.js +21 -0
  91. package/api/resources/harbors/resources/keys/index.d.ts +1 -0
  92. package/api/resources/harbors/resources/keys/index.js +17 -0
  93. package/api/resources/harbors/resources/savedQueries/client/Client.d.ts +430 -0
  94. package/api/resources/harbors/resources/savedQueries/client/Client.js +1008 -0
  95. package/api/resources/harbors/resources/savedQueries/client/index.d.ts +1 -0
  96. package/api/resources/harbors/resources/savedQueries/client/index.js +17 -0
  97. package/api/resources/harbors/{client → resources/savedQueries/client}/requests/CreateHarborSavedQueryDraftRequest.d.ts +1 -1
  98. package/api/resources/harbors/{client → resources/savedQueries/client}/requests/SaveHarborSavedQueryDraftRequest.d.ts +1 -1
  99. package/api/resources/harbors/resources/savedQueries/client/requests/SavedQueriesGetRequest.d.ts +10 -0
  100. package/api/resources/harbors/{client/requests/HarborsListSavedQueryDraftsRequest.d.ts → resources/savedQueries/client/requests/SavedQueriesListDraftsRequest.d.ts} +1 -1
  101. package/api/resources/harbors/{client/requests/HarborsListSavedQueriesRequest.d.ts → resources/savedQueries/client/requests/SavedQueriesListRequest.d.ts} +1 -1
  102. package/api/resources/harbors/resources/savedQueries/client/requests/index.d.ts +6 -0
  103. package/api/resources/harbors/resources/savedQueries/client/requests/index.js +2 -0
  104. package/api/resources/harbors/resources/savedQueries/exports.d.ts +2 -0
  105. package/api/resources/harbors/resources/savedQueries/exports.js +21 -0
  106. package/api/resources/harbors/resources/savedQueries/index.d.ts +1 -0
  107. package/api/resources/harbors/resources/savedQueries/index.js +17 -0
  108. package/api/resources/harbors/resources/users/client/Client.d.ts +105 -0
  109. package/api/resources/harbors/resources/users/client/Client.js +342 -0
  110. package/api/resources/harbors/resources/users/client/index.d.ts +1 -0
  111. package/api/resources/harbors/resources/users/client/index.js +17 -0
  112. package/api/resources/harbors/{client/requests/HarborsListUsersRequest.d.ts → resources/users/client/requests/UsersListRequest.d.ts} +1 -1
  113. package/api/resources/harbors/resources/users/client/requests/UsersListRequest.js +3 -0
  114. package/api/resources/harbors/resources/users/client/requests/index.d.ts +2 -0
  115. package/api/resources/harbors/resources/users/client/requests/index.js +2 -0
  116. package/api/resources/harbors/resources/users/exports.d.ts +2 -0
  117. package/api/resources/harbors/resources/users/exports.js +21 -0
  118. package/api/resources/harbors/resources/users/index.d.ts +1 -0
  119. package/api/resources/harbors/resources/users/index.js +17 -0
  120. package/api/resources/index.d.ts +0 -3
  121. package/api/resources/index.js +1 -4
  122. package/api/resources/modelSync/resources/executions/client/Client.d.ts +12 -6
  123. package/api/resources/modelSync/resources/executions/client/Client.js +12 -6
  124. package/api/resources/modelSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +1 -1
  125. package/api/resources/models/client/Client.d.ts +83 -10
  126. package/api/resources/models/client/Client.js +83 -10
  127. package/api/resources/models/client/requests/UpdateModelRequest.d.ts +2 -0
  128. package/api/resources/permissions/resources/policies/client/Client.d.ts +10 -2
  129. package/api/resources/permissions/resources/policies/client/Client.js +10 -2
  130. package/api/resources/permissions/resources/policies/client/requests/CreatePolicyRequest.d.ts +5 -1
  131. package/api/resources/permissions/resources/policies/client/requests/UpdatePolicyRequest.d.ts +5 -1
  132. package/api/resources/queryRunner/client/Client.d.ts +5 -0
  133. package/api/resources/queryRunner/client/Client.js +5 -0
  134. package/api/resources/recordViewLinks/client/Client.d.ts +5 -0
  135. package/api/resources/recordViewLinks/client/Client.js +5 -0
  136. package/api/resources/schemas/client/Client.d.ts +4 -11
  137. package/api/resources/schemas/client/Client.js +4 -11
  138. package/api/resources/temporaryCredentials/client/Client.d.ts +3 -0
  139. package/api/resources/temporaryCredentials/client/Client.js +3 -0
  140. package/api/resources/users/client/Client.d.ts +30 -15
  141. package/api/resources/users/client/Client.js +30 -15
  142. package/api/resources/webhooks/client/Client.d.ts +7 -7
  143. package/api/resources/webhooks/client/Client.js +7 -7
  144. package/api/types/BulkBulkSyncSchedule.d.ts +0 -1
  145. package/api/types/BulkSchema.d.ts +13 -0
  146. package/api/types/BulkSchema.js +10 -0
  147. package/api/types/BulkSchemaListItem.d.ts +11 -0
  148. package/api/types/BulkSchemaListItem.js +10 -0
  149. package/api/types/BulkSelectiveMode.d.ts +9 -0
  150. package/api/types/BulkSelectiveMode.js +9 -0
  151. package/api/types/BulkSyncAdditionalScheduleRequest.d.ts +0 -1
  152. package/api/types/BulkSyncAdditionalScheduleResponse.d.ts +0 -1
  153. package/api/types/BulkSyncDest.d.ts +2 -0
  154. package/api/types/BulkSyncScheduleApi.d.ts +0 -1
  155. package/api/types/BulkSyncSourceCapabilities.d.ts +2 -0
  156. package/api/types/BulkSyncSourceStatus.d.ts +5 -0
  157. package/api/types/ConnectAccessLevel.d.ts +5 -0
  158. package/api/types/ConnectAccessLevel.js +8 -0
  159. package/api/types/ConnectionType.d.ts +4 -0
  160. package/api/types/CreateModelRequest.d.ts +2 -0
  161. package/api/types/EventPayload.d.ts +1 -1
  162. package/api/types/EventingBulkSyncCanceledEvent.d.ts +5 -2
  163. package/api/types/EventingBulkSyncCompletedEvent.d.ts +5 -2
  164. package/api/types/EventingBulkSyncCompletedWithErrorEvent.d.ts +5 -2
  165. package/api/types/EventingBulkSyncFailedEvent.d.ts +5 -2
  166. package/api/types/EventingBulkSyncRunningEvent.d.ts +5 -2
  167. package/api/types/EventingBulkSyncSchedule.d.ts +1 -1
  168. package/api/types/EventingIngestionRecoveredEvent.d.ts +17 -0
  169. package/api/types/EventingIngestionRecoveredEvent.js +3 -0
  170. package/api/types/EventingIngestionStalledEvent.d.ts +19 -0
  171. package/api/types/EventingIngestionStalledEvent.js +3 -0
  172. package/api/types/EventingSyncCanceledEvent.d.ts +5 -2
  173. package/api/types/EventingSyncCompletedEvent.d.ts +6 -3
  174. package/api/types/EventingSyncCompletedWithErrorsEvent.d.ts +5 -2
  175. package/api/types/EventingSyncFailedEvent.d.ts +5 -2
  176. package/api/types/EventingSyncRunningEvent.d.ts +5 -2
  177. package/api/types/GetIdentityResponseSchema.d.ts +2 -0
  178. package/api/types/HarborStatusScheduleResponse.d.ts +0 -1
  179. package/api/types/HarboractivityapiHarborActivityMetadata.d.ts +2 -2
  180. package/api/types/IdentityCredentialSchema.d.ts +2 -0
  181. package/api/types/IdentityCredentialSupportAccessSchema.d.ts +6 -0
  182. package/api/types/IdentityCredentialSupportAccessSchema.js +3 -0
  183. package/api/types/ModelModelFieldOverride.d.ts +17 -0
  184. package/api/types/ModelModelFieldOverride.js +17 -0
  185. package/api/types/SchemaConfiguration.d.ts +11 -0
  186. package/api/types/SchemaConfiguration.js +10 -0
  187. package/api/types/SchemaField.d.ts +4 -0
  188. package/api/types/SchemaSchemaError.d.ts +4 -0
  189. package/api/types/SchemaSchemaError.js +3 -0
  190. package/api/types/SyncDestinationProperties.d.ts +2 -0
  191. package/api/types/index.d.ts +6 -0
  192. package/api/types/index.js +6 -0
  193. package/package.json +1 -1
  194. package/reference.md +2822 -2622
  195. package/version.d.ts +1 -1
  196. package/version.js +1 -1
  197. package/api/resources/harbors/client/requests/HarborsDeleteContextDraftRequest.d.ts +0 -10
  198. package/api/resources/harbors/client/requests/HarborsGetAuthorizedSchemaRequest.d.ts +0 -10
  199. package/api/resources/harbors/client/requests/HarborsGetContextVersionRequest.d.ts +0 -10
  200. package/api/resources/harbors/client/requests/HarborsPromoteContextDraftRequest.d.ts +0 -10
  201. /package/api/resources/{activity/client/requests/ActivityGetSessionRequest.js → bulkSync/client/requests/BulkSyncGetDestinationRequest.js} +0 -0
  202. /package/api/resources/{activity → harbors/resources/actionConfiguration}/client/index.d.ts +0 -0
  203. /package/api/resources/{activity → harbors/resources/actionConfiguration}/client/index.js +0 -0
  204. /package/api/resources/{activity/client/requests/ActivityListRequest.js → harbors/resources/actionConfiguration/client/requests/ActionConfigurationListSchemasRequest.js} +0 -0
  205. /package/api/resources/harbors/{client/requests/CreateHarborContextDraftRequest.js → resources/actionConfiguration/client/requests/ActionConfigurationRemoveRequest.js} +0 -0
  206. /package/api/resources/harbors/{client → resources/actionConfiguration/client}/requests/SetHarborActionConfigurationRequest.js +0 -0
  207. /package/api/resources/{activity → harbors/resources/actionConfiguration}/client/requests/index.js +0 -0
  208. /package/api/resources/harbors/{client/requests/CreateHarborContextRequest.js → resources/activity/client/requests/ActivityGetSessionRequest.js} +0 -0
  209. /package/api/resources/harbors/{client/requests/CreateHarborSavedQueryDraftRequest.js → resources/activity/client/requests/ActivityListRequest.js} +0 -0
  210. /package/api/resources/{activity → harbors/resources/activity}/client/requests/index.d.ts +0 -0
  211. /package/api/resources/{activity → harbors/resources/activity}/exports.d.ts +0 -0
  212. /package/api/resources/{activity → harbors/resources/activity}/exports.js +0 -0
  213. /package/api/resources/{activity → harbors/resources/activity}/index.d.ts +0 -0
  214. /package/api/resources/{activity → harbors/resources/activity}/index.js +0 -0
  215. /package/api/resources/{activity → harbors/resources/activity}/types/ActivityGetSessionRequestOrder.d.ts +0 -0
  216. /package/api/resources/{activity → harbors/resources/activity}/types/ActivityGetSessionRequestOrder.js +0 -0
  217. /package/api/resources/{activity → harbors/resources/activity}/types/ActivityListRequestOrder.d.ts +0 -0
  218. /package/api/resources/{activity → harbors/resources/activity}/types/ActivityListRequestOrder.js +0 -0
  219. /package/api/resources/{activity → harbors/resources/activity}/types/index.d.ts +0 -0
  220. /package/api/resources/{activity → harbors/resources/activity}/types/index.js +0 -0
  221. /package/api/resources/harbors/{client/requests/ExecuteHarborSavedQueryRequest.js → resources/connections/client/requests/ConnectionsGetSchemaRequest.js} +0 -0
  222. /package/api/resources/harbors/{client/requests/HarborsDeleteContextDraftRequest.js → resources/connections/client/requests/ConnectionsListRequest.js} +0 -0
  223. /package/api/resources/harbors/{client/requests/HarborsDeleteContextRequest.js → resources/connections/client/requests/ConnectionsListSchemasRequest.js} +0 -0
  224. /package/api/resources/harbors/{client/requests/HarborsGetAuthorizedSchemaRequest.js → resources/contexts/client/requests/ContextsDeleteDraftRequest.js} +0 -0
  225. /package/api/resources/harbors/{client/requests/HarborsGetContextDraftRequest.js → resources/contexts/client/requests/ContextsDeleteRequest.js} +0 -0
  226. /package/api/resources/harbors/{client/requests/HarborsGetContextRequest.js → resources/contexts/client/requests/ContextsGetDraftRequest.js} +0 -0
  227. /package/api/resources/harbors/{client/requests/HarborsGetContextVersionRequest.js → resources/contexts/client/requests/ContextsGetRequest.js} +0 -0
  228. /package/api/resources/harbors/{client/requests/HarborsGetSavedQueryRequest.js → resources/contexts/client/requests/ContextsGetVersionRequest.js} +0 -0
  229. /package/api/resources/harbors/{client/requests/HarborsListActionConfigurationSchemasRequest.js → resources/contexts/client/requests/ContextsListDraftsRequest.js} +0 -0
  230. /package/api/resources/harbors/{client/requests/HarborsListAuthorizedConnectionsRequest.js → resources/contexts/client/requests/ContextsListRequest.js} +0 -0
  231. /package/api/resources/harbors/{client/requests/HarborsListAuthorizedSchemasRequest.js → resources/contexts/client/requests/ContextsListVersionsRequest.js} +0 -0
  232. /package/api/resources/harbors/{client/requests/HarborsListContextDraftsRequest.js → resources/contexts/client/requests/ContextsPromoteDraftRequest.js} +0 -0
  233. /package/api/resources/harbors/{client → resources/contexts/client}/requests/CreateHarborContextDraftRequest.d.ts +0 -0
  234. /package/api/resources/harbors/{client/requests/HarborsListContextVersionsRequest.js → resources/contexts/client/requests/CreateHarborContextDraftRequest.js} +0 -0
  235. /package/api/resources/harbors/{client → resources/contexts/client}/requests/CreateHarborContextRequest.d.ts +0 -0
  236. /package/api/resources/harbors/{client/requests/HarborsListContextsRequest.js → resources/contexts/client/requests/CreateHarborContextRequest.js} +0 -0
  237. /package/api/resources/harbors/{client → resources/contexts/client}/requests/ResolveHarborSourceMappingsRequest.js +0 -0
  238. /package/api/resources/harbors/{client → resources/contexts/client}/requests/SaveHarborContextDraftRequest.d.ts +0 -0
  239. /package/api/resources/harbors/{client → resources/contexts/client}/requests/SaveHarborContextDraftRequest.js +0 -0
  240. /package/api/resources/harbors/{client → resources/contexts/client}/requests/SaveHarborContextRequest.d.ts +0 -0
  241. /package/api/resources/harbors/{client → resources/contexts/client}/requests/SaveHarborContextRequest.js +0 -0
  242. /package/api/resources/harbors/{client/requests/HarborsListKeysRequest.js → resources/keys/client/requests/KeysListRequest.js} +0 -0
  243. /package/api/resources/harbors/{client/requests/HarborsListSavedQueriesRequest.js → resources/savedQueries/client/requests/CreateHarborSavedQueryDraftRequest.js} +0 -0
  244. /package/api/resources/harbors/{client → resources/savedQueries/client}/requests/ExecuteHarborSavedQueryRequest.d.ts +0 -0
  245. /package/api/resources/harbors/{client/requests/HarborsListSavedQueryDraftsRequest.js → resources/savedQueries/client/requests/ExecuteHarborSavedQueryRequest.js} +0 -0
  246. /package/api/resources/harbors/{client → resources/savedQueries/client}/requests/SaveHarborSavedQueryDraftRequest.js +0 -0
  247. /package/api/resources/harbors/{client/requests/HarborsListUsersRequest.js → resources/savedQueries/client/requests/SavedQueriesGetRequest.js} +0 -0
  248. /package/api/resources/harbors/{client/requests/HarborsPromoteContextDraftRequest.js → resources/savedQueries/client/requests/SavedQueriesListDraftsRequest.js} +0 -0
  249. /package/api/resources/harbors/{client/requests/HarborsRemoveActionConfigurationRequest.js → resources/savedQueries/client/requests/SavedQueriesListRequest.js} +0 -0
  250. /package/api/resources/harbors/{client → resources/users/client}/requests/InviteHarborUserRequest.d.ts +0 -0
  251. /package/api/resources/harbors/{client → resources/users/client}/requests/InviteHarborUserRequest.js +0 -0
@@ -0,0 +1,1142 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ var __rest = (this && this.__rest) || function (s, e) {
46
+ var t = {};
47
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
48
+ t[p] = s[p];
49
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
50
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
51
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
52
+ t[p[i]] = s[p[i]];
53
+ }
54
+ return t;
55
+ };
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.ContextsClient = void 0;
58
+ const BaseClient_1 = require("../../../../../../BaseClient");
59
+ const core = __importStar(require("../../../../../../core"));
60
+ const headers_1 = require("../../../../../../core/headers");
61
+ const requestBody_1 = require("../../../../../../core/requestBody");
62
+ const environments = __importStar(require("../../../../../../environments"));
63
+ const handleNonStatusCodeError_1 = require("../../../../../../errors/handleNonStatusCodeError");
64
+ const errors = __importStar(require("../../../../../../errors/index"));
65
+ const Polytomic = __importStar(require("../../../../../index"));
66
+ class ContextsClient {
67
+ constructor(options = {}) {
68
+ this._options = (0, BaseClient_1.normalizeClientOptionsWithAuth)(options);
69
+ }
70
+ /**
71
+ * Lists context document metadata for a Harbor without returning document content.
72
+ *
73
+ * Collection items include the current published `version` number and omit
74
+ * `content`. Use the context item endpoint to retrieve a complete document.
75
+ *
76
+ * A Harbor profile credential can read context only when `harbor_id` identifies
77
+ * its own Harbor.
78
+ *
79
+ * @param {string} harbor_id - Unique identifier of the Harbor
80
+ * @param {Polytomic.harbors.ContextsListRequest} request
81
+ * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
82
+ *
83
+ * @throws {@link Polytomic.ForbiddenError}
84
+ * @throws {@link Polytomic.NotFoundError}
85
+ * @throws {@link Polytomic.UnprocessableEntityError}
86
+ * @throws {@link Polytomic.InternalServerError}
87
+ * @throws {@link errors.PolytomicError}
88
+ * @throws {@link errors.PolytomicTimeoutError}
89
+ *
90
+ * @example
91
+ * await client.harbors.contexts.list("248df4b7-aa70-47b8-a036-33ac447e668d", {
92
+ * limit: 50,
93
+ * page_token: "page_token"
94
+ * })
95
+ */
96
+ list(harbor_id, request = {}, requestOptions) {
97
+ return core.HttpResponsePromise.fromPromise(this.__list(harbor_id, request, requestOptions));
98
+ }
99
+ __list(harbor_id_1) {
100
+ return __awaiter(this, arguments, void 0, function* (harbor_id, request = {}, requestOptions) {
101
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
102
+ const { limit, page_token: pageToken, "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
103
+ const _queryParams = {
104
+ limit,
105
+ page_token: pageToken,
106
+ };
107
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
108
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
109
+ "X-Polytomic-Harbor-Session": polytomicHarborSession,
110
+ "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
111
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
112
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
113
+ const _response = yield core.fetcher({
114
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts`),
115
+ method: "GET",
116
+ headers: _headers,
117
+ queryString: core.url
118
+ .queryBuilder()
119
+ .addMany(_queryParams)
120
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
121
+ .build(),
122
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
123
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
124
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
125
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
126
+ logging: this._options.logging,
127
+ });
128
+ if (_response.ok) {
129
+ return { data: _response.body, rawResponse: _response.rawResponse };
130
+ }
131
+ if (_response.error.reason === "status-code") {
132
+ switch (_response.error.statusCode) {
133
+ case 403:
134
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
135
+ case 404:
136
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
137
+ case 422:
138
+ throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
139
+ case 500:
140
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
141
+ default:
142
+ throw new errors.PolytomicError({
143
+ statusCode: _response.error.statusCode,
144
+ body: _response.error.body,
145
+ rawResponse: _response.rawResponse,
146
+ });
147
+ }
148
+ }
149
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts");
150
+ });
151
+ }
152
+ /**
153
+ * Creates and attaches a context document to a Harbor.
154
+ *
155
+ * The new document belongs only to this Harbor. Context documents cannot be attached to multiple Harbors.
156
+ *
157
+ * @param {string} harbor_id - Unique identifier of the Harbor
158
+ * @param {Polytomic.harbors.CreateHarborContextRequest} request
159
+ * @param {ContextsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
160
+ *
161
+ * @throws {@link Polytomic.ForbiddenError}
162
+ * @throws {@link Polytomic.NotFoundError}
163
+ * @throws {@link Polytomic.UnprocessableEntityError}
164
+ * @throws {@link Polytomic.InternalServerError}
165
+ * @throws {@link errors.PolytomicError}
166
+ * @throws {@link errors.PolytomicTimeoutError}
167
+ *
168
+ * @example
169
+ * await client.harbors.contexts.create("248df4b7-aa70-47b8-a036-33ac447e668d", {
170
+ * content: "Bookings use the contract signed date...",
171
+ * title: "Revenue definitions"
172
+ * })
173
+ */
174
+ create(harbor_id, request, requestOptions) {
175
+ return core.HttpResponsePromise.fromPromise(this.__create(harbor_id, request, requestOptions));
176
+ }
177
+ __create(harbor_id, request, requestOptions) {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
180
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
181
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
182
+ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
183
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
184
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
185
+ const _response = yield core.fetcher({
186
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts`),
187
+ method: "POST",
188
+ headers: _headers,
189
+ contentType: "application/json",
190
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
191
+ requestType: "json",
192
+ body: (0, requestBody_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
193
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
194
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
195
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
196
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
197
+ logging: this._options.logging,
198
+ });
199
+ if (_response.ok) {
200
+ return { data: _response.body, rawResponse: _response.rawResponse };
201
+ }
202
+ if (_response.error.reason === "status-code") {
203
+ switch (_response.error.statusCode) {
204
+ case 403:
205
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
206
+ case 404:
207
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
208
+ case 422:
209
+ throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
210
+ case 500:
211
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
212
+ default:
213
+ throw new errors.PolytomicError({
214
+ statusCode: _response.error.statusCode,
215
+ body: _response.error.body,
216
+ rawResponse: _response.rawResponse,
217
+ });
218
+ }
219
+ }
220
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/contexts");
221
+ });
222
+ }
223
+ /**
224
+ * Lists mutable Harbor context drafts without returning document content.
225
+ *
226
+ * The collection includes drafts for published context documents and initial drafts
227
+ * that have not yet been published. Use `context_id` with the draft detail,
228
+ * replacement, promotion, and discard endpoints.
229
+ *
230
+ * Draft metadata does not include `content`. Fetch a selected draft through its
231
+ * detail endpoint to read the complete candidate. Normal context list and detail
232
+ * operations continue to return published content only.
233
+ *
234
+ * @param {string} harbor_id - Unique identifier of the Harbor
235
+ * @param {Polytomic.harbors.ContextsListDraftsRequest} request
236
+ * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
237
+ *
238
+ * @throws {@link Polytomic.ForbiddenError}
239
+ * @throws {@link Polytomic.NotFoundError}
240
+ * @throws {@link Polytomic.UnprocessableEntityError}
241
+ * @throws {@link Polytomic.InternalServerError}
242
+ * @throws {@link errors.PolytomicError}
243
+ * @throws {@link errors.PolytomicTimeoutError}
244
+ *
245
+ * @example
246
+ * await client.harbors.contexts.listDrafts("248df4b7-aa70-47b8-a036-33ac447e668d", {
247
+ * limit: 50,
248
+ * page_token: "page_token"
249
+ * })
250
+ */
251
+ listDrafts(harbor_id, request = {}, requestOptions) {
252
+ return core.HttpResponsePromise.fromPromise(this.__listDrafts(harbor_id, request, requestOptions));
253
+ }
254
+ __listDrafts(harbor_id_1) {
255
+ return __awaiter(this, arguments, void 0, function* (harbor_id, request = {}, requestOptions) {
256
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
257
+ const { limit, page_token: pageToken } = request;
258
+ const _queryParams = {
259
+ limit,
260
+ page_token: pageToken,
261
+ };
262
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
263
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
264
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
265
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
266
+ const _response = yield core.fetcher({
267
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/drafts`),
268
+ method: "GET",
269
+ headers: _headers,
270
+ queryString: core.url
271
+ .queryBuilder()
272
+ .addMany(_queryParams)
273
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
274
+ .build(),
275
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
276
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
277
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
278
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
279
+ logging: this._options.logging,
280
+ });
281
+ if (_response.ok) {
282
+ return {
283
+ data: _response.body,
284
+ rawResponse: _response.rawResponse,
285
+ };
286
+ }
287
+ if (_response.error.reason === "status-code") {
288
+ switch (_response.error.statusCode) {
289
+ case 403:
290
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
291
+ case 404:
292
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
293
+ case 422:
294
+ throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
295
+ case 500:
296
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
297
+ default:
298
+ throw new errors.PolytomicError({
299
+ statusCode: _response.error.statusCode,
300
+ body: _response.error.body,
301
+ rawResponse: _response.rawResponse,
302
+ });
303
+ }
304
+ }
305
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts/drafts");
306
+ });
307
+ }
308
+ /**
309
+ * Creates an unpublished context document with its initial mutable draft.
310
+ *
311
+ * Creates a stable context identity and its initial mutable draft without publishing
312
+ * content to the Harbor. The response includes `context_id`, which identifies the
313
+ * draft replacement, promotion, and discard routes.
314
+ *
315
+ * The initial draft has a null `base_revision_id`. It remains absent from normal
316
+ * context list/detail, GraphQL, entity lookup, and Harbor MCP reads until promoted.
317
+ * Use the regular context creation endpoint instead when the initial payload should
318
+ * be published immediately.
319
+ *
320
+ * @param {string} harbor_id - Unique identifier of the Harbor
321
+ * @param {Polytomic.harbors.CreateHarborContextDraftRequest} request
322
+ * @param {ContextsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
323
+ *
324
+ * @throws {@link Polytomic.ForbiddenError}
325
+ * @throws {@link Polytomic.NotFoundError}
326
+ * @throws {@link Polytomic.UnprocessableEntityError}
327
+ * @throws {@link Polytomic.InternalServerError}
328
+ * @throws {@link errors.PolytomicError}
329
+ * @throws {@link errors.PolytomicTimeoutError}
330
+ *
331
+ * @example
332
+ * await client.harbors.contexts.createDraft("248df4b7-aa70-47b8-a036-33ac447e668d", {
333
+ * content: "Bookings use the contract signed date...",
334
+ * title: "Revenue definitions"
335
+ * })
336
+ */
337
+ createDraft(harbor_id, request, requestOptions) {
338
+ return core.HttpResponsePromise.fromPromise(this.__createDraft(harbor_id, request, requestOptions));
339
+ }
340
+ __createDraft(harbor_id, request, requestOptions) {
341
+ return __awaiter(this, void 0, void 0, function* () {
342
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
343
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
344
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
345
+ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
346
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
347
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
348
+ const _response = yield core.fetcher({
349
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/drafts`),
350
+ method: "POST",
351
+ headers: _headers,
352
+ contentType: "application/json",
353
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
354
+ requestType: "json",
355
+ body: (0, requestBody_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
356
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
357
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
358
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
359
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
360
+ logging: this._options.logging,
361
+ });
362
+ if (_response.ok) {
363
+ return { data: _response.body, rawResponse: _response.rawResponse };
364
+ }
365
+ if (_response.error.reason === "status-code") {
366
+ switch (_response.error.statusCode) {
367
+ case 403:
368
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
369
+ case 404:
370
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
371
+ case 422:
372
+ throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
373
+ case 500:
374
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
375
+ default:
376
+ throw new errors.PolytomicError({
377
+ statusCode: _response.error.statusCode,
378
+ body: _response.error.body,
379
+ rawResponse: _response.rawResponse,
380
+ });
381
+ }
382
+ }
383
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/contexts/drafts");
384
+ });
385
+ }
386
+ /**
387
+ * Returns one complete Harbor context document.
388
+ *
389
+ * The response includes the current published `version` number and complete
390
+ * plain-text `content`.
391
+ *
392
+ * A Harbor profile credential can read context only when `harbor_id` identifies
393
+ * its own Harbor.
394
+ *
395
+ * @param {string} harbor_id - Unique identifier of the Harbor
396
+ * @param {string} context_id - Unique identifier of the context document
397
+ * @param {Polytomic.harbors.ContextsGetRequest} request
398
+ * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
399
+ *
400
+ * @throws {@link Polytomic.ForbiddenError}
401
+ * @throws {@link Polytomic.NotFoundError}
402
+ * @throws {@link Polytomic.InternalServerError}
403
+ * @throws {@link errors.PolytomicError}
404
+ * @throws {@link errors.PolytomicTimeoutError}
405
+ *
406
+ * @example
407
+ * await client.harbors.contexts.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
408
+ */
409
+ get(harbor_id, context_id, request = {}, requestOptions) {
410
+ return core.HttpResponsePromise.fromPromise(this.__get(harbor_id, context_id, request, requestOptions));
411
+ }
412
+ __get(harbor_id_1, context_id_1) {
413
+ return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
414
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
415
+ const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
416
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
417
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
418
+ "X-Polytomic-Harbor-Session": polytomicHarborSession,
419
+ "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
420
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
421
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
422
+ const _response = yield core.fetcher({
423
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}`),
424
+ method: "GET",
425
+ headers: _headers,
426
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
427
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
428
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
429
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
430
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
431
+ logging: this._options.logging,
432
+ });
433
+ if (_response.ok) {
434
+ return { data: _response.body, rawResponse: _response.rawResponse };
435
+ }
436
+ if (_response.error.reason === "status-code") {
437
+ switch (_response.error.statusCode) {
438
+ case 403:
439
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
440
+ case 404:
441
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
442
+ case 500:
443
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
444
+ default:
445
+ throw new errors.PolytomicError({
446
+ statusCode: _response.error.statusCode,
447
+ body: _response.error.body,
448
+ rawResponse: _response.rawResponse,
449
+ });
450
+ }
451
+ }
452
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts/{context_id}");
453
+ });
454
+ }
455
+ /**
456
+ * Replaces one Harbor context document.
457
+ *
458
+ * Each successful request publishes the next immutable version. You can omit
459
+ * `change_note`.
460
+ *
461
+ * A direct publication leaves an existing draft unchanged.
462
+ *
463
+ * @param {string} harbor_id - Unique identifier of the Harbor
464
+ * @param {string} context_id - Unique identifier of the context document
465
+ * @param {Polytomic.harbors.SaveHarborContextRequest} request
466
+ * @param {ContextsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
467
+ *
468
+ * @throws {@link Polytomic.ForbiddenError}
469
+ * @throws {@link Polytomic.NotFoundError}
470
+ * @throws {@link Polytomic.UnprocessableEntityError}
471
+ * @throws {@link Polytomic.InternalServerError}
472
+ * @throws {@link errors.PolytomicError}
473
+ * @throws {@link errors.PolytomicTimeoutError}
474
+ *
475
+ * @example
476
+ * await client.harbors.contexts.update("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
477
+ * content: "Bookings use the contract signed date...",
478
+ * title: "Revenue definitions"
479
+ * })
480
+ */
481
+ update(harbor_id, context_id, request, requestOptions) {
482
+ return core.HttpResponsePromise.fromPromise(this.__update(harbor_id, context_id, request, requestOptions));
483
+ }
484
+ __update(harbor_id, context_id, request, requestOptions) {
485
+ return __awaiter(this, void 0, void 0, function* () {
486
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
487
+ const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId } = request, _body = __rest(request, ["X-Polytomic-Harbor-Session", "X-Polytomic-Activity-Request-ID"]);
488
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
489
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
490
+ "X-Polytomic-Harbor-Session": polytomicHarborSession,
491
+ "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
492
+ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
493
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
494
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
495
+ const _response = yield core.fetcher({
496
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}`),
497
+ method: "PUT",
498
+ headers: _headers,
499
+ contentType: "application/json",
500
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
501
+ requestType: "json",
502
+ body: (0, requestBody_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
503
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
504
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
505
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
506
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
507
+ logging: this._options.logging,
508
+ });
509
+ if (_response.ok) {
510
+ return { data: _response.body, rawResponse: _response.rawResponse };
511
+ }
512
+ if (_response.error.reason === "status-code") {
513
+ switch (_response.error.statusCode) {
514
+ case 403:
515
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
516
+ case 404:
517
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
518
+ case 422:
519
+ throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
520
+ case 500:
521
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
522
+ default:
523
+ throw new errors.PolytomicError({
524
+ statusCode: _response.error.statusCode,
525
+ body: _response.error.body,
526
+ rawResponse: _response.rawResponse,
527
+ });
528
+ }
529
+ }
530
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/api/harbors/{harbor_id}/contexts/{context_id}");
531
+ });
532
+ }
533
+ /**
534
+ * Deletes one context document from a Harbor.
535
+ *
536
+ * Deleting a context document does not affect the Harbor or its other context documents.
537
+ *
538
+ * @param {string} harbor_id - Unique identifier of the Harbor
539
+ * @param {string} context_id - Unique identifier of the context document
540
+ * @param {Polytomic.harbors.ContextsDeleteRequest} request
541
+ * @param {ContextsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
542
+ *
543
+ * @throws {@link Polytomic.ForbiddenError}
544
+ * @throws {@link Polytomic.NotFoundError}
545
+ * @throws {@link Polytomic.InternalServerError}
546
+ * @throws {@link errors.PolytomicError}
547
+ * @throws {@link errors.PolytomicTimeoutError}
548
+ *
549
+ * @example
550
+ * await client.harbors.contexts.delete("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
551
+ */
552
+ delete(harbor_id, context_id, request = {}, requestOptions) {
553
+ return core.HttpResponsePromise.fromPromise(this.__delete(harbor_id, context_id, request, requestOptions));
554
+ }
555
+ __delete(harbor_id_1, context_id_1) {
556
+ return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
557
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
558
+ const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
559
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
560
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
561
+ "X-Polytomic-Harbor-Session": polytomicHarborSession,
562
+ "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
563
+ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
564
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
565
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
566
+ const _response = yield core.fetcher({
567
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}`),
568
+ method: "DELETE",
569
+ headers: _headers,
570
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
571
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
572
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
573
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
574
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
575
+ logging: this._options.logging,
576
+ });
577
+ if (_response.ok) {
578
+ return {
579
+ data: _response.body,
580
+ rawResponse: _response.rawResponse,
581
+ };
582
+ }
583
+ if (_response.error.reason === "status-code") {
584
+ switch (_response.error.statusCode) {
585
+ case 403:
586
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
587
+ case 404:
588
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
589
+ case 500:
590
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
591
+ default:
592
+ throw new errors.PolytomicError({
593
+ statusCode: _response.error.statusCode,
594
+ body: _response.error.body,
595
+ rawResponse: _response.rawResponse,
596
+ });
597
+ }
598
+ }
599
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/api/harbors/{harbor_id}/contexts/{context_id}");
600
+ });
601
+ }
602
+ /**
603
+ * Returns the mutable draft for a Harbor context document.
604
+ *
605
+ * Drafts are available only through the draft endpoints. `base_revision_id`
606
+ * identifies the published revision from which the candidate was created. Normal
607
+ * context reads and Harbor MCP tools continue to return the current published
608
+ * version. Creator and updater IDs are null when their actor type is `system`.
609
+ *
610
+ * @param {string} harbor_id - Unique identifier of the Harbor
611
+ * @param {string} context_id - Unique identifier of the context document
612
+ * @param {Polytomic.harbors.ContextsGetDraftRequest} request
613
+ * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
614
+ *
615
+ * @throws {@link Polytomic.ForbiddenError}
616
+ * @throws {@link Polytomic.NotFoundError}
617
+ * @throws {@link Polytomic.InternalServerError}
618
+ * @throws {@link errors.PolytomicError}
619
+ * @throws {@link errors.PolytomicTimeoutError}
620
+ *
621
+ * @example
622
+ * await client.harbors.contexts.getDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
623
+ */
624
+ getDraft(harbor_id, context_id, request = {}, requestOptions) {
625
+ return core.HttpResponsePromise.fromPromise(this.__getDraft(harbor_id, context_id, request, requestOptions));
626
+ }
627
+ __getDraft(harbor_id_1, context_id_1) {
628
+ return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
629
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
630
+ const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
631
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
632
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
633
+ "X-Polytomic-Harbor-Session": polytomicHarborSession,
634
+ "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
635
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
636
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
637
+ const _response = yield core.fetcher({
638
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/draft`),
639
+ method: "GET",
640
+ headers: _headers,
641
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
642
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
643
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
644
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
645
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
646
+ logging: this._options.logging,
647
+ });
648
+ if (_response.ok) {
649
+ return { data: _response.body, rawResponse: _response.rawResponse };
650
+ }
651
+ if (_response.error.reason === "status-code") {
652
+ switch (_response.error.statusCode) {
653
+ case 403:
654
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
655
+ case 404:
656
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
657
+ case 500:
658
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
659
+ default:
660
+ throw new errors.PolytomicError({
661
+ statusCode: _response.error.statusCode,
662
+ body: _response.error.body,
663
+ rawResponse: _response.rawResponse,
664
+ });
665
+ }
666
+ }
667
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts/{context_id}/draft");
668
+ });
669
+ }
670
+ /**
671
+ * Creates or completely replaces the mutable draft for a Harbor context document.
672
+ *
673
+ * The request supplies the complete draft payload. If a draft already exists,
674
+ * this request replaces it while preserving the draft ID, creation metadata, and
675
+ * `base_revision_id`.
676
+ *
677
+ * A new draft for a published document records the current revision as its base.
678
+ * An unpublished document's initial draft keeps a null base when replaced. Saving
679
+ * a draft does not change published content or its `updated_at`. Creator and
680
+ * updater provenance comes from the request actor; system actors have a null actor
681
+ * ID.
682
+ *
683
+ * @param {string} harbor_id - Unique identifier of the Harbor
684
+ * @param {string} context_id - Unique identifier of the context document
685
+ * @param {Polytomic.harbors.SaveHarborContextDraftRequest} request
686
+ * @param {ContextsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
687
+ *
688
+ * @throws {@link Polytomic.ForbiddenError}
689
+ * @throws {@link Polytomic.NotFoundError}
690
+ * @throws {@link Polytomic.UnprocessableEntityError}
691
+ * @throws {@link Polytomic.InternalServerError}
692
+ * @throws {@link errors.PolytomicError}
693
+ * @throws {@link errors.PolytomicTimeoutError}
694
+ *
695
+ * @example
696
+ * await client.harbors.contexts.saveDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
697
+ * content: "Bookings use the contract signed date...",
698
+ * title: "Revenue definitions"
699
+ * })
700
+ */
701
+ saveDraft(harbor_id, context_id, request, requestOptions) {
702
+ return core.HttpResponsePromise.fromPromise(this.__saveDraft(harbor_id, context_id, request, requestOptions));
703
+ }
704
+ __saveDraft(harbor_id, context_id, request, requestOptions) {
705
+ return __awaiter(this, void 0, void 0, function* () {
706
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
707
+ const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId } = request, _body = __rest(request, ["X-Polytomic-Harbor-Session", "X-Polytomic-Activity-Request-ID"]);
708
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
709
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
710
+ "X-Polytomic-Harbor-Session": polytomicHarborSession,
711
+ "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
712
+ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
713
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
714
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
715
+ const _response = yield core.fetcher({
716
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/draft`),
717
+ method: "PUT",
718
+ headers: _headers,
719
+ contentType: "application/json",
720
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
721
+ requestType: "json",
722
+ body: (0, requestBody_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
723
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
724
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
725
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
726
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
727
+ logging: this._options.logging,
728
+ });
729
+ if (_response.ok) {
730
+ return { data: _response.body, rawResponse: _response.rawResponse };
731
+ }
732
+ if (_response.error.reason === "status-code") {
733
+ switch (_response.error.statusCode) {
734
+ case 403:
735
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
736
+ case 404:
737
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
738
+ case 422:
739
+ throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
740
+ case 500:
741
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
742
+ default:
743
+ throw new errors.PolytomicError({
744
+ statusCode: _response.error.statusCode,
745
+ body: _response.error.body,
746
+ rawResponse: _response.rawResponse,
747
+ });
748
+ }
749
+ }
750
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/api/harbors/{harbor_id}/contexts/{context_id}/draft");
751
+ });
752
+ }
753
+ /**
754
+ * Discards the mutable draft for a Harbor context document.
755
+ *
756
+ * Discarding a draft does not change the current published version or its
757
+ * history. If the draft belongs to a context that has never been published,
758
+ * discarding it also removes the otherwise empty context identity.
759
+ *
760
+ * @param {string} harbor_id - Unique identifier of the Harbor
761
+ * @param {string} context_id - Unique identifier of the context document
762
+ * @param {Polytomic.harbors.ContextsDeleteDraftRequest} request
763
+ * @param {ContextsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
764
+ *
765
+ * @throws {@link Polytomic.ForbiddenError}
766
+ * @throws {@link Polytomic.NotFoundError}
767
+ * @throws {@link Polytomic.InternalServerError}
768
+ * @throws {@link errors.PolytomicError}
769
+ * @throws {@link errors.PolytomicTimeoutError}
770
+ *
771
+ * @example
772
+ * await client.harbors.contexts.deleteDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
773
+ */
774
+ deleteDraft(harbor_id, context_id, request = {}, requestOptions) {
775
+ return core.HttpResponsePromise.fromPromise(this.__deleteDraft(harbor_id, context_id, request, requestOptions));
776
+ }
777
+ __deleteDraft(harbor_id_1, context_id_1) {
778
+ return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
779
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
780
+ const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
781
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
782
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
783
+ "X-Polytomic-Harbor-Session": polytomicHarborSession,
784
+ "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
785
+ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
786
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
787
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
788
+ const _response = yield core.fetcher({
789
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/draft`),
790
+ method: "DELETE",
791
+ headers: _headers,
792
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
793
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
794
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
795
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
796
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
797
+ logging: this._options.logging,
798
+ });
799
+ if (_response.ok) {
800
+ return {
801
+ data: _response.body,
802
+ rawResponse: _response.rawResponse,
803
+ };
804
+ }
805
+ if (_response.error.reason === "status-code") {
806
+ switch (_response.error.statusCode) {
807
+ case 403:
808
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
809
+ case 404:
810
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
811
+ case 500:
812
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
813
+ default:
814
+ throw new errors.PolytomicError({
815
+ statusCode: _response.error.statusCode,
816
+ body: _response.error.body,
817
+ rawResponse: _response.rawResponse,
818
+ });
819
+ }
820
+ }
821
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/api/harbors/{harbor_id}/contexts/{context_id}/draft");
822
+ });
823
+ }
824
+ /**
825
+ * Promotes the draft to the next immutable published context version.
826
+ *
827
+ * Promotion publishes the draft's exact title, description, content, and optional
828
+ * change note as the next version. An unpublished context's initial draft becomes
829
+ * version 1. The draft is removed after publication.
830
+ *
831
+ * Promotion returns a conflict when the current published revision differs from
832
+ * the draft's `base_revision_id`. The stale draft remains available so an author
833
+ * can compare it with the current version before discarding and recreating it.
834
+ *
835
+ * @param {string} harbor_id - Unique identifier of the Harbor
836
+ * @param {string} context_id - Unique identifier of the context document
837
+ * @param {Polytomic.harbors.ContextsPromoteDraftRequest} request
838
+ * @param {ContextsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
839
+ *
840
+ * @throws {@link Polytomic.ForbiddenError}
841
+ * @throws {@link Polytomic.NotFoundError}
842
+ * @throws {@link Polytomic.ConflictError}
843
+ * @throws {@link Polytomic.InternalServerError}
844
+ * @throws {@link errors.PolytomicError}
845
+ * @throws {@link errors.PolytomicTimeoutError}
846
+ *
847
+ * @example
848
+ * await client.harbors.contexts.promoteDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
849
+ */
850
+ promoteDraft(harbor_id, context_id, request = {}, requestOptions) {
851
+ return core.HttpResponsePromise.fromPromise(this.__promoteDraft(harbor_id, context_id, request, requestOptions));
852
+ }
853
+ __promoteDraft(harbor_id_1, context_id_1) {
854
+ return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
855
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
856
+ const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
857
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
858
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
859
+ "X-Polytomic-Harbor-Session": polytomicHarborSession,
860
+ "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
861
+ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
862
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
863
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
864
+ const _response = yield core.fetcher({
865
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/draft/promote`),
866
+ method: "POST",
867
+ headers: _headers,
868
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
869
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
870
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
871
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
872
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
873
+ logging: this._options.logging,
874
+ });
875
+ if (_response.ok) {
876
+ return {
877
+ data: _response.body,
878
+ rawResponse: _response.rawResponse,
879
+ };
880
+ }
881
+ if (_response.error.reason === "status-code") {
882
+ switch (_response.error.statusCode) {
883
+ case 403:
884
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
885
+ case 404:
886
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
887
+ case 409:
888
+ throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
889
+ case 500:
890
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
891
+ default:
892
+ throw new errors.PolytomicError({
893
+ statusCode: _response.error.statusCode,
894
+ body: _response.error.body,
895
+ rawResponse: _response.rawResponse,
896
+ });
897
+ }
898
+ }
899
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/contexts/{context_id}/draft/promote");
900
+ });
901
+ }
902
+ /**
903
+ * Lists immutable published versions of a Harbor context document without returning content.
904
+ *
905
+ * Versions are ordered from newest to oldest. Collection items omit `content`,
906
+ * and the draft is never included. Pagination tokens continue from the last
907
+ * returned version, so publishing a newer version between requests does not shift
908
+ * or duplicate older results.
909
+ *
910
+ * Published revision IDs are durable artifact identities intended for future
911
+ * Harbor activity and audit records. Publisher IDs are paired with actor types.
912
+ * System publications have `published_by_type: "system"` and a null
913
+ * `published_by` because the system actor has no UUID.
914
+ *
915
+ * A Harbor profile credential can read versions only when `harbor_id` identifies
916
+ * its own Harbor.
917
+ *
918
+ * @param {string} harbor_id - Unique identifier of the Harbor
919
+ * @param {string} context_id - Unique identifier of the context document
920
+ * @param {Polytomic.harbors.ContextsListVersionsRequest} request
921
+ * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
922
+ *
923
+ * @throws {@link Polytomic.ForbiddenError}
924
+ * @throws {@link Polytomic.NotFoundError}
925
+ * @throws {@link Polytomic.UnprocessableEntityError}
926
+ * @throws {@link Polytomic.InternalServerError}
927
+ * @throws {@link errors.PolytomicError}
928
+ * @throws {@link errors.PolytomicTimeoutError}
929
+ *
930
+ * @example
931
+ * await client.harbors.contexts.listVersions("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
932
+ * limit: 50,
933
+ * page_token: "page_token"
934
+ * })
935
+ */
936
+ listVersions(harbor_id, context_id, request = {}, requestOptions) {
937
+ return core.HttpResponsePromise.fromPromise(this.__listVersions(harbor_id, context_id, request, requestOptions));
938
+ }
939
+ __listVersions(harbor_id_1, context_id_1) {
940
+ return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
941
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
942
+ const { limit, page_token: pageToken, "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
943
+ const _queryParams = {
944
+ limit,
945
+ page_token: pageToken,
946
+ };
947
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
948
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
949
+ "X-Polytomic-Harbor-Session": polytomicHarborSession,
950
+ "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
951
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
952
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
953
+ const _response = yield core.fetcher({
954
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/versions`),
955
+ method: "GET",
956
+ headers: _headers,
957
+ queryString: core.url
958
+ .queryBuilder()
959
+ .addMany(_queryParams)
960
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
961
+ .build(),
962
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
963
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
964
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
965
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
966
+ logging: this._options.logging,
967
+ });
968
+ if (_response.ok) {
969
+ return {
970
+ data: _response.body,
971
+ rawResponse: _response.rawResponse,
972
+ };
973
+ }
974
+ if (_response.error.reason === "status-code") {
975
+ switch (_response.error.statusCode) {
976
+ case 403:
977
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
978
+ case 404:
979
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
980
+ case 422:
981
+ throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
982
+ case 500:
983
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
984
+ default:
985
+ throw new errors.PolytomicError({
986
+ statusCode: _response.error.statusCode,
987
+ body: _response.error.body,
988
+ rawResponse: _response.rawResponse,
989
+ });
990
+ }
991
+ }
992
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts/{context_id}/versions");
993
+ });
994
+ }
995
+ /**
996
+ * Returns one immutable published version of a Harbor context document.
997
+ *
998
+ * The response includes the complete title, description, and plain-text
999
+ * `content` captured when the version was published.
1000
+ *
1001
+ * Published versions cannot be changed or deleted. System publications have
1002
+ * `published_by_type: "system"` and a null `published_by`.
1003
+ *
1004
+ * @param {string} harbor_id - Unique identifier of the Harbor
1005
+ * @param {string} context_id - Unique identifier of the context document
1006
+ * @param {string} version_id - Unique identifier of the published context version
1007
+ * @param {Polytomic.harbors.ContextsGetVersionRequest} request
1008
+ * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
1009
+ *
1010
+ * @throws {@link Polytomic.ForbiddenError}
1011
+ * @throws {@link Polytomic.NotFoundError}
1012
+ * @throws {@link Polytomic.InternalServerError}
1013
+ * @throws {@link errors.PolytomicError}
1014
+ * @throws {@link errors.PolytomicTimeoutError}
1015
+ *
1016
+ * @example
1017
+ * await client.harbors.contexts.getVersion("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
1018
+ */
1019
+ getVersion(harbor_id, context_id, version_id, request = {}, requestOptions) {
1020
+ return core.HttpResponsePromise.fromPromise(this.__getVersion(harbor_id, context_id, version_id, request, requestOptions));
1021
+ }
1022
+ __getVersion(harbor_id_1, context_id_1, version_id_1) {
1023
+ return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, version_id, request = {}, requestOptions) {
1024
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1025
+ const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
1026
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1027
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
1028
+ "X-Polytomic-Harbor-Session": polytomicHarborSession,
1029
+ "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
1030
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
1031
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1032
+ const _response = yield core.fetcher({
1033
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/versions/${core.url.encodePathParam(version_id)}`),
1034
+ method: "GET",
1035
+ headers: _headers,
1036
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1037
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
1038
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
1039
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1040
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
1041
+ logging: this._options.logging,
1042
+ });
1043
+ if (_response.ok) {
1044
+ return {
1045
+ data: _response.body,
1046
+ rawResponse: _response.rawResponse,
1047
+ };
1048
+ }
1049
+ if (_response.error.reason === "status-code") {
1050
+ switch (_response.error.statusCode) {
1051
+ case 403:
1052
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
1053
+ case 404:
1054
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
1055
+ case 500:
1056
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
1057
+ default:
1058
+ throw new errors.PolytomicError({
1059
+ statusCode: _response.error.statusCode,
1060
+ body: _response.error.body,
1061
+ rawResponse: _response.rawResponse,
1062
+ });
1063
+ }
1064
+ }
1065
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts/{context_id}/versions/{version_id}");
1066
+ });
1067
+ }
1068
+ /**
1069
+ * Resolves documented source table and field identities to the names a Harbor's backing Connection accepts.
1070
+ *
1071
+ * @param {string} harbor_id - Unique identifier of the Harbor
1072
+ * @param {Polytomic.harbors.ResolveHarborSourceMappingsRequest} request
1073
+ * @param {ContextsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
1074
+ *
1075
+ * @throws {@link Polytomic.ForbiddenError}
1076
+ * @throws {@link Polytomic.NotFoundError}
1077
+ * @throws {@link Polytomic.UnprocessableEntityError}
1078
+ * @throws {@link Polytomic.InternalServerError}
1079
+ * @throws {@link errors.PolytomicError}
1080
+ * @throws {@link errors.PolytomicTimeoutError}
1081
+ *
1082
+ * @example
1083
+ * await client.harbors.contexts.resolveSourceMappings("248df4b7-aa70-47b8-a036-33ac447e668d", {
1084
+ * sources: [{
1085
+ * connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d"
1086
+ * }]
1087
+ * })
1088
+ */
1089
+ resolveSourceMappings(harbor_id, request = {}, requestOptions) {
1090
+ return core.HttpResponsePromise.fromPromise(this.__resolveSourceMappings(harbor_id, request, requestOptions));
1091
+ }
1092
+ __resolveSourceMappings(harbor_id_1) {
1093
+ return __awaiter(this, arguments, void 0, function* (harbor_id, request = {}, requestOptions) {
1094
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1095
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1096
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
1097
+ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
1098
+ "X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
1099
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1100
+ const _response = yield core.fetcher({
1101
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/source-mappings/resolve`),
1102
+ method: "POST",
1103
+ headers: _headers,
1104
+ contentType: "application/json",
1105
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1106
+ requestType: "json",
1107
+ body: (0, requestBody_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
1108
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
1109
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
1110
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1111
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
1112
+ logging: this._options.logging,
1113
+ });
1114
+ if (_response.ok) {
1115
+ return {
1116
+ data: _response.body,
1117
+ rawResponse: _response.rawResponse,
1118
+ };
1119
+ }
1120
+ if (_response.error.reason === "status-code") {
1121
+ switch (_response.error.statusCode) {
1122
+ case 403:
1123
+ throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
1124
+ case 404:
1125
+ throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
1126
+ case 422:
1127
+ throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
1128
+ case 500:
1129
+ throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
1130
+ default:
1131
+ throw new errors.PolytomicError({
1132
+ statusCode: _response.error.statusCode,
1133
+ body: _response.error.body,
1134
+ rawResponse: _response.rawResponse,
1135
+ });
1136
+ }
1137
+ }
1138
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/source-mappings/resolve");
1139
+ });
1140
+ }
1141
+ }
1142
+ exports.ContextsClient = ContextsClient;