@fern-api/venus-api-sdk 0.0.18 → 0.0.20-2-gc6b8e16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/Client.d.ts +23 -0
  2. package/Client.js +28 -0
  3. package/api/index.js +17 -0
  4. package/api/resources/commons/index.js +17 -0
  5. package/api/resources/commons/types/OrganizationId.js +10 -0
  6. package/api/resources/commons/types/UserId.js +10 -0
  7. package/api/resources/commons/types/index.js +18 -0
  8. package/api/resources/index.js +40 -0
  9. package/api/resources/organization/client/Client.d.ts +24 -0
  10. package/api/resources/organization/client/Client.js +214 -0
  11. package/{types/api → api}/resources/organization/client/addUser.d.ts +0 -1
  12. package/api/resources/organization/client/addUser.js +44 -0
  13. package/{types/api → api}/resources/organization/client/create.d.ts +0 -1
  14. package/api/resources/organization/client/create.js +44 -0
  15. package/{types/api → api}/resources/organization/client/get.d.ts +0 -1
  16. package/api/resources/organization/client/get.js +34 -0
  17. package/{types/api → api}/resources/organization/client/getMyOrganizationFromScopedToken.d.ts +0 -1
  18. package/api/resources/organization/client/getMyOrganizationFromScopedToken.js +34 -0
  19. package/api/resources/organization/client/index.js +36 -0
  20. package/{types/api → api}/resources/organization/client/isMember.d.ts +0 -1
  21. package/api/resources/organization/client/isMember.js +24 -0
  22. package/api/resources/organization/client/requests/AddUserToOrgRequest.js +5 -0
  23. package/api/resources/organization/client/requests/CreateOrganizationRequest.js +5 -0
  24. package/api/resources/organization/client/requests/UpdateOrganizationRequest.js +5 -0
  25. package/api/resources/organization/client/requests/index.js +2 -0
  26. package/{types/api → api}/resources/organization/client/update.d.ts +0 -1
  27. package/api/resources/organization/client/update.js +34 -0
  28. package/api/resources/organization/index.js +18 -0
  29. package/api/resources/organization/types/Organization.js +5 -0
  30. package/api/resources/organization/types/index.js +17 -0
  31. package/api/resources/registry/client/Client.d.ts +18 -0
  32. package/api/resources/registry/client/Client.js +135 -0
  33. package/{types/api → api}/resources/registry/client/generateRegistryTokens.d.ts +0 -1
  34. package/api/resources/registry/client/generateRegistryTokens.js +44 -0
  35. package/{types/api → api}/resources/registry/client/hasRegistryPermission.d.ts +0 -1
  36. package/api/resources/registry/client/hasRegistryPermission.js +44 -0
  37. package/api/resources/registry/client/index.js +33 -0
  38. package/api/resources/registry/client/requests/CheckRegistryPermissionRequest.js +5 -0
  39. package/api/resources/registry/client/requests/GenerateRegistryTokensRequest.js +5 -0
  40. package/api/resources/registry/client/requests/RevokeTokenRequest.js +5 -0
  41. package/api/resources/registry/client/requests/index.js +2 -0
  42. package/{types/api → api}/resources/registry/client/revokeToken.d.ts +0 -1
  43. package/api/resources/registry/client/revokeToken.js +44 -0
  44. package/api/resources/registry/index.js +18 -0
  45. package/api/resources/registry/types/MavenRegistryToken.js +5 -0
  46. package/api/resources/registry/types/NpmRegistryToken.js +5 -0
  47. package/api/resources/registry/types/RegistryToken.js +45 -0
  48. package/api/resources/registry/types/RegistryTokens.js +5 -0
  49. package/api/resources/registry/types/index.js +20 -0
  50. package/api/resources/user/client/Client.d.ts +17 -0
  51. package/api/resources/user/client/Client.js +87 -0
  52. package/{types/api → api}/resources/user/client/getMyOrganizations.d.ts +0 -1
  53. package/api/resources/user/client/getMyOrganizations.js +24 -0
  54. package/{types/api → api}/resources/user/client/getMyself.d.ts +0 -1
  55. package/api/resources/user/client/getMyself.js +24 -0
  56. package/api/resources/user/client/index.js +32 -0
  57. package/api/resources/user/client/requests/GetUserOrganizationsRequest.js +5 -0
  58. package/api/resources/user/client/requests/index.js +2 -0
  59. package/api/resources/user/index.js +18 -0
  60. package/api/resources/user/types/OrganizationsPage.js +5 -0
  61. package/api/resources/user/types/User.js +5 -0
  62. package/api/resources/user/types/index.js +18 -0
  63. package/core/auth/BasicAuth.js +24 -0
  64. package/core/auth/BearerToken.js +15 -0
  65. package/core/auth/index.js +7 -0
  66. package/core/fetcher/APIResponse.js +2 -0
  67. package/{types/core → core}/fetcher/Fetcher.d.ts +1 -4
  68. package/core/fetcher/Fetcher.js +85 -0
  69. package/core/fetcher/Supplier.js +13 -0
  70. package/core/fetcher/index.js +7 -0
  71. package/core/index.js +32 -0
  72. package/core/schemas/Schema.d.ts +46 -0
  73. package/core/schemas/Schema.js +19 -0
  74. package/core/schemas/builders/date/date.js +55 -0
  75. package/core/schemas/builders/date/index.js +5 -0
  76. package/core/schemas/builders/enum/enum.d.ts +2 -0
  77. package/core/schemas/builders/enum/enum.js +29 -0
  78. package/core/schemas/builders/enum/index.js +5 -0
  79. package/{types/core → core}/schemas/builders/index.d.ts +0 -1
  80. package/core/schemas/builders/index.js +28 -0
  81. package/core/schemas/builders/lazy/index.js +7 -0
  82. package/core/schemas/builders/lazy/lazy.js +28 -0
  83. package/core/schemas/builders/lazy/lazyObject.js +21 -0
  84. package/core/schemas/builders/list/index.js +5 -0
  85. package/core/schemas/builders/list/list.js +53 -0
  86. package/core/schemas/builders/literals/index.js +5 -0
  87. package/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
  88. package/core/schemas/builders/literals/stringLiteral.js +28 -0
  89. package/core/schemas/builders/object/index.js +9 -0
  90. package/core/schemas/builders/object/object.js +231 -0
  91. package/core/schemas/builders/object/property.js +16 -0
  92. package/{types/core → core}/schemas/builders/object/types.d.ts +5 -4
  93. package/core/schemas/builders/object/types.js +2 -0
  94. package/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
  95. package/core/schemas/builders/object-like/getObjectLikeUtils.js +62 -0
  96. package/core/schemas/builders/object-like/index.d.ts +2 -0
  97. package/core/schemas/builders/object-like/index.js +6 -0
  98. package/core/schemas/builders/object-like/types.d.ts +7 -0
  99. package/core/schemas/builders/object-like/types.js +2 -0
  100. package/core/schemas/builders/primitives/any.d.ts +1 -0
  101. package/core/schemas/builders/primitives/any.js +6 -0
  102. package/core/schemas/builders/primitives/boolean.d.ts +1 -0
  103. package/core/schemas/builders/primitives/boolean.js +24 -0
  104. package/core/schemas/builders/primitives/index.js +13 -0
  105. package/core/schemas/builders/primitives/number.d.ts +1 -0
  106. package/core/schemas/builders/primitives/number.js +24 -0
  107. package/core/schemas/builders/primitives/string.d.ts +1 -0
  108. package/core/schemas/builders/primitives/string.js +24 -0
  109. package/core/schemas/builders/primitives/unknown.d.ts +1 -0
  110. package/core/schemas/builders/primitives/unknown.js +6 -0
  111. package/core/schemas/builders/record/index.d.ts +2 -0
  112. package/core/schemas/builders/record/index.js +5 -0
  113. package/core/schemas/builders/record/record.d.ts +3 -0
  114. package/core/schemas/builders/record/record.js +91 -0
  115. package/core/schemas/builders/record/types.d.ts +5 -0
  116. package/core/schemas/builders/record/types.js +2 -0
  117. package/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
  118. package/core/schemas/builders/schema-utils/JsonError.js +13 -0
  119. package/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
  120. package/core/schemas/builders/schema-utils/ParseError.js +13 -0
  121. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +17 -0
  122. package/core/schemas/builders/schema-utils/getSchemaUtils.js +82 -0
  123. package/{types/core → core}/schemas/builders/schema-utils/index.d.ts +2 -1
  124. package/core/schemas/builders/schema-utils/index.js +11 -0
  125. package/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
  126. package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +10 -0
  127. package/core/schemas/builders/set/index.js +5 -0
  128. package/core/schemas/builders/set/set.js +44 -0
  129. package/core/schemas/builders/union/discriminant.js +10 -0
  130. package/core/schemas/builders/union/index.js +7 -0
  131. package/core/schemas/builders/union/types.js +2 -0
  132. package/core/schemas/builders/union/union.js +100 -0
  133. package/core/schemas/index.js +17 -0
  134. package/core/schemas/utils/MaybePromise.d.ts +1 -0
  135. package/core/schemas/utils/MaybePromise.js +2 -0
  136. package/core/schemas/utils/OptionalRecord.d.ts +1 -0
  137. package/core/schemas/utils/OptionalRecord.js +2 -0
  138. package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
  139. package/core/schemas/utils/addQuestionMarksToNullableProperties.js +2 -0
  140. package/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
  141. package/core/schemas/utils/createIdentitySchemaCreator.js +18 -0
  142. package/core/schemas/utils/entries.js +7 -0
  143. package/core/schemas/utils/filterObject.js +14 -0
  144. package/core/schemas/utils/isPlainObject.d.ts +2 -0
  145. package/core/schemas/utils/isPlainObject.js +19 -0
  146. package/core/schemas/utils/keys.js +7 -0
  147. package/core/schemas/utils/partition.js +16 -0
  148. package/index.js +29 -0
  149. package/package.json +23 -44
  150. package/serialization/index.js +17 -0
  151. package/serialization/resources/commons/index.js +17 -0
  152. package/serialization/resources/commons/types/OrganizationId.js +35 -0
  153. package/serialization/resources/commons/types/UserId.js +37 -0
  154. package/serialization/resources/commons/types/index.js +18 -0
  155. package/{types/serialization → serialization}/resources/index.d.ts +2 -0
  156. package/serialization/resources/index.js +39 -0
  157. package/{types/serialization → serialization}/resources/organization/client/addUser.d.ts +0 -7
  158. package/serialization/resources/organization/client/addUser.js +47 -0
  159. package/{types/serialization → serialization}/resources/organization/client/create.d.ts +0 -7
  160. package/serialization/resources/organization/client/create.js +47 -0
  161. package/{types/serialization → serialization}/resources/organization/client/get.d.ts +0 -4
  162. package/serialization/resources/organization/client/get.js +44 -0
  163. package/{types/serialization → serialization}/resources/organization/client/getMyOrganizationFromScopedToken.d.ts +0 -4
  164. package/serialization/resources/organization/client/getMyOrganizationFromScopedToken.js +44 -0
  165. package/{types/serialization → serialization}/resources/organization/client/index.d.ts +1 -0
  166. package/serialization/resources/organization/client/index.js +36 -0
  167. package/serialization/resources/organization/client/isMember.js +31 -0
  168. package/serialization/resources/organization/client/requests/AddUserToOrgRequest.d.ts +13 -0
  169. package/serialization/resources/organization/client/requests/AddUserToOrgRequest.js +34 -0
  170. package/serialization/resources/organization/client/requests/CreateOrganizationRequest.d.ts +13 -0
  171. package/serialization/resources/organization/client/requests/CreateOrganizationRequest.js +34 -0
  172. package/serialization/resources/organization/client/requests/UpdateOrganizationRequest.d.ts +12 -0
  173. package/serialization/resources/organization/client/requests/UpdateOrganizationRequest.js +33 -0
  174. package/serialization/resources/organization/client/requests/index.d.ts +3 -0
  175. package/serialization/resources/organization/client/requests/index.js +9 -0
  176. package/{types/serialization → serialization}/resources/organization/client/update.d.ts +0 -6
  177. package/serialization/resources/organization/client/update.js +44 -0
  178. package/serialization/resources/organization/index.js +18 -0
  179. package/serialization/resources/organization/types/Organization.js +34 -0
  180. package/serialization/resources/organization/types/index.js +17 -0
  181. package/{types/serialization → serialization}/resources/registry/client/generateRegistryTokens.d.ts +0 -10
  182. package/serialization/resources/registry/client/generateRegistryTokens.js +47 -0
  183. package/{types/serialization → serialization}/resources/registry/client/hasRegistryPermission.d.ts +1 -8
  184. package/serialization/resources/registry/client/hasRegistryPermission.js +48 -0
  185. package/{types/serialization → serialization}/resources/registry/client/index.d.ts +1 -0
  186. package/serialization/resources/registry/client/index.js +33 -0
  187. package/serialization/resources/registry/client/requests/CheckRegistryPermissionRequest.d.ts +13 -0
  188. package/serialization/resources/registry/client/requests/CheckRegistryPermissionRequest.js +34 -0
  189. package/serialization/resources/registry/client/requests/GenerateRegistryTokensRequest.d.ts +12 -0
  190. package/serialization/resources/registry/client/requests/GenerateRegistryTokensRequest.js +33 -0
  191. package/serialization/resources/registry/client/requests/RevokeTokenRequest.d.ts +13 -0
  192. package/serialization/resources/registry/client/requests/RevokeTokenRequest.js +34 -0
  193. package/serialization/resources/registry/client/requests/index.d.ts +3 -0
  194. package/serialization/resources/registry/client/requests/index.js +9 -0
  195. package/{types/serialization → serialization}/resources/registry/client/revokeToken.d.ts +0 -7
  196. package/serialization/resources/registry/client/revokeToken.js +47 -0
  197. package/serialization/resources/registry/index.js +18 -0
  198. package/serialization/resources/registry/types/MavenRegistryToken.js +34 -0
  199. package/serialization/resources/registry/types/NpmRegistryToken.js +33 -0
  200. package/serialization/resources/registry/types/RegistryToken.js +49 -0
  201. package/serialization/resources/registry/types/RegistryTokens.js +34 -0
  202. package/serialization/resources/registry/types/index.js +20 -0
  203. package/serialization/resources/user/index.d.ts +1 -0
  204. package/serialization/resources/user/index.js +17 -0
  205. package/serialization/resources/user/types/OrganizationsPage.js +34 -0
  206. package/serialization/resources/user/types/User.js +36 -0
  207. package/serialization/resources/user/types/index.js +18 -0
  208. package/core.d.ts +0 -3
  209. package/dist/browser/cjs/core.js +0 -4286
  210. package/dist/browser/cjs/index.js +0 -6332
  211. package/dist/browser/cjs/serialization.js +0 -5852
  212. package/dist/browser/esm/core.js +0 -4280
  213. package/dist/browser/esm/index.js +0 -6328
  214. package/dist/browser/esm/serialization.js +0 -5864
  215. package/dist/node/core.js +0 -12643
  216. package/dist/node/index.js +0 -14715
  217. package/dist/node/serialization.js +0 -14721
  218. package/serialization.d.ts +0 -3
  219. package/types/Client.d.ts +0 -21
  220. package/types/api/resources/organization/client/Client.d.ts +0 -24
  221. package/types/api/resources/registry/client/Client.d.ts +0 -18
  222. package/types/api/resources/user/client/Client.d.ts +0 -17
  223. package/types/core/schemas/Schema.d.ts +0 -18
  224. package/types/core/schemas/builders/enum/enum.d.ts +0 -2
  225. package/types/core/schemas/builders/identity/createIdentitySchemaCreator.d.ts +0 -2
  226. package/types/core/schemas/builders/identity/identity.d.ts +0 -2
  227. package/types/core/schemas/builders/identity/index.d.ts +0 -2
  228. package/types/core/schemas/builders/literals/stringLiteral.d.ts +0 -2
  229. package/types/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +0 -8
  230. package/types/core/schemas/builders/object-like/index.d.ts +0 -2
  231. package/types/core/schemas/builders/object-like/types.d.ts +0 -13
  232. package/types/core/schemas/builders/primitives/any.d.ts +0 -1
  233. package/types/core/schemas/builders/primitives/boolean.d.ts +0 -1
  234. package/types/core/schemas/builders/primitives/number.d.ts +0 -1
  235. package/types/core/schemas/builders/primitives/string.d.ts +0 -1
  236. package/types/core/schemas/builders/primitives/unknown.d.ts +0 -1
  237. package/types/core/schemas/builders/record/index.d.ts +0 -1
  238. package/types/core/schemas/builders/record/record.d.ts +0 -2
  239. package/types/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +0 -12
  240. package/types/core/schemas/builders/schema-utils/types.d.ts +0 -7
  241. package/types/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +0 -9
  242. package/types/serialization/resources/user/client/getMyOrganizations.d.ts +0 -10
  243. package/types/serialization/resources/user/client/getMyself.d.ts +0 -10
  244. package/types/serialization/resources/user/client/index.d.ts +0 -2
  245. package/types/serialization/resources/user/index.d.ts +0 -2
  246. /package/{types/api → api}/index.d.ts +0 -0
  247. /package/{types/api → api}/resources/commons/index.d.ts +0 -0
  248. /package/{types/api → api}/resources/commons/types/OrganizationId.d.ts +0 -0
  249. /package/{types/api → api}/resources/commons/types/UserId.d.ts +0 -0
  250. /package/{types/api → api}/resources/commons/types/index.d.ts +0 -0
  251. /package/{types/api → api}/resources/index.d.ts +0 -0
  252. /package/{types/api → api}/resources/organization/client/index.d.ts +0 -0
  253. /package/{types/api → api}/resources/organization/client/requests/AddUserToOrgRequest.d.ts +0 -0
  254. /package/{types/api → api}/resources/organization/client/requests/CreateOrganizationRequest.d.ts +0 -0
  255. /package/{types/api → api}/resources/organization/client/requests/UpdateOrganizationRequest.d.ts +0 -0
  256. /package/{types/api → api}/resources/organization/client/requests/index.d.ts +0 -0
  257. /package/{types/api → api}/resources/organization/index.d.ts +0 -0
  258. /package/{types/api → api}/resources/organization/types/Organization.d.ts +0 -0
  259. /package/{types/api → api}/resources/organization/types/index.d.ts +0 -0
  260. /package/{types/api → api}/resources/registry/client/index.d.ts +0 -0
  261. /package/{types/api → api}/resources/registry/client/requests/CheckRegistryPermissionRequest.d.ts +0 -0
  262. /package/{types/api → api}/resources/registry/client/requests/GenerateRegistryTokensRequest.d.ts +0 -0
  263. /package/{types/api → api}/resources/registry/client/requests/RevokeTokenRequest.d.ts +0 -0
  264. /package/{types/api → api}/resources/registry/client/requests/index.d.ts +0 -0
  265. /package/{types/api → api}/resources/registry/index.d.ts +0 -0
  266. /package/{types/api → api}/resources/registry/types/MavenRegistryToken.d.ts +0 -0
  267. /package/{types/api → api}/resources/registry/types/NpmRegistryToken.d.ts +0 -0
  268. /package/{types/api → api}/resources/registry/types/RegistryToken.d.ts +0 -0
  269. /package/{types/api → api}/resources/registry/types/RegistryTokens.d.ts +0 -0
  270. /package/{types/api → api}/resources/registry/types/index.d.ts +0 -0
  271. /package/{types/api → api}/resources/user/client/index.d.ts +0 -0
  272. /package/{types/api → api}/resources/user/client/requests/GetUserOrganizationsRequest.d.ts +0 -0
  273. /package/{types/api → api}/resources/user/client/requests/index.d.ts +0 -0
  274. /package/{types/api → api}/resources/user/index.d.ts +0 -0
  275. /package/{types/api → api}/resources/user/types/OrganizationsPage.d.ts +0 -0
  276. /package/{types/api → api}/resources/user/types/User.d.ts +0 -0
  277. /package/{types/api → api}/resources/user/types/index.d.ts +0 -0
  278. /package/{types/core → core}/auth/BasicAuth.d.ts +0 -0
  279. /package/{types/core → core}/auth/BearerToken.d.ts +0 -0
  280. /package/{types/core → core}/auth/index.d.ts +0 -0
  281. /package/{types/core → core}/fetcher/APIResponse.d.ts +0 -0
  282. /package/{types/core → core}/fetcher/Supplier.d.ts +0 -0
  283. /package/{types/core → core}/fetcher/index.d.ts +0 -0
  284. /package/{types/core → core}/index.d.ts +0 -0
  285. /package/{types/core → core}/schemas/builders/date/date.d.ts +0 -0
  286. /package/{types/core → core}/schemas/builders/date/index.d.ts +0 -0
  287. /package/{types/core → core}/schemas/builders/enum/index.d.ts +0 -0
  288. /package/{types/core → core}/schemas/builders/lazy/index.d.ts +0 -0
  289. /package/{types/core → core}/schemas/builders/lazy/lazy.d.ts +0 -0
  290. /package/{types/core → core}/schemas/builders/lazy/lazyObject.d.ts +0 -0
  291. /package/{types/core → core}/schemas/builders/list/index.d.ts +0 -0
  292. /package/{types/core → core}/schemas/builders/list/list.d.ts +0 -0
  293. /package/{types/core → core}/schemas/builders/literals/index.d.ts +0 -0
  294. /package/{types/core → core}/schemas/builders/object/index.d.ts +0 -0
  295. /package/{types/core → core}/schemas/builders/object/object.d.ts +0 -0
  296. /package/{types/core → core}/schemas/builders/object/property.d.ts +0 -0
  297. /package/{types/core → core}/schemas/builders/primitives/index.d.ts +0 -0
  298. /package/{types/core → core}/schemas/builders/set/index.d.ts +0 -0
  299. /package/{types/core → core}/schemas/builders/set/set.d.ts +0 -0
  300. /package/{types/core → core}/schemas/builders/union/discriminant.d.ts +0 -0
  301. /package/{types/core → core}/schemas/builders/union/index.d.ts +0 -0
  302. /package/{types/core → core}/schemas/builders/union/types.d.ts +0 -0
  303. /package/{types/core → core}/schemas/builders/union/union.d.ts +0 -0
  304. /package/{types/core → core}/schemas/index.d.ts +0 -0
  305. /package/{types/core → core}/schemas/utils/entries.d.ts +0 -0
  306. /package/{types/core → core}/schemas/utils/filterObject.d.ts +0 -0
  307. /package/{types/core → core}/schemas/utils/keys.d.ts +0 -0
  308. /package/{types/core → core}/schemas/utils/partition.d.ts +0 -0
  309. /package/{types/index.d.ts → index.d.ts} +0 -0
  310. /package/{types/serialization → serialization}/index.d.ts +0 -0
  311. /package/{types/serialization → serialization}/resources/commons/index.d.ts +0 -0
  312. /package/{types/serialization → serialization}/resources/commons/types/OrganizationId.d.ts +0 -0
  313. /package/{types/serialization → serialization}/resources/commons/types/UserId.d.ts +0 -0
  314. /package/{types/serialization → serialization}/resources/commons/types/index.d.ts +0 -0
  315. /package/{types/serialization → serialization}/resources/organization/client/isMember.d.ts +0 -0
  316. /package/{types/serialization → serialization}/resources/organization/index.d.ts +0 -0
  317. /package/{types/serialization → serialization}/resources/organization/types/Organization.d.ts +0 -0
  318. /package/{types/serialization → serialization}/resources/organization/types/index.d.ts +0 -0
  319. /package/{types/serialization → serialization}/resources/registry/index.d.ts +0 -0
  320. /package/{types/serialization → serialization}/resources/registry/types/MavenRegistryToken.d.ts +0 -0
  321. /package/{types/serialization → serialization}/resources/registry/types/NpmRegistryToken.d.ts +0 -0
  322. /package/{types/serialization → serialization}/resources/registry/types/RegistryToken.d.ts +0 -0
  323. /package/{types/serialization → serialization}/resources/registry/types/RegistryTokens.d.ts +0 -0
  324. /package/{types/serialization → serialization}/resources/registry/types/index.d.ts +0 -0
  325. /package/{types/serialization → serialization}/resources/user/types/OrganizationsPage.d.ts +0 -0
  326. /package/{types/serialization → serialization}/resources/user/types/User.d.ts +0 -0
  327. /package/{types/serialization → serialization}/resources/user/types/index.d.ts +0 -0
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.string = void 0;
4
+ const Schema_1 = require("../../Schema");
5
+ const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
6
+ exports.string = (0, createIdentitySchemaCreator_1.createIdentitySchemaCreator)(Schema_1.SchemaType.STRING, (value) => {
7
+ if (typeof value === "string") {
8
+ return {
9
+ ok: true,
10
+ value,
11
+ };
12
+ }
13
+ else {
14
+ return {
15
+ ok: false,
16
+ errors: [
17
+ {
18
+ path: [],
19
+ message: "Not a string",
20
+ },
21
+ ],
22
+ };
23
+ }
24
+ });
@@ -0,0 +1 @@
1
+ export declare const unknown: () => import("../../Schema").Schema<unknown, unknown>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unknown = void 0;
4
+ const Schema_1 = require("../../Schema");
5
+ const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
6
+ exports.unknown = (0, createIdentitySchemaCreator_1.createIdentitySchemaCreator)(Schema_1.SchemaType.UNKNOWN, (value) => ({ ok: true, value }));
@@ -0,0 +1,2 @@
1
+ export { record } from "./record";
2
+ export { type BaseRecordSchema, type RecordSchema } from "./types";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.record = void 0;
4
+ var record_1 = require("./record");
5
+ Object.defineProperty(exports, "record", { enumerable: true, get: function () { return record_1.record; } });
@@ -0,0 +1,3 @@
1
+ import { Schema } from "../../Schema";
2
+ import { RecordSchema } from "./types";
3
+ export declare function record<RawKey extends string | number, RawValue, ParsedValue, ParsedKey extends string | number>(keySchema: Schema<RawKey, ParsedKey>, valueSchema: Schema<RawValue, ParsedValue>): RecordSchema<RawKey, RawValue, ParsedKey, ParsedValue>;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.record = void 0;
4
+ const Schema_1 = require("../../Schema");
5
+ const entries_1 = require("../../utils/entries");
6
+ const isPlainObject_1 = require("../../utils/isPlainObject");
7
+ const schema_utils_1 = require("../schema-utils");
8
+ function record(keySchema, valueSchema) {
9
+ const baseSchema = {
10
+ parse: async (raw, opts) => {
11
+ return validateAndTransformRecord({
12
+ value: raw,
13
+ isKeyNumeric: (await keySchema.getType()) === Schema_1.SchemaType.NUMBER,
14
+ transformKey: (key) => keySchema.parse(key, opts),
15
+ transformValue: (value) => valueSchema.parse(value, opts),
16
+ });
17
+ },
18
+ json: async (parsed, opts) => {
19
+ return validateAndTransformRecord({
20
+ value: parsed,
21
+ isKeyNumeric: (await keySchema.getType()) === Schema_1.SchemaType.NUMBER,
22
+ transformKey: (key) => keySchema.json(key, opts),
23
+ transformValue: (value) => valueSchema.json(value, opts),
24
+ });
25
+ },
26
+ getType: () => Schema_1.SchemaType.RECORD,
27
+ };
28
+ return {
29
+ ...baseSchema,
30
+ ...(0, schema_utils_1.getSchemaUtils)(baseSchema),
31
+ };
32
+ }
33
+ exports.record = record;
34
+ async function validateAndTransformRecord({ value, isKeyNumeric, transformKey, transformValue, }) {
35
+ if (!(0, isPlainObject_1.isPlainObject)(value)) {
36
+ return {
37
+ ok: false,
38
+ errors: [
39
+ {
40
+ path: [],
41
+ message: isPlainObject_1.NOT_AN_OBJECT_ERROR_MESSAGE,
42
+ },
43
+ ],
44
+ };
45
+ }
46
+ return (0, entries_1.entries)(value).reduce(async (accPromise, [stringKey, value]) => {
47
+ // skip nullish keys
48
+ if (value == null) {
49
+ return accPromise;
50
+ }
51
+ const acc = await accPromise;
52
+ let key = stringKey;
53
+ if (isKeyNumeric) {
54
+ const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN;
55
+ if (!isNaN(numberKey)) {
56
+ key = numberKey;
57
+ }
58
+ }
59
+ const transformedKey = await transformKey(key);
60
+ const transformedValue = await transformValue(value);
61
+ if (acc.ok && transformedKey.ok && transformedValue.ok) {
62
+ return {
63
+ ok: true,
64
+ value: {
65
+ ...acc.value,
66
+ [transformedKey.value]: transformedValue.value,
67
+ },
68
+ };
69
+ }
70
+ const errors = [];
71
+ if (!acc.ok) {
72
+ errors.push(...acc.errors);
73
+ }
74
+ if (!transformedKey.ok) {
75
+ errors.push(...transformedKey.errors.map((error) => ({
76
+ path: [`${key} (key)`, ...error.path],
77
+ message: error.message,
78
+ })));
79
+ }
80
+ if (!transformedValue.ok) {
81
+ errors.push(...transformedValue.errors.map((error) => ({
82
+ path: [stringKey, ...error.path],
83
+ message: error.message,
84
+ })));
85
+ }
86
+ return {
87
+ ok: false,
88
+ errors,
89
+ };
90
+ }, Promise.resolve({ ok: true, value: {} }));
91
+ }
@@ -0,0 +1,5 @@
1
+ import { BaseSchema } from "../../Schema";
2
+ import { OptionalRecord } from "../../utils/OptionalRecord";
3
+ import { SchemaUtils } from "../schema-utils";
4
+ export declare type RecordSchema<RawKey extends string | number, RawValue, ParsedKey extends string | number, ParsedValue> = BaseRecordSchema<RawKey, RawValue, ParsedKey, ParsedValue> & SchemaUtils<OptionalRecord<RawKey, RawValue>, OptionalRecord<ParsedKey, ParsedValue>>;
5
+ export declare type BaseRecordSchema<RawKey extends string | number, RawValue, ParsedKey extends string | number, ParsedValue> = BaseSchema<OptionalRecord<RawKey, RawValue>, OptionalRecord<ParsedKey, ParsedValue>>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { ValidationError } from "../../Schema";
2
+ export declare class JsonError extends Error {
3
+ readonly errors: ValidationError[];
4
+ constructor(errors: ValidationError[]);
5
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JsonError = void 0;
4
+ const stringifyValidationErrors_1 = require("./stringifyValidationErrors");
5
+ class JsonError extends Error {
6
+ errors;
7
+ constructor(errors) {
8
+ super(errors.map(stringifyValidationErrors_1.stringifyValidationError).join("; "));
9
+ this.errors = errors;
10
+ Object.setPrototypeOf(this, JsonError.prototype);
11
+ }
12
+ }
13
+ exports.JsonError = JsonError;
@@ -0,0 +1,5 @@
1
+ import { ValidationError } from "../../Schema";
2
+ export declare class ParseError extends Error {
3
+ readonly errors: ValidationError[];
4
+ constructor(errors: ValidationError[]);
5
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ParseError = void 0;
4
+ const stringifyValidationErrors_1 = require("./stringifyValidationErrors");
5
+ class ParseError extends Error {
6
+ errors;
7
+ constructor(errors) {
8
+ super(errors.map(stringifyValidationErrors_1.stringifyValidationError).join("; "));
9
+ this.errors = errors;
10
+ Object.setPrototypeOf(this, ParseError.prototype);
11
+ }
12
+ }
13
+ exports.ParseError = ParseError;
@@ -0,0 +1,17 @@
1
+ import { BaseSchema, Schema, SchemaOptions } from "../../Schema";
2
+ export interface SchemaUtils<Raw, Parsed> {
3
+ optional: () => Schema<Raw | null | undefined, Parsed | undefined>;
4
+ transform: <Transformed>(transformer: SchemaTransformer<Parsed, Transformed>) => Schema<Raw, Transformed>;
5
+ parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Promise<Parsed>;
6
+ jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Promise<Raw>;
7
+ }
8
+ export interface SchemaTransformer<Parsed, Transformed> {
9
+ transform: (parsed: Parsed) => Transformed;
10
+ untransform: (transformed: any) => Parsed;
11
+ }
12
+ export declare function getSchemaUtils<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): SchemaUtils<Raw, Parsed>;
13
+ /**
14
+ * schema utils are defined in one file to resolve issues with circular imports
15
+ */
16
+ export declare function optional<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): Schema<Raw | null | undefined, Parsed | undefined>;
17
+ export declare function transform<Raw, Parsed, Transformed>(schema: BaseSchema<Raw, Parsed>, transformer: SchemaTransformer<Parsed, Transformed>): Schema<Raw, Transformed>;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transform = exports.optional = exports.getSchemaUtils = void 0;
4
+ const Schema_1 = require("../../Schema");
5
+ const JsonError_1 = require("./JsonError");
6
+ const ParseError_1 = require("./ParseError");
7
+ function getSchemaUtils(schema) {
8
+ return {
9
+ optional: () => optional(schema),
10
+ transform: (transformer) => transform(schema, transformer),
11
+ parseOrThrow: async (raw, opts) => {
12
+ const parsed = await schema.parse(raw, opts);
13
+ if (parsed.ok) {
14
+ return parsed.value;
15
+ }
16
+ throw new ParseError_1.ParseError(parsed.errors);
17
+ },
18
+ jsonOrThrow: async (parsed, opts) => {
19
+ const raw = await schema.json(parsed, opts);
20
+ if (raw.ok) {
21
+ return raw.value;
22
+ }
23
+ throw new JsonError_1.JsonError(raw.errors);
24
+ },
25
+ };
26
+ }
27
+ exports.getSchemaUtils = getSchemaUtils;
28
+ /**
29
+ * schema utils are defined in one file to resolve issues with circular imports
30
+ */
31
+ function optional(schema) {
32
+ const baseSchema = {
33
+ parse: (raw, opts) => {
34
+ if (raw == null) {
35
+ return {
36
+ ok: true,
37
+ value: undefined,
38
+ };
39
+ }
40
+ return schema.parse(raw, opts);
41
+ },
42
+ json: (parsed, opts) => {
43
+ if (parsed == null) {
44
+ return {
45
+ ok: true,
46
+ value: null,
47
+ };
48
+ }
49
+ return schema.json(parsed, opts);
50
+ },
51
+ getType: () => Schema_1.SchemaType.OPTIONAL,
52
+ };
53
+ return {
54
+ ...baseSchema,
55
+ ...getSchemaUtils(baseSchema),
56
+ };
57
+ }
58
+ exports.optional = optional;
59
+ function transform(schema, transformer) {
60
+ const baseSchema = {
61
+ parse: async (raw, opts) => {
62
+ const parsed = await schema.parse(raw, opts);
63
+ if (!parsed.ok) {
64
+ return parsed;
65
+ }
66
+ return {
67
+ ok: true,
68
+ value: transformer.transform(parsed.value),
69
+ };
70
+ },
71
+ json: async (transformed, opts) => {
72
+ const parsed = await transformer.untransform(transformed);
73
+ return schema.json(parsed, opts);
74
+ },
75
+ getType: () => schema.getType(),
76
+ };
77
+ return {
78
+ ...baseSchema,
79
+ ...getSchemaUtils(baseSchema),
80
+ };
81
+ }
82
+ exports.transform = transform;
@@ -1,2 +1,3 @@
1
1
  export { getSchemaUtils, optional, transform, type SchemaUtils } from "./getSchemaUtils";
2
- export { OPTIONAL_BRAND, type OptionalSchema } from "./types";
2
+ export { JsonError } from "./JsonError";
3
+ export { ParseError } from "./ParseError";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ParseError = exports.JsonError = exports.transform = exports.optional = exports.getSchemaUtils = void 0;
4
+ var getSchemaUtils_1 = require("./getSchemaUtils");
5
+ Object.defineProperty(exports, "getSchemaUtils", { enumerable: true, get: function () { return getSchemaUtils_1.getSchemaUtils; } });
6
+ Object.defineProperty(exports, "optional", { enumerable: true, get: function () { return getSchemaUtils_1.optional; } });
7
+ Object.defineProperty(exports, "transform", { enumerable: true, get: function () { return getSchemaUtils_1.transform; } });
8
+ var JsonError_1 = require("./JsonError");
9
+ Object.defineProperty(exports, "JsonError", { enumerable: true, get: function () { return JsonError_1.JsonError; } });
10
+ var ParseError_1 = require("./ParseError");
11
+ Object.defineProperty(exports, "ParseError", { enumerable: true, get: function () { return ParseError_1.ParseError; } });
@@ -0,0 +1,2 @@
1
+ import { ValidationError } from "../../Schema";
2
+ export declare function stringifyValidationError(error: ValidationError): string;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stringifyValidationError = void 0;
4
+ function stringifyValidationError(error) {
5
+ if (error.path.length === 0) {
6
+ return error.message;
7
+ }
8
+ return `${error.path.join(" -> ")}: ${error.message}`;
9
+ }
10
+ exports.stringifyValidationError = stringifyValidationError;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.set = void 0;
4
+ var set_1 = require("./set");
5
+ Object.defineProperty(exports, "set", { enumerable: true, get: function () { return set_1.set; } });
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.set = void 0;
4
+ const Schema_1 = require("../../Schema");
5
+ const list_1 = require("../list");
6
+ const schema_utils_1 = require("../schema-utils");
7
+ function set(schema) {
8
+ const listSchema = (0, list_1.list)(schema);
9
+ const baseSchema = {
10
+ parse: async (raw, opts) => {
11
+ const parsedList = await listSchema.parse(raw, opts);
12
+ if (parsedList.ok) {
13
+ return {
14
+ ok: true,
15
+ value: new Set(parsedList.value),
16
+ };
17
+ }
18
+ else {
19
+ return parsedList;
20
+ }
21
+ },
22
+ json: async (parsed, opts) => {
23
+ if (!(parsed instanceof Set)) {
24
+ return {
25
+ ok: false,
26
+ errors: [
27
+ {
28
+ path: [],
29
+ message: "Not a Set",
30
+ },
31
+ ],
32
+ };
33
+ }
34
+ const jsonList = await listSchema.json([...parsed], opts);
35
+ return jsonList;
36
+ },
37
+ getType: () => Schema_1.SchemaType.SET,
38
+ };
39
+ return {
40
+ ...baseSchema,
41
+ ...(0, schema_utils_1.getSchemaUtils)(baseSchema),
42
+ };
43
+ }
44
+ exports.set = set;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.discriminant = void 0;
4
+ function discriminant(parsedDiscriminant, rawDiscriminant) {
5
+ return {
6
+ parsedDiscriminant,
7
+ rawDiscriminant,
8
+ };
9
+ }
10
+ exports.discriminant = discriminant;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.union = exports.discriminant = void 0;
4
+ var discriminant_1 = require("./discriminant");
5
+ Object.defineProperty(exports, "discriminant", { enumerable: true, get: function () { return discriminant_1.discriminant; } });
6
+ var union_1 = require("./union");
7
+ Object.defineProperty(exports, "union", { enumerable: true, get: function () { return union_1.union; } });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.union = void 0;
4
+ const Schema_1 = require("../../Schema");
5
+ const isPlainObject_1 = require("../../utils/isPlainObject");
6
+ const keys_1 = require("../../utils/keys");
7
+ const enum_1 = require("../enum");
8
+ const object_like_1 = require("../object-like");
9
+ const schema_utils_1 = require("../schema-utils");
10
+ function union(discriminant, union) {
11
+ const rawDiscriminant = typeof discriminant === "string" ? discriminant : discriminant.rawDiscriminant;
12
+ const parsedDiscriminant = typeof discriminant === "string"
13
+ ? discriminant
14
+ : discriminant.parsedDiscriminant;
15
+ const discriminantValueSchema = (0, enum_1.enum_)((0, keys_1.keys)(union));
16
+ const baseSchema = {
17
+ parse: async (raw, opts) => {
18
+ return transformAndValidateUnion(raw, rawDiscriminant, parsedDiscriminant, (discriminantValue) => discriminantValueSchema.parse(discriminantValue, opts), (discriminantValue) => union[discriminantValue], opts?.allowUnknownKeys ?? false, (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.parse(additionalProperties, opts));
19
+ },
20
+ json: async (parsed, opts) => {
21
+ return transformAndValidateUnion(parsed, parsedDiscriminant, rawDiscriminant, (discriminantValue) => discriminantValueSchema.json(discriminantValue, opts), (discriminantValue) => union[discriminantValue], opts?.allowUnknownKeys ?? false, (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.json(additionalProperties, opts));
22
+ },
23
+ getType: () => Schema_1.SchemaType.UNION,
24
+ };
25
+ return {
26
+ ...baseSchema,
27
+ ...(0, schema_utils_1.getSchemaUtils)(baseSchema),
28
+ ...(0, object_like_1.getObjectLikeUtils)(baseSchema),
29
+ };
30
+ }
31
+ exports.union = union;
32
+ async function transformAndValidateUnion(value, discriminant, transformedDiscriminant, transformDiscriminantValue, getAdditionalPropertiesSchema, allowUnknownKeys, transformAdditionalProperties) {
33
+ if (!(0, isPlainObject_1.isPlainObject)(value)) {
34
+ return {
35
+ ok: false,
36
+ errors: [
37
+ {
38
+ path: [],
39
+ message: isPlainObject_1.NOT_AN_OBJECT_ERROR_MESSAGE,
40
+ },
41
+ ],
42
+ };
43
+ }
44
+ const { [discriminant]: discriminantValue, ...additionalProperties } = value;
45
+ if (discriminantValue == null) {
46
+ return {
47
+ ok: false,
48
+ errors: [
49
+ {
50
+ path: [],
51
+ message: `Missing discriminant ("${discriminant}")`,
52
+ },
53
+ ],
54
+ };
55
+ }
56
+ const transformedDiscriminantValue = await transformDiscriminantValue(discriminantValue);
57
+ if (!transformedDiscriminantValue.ok) {
58
+ return {
59
+ ok: false,
60
+ errors: transformedDiscriminantValue.errors.map((error) => ({
61
+ path: [discriminant, ...error.path],
62
+ message: error.message,
63
+ })),
64
+ };
65
+ }
66
+ const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value);
67
+ if (additionalPropertiesSchema == null) {
68
+ if (allowUnknownKeys) {
69
+ return {
70
+ ok: true,
71
+ value: {
72
+ [transformedDiscriminant]: transformedDiscriminantValue.value,
73
+ ...additionalProperties,
74
+ },
75
+ };
76
+ }
77
+ else {
78
+ return {
79
+ ok: false,
80
+ errors: [
81
+ {
82
+ path: [discriminant],
83
+ message: "Unrecognized discriminant value",
84
+ },
85
+ ],
86
+ };
87
+ }
88
+ }
89
+ const transformedAdditionalProperties = await transformAdditionalProperties(additionalProperties, additionalPropertiesSchema);
90
+ if (!transformedAdditionalProperties.ok) {
91
+ return transformedAdditionalProperties;
92
+ }
93
+ return {
94
+ ok: true,
95
+ value: {
96
+ [transformedDiscriminant]: discriminantValue,
97
+ ...transformedAdditionalProperties.value,
98
+ },
99
+ };
100
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./builders"), exports);
@@ -0,0 +1 @@
1
+ export declare type MaybePromise<T> = T | Promise<T>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export declare type OptionalRecord<K extends string | number, V> = Record<K, V | undefined>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export declare type addQuestionMarksToNullableProperties<T> = {
2
+ [K in OptionalKeys<T>]?: T[K];
3
+ } & Pick<T, RequiredKeys<T>>;
4
+ export declare type OptionalKeys<T> = {
5
+ [K in keyof T]-?: undefined extends T[K] ? K : null extends T[K] ? K : 1 extends (any extends T[K] ? 0 : 1) ? never : K;
6
+ }[keyof T];
7
+ export declare type RequiredKeys<T> = Exclude<keyof T, OptionalKeys<T>>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema";
2
+ export declare function createIdentitySchemaCreator<T>(schemaType: SchemaType, validate: (value: unknown, opts?: SchemaOptions) => MaybeValid<T>): () => Schema<T, T>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createIdentitySchemaCreator = void 0;
4
+ const schema_utils_1 = require("../builders/schema-utils");
5
+ function createIdentitySchemaCreator(schemaType, validate) {
6
+ return () => {
7
+ const baseSchema = {
8
+ parse: validate,
9
+ json: validate,
10
+ getType: () => schemaType,
11
+ };
12
+ return {
13
+ ...baseSchema,
14
+ ...(0, schema_utils_1.getSchemaUtils)(baseSchema),
15
+ };
16
+ };
17
+ }
18
+ exports.createIdentitySchemaCreator = createIdentitySchemaCreator;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.entries = void 0;
4
+ function entries(object) {
5
+ return Object.entries(object);
6
+ }
7
+ exports.entries = entries;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filterObject = void 0;
4
+ function filterObject(obj, keysToInclude) {
5
+ const keysToIncludeSet = new Set(keysToInclude);
6
+ return Object.entries(obj).reduce((acc, [key, value]) => {
7
+ if (keysToIncludeSet.has(key)) {
8
+ acc[key] = value;
9
+ }
10
+ return acc;
11
+ // eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter
12
+ }, {});
13
+ }
14
+ exports.filterObject = filterObject;
@@ -0,0 +1,2 @@
1
+ export declare const NOT_AN_OBJECT_ERROR_MESSAGE = "Not an object";
2
+ export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPlainObject = exports.NOT_AN_OBJECT_ERROR_MESSAGE = void 0;
4
+ exports.NOT_AN_OBJECT_ERROR_MESSAGE = "Not an object";
5
+ // borrowed from https://github.com/lodash/lodash/blob/master/isPlainObject.js
6
+ function isPlainObject(value) {
7
+ if (typeof value !== "object" || value === null) {
8
+ return false;
9
+ }
10
+ if (Object.getPrototypeOf(value) === null) {
11
+ return true;
12
+ }
13
+ let proto = value;
14
+ while (Object.getPrototypeOf(proto) !== null) {
15
+ proto = Object.getPrototypeOf(proto);
16
+ }
17
+ return Object.getPrototypeOf(value) === proto;
18
+ }
19
+ exports.isPlainObject = isPlainObject;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.keys = void 0;
4
+ function keys(object) {
5
+ return Object.keys(object);
6
+ }
7
+ exports.keys = keys;