effect-app 4.0.0-beta.26 → 4.0.0-beta.261

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 (368) hide show
  1. package/CHANGELOG.md +1194 -0
  2. package/dist/Array.d.ts +3 -2
  3. package/dist/Array.d.ts.map +1 -1
  4. package/dist/Array.js +4 -4
  5. package/dist/Chunk.d.ts +1 -1
  6. package/dist/Chunk.d.ts.map +1 -1
  7. package/dist/Config/SecretURL.d.ts +4 -2
  8. package/dist/Config/SecretURL.d.ts.map +1 -1
  9. package/dist/Config/SecretURL.js +3 -6
  10. package/dist/Config/internal/configSecretURL.d.ts +1 -1
  11. package/dist/Config/internal/configSecretURL.d.ts.map +1 -1
  12. package/dist/Config/internal/configSecretURL.js +2 -2
  13. package/dist/Config.d.ts +7 -0
  14. package/dist/Config.d.ts.map +1 -0
  15. package/dist/Config.js +6 -0
  16. package/dist/ConfigProvider.d.ts +39 -0
  17. package/dist/ConfigProvider.d.ts.map +1 -0
  18. package/dist/ConfigProvider.js +42 -0
  19. package/dist/Context.d.ts +42 -0
  20. package/dist/Context.d.ts.map +1 -0
  21. package/dist/Context.js +67 -0
  22. package/dist/DataDependencies.d.ts +158 -0
  23. package/dist/DataDependencies.d.ts.map +1 -0
  24. package/dist/DataDependencies.js +39 -0
  25. package/dist/Effect.d.ts +13 -12
  26. package/dist/Effect.d.ts.map +1 -1
  27. package/dist/Effect.js +5 -8
  28. package/dist/Emailer.d.ts +51 -0
  29. package/dist/Emailer.d.ts.map +1 -0
  30. package/dist/Emailer.js +7 -0
  31. package/dist/Function.d.ts +1 -1
  32. package/dist/Function.d.ts.map +1 -1
  33. package/dist/Inputify.type.d.ts +1 -1
  34. package/dist/Layer.d.ts +11 -7
  35. package/dist/Layer.d.ts.map +1 -1
  36. package/dist/Layer.js +3 -2
  37. package/dist/Model/Repository/Registry.d.ts +21 -0
  38. package/dist/Model/Repository/Registry.d.ts.map +1 -0
  39. package/dist/Model/Repository/Registry.js +18 -0
  40. package/dist/Model/Repository/ext.d.ts +60 -0
  41. package/dist/Model/Repository/ext.d.ts.map +1 -0
  42. package/dist/Model/Repository/ext.js +122 -0
  43. package/dist/Model/Repository/internal/internal.d.ts +63 -0
  44. package/dist/Model/Repository/internal/internal.d.ts.map +1 -0
  45. package/dist/Model/Repository/internal/internal.js +430 -0
  46. package/dist/Model/Repository/legacy.d.ts +21 -0
  47. package/dist/Model/Repository/legacy.d.ts.map +1 -0
  48. package/dist/Model/Repository/legacy.js +2 -0
  49. package/dist/Model/Repository/makeRepo.d.ts +54 -0
  50. package/dist/Model/Repository/makeRepo.d.ts.map +1 -0
  51. package/dist/Model/Repository/makeRepo.js +27 -0
  52. package/dist/Model/Repository/service.d.ts +121 -0
  53. package/dist/Model/Repository/service.d.ts.map +1 -0
  54. package/dist/Model/Repository/service.js +2 -0
  55. package/dist/Model/Repository/validation.d.ts +58 -0
  56. package/dist/Model/Repository/validation.d.ts.map +1 -0
  57. package/dist/Model/Repository/validation.js +32 -0
  58. package/dist/Model/Repository.d.ts +7 -0
  59. package/dist/Model/Repository.d.ts.map +1 -0
  60. package/dist/Model/Repository.js +7 -0
  61. package/dist/Model/dsl.d.ts +33 -0
  62. package/dist/Model/dsl.d.ts.map +1 -0
  63. package/dist/Model/dsl.js +43 -0
  64. package/dist/Model/filter/filterApi.d.ts +30 -0
  65. package/dist/Model/filter/filterApi.d.ts.map +1 -0
  66. package/dist/Model/filter/filterApi.js +2 -0
  67. package/dist/Model/filter/types/errors.d.ts +29 -0
  68. package/dist/Model/filter/types/errors.d.ts.map +1 -0
  69. package/dist/Model/filter/types/errors.js +2 -0
  70. package/dist/Model/filter/types/fields.d.ts +15 -0
  71. package/dist/Model/filter/types/fields.d.ts.map +1 -0
  72. package/dist/Model/filter/types/fields.js +2 -0
  73. package/dist/Model/filter/types/path/common.d.ts +316 -0
  74. package/dist/Model/filter/types/path/common.d.ts.map +1 -0
  75. package/dist/Model/filter/types/path/common.js +2 -0
  76. package/dist/Model/filter/types/path/eager.d.ts +95 -0
  77. package/dist/Model/filter/types/path/eager.d.ts.map +1 -0
  78. package/dist/Model/filter/types/path/eager.js +31 -0
  79. package/dist/Model/filter/types/path/index.d.ts +4 -0
  80. package/dist/Model/filter/types/path/index.d.ts.map +1 -0
  81. package/dist/Model/filter/types/path/index.js +3 -0
  82. package/dist/Model/filter/types/utils.d.ts +79 -0
  83. package/dist/Model/filter/types/utils.d.ts.map +1 -0
  84. package/dist/Model/filter/types/utils.js +2 -0
  85. package/dist/Model/filter/types/validator.d.ts +30 -0
  86. package/dist/Model/filter/types/validator.d.ts.map +1 -0
  87. package/dist/Model/filter/types/validator.js +2 -0
  88. package/dist/Model/filter/types.d.ts +5 -0
  89. package/dist/Model/filter/types.d.ts.map +1 -0
  90. package/dist/Model/filter/types.js +7 -0
  91. package/dist/Model/query/dsl.d.ts +493 -0
  92. package/dist/Model/query/dsl.d.ts.map +1 -0
  93. package/dist/Model/query/dsl.js +376 -0
  94. package/dist/Model/query/new-kid-interpreter.d.ts +136 -0
  95. package/dist/Model/query/new-kid-interpreter.d.ts.map +1 -0
  96. package/dist/Model/query/new-kid-interpreter.js +336 -0
  97. package/dist/Model/query.d.ts +15 -0
  98. package/dist/Model/query.d.ts.map +1 -0
  99. package/dist/Model/query.js +3 -0
  100. package/dist/Model.d.ts +5 -0
  101. package/dist/Model.d.ts.map +1 -0
  102. package/dist/Model.js +5 -0
  103. package/dist/NonEmptySet.d.ts +4 -2
  104. package/dist/NonEmptySet.d.ts.map +1 -1
  105. package/dist/NonEmptySet.js +2 -2
  106. package/dist/Option.d.ts +2 -1
  107. package/dist/Option.d.ts.map +1 -1
  108. package/dist/Option.js +3 -1
  109. package/dist/Pure.d.ts +8 -6
  110. package/dist/Pure.d.ts.map +1 -1
  111. package/dist/Pure.js +17 -14
  112. package/dist/QueueMaker.d.ts +13 -0
  113. package/dist/QueueMaker.d.ts.map +1 -0
  114. package/dist/QueueMaker.js +4 -0
  115. package/dist/RequestContext.d.ts +91 -0
  116. package/dist/RequestContext.d.ts.map +1 -0
  117. package/dist/RequestContext.js +49 -0
  118. package/dist/Schema/Class.d.ts +66 -20
  119. package/dist/Schema/Class.d.ts.map +1 -1
  120. package/dist/Schema/Class.js +192 -27
  121. package/dist/Schema/FastCheck.d.ts +1 -1
  122. package/dist/Schema/FastCheck.d.ts.map +1 -1
  123. package/dist/Schema/Methods.d.ts +1 -1
  124. package/dist/Schema/SchemaParser.d.ts +5 -0
  125. package/dist/Schema/SchemaParser.d.ts.map +1 -0
  126. package/dist/Schema/SchemaParser.js +6 -0
  127. package/dist/Schema/SpecialJsonSchema.d.ts +34 -0
  128. package/dist/Schema/SpecialJsonSchema.d.ts.map +1 -0
  129. package/dist/Schema/SpecialJsonSchema.js +118 -0
  130. package/dist/Schema/SpecialOpenApi.d.ts +32 -0
  131. package/dist/Schema/SpecialOpenApi.d.ts.map +1 -0
  132. package/dist/Schema/SpecialOpenApi.js +123 -0
  133. package/dist/Schema/brand.d.ts +5 -3
  134. package/dist/Schema/brand.d.ts.map +1 -1
  135. package/dist/Schema/brand.js +3 -1
  136. package/dist/Schema/email.d.ts +1 -1
  137. package/dist/Schema/email.d.ts.map +1 -1
  138. package/dist/Schema/email.js +7 -4
  139. package/dist/Schema/ext.d.ts +339 -56
  140. package/dist/Schema/ext.d.ts.map +1 -1
  141. package/dist/Schema/ext.js +358 -53
  142. package/dist/Schema/moreStrings.d.ts +83 -37
  143. package/dist/Schema/moreStrings.d.ts.map +1 -1
  144. package/dist/Schema/moreStrings.js +49 -42
  145. package/dist/Schema/numbers.d.ts +35 -22
  146. package/dist/Schema/numbers.d.ts.map +1 -1
  147. package/dist/Schema/numbers.js +55 -12
  148. package/dist/Schema/phoneNumber.d.ts +1 -1
  149. package/dist/Schema/phoneNumber.d.ts.map +1 -1
  150. package/dist/Schema/phoneNumber.js +6 -3
  151. package/dist/Schema/schema.d.ts +1 -1
  152. package/dist/Schema/strings.d.ts +19 -5
  153. package/dist/Schema/strings.d.ts.map +1 -1
  154. package/dist/Schema/strings.js +1 -5
  155. package/dist/Schema.d.ts +214 -8
  156. package/dist/Schema.d.ts.map +1 -1
  157. package/dist/Schema.js +190 -11
  158. package/dist/Set.d.ts +5 -2
  159. package/dist/Set.d.ts.map +1 -1
  160. package/dist/Set.js +3 -2
  161. package/dist/Store.d.ts +170 -0
  162. package/dist/Store.d.ts.map +1 -0
  163. package/dist/Store.js +121 -0
  164. package/dist/TypeTest.d.ts +1 -1
  165. package/dist/Types.d.ts +1 -1
  166. package/dist/Widen.type.d.ts +1 -1
  167. package/dist/_ext/Array.d.ts +2 -2
  168. package/dist/_ext/Array.d.ts.map +1 -1
  169. package/dist/_ext/Array.js +4 -2
  170. package/dist/_ext/date.d.ts +1 -1
  171. package/dist/_ext/misc.d.ts +5 -2
  172. package/dist/_ext/misc.d.ts.map +1 -1
  173. package/dist/_ext/misc.js +4 -2
  174. package/dist/_ext/ord.ext.d.ts +3 -2
  175. package/dist/_ext/ord.ext.d.ts.map +1 -1
  176. package/dist/_ext/ord.ext.js +2 -2
  177. package/dist/builtin.d.ts +1 -1
  178. package/dist/builtin.d.ts.map +1 -1
  179. package/dist/client/InvalidationKeys.d.ts +29 -0
  180. package/dist/client/InvalidationKeys.d.ts.map +1 -0
  181. package/dist/client/InvalidationKeys.js +33 -0
  182. package/dist/client/apiClientFactory.d.ts +20 -32
  183. package/dist/client/apiClientFactory.d.ts.map +1 -1
  184. package/dist/client/apiClientFactory.js +104 -34
  185. package/dist/client/clientFor.d.ts +53 -19
  186. package/dist/client/clientFor.d.ts.map +1 -1
  187. package/dist/client/clientFor.js +9 -1
  188. package/dist/client/errors.d.ts +49 -25
  189. package/dist/client/errors.d.ts.map +1 -1
  190. package/dist/client/errors.js +43 -17
  191. package/dist/client/makeClient.d.ts +495 -33
  192. package/dist/client/makeClient.d.ts.map +1 -1
  193. package/dist/client/makeClient.js +66 -24
  194. package/dist/client.d.ts +6 -5
  195. package/dist/client.d.ts.map +1 -1
  196. package/dist/client.js +2 -1
  197. package/dist/faker.d.ts +1 -1
  198. package/dist/faker.d.ts.map +1 -1
  199. package/dist/http/Request.d.ts +2 -2
  200. package/dist/http/Request.d.ts.map +1 -1
  201. package/dist/http/Request.js +2 -2
  202. package/dist/http/internal/lib.d.ts +1 -1
  203. package/dist/http.d.ts +1 -1
  204. package/dist/ids.d.ts +43 -15
  205. package/dist/ids.d.ts.map +1 -1
  206. package/dist/ids.js +30 -5
  207. package/dist/index.d.ts +7 -8
  208. package/dist/index.d.ts.map +1 -1
  209. package/dist/index.js +8 -8
  210. package/dist/logger.d.ts +1 -1
  211. package/dist/middleware.d.ts +14 -8
  212. package/dist/middleware.d.ts.map +1 -1
  213. package/dist/middleware.js +14 -8
  214. package/dist/rpc/Invalidation.d.ts +420 -0
  215. package/dist/rpc/Invalidation.d.ts.map +1 -0
  216. package/dist/rpc/Invalidation.js +168 -0
  217. package/dist/rpc/MiddlewareMaker.d.ts +12 -8
  218. package/dist/rpc/MiddlewareMaker.d.ts.map +1 -1
  219. package/dist/rpc/MiddlewareMaker.js +59 -38
  220. package/dist/rpc/RpcContextMap.d.ts +4 -4
  221. package/dist/rpc/RpcContextMap.d.ts.map +1 -1
  222. package/dist/rpc/RpcContextMap.js +4 -4
  223. package/dist/rpc/RpcMiddleware.d.ts +15 -11
  224. package/dist/rpc/RpcMiddleware.d.ts.map +1 -1
  225. package/dist/rpc/RpcMiddleware.js +1 -1
  226. package/dist/rpc.d.ts +2 -2
  227. package/dist/rpc.d.ts.map +1 -1
  228. package/dist/rpc.js +2 -2
  229. package/dist/runtime.d.ts +19 -0
  230. package/dist/runtime.d.ts.map +1 -0
  231. package/dist/runtime.js +40 -0
  232. package/dist/setupRequest.d.ts +19 -0
  233. package/dist/setupRequest.d.ts.map +1 -0
  234. package/dist/setupRequest.js +69 -0
  235. package/dist/toast.d.ts +51 -0
  236. package/dist/toast.d.ts.map +1 -0
  237. package/dist/toast.js +34 -0
  238. package/dist/transform.d.ts +2 -2
  239. package/dist/transform.d.ts.map +1 -1
  240. package/dist/transform.js +4 -5
  241. package/dist/utils/effectify.d.ts +2 -2
  242. package/dist/utils/effectify.d.ts.map +1 -1
  243. package/dist/utils/effectify.js +2 -2
  244. package/dist/utils/extend.d.ts +1 -1
  245. package/dist/utils/extend.d.ts.map +1 -1
  246. package/dist/utils/gen.d.ts +5 -5
  247. package/dist/utils/gen.d.ts.map +1 -1
  248. package/dist/utils/logLevel.d.ts +3 -3
  249. package/dist/utils/logLevel.d.ts.map +1 -1
  250. package/dist/utils/logger.d.ts +5 -4
  251. package/dist/utils/logger.d.ts.map +1 -1
  252. package/dist/utils/logger.js +4 -4
  253. package/dist/utils.d.ts +40 -45
  254. package/dist/utils.d.ts.map +1 -1
  255. package/dist/utils.js +19 -27
  256. package/dist/validation/validators.d.ts +1 -1
  257. package/dist/validation/validators.d.ts.map +1 -1
  258. package/dist/validation.d.ts +1 -1
  259. package/dist/validation.d.ts.map +1 -1
  260. package/dist/withToast.d.ts +30 -0
  261. package/dist/withToast.d.ts.map +1 -0
  262. package/dist/withToast.js +64 -0
  263. package/package.json +20 -245
  264. package/src/Array.ts +3 -3
  265. package/src/Config/SecretURL.ts +5 -2
  266. package/src/Config/internal/configSecretURL.ts +1 -1
  267. package/src/Config.ts +14 -0
  268. package/src/ConfigProvider.ts +48 -0
  269. package/src/{ServiceMap.ts → Context.ts} +56 -63
  270. package/src/Effect.ts +12 -14
  271. package/src/Emailer.ts +51 -0
  272. package/src/Layer.ts +10 -6
  273. package/src/Model/Repository/Registry.ts +34 -0
  274. package/src/Model/Repository/ext.ts +375 -0
  275. package/src/Model/Repository/internal/internal.ts +741 -0
  276. package/src/Model/Repository/legacy.ts +29 -0
  277. package/src/Model/Repository/makeRepo.ts +145 -0
  278. package/src/Model/Repository/service.ts +666 -0
  279. package/src/Model/Repository/validation.ts +31 -0
  280. package/src/Model/Repository.ts +6 -0
  281. package/src/Model/dsl.ts +129 -0
  282. package/src/Model/filter/filterApi.ts +60 -0
  283. package/src/Model/filter/types/errors.ts +47 -0
  284. package/src/Model/filter/types/fields.ts +50 -0
  285. package/src/Model/filter/types/path/common.ts +404 -0
  286. package/src/Model/filter/types/path/eager.ts +297 -0
  287. package/src/Model/filter/types/path/index.ts +4 -0
  288. package/src/Model/filter/types/utils.ts +128 -0
  289. package/src/Model/filter/types/validator.ts +46 -0
  290. package/src/Model/filter/types.ts +6 -0
  291. package/src/Model/query/dsl.ts +2694 -0
  292. package/src/Model/query/new-kid-interpreter.ts +484 -0
  293. package/src/Model/query.ts +13 -0
  294. package/src/Model.ts +4 -0
  295. package/src/NonEmptySet.ts +3 -1
  296. package/src/Option.ts +2 -0
  297. package/src/Pure.ts +21 -19
  298. package/src/QueueMaker.ts +19 -0
  299. package/src/RequestContext.ts +62 -0
  300. package/src/Schema/Class.ts +274 -68
  301. package/src/Schema/SchemaParser.ts +12 -0
  302. package/src/Schema/SpecialJsonSchema.ts +139 -0
  303. package/src/Schema/SpecialOpenApi.ts +130 -0
  304. package/src/Schema/brand.ts +22 -2
  305. package/src/Schema/email.ts +7 -2
  306. package/src/Schema/ext.ts +443 -88
  307. package/src/Schema/moreStrings.ts +146 -67
  308. package/src/Schema/numbers.ts +96 -27
  309. package/src/Schema/phoneNumber.ts +5 -1
  310. package/src/Schema/strings.ts +22 -13
  311. package/src/Schema.ts +374 -10
  312. package/src/Set.ts +5 -1
  313. package/src/Store.ts +277 -0
  314. package/src/_ext/Array.ts +3 -1
  315. package/src/_ext/misc.ts +4 -1
  316. package/src/_ext/ord.ext.ts +2 -1
  317. package/src/client/InvalidationKeys.ts +50 -0
  318. package/src/client/apiClientFactory.ts +230 -131
  319. package/src/client/clientFor.ts +102 -31
  320. package/src/client/errors.ts +52 -26
  321. package/src/client/makeClient.ts +592 -71
  322. package/src/client.ts +5 -4
  323. package/src/http/Request.ts +1 -1
  324. package/src/ids.ts +32 -5
  325. package/src/index.ts +7 -10
  326. package/src/middleware.ts +13 -9
  327. package/src/rpc/Invalidation.ts +261 -0
  328. package/src/rpc/MiddlewareMaker.ts +83 -75
  329. package/src/rpc/README.md +2 -2
  330. package/src/rpc/RpcContextMap.ts +6 -5
  331. package/src/rpc/RpcMiddleware.ts +18 -12
  332. package/src/rpc.ts +1 -1
  333. package/src/runtime.ts +56 -0
  334. package/src/setupRequest.ts +134 -0
  335. package/src/toast.ts +54 -0
  336. package/src/transform.ts +3 -3
  337. package/src/utils/effectify.ts +1 -1
  338. package/src/utils/gen.ts +8 -8
  339. package/src/utils/logLevel.ts +1 -1
  340. package/src/utils/logger.ts +4 -3
  341. package/src/utils.ts +62 -139
  342. package/src/withToast.ts +133 -0
  343. package/test/dist/rpc-dynamic-middleware.test.d.ts.map +1 -0
  344. package/test/dist/rpc.test.d.ts.map +1 -1
  345. package/test/dist/secretURL.test.d.ts.map +1 -0
  346. package/test/dist/special.test.d.ts.map +1 -0
  347. package/test/dist/stream-error.types.d.ts +2 -0
  348. package/test/dist/stream-error.types.d.ts.map +1 -0
  349. package/test/dist/stream-error.types.js +27 -0
  350. package/test/moreStrings.test.ts +1 -1
  351. package/test/rpc.test.ts +46 -6
  352. package/test/schema.test.ts +459 -30
  353. package/test/secretURL.test.ts +160 -0
  354. package/test/special.test.ts +1026 -0
  355. package/test/utils.test.ts +7 -7
  356. package/tsconfig.base.json +6 -5
  357. package/tsconfig.json +2 -1
  358. package/tsconfig.json.bak +2 -2
  359. package/tsconfig.src.json +29 -29
  360. package/tsconfig.test.json +2 -2
  361. package/dist/Operations.d.ts +0 -123
  362. package/dist/Operations.d.ts.map +0 -1
  363. package/dist/Operations.js +0 -29
  364. package/dist/ServiceMap.d.ts +0 -44
  365. package/dist/ServiceMap.d.ts.map +0 -1
  366. package/dist/ServiceMap.js +0 -91
  367. package/eslint.config.mjs +0 -26
  368. package/src/Operations.ts +0 -55
@@ -0,0 +1,62 @@
1
+ import * as Context from "./Context.js"
2
+ import { UserProfileId } from "./ids.js"
3
+ import * as S from "./Schema.js"
4
+ import { NonEmptyString255 } from "./Schema.js"
5
+
6
+ export const Locale = S.Literals(["en", "de"])
7
+ export type Locale = typeof Locale.Type
8
+
9
+ export class LocaleRef extends Context.Reference("Locale", { defaultValue: (): Locale => "en" }) {}
10
+
11
+ export class RequestContext extends S.Opaque<
12
+ RequestContext,
13
+ RequestContext.Encoded
14
+ >()(S.Struct({
15
+ span: S.Struct({
16
+ traceId: S.String,
17
+ spanId: S.String,
18
+ sampled: S.Boolean
19
+ }),
20
+ name: NonEmptyString255,
21
+ locale: Locale,
22
+ sourceId: S.optional(NonEmptyString255), // TODO?
23
+ namespace: NonEmptyString255,
24
+ /** @deprecated */
25
+ userProfile: S.optional(S.Struct({ sub: UserProfileId })) //
26
+ })) {
27
+ // static Tag = Context.Tag<RequestContext>()
28
+
29
+ static toMonitoring(this: void, self: RequestContext) {
30
+ return {
31
+ operationName: self.name,
32
+ locale: self.locale
33
+ }
34
+ }
35
+ }
36
+
37
+ export const spanAttributes = (ctx: Pick<RequestContext, "locale" | "namespace"> & Partial<RequestContext>) => ({
38
+ "code.function.name": ctx.name,
39
+ "app.locale": ctx.locale,
40
+ "app.tenant.id": ctx.namespace,
41
+ ...ctx.sourceId ? { "client.id": ctx.sourceId } : {},
42
+ ...(ctx.userProfile?.sub
43
+ ? {
44
+ "user.id": ctx
45
+ .userProfile
46
+ .sub,
47
+ "user.roles": "roles" in ctx
48
+ .userProfile
49
+ ? ctx.userProfile.roles
50
+ : undefined
51
+ }
52
+ : {})
53
+ })
54
+
55
+ // codegen:start {preset: model}
56
+ //
57
+ export namespace RequestContext {
58
+ export interface Encoded extends S.StructNestedEncoded<typeof RequestContext> {}
59
+ }
60
+ //
61
+ // codegen:end
62
+ //
@@ -1,105 +1,311 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { pipe, Struct as Struct2 } from "effect"
3
- import type { Struct } from "effect/Schema"
2
+ import type * as Cause from "effect/Cause"
3
+ import * as Effect from "effect/Effect"
4
+ import * as Option from "effect/Option"
4
5
  import * as S from "effect/Schema"
6
+ import * as SchemaAST from "effect/SchemaAST"
7
+ import * as SchemaIssue from "effect/SchemaIssue"
8
+ import { copyOrigin } from "../utils.js"
9
+ import { concurrencyUnbounded } from "./ext.js"
10
+ import * as SchemaParser from "./SchemaParser.js"
5
11
 
6
12
  type ClassAnnotations<Self> = S.Annotations.Declaration<Self, readonly [any]>
7
13
 
8
- export interface EnhancedClass<Self, SchemaS extends S.Top & { readonly fields: Struct.Fields }, Inherited>
9
- extends S.Class<Self, SchemaS, Inherited>, /* Reason for enhancement */ PropsExtensions<SchemaS["fields"]>
14
+ export interface EnhancedClass<Self, SchemaS extends S.Top & { readonly fields: S.Struct.Fields }, Inherited>
15
+ extends S.Class<Self, SchemaS, Inherited>
10
16
  {
17
+ /**
18
+ * See `copyOrigin` docs in `utils.ts` for return-type design details.
19
+ */
20
+ readonly copy: ReturnType<typeof copyOrigin<new(_: any) => Self>>
11
21
  }
12
22
  type MissingSelfGeneric<Usage extends string, Params extends string = ""> =
13
23
  `Missing \`Self\` generic - use \`class Self extends ${Usage}<Self>()(${Params}{ ... })\``
14
24
 
15
- export interface PropsExtensions<Fields> {
16
- // include: <NewProps extends S.Struct.Fields>(
17
- // fnc: (fields: Fields) => NewProps
18
- // ) => NewProps
19
- pick: <P extends keyof Fields>(...keys: readonly P[]) => Pick<Fields, P>
20
- omit: <P extends keyof Fields>(...keys: readonly P[]) => Omit<Fields, P>
21
- }
22
-
23
- type HasFields<Fields extends Struct.Fields> = {
25
+ type HasFields<Fields extends S.Struct.Fields> = {
24
26
  readonly fields: Fields
25
27
  } | {
26
28
  readonly from: HasFields<Fields>
27
29
  }
28
30
 
29
- export const Class: <Self = never>(identifier: string) => <Fields extends S.Struct.Fields>(
31
+ type ClassOptions = {
32
+ readonly strict?: boolean
33
+ }
34
+
35
+ export declare const ExtendedSchemaNoEncoded: unique symbol
36
+
37
+ export type ExtendedSchemaNoEncoded = typeof ExtendedSchemaNoEncoded
38
+
39
+ type WithEncoded<SchemaS extends S.Top, Encoded> = Omit<SchemaS, "Encoded"> & { readonly Encoded: Encoded }
40
+
41
+ type ExtendedSchema<SchemaS extends S.Top, Encoded> = [Encoded] extends [ExtendedSchemaNoEncoded] ? SchemaS
42
+ : WithEncoded<SchemaS, Encoded>
43
+
44
+ export type Class<Self, S extends S.Top & { readonly fields: S.Struct.Fields }, Inherited> = EnhancedClass<
45
+ Self,
46
+ S,
47
+ Inherited
48
+ >
49
+
50
+ /**
51
+ * Build a modified Declaration that accepts struct-matching values during
52
+ * encoding, given the original Declaration and the class's fields.
53
+ */
54
+ function makeRelaxedDeclaration(
55
+ ast: SchemaAST.Declaration,
56
+ fields: S.Struct.Fields,
57
+ cls: any
58
+ ): SchemaAST.Declaration {
59
+ const parseOptions = ast.annotations?.["parseOptions"] as SchemaAST.ParseOptions | undefined
60
+ const structSchema = S.Struct(fields)
61
+ const annotatedStruct = parseOptions ? S.toType(structSchema).annotate({ parseOptions }) : S.toType(structSchema)
62
+ const decodeStruct = SchemaParser.decodeUnknownEffect(annotatedStruct)
63
+
64
+ return new SchemaAST.Declaration(
65
+ ast.typeParameters,
66
+ () => (input: unknown, self: SchemaAST.Declaration, options: SchemaAST.ParseOptions) => {
67
+ if (input instanceof cls) {
68
+ return Effect.succeed(input)
69
+ }
70
+ if (input !== null && typeof input === "object") {
71
+ return decodeStruct(input, options)
72
+ }
73
+ return Effect.fail(new SchemaIssue.InvalidType(self, Option.some(input)))
74
+ },
75
+ ast.annotations,
76
+ ast.checks,
77
+ ast.encoding,
78
+ ast.context
79
+ )
80
+ }
81
+
82
+ // ---------------------------------------------------------------------------
83
+ // Class — like Schema.Class but with relaxed encoding
84
+ // ---------------------------------------------------------------------------
85
+
86
+ /**
87
+ * Like `Schema.Class`, but the resulting class accepts plain objects matching
88
+ * the struct schema during encoding — not only `instanceof` or type-id
89
+ * checks.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * import * as Schema from "effect/Schema"
94
+ * import { Class } from "./Class.js"
95
+ *
96
+ * class A extends Class<A>("A")({ a: Schema.String }) {}
97
+ *
98
+ * // Construction works as normal:
99
+ * new A({ a: "hello" })
100
+ *
101
+ * // Encoding accepts plain objects:
102
+ * Schema.encodeUnknownSync(A)({ a: "hello" }) // { a: "hello" }
103
+ * ```
104
+ */
105
+ export const Class: <Self = never, Encoded = ExtendedSchemaNoEncoded, Brand = {}>(
106
+ identifier: string
107
+ ) => <Fields extends S.Struct.Fields>(
30
108
  fieldsOr: Fields | HasFields<Fields>,
31
- annotations?: ClassAnnotations<Self>
109
+ annotations?: ClassAnnotations<Self>,
110
+ options?: ClassOptions
32
111
  ) => [Self] extends [never] ? MissingSelfGeneric<"Class">
33
112
  : EnhancedClass<
34
113
  Self,
35
- S.Struct<Fields>,
36
- {}
37
- > = (identifier) => (fields, annotations) => {
38
- const cls = S.Class as any
39
- return class extends cls(identifier)(fields, annotations) {
40
- // we disableValidation by default because we don't want class identifier validation (e.g if User over provides UserView, we want to be able to pass User), and most of our classes fields are already validated and branded..
41
- // this however also disables additional filter/check rules...
42
- constructor(a: any, b = { disableValidation: true }) {
43
- super(a, b)
114
+ ExtendedSchema<S.Struct<Fields>, Encoded>,
115
+ Brand
116
+ > = (identifier) => (fields, annotations, options) => {
117
+ const relaxed = options?.strict === false
118
+ // Build the original Schema.Class
119
+ const Base = (S.Class as any)(identifier)(fields, { ...concurrencyUnbounded, ...annotations })
120
+ // Get the original ast getter from the base class
121
+ const originalAstDescriptor = Object.getOwnPropertyDescriptor(Base, "ast")!
122
+
123
+ // Cache per-class to avoid recomputing
124
+ const astCache = new WeakMap<any, SchemaAST.Declaration>()
125
+ const copyCache = new WeakMap<any, ReturnType<typeof copyOrigin>>()
126
+
127
+ return class extends Base {
128
+ static get copy() {
129
+ let cached = copyCache.get(this)
130
+ if (cached === undefined) {
131
+ cached = copyOrigin(this)
132
+ copyCache.set(this, cached)
133
+ }
134
+ return cached
135
+ }
136
+ static get ast(): SchemaAST.Declaration {
137
+ let cached = astCache.get(this)
138
+ if (cached !== undefined) return cached
139
+ // Call the original getter with `this` bound to the actual user class,
140
+ // so getClassSchema(this) creates a schema that uses `new this(...)`.
141
+ const originalAst = originalAstDescriptor.get!.call(this) as SchemaAST.Declaration
142
+ cached = relaxed ? makeRelaxedDeclaration(originalAst, Base.fields, this) : originalAst
143
+ astCache.set(this, cached)
144
+ return cached
145
+ }
146
+ static mapFields(f: any, options?: any) {
147
+ return Base.mapFields(f, options).annotate(concurrencyUnbounded)
44
148
  }
45
- // static readonly include = include(fields)
46
- static readonly pick = (...selection: any[]) => pipe(this["fields"], Struct2.pick(selection))
47
- static readonly omit = (...selection: any[]) => pipe(this["fields"], Struct2.omit(selection))
48
149
  } as any
49
150
  }
50
151
 
51
- export const TaggedClass: <Self = never>(identifier?: string) => <Tag extends string, Fields extends S.Struct.Fields>(
152
+ // ---------------------------------------------------------------------------
153
+ // TaggedClass — like Schema.TaggedClass but with relaxed encoding
154
+ // ---------------------------------------------------------------------------
155
+
156
+ /**
157
+ * Like `Schema.TaggedClass`, but the resulting class accepts plain objects
158
+ * matching the struct schema during encoding.
159
+ *
160
+ * @example
161
+ * ```ts
162
+ * import * as Schema from "effect/Schema"
163
+ * import { TaggedClass } from "./Class.js"
164
+ *
165
+ * class Circle extends TaggedClass<Circle>()("Circle", {
166
+ * radius: Schema.Number
167
+ * }) {}
168
+ *
169
+ * Schema.encodeUnknownSync(Circle)({ _tag: "Circle", radius: 5 })
170
+ * ```
171
+ */
172
+ export const TaggedClass: <Self = never, Encoded = ExtendedSchemaNoEncoded, Brand = {}>(
173
+ identifier?: string
174
+ ) => <Tag extends string, Fields extends S.Struct.Fields>(
52
175
  tag: Tag,
53
176
  fieldsOr: Fields | HasFields<Fields>,
54
- annotations?: ClassAnnotations<Self>
55
- ) => [Self] extends [never] ? MissingSelfGeneric<"Class">
177
+ annotations?: ClassAnnotations<Self>,
178
+ options?: ClassOptions
179
+ ) => [Self] extends [never] ? MissingSelfGeneric<"TaggedClass">
56
180
  : EnhancedClass<
57
181
  Self,
58
- S.Struct<{ readonly _tag: S.tag<Tag> } & Fields>,
59
- {}
60
- > = (identifier) => (tag, fields, annotations) => {
61
- const cls = S.TaggedClass as any
62
- return class extends cls(identifier)(tag, fields, annotations) {
63
- // we disableValidation by default because we don't want class identifier validation (e.g if User over provides UserView, we want to be able to pass User), and most of our classes fields are already validated and branded..
64
- // this however also disables additional filter/check rules...
65
- constructor(a: any, b = { disableValidation: true }) {
66
- super(a, b)
182
+ ExtendedSchema<S.Struct<{ readonly _tag: S.tag<Tag> } & Fields>, Encoded>,
183
+ Brand
184
+ > = (identifier) => (tag, fields, annotations, options) => {
185
+ const relaxed = options?.strict === false
186
+ const Base = (S.TaggedClass as any)(identifier)(tag, fields, { ...concurrencyUnbounded, ...annotations })
187
+ const originalAstDescriptor = Object.getOwnPropertyDescriptor(Base, "ast")!
188
+ const astCache = new WeakMap<any, SchemaAST.Declaration>()
189
+ const copyCache = new WeakMap<any, ReturnType<typeof copyOrigin>>()
190
+
191
+ return class extends Base {
192
+ static get copy() {
193
+ let cached = copyCache.get(this)
194
+ if (cached === undefined) {
195
+ cached = copyOrigin(this)
196
+ copyCache.set(this, cached)
197
+ }
198
+ return cached
199
+ }
200
+ static get ast(): SchemaAST.Declaration {
201
+ let cached = astCache.get(this)
202
+ if (cached !== undefined) return cached
203
+ const originalAst = originalAstDescriptor.get!.call(this) as SchemaAST.Declaration
204
+ cached = relaxed ? makeRelaxedDeclaration(originalAst, Base.fields, this) : originalAst
205
+ astCache.set(this, cached)
206
+ return cached
207
+ }
208
+ static mapFields(f: any, options?: any) {
209
+ return Base.mapFields(f, options).annotate(concurrencyUnbounded)
67
210
  }
68
- // static readonly include = include(fields)
69
- static readonly pick = (...selection: any[]) => pipe(this["fields"], Struct2.pick(selection))
70
- static readonly omit = (...selection: any[]) => pipe(this["fields"], Struct2.omit(selection))
71
211
  } as any
72
212
  }
73
213
 
74
- export const ExtendedClass: <Self, _SelfFrom>(identifier: string) => <Fields extends S.Struct.Fields>(
214
+ // ---------------------------------------------------------------------------
215
+ // ErrorClass — like Schema.ErrorClass but with relaxed encoding
216
+ // ---------------------------------------------------------------------------
217
+
218
+ export const ErrorClass: <Self = never, Encoded = ExtendedSchemaNoEncoded, Brand = {}>(
219
+ identifier: string
220
+ ) => <Fields extends S.Struct.Fields>(
75
221
  fieldsOr: Fields | HasFields<Fields>,
76
- annotations?: ClassAnnotations<Self>
77
- ) => EnhancedClass<
78
- Self,
79
- S.Struct<Fields>,
80
- {}
81
- > = Class as any
82
-
83
- export interface EnhancedTaggedClass<Self, Tag extends string, Fields extends Struct.Fields, SelfFrom>
84
- extends
85
- EnhancedClass<
86
- Self,
87
- S.Struct<Fields> & { readonly Encoded: SelfFrom },
88
- {}
89
- >
90
- {
91
- readonly _tag: Tag
92
- }
222
+ annotations?: ClassAnnotations<Self>,
223
+ options?: ClassOptions
224
+ ) => [Self] extends [never] ? MissingSelfGeneric<"ErrorClass">
225
+ : EnhancedClass<
226
+ Self,
227
+ ExtendedSchema<S.Struct<Fields>, Encoded>,
228
+ Cause.YieldableError & Brand
229
+ > = (identifier) => (fields, annotations, options) => {
230
+ const relaxed = options?.strict === false
231
+ const Base = (S.ErrorClass as any)(identifier)(fields, { ...concurrencyUnbounded, ...annotations })
232
+ const originalAstDescriptor = Object.getOwnPropertyDescriptor(Base, "ast")!
233
+ const astCache = new WeakMap<any, SchemaAST.Declaration>()
234
+ const copyCache = new WeakMap<any, ReturnType<typeof copyOrigin>>()
235
+
236
+ return class extends Base {
237
+ static get copy() {
238
+ let cached = copyCache.get(this)
239
+ if (cached === undefined) {
240
+ cached = copyOrigin(this)
241
+ copyCache.set(this, cached)
242
+ }
243
+ return cached
244
+ }
245
+ static get ast(): SchemaAST.Declaration {
246
+ let cached = astCache.get(this)
247
+ if (cached !== undefined) return cached
248
+ const originalAst = originalAstDescriptor.get!.call(this) as SchemaAST.Declaration
249
+ cached = relaxed ? makeRelaxedDeclaration(originalAst, Base.fields, this) : originalAst
250
+ astCache.set(this, cached)
251
+ return cached
252
+ }
253
+ static mapFields(f: any, options?: any) {
254
+ return Base.mapFields(f, options).annotate(concurrencyUnbounded)
255
+ }
256
+ } as any
257
+ }
93
258
 
94
- export const ExtendedTaggedClass: <Self, SelfFrom>(
259
+ // ---------------------------------------------------------------------------
260
+ // TaggedErrorClass — like Schema.TaggedErrorClass but with relaxed encoding
261
+ // ---------------------------------------------------------------------------
262
+
263
+ export const TaggedErrorClass: <Self = never, Encoded = ExtendedSchemaNoEncoded, Brand = {}>(
95
264
  identifier?: string
96
265
  ) => <Tag extends string, Fields extends S.Struct.Fields>(
97
266
  tag: Tag,
98
267
  fieldsOr: Fields | HasFields<Fields>,
99
- annotations?: ClassAnnotations<Self>
100
- ) => EnhancedTaggedClass<
101
- Self,
102
- Tag,
103
- { readonly _tag: S.tag<Tag> } & Fields,
104
- SelfFrom
105
- > = TaggedClass as any
268
+ annotations?: ClassAnnotations<Self>,
269
+ options?: ClassOptions
270
+ ) => [Self] extends [never] ? MissingSelfGeneric<"TaggedErrorClass">
271
+ : EnhancedClass<
272
+ Self,
273
+ ExtendedSchema<S.Struct<{ readonly _tag: S.tag<Tag> } & Fields>, Encoded>,
274
+ Cause.YieldableError & Brand
275
+ > = (identifier) => (tag, fields, annotations, options) => {
276
+ const relaxed = options?.strict === false
277
+ const Base = (S.TaggedErrorClass as any)(identifier)(tag, fields, { ...concurrencyUnbounded, ...annotations })
278
+ const originalAstDescriptor = Object.getOwnPropertyDescriptor(Base, "ast")!
279
+ const astCache = new WeakMap<any, SchemaAST.Declaration>()
280
+ const copyCache = new WeakMap<any, ReturnType<typeof copyOrigin>>()
281
+
282
+ return class extends Base {
283
+ static get copy() {
284
+ let cached = copyCache.get(this)
285
+ if (cached === undefined) {
286
+ cached = copyOrigin(this)
287
+ copyCache.set(this, cached)
288
+ }
289
+ return cached
290
+ }
291
+ static get ast(): SchemaAST.Declaration {
292
+ let cached = astCache.get(this)
293
+ if (cached !== undefined) return cached
294
+ const originalAst = originalAstDescriptor.get!.call(this) as SchemaAST.Declaration
295
+ cached = relaxed ? makeRelaxedDeclaration(originalAst, Base.fields, this) : originalAst
296
+ astCache.set(this, cached)
297
+ return cached
298
+ }
299
+ static mapFields(f: any, options?: any) {
300
+ return Base.mapFields(f, options).annotate(concurrencyUnbounded)
301
+ }
302
+ } as any
303
+ }
304
+
305
+ export interface Opaque<Self, Encoded, SchemaS extends S.Top, Brand>
306
+ extends S.Opaque<Self, ExtendedSchema<SchemaS, Encoded>, Brand>
307
+ {}
308
+
309
+ export const Opaque: <Self, Encoded = ExtendedSchemaNoEncoded, Brand = {}>() => <S extends S.Top>(
310
+ schema: S
311
+ ) => Opaque<Self, Encoded, S, Brand> & Omit<S, keyof S.Top> = S.Opaque as any
@@ -0,0 +1,12 @@
1
+ import * as SchemaParser from "effect/SchemaParser"
2
+ import { withDefaultParseOptions } from "./ext.js"
3
+
4
+ export * from "effect/SchemaParser"
5
+
6
+ export const decodeEffectConcurrently: typeof SchemaParser.decodeEffect = withDefaultParseOptions(
7
+ SchemaParser.decodeEffect
8
+ )
9
+
10
+ export const decodeUnknownEffectConcurrently: typeof SchemaParser.decodeUnknownEffect = withDefaultParseOptions(
11
+ SchemaParser.decodeUnknownEffect
12
+ )
@@ -0,0 +1,139 @@
1
+ /**
2
+ * SpecialJsonSchema — A variant of Schema.toJsonSchemaDocument that
3
+ * post-processes the output (e.g. flattens simple allOf).
4
+ */
5
+ import type * as JsonSchema from "effect/JsonSchema"
6
+ import type * as Schema from "effect/Schema"
7
+ import * as SchemaRepresentation from "effect/SchemaRepresentation"
8
+
9
+ /**
10
+ * Converts a schema to a JSON Schema Document (draft-2020-12), with
11
+ * post-processing that flattens simple allOf entries.
12
+ */
13
+ export function specialJsonSchemaDocument(
14
+ schema: Schema.Top,
15
+ options?: Schema.ToJsonSchemaOptions
16
+ ): JsonSchema.Document<"draft-2020-12"> {
17
+ const doc = SchemaRepresentation.fromAST(schema.ast)
18
+ const jd = SchemaRepresentation.toJsonSchemaDocument(doc, options)
19
+ const processedDefs: JsonSchema.Definitions = {}
20
+ for (const [key, def] of Object.entries(jd.definitions)) {
21
+ processedDefs[key] = postProcessJsonSchema(def)
22
+ }
23
+ return {
24
+ dialect: "draft-2020-12",
25
+ schema: postProcessJsonSchema(jd.schema),
26
+ definitions: processedDefs
27
+ }
28
+ }
29
+
30
+ /**
31
+ * Flattens `allOf` entries into the parent when the parent already has a
32
+ * `type` and every `allOf` entry is a plain constraint object (no `$ref`,
33
+ * no `type`). Merged properties from `allOf` entries win on conflict.
34
+ */
35
+ export function flattenSimpleAllOf(obj: unknown): unknown {
36
+ if (obj === null || typeof obj !== "object") return obj
37
+
38
+ if (globalThis.Array.isArray(obj)) {
39
+ return obj.map(flattenSimpleAllOf)
40
+ }
41
+
42
+ const record = obj as Record<string, unknown>
43
+ const result: Record<string, unknown> = {}
44
+ for (const [key, value] of Object.entries(record)) {
45
+ result[key] = flattenSimpleAllOf(value)
46
+ }
47
+
48
+ if (result["type"] && globalThis.Array.isArray(result["allOf"])) {
49
+ const allOf = result["allOf"] as Array<Record<string, unknown>>
50
+ const canFlatten = allOf.every((entry) =>
51
+ typeof entry === "object" && entry !== null && !("$ref" in entry) && !("type" in entry)
52
+ )
53
+ if (canFlatten) {
54
+ const { allOf: _, ...rest } = result
55
+ const merged: Record<string, unknown> = { ...rest }
56
+ for (const entry of allOf) {
57
+ Object.assign(merged, entry)
58
+ }
59
+ return merged
60
+ }
61
+ }
62
+
63
+ return result
64
+ }
65
+
66
+ /**
67
+ * Recursively removes `additionalProperties: false` from JSON Schema objects.
68
+ * Only removes when the value is exactly `false` -- other values are left intact.
69
+ */
70
+ export function removeAdditionalPropertiesFalse(obj: unknown): unknown {
71
+ if (obj === null || typeof obj !== "object") return obj
72
+
73
+ if (globalThis.Array.isArray(obj)) {
74
+ return obj.map(removeAdditionalPropertiesFalse)
75
+ }
76
+
77
+ const record = obj as Record<string, unknown>
78
+ const result: Record<string, unknown> = {}
79
+ for (const [key, value] of Object.entries(record)) {
80
+ if (key === "additionalProperties" && value === false) continue
81
+ result[key] = removeAdditionalPropertiesFalse(value)
82
+ }
83
+
84
+ return result
85
+ }
86
+
87
+ /**
88
+ * Flattens nested `anyOf` entries: if an anyOf entry is itself just `{ anyOf: [...] }`
89
+ * with no other keys, its children are inlined. If only one item remains, the anyOf
90
+ * wrapper is removed entirely.
91
+ */
92
+ export function flattenNestedAnyOf(obj: unknown): unknown {
93
+ if (obj === null || typeof obj !== "object") return obj
94
+ if (globalThis.Array.isArray(obj)) return obj.map(flattenNestedAnyOf)
95
+
96
+ const record = obj as Record<string, unknown>
97
+ const result: Record<string, unknown> = {}
98
+ for (const [key, value] of Object.entries(record)) {
99
+ result[key] = flattenNestedAnyOf(value)
100
+ }
101
+
102
+ if (globalThis.Array.isArray(result["anyOf"])) {
103
+ const anyOf = result["anyOf"] as Array<unknown>
104
+ const flattened: Array<unknown> = []
105
+ for (const entry of anyOf) {
106
+ if (
107
+ typeof entry === "object"
108
+ && entry !== null
109
+ && !globalThis.Array.isArray(entry)
110
+ && "anyOf" in entry
111
+ && Object.keys(entry).length === 1
112
+ && globalThis.Array.isArray((entry as Record<string, unknown>)["anyOf"])
113
+ ) {
114
+ flattened.push(...(entry as Record<string, unknown>)["anyOf"] as Array<unknown>)
115
+ } else {
116
+ flattened.push(entry)
117
+ }
118
+ }
119
+ if (flattened.length === 1) {
120
+ const { anyOf: _, ...rest } = result
121
+ const single = flattened[0]
122
+ if (typeof single === "object" && single !== null && !globalThis.Array.isArray(single)) {
123
+ return { ...rest, ...single }
124
+ }
125
+ return single
126
+ }
127
+ result["anyOf"] = flattened
128
+ }
129
+
130
+ return result
131
+ }
132
+
133
+ /**
134
+ * Applies JSON Schema post-processing: flattens simple allOf,
135
+ * flattens nested anyOf, then strips additionalProperties: false.
136
+ */
137
+ export function postProcessJsonSchema(obj: JsonSchema.JsonSchema): JsonSchema.JsonSchema {
138
+ return removeAdditionalPropertiesFalse(flattenNestedAnyOf(flattenSimpleAllOf(obj))) as JsonSchema.JsonSchema
139
+ }