@adaptic/backend-legacy 0.0.1054 → 0.0.1056

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 (364) hide show
  1. package/Account.cjs +26 -0
  2. package/AccountLinkingRequest.cjs +26 -0
  3. package/AccountRiskMetrics.cjs +58 -0
  4. package/Action.cjs +26 -0
  5. package/AdaConversation.cjs +84 -0
  6. package/AdaMessage.cjs +29 -0
  7. package/Alert.cjs +58 -0
  8. package/Allocation.cjs +58 -0
  9. package/AlpacaAccount.cjs +52 -0
  10. package/Authenticator.cjs +26 -0
  11. package/AutoFollowRule.cjs +84 -0
  12. package/BrokerageAccount.cjs +116 -0
  13. package/Customer.cjs +55 -0
  14. package/DeskDecision.cjs +116 -0
  15. package/FeatureFlagOverride.cjs +26 -0
  16. package/Follow.cjs +84 -0
  17. package/Fund.cjs +197 -0
  18. package/FundAssignment.cjs +84 -0
  19. package/Holding.cjs +87 -0
  20. package/Investor.cjs +55 -0
  21. package/InvestorDocument.cjs +87 -0
  22. package/InvestorTransaction.cjs +87 -0
  23. package/InviteToken.cjs +29 -0
  24. package/LinkedProvider.cjs +26 -0
  25. package/LlmConfiguration.cjs +26 -0
  26. package/Mandate.cjs +142 -0
  27. package/MandateApproval.cjs +55 -0
  28. package/MandateRule.cjs +29 -0
  29. package/MandateVersion.cjs +113 -0
  30. package/NotificationDelivery.cjs +26 -0
  31. package/NotificationEvent.cjs +87 -0
  32. package/NotificationPreference.cjs +26 -0
  33. package/OrgMembership.cjs +26 -0
  34. package/Organization.cjs +174 -0
  35. package/PushSubscription.cjs +26 -0
  36. package/RiskEscalationEvent.cjs +58 -0
  37. package/Session.cjs +26 -0
  38. package/Strategy.cjs +15 -0
  39. package/StrategyHealthSnapshot.cjs +58 -0
  40. package/StrategySubscription.cjs +54 -0
  41. package/TaxDocument.cjs +87 -0
  42. package/Trade.cjs +23 -0
  43. package/TradingPolicy.cjs +58 -0
  44. package/User.cjs +110 -0
  45. package/UserTotp.cjs +26 -0
  46. package/WaitlistEntry.cjs +26 -0
  47. package/esm/Account.mjs +26 -0
  48. package/esm/AccountLinkingRequest.mjs +26 -0
  49. package/esm/AccountRiskMetrics.mjs +58 -0
  50. package/esm/Action.mjs +26 -0
  51. package/esm/AdaConversation.mjs +84 -0
  52. package/esm/AdaMessage.mjs +29 -0
  53. package/esm/Alert.mjs +58 -0
  54. package/esm/Allocation.mjs +58 -0
  55. package/esm/AlpacaAccount.mjs +52 -0
  56. package/esm/Authenticator.mjs +26 -0
  57. package/esm/AutoFollowRule.mjs +84 -0
  58. package/esm/BrokerageAccount.mjs +116 -0
  59. package/esm/Customer.mjs +55 -0
  60. package/esm/DeskDecision.mjs +116 -0
  61. package/esm/FeatureFlagOverride.mjs +26 -0
  62. package/esm/Follow.mjs +84 -0
  63. package/esm/Fund.mjs +197 -0
  64. package/esm/FundAssignment.mjs +84 -0
  65. package/esm/Holding.mjs +87 -0
  66. package/esm/Investor.mjs +55 -0
  67. package/esm/InvestorDocument.mjs +87 -0
  68. package/esm/InvestorTransaction.mjs +87 -0
  69. package/esm/InviteToken.mjs +29 -0
  70. package/esm/LinkedProvider.mjs +26 -0
  71. package/esm/LlmConfiguration.mjs +26 -0
  72. package/esm/Mandate.mjs +142 -0
  73. package/esm/MandateApproval.mjs +55 -0
  74. package/esm/MandateRule.mjs +29 -0
  75. package/esm/MandateVersion.mjs +113 -0
  76. package/esm/NotificationDelivery.mjs +26 -0
  77. package/esm/NotificationEvent.mjs +87 -0
  78. package/esm/NotificationPreference.mjs +26 -0
  79. package/esm/OrgMembership.mjs +26 -0
  80. package/esm/Organization.mjs +174 -0
  81. package/esm/PushSubscription.mjs +26 -0
  82. package/esm/RiskEscalationEvent.mjs +58 -0
  83. package/esm/Session.mjs +26 -0
  84. package/esm/Strategy.mjs +15 -0
  85. package/esm/StrategyHealthSnapshot.mjs +58 -0
  86. package/esm/StrategySubscription.mjs +54 -0
  87. package/esm/TaxDocument.mjs +87 -0
  88. package/esm/Trade.mjs +23 -0
  89. package/esm/TradingPolicy.mjs +58 -0
  90. package/esm/User.mjs +110 -0
  91. package/esm/UserTotp.mjs +26 -0
  92. package/esm/WaitlistEntry.mjs +26 -0
  93. package/esm/auth/membership-write-authority.d.ts +110 -0
  94. package/esm/auth/membership-write-authority.mjs +125 -0
  95. package/esm/auth/mutation-authorization.d.ts +23 -4
  96. package/esm/auth/mutation-authorization.mjs +36 -3
  97. package/esm/auth/nested-write-policy.d.ts +4 -0
  98. package/esm/auth/nested-write-policy.mjs +19 -0
  99. package/esm/auth/tenancy-scope.d.ts +50 -8
  100. package/esm/auth/tenancy-scope.mjs +87 -10
  101. package/esm/generated/selectionSets/Strategy.d.ts +1 -1
  102. package/esm/generated/selectionSets/Strategy.mjs +2 -0
  103. package/esm/generated/selectionSets/StrategySubscription.d.ts +1 -1
  104. package/esm/generated/selectionSets/StrategySubscription.mjs +2 -0
  105. package/esm/generated/typeStrings/Strategy.d.ts +1 -1
  106. package/esm/generated/typeStrings/Strategy.mjs +7 -0
  107. package/esm/generated/typeStrings/index.d.ts +1 -1
  108. package/esm/generated/typegraphql-prisma/enhance.mjs +79 -62
  109. package/esm/generated/typegraphql-prisma/enums/StrategyLifecycleState.d.ts +1 -0
  110. package/esm/generated/typegraphql-prisma/enums/StrategyLifecycleState.mjs +1 -0
  111. package/esm/generated/typegraphql-prisma/enums/StrategyScalarFieldEnum.d.ts +2 -0
  112. package/esm/generated/typegraphql-prisma/enums/StrategyScalarFieldEnum.mjs +2 -0
  113. package/esm/generated/typegraphql-prisma/models/Fund.d.ts +5 -0
  114. package/esm/generated/typegraphql-prisma/models/Fund.mjs +4 -0
  115. package/esm/generated/typegraphql-prisma/models/Strategy.d.ts +30 -1
  116. package/esm/generated/typegraphql-prisma/models/Strategy.mjs +43 -1
  117. package/esm/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindFirstStrategyArgs.d.ts +1 -1
  118. package/esm/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindFirstStrategyOrThrowArgs.d.ts +1 -1
  119. package/esm/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindManyStrategyArgs.d.ts +1 -1
  120. package/esm/generated/typegraphql-prisma/resolvers/crud/Strategy/args/GroupByStrategyArgs.d.ts +1 -1
  121. package/esm/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateFieldUpdateOperationsInput.d.ts +1 -1
  122. package/esm/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateFilter.d.ts +3 -3
  123. package/esm/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateWithAggregatesFilter.d.ts +3 -3
  124. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateNestedOneWithoutStrategiesInput.d.ts +9 -0
  125. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateNestedOneWithoutStrategiesInput.mjs +41 -0
  126. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateOrConnectWithoutStrategiesInput.d.ts +7 -0
  127. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateOrConnectWithoutStrategiesInput.mjs +33 -0
  128. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateWithoutStrategiesInput.d.ts +53 -0
  129. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateWithoutStrategiesInput.mjs +272 -0
  130. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateOneWithoutStrategiesNestedInput.d.ts +16 -0
  131. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateOneWithoutStrategiesNestedInput.mjs +72 -0
  132. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateToOneWithWhereWithoutStrategiesInput.d.ts +7 -0
  133. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateToOneWithWhereWithoutStrategiesInput.mjs +33 -0
  134. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateWithoutStrategiesInput.d.ts +60 -0
  135. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateWithoutStrategiesInput.mjs +278 -0
  136. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpsertWithoutStrategiesInput.d.ts +9 -0
  137. package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpsertWithoutStrategiesInput.mjs +41 -0
  138. package/esm/generated/typegraphql-prisma/resolvers/inputs/NestedEnumStrategyLifecycleStateFilter.d.ts +3 -3
  139. package/esm/generated/typegraphql-prisma/resolvers/inputs/NestedEnumStrategyLifecycleStateWithAggregatesFilter.d.ts +3 -3
  140. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCountOrderByAggregateInput.d.ts +2 -0
  141. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCountOrderByAggregateInput.mjs +14 -0
  142. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateInput.d.ts +2 -1
  143. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateInput.mjs +7 -0
  144. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInput.d.ts +20 -0
  145. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInput.mjs +134 -0
  146. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInputEnvelope.d.ts +6 -0
  147. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInputEnvelope.mjs +32 -0
  148. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyInput.d.ts +3 -1
  149. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyInput.mjs +14 -0
  150. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyOwnerInput.d.ts +3 -1
  151. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyOwnerInput.mjs +14 -0
  152. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateNestedManyWithoutFundInput.d.ts +11 -0
  153. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateNestedManyWithoutFundInput.mjs +49 -0
  154. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateOrConnectWithoutFundInput.d.ts +7 -0
  155. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateOrConnectWithoutFundInput.mjs +33 -0
  156. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutFundInput.d.ts +25 -0
  157. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutFundInput.mjs +151 -0
  158. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutOwnerInput.d.ts +2 -1
  159. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutOwnerInput.mjs +7 -0
  160. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutSubscriptionsInput.d.ts +2 -1
  161. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutSubscriptionsInput.mjs +7 -0
  162. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutTradesInput.d.ts +2 -1
  163. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutTradesInput.mjs +7 -0
  164. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyMaxOrderByAggregateInput.d.ts +2 -0
  165. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyMaxOrderByAggregateInput.mjs +14 -0
  166. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyMinOrderByAggregateInput.d.ts +2 -0
  167. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyMinOrderByAggregateInput.mjs +14 -0
  168. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithAggregationInput.d.ts +2 -0
  169. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithAggregationInput.mjs +14 -0
  170. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithRelationInput.d.ts +2 -0
  171. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithRelationInput.mjs +14 -0
  172. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereInput.d.ts +2 -0
  173. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereInput.mjs +14 -0
  174. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereWithAggregatesInput.d.ts +2 -0
  175. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereWithAggregatesInput.mjs +14 -0
  176. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateInput.d.ts +1 -0
  177. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateInput.mjs +7 -0
  178. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyMutationInput.d.ts +1 -0
  179. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyMutationInput.mjs +7 -0
  180. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithWhereWithoutFundInput.d.ts +7 -0
  181. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithWhereWithoutFundInput.mjs +33 -0
  182. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithoutFundNestedInput.d.ts +22 -0
  183. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithoutFundNestedInput.mjs +102 -0
  184. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithWhereUniqueWithoutFundInput.d.ts +7 -0
  185. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithWhereUniqueWithoutFundInput.mjs +33 -0
  186. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutFundInput.d.ts +33 -0
  187. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutFundInput.mjs +155 -0
  188. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutOwnerInput.d.ts +1 -0
  189. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutOwnerInput.mjs +7 -0
  190. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutSubscriptionsInput.d.ts +1 -0
  191. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutSubscriptionsInput.mjs +7 -0
  192. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutTradesInput.d.ts +1 -0
  193. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutTradesInput.mjs +7 -0
  194. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpsertWithWhereUniqueWithoutFundInput.d.ts +9 -0
  195. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpsertWithWhereUniqueWithoutFundInput.mjs +41 -0
  196. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereInput.d.ts +2 -0
  197. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereInput.mjs +14 -0
  198. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereUniqueInput.d.ts +2 -0
  199. package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereUniqueInput.mjs +14 -0
  200. package/esm/generated/typegraphql-prisma/resolvers/inputs/index.d.ts +17 -0
  201. package/esm/generated/typegraphql-prisma/resolvers/inputs/index.mjs +17 -0
  202. package/esm/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnStrategy.d.ts +7 -1
  203. package/esm/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnStrategy.mjs +31 -0
  204. package/esm/generated/typegraphql-prisma/resolvers/outputs/FundCount.d.ts +3 -0
  205. package/esm/generated/typegraphql-prisma/resolvers/outputs/FundCount.mjs +16 -0
  206. package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyCountAggregate.d.ts +2 -0
  207. package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyCountAggregate.mjs +14 -0
  208. package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyGroupBy.d.ts +3 -1
  209. package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyGroupBy.mjs +14 -0
  210. package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyMaxAggregate.d.ts +3 -1
  211. package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyMaxAggregate.mjs +14 -0
  212. package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyMinAggregate.d.ts +3 -1
  213. package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyMinAggregate.mjs +14 -0
  214. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/CreateManyAndReturnStrategyFundArgs.d.ts +5 -0
  215. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/CreateManyAndReturnStrategyFundArgs.mjs +25 -0
  216. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/FundCountStrategiesArgs.d.ts +5 -0
  217. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/FundCountStrategiesArgs.mjs +25 -0
  218. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/index.d.ts +2 -0
  219. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/index.mjs +2 -0
  220. package/esm/generated/typegraphql-prisma/resolvers/relations/User/args/UserOwnedStrategiesArgs.d.ts +1 -1
  221. package/esm/middleware/__tests__/mutation-auth-guard.harness.d.ts +2 -0
  222. package/esm/middleware/__tests__/mutation-auth-guard.harness.mjs +136 -10
  223. package/esm/middleware/mutation-auth-guard.d.ts +4 -2
  224. package/esm/middleware/mutation-auth-guard.mjs +20 -2
  225. package/esm/middleware/mutation-membership-facts.d.ts +133 -0
  226. package/esm/middleware/mutation-membership-facts.mjs +271 -0
  227. package/esm/middleware/mutation-tenant-facts.d.ts +4 -2
  228. package/esm/middleware/mutation-tenant-facts.mjs +4 -2
  229. package/esm/middleware/tenancy-scoping.mjs +15 -3
  230. package/esm/resolvers/custom/StrategyDraftResolver.d.ts +44 -0
  231. package/esm/resolvers/custom/StrategyDraftResolver.mjs +188 -0
  232. package/esm/resolvers/custom/index.d.ts +1 -0
  233. package/esm/resolvers/custom/index.mjs +1 -0
  234. package/esm/resolvers/custom/strategy-draft-service.d.ts +180 -0
  235. package/esm/resolvers/custom/strategy-draft-service.mjs +254 -0
  236. package/esm/resolvers/custom/strategy-spec-hash.d.ts +32 -0
  237. package/esm/resolvers/custom/strategy-spec-hash.mjs +54 -0
  238. package/esm/tests/strategy-fund-tenancy.harness.d.ts +20 -0
  239. package/esm/tests/strategy-fund-tenancy.harness.mjs +212 -0
  240. package/generated/typeStrings/Strategy.cjs +7 -0
  241. package/generated/typeStrings/Strategy.d.ts +1 -1
  242. package/generated/typeStrings/index.d.ts +1 -1
  243. package/generated/typegraphql-prisma/enhance.cjs +79 -62
  244. package/generated/typegraphql-prisma/enums/StrategyLifecycleState.cjs +1 -0
  245. package/generated/typegraphql-prisma/enums/StrategyLifecycleState.d.ts +1 -0
  246. package/generated/typegraphql-prisma/enums/StrategyScalarFieldEnum.cjs +2 -0
  247. package/generated/typegraphql-prisma/enums/StrategyScalarFieldEnum.d.ts +2 -0
  248. package/generated/typegraphql-prisma/models/Fund.d.ts +5 -0
  249. package/generated/typegraphql-prisma/models/Strategy.cjs +15 -1
  250. package/generated/typegraphql-prisma/models/Strategy.d.ts +30 -1
  251. package/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindFirstStrategyArgs.d.ts +1 -1
  252. package/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindFirstStrategyOrThrowArgs.d.ts +1 -1
  253. package/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindManyStrategyArgs.d.ts +1 -1
  254. package/generated/typegraphql-prisma/resolvers/crud/Strategy/args/GroupByStrategyArgs.d.ts +1 -1
  255. package/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateFieldUpdateOperationsInput.d.ts +1 -1
  256. package/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateFilter.d.ts +3 -3
  257. package/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateWithAggregatesFilter.d.ts +3 -3
  258. package/generated/typegraphql-prisma/resolvers/inputs/FundCreateNestedOneWithoutStrategiesInput.cjs +74 -0
  259. package/generated/typegraphql-prisma/resolvers/inputs/FundCreateNestedOneWithoutStrategiesInput.d.ts +9 -0
  260. package/generated/typegraphql-prisma/resolvers/inputs/FundCreateOrConnectWithoutStrategiesInput.cjs +67 -0
  261. package/generated/typegraphql-prisma/resolvers/inputs/FundCreateOrConnectWithoutStrategiesInput.d.ts +7 -0
  262. package/generated/typegraphql-prisma/resolvers/inputs/FundCreateWithoutStrategiesInput.cjs +274 -0
  263. package/generated/typegraphql-prisma/resolvers/inputs/FundCreateWithoutStrategiesInput.d.ts +53 -0
  264. package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateOneWithoutStrategiesNestedInput.cjs +101 -0
  265. package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateOneWithoutStrategiesNestedInput.d.ts +16 -0
  266. package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateToOneWithWhereWithoutStrategiesInput.cjs +67 -0
  267. package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateToOneWithWhereWithoutStrategiesInput.d.ts +7 -0
  268. package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateWithoutStrategiesInput.cjs +280 -0
  269. package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateWithoutStrategiesInput.d.ts +60 -0
  270. package/generated/typegraphql-prisma/resolvers/inputs/FundUpsertWithoutStrategiesInput.cjs +74 -0
  271. package/generated/typegraphql-prisma/resolvers/inputs/FundUpsertWithoutStrategiesInput.d.ts +9 -0
  272. package/generated/typegraphql-prisma/resolvers/inputs/NestedEnumStrategyLifecycleStateFilter.d.ts +3 -3
  273. package/generated/typegraphql-prisma/resolvers/inputs/NestedEnumStrategyLifecycleStateWithAggregatesFilter.d.ts +3 -3
  274. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCountOrderByAggregateInput.cjs +12 -0
  275. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCountOrderByAggregateInput.d.ts +2 -0
  276. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateInput.cjs +6 -0
  277. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateInput.d.ts +2 -1
  278. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInput.cjs +154 -0
  279. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInput.d.ts +20 -0
  280. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInputEnvelope.cjs +66 -0
  281. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInputEnvelope.d.ts +6 -0
  282. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyInput.cjs +12 -0
  283. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyInput.d.ts +3 -1
  284. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyOwnerInput.cjs +12 -0
  285. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyOwnerInput.d.ts +3 -1
  286. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateNestedManyWithoutFundInput.cjs +81 -0
  287. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateNestedManyWithoutFundInput.d.ts +11 -0
  288. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateOrConnectWithoutFundInput.cjs +67 -0
  289. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateOrConnectWithoutFundInput.d.ts +7 -0
  290. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutFundInput.cjs +169 -0
  291. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutFundInput.d.ts +25 -0
  292. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutOwnerInput.cjs +6 -0
  293. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutOwnerInput.d.ts +2 -1
  294. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutSubscriptionsInput.cjs +6 -0
  295. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutSubscriptionsInput.d.ts +2 -1
  296. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutTradesInput.cjs +6 -0
  297. package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutTradesInput.d.ts +2 -1
  298. package/generated/typegraphql-prisma/resolvers/inputs/StrategyMaxOrderByAggregateInput.cjs +12 -0
  299. package/generated/typegraphql-prisma/resolvers/inputs/StrategyMaxOrderByAggregateInput.d.ts +2 -0
  300. package/generated/typegraphql-prisma/resolvers/inputs/StrategyMinOrderByAggregateInput.cjs +12 -0
  301. package/generated/typegraphql-prisma/resolvers/inputs/StrategyMinOrderByAggregateInput.d.ts +2 -0
  302. package/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithAggregationInput.cjs +12 -0
  303. package/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithAggregationInput.d.ts +2 -0
  304. package/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithRelationInput.cjs +12 -0
  305. package/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithRelationInput.d.ts +2 -0
  306. package/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereInput.cjs +12 -0
  307. package/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereInput.d.ts +2 -0
  308. package/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereWithAggregatesInput.cjs +12 -0
  309. package/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereWithAggregatesInput.d.ts +2 -0
  310. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateInput.cjs +6 -0
  311. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateInput.d.ts +1 -0
  312. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyMutationInput.cjs +6 -0
  313. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyMutationInput.d.ts +1 -0
  314. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithWhereWithoutFundInput.cjs +67 -0
  315. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithWhereWithoutFundInput.d.ts +7 -0
  316. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithoutFundNestedInput.cjs +127 -0
  317. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithoutFundNestedInput.d.ts +22 -0
  318. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithWhereUniqueWithoutFundInput.cjs +67 -0
  319. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithWhereUniqueWithoutFundInput.d.ts +7 -0
  320. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutFundInput.cjs +173 -0
  321. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutFundInput.d.ts +33 -0
  322. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutOwnerInput.cjs +6 -0
  323. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutOwnerInput.d.ts +1 -0
  324. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutSubscriptionsInput.cjs +6 -0
  325. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutSubscriptionsInput.d.ts +1 -0
  326. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutTradesInput.cjs +6 -0
  327. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutTradesInput.d.ts +1 -0
  328. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpsertWithWhereUniqueWithoutFundInput.cjs +74 -0
  329. package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpsertWithWhereUniqueWithoutFundInput.d.ts +9 -0
  330. package/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereInput.cjs +12 -0
  331. package/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereInput.d.ts +2 -0
  332. package/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereUniqueInput.cjs +12 -0
  333. package/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereUniqueInput.d.ts +2 -0
  334. package/generated/typegraphql-prisma/resolvers/inputs/index.cjs +84 -50
  335. package/generated/typegraphql-prisma/resolvers/inputs/index.d.ts +17 -0
  336. package/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnStrategy.cjs +28 -0
  337. package/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnStrategy.d.ts +7 -1
  338. package/generated/typegraphql-prisma/resolvers/outputs/FundCount.cjs +15 -0
  339. package/generated/typegraphql-prisma/resolvers/outputs/FundCount.d.ts +3 -0
  340. package/generated/typegraphql-prisma/resolvers/outputs/StrategyCountAggregate.cjs +12 -0
  341. package/generated/typegraphql-prisma/resolvers/outputs/StrategyCountAggregate.d.ts +2 -0
  342. package/generated/typegraphql-prisma/resolvers/outputs/StrategyGroupBy.cjs +12 -0
  343. package/generated/typegraphql-prisma/resolvers/outputs/StrategyGroupBy.d.ts +3 -1
  344. package/generated/typegraphql-prisma/resolvers/outputs/StrategyMaxAggregate.cjs +12 -0
  345. package/generated/typegraphql-prisma/resolvers/outputs/StrategyMaxAggregate.d.ts +3 -1
  346. package/generated/typegraphql-prisma/resolvers/outputs/StrategyMinAggregate.cjs +12 -0
  347. package/generated/typegraphql-prisma/resolvers/outputs/StrategyMinAggregate.d.ts +3 -1
  348. package/generated/typegraphql-prisma/resolvers/outputs/args/CreateManyAndReturnStrategyFundArgs.cjs +60 -0
  349. package/generated/typegraphql-prisma/resolvers/outputs/args/CreateManyAndReturnStrategyFundArgs.d.ts +5 -0
  350. package/generated/typegraphql-prisma/resolvers/outputs/args/FundCountStrategiesArgs.cjs +60 -0
  351. package/generated/typegraphql-prisma/resolvers/outputs/args/FundCountStrategiesArgs.d.ts +5 -0
  352. package/generated/typegraphql-prisma/resolvers/outputs/args/index.cjs +7 -3
  353. package/generated/typegraphql-prisma/resolvers/outputs/args/index.d.ts +2 -0
  354. package/generated/typegraphql-prisma/resolvers/relations/User/args/UserOwnedStrategiesArgs.d.ts +1 -1
  355. package/package.json +1 -1
  356. package/resolvers/custom/StrategyDraftResolver.cjs +221 -0
  357. package/resolvers/custom/StrategyDraftResolver.d.ts +44 -0
  358. package/resolvers/custom/index.cjs +5 -1
  359. package/resolvers/custom/index.d.ts +1 -0
  360. package/resolvers/custom/strategy-draft-service.cjs +262 -0
  361. package/resolvers/custom/strategy-draft-service.d.ts +180 -0
  362. package/resolvers/custom/strategy-spec-hash.cjs +58 -0
  363. package/resolvers/custom/strategy-spec-hash.d.ts +32 -0
  364. package/server.cjs +1 -0
package/esm/UserTotp.mjs CHANGED
@@ -2679,6 +2679,7 @@ export const UserTotp = {
2679
2679
  kind: item.kind !== undefined ? item.kind : undefined,
2680
2680
  spec: item.spec !== undefined ? item.spec : undefined,
2681
2681
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
2682
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
2682
2683
  desk: item.desk !== undefined ? item.desk : undefined,
2683
2684
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
2684
2685
  subscriptions: item.subscriptions ?
@@ -11007,6 +11008,9 @@ export const UserTotp = {
11007
11008
  ownerUserId: item.ownerUserId !== undefined ? {
11008
11009
  equals: item.ownerUserId
11009
11010
  } : undefined,
11011
+ fundId: item.fundId !== undefined ? {
11012
+ equals: item.fundId
11013
+ } : undefined,
11010
11014
  },
11011
11015
  update: {
11012
11016
  id: item.id !== undefined ? {
@@ -11037,6 +11041,9 @@ export const UserTotp = {
11037
11041
  backtestJobId: item.backtestJobId !== undefined ? {
11038
11042
  set: item.backtestJobId
11039
11043
  } : undefined,
11044
+ backtestSpecHash: item.backtestSpecHash !== undefined ? {
11045
+ set: item.backtestSpecHash
11046
+ } : undefined,
11040
11047
  desk: item.desk !== undefined ? {
11041
11048
  set: item.desk
11042
11049
  } : undefined,
@@ -11299,6 +11306,7 @@ export const UserTotp = {
11299
11306
  kind: item.kind !== undefined ? item.kind : undefined,
11300
11307
  spec: item.spec !== undefined ? item.spec : undefined,
11301
11308
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
11309
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
11302
11310
  desk: item.desk !== undefined ? item.desk : undefined,
11303
11311
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
11304
11312
  subscriptions: item.subscriptions ?
@@ -14773,6 +14781,7 @@ export const UserTotp = {
14773
14781
  kind: item.kind !== undefined ? item.kind : undefined,
14774
14782
  spec: item.spec !== undefined ? item.spec : undefined,
14775
14783
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
14784
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
14776
14785
  desk: item.desk !== undefined ? item.desk : undefined,
14777
14786
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
14778
14787
  subscriptions: item.subscriptions ?
@@ -17944,6 +17953,7 @@ export const UserTotp = {
17944
17953
  kind: item.kind !== undefined ? item.kind : undefined,
17945
17954
  spec: item.spec !== undefined ? item.spec : undefined,
17946
17955
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
17956
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
17947
17957
  desk: item.desk !== undefined ? item.desk : undefined,
17948
17958
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
17949
17959
  subscriptions: item.subscriptions ?
@@ -25983,6 +25993,9 @@ export const UserTotp = {
25983
25993
  ownerUserId: item.ownerUserId !== undefined ? {
25984
25994
  equals: item.ownerUserId
25985
25995
  } : undefined,
25996
+ fundId: item.fundId !== undefined ? {
25997
+ equals: item.fundId
25998
+ } : undefined,
25986
25999
  },
25987
26000
  update: {
25988
26001
  id: item.id !== undefined ? {
@@ -26013,6 +26026,9 @@ export const UserTotp = {
26013
26026
  backtestJobId: item.backtestJobId !== undefined ? {
26014
26027
  set: item.backtestJobId
26015
26028
  } : undefined,
26029
+ backtestSpecHash: item.backtestSpecHash !== undefined ? {
26030
+ set: item.backtestSpecHash
26031
+ } : undefined,
26016
26032
  desk: item.desk !== undefined ? {
26017
26033
  set: item.desk
26018
26034
  } : undefined,
@@ -26275,6 +26291,7 @@ export const UserTotp = {
26275
26291
  kind: item.kind !== undefined ? item.kind : undefined,
26276
26292
  spec: item.spec !== undefined ? item.spec : undefined,
26277
26293
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
26294
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
26278
26295
  desk: item.desk !== undefined ? item.desk : undefined,
26279
26296
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
26280
26297
  subscriptions: item.subscriptions ?
@@ -29749,6 +29766,7 @@ export const UserTotp = {
29749
29766
  kind: item.kind !== undefined ? item.kind : undefined,
29750
29767
  spec: item.spec !== undefined ? item.spec : undefined,
29751
29768
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
29769
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
29752
29770
  desk: item.desk !== undefined ? item.desk : undefined,
29753
29771
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
29754
29772
  subscriptions: item.subscriptions ?
@@ -37936,6 +37954,9 @@ export const UserTotp = {
37936
37954
  ownerUserId: item.ownerUserId !== undefined ? {
37937
37955
  equals: item.ownerUserId
37938
37956
  } : undefined,
37957
+ fundId: item.fundId !== undefined ? {
37958
+ equals: item.fundId
37959
+ } : undefined,
37939
37960
  },
37940
37961
  update: {
37941
37962
  id: item.id !== undefined ? {
@@ -37966,6 +37987,9 @@ export const UserTotp = {
37966
37987
  backtestJobId: item.backtestJobId !== undefined ? {
37967
37988
  set: item.backtestJobId
37968
37989
  } : undefined,
37990
+ backtestSpecHash: item.backtestSpecHash !== undefined ? {
37991
+ set: item.backtestSpecHash
37992
+ } : undefined,
37969
37993
  desk: item.desk !== undefined ? {
37970
37994
  set: item.desk
37971
37995
  } : undefined,
@@ -38228,6 +38252,7 @@ export const UserTotp = {
38228
38252
  kind: item.kind !== undefined ? item.kind : undefined,
38229
38253
  spec: item.spec !== undefined ? item.spec : undefined,
38230
38254
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
38255
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
38231
38256
  desk: item.desk !== undefined ? item.desk : undefined,
38232
38257
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
38233
38258
  subscriptions: item.subscriptions ?
@@ -41702,6 +41727,7 @@ export const UserTotp = {
41702
41727
  kind: item.kind !== undefined ? item.kind : undefined,
41703
41728
  spec: item.spec !== undefined ? item.spec : undefined,
41704
41729
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
41730
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
41705
41731
  desk: item.desk !== undefined ? item.desk : undefined,
41706
41732
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
41707
41733
  subscriptions: item.subscriptions ?
@@ -2649,6 +2649,7 @@ export const WaitlistEntry = {
2649
2649
  kind: item.kind !== undefined ? item.kind : undefined,
2650
2650
  spec: item.spec !== undefined ? item.spec : undefined,
2651
2651
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
2652
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
2652
2653
  desk: item.desk !== undefined ? item.desk : undefined,
2653
2654
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
2654
2655
  subscriptions: item.subscriptions ?
@@ -10908,6 +10909,9 @@ export const WaitlistEntry = {
10908
10909
  ownerUserId: item.ownerUserId !== undefined ? {
10909
10910
  equals: item.ownerUserId
10910
10911
  } : undefined,
10912
+ fundId: item.fundId !== undefined ? {
10913
+ equals: item.fundId
10914
+ } : undefined,
10911
10915
  },
10912
10916
  update: {
10913
10917
  id: item.id !== undefined ? {
@@ -10938,6 +10942,9 @@ export const WaitlistEntry = {
10938
10942
  backtestJobId: item.backtestJobId !== undefined ? {
10939
10943
  set: item.backtestJobId
10940
10944
  } : undefined,
10945
+ backtestSpecHash: item.backtestSpecHash !== undefined ? {
10946
+ set: item.backtestSpecHash
10947
+ } : undefined,
10941
10948
  desk: item.desk !== undefined ? {
10942
10949
  set: item.desk
10943
10950
  } : undefined,
@@ -11200,6 +11207,7 @@ export const WaitlistEntry = {
11200
11207
  kind: item.kind !== undefined ? item.kind : undefined,
11201
11208
  spec: item.spec !== undefined ? item.spec : undefined,
11202
11209
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
11210
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
11203
11211
  desk: item.desk !== undefined ? item.desk : undefined,
11204
11212
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
11205
11213
  subscriptions: item.subscriptions ?
@@ -14666,6 +14674,7 @@ export const WaitlistEntry = {
14666
14674
  kind: item.kind !== undefined ? item.kind : undefined,
14667
14675
  spec: item.spec !== undefined ? item.spec : undefined,
14668
14676
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
14677
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
14669
14678
  desk: item.desk !== undefined ? item.desk : undefined,
14670
14679
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
14671
14680
  subscriptions: item.subscriptions ?
@@ -17861,6 +17870,7 @@ export const WaitlistEntry = {
17861
17870
  kind: item.kind !== undefined ? item.kind : undefined,
17862
17871
  spec: item.spec !== undefined ? item.spec : undefined,
17863
17872
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
17873
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
17864
17874
  desk: item.desk !== undefined ? item.desk : undefined,
17865
17875
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
17866
17876
  subscriptions: item.subscriptions ?
@@ -25828,6 +25838,9 @@ export const WaitlistEntry = {
25828
25838
  ownerUserId: item.ownerUserId !== undefined ? {
25829
25839
  equals: item.ownerUserId
25830
25840
  } : undefined,
25841
+ fundId: item.fundId !== undefined ? {
25842
+ equals: item.fundId
25843
+ } : undefined,
25831
25844
  },
25832
25845
  update: {
25833
25846
  id: item.id !== undefined ? {
@@ -25858,6 +25871,9 @@ export const WaitlistEntry = {
25858
25871
  backtestJobId: item.backtestJobId !== undefined ? {
25859
25872
  set: item.backtestJobId
25860
25873
  } : undefined,
25874
+ backtestSpecHash: item.backtestSpecHash !== undefined ? {
25875
+ set: item.backtestSpecHash
25876
+ } : undefined,
25861
25877
  desk: item.desk !== undefined ? {
25862
25878
  set: item.desk
25863
25879
  } : undefined,
@@ -26120,6 +26136,7 @@ export const WaitlistEntry = {
26120
26136
  kind: item.kind !== undefined ? item.kind : undefined,
26121
26137
  spec: item.spec !== undefined ? item.spec : undefined,
26122
26138
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
26139
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
26123
26140
  desk: item.desk !== undefined ? item.desk : undefined,
26124
26141
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
26125
26142
  subscriptions: item.subscriptions ?
@@ -29586,6 +29603,7 @@ export const WaitlistEntry = {
29586
29603
  kind: item.kind !== undefined ? item.kind : undefined,
29587
29604
  spec: item.spec !== undefined ? item.spec : undefined,
29588
29605
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
29606
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
29589
29607
  desk: item.desk !== undefined ? item.desk : undefined,
29590
29608
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
29591
29609
  subscriptions: item.subscriptions ?
@@ -37725,6 +37743,9 @@ export const WaitlistEntry = {
37725
37743
  ownerUserId: item.ownerUserId !== undefined ? {
37726
37744
  equals: item.ownerUserId
37727
37745
  } : undefined,
37746
+ fundId: item.fundId !== undefined ? {
37747
+ equals: item.fundId
37748
+ } : undefined,
37728
37749
  },
37729
37750
  update: {
37730
37751
  id: item.id !== undefined ? {
@@ -37755,6 +37776,9 @@ export const WaitlistEntry = {
37755
37776
  backtestJobId: item.backtestJobId !== undefined ? {
37756
37777
  set: item.backtestJobId
37757
37778
  } : undefined,
37779
+ backtestSpecHash: item.backtestSpecHash !== undefined ? {
37780
+ set: item.backtestSpecHash
37781
+ } : undefined,
37758
37782
  desk: item.desk !== undefined ? {
37759
37783
  set: item.desk
37760
37784
  } : undefined,
@@ -38017,6 +38041,7 @@ export const WaitlistEntry = {
38017
38041
  kind: item.kind !== undefined ? item.kind : undefined,
38018
38042
  spec: item.spec !== undefined ? item.spec : undefined,
38019
38043
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
38044
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
38020
38045
  desk: item.desk !== undefined ? item.desk : undefined,
38021
38046
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
38022
38047
  subscriptions: item.subscriptions ?
@@ -41483,6 +41508,7 @@ export const WaitlistEntry = {
41483
41508
  kind: item.kind !== undefined ? item.kind : undefined,
41484
41509
  spec: item.spec !== undefined ? item.spec : undefined,
41485
41510
  backtestJobId: item.backtestJobId !== undefined ? item.backtestJobId : undefined,
41511
+ backtestSpecHash: item.backtestSpecHash !== undefined ? item.backtestSpecHash : undefined,
41486
41512
  desk: item.desk !== undefined ? item.desk : undefined,
41487
41513
  deletedAt: item.deletedAt !== undefined ? item.deletedAt : undefined,
41488
41514
  subscriptions: item.subscriptions ?
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Who may write an entitlement row — pure decision logic.
3
+ *
4
+ * `OrgMembership.role` and `FundAssignment.role` are the authority the rest of
5
+ * the system reads: the platform derives a person's personas from them at
6
+ * sign-in, the tenancy scope derives which organizations and funds they reach,
7
+ * and fund entitlement admits writes to every brokerage account bridged to a
8
+ * fund. Being inside a tenant is therefore not enough to write one of these
9
+ * rows. A plain member who could write them could make themselves OWNER of
10
+ * their organization, or MANAGER of any fund in it, and every downstream
11
+ * authority would follow.
12
+ *
13
+ * A user principal may write an entitlement row only with authority over the
14
+ * tenant the row belongs to:
15
+ *
16
+ * - **OrgMembership** — the caller holds OWNER or ADMIN in that organization.
17
+ * A row whose role is OWNER, before or after the write, needs OWNER: an
18
+ * ADMIN who could grant OWNER could grant it to themselves, and an ADMIN who
19
+ * could demote or remove an OWNER could take the organization from them.
20
+ * - **FundAssignment** — the caller holds OWNER or ADMIN in the fund's
21
+ * organization, or a MANAGER assignment on that same fund. MANAGER is the
22
+ * highest fund role and is the role that runs the fund's team, so admitting
23
+ * it lets no one rise above what they already hold, and it confers nothing
24
+ * on any other fund.
25
+ *
26
+ * One self-service write is admitted without that authority, because the
27
+ * backend can prove from its own rows that nothing is being taken from
28
+ * anyone: the **first owner**. A caller makes themselves OWNER of an
29
+ * organization that is not deleted and has no members and no funds. That is
30
+ * the state an organization is in the moment its creator has written it; once
31
+ * anyone holds a membership, or the organization holds a fund, the exception
32
+ * closes, and an organization with neither has nothing in it to claim.
33
+ *
34
+ * Joining an organization any other way (an invitation, an email-domain
35
+ * match) rests on proof the backend cannot verify from rows the caller is
36
+ * unable to write — an invitation is a single-use token, and a user's email
37
+ * address is a column of their own row — so those memberships are written by
38
+ * a service principal after the platform has checked the proof.
39
+ *
40
+ * Everything here is decided from facts read from the database for this
41
+ * mutation (`src/middleware/mutation-membership-facts.ts`), never from the
42
+ * token's claims.
43
+ *
44
+ * @module auth/membership-write-authority
45
+ */
46
+ /** An entitlement model. */
47
+ export type MembershipModel = 'OrgMembership' | 'FundAssignment';
48
+ /** Whether a model is one of the entitlement models this module decides. */
49
+ export declare function isMembershipModel(model: string): model is MembershipModel;
50
+ /** The organization role that owns an organization. */
51
+ export declare const ORG_OWNER_ROLE = "OWNER";
52
+ /** Organization roles that may manage memberships and fund assignments. */
53
+ export declare const ORG_MANAGEMENT_ROLES: ReadonlySet<string>;
54
+ /** The fund role that may manage its own fund's assignments. */
55
+ export declare const FUND_MANAGER_ROLE = "MANAGER";
56
+ /** What one side of an entitlement write does to one row. */
57
+ export interface MembershipRowWrite {
58
+ /** Whether the row is being created, or an existing row changed or removed. */
59
+ readonly side: 'create' | 'existing';
60
+ /** The organization the row belongs to (for a fund assignment, its fund's). */
61
+ readonly organizationId: string;
62
+ /** For a fund assignment: the fund. */
63
+ readonly fundId?: string;
64
+ /** The person the row is for. */
65
+ readonly memberUserId: string;
66
+ /**
67
+ * Every role the row holds before or after the write: the payload's role
68
+ * (or the column default) for a create; the stored role, and the new one
69
+ * if the write sets it, for an existing row.
70
+ */
71
+ readonly rolesTouched: readonly string[];
72
+ /** Whether the write sets the row's free-form `permissions`. */
73
+ readonly setsPermissions: boolean;
74
+ }
75
+ /** What the caller holds in the row's tenant, read from the database. */
76
+ export interface CallerStanding {
77
+ /** The caller's OrgMembership role in the row's organization, or `null`. */
78
+ readonly orgRole: string | null;
79
+ /** For a fund assignment: the caller's FundAssignment role on that fund, or `null`. */
80
+ readonly fundRole: string | null;
81
+ }
82
+ /** The facts a first-owner OrgMembership create is decided on. */
83
+ export interface FirstOwnerFacts {
84
+ readonly organizationDeleted: boolean;
85
+ readonly organizationMemberCount: number;
86
+ readonly organizationFundCount: number;
87
+ }
88
+ /** Why an entitlement write was admitted or refused. */
89
+ export type MembershipVerdict = 'membership_org_admin' | 'membership_fund_manager' | 'membership_first_owner' | 'tenant_out_of_scope' | 'membership_role_insufficient' | 'membership_owner_requires_owner';
90
+ /** The verdicts that admit the write. */
91
+ export declare const ADMITTING_MEMBERSHIP_VERDICTS: ReadonlySet<MembershipVerdict>;
92
+ /**
93
+ * Whether a write could be a first-owner create: the caller making
94
+ * themselves a member of an organization they do not belong to. The
95
+ * first-owner facts are read only for this shape.
96
+ */
97
+ export declare function isFirstOwnerCandidate(model: MembershipModel, write: MembershipRowWrite, callerId: string, standing: CallerStanding): boolean;
98
+ /**
99
+ * Decide one side of an entitlement write. Pure; performs no I/O.
100
+ *
101
+ * @param model - The entitlement model written.
102
+ * @param write - What the write does to the row.
103
+ * @param callerId - The user principal's subject.
104
+ * @param standing - What the caller holds in the row's tenant.
105
+ * @param firstOwner - The first-owner facts, read only for an
106
+ * {@link isFirstOwnerCandidate} write; `null` otherwise.
107
+ * @returns The verdict.
108
+ */
109
+ export declare function decideMembershipWrite(model: MembershipModel, write: MembershipRowWrite, callerId: string, standing: CallerStanding, firstOwner: FirstOwnerFacts | null): MembershipVerdict;
110
+ //# sourceMappingURL=membership-write-authority.d.ts.map
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Who may write an entitlement row — pure decision logic.
3
+ *
4
+ * `OrgMembership.role` and `FundAssignment.role` are the authority the rest of
5
+ * the system reads: the platform derives a person's personas from them at
6
+ * sign-in, the tenancy scope derives which organizations and funds they reach,
7
+ * and fund entitlement admits writes to every brokerage account bridged to a
8
+ * fund. Being inside a tenant is therefore not enough to write one of these
9
+ * rows. A plain member who could write them could make themselves OWNER of
10
+ * their organization, or MANAGER of any fund in it, and every downstream
11
+ * authority would follow.
12
+ *
13
+ * A user principal may write an entitlement row only with authority over the
14
+ * tenant the row belongs to:
15
+ *
16
+ * - **OrgMembership** — the caller holds OWNER or ADMIN in that organization.
17
+ * A row whose role is OWNER, before or after the write, needs OWNER: an
18
+ * ADMIN who could grant OWNER could grant it to themselves, and an ADMIN who
19
+ * could demote or remove an OWNER could take the organization from them.
20
+ * - **FundAssignment** — the caller holds OWNER or ADMIN in the fund's
21
+ * organization, or a MANAGER assignment on that same fund. MANAGER is the
22
+ * highest fund role and is the role that runs the fund's team, so admitting
23
+ * it lets no one rise above what they already hold, and it confers nothing
24
+ * on any other fund.
25
+ *
26
+ * One self-service write is admitted without that authority, because the
27
+ * backend can prove from its own rows that nothing is being taken from
28
+ * anyone: the **first owner**. A caller makes themselves OWNER of an
29
+ * organization that is not deleted and has no members and no funds. That is
30
+ * the state an organization is in the moment its creator has written it; once
31
+ * anyone holds a membership, or the organization holds a fund, the exception
32
+ * closes, and an organization with neither has nothing in it to claim.
33
+ *
34
+ * Joining an organization any other way (an invitation, an email-domain
35
+ * match) rests on proof the backend cannot verify from rows the caller is
36
+ * unable to write — an invitation is a single-use token, and a user's email
37
+ * address is a column of their own row — so those memberships are written by
38
+ * a service principal after the platform has checked the proof.
39
+ *
40
+ * Everything here is decided from facts read from the database for this
41
+ * mutation (`src/middleware/mutation-membership-facts.ts`), never from the
42
+ * token's claims.
43
+ *
44
+ * @module auth/membership-write-authority
45
+ */
46
+ /** Whether a model is one of the entitlement models this module decides. */
47
+ export function isMembershipModel(model) {
48
+ return model === 'OrgMembership' || model === 'FundAssignment';
49
+ }
50
+ /** The organization role that owns an organization. */
51
+ export const ORG_OWNER_ROLE = 'OWNER';
52
+ /** Organization roles that may manage memberships and fund assignments. */
53
+ export const ORG_MANAGEMENT_ROLES = new Set([
54
+ ORG_OWNER_ROLE,
55
+ 'ADMIN',
56
+ ]);
57
+ /** The fund role that may manage its own fund's assignments. */
58
+ export const FUND_MANAGER_ROLE = 'MANAGER';
59
+ /** The verdicts that admit the write. */
60
+ export const ADMITTING_MEMBERSHIP_VERDICTS = new Set([
61
+ 'membership_org_admin',
62
+ 'membership_fund_manager',
63
+ 'membership_first_owner',
64
+ ]);
65
+ /**
66
+ * Whether a write could be a first-owner create: the caller making
67
+ * themselves a member of an organization they do not belong to. The
68
+ * first-owner facts are read only for this shape.
69
+ */
70
+ export function isFirstOwnerCandidate(model, write, callerId, standing) {
71
+ return (model === 'OrgMembership' &&
72
+ write.side === 'create' &&
73
+ write.memberUserId === callerId &&
74
+ standing.orgRole === null);
75
+ }
76
+ /** Whether a create makes the caller the plain first OWNER of an empty organization. */
77
+ function isFirstOwner(write, facts) {
78
+ return (write.rolesTouched.length === 1 &&
79
+ write.rolesTouched[0] === ORG_OWNER_ROLE &&
80
+ !write.setsPermissions &&
81
+ !facts.organizationDeleted &&
82
+ facts.organizationMemberCount === 0 &&
83
+ facts.organizationFundCount === 0);
84
+ }
85
+ /**
86
+ * Decide one side of an entitlement write. Pure; performs no I/O.
87
+ *
88
+ * @param model - The entitlement model written.
89
+ * @param write - What the write does to the row.
90
+ * @param callerId - The user principal's subject.
91
+ * @param standing - What the caller holds in the row's tenant.
92
+ * @param firstOwner - The first-owner facts, read only for an
93
+ * {@link isFirstOwnerCandidate} write; `null` otherwise.
94
+ * @returns The verdict.
95
+ */
96
+ export function decideMembershipWrite(model, write, callerId, standing, firstOwner) {
97
+ const { orgRole, fundRole } = standing;
98
+ if (model === 'OrgMembership') {
99
+ if (orgRole === ORG_OWNER_ROLE)
100
+ return 'membership_org_admin';
101
+ if (orgRole !== null && ORG_MANAGEMENT_ROLES.has(orgRole)) {
102
+ return write.rolesTouched.includes(ORG_OWNER_ROLE)
103
+ ? 'membership_owner_requires_owner'
104
+ : 'membership_org_admin';
105
+ }
106
+ if (orgRole !== null)
107
+ return 'membership_role_insufficient';
108
+ if (firstOwner !== null &&
109
+ isFirstOwnerCandidate(model, write, callerId, standing) &&
110
+ isFirstOwner(write, firstOwner)) {
111
+ return 'membership_first_owner';
112
+ }
113
+ return 'tenant_out_of_scope';
114
+ }
115
+ if (orgRole !== null && ORG_MANAGEMENT_ROLES.has(orgRole)) {
116
+ return 'membership_org_admin';
117
+ }
118
+ if (fundRole === FUND_MANAGER_ROLE)
119
+ return 'membership_fund_manager';
120
+ if (orgRole !== null || fundRole !== null) {
121
+ return 'membership_role_insufficient';
122
+ }
123
+ return 'tenant_out_of_scope';
124
+ }
125
+ //# sourceMappingURL=membership-write-authority.js.map
@@ -30,7 +30,15 @@
30
30
  * accounts has no single owner to check.
31
31
  * - `self` — `User`: only the caller's own row, and only its profile and
32
32
  * onboarding fields (`./user-write-content.ts`).
33
- * - `tenant_scoped` — the tenancy-governed models: the row (for an update,
33
+ * - `membership_authority` — `OrgMembership` and `FundAssignment`, the rows
34
+ * every other entitlement is read from: the caller must hold OWNER or
35
+ * ADMIN in the row's organization (OWNER for a row whose role is OWNER),
36
+ * or MANAGER on the assignment's own fund; or the write makes the caller
37
+ * the first owner of an empty organization, the one self-service create
38
+ * the backend can verify from rows the caller cannot write
39
+ * (`./membership-write-authority.ts`). Roles are read from the database
40
+ * for the mutation, never from the token.
41
+ * - `tenant_scoped` — the other tenancy-governed models: the row (for an update,
34
42
  * upsert or delete) or the payload's tenant (for a create) must lie in the
35
43
  * caller's OrgMembership / FundAssignment entitlement. The guard checks
36
44
  * this itself, whatever `TENANCY_SCOPING_MODE` says, because fund
@@ -45,7 +53,8 @@
45
53
  * must belong to an organization the caller is a member of or a fund they
46
54
  * are entitled to. Nested writes treat it as `authenticated`, as before.
47
55
  * - `resolver_authorized` — custom mutations whose resolver performs its own
48
- * authorization.
56
+ * authorization, among them the strategy-draft mutations: the only user
57
+ * writes to `Strategy`, which is otherwise `service_only`.
49
58
  * - everything else is `service_only`.
50
59
  * - `UserTotp` and the TOTP custom mutations are service-principal only:
51
60
  * not even an admin may write a user's second factor through GraphQL
@@ -80,6 +89,7 @@
80
89
  *
81
90
  * @module auth/mutation-authorization
82
91
  */
92
+ import { type MembershipVerdict } from './membership-write-authority';
83
93
  import type { BackendPrincipal } from './token-verifier';
84
94
  /** Operating mode of the mutation guard. See the module doc. */
85
95
  export type MutationAuthMode = 'off' | 'shadow' | 'enforce';
@@ -172,13 +182,15 @@ export interface MutationTarget {
172
182
  */
173
183
  export declare function classifyMutationField(fieldName: string, models: ReadonlySet<string>): MutationTarget;
174
184
  /** How a `user` principal may write a model. See the module doc. */
175
- export type UserWritePolicy = 'service_only' | 'account_owned' | 'self' | 'tenant_scoped' | 'mandate_tenant' | 'authenticated' | 'resolver_authorized';
185
+ export type UserWritePolicy = 'service_only' | 'account_owned' | 'self' | 'tenant_scoped' | 'membership_authority' | 'mandate_tenant' | 'authenticated' | 'resolver_authorized';
176
186
  /** A model's user policy plus the actions a user may perform under it. */
177
187
  export interface ModelWriteRule {
178
188
  readonly policy: UserWritePolicy;
179
189
  /** Actions a user may perform; absent means every action. */
180
190
  readonly userActions?: ReadonlySet<MutationAction | 'custom'>;
181
191
  }
192
+ /** The strategy-draft custom mutations (`src/resolvers/custom/StrategyDraftResolver.ts`), as classified targets. */
193
+ export declare const STRATEGY_DRAFT_MUTATIONS: readonly string[];
182
194
  /**
183
195
  * Explicit user-write rules. Every model absent here is `service_only`.
184
196
  *
@@ -193,7 +205,7 @@ export declare const MODEL_WRITE_RULES: ReadonlyMap<string, ModelWriteRule>;
193
205
  /** The write rule for a model. */
194
206
  export declare function ruleFor(model: string): ModelWriteRule;
195
207
  /** Why a mutation was admitted or refused. A bounded metric label. */
196
- export type MutationAuthReason = 'guard_off' | 'guard_error' | 'service_principal' | 'admin_principal' | 'account_owner' | 'account_fund_entitled' | 'self' | 'tenant_scoped' | 'authenticated_user_model' | 'resolver_authorized' | 'unauthenticated' | 'service_principal_only' | 'model_not_user_writable' | 'action_not_user_writable' | 'bulk_not_user_writable' | 'not_account_owner' | 'account_unresolved' | 'not_self' | 'tenant_out_of_scope' | 'tenant_unresolved' | 'field_not_user_writable' | 'reserved_audit_source' | 'audit_actor_mismatch' | 'ledger_fund_reserved' | 'config_key_not_user_scoped' | 'nested_write_not_user_writable' | 'nested_entitlement_write';
208
+ export type MutationAuthReason = 'guard_off' | 'guard_error' | 'service_principal' | 'admin_principal' | 'account_owner' | 'account_fund_entitled' | 'self' | 'tenant_scoped' | 'authenticated_user_model' | 'resolver_authorized' | 'unauthenticated' | 'service_principal_only' | 'model_not_user_writable' | 'action_not_user_writable' | 'bulk_not_user_writable' | 'not_account_owner' | 'account_unresolved' | 'not_self' | 'tenant_out_of_scope' | 'tenant_unresolved' | 'membership_org_admin' | 'membership_fund_manager' | 'membership_first_owner' | 'membership_role_insufficient' | 'membership_owner_requires_owner' | 'membership_authority_unresolved' | 'field_not_user_writable' | 'reserved_audit_source' | 'audit_actor_mismatch' | 'ledger_fund_reserved' | 'config_key_not_user_scoped' | 'nested_write_not_user_writable' | 'nested_entitlement_write';
197
209
  /** Ownership facts the middleware resolved for an `account_owned` write. */
198
210
  export type AccountOwnership = {
199
211
  readonly kind: 'owner';
@@ -206,6 +218,11 @@ export type AccountOwnership = {
206
218
  };
207
219
  /** For a `tenant_scoped` write: whether the row or payload lies in the caller's entitlement. */
208
220
  export type TenantScope = 'in_scope' | 'out_of_scope';
221
+ /**
222
+ * For a `membership_authority` write: the verdict read from the database, or
223
+ * `unresolved` when the rows it reaches could not be identified or read.
224
+ */
225
+ export type MembershipAuthority = MembershipVerdict | 'unresolved';
209
226
  /** Everything the decision needs beyond the principal and target. */
210
227
  export interface MutationFacts {
211
228
  /** For `account_owned`: whether the caller owns every account touched. */
@@ -214,6 +231,8 @@ export interface MutationFacts {
214
231
  readonly targetsSelf?: boolean;
215
232
  /** For `tenant_scoped`: the guard's own scope check; absent = not yet resolved. */
216
233
  readonly tenantScope?: TenantScope;
234
+ /** For `membership_authority`: the caller's authority over the row; absent = not yet resolved. */
235
+ readonly membershipAuthority?: MembershipAuthority;
217
236
  /**
218
237
  * Every model the mutation's nested writes reach. A non-service principal is
219
238
  * refused when one is service-principal only, whatever its root.