@bfra.me/api-core 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (602) hide show
  1. package/package.json +6 -1
  2. package/CHANGELOG.md +0 -11
  3. package/dist/chunk-7NM3WYHE.js.map +0 -1
  4. package/dist/chunk-7QVYU63E.js.map +0 -1
  5. package/dist/chunk-HKKQOEV3.js.map +0 -1
  6. package/dist/errors/fetchError.js.map +0 -1
  7. package/dist/index.js.map +0 -1
  8. package/dist/lib/index.js.map +0 -1
  9. package/dist/types.js.map +0 -1
  10. package/eslint.config.ts +0 -25
  11. package/test-utils/CHANGELOG.md +0 -11
  12. package/test-utils/datasets/real-world-apis.json +0 -8507
  13. package/test-utils/datasets/refresh-dataset +0 -336
  14. package/test-utils/definitions/alby.json +0 -5391
  15. package/test-utils/definitions/auth-quirks.json +0 -62
  16. package/test-utils/definitions/basiq.json +0 -104
  17. package/test-utils/definitions/metrotransit.json +0 -318
  18. package/test-utils/definitions/nested-defaults.json +0 -107
  19. package/test-utils/definitions/operationid-quirks.json +0 -36
  20. package/test-utils/definitions/optional-payload.json +0 -57
  21. package/test-utils/definitions/payloads.json +0 -58
  22. package/test-utils/definitions/response-title-quirks.json +0 -77
  23. package/test-utils/definitions/simple.json +0 -291
  24. package/test-utils/fetch-mock.ts +0 -81
  25. package/test-utils/fixtures/hello.jp.txt +0 -1
  26. package/test-utils/fixtures/hello.txt +0 -1
  27. package/test-utils/fixtures/owlbert-shrub.png +0 -0
  28. package/test-utils/fixtures/owlbert.png +0 -0
  29. package/test-utils/index.ts +0 -2
  30. package/test-utils/load-spec.ts +0 -8
  31. package/test-utils/node_modules/.bin/tsc +0 -17
  32. package/test-utils/node_modules/.bin/tsserver +0 -17
  33. package/test-utils/package.json +0 -20
  34. package/test-utils/sdks/README.md +0 -3
  35. package/test-utils/sdks/alby/README.md +0 -23
  36. package/test-utils/sdks/alby/package.json +0 -55
  37. package/test-utils/sdks/alby/src/index.ts +0 -18
  38. package/test-utils/sdks/alby/src/schemas/AmqpExternalRulePatch.ts +0 -92
  39. package/test-utils/sdks/alby/src/schemas/AmqpExternalRulePost.ts +0 -93
  40. package/test-utils/sdks/alby/src/schemas/AmqpExternalRuleResponse.ts +0 -143
  41. package/test-utils/sdks/alby/src/schemas/AmqpRulePatch.ts +0 -76
  42. package/test-utils/sdks/alby/src/schemas/AmqpRulePost.ts +0 -85
  43. package/test-utils/sdks/alby/src/schemas/AmqpRuleResponse.ts +0 -124
  44. package/test-utils/sdks/alby/src/schemas/AppPatch.ts +0 -68
  45. package/test-utils/sdks/alby/src/schemas/AppPkcs12.ts +0 -22
  46. package/test-utils/sdks/alby/src/schemas/AppPost.ts +0 -71
  47. package/test-utils/sdks/alby/src/schemas/AppResponse.ts +0 -69
  48. package/test-utils/sdks/alby/src/schemas/AwsAccessKeys.ts +0 -28
  49. package/test-utils/sdks/alby/src/schemas/AwsAccessKeysResponse.ts +0 -20
  50. package/test-utils/sdks/alby/src/schemas/AwsAssumeRole.ts +0 -23
  51. package/test-utils/sdks/alby/src/schemas/AwsKinesisRulePatch.ts +0 -90
  52. package/test-utils/sdks/alby/src/schemas/AwsKinesisRulePost.ts +0 -103
  53. package/test-utils/sdks/alby/src/schemas/AwsKinesisRuleResponse.ts +0 -142
  54. package/test-utils/sdks/alby/src/schemas/AwsLambdaRulePatch.ts +0 -90
  55. package/test-utils/sdks/alby/src/schemas/AwsLambdaRulePost.ts +0 -90
  56. package/test-utils/sdks/alby/src/schemas/AwsLambdaRuleResponse.ts +0 -132
  57. package/test-utils/sdks/alby/src/schemas/AwsSqsRulePatch.ts +0 -86
  58. package/test-utils/sdks/alby/src/schemas/AwsSqsRulePost.ts +0 -98
  59. package/test-utils/sdks/alby/src/schemas/AwsSqsRuleResponse.ts +0 -137
  60. package/test-utils/sdks/alby/src/schemas/AzureFunctionRulePatch.ts +0 -96
  61. package/test-utils/sdks/alby/src/schemas/AzureFunctionRulePost.ts +0 -106
  62. package/test-utils/sdks/alby/src/schemas/AzureFunctionRuleResponse.ts +0 -145
  63. package/test-utils/sdks/alby/src/schemas/CloudflareWorkerRulePatch.ts +0 -74
  64. package/test-utils/sdks/alby/src/schemas/CloudflareWorkerRulePost.ts +0 -83
  65. package/test-utils/sdks/alby/src/schemas/CloudflareWorkerRuleResponse.ts +0 -125
  66. package/test-utils/sdks/alby/src/schemas/DeleteAppsAppIdNamespacesNamespaceId.ts +0 -26
  67. package/test-utils/sdks/alby/src/schemas/DeleteAppsAppIdQueuesQueueId.ts +0 -26
  68. package/test-utils/sdks/alby/src/schemas/DeleteAppsAppIdRulesRuleId.ts +0 -26
  69. package/test-utils/sdks/alby/src/schemas/DeleteAppsId.ts +0 -20
  70. package/test-utils/sdks/alby/src/schemas/Error.ts +0 -39
  71. package/test-utils/sdks/alby/src/schemas/GetAccountsAccountIdApps.ts +0 -29
  72. package/test-utils/sdks/alby/src/schemas/GetAppsAppIdKeys.ts +0 -29
  73. package/test-utils/sdks/alby/src/schemas/GetAppsAppIdNamespaces.ts +0 -29
  74. package/test-utils/sdks/alby/src/schemas/GetAppsAppIdQueues.ts +0 -29
  75. package/test-utils/sdks/alby/src/schemas/GetAppsAppIdRules.ts +0 -29
  76. package/test-utils/sdks/alby/src/schemas/GetAppsAppIdRulesRuleId.ts +0 -26
  77. package/test-utils/sdks/alby/src/schemas/GoogleCloudFunctionRulePatch.ts +0 -100
  78. package/test-utils/sdks/alby/src/schemas/GoogleCloudFunctionRulePost.ts +0 -100
  79. package/test-utils/sdks/alby/src/schemas/GoogleCloudFunctionRuleResponse.ts +0 -150
  80. package/test-utils/sdks/alby/src/schemas/HttpRulePatch.ts +0 -89
  81. package/test-utils/sdks/alby/src/schemas/HttpRulePost.ts +0 -100
  82. package/test-utils/sdks/alby/src/schemas/HttpRuleResponse.ts +0 -138
  83. package/test-utils/sdks/alby/src/schemas/IftttRulePatch.ts +0 -59
  84. package/test-utils/sdks/alby/src/schemas/IftttRulePost.ts +0 -62
  85. package/test-utils/sdks/alby/src/schemas/IftttRuleResponse.ts +0 -101
  86. package/test-utils/sdks/alby/src/schemas/KeyPatch.ts +0 -34
  87. package/test-utils/sdks/alby/src/schemas/KeyPost.ts +0 -39
  88. package/test-utils/sdks/alby/src/schemas/KeyResponse.ts +0 -63
  89. package/test-utils/sdks/alby/src/schemas/Me.ts +0 -98
  90. package/test-utils/sdks/alby/src/schemas/NamespacePatch.ts +0 -49
  91. package/test-utils/sdks/alby/src/schemas/NamespacePost.ts +0 -59
  92. package/test-utils/sdks/alby/src/schemas/NamespaceResponse.ts +0 -70
  93. package/test-utils/sdks/alby/src/schemas/PatchAppsAppIdKeysKeyId.ts +0 -26
  94. package/test-utils/sdks/alby/src/schemas/PatchAppsAppIdNamespacesNamespaceId.ts +0 -26
  95. package/test-utils/sdks/alby/src/schemas/PatchAppsAppIdRulesRuleId.ts +0 -26
  96. package/test-utils/sdks/alby/src/schemas/PatchAppsId.ts +0 -20
  97. package/test-utils/sdks/alby/src/schemas/PostAccountsAccountIdApps.ts +0 -20
  98. package/test-utils/sdks/alby/src/schemas/PostAppsAppIdKeys.ts +0 -20
  99. package/test-utils/sdks/alby/src/schemas/PostAppsAppIdKeysKeyIdRevoke.ts +0 -26
  100. package/test-utils/sdks/alby/src/schemas/PostAppsAppIdNamespaces.ts +0 -20
  101. package/test-utils/sdks/alby/src/schemas/PostAppsAppIdQueues.ts +0 -20
  102. package/test-utils/sdks/alby/src/schemas/PostAppsAppIdRules.ts +0 -20
  103. package/test-utils/sdks/alby/src/schemas/PostAppsIdPkcs12.ts +0 -20
  104. package/test-utils/sdks/alby/src/schemas/Queue.ts +0 -43
  105. package/test-utils/sdks/alby/src/schemas/QueueResponse.ts +0 -185
  106. package/test-utils/sdks/alby/src/schemas/RulePatch.ts +0 -46
  107. package/test-utils/sdks/alby/src/schemas/RulePost.ts +0 -49
  108. package/test-utils/sdks/alby/src/schemas/RuleResponse.ts +0 -46
  109. package/test-utils/sdks/alby/src/schemas/RuleSource.ts +0 -30
  110. package/test-utils/sdks/alby/src/schemas/UnsupportedRuleResponse.ts +0 -98
  111. package/test-utils/sdks/alby/src/schemas/ZapierRulePatch.ts +0 -74
  112. package/test-utils/sdks/alby/src/schemas/ZapierRulePost.ts +0 -83
  113. package/test-utils/sdks/alby/src/schemas/ZapierRuleResponse.ts +0 -122
  114. package/test-utils/sdks/alby/src/schemas.ts +0 -77
  115. package/test-utils/sdks/alby/src/sdk.ts +0 -381
  116. package/test-utils/sdks/alby/src/types.ts +0 -84
  117. package/test-utils/sdks/alby/tsconfig.json +0 -12
  118. package/test-utils/sdks/metrotransit/README.md +0 -22
  119. package/test-utils/sdks/metrotransit/package.json +0 -55
  120. package/test-utils/sdks/metrotransit/src/index.ts +0 -12
  121. package/test-utils/sdks/metrotransit/src/schemas/Agency.ts +0 -19
  122. package/test-utils/sdks/metrotransit/src/schemas/AlertMessage.ts +0 -18
  123. package/test-utils/sdks/metrotransit/src/schemas/Departure.ts +0 -78
  124. package/test-utils/sdks/metrotransit/src/schemas/Direction.ts +0 -19
  125. package/test-utils/sdks/metrotransit/src/schemas/GetNextripAgencies.ts +0 -12
  126. package/test-utils/sdks/metrotransit/src/schemas/GetNextripDirectionsRouteId.ts +0 -28
  127. package/test-utils/sdks/metrotransit/src/schemas/GetNextripRouteIdDirectionIdPlaceCode.ts +0 -30
  128. package/test-utils/sdks/metrotransit/src/schemas/GetNextripRoutes.ts +0 -12
  129. package/test-utils/sdks/metrotransit/src/schemas/GetNextripStopId.ts +0 -20
  130. package/test-utils/sdks/metrotransit/src/schemas/GetNextripStopsRouteIdDirectionId.ts +0 -34
  131. package/test-utils/sdks/metrotransit/src/schemas/GetNextripVehiclesRouteId.ts +0 -28
  132. package/test-utils/sdks/metrotransit/src/schemas/NexTripResult.ts +0 -34
  133. package/test-utils/sdks/metrotransit/src/schemas/Place.ts +0 -21
  134. package/test-utils/sdks/metrotransit/src/schemas/ProblemDetails.ts +0 -40
  135. package/test-utils/sdks/metrotransit/src/schemas/Route.ts +0 -25
  136. package/test-utils/sdks/metrotransit/src/schemas/Stop.ts +0 -27
  137. package/test-utils/sdks/metrotransit/src/schemas/Vehicle.ts +0 -61
  138. package/test-utils/sdks/metrotransit/src/schemas.ts +0 -18
  139. package/test-utils/sdks/metrotransit/src/sdk.ts +0 -107
  140. package/test-utils/sdks/metrotransit/src/types.ts +0 -23
  141. package/test-utils/sdks/metrotransit/tsconfig.json +0 -12
  142. package/test-utils/sdks/operationid-quirks/README.md +0 -22
  143. package/test-utils/sdks/operationid-quirks/package.json +0 -50
  144. package/test-utils/sdks/operationid-quirks/src/index.ts +0 -9
  145. package/test-utils/sdks/operationid-quirks/src/sdk.ts +0 -107
  146. package/test-utils/sdks/operationid-quirks/tsconfig.json +0 -12
  147. package/test-utils/sdks/optional-payload/README.md +0 -14
  148. package/test-utils/sdks/optional-payload/package.json +0 -55
  149. package/test-utils/sdks/optional-payload/src/index.ts +0 -9
  150. package/test-utils/sdks/optional-payload/src/schemas/UpdatePetWithForm.ts +0 -35
  151. package/test-utils/sdks/optional-payload/src/schemas.ts +0 -2
  152. package/test-utils/sdks/optional-payload/src/sdk.ts +0 -82
  153. package/test-utils/sdks/optional-payload/src/types.ts +0 -5
  154. package/test-utils/sdks/optional-payload/tsconfig.json +0 -12
  155. package/test-utils/sdks/petstore/LICENSE +0 -97
  156. package/test-utils/sdks/petstore/README.md +0 -23
  157. package/test-utils/sdks/petstore/package.json +0 -56
  158. package/test-utils/sdks/petstore/src/index.ts +0 -17
  159. package/test-utils/sdks/petstore/src/schemas/ApiResponse.ts +0 -18
  160. package/test-utils/sdks/petstore/src/schemas/Category.ts +0 -15
  161. package/test-utils/sdks/petstore/src/schemas/CreateUsersWithArrayInput.ts +0 -10
  162. package/test-utils/sdks/petstore/src/schemas/CreateUsersWithListInput.ts +0 -10
  163. package/test-utils/sdks/petstore/src/schemas/DeleteOrder.ts +0 -22
  164. package/test-utils/sdks/petstore/src/schemas/DeletePet.ts +0 -31
  165. package/test-utils/sdks/petstore/src/schemas/DeleteUser.ts +0 -20
  166. package/test-utils/sdks/petstore/src/schemas/FindPetsByStatus.ts +0 -38
  167. package/test-utils/sdks/petstore/src/schemas/FindPetsByTags.ts +0 -32
  168. package/test-utils/sdks/petstore/src/schemas/GetInventory.ts +0 -13
  169. package/test-utils/sdks/petstore/src/schemas/GetOrderById.ts +0 -23
  170. package/test-utils/sdks/petstore/src/schemas/GetPetById.ts +0 -21
  171. package/test-utils/sdks/petstore/src/schemas/GetUserByName.ts +0 -20
  172. package/test-utils/sdks/petstore/src/schemas/LoginUser.ts +0 -32
  173. package/test-utils/sdks/petstore/src/schemas/Order.ts +0 -37
  174. package/test-utils/sdks/petstore/src/schemas/Pet.ts +0 -53
  175. package/test-utils/sdks/petstore/src/schemas/Tag.ts +0 -15
  176. package/test-utils/sdks/petstore/src/schemas/UpdatePetWithForm.ts +0 -35
  177. package/test-utils/sdks/petstore/src/schemas/UpdateUser.ts +0 -20
  178. package/test-utils/sdks/petstore/src/schemas/UploadFile.ts +0 -36
  179. package/test-utils/sdks/petstore/src/schemas/User.ts +0 -35
  180. package/test-utils/sdks/petstore/src/schemas.ts +0 -22
  181. package/test-utils/sdks/petstore/src/sdk.ts +0 -248
  182. package/test-utils/sdks/petstore/src/types.ts +0 -29
  183. package/test-utils/sdks/petstore/tsconfig.json +0 -12
  184. package/test-utils/sdks/readme/README.md +0 -23
  185. package/test-utils/sdks/readme/package.json +0 -55
  186. package/test-utils/sdks/readme/src/index.ts +0 -13
  187. package/test-utils/sdks/readme/src/schemas/Apply.ts +0 -61
  188. package/test-utils/sdks/readme/src/schemas/Category.ts +0 -24
  189. package/test-utils/sdks/readme/src/schemas/Changelog.ts +0 -36
  190. package/test-utils/sdks/readme/src/schemas/CondensedProjectData.ts +0 -25
  191. package/test-utils/sdks/readme/src/schemas/CreateCategory.ts +0 -21
  192. package/test-utils/sdks/readme/src/schemas/CreateCustomPage.ts +0 -22
  193. package/test-utils/sdks/readme/src/schemas/CreateDoc.ts +0 -40
  194. package/test-utils/sdks/readme/src/schemas/CreateVersion.ts +0 -33
  195. package/test-utils/sdks/readme/src/schemas/CustomPage.ts +0 -33
  196. package/test-utils/sdks/readme/src/schemas/DeleteApiSpecification.ts +0 -39
  197. package/test-utils/sdks/readme/src/schemas/DeleteCategory.ts +0 -37
  198. package/test-utils/sdks/readme/src/schemas/DeleteChangelog.ts +0 -20
  199. package/test-utils/sdks/readme/src/schemas/DeleteCustomPage.ts +0 -39
  200. package/test-utils/sdks/readme/src/schemas/DeleteDoc.ts +0 -53
  201. package/test-utils/sdks/readme/src/schemas/DeleteVersion.ts +0 -42
  202. package/test-utils/sdks/readme/src/schemas/DocSchemaPost.ts +0 -135
  203. package/test-utils/sdks/readme/src/schemas/DocSchemaPut.ts +0 -62
  204. package/test-utils/sdks/readme/src/schemas/DocSchemaResponse.ts +0 -54
  205. package/test-utils/sdks/readme/src/schemas/ErrorApikeyEmpty.ts +0 -49
  206. package/test-utils/sdks/readme/src/schemas/ErrorApikeyMismatch.ts +0 -49
  207. package/test-utils/sdks/readme/src/schemas/ErrorApikeyNotfound.ts +0 -49
  208. package/test-utils/sdks/readme/src/schemas/ErrorCategoryInvalid.ts +0 -49
  209. package/test-utils/sdks/readme/src/schemas/ErrorCategoryNotfound.ts +0 -49
  210. package/test-utils/sdks/readme/src/schemas/ErrorCustompageInvalid.ts +0 -49
  211. package/test-utils/sdks/readme/src/schemas/ErrorCustompageNotfound.ts +0 -49
  212. package/test-utils/sdks/readme/src/schemas/ErrorDocInvalid.ts +0 -49
  213. package/test-utils/sdks/readme/src/schemas/ErrorDocNotfound.ts +0 -49
  214. package/test-utils/sdks/readme/src/schemas/ErrorRegistryNotfound.ts +0 -49
  215. package/test-utils/sdks/readme/src/schemas/ErrorSpecFileEmpty.ts +0 -49
  216. package/test-utils/sdks/readme/src/schemas/ErrorSpecIdDuplicate.ts +0 -49
  217. package/test-utils/sdks/readme/src/schemas/ErrorSpecIdInvalid.ts +0 -49
  218. package/test-utils/sdks/readme/src/schemas/ErrorSpecInvalid.ts +0 -49
  219. package/test-utils/sdks/readme/src/schemas/ErrorSpecInvalidSchema.ts +0 -49
  220. package/test-utils/sdks/readme/src/schemas/ErrorSpecNotfound.ts +0 -49
  221. package/test-utils/sdks/readme/src/schemas/ErrorSpecTimeout.ts +0 -49
  222. package/test-utils/sdks/readme/src/schemas/ErrorSpecVersionNotfound.ts +0 -49
  223. package/test-utils/sdks/readme/src/schemas/ErrorVersionCantDemoteStable.ts +0 -49
  224. package/test-utils/sdks/readme/src/schemas/ErrorVersionCantRemoveStable.ts +0 -49
  225. package/test-utils/sdks/readme/src/schemas/ErrorVersionDuplicate.ts +0 -49
  226. package/test-utils/sdks/readme/src/schemas/ErrorVersionEmpty.ts +0 -49
  227. package/test-utils/sdks/readme/src/schemas/ErrorVersionForkEmpty.ts +0 -49
  228. package/test-utils/sdks/readme/src/schemas/ErrorVersionForkNotfound.ts +0 -49
  229. package/test-utils/sdks/readme/src/schemas/ErrorVersionNotfound.ts +0 -49
  230. package/test-utils/sdks/readme/src/schemas/GetApiRegistry.ts +0 -27
  231. package/test-utils/sdks/readme/src/schemas/GetApiSchema.ts +0 -10
  232. package/test-utils/sdks/readme/src/schemas/GetApiSpecification.ts +0 -74
  233. package/test-utils/sdks/readme/src/schemas/GetCategories.ts +0 -57
  234. package/test-utils/sdks/readme/src/schemas/GetCategory.ts +0 -37
  235. package/test-utils/sdks/readme/src/schemas/GetCategoryDocs.ts +0 -37
  236. package/test-utils/sdks/readme/src/schemas/GetChangelog.ts +0 -20
  237. package/test-utils/sdks/readme/src/schemas/GetChangelogs.ts +0 -43
  238. package/test-utils/sdks/readme/src/schemas/GetCustomPage.ts +0 -39
  239. package/test-utils/sdks/readme/src/schemas/GetCustomPages.ts +0 -60
  240. package/test-utils/sdks/readme/src/schemas/GetDoc.ts +0 -53
  241. package/test-utils/sdks/readme/src/schemas/GetOpenRoles.ts +0 -12
  242. package/test-utils/sdks/readme/src/schemas/GetProductionDoc.ts +0 -53
  243. package/test-utils/sdks/readme/src/schemas/GetProject.ts +0 -22
  244. package/test-utils/sdks/readme/src/schemas/GetVersion.ts +0 -42
  245. package/test-utils/sdks/readme/src/schemas/GetVersions.ts +0 -22
  246. package/test-utils/sdks/readme/src/schemas/JobOpening.ts +0 -52
  247. package/test-utils/sdks/readme/src/schemas/SearchDocs.ts +0 -53
  248. package/test-utils/sdks/readme/src/schemas/UpdateApiSpecification.ts +0 -67
  249. package/test-utils/sdks/readme/src/schemas/UpdateCategory.ts +0 -37
  250. package/test-utils/sdks/readme/src/schemas/UpdateChangelog.ts +0 -20
  251. package/test-utils/sdks/readme/src/schemas/UpdateCustomPage.ts +0 -39
  252. package/test-utils/sdks/readme/src/schemas/UpdateDoc.ts +0 -53
  253. package/test-utils/sdks/readme/src/schemas/UpdateVersion.ts +0 -42
  254. package/test-utils/sdks/readme/src/schemas/UploadApiSpecification.ts +0 -64
  255. package/test-utils/sdks/readme/src/schemas/Version.ts +0 -40
  256. package/test-utils/sdks/readme/src/schemas.ts +0 -70
  257. package/test-utils/sdks/readme/src/sdk.ts +0 -477
  258. package/test-utils/sdks/readme/src/types.ts +0 -120
  259. package/test-utils/sdks/readme/tsconfig.json +0 -12
  260. package/test-utils/sdks/response-title-quirks/README.md +0 -14
  261. package/test-utils/sdks/response-title-quirks/package.json +0 -55
  262. package/test-utils/sdks/response-title-quirks/src/index.ts +0 -9
  263. package/test-utils/sdks/response-title-quirks/src/schemas/GetAnything.ts +0 -60
  264. package/test-utils/sdks/response-title-quirks/src/schemas.ts +0 -2
  265. package/test-utils/sdks/response-title-quirks/src/sdk.ts +0 -76
  266. package/test-utils/sdks/response-title-quirks/src/types.ts +0 -5
  267. package/test-utils/sdks/response-title-quirks/tsconfig.json +0 -12
  268. package/test-utils/sdks/simple/README.md +0 -14
  269. package/test-utils/sdks/simple/package.json +0 -55
  270. package/test-utils/sdks/simple/src/index.ts +0 -10
  271. package/test-utils/sdks/simple/src/schemas/Category.ts +0 -15
  272. package/test-utils/sdks/simple/src/schemas/FindPetsByStatus.ts +0 -38
  273. package/test-utils/sdks/simple/src/schemas/Pet.ts +0 -53
  274. package/test-utils/sdks/simple/src/schemas/Tag.ts +0 -15
  275. package/test-utils/sdks/simple/src/schemas.ts +0 -5
  276. package/test-utils/sdks/simple/src/sdk.ts +0 -81
  277. package/test-utils/sdks/simple/src/types.ts +0 -8
  278. package/test-utils/sdks/simple/tsconfig.json +0 -12
  279. package/test-utils/sdks/star-trek/README.md +0 -22
  280. package/test-utils/sdks/star-trek/package.json +0 -55
  281. package/test-utils/sdks/star-trek/src/index.ts +0 -9
  282. package/test-utils/sdks/star-trek/src/schemas/AnimalBase.ts +0 -41
  283. package/test-utils/sdks/star-trek/src/schemas/AnimalBaseResponse.ts +0 -20
  284. package/test-utils/sdks/star-trek/src/schemas/AnimalFull.ts +0 -41
  285. package/test-utils/sdks/star-trek/src/schemas/AnimalFullResponse.ts +0 -12
  286. package/test-utils/sdks/star-trek/src/schemas/AstronomicalObjectBase.ts +0 -27
  287. package/test-utils/sdks/star-trek/src/schemas/AstronomicalObjectBaseResponse.ts +0 -20
  288. package/test-utils/sdks/star-trek/src/schemas/AstronomicalObjectFull.ts +0 -32
  289. package/test-utils/sdks/star-trek/src/schemas/AstronomicalObjectFullResponse.ts +0 -12
  290. package/test-utils/sdks/star-trek/src/schemas/AstronomicalObjectHeader.ts +0 -21
  291. package/test-utils/sdks/star-trek/src/schemas/AstronomicalObjectType.ts +0 -36
  292. package/test-utils/sdks/star-trek/src/schemas/BloodType.ts +0 -12
  293. package/test-utils/sdks/star-trek/src/schemas/BookBase.ts +0 -120
  294. package/test-utils/sdks/star-trek/src/schemas/BookBaseResponse.ts +0 -20
  295. package/test-utils/sdks/star-trek/src/schemas/BookCollectionBase.ts +0 -51
  296. package/test-utils/sdks/star-trek/src/schemas/BookCollectionBaseResponse.ts +0 -20
  297. package/test-utils/sdks/star-trek/src/schemas/BookCollectionFull.ts +0 -98
  298. package/test-utils/sdks/star-trek/src/schemas/BookCollectionFullResponse.ts +0 -12
  299. package/test-utils/sdks/star-trek/src/schemas/BookFull.ts +0 -182
  300. package/test-utils/sdks/star-trek/src/schemas/BookFullResponse.ts +0 -12
  301. package/test-utils/sdks/star-trek/src/schemas/BookSeriesBase.ts +0 -57
  302. package/test-utils/sdks/star-trek/src/schemas/BookSeriesBaseResponse.ts +0 -20
  303. package/test-utils/sdks/star-trek/src/schemas/BookSeriesFull.ts +0 -81
  304. package/test-utils/sdks/star-trek/src/schemas/BookSeriesFullResponse.ts +0 -12
  305. package/test-utils/sdks/star-trek/src/schemas/CharacterBase.ts +0 -104
  306. package/test-utils/sdks/star-trek/src/schemas/CharacterBaseResponse.ts +0 -20
  307. package/test-utils/sdks/star-trek/src/schemas/CharacterFull.ts +0 -152
  308. package/test-utils/sdks/star-trek/src/schemas/CharacterFullResponse.ts +0 -12
  309. package/test-utils/sdks/star-trek/src/schemas/CharacterHeader.ts +0 -21
  310. package/test-utils/sdks/star-trek/src/schemas/CharacterRelation.ts +0 -17
  311. package/test-utils/sdks/star-trek/src/schemas/CharacterSpecies.ts +0 -25
  312. package/test-utils/sdks/star-trek/src/schemas/ComicCollectionBase.ts +0 -71
  313. package/test-utils/sdks/star-trek/src/schemas/ComicCollectionBaseResponse.ts +0 -20
  314. package/test-utils/sdks/star-trek/src/schemas/ComicCollectionFull.ts +0 -123
  315. package/test-utils/sdks/star-trek/src/schemas/ComicCollectionFullResponse.ts +0 -12
  316. package/test-utils/sdks/star-trek/src/schemas/ComicSeriesBase.ts +0 -75
  317. package/test-utils/sdks/star-trek/src/schemas/ComicSeriesBaseResponse.ts +0 -20
  318. package/test-utils/sdks/star-trek/src/schemas/ComicSeriesFull.ts +0 -99
  319. package/test-utils/sdks/star-trek/src/schemas/ComicSeriesFullResponse.ts +0 -12
  320. package/test-utils/sdks/star-trek/src/schemas/ComicStripBase.ts +0 -61
  321. package/test-utils/sdks/star-trek/src/schemas/ComicStripBaseResponse.ts +0 -20
  322. package/test-utils/sdks/star-trek/src/schemas/ComicStripFull.ts +0 -85
  323. package/test-utils/sdks/star-trek/src/schemas/ComicStripFullResponse.ts +0 -12
  324. package/test-utils/sdks/star-trek/src/schemas/ComicsBase.ts +0 -75
  325. package/test-utils/sdks/star-trek/src/schemas/ComicsBaseResponse.ts +0 -20
  326. package/test-utils/sdks/star-trek/src/schemas/ComicsFull.ts +0 -127
  327. package/test-utils/sdks/star-trek/src/schemas/ComicsFullResponse.ts +0 -12
  328. package/test-utils/sdks/star-trek/src/schemas/CompanyBase.ts +0 -89
  329. package/test-utils/sdks/star-trek/src/schemas/CompanyBaseResponse.ts +0 -20
  330. package/test-utils/sdks/star-trek/src/schemas/CompanyFull.ts +0 -89
  331. package/test-utils/sdks/star-trek/src/schemas/CompanyFullResponse.ts +0 -12
  332. package/test-utils/sdks/star-trek/src/schemas/CompanyHeader.ts +0 -21
  333. package/test-utils/sdks/star-trek/src/schemas/ConflictBase.ts +0 -49
  334. package/test-utils/sdks/star-trek/src/schemas/ConflictBaseResponse.ts +0 -20
  335. package/test-utils/sdks/star-trek/src/schemas/ConflictFull.ts +0 -78
  336. package/test-utils/sdks/star-trek/src/schemas/ConflictFullResponse.ts +0 -12
  337. package/test-utils/sdks/star-trek/src/schemas/ContentLanguage.ts +0 -21
  338. package/test-utils/sdks/star-trek/src/schemas/ContentRating.ts +0 -20
  339. package/test-utils/sdks/star-trek/src/schemas/ContentRatingSystem.ts +0 -35
  340. package/test-utils/sdks/star-trek/src/schemas/Country.ts +0 -21
  341. package/test-utils/sdks/star-trek/src/schemas/ElementBase.ts +0 -61
  342. package/test-utils/sdks/star-trek/src/schemas/ElementBaseResponse.ts +0 -20
  343. package/test-utils/sdks/star-trek/src/schemas/ElementFull.ts +0 -61
  344. package/test-utils/sdks/star-trek/src/schemas/ElementFullResponse.ts +0 -12
  345. package/test-utils/sdks/star-trek/src/schemas/EpisodeBase.ts +0 -82
  346. package/test-utils/sdks/star-trek/src/schemas/EpisodeBaseResponse.ts +0 -20
  347. package/test-utils/sdks/star-trek/src/schemas/EpisodeFull.ts +0 -125
  348. package/test-utils/sdks/star-trek/src/schemas/EpisodeFullResponse.ts +0 -12
  349. package/test-utils/sdks/star-trek/src/schemas/Error.ts +0 -17
  350. package/test-utils/sdks/star-trek/src/schemas/FoodBase.ts +0 -61
  351. package/test-utils/sdks/star-trek/src/schemas/FoodBaseResponse.ts +0 -20
  352. package/test-utils/sdks/star-trek/src/schemas/FoodFull.ts +0 -61
  353. package/test-utils/sdks/star-trek/src/schemas/FoodFullResponse.ts +0 -12
  354. package/test-utils/sdks/star-trek/src/schemas/Gender.ts +0 -11
  355. package/test-utils/sdks/star-trek/src/schemas/Genre.ts +0 -17
  356. package/test-utils/sdks/star-trek/src/schemas/GetAnimal.ts +0 -25
  357. package/test-utils/sdks/star-trek/src/schemas/GetAnimalSearch.ts +0 -30
  358. package/test-utils/sdks/star-trek/src/schemas/GetAstronomicalobject.ts +0 -25
  359. package/test-utils/sdks/star-trek/src/schemas/GetAstronomicalobjectSearch.ts +0 -30
  360. package/test-utils/sdks/star-trek/src/schemas/GetBook.ts +0 -25
  361. package/test-utils/sdks/star-trek/src/schemas/GetBookSearch.ts +0 -30
  362. package/test-utils/sdks/star-trek/src/schemas/GetBookcollection.ts +0 -25
  363. package/test-utils/sdks/star-trek/src/schemas/GetBookcollectionSearch.ts +0 -30
  364. package/test-utils/sdks/star-trek/src/schemas/GetBookseries.ts +0 -25
  365. package/test-utils/sdks/star-trek/src/schemas/GetBookseriesSearch.ts +0 -30
  366. package/test-utils/sdks/star-trek/src/schemas/GetCharacter.ts +0 -25
  367. package/test-utils/sdks/star-trek/src/schemas/GetCharacterSearch.ts +0 -30
  368. package/test-utils/sdks/star-trek/src/schemas/GetComiccollection.ts +0 -25
  369. package/test-utils/sdks/star-trek/src/schemas/GetComiccollectionSearch.ts +0 -30
  370. package/test-utils/sdks/star-trek/src/schemas/GetComics.ts +0 -25
  371. package/test-utils/sdks/star-trek/src/schemas/GetComicsSearch.ts +0 -30
  372. package/test-utils/sdks/star-trek/src/schemas/GetComicseries.ts +0 -25
  373. package/test-utils/sdks/star-trek/src/schemas/GetComicseriesSearch.ts +0 -30
  374. package/test-utils/sdks/star-trek/src/schemas/GetComicstrip.ts +0 -25
  375. package/test-utils/sdks/star-trek/src/schemas/GetComicstripSearch.ts +0 -30
  376. package/test-utils/sdks/star-trek/src/schemas/GetCompany.ts +0 -25
  377. package/test-utils/sdks/star-trek/src/schemas/GetCompanySearch.ts +0 -30
  378. package/test-utils/sdks/star-trek/src/schemas/GetConflict.ts +0 -25
  379. package/test-utils/sdks/star-trek/src/schemas/GetConflictSearch.ts +0 -30
  380. package/test-utils/sdks/star-trek/src/schemas/GetElement.ts +0 -25
  381. package/test-utils/sdks/star-trek/src/schemas/GetElementSearch.ts +0 -30
  382. package/test-utils/sdks/star-trek/src/schemas/GetEpisode.ts +0 -25
  383. package/test-utils/sdks/star-trek/src/schemas/GetEpisodeSearch.ts +0 -30
  384. package/test-utils/sdks/star-trek/src/schemas/GetFood.ts +0 -25
  385. package/test-utils/sdks/star-trek/src/schemas/GetFoodSearch.ts +0 -30
  386. package/test-utils/sdks/star-trek/src/schemas/GetLiterature.ts +0 -25
  387. package/test-utils/sdks/star-trek/src/schemas/GetLiteratureSearch.ts +0 -30
  388. package/test-utils/sdks/star-trek/src/schemas/GetLocation.ts +0 -25
  389. package/test-utils/sdks/star-trek/src/schemas/GetLocationSearch.ts +0 -30
  390. package/test-utils/sdks/star-trek/src/schemas/GetMagazine.ts +0 -25
  391. package/test-utils/sdks/star-trek/src/schemas/GetMagazineSearch.ts +0 -30
  392. package/test-utils/sdks/star-trek/src/schemas/GetMagazineseries.ts +0 -25
  393. package/test-utils/sdks/star-trek/src/schemas/GetMagazineseriesSearch.ts +0 -30
  394. package/test-utils/sdks/star-trek/src/schemas/GetMaterial.ts +0 -25
  395. package/test-utils/sdks/star-trek/src/schemas/GetMaterialSearch.ts +0 -30
  396. package/test-utils/sdks/star-trek/src/schemas/GetMedicalcondition.ts +0 -25
  397. package/test-utils/sdks/star-trek/src/schemas/GetMedicalconditionSearch.ts +0 -30
  398. package/test-utils/sdks/star-trek/src/schemas/GetMovie.ts +0 -25
  399. package/test-utils/sdks/star-trek/src/schemas/GetMovieSearch.ts +0 -30
  400. package/test-utils/sdks/star-trek/src/schemas/GetOccupation.ts +0 -25
  401. package/test-utils/sdks/star-trek/src/schemas/GetOccupationSearch.ts +0 -30
  402. package/test-utils/sdks/star-trek/src/schemas/GetOrganization.ts +0 -25
  403. package/test-utils/sdks/star-trek/src/schemas/GetOrganizationSearch.ts +0 -30
  404. package/test-utils/sdks/star-trek/src/schemas/GetPerformer.ts +0 -25
  405. package/test-utils/sdks/star-trek/src/schemas/GetPerformerSearch.ts +0 -30
  406. package/test-utils/sdks/star-trek/src/schemas/GetSeason.ts +0 -25
  407. package/test-utils/sdks/star-trek/src/schemas/GetSeasonSearch.ts +0 -30
  408. package/test-utils/sdks/star-trek/src/schemas/GetSeries.ts +0 -25
  409. package/test-utils/sdks/star-trek/src/schemas/GetSeriesSearch.ts +0 -30
  410. package/test-utils/sdks/star-trek/src/schemas/GetSoundtrack.ts +0 -25
  411. package/test-utils/sdks/star-trek/src/schemas/GetSoundtrackSearch.ts +0 -30
  412. package/test-utils/sdks/star-trek/src/schemas/GetSpacecraft.ts +0 -25
  413. package/test-utils/sdks/star-trek/src/schemas/GetSpacecraftSearch.ts +0 -30
  414. package/test-utils/sdks/star-trek/src/schemas/GetSpacecraftclass.ts +0 -25
  415. package/test-utils/sdks/star-trek/src/schemas/GetSpacecraftclassSearch.ts +0 -30
  416. package/test-utils/sdks/star-trek/src/schemas/GetSpecies.ts +0 -25
  417. package/test-utils/sdks/star-trek/src/schemas/GetSpeciesSearch.ts +0 -30
  418. package/test-utils/sdks/star-trek/src/schemas/GetStaff.ts +0 -25
  419. package/test-utils/sdks/star-trek/src/schemas/GetStaffSearch.ts +0 -30
  420. package/test-utils/sdks/star-trek/src/schemas/GetTechnology.ts +0 -25
  421. package/test-utils/sdks/star-trek/src/schemas/GetTechnologySearch.ts +0 -30
  422. package/test-utils/sdks/star-trek/src/schemas/GetTitle.ts +0 -25
  423. package/test-utils/sdks/star-trek/src/schemas/GetTitleSearch.ts +0 -30
  424. package/test-utils/sdks/star-trek/src/schemas/GetTradingcard.ts +0 -25
  425. package/test-utils/sdks/star-trek/src/schemas/GetTradingcardSearch.ts +0 -30
  426. package/test-utils/sdks/star-trek/src/schemas/GetTradingcarddeck.ts +0 -25
  427. package/test-utils/sdks/star-trek/src/schemas/GetTradingcarddeckSearch.ts +0 -30
  428. package/test-utils/sdks/star-trek/src/schemas/GetTradingcardset.ts +0 -25
  429. package/test-utils/sdks/star-trek/src/schemas/GetTradingcardsetSearch.ts +0 -30
  430. package/test-utils/sdks/star-trek/src/schemas/GetVideogame.ts +0 -25
  431. package/test-utils/sdks/star-trek/src/schemas/GetVideogameSearch.ts +0 -30
  432. package/test-utils/sdks/star-trek/src/schemas/GetVideorelease.ts +0 -25
  433. package/test-utils/sdks/star-trek/src/schemas/GetVideoreleaseSearch.ts +0 -30
  434. package/test-utils/sdks/star-trek/src/schemas/GetWeapon.ts +0 -25
  435. package/test-utils/sdks/star-trek/src/schemas/GetWeaponSearch.ts +0 -30
  436. package/test-utils/sdks/star-trek/src/schemas/LiteratureBase.ts +0 -45
  437. package/test-utils/sdks/star-trek/src/schemas/LiteratureBaseResponse.ts +0 -20
  438. package/test-utils/sdks/star-trek/src/schemas/LiteratureFull.ts +0 -45
  439. package/test-utils/sdks/star-trek/src/schemas/LiteratureFullResponse.ts +0 -12
  440. package/test-utils/sdks/star-trek/src/schemas/LocationBase.ts +0 -113
  441. package/test-utils/sdks/star-trek/src/schemas/LocationBaseResponse.ts +0 -20
  442. package/test-utils/sdks/star-trek/src/schemas/LocationFull.ts +0 -113
  443. package/test-utils/sdks/star-trek/src/schemas/LocationFullResponse.ts +0 -12
  444. package/test-utils/sdks/star-trek/src/schemas/MagazineBase.ts +0 -53
  445. package/test-utils/sdks/star-trek/src/schemas/MagazineBaseResponse.ts +0 -20
  446. package/test-utils/sdks/star-trek/src/schemas/MagazineFull.ts +0 -72
  447. package/test-utils/sdks/star-trek/src/schemas/MagazineFullResponse.ts +0 -12
  448. package/test-utils/sdks/star-trek/src/schemas/MagazineSeriesBase.ts +0 -41
  449. package/test-utils/sdks/star-trek/src/schemas/MagazineSeriesBaseResponse.ts +0 -20
  450. package/test-utils/sdks/star-trek/src/schemas/MagazineSeriesFull.ts +0 -60
  451. package/test-utils/sdks/star-trek/src/schemas/MagazineSeriesFullResponse.ts +0 -12
  452. package/test-utils/sdks/star-trek/src/schemas/MaritalStatus.ts +0 -17
  453. package/test-utils/sdks/star-trek/src/schemas/MaterialBase.ts +0 -61
  454. package/test-utils/sdks/star-trek/src/schemas/MaterialBaseResponse.ts +0 -20
  455. package/test-utils/sdks/star-trek/src/schemas/MaterialFull.ts +0 -61
  456. package/test-utils/sdks/star-trek/src/schemas/MaterialFullResponse.ts +0 -12
  457. package/test-utils/sdks/star-trek/src/schemas/MedicalConditionBase.ts +0 -25
  458. package/test-utils/sdks/star-trek/src/schemas/MedicalConditionBaseResponse.ts +0 -20
  459. package/test-utils/sdks/star-trek/src/schemas/MedicalConditionFull.ts +0 -25
  460. package/test-utils/sdks/star-trek/src/schemas/MedicalConditionFullResponse.ts +0 -12
  461. package/test-utils/sdks/star-trek/src/schemas/MovieBase.ts +0 -87
  462. package/test-utils/sdks/star-trek/src/schemas/MovieBaseResponse.ts +0 -20
  463. package/test-utils/sdks/star-trek/src/schemas/MovieFull.ts +0 -139
  464. package/test-utils/sdks/star-trek/src/schemas/MovieFullResponse.ts +0 -12
  465. package/test-utils/sdks/star-trek/src/schemas/OccupationBase.ts +0 -33
  466. package/test-utils/sdks/star-trek/src/schemas/OccupationBaseResponse.ts +0 -20
  467. package/test-utils/sdks/star-trek/src/schemas/OccupationFull.ts +0 -40
  468. package/test-utils/sdks/star-trek/src/schemas/OccupationFullResponse.ts +0 -12
  469. package/test-utils/sdks/star-trek/src/schemas/OrganizationBase.ts +0 -69
  470. package/test-utils/sdks/star-trek/src/schemas/OrganizationBaseResponse.ts +0 -20
  471. package/test-utils/sdks/star-trek/src/schemas/OrganizationFull.ts +0 -76
  472. package/test-utils/sdks/star-trek/src/schemas/OrganizationFullResponse.ts +0 -12
  473. package/test-utils/sdks/star-trek/src/schemas/OrganizationHeader.ts +0 -21
  474. package/test-utils/sdks/star-trek/src/schemas/PerformerBase.ts +0 -98
  475. package/test-utils/sdks/star-trek/src/schemas/PerformerBaseResponse.ts +0 -20
  476. package/test-utils/sdks/star-trek/src/schemas/PerformerFull.ts +0 -136
  477. package/test-utils/sdks/star-trek/src/schemas/PerformerFullResponse.ts +0 -12
  478. package/test-utils/sdks/star-trek/src/schemas/Platform.ts +0 -17
  479. package/test-utils/sdks/star-trek/src/schemas/PostAnimalSearch.ts +0 -65
  480. package/test-utils/sdks/star-trek/src/schemas/PostAstronomicalobjectSearch.ts +0 -53
  481. package/test-utils/sdks/star-trek/src/schemas/PostBookSearch.ts +0 -141
  482. package/test-utils/sdks/star-trek/src/schemas/PostBookcollectionSearch.ts +0 -85
  483. package/test-utils/sdks/star-trek/src/schemas/PostBookseriesSearch.ts +0 -83
  484. package/test-utils/sdks/star-trek/src/schemas/PostCharacterSearch.ts +0 -69
  485. package/test-utils/sdks/star-trek/src/schemas/PostComiccollectionSearch.ts +0 -89
  486. package/test-utils/sdks/star-trek/src/schemas/PostComicsSearch.ts +0 -93
  487. package/test-utils/sdks/star-trek/src/schemas/PostComicseriesSearch.ts +0 -93
  488. package/test-utils/sdks/star-trek/src/schemas/PostComicstripSearch.ts +0 -75
  489. package/test-utils/sdks/star-trek/src/schemas/PostCompanySearch.ts +0 -113
  490. package/test-utils/sdks/star-trek/src/schemas/PostConflictSearch.ts +0 -75
  491. package/test-utils/sdks/star-trek/src/schemas/PostElementSearch.ts +0 -77
  492. package/test-utils/sdks/star-trek/src/schemas/PostEpisodeSearch.ts +0 -113
  493. package/test-utils/sdks/star-trek/src/schemas/PostFoodSearch.ts +0 -85
  494. package/test-utils/sdks/star-trek/src/schemas/PostLiteratureSearch.ts +0 -69
  495. package/test-utils/sdks/star-trek/src/schemas/PostLocationSearch.ts +0 -137
  496. package/test-utils/sdks/star-trek/src/schemas/PostMagazineSearch.ts +0 -65
  497. package/test-utils/sdks/star-trek/src/schemas/PostMagazineseriesSearch.ts +0 -65
  498. package/test-utils/sdks/star-trek/src/schemas/PostMaterialSearch.ts +0 -85
  499. package/test-utils/sdks/star-trek/src/schemas/PostMedicalconditionSearch.ts +0 -49
  500. package/test-utils/sdks/star-trek/src/schemas/PostMovieSearch.ts +0 -75
  501. package/test-utils/sdks/star-trek/src/schemas/PostOccupationSearch.ts +0 -57
  502. package/test-utils/sdks/star-trek/src/schemas/PostOrganizationSearch.ts +0 -93
  503. package/test-utils/sdks/star-trek/src/schemas/PostPerformerSearch.ts +0 -133
  504. package/test-utils/sdks/star-trek/src/schemas/PostSeasonSearch.ts +0 -65
  505. package/test-utils/sdks/star-trek/src/schemas/PostSeriesSearch.ts +0 -89
  506. package/test-utils/sdks/star-trek/src/schemas/PostSoundtrackSearch.ts +0 -65
  507. package/test-utils/sdks/star-trek/src/schemas/PostSpacecraftSearch.ts +0 -45
  508. package/test-utils/sdks/star-trek/src/schemas/PostSpacecraftclassSearch.ts +0 -53
  509. package/test-utils/sdks/star-trek/src/schemas/PostSpeciesSearch.ts +0 -93
  510. package/test-utils/sdks/star-trek/src/schemas/PostStaffSearch.ts +0 -301
  511. package/test-utils/sdks/star-trek/src/schemas/PostTechnologySearch.ts +0 -125
  512. package/test-utils/sdks/star-trek/src/schemas/PostTitleSearch.ts +0 -65
  513. package/test-utils/sdks/star-trek/src/schemas/PostTradingcardSearch.ts +0 -53
  514. package/test-utils/sdks/star-trek/src/schemas/PostTradingcarddeckSearch.ts +0 -49
  515. package/test-utils/sdks/star-trek/src/schemas/PostTradingcardsetSearch.ts +0 -119
  516. package/test-utils/sdks/star-trek/src/schemas/PostVideogameSearch.ts +0 -55
  517. package/test-utils/sdks/star-trek/src/schemas/PostVideoreleaseSearch.ts +0 -65
  518. package/test-utils/sdks/star-trek/src/schemas/PostWeaponSearch.ts +0 -73
  519. package/test-utils/sdks/star-trek/src/schemas/ProductionRunUnit.ts +0 -11
  520. package/test-utils/sdks/star-trek/src/schemas/Reference.ts +0 -20
  521. package/test-utils/sdks/star-trek/src/schemas/ReferenceType.ts +0 -11
  522. package/test-utils/sdks/star-trek/src/schemas/ResponsePage.ts +0 -42
  523. package/test-utils/sdks/star-trek/src/schemas/ResponseSort.ts +0 -16
  524. package/test-utils/sdks/star-trek/src/schemas/ResponseSortClause.ts +0 -25
  525. package/test-utils/sdks/star-trek/src/schemas/ResponseSortDirection.ts +0 -11
  526. package/test-utils/sdks/star-trek/src/schemas/SeasonBase.ts +0 -32
  527. package/test-utils/sdks/star-trek/src/schemas/SeasonBaseResponse.ts +0 -20
  528. package/test-utils/sdks/star-trek/src/schemas/SeasonFull.ts +0 -38
  529. package/test-utils/sdks/star-trek/src/schemas/SeasonFullResponse.ts +0 -12
  530. package/test-utils/sdks/star-trek/src/schemas/SeasonHeader.ts +0 -21
  531. package/test-utils/sdks/star-trek/src/schemas/SeriesBase.ts +0 -60
  532. package/test-utils/sdks/star-trek/src/schemas/SeriesBaseResponse.ts +0 -20
  533. package/test-utils/sdks/star-trek/src/schemas/SeriesFull.ts +0 -72
  534. package/test-utils/sdks/star-trek/src/schemas/SeriesFullResponse.ts +0 -12
  535. package/test-utils/sdks/star-trek/src/schemas/SeriesHeader.ts +0 -21
  536. package/test-utils/sdks/star-trek/src/schemas/SoundtrackBase.ts +0 -30
  537. package/test-utils/sdks/star-trek/src/schemas/SoundtrackBaseResponse.ts +0 -20
  538. package/test-utils/sdks/star-trek/src/schemas/SoundtrackFull.ts +0 -59
  539. package/test-utils/sdks/star-trek/src/schemas/SoundtrackFullResponse.ts +0 -12
  540. package/test-utils/sdks/star-trek/src/schemas/SpacecraftBase.ts +0 -39
  541. package/test-utils/sdks/star-trek/src/schemas/SpacecraftBaseResponse.ts +0 -20
  542. package/test-utils/sdks/star-trek/src/schemas/SpacecraftClassBase.ts +0 -48
  543. package/test-utils/sdks/star-trek/src/schemas/SpacecraftClassBaseResponse.ts +0 -20
  544. package/test-utils/sdks/star-trek/src/schemas/SpacecraftClassFull.ts +0 -60
  545. package/test-utils/sdks/star-trek/src/schemas/SpacecraftClassFullResponse.ts +0 -12
  546. package/test-utils/sdks/star-trek/src/schemas/SpacecraftClassHeader.ts +0 -21
  547. package/test-utils/sdks/star-trek/src/schemas/SpacecraftFull.ts +0 -45
  548. package/test-utils/sdks/star-trek/src/schemas/SpacecraftFullResponse.ts +0 -12
  549. package/test-utils/sdks/star-trek/src/schemas/SpacecraftType.ts +0 -17
  550. package/test-utils/sdks/star-trek/src/schemas/SpeciesBase.ts +0 -73
  551. package/test-utils/sdks/star-trek/src/schemas/SpeciesBaseResponse.ts +0 -20
  552. package/test-utils/sdks/star-trek/src/schemas/SpeciesFull.ts +0 -79
  553. package/test-utils/sdks/star-trek/src/schemas/SpeciesFullResponse.ts +0 -12
  554. package/test-utils/sdks/star-trek/src/schemas/SpeciesHeader.ts +0 -21
  555. package/test-utils/sdks/star-trek/src/schemas/StaffBase.ts +0 -266
  556. package/test-utils/sdks/star-trek/src/schemas/StaffBaseResponse.ts +0 -20
  557. package/test-utils/sdks/star-trek/src/schemas/StaffFull.ts +0 -323
  558. package/test-utils/sdks/star-trek/src/schemas/StaffFullResponse.ts +0 -12
  559. package/test-utils/sdks/star-trek/src/schemas/StaffHeader.ts +0 -21
  560. package/test-utils/sdks/star-trek/src/schemas/TechnologyBase.ts +0 -101
  561. package/test-utils/sdks/star-trek/src/schemas/TechnologyBaseResponse.ts +0 -20
  562. package/test-utils/sdks/star-trek/src/schemas/TechnologyFull.ts +0 -101
  563. package/test-utils/sdks/star-trek/src/schemas/TechnologyFullResponse.ts +0 -12
  564. package/test-utils/sdks/star-trek/src/schemas/TitleBase.ts +0 -41
  565. package/test-utils/sdks/star-trek/src/schemas/TitleBaseResponse.ts +0 -20
  566. package/test-utils/sdks/star-trek/src/schemas/TitleFull.ts +0 -48
  567. package/test-utils/sdks/star-trek/src/schemas/TitleFullResponse.ts +0 -12
  568. package/test-utils/sdks/star-trek/src/schemas/TradingCardBase.ts +0 -38
  569. package/test-utils/sdks/star-trek/src/schemas/TradingCardBaseResponse.ts +0 -20
  570. package/test-utils/sdks/star-trek/src/schemas/TradingCardDeckBase.ts +0 -28
  571. package/test-utils/sdks/star-trek/src/schemas/TradingCardDeckBaseResponse.ts +0 -20
  572. package/test-utils/sdks/star-trek/src/schemas/TradingCardDeckFull.ts +0 -34
  573. package/test-utils/sdks/star-trek/src/schemas/TradingCardDeckFullResponse.ts +0 -12
  574. package/test-utils/sdks/star-trek/src/schemas/TradingCardDeckHeader.ts +0 -21
  575. package/test-utils/sdks/star-trek/src/schemas/TradingCardFull.ts +0 -38
  576. package/test-utils/sdks/star-trek/src/schemas/TradingCardFullResponse.ts +0 -12
  577. package/test-utils/sdks/star-trek/src/schemas/TradingCardSetBase.ts +0 -62
  578. package/test-utils/sdks/star-trek/src/schemas/TradingCardSetBaseResponse.ts +0 -20
  579. package/test-utils/sdks/star-trek/src/schemas/TradingCardSetFull.ts +0 -86
  580. package/test-utils/sdks/star-trek/src/schemas/TradingCardSetFullResponse.ts +0 -12
  581. package/test-utils/sdks/star-trek/src/schemas/TradingCardSetHeader.ts +0 -21
  582. package/test-utils/sdks/star-trek/src/schemas/VideoGameBase.ts +0 -48
  583. package/test-utils/sdks/star-trek/src/schemas/VideoGameBaseResponse.ts +0 -20
  584. package/test-utils/sdks/star-trek/src/schemas/VideoGameFull.ts +0 -84
  585. package/test-utils/sdks/star-trek/src/schemas/VideoGameFullResponse.ts +0 -12
  586. package/test-utils/sdks/star-trek/src/schemas/VideoReleaseBase.ts +0 -127
  587. package/test-utils/sdks/star-trek/src/schemas/VideoReleaseBaseResponse.ts +0 -20
  588. package/test-utils/sdks/star-trek/src/schemas/VideoReleaseFormat.ts +0 -23
  589. package/test-utils/sdks/star-trek/src/schemas/VideoReleaseFull.ts +0 -155
  590. package/test-utils/sdks/star-trek/src/schemas/VideoReleaseFullResponse.ts +0 -12
  591. package/test-utils/sdks/star-trek/src/schemas/WeaponBase.ts +0 -49
  592. package/test-utils/sdks/star-trek/src/schemas/WeaponBaseResponse.ts +0 -20
  593. package/test-utils/sdks/star-trek/src/schemas/WeaponFull.ts +0 -49
  594. package/test-utils/sdks/star-trek/src/schemas/WeaponFullResponse.ts +0 -12
  595. package/test-utils/sdks/star-trek/src/schemas.ts +0 -314
  596. package/test-utils/sdks/star-trek/src/sdk.ts +0 -1032
  597. package/test-utils/sdks/star-trek/src/types.ts +0 -490
  598. package/test-utils/sdks/star-trek/tsconfig.json +0 -12
  599. package/test-utils/tsconfig.json +0 -9
  600. package/tsconfig.eslint.json +0 -8
  601. package/tsconfig.json +0 -9
  602. package/tsup.config.ts +0 -31
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bfra.me/api-core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "The magic behind `api` 🧙",
5
5
  "homepage": "https://api.readme.dev",
6
6
  "bugs": {
@@ -33,6 +33,11 @@
33
33
  "main": "dist/index.js",
34
34
  "module": "dist/index.js",
35
35
  "types": "dist/index.d.ts",
36
+ "files": [
37
+ "dist",
38
+ "src",
39
+ "!**/*.map"
40
+ ],
36
41
  "dependencies": {
37
42
  "@readme/oas-to-har": "^23.2.0",
38
43
  "caseless": "^0.12.0",
package/CHANGELOG.md DELETED
@@ -1,11 +0,0 @@
1
- # @bfra.me/api-core
2
-
3
- ## 0.1.0
4
- ### Minor Changes
5
-
6
-
7
-
8
- - Add a fork of [`@readme/api-core`](https://github.com/readmeio/api/tree/main/packages/core) as `@bfra.me/api-core`:
9
- - Use `git subtree` to add `@readme/api-core` and `@api/test-utils` as forks
10
- - Patch `@bfra.me/api-core` with readmeio/api#820, to fix issues bundling `@readme/api-core` for the browser
11
- - Adjust forked packages to build, lint, and test within the `@bfra.me/works` monorepo (by [@marcusrbrown](https://github.com/marcusrbrown) with [#443](https://github.com/bfra-me/works/pull/443))
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/errors/fetchError.ts"],"sourcesContent":["export default class FetchError<Status = number, Data = unknown> extends Error {\n /** HTTP Status */\n status: Status\n\n /** The content of the response. */\n data: Data\n\n /** The Headers of the response. */\n headers: Headers\n\n /** The raw `Response` object. */\n res: Response\n\n constructor(status: Status, data: Data, headers: Headers, res: Response) {\n super(res.statusText)\n\n this.name = 'FetchError'\n this.status = status\n this.data = data\n this.headers = headers\n this.res = res\n\n // We could fix this by updating our target to ES2015 but because we support exporting to CJS\n // we can't.\n //\n // https://www.dannyguo.com/blog/how-to-fix-instanceof-not-working-for-custom-errors-in-typescript/\n Object.setPrototypeOf(this, FetchError.prototype)\n }\n}\n"],"mappings":";;;;;AAAA,IAAqBA,aAArB,MAAqBA,oBAAoDC,MAAAA;EAAzE,OAAyEA;;;;EAEvEC;;EAGAC;;EAGAC;;EAGAC;EAEAC,YAAYJ,QAAgBC,MAAYC,SAAkBC,KAAe;AACvE,UAAMA,IAAIE,UAAU;AAEpB,SAAKC,OAAO;AACZ,SAAKN,SAASA;AACd,SAAKC,OAAOA;AACZ,SAAKC,UAAUA;AACf,SAAKC,MAAMA;AAMXI,WAAOC,eAAe,MAAMV,YAAWW,SAAS;EAClD;AACF;","names":["FetchError","Error","status","data","headers","res","constructor","statusText","name","Object","setPrototypeOf","prototype"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/getJSONSchemaDefaults.ts","../src/lib/parseResponse.ts","../src/lib/prepareAuth.ts","../src/lib/prepareParams.ts","../../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/index.js","../../../node_modules/.pnpm/is-stream@4.0.1/node_modules/is-stream/index.js","../../../node_modules/.pnpm/@sec-ant+readable-stream@0.4.1/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js","../../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/stream.js","../../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/contents.js","../../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/utils.js","../../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/array-buffer.js","../../../node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/buffer.js","../src/lib/prepareServer.ts"],"sourcesContent":["import type {SchemaWrapper} from 'oas/operation/get-parameters-as-json-schema'\nimport type {SchemaObject} from 'oas/types'\n\nimport traverse from 'json-schema-traverse'\n\n/**\n * Run through a JSON Schema object and compose up an object containing default data for any schema\n * property that is required and also has a defined default.\n *\n * Code partially adapted from the `json-schema-default` package but modified to only return\n * defaults of required properties.\n *\n * @todo This is a good candidate to be moved into a core `oas` library method.\n * @see {@link https://github.com/mdornseif/json-schema-default}\n */\nexport default function getJSONSchemaDefaults(jsonSchemas: SchemaWrapper[]) {\n return jsonSchemas\n .map(({type: payloadType, schema: jsonSchema}) => {\n const defaults: Record<string, unknown> = {}\n traverse(\n jsonSchema,\n (\n schema: SchemaObject,\n pointer: string,\n _rootSchema: SchemaObject,\n parentPointer?: string,\n _parentKeyword?: string,\n parentSchema?: SchemaObject,\n indexProperty?: number | string,\n ) => {\n if (!pointer.startsWith('/properties/')) {\n return\n }\n\n if (\n Array.isArray(parentSchema?.required) &&\n parentSchema?.required.includes(String(indexProperty))\n ) {\n if (schema.type === 'object' && indexProperty) {\n defaults[indexProperty] = {}\n }\n\n let destination = defaults\n if (parentPointer) {\n // To map nested objects correct we need to pick apart the parent pointer.\n parentPointer\n .replace(/\\/properties/g, '')\n .split('/')\n .forEach((subSchema: string) => {\n if (subSchema === '') {\n return\n }\n\n destination = (destination?.[subSchema] as Record<string, unknown>) || {}\n })\n }\n\n if (schema.default !== undefined) {\n if (indexProperty !== undefined) {\n destination[indexProperty] = schema.default\n }\n }\n }\n },\n )\n\n if (!Object.keys(defaults).length) {\n return {}\n }\n\n return {\n // @todo should we filter out empty and undefined objects from here with `remove-undefined-objects`?\n [payloadType]: defaults,\n }\n })\n .reduce((prev, next) => Object.assign(prev, next))\n}\n","import {matchesMimeType} from 'oas/utils'\n\nexport default async function parseResponse<HTTPStatus extends number = number>(\n response: Response,\n) {\n const contentType = response.headers.get('Content-Type')\n const isJSON =\n contentType && (matchesMimeType.json(contentType) || matchesMimeType.wildcard(contentType))\n\n const responseBody = await response.clone().text()\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let data: any = responseBody\n if (isJSON) {\n try {\n data = JSON.parse(responseBody)\n } catch (e) {\n // If our JSON parsing failed then we can just return plaintext instead.\n }\n }\n\n return {\n data,\n status: response.status as HTTPStatus,\n headers: response.headers,\n res: response,\n }\n}\n","/* eslint-disable no-underscore-dangle */\nimport type {AuthForHAR} from '@readme/oas-to-har/lib/types'\nimport type {Operation} from 'oas/operation'\nimport type {KeyedSecuritySchemeObject} from 'oas/types'\n\nexport default function prepareAuth(authKey: (number | string)[], operation: Operation) {\n if (authKey.length === 0) {\n return {}\n }\n\n const preparedAuth: AuthForHAR = {}\n\n const security = operation.getSecurity()\n if (security.length === 0) {\n // If there's no auth configured on this operation, don't prepare anything (even if it was\n // supplied by the user).\n return {}\n }\n\n // Does this operation require multiple forms of auth?\n if (security.every(s => Object.keys(s).length > 1)) {\n throw new Error(\n \"Sorry, this operation currently requires multiple forms of authentication which this library doesn't yet support.\",\n )\n }\n\n // Since we can only handle single auth security configurations, let's pull those out. This code\n // is a bit opaque but `security` here may look like `[{ basic: [] }, { oauth2: [], basic: []}]`\n // and are filtering it down to only single-auth requirements of `[{ basic: [] }]`.\n const usableSecurity = security\n .map(s => {\n return Object.keys(s).length === 1 ? s : false\n })\n .filter(Boolean)\n\n const usableSecuritySchemes = usableSecurity\n .map(s => Object.keys(s))\n .reduce((prev, next) => prev.concat(next), [])\n const preparedSecurity = operation.prepareSecurity()\n\n // If we have two auth tokens present let's look for Basic Auth in their configuration.\n if (authKey.length >= 2) {\n // If this operation doesn't support HTTP Basic auth but we have two tokens, that's a paddlin.\n if (!('Basic' in preparedSecurity)) {\n throw new Error(\n 'Multiple auth tokens were supplied for this endpoint but only a single token is needed.',\n )\n }\n\n // If we have two auth keys for Basic Auth but Basic isn't a usable security scheme (maybe it's\n // part of an AND or auth configuration -- which we don't support) then we need to error out.\n const schemes = preparedSecurity.Basic.filter(s => usableSecuritySchemes.includes(s._key))\n if (!schemes.length) {\n throw new Error(\n 'Credentials for Basic Authentication were supplied but this operation requires another form of auth in that case, which this library does not yet support. This operation does, however, allow supplying a single auth token.',\n )\n }\n\n const scheme = schemes.shift() as KeyedSecuritySchemeObject\n preparedAuth[scheme._key] = {\n user: String(authKey[0]),\n pass: authKey.length === 2 ? String(authKey[1]) : '',\n }\n\n return preparedAuth\n }\n\n // If we know we don't need to use HTTP Basic auth because we have a username+password then we\n // can pick the first usable security scheme available and try to use that. This might not always\n // be the auth scheme that the user wants, but we don't have any other way for the user to tell\n // us what they want with the current `sdk.auth()` API.\n const usableScheme = usableSecuritySchemes[0]\n const schemes = Object.entries(preparedSecurity)\n .map(([, ps]) => ps.filter(s => usableScheme === s._key))\n .reduce((prev, next) => prev.concat(next), [])\n\n const scheme = schemes.shift() as KeyedSecuritySchemeObject\n switch (scheme.type) {\n case 'http':\n if (scheme.scheme === 'basic') {\n preparedAuth[scheme._key] = {\n user: String(authKey[0]),\n pass: authKey.length === 2 ? String(authKey[1]) : '',\n }\n } else if (scheme.scheme === 'bearer') {\n preparedAuth[scheme._key] = String(authKey[0])\n }\n break\n\n case 'oauth2':\n preparedAuth[scheme._key] = String(authKey[0])\n break\n\n case 'apiKey':\n if (scheme.in === 'query' || scheme.in === 'header' || scheme.in === 'cookie') {\n preparedAuth[scheme._key] = String(authKey[0])\n }\n break\n\n default:\n throw new Error(\n `Sorry, this API currently uses a security scheme, ${scheme.type}, which this library doesn't yet support.`,\n )\n }\n\n return preparedAuth\n}\n","import type {ReadStream} from 'node:fs'\nimport type {Operation} from 'oas/operation'\nimport type {ParameterObject, SchemaObject} from 'oas/types'\n\nimport stream from 'node:stream'\n\nimport caseless from 'caseless'\n// `get-stream` is included in our bundle, see `tsup.config.ts`\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {getStreamAsBuffer} from 'get-stream'\nimport lodashMerge from 'lodash.merge'\nimport removeUndefinedObjects from 'remove-undefined-objects'\n\nimport getJSONSchemaDefaults from './getJSONSchemaDefaults.js'\n\n// These headers are normally only defined by the OpenAPI definition but we allow the user to\n// manually supply them in their `metadata` parameter if they wish.\nconst specialHeaders = ['accept', 'authorization']\n\n/**\n * Extract all available parameters from an operations Parameter Object into a digestable array\n * that we can use to apply to the request.\n *\n * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameterObject}\n * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterObject}\n */\nfunction digestParameters(parameters: ParameterObject[]): Record<string, ParameterObject> {\n return parameters.reduce((prev, param) => {\n if ('$ref' in param || 'allOf' in param || 'anyOf' in param || 'oneOf' in param) {\n throw new Error(\n \"The OpenAPI document for this operation wasn't dereferenced before processing.\",\n )\n } else if (param.name in prev) {\n throw new Error(\n `The operation you are using has the same parameter, ${param.name}, spread across multiple entry points. We unfortunately can't handle this right now.`,\n )\n }\n\n return Object.assign(prev, {[param.name]: param})\n }, {})\n}\n\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_isempty\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isEmpty(obj: any) {\n return [Object, Array].includes((obj || {}).constructor) && !Object.entries(obj || {}).length\n}\n\nfunction isObject(thing: unknown) {\n if (thing instanceof stream.Readable) {\n return false\n }\n\n return typeof thing === 'object' && thing !== null && !Array.isArray(thing)\n}\n\nfunction isPrimitive(obj: unknown) {\n return obj === null || typeof obj === 'number' || typeof obj === 'string'\n}\n\nfunction merge(src: unknown, target: unknown) {\n if (Array.isArray(target)) {\n // @todo we need to add support for merging array defaults with array body/metadata arguments\n return target\n } else if (!isObject(target)) {\n return target\n }\n\n return lodashMerge(src, target)\n}\n\n/**\n * Ingest a file path or readable stream into a common object that we can later use to process it\n * into a parameters object for making an API request.\n *\n */\nasync function processFile(\n paramName: string | undefined,\n file: ReadStream | string,\n): Promise<{base64?: string; buffer?: Buffer; filename: string; paramName?: string} | undefined> {\n const fs = await import('node:fs')\n const path = await import('node:path')\n const {default: DatauriParser} = await import('datauri/parser.js')\n const {default: datauri} = await import('datauri/sync.js')\n if (typeof file === 'string') {\n // In order to support relative pathed files, we need to attempt to resolve them.\n const resolvedFile = path.resolve(file)\n\n return new Promise((resolve, reject) => {\n fs.stat(resolvedFile, async err => {\n if (err) {\n if (err.code === 'ENOENT') {\n // It's less than ideal for us to handle files that don't exist like this but because\n // `file` is a string it might actually be the full text contents of the file and not\n // actually a path.\n //\n // We also can't really regex to see if `file` *looks*` like a path because one should be\n // able to pass in a relative `owlbert.png` (instead of `./owlbert.png`) and though that\n // doesn't *look* like a path, it is one that should still work.\n return resolve(undefined)\n }\n\n return reject(err)\n }\n\n const fileMetadata = await datauri(resolvedFile)\n const payloadFilename = encodeURIComponent(path.basename(resolvedFile))\n\n return resolve({\n paramName,\n base64: fileMetadata?.content?.replace(';base64', `;name=${payloadFilename};base64`),\n filename: payloadFilename,\n buffer: fileMetadata.buffer,\n })\n })\n })\n } else if (file instanceof stream.Readable) {\n return getStreamAsBuffer(file).then(buffer => {\n const filePath = file.path as string\n const parser = new DatauriParser()\n const base64 = parser.format(filePath, buffer).content\n const payloadFilename = encodeURIComponent(path.basename(filePath))\n\n return {\n paramName,\n base64: base64?.replace(';base64', `;name=${payloadFilename};base64`),\n filename: payloadFilename,\n buffer,\n }\n })\n }\n\n return Promise.reject(\n new TypeError(\n paramName\n ? `The data supplied for the \\`${paramName}\\` request body parameter is not a file handler that we support.`\n : 'The data supplied for the request body payload is not a file handler that we support.',\n ),\n )\n}\n\n/**\n * With potentially supplied body and/or metadata we need to run through them against a given API\n * operation to see what's what and prepare any available parameters to be used in an API request\n * with `@readme/oas-to-har`.\n *\n */\nexport default async function prepareParams(\n operation: Operation,\n body?: unknown,\n metadata?: Record<string, unknown>,\n) {\n let metadataIntersected = false\n const digestedParameters = digestParameters(operation.getParameters())\n const jsonSchema = operation.getParametersAsJSONSchema()\n\n /**\n * It might be common for somebody to run `sdk.findPetsByStatus({ status: 'available' }, {})`, in\n * which case we want to filter out the second (metadata) parameter and treat the first parameter\n * as the metadata instead. If we don't do this, their supplied `status` metadata will be treated\n * as a body parameter, and because there's no `status` body parameter, and no supplied metadata\n * (because it's an empty object), the request won't send a payload.\n *\n * @see {@link https://github.com/readmeio/api/issues/449}\n */\n // eslint-disable-next-line no-param-reassign\n metadata = removeUndefinedObjects(metadata)\n\n if (!jsonSchema && (body !== undefined || metadata !== undefined)) {\n let throwNoParamsError = true\n\n // If this operation doesn't have any parameters for us to transform to JSON Schema but they've\n // sent us either an `Accept` or `Authorization` header (or both) we should let them do that.\n // We should, however, only do this check for the `body` parameter as if they've sent this\n // request both `body` and `metadata` we can reject it outright as the operation won't have any\n // body data.\n if (body !== undefined) {\n if (typeof body === 'object' && body !== null && !Array.isArray(body)) {\n if (Object.keys(body).length <= 2) {\n const bodyParams = caseless(body)\n\n if (specialHeaders.some(header => bodyParams.has(header))) {\n throwNoParamsError = false\n }\n }\n }\n }\n\n if (throwNoParamsError) {\n throw new Error(\n \"You supplied metadata and/or body data for this operation but it doesn't have any documented parameters or request payloads. If you think this is an error please contact support for the API you're using.\",\n )\n }\n }\n\n const jsonSchemaDefaults = jsonSchema ? getJSONSchemaDefaults(jsonSchema) : {}\n\n const params: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n body?: any\n cookie?: Record<string, boolean | number | string>\n files?: Record<string, Buffer>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n formData?: any\n header?: Record<string, boolean | number | string>\n path?: Record<string, boolean | number | string>\n query?: Record<string, boolean | number | string>\n server?: {\n selected: number\n variables: Record<string, number | string>\n }\n } = jsonSchemaDefaults\n\n // If a body argument was supplied we need to do a bit of work to see if it's actually a body\n // argument or metadata because the library lets you supply either a body, metadata, or body with\n // metadata.\n if (typeof body !== 'undefined') {\n if (Array.isArray(body) || isPrimitive(body)) {\n // If the body param is an array or a primitive then we know it's absolutely a body because\n // metadata can only ever be undefined or an object.\n params.body = merge(params.body, body)\n } else if (typeof metadata === 'undefined') {\n // No metadata was explicitly provided so we need to analyze the body to determine if it's a\n // body or should be actually be treated as metadata.\n const headerParams = caseless({})\n Object.entries(digestedParameters).forEach(([paramName, param]) => {\n // Headers are sent case-insensitive so we need to make sure that we're properly\n // matching them when detecting what our incoming payload looks like.\n if (param.in === 'header') {\n headerParams.set(paramName, '')\n }\n })\n\n // `Accept` and `Authorization` headers can't be defined as normal parameters but we should\n // always allow the user to supply them if they wish.\n specialHeaders.forEach(header => {\n if (!headerParams.has(header)) {\n headerParams.set(header, '')\n }\n })\n\n const intersection = Object.keys(body as NonNullable<unknown>).filter(value => {\n if (Object.keys(digestedParameters).includes(value)) {\n return true\n } else if (headerParams.has(value)) {\n return true\n }\n\n return false\n }).length\n\n // If more than 25% of the body intersects with the parameters that we've got on hand, then\n // we should treat it as a metadata object and organize into parameters.\n if (intersection && intersection / Object.keys(body as NonNullable<unknown>).length > 0.25) {\n /* eslint-disable no-param-reassign */\n metadataIntersected = true\n metadata = merge(params.body, body) as Record<string, unknown>\n body = undefined\n /* eslint-enable no-param-reassign */\n } else {\n // For all other cases, we should just treat the supplied body as a body.\n params.body = merge(params.body, body)\n }\n } else {\n // Body and metadata were both supplied.\n params.body = merge(params.body, body)\n }\n }\n\n if (!operation.hasRequestBody()) {\n // If this operation doesn't have any documented request body then we shouldn't be sending\n // anything.\n delete params.body\n } else {\n if (!('body' in params)) params.body = {}\n\n // We need to retrieve the request body for this operation to search for any `binary` format\n // data that the user wants to send so we know what we need to prepare for the final API\n // request.\n const payloadJsonSchema = jsonSchema.find(js => js.type === 'body')\n if (payloadJsonSchema) {\n if (!params.files) params.files = {}\n\n const conversions = []\n\n // @todo add support for `type: array`, `oneOf` and `anyOf`\n if (payloadJsonSchema.schema?.properties) {\n Object.entries(payloadJsonSchema.schema?.properties)\n .filter(([, schema]: [string, SchemaObject]) => schema?.format === 'binary')\n .filter(([prop]) => Object.keys(params.body).includes(prop))\n .forEach(([prop]) => {\n conversions.push(processFile(prop, params.body[prop]))\n })\n } else if (payloadJsonSchema.schema?.type === 'string') {\n if (payloadJsonSchema.schema?.format === 'binary') {\n conversions.push(processFile(undefined, params.body))\n }\n }\n\n await Promise.all(conversions)\n .then(fileMetadata => fileMetadata.filter(Boolean))\n .then(fm => {\n fm.forEach(fileMetadata => {\n if (!fileMetadata) {\n // If we don't have any metadata here it's because the file we have is likely\n // the full string content of the file so since we don't have any filenames to\n // work with we shouldn't do any additional handling to the `body` or `files`\n // parameters.\n return\n }\n\n if (fileMetadata.paramName) {\n params.body[fileMetadata.paramName] = fileMetadata.base64\n } else {\n params.body = fileMetadata.base64\n }\n\n if (fileMetadata.buffer && params?.files) {\n params.files[fileMetadata.filename] = fileMetadata.buffer\n }\n })\n })\n }\n }\n\n // Form data should be placed within `formData` instead of `body` for it to properly get picked\n // up by `fetch-har`.\n if (operation.isFormUrlEncoded()) {\n params.formData = merge(params.formData, params.body)\n delete params.body\n }\n\n // Only spend time trying to organize metadata into parameters if we were able to digest\n // parameters out of the operation schema. If we couldn't digest anything, but metadata was\n // supplied then we wouldn't know how to send it in the request!\n if (typeof metadata !== 'undefined') {\n if (!('cookie' in params)) params.cookie = {}\n if (!('header' in params)) params.header = {}\n if (!('path' in params)) params.path = {}\n if (!('query' in params)) params.query = {}\n\n Object.entries(digestedParameters).forEach(([paramName, param]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let value: any\n let metadataHeaderParam\n if (typeof metadata === 'object' && !isEmpty(metadata)) {\n if (paramName in metadata) {\n value = metadata[paramName]\n metadataHeaderParam = paramName\n } else if (param.in === 'header') {\n // Headers are sent case-insensitive so we need to make sure that we're properly\n // matching them when detecting what our incoming payload looks like.\n metadataHeaderParam =\n Object.keys(metadata).find(k => k.toLowerCase() === paramName.toLowerCase()) || ''\n value = metadata[metadataHeaderParam]\n }\n }\n\n if (value === undefined) {\n return\n }\n\n /* eslint-disable no-param-reassign */\n switch (param.in) {\n case 'path':\n ;(params.path as NonNullable<typeof params.path>)[paramName] = value\n if (metadata?.[paramName]) delete metadata[paramName]\n break\n case 'query':\n ;(params.query as NonNullable<typeof params.query>)[paramName] = value\n if (metadata?.[paramName]) delete metadata[paramName]\n break\n case 'header':\n ;(params.header as NonNullable<typeof params.header>)[paramName.toLowerCase()] = value\n if (metadataHeaderParam && metadata?.[metadataHeaderParam])\n delete metadata[metadataHeaderParam]\n break\n case 'cookie':\n ;(params.cookie as NonNullable<typeof params.cookie>)[paramName] = value\n if (metadata?.[paramName]) delete metadata[paramName]\n break\n default: // no-op\n }\n /* eslint-enable no-param-reassign */\n\n // Because a user might have sent just a metadata object, we want to make sure that we filter\n // out anything that they sent that is a parameter from also being sent as part of a form\n // data payload for `x-www-form-urlencoded` requests.\n if (metadataIntersected && operation.isFormUrlEncoded()) {\n if (paramName in params.formData) {\n delete params.formData[paramName]\n }\n }\n })\n\n // If there's any leftover metadata that hasn't been moved into form data for this request we\n // need to move it or else it'll get tossed.\n if (!isEmpty(metadata)) {\n if (typeof metadata === 'object') {\n // If the user supplied an `accept` or `authorization` header themselves we should allow it\n // through. Normally these headers are automatically handled by `@readme/oas-to-har` but in\n // the event that maybe the user wants to return XML for an API that normally returns JSON\n // or specify a custom auth header (maybe we can't handle their auth case right) this is the\n // only way with this library that they can do that.\n specialHeaders.forEach(headerName => {\n const headerParam = Object.keys(metadata || {}).find(m => m.toLowerCase() === headerName)\n if (headerParam) {\n // this if-statement below is a typeguard\n if (typeof metadata === 'object') {\n // this if-statement below is a typeguard\n if (typeof params.header === 'object') {\n params.header[headerName] = metadata[headerParam] as string\n }\n // eslint-disable-next-line no-param-reassign\n delete metadata[headerParam]\n }\n }\n })\n }\n\n if (operation.isFormUrlEncoded()) {\n params.formData = merge(params.formData, metadata)\n } else {\n // Any other remaining unused metadata will be unused because we don't know where to place\n // it in the request.\n }\n }\n }\n\n ;(['body', 'cookie', 'files', 'formData', 'header', 'path', 'query'] as const).forEach(\n (type: keyof typeof params) => {\n if (type in params && isEmpty(params[type])) {\n delete params[type]\n }\n },\n )\n\n return params\n}\n","import {on} from 'node:events';\nimport {finished} from 'node:stream/promises';\nimport {nodeImports} from './stream.js';\n\nObject.assign(nodeImports, {on, finished});\n\nexport {\n\tdefault,\n\tgetStreamAsArray,\n\tgetStreamAsArrayBuffer,\n\tgetStreamAsBuffer,\n\tMaxBufferError,\n} from './exports.js';\n","export function isStream(stream, {checkOpen = true} = {}) {\n\treturn stream !== null\n\t\t&& typeof stream === 'object'\n\t\t&& (stream.writable || stream.readable || !checkOpen || (stream.writable === undefined && stream.readable === undefined))\n\t\t&& typeof stream.pipe === 'function';\n}\n\nexport function isWritableStream(stream, {checkOpen = true} = {}) {\n\treturn isStream(stream, {checkOpen})\n\t\t&& (stream.writable || !checkOpen)\n\t\t&& typeof stream.write === 'function'\n\t\t&& typeof stream.end === 'function'\n\t\t&& typeof stream.writable === 'boolean'\n\t\t&& typeof stream.writableObjectMode === 'boolean'\n\t\t&& typeof stream.destroy === 'function'\n\t\t&& typeof stream.destroyed === 'boolean';\n}\n\nexport function isReadableStream(stream, {checkOpen = true} = {}) {\n\treturn isStream(stream, {checkOpen})\n\t\t&& (stream.readable || !checkOpen)\n\t\t&& typeof stream.read === 'function'\n\t\t&& typeof stream.readable === 'boolean'\n\t\t&& typeof stream.readableObjectMode === 'boolean'\n\t\t&& typeof stream.destroy === 'function'\n\t\t&& typeof stream.destroyed === 'boolean';\n}\n\nexport function isDuplexStream(stream, options) {\n\treturn isWritableStream(stream, options)\n\t\t&& isReadableStream(stream, options);\n}\n\nexport function isTransformStream(stream, options) {\n\treturn isDuplexStream(stream, options)\n\t\t&& typeof stream._transform === 'function';\n}\n","const a = Object.getPrototypeOf(\n Object.getPrototypeOf(\n /* istanbul ignore next */\n async function* () {\n }\n ).prototype\n);\nclass c {\n #t;\n #n;\n #r = !1;\n #e = void 0;\n constructor(e, t) {\n this.#t = e, this.#n = t;\n }\n next() {\n const e = () => this.#s();\n return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e;\n }\n return(e) {\n const t = () => this.#i(e);\n return this.#e ? this.#e.then(t, t) : t();\n }\n async #s() {\n if (this.#r)\n return {\n done: !0,\n value: void 0\n };\n let e;\n try {\n e = await this.#t.read();\n } catch (t) {\n throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t;\n }\n return e.done && (this.#e = void 0, this.#r = !0, this.#t.releaseLock()), e;\n }\n async #i(e) {\n if (this.#r)\n return {\n done: !0,\n value: e\n };\n if (this.#r = !0, !this.#n) {\n const t = this.#t.cancel(e);\n return this.#t.releaseLock(), await t, {\n done: !0,\n value: e\n };\n }\n return this.#t.releaseLock(), {\n done: !0,\n value: e\n };\n }\n}\nconst n = Symbol();\nfunction i() {\n return this[n].next();\n}\nObject.defineProperty(i, \"name\", { value: \"next\" });\nfunction o(r) {\n return this[n].return(r);\n}\nObject.defineProperty(o, \"name\", { value: \"return\" });\nconst u = Object.create(a, {\n next: {\n enumerable: !0,\n configurable: !0,\n writable: !0,\n value: i\n },\n return: {\n enumerable: !0,\n configurable: !0,\n writable: !0,\n value: o\n }\n});\nfunction h({ preventCancel: r = !1 } = {}) {\n const e = this.getReader(), t = new c(\n e,\n r\n ), s = Object.create(u);\n return s[n] = t, s;\n}\nexport {\n h as asyncIterator\n};\n","import {isReadableStream} from 'is-stream';\nimport {asyncIterator} from '@sec-ant/readable-stream/ponyfill';\n\nexport const getAsyncIterable = stream => {\n\tif (isReadableStream(stream, {checkOpen: false}) && nodeImports.on !== undefined) {\n\t\treturn getStreamIterable(stream);\n\t}\n\n\tif (typeof stream?.[Symbol.asyncIterator] === 'function') {\n\t\treturn stream;\n\t}\n\n\t// `ReadableStream[Symbol.asyncIterator]` support is missing in multiple browsers, so we ponyfill it\n\tif (toString.call(stream) === '[object ReadableStream]') {\n\t\treturn asyncIterator.call(stream);\n\t}\n\n\tthrow new TypeError('The first argument must be a Readable, a ReadableStream, or an async iterable.');\n};\n\nconst {toString} = Object.prototype;\n\n// The default iterable for Node.js streams does not allow for multiple readers at once, so we re-implement it\nconst getStreamIterable = async function * (stream) {\n\tconst controller = new AbortController();\n\tconst state = {};\n\thandleStreamEnd(stream, controller, state);\n\n\ttry {\n\t\tfor await (const [chunk] of nodeImports.on(stream, 'data', {signal: controller.signal})) {\n\t\t\tyield chunk;\n\t\t}\n\t} catch (error) {\n\t\t// Stream failure, for example due to `stream.destroy(error)`\n\t\tif (state.error !== undefined) {\n\t\t\tthrow state.error;\n\t\t// `error` event directly emitted on stream\n\t\t} else if (!controller.signal.aborted) {\n\t\t\tthrow error;\n\t\t// Otherwise, stream completed successfully\n\t\t}\n\t\t// The `finally` block also runs when the caller throws, for example due to the `maxBuffer` option\n\t} finally {\n\t\tstream.destroy();\n\t}\n};\n\nconst handleStreamEnd = async (stream, controller, state) => {\n\ttry {\n\t\tawait nodeImports.finished(stream, {\n\t\t\tcleanup: true,\n\t\t\treadable: true,\n\t\t\twritable: false,\n\t\t\terror: false,\n\t\t});\n\t} catch (error) {\n\t\tstate.error = error;\n\t} finally {\n\t\tcontroller.abort();\n\t}\n};\n\n// Loaded by the Node entrypoint, but not by the browser one.\n// This prevents using dynamic imports.\nexport const nodeImports = {};\n","import {getAsyncIterable} from './stream.js';\n\nexport const getStreamContents = async (stream, {init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize}, {maxBuffer = Number.POSITIVE_INFINITY} = {}) => {\n\tconst asyncIterable = getAsyncIterable(stream);\n\n\tconst state = init();\n\tstate.length = 0;\n\n\ttry {\n\t\tfor await (const chunk of asyncIterable) {\n\t\t\tconst chunkType = getChunkType(chunk);\n\t\t\tconst convertedChunk = convertChunk[chunkType](chunk, state);\n\t\t\tappendChunk({\n\t\t\t\tconvertedChunk,\n\t\t\t\tstate,\n\t\t\t\tgetSize,\n\t\t\t\ttruncateChunk,\n\t\t\t\taddChunk,\n\t\t\t\tmaxBuffer,\n\t\t\t});\n\t\t}\n\n\t\tappendFinalChunk({\n\t\t\tstate,\n\t\t\tconvertChunk,\n\t\t\tgetSize,\n\t\t\ttruncateChunk,\n\t\t\taddChunk,\n\t\t\tgetFinalChunk,\n\t\t\tmaxBuffer,\n\t\t});\n\t\treturn finalize(state);\n\t} catch (error) {\n\t\tconst normalizedError = typeof error === 'object' && error !== null ? error : new Error(error);\n\t\tnormalizedError.bufferedData = finalize(state);\n\t\tthrow normalizedError;\n\t}\n};\n\nconst appendFinalChunk = ({state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}) => {\n\tconst convertedChunk = getFinalChunk(state);\n\tif (convertedChunk !== undefined) {\n\t\tappendChunk({\n\t\t\tconvertedChunk,\n\t\t\tstate,\n\t\t\tgetSize,\n\t\t\ttruncateChunk,\n\t\t\taddChunk,\n\t\t\tmaxBuffer,\n\t\t});\n\t}\n};\n\nconst appendChunk = ({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}) => {\n\tconst chunkSize = getSize(convertedChunk);\n\tconst newLength = state.length + chunkSize;\n\n\tif (newLength <= maxBuffer) {\n\t\taddNewChunk(convertedChunk, state, addChunk, newLength);\n\t\treturn;\n\t}\n\n\tconst truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);\n\n\tif (truncatedChunk !== undefined) {\n\t\taddNewChunk(truncatedChunk, state, addChunk, maxBuffer);\n\t}\n\n\tthrow new MaxBufferError();\n};\n\nconst addNewChunk = (convertedChunk, state, addChunk, newLength) => {\n\tstate.contents = addChunk(convertedChunk, state, newLength);\n\tstate.length = newLength;\n};\n\nconst getChunkType = chunk => {\n\tconst typeOfChunk = typeof chunk;\n\n\tif (typeOfChunk === 'string') {\n\t\treturn 'string';\n\t}\n\n\tif (typeOfChunk !== 'object' || chunk === null) {\n\t\treturn 'others';\n\t}\n\n\tif (globalThis.Buffer?.isBuffer(chunk)) {\n\t\treturn 'buffer';\n\t}\n\n\tconst prototypeName = objectToString.call(chunk);\n\n\tif (prototypeName === '[object ArrayBuffer]') {\n\t\treturn 'arrayBuffer';\n\t}\n\n\tif (prototypeName === '[object DataView]') {\n\t\treturn 'dataView';\n\t}\n\n\tif (\n\t\tNumber.isInteger(chunk.byteLength)\n\t\t&& Number.isInteger(chunk.byteOffset)\n\t\t&& objectToString.call(chunk.buffer) === '[object ArrayBuffer]'\n\t) {\n\t\treturn 'typedArray';\n\t}\n\n\treturn 'others';\n};\n\nconst {toString: objectToString} = Object.prototype;\n\nexport class MaxBufferError extends Error {\n\tname = 'MaxBufferError';\n\n\tconstructor() {\n\t\tsuper('maxBuffer exceeded');\n\t}\n}\n","export const identity = value => value;\n\nexport const noop = () => undefined;\n\nexport const getContentsProperty = ({contents}) => contents;\n\nexport const throwObjectStream = chunk => {\n\tthrow new Error(`Streams in object mode are not supported: ${String(chunk)}`);\n};\n\nexport const getLengthProperty = convertedChunk => convertedChunk.length;\n","import {getStreamContents} from './contents.js';\nimport {noop, throwObjectStream, getLengthProperty} from './utils.js';\n\nexport async function getStreamAsArrayBuffer(stream, options) {\n\treturn getStreamContents(stream, arrayBufferMethods, options);\n}\n\nconst initArrayBuffer = () => ({contents: new ArrayBuffer(0)});\n\nconst useTextEncoder = chunk => textEncoder.encode(chunk);\nconst textEncoder = new TextEncoder();\n\nconst useUint8Array = chunk => new Uint8Array(chunk);\n\nconst useUint8ArrayWithOffset = chunk => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n\nconst truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);\n\n// `contents` is an increasingly growing `Uint8Array`.\nconst addArrayBufferChunk = (convertedChunk, {contents, length: previousLength}, length) => {\n\tconst newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);\n\tnew Uint8Array(newContents).set(convertedChunk, previousLength);\n\treturn newContents;\n};\n\n// Without `ArrayBuffer.resize()`, `contents` size is always a power of 2.\n// This means its last bytes are zeroes (not stream data), which need to be\n// trimmed at the end with `ArrayBuffer.slice()`.\nconst resizeArrayBufferSlow = (contents, length) => {\n\tif (length <= contents.byteLength) {\n\t\treturn contents;\n\t}\n\n\tconst arrayBuffer = new ArrayBuffer(getNewContentsLength(length));\n\tnew Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);\n\treturn arrayBuffer;\n};\n\n// With `ArrayBuffer.resize()`, `contents` size matches exactly the size of\n// the stream data. It does not include extraneous zeroes to trim at the end.\n// The underlying `ArrayBuffer` does allocate a number of bytes that is a power\n// of 2, but those bytes are only visible after calling `ArrayBuffer.resize()`.\nconst resizeArrayBuffer = (contents, length) => {\n\tif (length <= contents.maxByteLength) {\n\t\tcontents.resize(length);\n\t\treturn contents;\n\t}\n\n\tconst arrayBuffer = new ArrayBuffer(length, {maxByteLength: getNewContentsLength(length)});\n\tnew Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);\n\treturn arrayBuffer;\n};\n\n// Retrieve the closest `length` that is both >= and a power of 2\nconst getNewContentsLength = length => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR));\n\nconst SCALE_FACTOR = 2;\n\nconst finalizeArrayBuffer = ({contents, length}) => hasArrayBufferResize() ? contents : contents.slice(0, length);\n\n// `ArrayBuffer.slice()` is slow. When `ArrayBuffer.resize()` is available\n// (Node >=20.0.0, Safari >=16.4 and Chrome), we can use it instead.\n// eslint-disable-next-line no-warning-comments\n// TODO: remove after dropping support for Node 20.\n// eslint-disable-next-line no-warning-comments\n// TODO: use `ArrayBuffer.transferToFixedLength()` instead once it is available\nconst hasArrayBufferResize = () => 'resize' in ArrayBuffer.prototype;\n\nconst arrayBufferMethods = {\n\tinit: initArrayBuffer,\n\tconvertChunk: {\n\t\tstring: useTextEncoder,\n\t\tbuffer: useUint8Array,\n\t\tarrayBuffer: useUint8Array,\n\t\tdataView: useUint8ArrayWithOffset,\n\t\ttypedArray: useUint8ArrayWithOffset,\n\t\tothers: throwObjectStream,\n\t},\n\tgetSize: getLengthProperty,\n\ttruncateChunk: truncateArrayBufferChunk,\n\taddChunk: addArrayBufferChunk,\n\tgetFinalChunk: noop,\n\tfinalize: finalizeArrayBuffer,\n};\n","import {getStreamAsArrayBuffer} from './array-buffer.js';\n\nexport async function getStreamAsBuffer(stream, options) {\n\tif (!('Buffer' in globalThis)) {\n\t\tthrow new Error('getStreamAsBuffer() is only supported in Node.js');\n\t}\n\n\ttry {\n\t\treturn arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));\n\t} catch (error) {\n\t\tif (error.bufferedData !== undefined) {\n\t\t\terror.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n\nconst arrayBufferToNodeBuffer = arrayBuffer => globalThis.Buffer.from(arrayBuffer);\n","import type Oas from 'oas'\n\nfunction stripTrailingSlash(url: string) {\n if (url[url.length - 1] === '/') {\n return url.slice(0, -1)\n }\n\n return url\n}\n\n/**\n * With an SDK server config and an instance of OAS we should extract and prepare the server and\n * any server variables to be supplied to `@readme/oas-to-har`.\n *\n */\nexport default function prepareServer(\n spec: Oas,\n url: string,\n variables: Record<string, number | string> = {},\n) {\n let serverIdx: number | undefined\n const sanitizedUrl = stripTrailingSlash(url)\n ;(spec.api.servers || []).forEach((server, i) => {\n if (server.url === sanitizedUrl) {\n serverIdx = i\n }\n })\n\n // If we were able to find the passed in server in the OAS servers, we should use that! If we\n // couldn't and server variables were passed in we should try our best to handle that, otherwise\n // we should ignore the passed in server and use whever the default from the OAS is.\n if (serverIdx !== undefined) {\n return {\n selected: serverIdx,\n variables,\n }\n } else if (Object.keys(variables).length) {\n // @todo we should run `oas.replaceUrl(url)` and pass that unto `@readme/oas-to-har`\n } else {\n const server = spec.splitVariables(url)\n if (server) {\n return {\n selected: server.selected,\n variables: server.variables,\n }\n }\n\n // @todo we should pass `url` directly into `@readme/oas-to-har` as the base URL\n }\n\n return false\n}\n"],"mappings":";;;;;AAGA,OAAOA,cAAc;AAYN,SAAf,sBAA8CC,aAA4B;AACxE,SAAOA,YACJC,IAAI,CAAC,EAACC,MAAMC,aAAaC,QAAQC,WAAU,MAAC;AAC3C,UAAMC,WAAoC,CAAC;AAC3CC,aACEF,YACA,CACED,QACAI,SACAC,aACAC,eACAC,gBACAC,cACAC,kBAAAA;AAEA,UAAI,CAACL,QAAQM,WAAW,cAAA,GAAiB;AACvC;MACF;AAEA,UACEC,MAAMC,QAAQJ,cAAcK,QAAAA,KAC5BL,cAAcK,SAASC,SAASC,OAAON,aAAAA,CAAAA,GACvC;AACA,YAAIT,OAAOF,SAAS,YAAYW,eAAe;AAC7CP,mBAASO,aAAAA,IAAiB,CAAC;QAC7B;AAEA,YAAIO,cAAcd;AAClB,YAAII,eAAe;AAEjBA,wBACGW,QAAQ,iBAAiB,EAAA,EACzBC,MAAM,GAAA,EACNC,QAAQ,CAACC,cAAAA;AACR,gBAAIA,cAAc,IAAI;AACpB;YACF;AAEAJ,0BAAeA,cAAcI,SAAAA,KAA0C,CAAC;UAC1E,CAAA;QACJ;AAEA,YAAIpB,OAAOqB,YAAYC,QAAW;AAChC,cAAIb,kBAAkBa,QAAW;AAC/BN,wBAAYP,aAAAA,IAAiBT,OAAOqB;UACtC;QACF;MACF;IACF,CAAA;AAGF,QAAI,CAACE,OAAOC,KAAKtB,QAAAA,EAAUuB,QAAQ;AACjC,aAAO,CAAC;IACV;AAEA,WAAO;;MAEL,CAAC1B,WAAAA,GAAcG;IACjB;EACF,CAAA,EACCwB,OAAO,CAACC,MAAMC,SAASL,OAAOM,OAAOF,MAAMC,IAAAA,CAAAA;AAChD;AA7DwBE;;;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jsonSchema","defaults","traverse","pointer","_rootSchema","parentPointer","_parentKeyword","parentSchema","indexProperty","startsWith","Array","isArray","required","includes","String","destination","replace","split","forEach","subSchema","default","undefined","Object","keys","length","reduce","prev","next","assign","getJSONSchemaDefaults","matchesMimeType","response","contentType","headers","get","isJSON","matchesMimeType","json","wildcard","responseBody","clone","text","data","JSON","parse","e","status","res","parseResponse","authKey","operation","length","preparedAuth","security","getSecurity","every","s","Object","keys","Error","usableSecurity","map","filter","Boolean","usableSecuritySchemes","reduce","prev","next","concat","preparedSecurity","prepareSecurity","schemes","Basic","includes","_key","scheme","shift","user","String","pass","usableScheme","entries","ps","type","in","prepareAuth","stream","caseless","on","finished","isStream","stream","checkOpen","writable","readable","undefined","pipe","isReadableStream","stream","checkOpen","isStream","readable","read","readableObjectMode","destroy","destroyed","a","Object","getPrototypeOf","prototype","c","constructor","e","t","next","then","return","done","value","read","releaseLock","cancel","n","Symbol","i","defineProperty","o","r","u","create","enumerable","configurable","writable","h","preventCancel","getReader","s","getAsyncIterable","stream","isReadableStream","checkOpen","nodeImports","on","undefined","getStreamIterable","Symbol","asyncIterator","toString","call","TypeError","Object","prototype","controller","AbortController","state","handleStreamEnd","chunk","signal","error","aborted","destroy","finished","cleanup","readable","writable","abort","getStreamContents","stream","init","convertChunk","getSize","truncateChunk","addChunk","getFinalChunk","finalize","maxBuffer","Number","POSITIVE_INFINITY","asyncIterable","getAsyncIterable","state","length","chunk","chunkType","getChunkType","convertedChunk","appendChunk","appendFinalChunk","error","normalizedError","Error","bufferedData","undefined","chunkSize","newLength","addNewChunk","truncatedChunk","MaxBufferError","contents","typeOfChunk","globalThis","Buffer","isBuffer","prototypeName","objectToString","call","isInteger","byteLength","byteOffset","buffer","toString","Object","prototype","name","constructor","noop","undefined","throwObjectStream","chunk","Error","String","getLengthProperty","convertedChunk","length","getStreamAsArrayBuffer","stream","options","getStreamContents","arrayBufferMethods","initArrayBuffer","contents","ArrayBuffer","useTextEncoder","chunk","textEncoder","encode","TextEncoder","useUint8Array","Uint8Array","useUint8ArrayWithOffset","buffer","byteOffset","byteLength","truncateArrayBufferChunk","convertedChunk","chunkSize","slice","addArrayBufferChunk","length","previousLength","newContents","hasArrayBufferResize","resizeArrayBuffer","resizeArrayBufferSlow","set","arrayBuffer","getNewContentsLength","maxByteLength","resize","SCALE_FACTOR","Math","ceil","log","finalizeArrayBuffer","prototype","init","convertChunk","string","dataView","typedArray","others","throwObjectStream","getSize","getLengthProperty","truncateChunk","addChunk","getFinalChunk","noop","finalize","getStreamAsBuffer","stream","options","globalThis","Error","arrayBufferToNodeBuffer","getStreamAsArrayBuffer","error","bufferedData","undefined","arrayBuffer","Buffer","from","Object","assign","nodeImports","on","finished","lodashMerge","removeUndefinedObjects","specialHeaders","digestParameters","parameters","reduce","prev","param","Error","name","Object","assign","isEmpty","obj","Array","includes","constructor","entries","length","isObject","thing","stream","Readable","isArray","isPrimitive","merge","src","target","lodashMerge","processFile","paramName","file","fs","path","default","DatauriParser","datauri","resolvedFile","resolve","Promise","reject","stat","err","code","undefined","fileMetadata","payloadFilename","encodeURIComponent","basename","base64","content","replace","filename","buffer","getStreamAsBuffer","then","filePath","parser","format","TypeError","operation","body","metadata","metadataIntersected","digestedParameters","getParameters","jsonSchema","getParametersAsJSONSchema","removeUndefinedObjects","throwNoParamsError","keys","bodyParams","caseless","some","header","has","jsonSchemaDefaults","getJSONSchemaDefaults","params","headerParams","forEach","in","set","intersection","filter","value","hasRequestBody","payloadJsonSchema","find","js","type","files","conversions","schema","properties","prop","push","all","Boolean","fm","isFormUrlEncoded","formData","cookie","query","metadataHeaderParam","k","toLowerCase","headerName","headerParam","m","prepareParams","stripTrailingSlash","url","length","slice","spec","variables","serverIdx","sanitizedUrl","api","servers","forEach","server","i","undefined","selected","Object","keys","splitVariables","prepareServer"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type {ConfigOptions} from './types.js'\nimport type {AuthForHAR, DataForHAR} from '@readme/oas-to-har/lib/types'\nimport type {Har} from 'har-format'\nimport type {Operation} from 'oas/operation'\nimport type {HttpMethods, OASDocument} from 'oas/types'\n\nimport oasToHar from '@readme/oas-to-har'\nimport fetchHar from 'fetch-har'\nimport Oas from 'oas'\n\nimport FetchError from './errors/fetchError.js'\nimport {parseResponse, prepareAuth, prepareParams, prepareServer} from './lib/index.js'\n\nexport default class APICore {\n spec!: Oas\n\n private auth: (number | string)[] = []\n\n private server:\n | false\n | {\n url: string\n variables?: Record<string, number | string>\n } = false\n\n private config: ConfigOptions = {}\n\n private userAgent!: string\n\n constructor(definition?: OASDocument | Record<string, unknown>, userAgent?: string) {\n if (definition) this.spec = Oas.init(definition)\n if (userAgent) this.userAgent = userAgent\n }\n\n setSpec(spec: Oas) {\n this.spec = spec\n }\n\n setConfig(config: ConfigOptions) {\n this.config = config\n return this\n }\n\n setUserAgent(userAgent: string) {\n this.userAgent = userAgent\n return this\n }\n\n setAuth(...values: number[] | string[]) {\n this.auth = values\n return this\n }\n\n setServer(url: string, variables: Record<string, number | string> = {}) {\n this.server = {url, variables}\n return this\n }\n\n async fetch<HTTPStatus extends number = number>(\n path: string,\n method: HttpMethods,\n body?: unknown,\n metadata?: Record<string, unknown>,\n ) {\n const operation = this.spec.operation(path, method)\n\n return this.fetchOperation<HTTPStatus>(operation, body, metadata)\n }\n\n /**\n * Retrieve a HAR for a given HTTP request.\n *\n * @internal\n */\n getHARForRequest(operation: Operation, data: DataForHAR, auth: AuthForHAR) {\n return oasToHar(this.spec, operation, data, auth)\n }\n\n async fetchOperation<HTTPStatus extends number = number>(\n operation: Operation,\n body?: unknown,\n metadata?: Record<string, unknown>,\n ) {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n return prepareParams(operation, body, metadata).then(params => {\n const data = {...params}\n\n // If `sdk.server()` has been issued data then we need to do some extra work to figure out\n // how to use that supplied server, and also handle any server variables that were sent\n // alongside it.\n if (this.server) {\n const preparedServer = prepareServer(this.spec, this.server.url, this.server.variables)\n if (preparedServer) {\n data.server = preparedServer\n }\n }\n\n const har = this.getHARForRequest(operation, data, prepareAuth(this.auth, operation))\n\n let timeoutSignal: NodeJS.Timeout\n const init: RequestInit = {}\n if (this.config.timeout) {\n const controller = new AbortController()\n timeoutSignal = setTimeout(() => controller.abort(), this.config.timeout)\n init.signal = controller.signal\n }\n\n return fetchHar(har as Har, {\n files: data.files || {},\n init,\n userAgent: this.userAgent,\n })\n .then(async (res: Response) => {\n const parsed = await parseResponse<HTTPStatus>(res)\n\n if (res.status >= 400 && res.status <= 599) {\n throw new FetchError<typeof parsed.status, typeof parsed.data>(\n parsed.status,\n parsed.data,\n parsed.headers,\n parsed.res,\n )\n }\n\n return parsed\n })\n .finally(() => {\n if (this.config.timeout) {\n clearTimeout(timeoutSignal)\n }\n })\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAMA,OAAOA,cAAc;AACrB,OAAOC,cAAc;AACrB,OAAOC,SAAS;AAKhB,IAAqBC,UAArB,MAAqBA;EAPrB,OAOqBA;;;EACnBC;EAEQC,OAA4B,CAAA;EAE5BC,SAKA;EAEAC,SAAwB,CAAC;EAEzBC;EAERC,YAAYC,YAAoDF,WAAoB;AAClF,QAAIE,WAAY,MAAKN,OAAOO,IAAIC,KAAKF,UAAAA;AACrC,QAAIF,UAAW,MAAKA,YAAYA;EAClC;EAEAK,QAAQT,MAAW;AACjB,SAAKA,OAAOA;EACd;EAEAU,UAAUP,QAAuB;AAC/B,SAAKA,SAASA;AACd,WAAO;EACT;EAEAQ,aAAaP,WAAmB;AAC9B,SAAKA,YAAYA;AACjB,WAAO;EACT;EAEAQ,WAAWC,QAA6B;AACtC,SAAKZ,OAAOY;AACZ,WAAO;EACT;EAEAC,UAAUC,KAAaC,YAA6C,CAAC,GAAG;AACtE,SAAKd,SAAS;MAACa;MAAKC;IAAS;AAC7B,WAAO;EACT;EA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,CAAA,EACCK,QAAQ,MAAA;AACP,YAAI,KAAK9C,OAAOgC,SAAS;AACvBe,uBAAahB,aAAAA;QACf;MACF,CAAA;IACJ,CAAA;EACF;AACF;","names":["oasToHar","fetchHar","Oas","APICore","spec","auth","server","config","userAgent","constructor","definition","Oas","init","setSpec","setConfig","setUserAgent","setAuth","values","setServer","url","variables","fetch","path","method","body","metadata","operation","fetchOperation","getHARForRequest","data","oasToHar","prepareParams","then","params","preparedServer","prepareServer","har","prepareAuth","timeoutSignal","timeout","controller","AbortController","setTimeout","abort","signal","fetchHar","files","res","parsed","parseResponse","status","FetchError","headers","finally","clearTimeout"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/eslint.config.ts DELETED
@@ -1,25 +0,0 @@
1
- import {defineConfig} from '@bfra.me/eslint-config'
2
-
3
- export default defineConfig({
4
- name: '@bfra.me/api-core',
5
- ignores: ['test-utils'],
6
- rules: {
7
- 'no-restricted-imports': [
8
- 'error',
9
- {
10
- name: 'fs/promises',
11
- message: "Please use `fs` instead as some client frameworks don't polyfill `fs/promises`.",
12
- },
13
- ],
14
-
15
- '@typescript-eslint/explicit-function-return-type': 'off',
16
- },
17
- typescript: {
18
- parserOptions: {
19
- project: ['./tsconfig.json', './tsconfig.eslint.json'],
20
- projectService: false,
21
- },
22
- tsconfigPath: './tsconfig.json',
23
- },
24
- vitest: true,
25
- })
@@ -1,11 +0,0 @@
1
- # @api/test-utils
2
-
3
- ## 0.1.0
4
- ### Minor Changes
5
-
6
-
7
-
8
- - Add a fork of [`@readme/api-core`](https://github.com/readmeio/api/tree/main/packages/core) as `@bfra.me/api-core`:
9
- - Use `git subtree` to add `@readme/api-core` and `@api/test-utils` as forks
10
- - Patch `@bfra.me/api-core` with readmeio/api#820, to fix issues bundling `@readme/api-core` for the browser
11
- - Adjust forked packages to build, lint, and test within the `@bfra.me/works` monorepo (by [@marcusrbrown](https://github.com/marcusrbrown) with [#443](https://github.com/bfra-me/works/pull/443))