@adaptic/backend 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.
- package/Account.cjs +26 -0
- package/AccountLinkingRequest.cjs +26 -0
- package/AccountRiskMetrics.cjs +58 -0
- package/Action.cjs +26 -0
- package/AdaConversation.cjs +84 -0
- package/AdaMessage.cjs +29 -0
- package/Alert.cjs +58 -0
- package/Allocation.cjs +58 -0
- package/AlpacaAccount.cjs +52 -0
- package/Authenticator.cjs +26 -0
- package/AutoFollowRule.cjs +84 -0
- package/BrokerageAccount.cjs +116 -0
- package/Customer.cjs +55 -0
- package/DeskDecision.cjs +116 -0
- package/FeatureFlagOverride.cjs +26 -0
- package/Follow.cjs +84 -0
- package/Fund.cjs +197 -0
- package/FundAssignment.cjs +84 -0
- package/Holding.cjs +87 -0
- package/Investor.cjs +55 -0
- package/InvestorDocument.cjs +87 -0
- package/InvestorTransaction.cjs +87 -0
- package/InviteToken.cjs +29 -0
- package/LinkedProvider.cjs +26 -0
- package/LlmConfiguration.cjs +26 -0
- package/Mandate.cjs +142 -0
- package/MandateApproval.cjs +55 -0
- package/MandateRule.cjs +29 -0
- package/MandateVersion.cjs +113 -0
- package/NotificationDelivery.cjs +26 -0
- package/NotificationEvent.cjs +87 -0
- package/NotificationPreference.cjs +26 -0
- package/OrgMembership.cjs +26 -0
- package/Organization.cjs +174 -0
- package/PushSubscription.cjs +26 -0
- package/RiskEscalationEvent.cjs +58 -0
- package/Session.cjs +26 -0
- package/Strategy.cjs +15 -0
- package/StrategyHealthSnapshot.cjs +58 -0
- package/StrategySubscription.cjs +54 -0
- package/TaxDocument.cjs +87 -0
- package/Trade.cjs +23 -0
- package/TradingPolicy.cjs +58 -0
- package/User.cjs +110 -0
- package/UserTotp.cjs +26 -0
- package/WaitlistEntry.cjs +26 -0
- package/esm/Account.mjs +26 -0
- package/esm/AccountLinkingRequest.mjs +26 -0
- package/esm/AccountRiskMetrics.mjs +58 -0
- package/esm/Action.mjs +26 -0
- package/esm/AdaConversation.mjs +84 -0
- package/esm/AdaMessage.mjs +29 -0
- package/esm/Alert.mjs +58 -0
- package/esm/Allocation.mjs +58 -0
- package/esm/AlpacaAccount.mjs +52 -0
- package/esm/Authenticator.mjs +26 -0
- package/esm/AutoFollowRule.mjs +84 -0
- package/esm/BrokerageAccount.mjs +116 -0
- package/esm/Customer.mjs +55 -0
- package/esm/DeskDecision.mjs +116 -0
- package/esm/FeatureFlagOverride.mjs +26 -0
- package/esm/Follow.mjs +84 -0
- package/esm/Fund.mjs +197 -0
- package/esm/FundAssignment.mjs +84 -0
- package/esm/Holding.mjs +87 -0
- package/esm/Investor.mjs +55 -0
- package/esm/InvestorDocument.mjs +87 -0
- package/esm/InvestorTransaction.mjs +87 -0
- package/esm/InviteToken.mjs +29 -0
- package/esm/LinkedProvider.mjs +26 -0
- package/esm/LlmConfiguration.mjs +26 -0
- package/esm/Mandate.mjs +142 -0
- package/esm/MandateApproval.mjs +55 -0
- package/esm/MandateRule.mjs +29 -0
- package/esm/MandateVersion.mjs +113 -0
- package/esm/NotificationDelivery.mjs +26 -0
- package/esm/NotificationEvent.mjs +87 -0
- package/esm/NotificationPreference.mjs +26 -0
- package/esm/OrgMembership.mjs +26 -0
- package/esm/Organization.mjs +174 -0
- package/esm/PushSubscription.mjs +26 -0
- package/esm/RiskEscalationEvent.mjs +58 -0
- package/esm/Session.mjs +26 -0
- package/esm/Strategy.mjs +15 -0
- package/esm/StrategyHealthSnapshot.mjs +58 -0
- package/esm/StrategySubscription.mjs +54 -0
- package/esm/TaxDocument.mjs +87 -0
- package/esm/Trade.mjs +23 -0
- package/esm/TradingPolicy.mjs +58 -0
- package/esm/User.mjs +110 -0
- package/esm/UserTotp.mjs +26 -0
- package/esm/WaitlistEntry.mjs +26 -0
- package/esm/auth/membership-write-authority.d.ts +110 -0
- package/esm/auth/membership-write-authority.mjs +125 -0
- package/esm/auth/mutation-authorization.d.ts +23 -4
- package/esm/auth/mutation-authorization.mjs +36 -3
- package/esm/auth/nested-write-policy.d.ts +4 -0
- package/esm/auth/nested-write-policy.mjs +19 -0
- package/esm/auth/tenancy-scope.d.ts +50 -8
- package/esm/auth/tenancy-scope.mjs +87 -10
- package/esm/generated/selectionSets/Strategy.d.ts +1 -1
- package/esm/generated/selectionSets/Strategy.mjs +2 -0
- package/esm/generated/selectionSets/StrategySubscription.d.ts +1 -1
- package/esm/generated/selectionSets/StrategySubscription.mjs +2 -0
- package/esm/generated/typeStrings/Strategy.d.ts +1 -1
- package/esm/generated/typeStrings/Strategy.mjs +7 -0
- package/esm/generated/typeStrings/index.d.ts +1 -1
- package/esm/generated/typegraphql-prisma/enhance.mjs +79 -62
- package/esm/generated/typegraphql-prisma/enums/StrategyLifecycleState.d.ts +1 -0
- package/esm/generated/typegraphql-prisma/enums/StrategyLifecycleState.mjs +1 -0
- package/esm/generated/typegraphql-prisma/enums/StrategyScalarFieldEnum.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/enums/StrategyScalarFieldEnum.mjs +2 -0
- package/esm/generated/typegraphql-prisma/models/Fund.d.ts +5 -0
- package/esm/generated/typegraphql-prisma/models/Fund.mjs +4 -0
- package/esm/generated/typegraphql-prisma/models/Strategy.d.ts +30 -1
- package/esm/generated/typegraphql-prisma/models/Strategy.mjs +43 -1
- package/esm/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindFirstStrategyArgs.d.ts +1 -1
- package/esm/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindFirstStrategyOrThrowArgs.d.ts +1 -1
- package/esm/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindManyStrategyArgs.d.ts +1 -1
- package/esm/generated/typegraphql-prisma/resolvers/crud/Strategy/args/GroupByStrategyArgs.d.ts +1 -1
- package/esm/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateFieldUpdateOperationsInput.d.ts +1 -1
- package/esm/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateFilter.d.ts +3 -3
- package/esm/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateWithAggregatesFilter.d.ts +3 -3
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateNestedOneWithoutStrategiesInput.d.ts +9 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateNestedOneWithoutStrategiesInput.mjs +41 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateOrConnectWithoutStrategiesInput.d.ts +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateOrConnectWithoutStrategiesInput.mjs +33 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateWithoutStrategiesInput.d.ts +53 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundCreateWithoutStrategiesInput.mjs +272 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateOneWithoutStrategiesNestedInput.d.ts +16 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateOneWithoutStrategiesNestedInput.mjs +72 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateToOneWithWhereWithoutStrategiesInput.d.ts +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateToOneWithWhereWithoutStrategiesInput.mjs +33 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateWithoutStrategiesInput.d.ts +60 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpdateWithoutStrategiesInput.mjs +278 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpsertWithoutStrategiesInput.d.ts +9 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/FundUpsertWithoutStrategiesInput.mjs +41 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/NestedEnumStrategyLifecycleStateFilter.d.ts +3 -3
- package/esm/generated/typegraphql-prisma/resolvers/inputs/NestedEnumStrategyLifecycleStateWithAggregatesFilter.d.ts +3 -3
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCountOrderByAggregateInput.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCountOrderByAggregateInput.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateInput.d.ts +2 -1
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateInput.mjs +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInput.d.ts +20 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInput.mjs +134 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInputEnvelope.d.ts +6 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInputEnvelope.mjs +32 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyInput.d.ts +3 -1
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyInput.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyOwnerInput.d.ts +3 -1
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyOwnerInput.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateNestedManyWithoutFundInput.d.ts +11 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateNestedManyWithoutFundInput.mjs +49 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateOrConnectWithoutFundInput.d.ts +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateOrConnectWithoutFundInput.mjs +33 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutFundInput.d.ts +25 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutFundInput.mjs +151 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutOwnerInput.d.ts +2 -1
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutOwnerInput.mjs +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutSubscriptionsInput.d.ts +2 -1
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutSubscriptionsInput.mjs +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutTradesInput.d.ts +2 -1
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutTradesInput.mjs +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyMaxOrderByAggregateInput.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyMaxOrderByAggregateInput.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyMinOrderByAggregateInput.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyMinOrderByAggregateInput.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithAggregationInput.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithAggregationInput.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithRelationInput.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithRelationInput.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereInput.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereInput.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereWithAggregatesInput.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereWithAggregatesInput.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateInput.d.ts +1 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateInput.mjs +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyMutationInput.d.ts +1 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyMutationInput.mjs +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithWhereWithoutFundInput.d.ts +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithWhereWithoutFundInput.mjs +33 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithoutFundNestedInput.d.ts +22 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithoutFundNestedInput.mjs +102 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithWhereUniqueWithoutFundInput.d.ts +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithWhereUniqueWithoutFundInput.mjs +33 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutFundInput.d.ts +33 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutFundInput.mjs +155 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutOwnerInput.d.ts +1 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutOwnerInput.mjs +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutSubscriptionsInput.d.ts +1 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutSubscriptionsInput.mjs +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutTradesInput.d.ts +1 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutTradesInput.mjs +7 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpsertWithWhereUniqueWithoutFundInput.d.ts +9 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyUpsertWithWhereUniqueWithoutFundInput.mjs +41 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereInput.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereInput.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereUniqueInput.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereUniqueInput.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/index.d.ts +17 -0
- package/esm/generated/typegraphql-prisma/resolvers/inputs/index.mjs +17 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnStrategy.d.ts +7 -1
- package/esm/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnStrategy.mjs +31 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/FundCount.d.ts +3 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/FundCount.mjs +16 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyCountAggregate.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyCountAggregate.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyGroupBy.d.ts +3 -1
- package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyGroupBy.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyMaxAggregate.d.ts +3 -1
- package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyMaxAggregate.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyMinAggregate.d.ts +3 -1
- package/esm/generated/typegraphql-prisma/resolvers/outputs/StrategyMinAggregate.mjs +14 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/args/CreateManyAndReturnStrategyFundArgs.d.ts +5 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/args/CreateManyAndReturnStrategyFundArgs.mjs +25 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/args/FundCountStrategiesArgs.d.ts +5 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/args/FundCountStrategiesArgs.mjs +25 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/args/index.d.ts +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/outputs/args/index.mjs +2 -0
- package/esm/generated/typegraphql-prisma/resolvers/relations/User/args/UserOwnedStrategiesArgs.d.ts +1 -1
- package/esm/middleware/__tests__/mutation-auth-guard.harness.d.ts +2 -0
- package/esm/middleware/__tests__/mutation-auth-guard.harness.mjs +136 -10
- package/esm/middleware/mutation-auth-guard.d.ts +4 -2
- package/esm/middleware/mutation-auth-guard.mjs +20 -2
- package/esm/middleware/mutation-membership-facts.d.ts +133 -0
- package/esm/middleware/mutation-membership-facts.mjs +271 -0
- package/esm/middleware/mutation-tenant-facts.d.ts +4 -2
- package/esm/middleware/mutation-tenant-facts.mjs +4 -2
- package/esm/middleware/tenancy-scoping.mjs +15 -3
- package/esm/resolvers/custom/StrategyDraftResolver.d.ts +44 -0
- package/esm/resolvers/custom/StrategyDraftResolver.mjs +188 -0
- package/esm/resolvers/custom/index.d.ts +1 -0
- package/esm/resolvers/custom/index.mjs +1 -0
- package/esm/resolvers/custom/strategy-draft-service.d.ts +180 -0
- package/esm/resolvers/custom/strategy-draft-service.mjs +254 -0
- package/esm/resolvers/custom/strategy-spec-hash.d.ts +32 -0
- package/esm/resolvers/custom/strategy-spec-hash.mjs +54 -0
- package/esm/tests/strategy-fund-tenancy.harness.d.ts +20 -0
- package/esm/tests/strategy-fund-tenancy.harness.mjs +212 -0
- package/generated/typeStrings/Strategy.cjs +7 -0
- package/generated/typeStrings/Strategy.d.ts +1 -1
- package/generated/typeStrings/index.d.ts +1 -1
- package/generated/typegraphql-prisma/enhance.cjs +79 -62
- package/generated/typegraphql-prisma/enums/StrategyLifecycleState.cjs +1 -0
- package/generated/typegraphql-prisma/enums/StrategyLifecycleState.d.ts +1 -0
- package/generated/typegraphql-prisma/enums/StrategyScalarFieldEnum.cjs +2 -0
- package/generated/typegraphql-prisma/enums/StrategyScalarFieldEnum.d.ts +2 -0
- package/generated/typegraphql-prisma/models/Fund.d.ts +5 -0
- package/generated/typegraphql-prisma/models/Strategy.cjs +15 -1
- package/generated/typegraphql-prisma/models/Strategy.d.ts +30 -1
- package/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindFirstStrategyArgs.d.ts +1 -1
- package/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindFirstStrategyOrThrowArgs.d.ts +1 -1
- package/generated/typegraphql-prisma/resolvers/crud/Strategy/args/FindManyStrategyArgs.d.ts +1 -1
- package/generated/typegraphql-prisma/resolvers/crud/Strategy/args/GroupByStrategyArgs.d.ts +1 -1
- package/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateFieldUpdateOperationsInput.d.ts +1 -1
- package/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateFilter.d.ts +3 -3
- package/generated/typegraphql-prisma/resolvers/inputs/EnumStrategyLifecycleStateWithAggregatesFilter.d.ts +3 -3
- package/generated/typegraphql-prisma/resolvers/inputs/FundCreateNestedOneWithoutStrategiesInput.cjs +74 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundCreateNestedOneWithoutStrategiesInput.d.ts +9 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundCreateOrConnectWithoutStrategiesInput.cjs +67 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundCreateOrConnectWithoutStrategiesInput.d.ts +7 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundCreateWithoutStrategiesInput.cjs +274 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundCreateWithoutStrategiesInput.d.ts +53 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateOneWithoutStrategiesNestedInput.cjs +101 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateOneWithoutStrategiesNestedInput.d.ts +16 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateToOneWithWhereWithoutStrategiesInput.cjs +67 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateToOneWithWhereWithoutStrategiesInput.d.ts +7 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateWithoutStrategiesInput.cjs +280 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundUpdateWithoutStrategiesInput.d.ts +60 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundUpsertWithoutStrategiesInput.cjs +74 -0
- package/generated/typegraphql-prisma/resolvers/inputs/FundUpsertWithoutStrategiesInput.d.ts +9 -0
- package/generated/typegraphql-prisma/resolvers/inputs/NestedEnumStrategyLifecycleStateFilter.d.ts +3 -3
- package/generated/typegraphql-prisma/resolvers/inputs/NestedEnumStrategyLifecycleStateWithAggregatesFilter.d.ts +3 -3
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCountOrderByAggregateInput.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCountOrderByAggregateInput.d.ts +2 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateInput.cjs +6 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateInput.d.ts +2 -1
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInput.cjs +154 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInput.d.ts +20 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInputEnvelope.cjs +66 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyFundInputEnvelope.d.ts +6 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyInput.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyInput.d.ts +3 -1
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyOwnerInput.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateManyOwnerInput.d.ts +3 -1
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateNestedManyWithoutFundInput.cjs +81 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateNestedManyWithoutFundInput.d.ts +11 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateOrConnectWithoutFundInput.cjs +67 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateOrConnectWithoutFundInput.d.ts +7 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutFundInput.cjs +169 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutFundInput.d.ts +25 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutOwnerInput.cjs +6 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutOwnerInput.d.ts +2 -1
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutSubscriptionsInput.cjs +6 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutSubscriptionsInput.d.ts +2 -1
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutTradesInput.cjs +6 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyCreateWithoutTradesInput.d.ts +2 -1
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyMaxOrderByAggregateInput.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyMaxOrderByAggregateInput.d.ts +2 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyMinOrderByAggregateInput.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyMinOrderByAggregateInput.d.ts +2 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithAggregationInput.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithAggregationInput.d.ts +2 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithRelationInput.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyOrderByWithRelationInput.d.ts +2 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereInput.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereInput.d.ts +2 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereWithAggregatesInput.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyScalarWhereWithAggregatesInput.d.ts +2 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateInput.cjs +6 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateInput.d.ts +1 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyMutationInput.cjs +6 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyMutationInput.d.ts +1 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithWhereWithoutFundInput.cjs +67 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithWhereWithoutFundInput.d.ts +7 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithoutFundNestedInput.cjs +127 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateManyWithoutFundNestedInput.d.ts +22 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithWhereUniqueWithoutFundInput.cjs +67 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithWhereUniqueWithoutFundInput.d.ts +7 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutFundInput.cjs +173 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutFundInput.d.ts +33 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutOwnerInput.cjs +6 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutOwnerInput.d.ts +1 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutSubscriptionsInput.cjs +6 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutSubscriptionsInput.d.ts +1 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutTradesInput.cjs +6 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpdateWithoutTradesInput.d.ts +1 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpsertWithWhereUniqueWithoutFundInput.cjs +74 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyUpsertWithWhereUniqueWithoutFundInput.d.ts +9 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereInput.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereInput.d.ts +2 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereUniqueInput.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/inputs/StrategyWhereUniqueInput.d.ts +2 -0
- package/generated/typegraphql-prisma/resolvers/inputs/index.cjs +84 -50
- package/generated/typegraphql-prisma/resolvers/inputs/index.d.ts +17 -0
- package/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnStrategy.cjs +28 -0
- package/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnStrategy.d.ts +7 -1
- package/generated/typegraphql-prisma/resolvers/outputs/FundCount.cjs +15 -0
- package/generated/typegraphql-prisma/resolvers/outputs/FundCount.d.ts +3 -0
- package/generated/typegraphql-prisma/resolvers/outputs/StrategyCountAggregate.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/outputs/StrategyCountAggregate.d.ts +2 -0
- package/generated/typegraphql-prisma/resolvers/outputs/StrategyGroupBy.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/outputs/StrategyGroupBy.d.ts +3 -1
- package/generated/typegraphql-prisma/resolvers/outputs/StrategyMaxAggregate.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/outputs/StrategyMaxAggregate.d.ts +3 -1
- package/generated/typegraphql-prisma/resolvers/outputs/StrategyMinAggregate.cjs +12 -0
- package/generated/typegraphql-prisma/resolvers/outputs/StrategyMinAggregate.d.ts +3 -1
- package/generated/typegraphql-prisma/resolvers/outputs/args/CreateManyAndReturnStrategyFundArgs.cjs +60 -0
- package/generated/typegraphql-prisma/resolvers/outputs/args/CreateManyAndReturnStrategyFundArgs.d.ts +5 -0
- package/generated/typegraphql-prisma/resolvers/outputs/args/FundCountStrategiesArgs.cjs +60 -0
- package/generated/typegraphql-prisma/resolvers/outputs/args/FundCountStrategiesArgs.d.ts +5 -0
- package/generated/typegraphql-prisma/resolvers/outputs/args/index.cjs +7 -3
- package/generated/typegraphql-prisma/resolvers/outputs/args/index.d.ts +2 -0
- package/generated/typegraphql-prisma/resolvers/relations/User/args/UserOwnedStrategiesArgs.d.ts +1 -1
- package/package.json +1 -1
- package/resolvers/custom/StrategyDraftResolver.cjs +221 -0
- package/resolvers/custom/StrategyDraftResolver.d.ts +44 -0
- package/resolvers/custom/index.cjs +5 -1
- package/resolvers/custom/index.d.ts +1 -0
- package/resolvers/custom/strategy-draft-service.cjs +262 -0
- package/resolvers/custom/strategy-draft-service.d.ts +180 -0
- package/resolvers/custom/strategy-spec-hash.cjs +58 -0
- package/resolvers/custom/strategy-spec-hash.d.ts +32 -0
- package/server.cjs +1 -0
|
@@ -8,13 +8,15 @@ export declare class StrategyGroupBy {
|
|
|
8
8
|
displayName: string;
|
|
9
9
|
description: string | null;
|
|
10
10
|
origin: "SYSTEM" | "USER" | "AI_GENERATED";
|
|
11
|
-
lifecycleState: "DRAFT" | "SHADOW" | "ACTIVE" | "PAUSED" | "RETIRED";
|
|
11
|
+
lifecycleState: "DRAFT" | "PENDING_APPROVAL" | "SHADOW" | "ACTIVE" | "PAUSED" | "RETIRED";
|
|
12
12
|
manifestHash: string | null;
|
|
13
13
|
kind: "thematic" | "signal" | null;
|
|
14
14
|
spec: Prisma.JsonValue | null;
|
|
15
15
|
backtestJobId: string | null;
|
|
16
|
+
backtestSpecHash: string | null;
|
|
16
17
|
desk: "EVENT" | "THEMATIC" | "SYSTEMATIC" | null;
|
|
17
18
|
ownerUserId: string | null;
|
|
19
|
+
fundId: string | null;
|
|
18
20
|
createdAt: Date;
|
|
19
21
|
updatedAt: Date;
|
|
20
22
|
deletedAt: Date | null;
|
|
@@ -27,8 +27,10 @@ let StrategyGroupBy = class StrategyGroupBy {
|
|
|
27
27
|
kind;
|
|
28
28
|
spec;
|
|
29
29
|
backtestJobId;
|
|
30
|
+
backtestSpecHash;
|
|
30
31
|
desk;
|
|
31
32
|
ownerUserId;
|
|
33
|
+
fundId;
|
|
32
34
|
createdAt;
|
|
33
35
|
updatedAt;
|
|
34
36
|
deletedAt;
|
|
@@ -96,6 +98,12 @@ __decorate([
|
|
|
96
98
|
}),
|
|
97
99
|
__metadata("design:type", Object)
|
|
98
100
|
], StrategyGroupBy.prototype, "backtestJobId", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
TypeGraphQL.Field(_type => String, {
|
|
103
|
+
nullable: true
|
|
104
|
+
}),
|
|
105
|
+
__metadata("design:type", Object)
|
|
106
|
+
], StrategyGroupBy.prototype, "backtestSpecHash", void 0);
|
|
99
107
|
__decorate([
|
|
100
108
|
TypeGraphQL.Field(_type => DeskType, {
|
|
101
109
|
nullable: true
|
|
@@ -108,6 +116,12 @@ __decorate([
|
|
|
108
116
|
}),
|
|
109
117
|
__metadata("design:type", Object)
|
|
110
118
|
], StrategyGroupBy.prototype, "ownerUserId", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
TypeGraphQL.Field(_type => String, {
|
|
121
|
+
nullable: true
|
|
122
|
+
}),
|
|
123
|
+
__metadata("design:type", Object)
|
|
124
|
+
], StrategyGroupBy.prototype, "fundId", void 0);
|
|
111
125
|
__decorate([
|
|
112
126
|
TypeGraphQL.Field(_type => Date, {
|
|
113
127
|
nullable: false
|
|
@@ -4,12 +4,14 @@ export declare class StrategyMaxAggregate {
|
|
|
4
4
|
displayName: string | null;
|
|
5
5
|
description: string | null;
|
|
6
6
|
origin: "SYSTEM" | "USER" | "AI_GENERATED" | null;
|
|
7
|
-
lifecycleState: "DRAFT" | "SHADOW" | "ACTIVE" | "PAUSED" | "RETIRED" | null;
|
|
7
|
+
lifecycleState: "DRAFT" | "PENDING_APPROVAL" | "SHADOW" | "ACTIVE" | "PAUSED" | "RETIRED" | null;
|
|
8
8
|
manifestHash: string | null;
|
|
9
9
|
kind: "thematic" | "signal" | null;
|
|
10
10
|
backtestJobId: string | null;
|
|
11
|
+
backtestSpecHash: string | null;
|
|
11
12
|
desk: "EVENT" | "THEMATIC" | "SYSTEMATIC" | null;
|
|
12
13
|
ownerUserId: string | null;
|
|
14
|
+
fundId: string | null;
|
|
13
15
|
createdAt: Date | null;
|
|
14
16
|
updatedAt: Date | null;
|
|
15
17
|
deletedAt: Date | null;
|
|
@@ -22,8 +22,10 @@ let StrategyMaxAggregate = class StrategyMaxAggregate {
|
|
|
22
22
|
manifestHash;
|
|
23
23
|
kind;
|
|
24
24
|
backtestJobId;
|
|
25
|
+
backtestSpecHash;
|
|
25
26
|
desk;
|
|
26
27
|
ownerUserId;
|
|
28
|
+
fundId;
|
|
27
29
|
createdAt;
|
|
28
30
|
updatedAt;
|
|
29
31
|
deletedAt;
|
|
@@ -82,6 +84,12 @@ __decorate([
|
|
|
82
84
|
}),
|
|
83
85
|
__metadata("design:type", Object)
|
|
84
86
|
], StrategyMaxAggregate.prototype, "backtestJobId", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
TypeGraphQL.Field(_type => String, {
|
|
89
|
+
nullable: true
|
|
90
|
+
}),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], StrategyMaxAggregate.prototype, "backtestSpecHash", void 0);
|
|
85
93
|
__decorate([
|
|
86
94
|
TypeGraphQL.Field(_type => DeskType, {
|
|
87
95
|
nullable: true
|
|
@@ -94,6 +102,12 @@ __decorate([
|
|
|
94
102
|
}),
|
|
95
103
|
__metadata("design:type", Object)
|
|
96
104
|
], StrategyMaxAggregate.prototype, "ownerUserId", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
TypeGraphQL.Field(_type => String, {
|
|
107
|
+
nullable: true
|
|
108
|
+
}),
|
|
109
|
+
__metadata("design:type", Object)
|
|
110
|
+
], StrategyMaxAggregate.prototype, "fundId", void 0);
|
|
97
111
|
__decorate([
|
|
98
112
|
TypeGraphQL.Field(_type => Date, {
|
|
99
113
|
nullable: true
|
|
@@ -4,12 +4,14 @@ export declare class StrategyMinAggregate {
|
|
|
4
4
|
displayName: string | null;
|
|
5
5
|
description: string | null;
|
|
6
6
|
origin: "SYSTEM" | "USER" | "AI_GENERATED" | null;
|
|
7
|
-
lifecycleState: "DRAFT" | "SHADOW" | "ACTIVE" | "PAUSED" | "RETIRED" | null;
|
|
7
|
+
lifecycleState: "DRAFT" | "PENDING_APPROVAL" | "SHADOW" | "ACTIVE" | "PAUSED" | "RETIRED" | null;
|
|
8
8
|
manifestHash: string | null;
|
|
9
9
|
kind: "thematic" | "signal" | null;
|
|
10
10
|
backtestJobId: string | null;
|
|
11
|
+
backtestSpecHash: string | null;
|
|
11
12
|
desk: "EVENT" | "THEMATIC" | "SYSTEMATIC" | null;
|
|
12
13
|
ownerUserId: string | null;
|
|
14
|
+
fundId: string | null;
|
|
13
15
|
createdAt: Date | null;
|
|
14
16
|
updatedAt: Date | null;
|
|
15
17
|
deletedAt: Date | null;
|
|
@@ -22,8 +22,10 @@ let StrategyMinAggregate = class StrategyMinAggregate {
|
|
|
22
22
|
manifestHash;
|
|
23
23
|
kind;
|
|
24
24
|
backtestJobId;
|
|
25
|
+
backtestSpecHash;
|
|
25
26
|
desk;
|
|
26
27
|
ownerUserId;
|
|
28
|
+
fundId;
|
|
27
29
|
createdAt;
|
|
28
30
|
updatedAt;
|
|
29
31
|
deletedAt;
|
|
@@ -82,6 +84,12 @@ __decorate([
|
|
|
82
84
|
}),
|
|
83
85
|
__metadata("design:type", Object)
|
|
84
86
|
], StrategyMinAggregate.prototype, "backtestJobId", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
TypeGraphQL.Field(_type => String, {
|
|
89
|
+
nullable: true
|
|
90
|
+
}),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], StrategyMinAggregate.prototype, "backtestSpecHash", void 0);
|
|
85
93
|
__decorate([
|
|
86
94
|
TypeGraphQL.Field(_type => DeskType, {
|
|
87
95
|
nullable: true
|
|
@@ -94,6 +102,12 @@ __decorate([
|
|
|
94
102
|
}),
|
|
95
103
|
__metadata("design:type", Object)
|
|
96
104
|
], StrategyMinAggregate.prototype, "ownerUserId", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
TypeGraphQL.Field(_type => String, {
|
|
107
|
+
nullable: true
|
|
108
|
+
}),
|
|
109
|
+
__metadata("design:type", Object)
|
|
110
|
+
], StrategyMinAggregate.prototype, "fundId", void 0);
|
|
97
111
|
__decorate([
|
|
98
112
|
TypeGraphQL.Field(_type => Date, {
|
|
99
113
|
nullable: true
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import * as TypeGraphQL from "type-graphql";
|
|
11
|
+
import { FundWhereInput } from "../../inputs/FundWhereInput.mjs";
|
|
12
|
+
let CreateManyAndReturnStrategyFundArgs = class CreateManyAndReturnStrategyFundArgs {
|
|
13
|
+
where;
|
|
14
|
+
};
|
|
15
|
+
__decorate([
|
|
16
|
+
TypeGraphQL.Field(_type => FundWhereInput, {
|
|
17
|
+
nullable: true
|
|
18
|
+
}),
|
|
19
|
+
__metadata("design:type", Object)
|
|
20
|
+
], CreateManyAndReturnStrategyFundArgs.prototype, "where", void 0);
|
|
21
|
+
CreateManyAndReturnStrategyFundArgs = __decorate([
|
|
22
|
+
TypeGraphQL.ArgsType()
|
|
23
|
+
], CreateManyAndReturnStrategyFundArgs);
|
|
24
|
+
export { CreateManyAndReturnStrategyFundArgs };
|
|
25
|
+
//# sourceMappingURL=CreateManyAndReturnStrategyFundArgs.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import * as TypeGraphQL from "type-graphql";
|
|
11
|
+
import { StrategyWhereInput } from "../../inputs/StrategyWhereInput.mjs";
|
|
12
|
+
let FundCountStrategiesArgs = class FundCountStrategiesArgs {
|
|
13
|
+
where;
|
|
14
|
+
};
|
|
15
|
+
__decorate([
|
|
16
|
+
TypeGraphQL.Field(_type => StrategyWhereInput, {
|
|
17
|
+
nullable: true
|
|
18
|
+
}),
|
|
19
|
+
__metadata("design:type", Object)
|
|
20
|
+
], FundCountStrategiesArgs.prototype, "where", void 0);
|
|
21
|
+
FundCountStrategiesArgs = __decorate([
|
|
22
|
+
TypeGraphQL.ArgsType()
|
|
23
|
+
], FundCountStrategiesArgs);
|
|
24
|
+
export { FundCountStrategiesArgs };
|
|
25
|
+
//# sourceMappingURL=FundCountStrategiesArgs.js.map
|
|
@@ -31,6 +31,7 @@ export { CreateManyAndReturnNotificationEventOrganizationArgs } from "./CreateMa
|
|
|
31
31
|
export { CreateManyAndReturnPolicyOverlayRiskEscalationEventArgs } from "./CreateManyAndReturnPolicyOverlayRiskEscalationEventArgs";
|
|
32
32
|
export { CreateManyAndReturnRiskEscalationEventAlpacaAccountArgs } from "./CreateManyAndReturnRiskEscalationEventAlpacaAccountArgs";
|
|
33
33
|
export { CreateManyAndReturnRiskEscalationEventTriggeredByPolicyOverlayArgs } from "./CreateManyAndReturnRiskEscalationEventTriggeredByPolicyOverlayArgs";
|
|
34
|
+
export { CreateManyAndReturnStrategyFundArgs } from "./CreateManyAndReturnStrategyFundArgs";
|
|
34
35
|
export { CreateManyAndReturnStrategyOwnerArgs } from "./CreateManyAndReturnStrategyOwnerArgs";
|
|
35
36
|
export { CreateManyAndReturnTaxDocumentFundArgs } from "./CreateManyAndReturnTaxDocumentFundArgs";
|
|
36
37
|
export { CreateManyAndReturnTradeStrategyRefArgs } from "./CreateManyAndReturnTradeStrategyRefArgs";
|
|
@@ -49,6 +50,7 @@ export { FundCountInvestorDocumentsArgs } from "./FundCountInvestorDocumentsArgs
|
|
|
49
50
|
export { FundCountInvestorTransactionsArgs } from "./FundCountInvestorTransactionsArgs";
|
|
50
51
|
export { FundCountMandatesArgs } from "./FundCountMandatesArgs";
|
|
51
52
|
export { FundCountNotificationEventsArgs } from "./FundCountNotificationEventsArgs";
|
|
53
|
+
export { FundCountStrategiesArgs } from "./FundCountStrategiesArgs";
|
|
52
54
|
export { FundCountTaxDocumentsArgs } from "./FundCountTaxDocumentsArgs";
|
|
53
55
|
export { HoldingCountTransactionsArgs } from "./HoldingCountTransactionsArgs";
|
|
54
56
|
export { InvestorCountDocumentsArgs } from "./InvestorCountDocumentsArgs";
|
|
@@ -31,6 +31,7 @@ export { CreateManyAndReturnNotificationEventOrganizationArgs } from "./CreateM
|
|
|
31
31
|
export { CreateManyAndReturnPolicyOverlayRiskEscalationEventArgs } from "./CreateManyAndReturnPolicyOverlayRiskEscalationEventArgs.mjs";
|
|
32
32
|
export { CreateManyAndReturnRiskEscalationEventAlpacaAccountArgs } from "./CreateManyAndReturnRiskEscalationEventAlpacaAccountArgs.mjs";
|
|
33
33
|
export { CreateManyAndReturnRiskEscalationEventTriggeredByPolicyOverlayArgs } from "./CreateManyAndReturnRiskEscalationEventTriggeredByPolicyOverlayArgs.mjs";
|
|
34
|
+
export { CreateManyAndReturnStrategyFundArgs } from "./CreateManyAndReturnStrategyFundArgs.mjs";
|
|
34
35
|
export { CreateManyAndReturnStrategyOwnerArgs } from "./CreateManyAndReturnStrategyOwnerArgs.mjs";
|
|
35
36
|
export { CreateManyAndReturnTaxDocumentFundArgs } from "./CreateManyAndReturnTaxDocumentFundArgs.mjs";
|
|
36
37
|
export { CreateManyAndReturnTradeStrategyRefArgs } from "./CreateManyAndReturnTradeStrategyRefArgs.mjs";
|
|
@@ -49,6 +50,7 @@ export { FundCountInvestorDocumentsArgs } from "./FundCountInvestorDocumentsArg
|
|
|
49
50
|
export { FundCountInvestorTransactionsArgs } from "./FundCountInvestorTransactionsArgs.mjs";
|
|
50
51
|
export { FundCountMandatesArgs } from "./FundCountMandatesArgs.mjs";
|
|
51
52
|
export { FundCountNotificationEventsArgs } from "./FundCountNotificationEventsArgs.mjs";
|
|
53
|
+
export { FundCountStrategiesArgs } from "./FundCountStrategiesArgs.mjs";
|
|
52
54
|
export { FundCountTaxDocumentsArgs } from "./FundCountTaxDocumentsArgs.mjs";
|
|
53
55
|
export { HoldingCountTransactionsArgs } from "./HoldingCountTransactionsArgs.mjs";
|
|
54
56
|
export { InvestorCountDocumentsArgs } from "./InvestorCountDocumentsArgs.mjs";
|
package/esm/generated/typegraphql-prisma/resolvers/relations/User/args/UserOwnedStrategiesArgs.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ export declare class UserOwnedStrategiesArgs {
|
|
|
7
7
|
cursor?: StrategyWhereUniqueInput | undefined;
|
|
8
8
|
take?: number | undefined;
|
|
9
9
|
skip?: number | undefined;
|
|
10
|
-
distinct?: Array<"id" | "key" | "displayName" | "description" | "origin" | "lifecycleState" | "manifestHash" | "kind" | "spec" | "backtestJobId" | "desk" | "ownerUserId" | "createdAt" | "updatedAt" | "deletedAt"> | undefined;
|
|
10
|
+
distinct?: Array<"id" | "key" | "displayName" | "description" | "origin" | "lifecycleState" | "manifestHash" | "kind" | "spec" | "backtestJobId" | "backtestSpecHash" | "desk" | "ownerUserId" | "fundId" | "createdAt" | "updatedAt" | "deletedAt"> | undefined;
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=UserOwnedStrategiesArgs.d.ts.map
|
|
@@ -34,6 +34,8 @@ export interface Scenario {
|
|
|
34
34
|
auditDown?: boolean;
|
|
35
35
|
/** The credential-field guard's mode; defaults to `enforce`, production's setting. */
|
|
36
36
|
credentialMode?: CredentialFieldGuardMode;
|
|
37
|
+
/** Make every OrgMembership and FundAssignment `findUnique` fail. */
|
|
38
|
+
membershipReadsDown?: boolean;
|
|
37
39
|
}
|
|
38
40
|
export declare const SCENARIOS: Scenario[];
|
|
39
41
|
/** What the harness reports per scenario. */
|
|
@@ -42,6 +42,18 @@ const U_OTHER = '44444444-4444-4444-8444-444444444444';
|
|
|
42
42
|
const FUND_1 = '55555555-5555-4555-8555-555555555555';
|
|
43
43
|
const FUND_2 = '77777777-7777-4777-8777-777777777777';
|
|
44
44
|
const ORG_2 = '88888888-8888-4888-8888-888888888888';
|
|
45
|
+
const ORG_1 = 'org-1';
|
|
46
|
+
/** An organization its creator has just written: no members, no funds. */
|
|
47
|
+
const ORG_NEW = '99999999-9999-4999-8999-999999999999';
|
|
48
|
+
/** An organization that admits sign-ups from one email domain. */
|
|
49
|
+
const ORG_DOMAIN = 'aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa';
|
|
50
|
+
const U_ORG_OWNER = 'b0000000-0000-4000-8000-000000000001';
|
|
51
|
+
const U_ORG_ADMIN = 'b0000000-0000-4000-8000-000000000002';
|
|
52
|
+
const U_ORG_MEMBER = 'b0000000-0000-4000-8000-000000000003';
|
|
53
|
+
const U_FUND_MANAGER = 'b0000000-0000-4000-8000-000000000004';
|
|
54
|
+
const U_FUND_TRADER = 'b0000000-0000-4000-8000-000000000005';
|
|
55
|
+
const U_FOUNDER = 'b0000000-0000-4000-8000-000000000006';
|
|
56
|
+
const U_JOINER = 'b0000000-0000-4000-8000-000000000007';
|
|
45
57
|
const ACCOUNTS = {
|
|
46
58
|
a1: { id: 'a1', userId: U_OWNER, type: 'LIVE', brokerageAccount: null },
|
|
47
59
|
a2: { id: 'a2', userId: U_OTHER, type: 'PAPER', brokerageAccount: { fundId: FUND_1 } },
|
|
@@ -52,17 +64,34 @@ const POLICIES = {
|
|
|
52
64
|
p2: { id: 'p2', alpacaAccountId: 'a2' },
|
|
53
65
|
p3: { id: 'p3', alpacaAccountId: 'a3' },
|
|
54
66
|
};
|
|
55
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* The tenancy rows: U_FUND is assigned FUND_1 (org-1) as a VIEWER; FUND_2
|
|
69
|
+
* (ORG_2) bridges the LIVE account a3. org-1 has an OWNER, an ADMIN and a
|
|
70
|
+
* MEMBER, and FUND_1 a MANAGER and a TRADER.
|
|
71
|
+
*/
|
|
56
72
|
const TENANCY = {
|
|
57
|
-
organization: [
|
|
58
|
-
|
|
73
|
+
organization: [
|
|
74
|
+
{ id: ORG_1, deletedAt: null, emailDomains: [] },
|
|
75
|
+
{ id: ORG_2, deletedAt: null, emailDomains: [] },
|
|
76
|
+
{ id: ORG_NEW, deletedAt: null, emailDomains: [] },
|
|
77
|
+
{ id: ORG_DOMAIN, deletedAt: null, emailDomains: ['join.example'] },
|
|
78
|
+
],
|
|
79
|
+
orgMembership: [
|
|
80
|
+
{ id: 'om2', organizationId: ORG_2, userId: U_OTHER, role: 'MEMBER' },
|
|
81
|
+
{ id: 'om-owner', organizationId: ORG_1, userId: U_ORG_OWNER, role: 'OWNER' },
|
|
82
|
+
{ id: 'om-admin', organizationId: ORG_1, userId: U_ORG_ADMIN, role: 'ADMIN' },
|
|
83
|
+
{ id: 'om-member', organizationId: ORG_1, userId: U_ORG_MEMBER, role: 'MEMBER' },
|
|
84
|
+
{ id: 'om-domain', organizationId: ORG_DOMAIN, userId: U_OTHER, role: 'OWNER' },
|
|
85
|
+
],
|
|
59
86
|
fund: [
|
|
60
|
-
{ id: FUND_1, organizationId:
|
|
87
|
+
{ id: FUND_1, organizationId: ORG_1 },
|
|
61
88
|
{ id: FUND_2, organizationId: ORG_2 },
|
|
62
89
|
],
|
|
63
90
|
fundAssignment: [
|
|
64
|
-
{ id: 'fa1', fundId: FUND_1, userId: U_FUND },
|
|
65
|
-
{ id: 'fa2', fundId: FUND_2, userId: U_OTHER },
|
|
91
|
+
{ id: 'fa1', fundId: FUND_1, userId: U_FUND, role: 'VIEWER' },
|
|
92
|
+
{ id: 'fa2', fundId: FUND_2, userId: U_OTHER, role: 'MANAGER' },
|
|
93
|
+
{ id: 'fa-manager', fundId: FUND_1, userId: U_FUND_MANAGER, role: 'MANAGER' },
|
|
94
|
+
{ id: 'fa-trader', fundId: FUND_1, userId: U_FUND_TRADER, role: 'TRADER' },
|
|
66
95
|
],
|
|
67
96
|
brokerageAccount: [
|
|
68
97
|
{ id: 'ba1', fundId: FUND_1, engineAccountId: 'a2' },
|
|
@@ -82,9 +111,41 @@ function matches(row, where) {
|
|
|
82
111
|
if (condition !== null && typeof condition === 'object' && 'in' in condition) {
|
|
83
112
|
return condition.in.includes(row[key]);
|
|
84
113
|
}
|
|
114
|
+
if (condition !== null && typeof condition === 'object' && 'equals' in condition) {
|
|
115
|
+
return row[key] === condition.equals;
|
|
116
|
+
}
|
|
117
|
+
// A compound unique selector (`organizationId_userId: { organizationId, userId }`).
|
|
118
|
+
if (condition !== null && typeof condition === 'object' && !(key in row)) {
|
|
119
|
+
return matches(row, condition);
|
|
120
|
+
}
|
|
85
121
|
return row[key] === condition;
|
|
86
122
|
});
|
|
87
123
|
}
|
|
124
|
+
/** Project a fixture row onto a Prisma `select`, including `_count` and a to-one relation. */
|
|
125
|
+
function project(delegate, row, select) {
|
|
126
|
+
if (!select)
|
|
127
|
+
return { id: row.id };
|
|
128
|
+
const out = {};
|
|
129
|
+
for (const [key, wanted] of Object.entries(select)) {
|
|
130
|
+
if (key === '_count') {
|
|
131
|
+
const counted = wanted.select;
|
|
132
|
+
const counts = {};
|
|
133
|
+
if ('members' in counted)
|
|
134
|
+
counts.members = TENANCY.orgMembership.filter((m) => m.organizationId === row.id).length;
|
|
135
|
+
if ('funds' in counted)
|
|
136
|
+
counts.funds = TENANCY.fund.filter((f) => f.organizationId === row.id).length;
|
|
137
|
+
out._count = counts;
|
|
138
|
+
}
|
|
139
|
+
else if (delegate === 'fundAssignment' && key === 'fund') {
|
|
140
|
+
const fund = TENANCY.fund.find((f) => f.id === row.fundId);
|
|
141
|
+
out.fund = fund ? project('fund', fund, wanted.select) : null;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
out[key] = row[key];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return out;
|
|
148
|
+
}
|
|
88
149
|
const PRINCIPALS = {
|
|
89
150
|
none: null,
|
|
90
151
|
server: { kind: 'server', sub: 'adaptic-engine:host-1:42' },
|
|
@@ -93,6 +154,15 @@ const PRINCIPALS = {
|
|
|
93
154
|
owner: { kind: 'user', sub: U_OWNER, email: 'owner@example.test', roles: [] },
|
|
94
155
|
stranger: { kind: 'user', sub: U_STRANGER, roles: [] },
|
|
95
156
|
fundUser: { kind: 'user', sub: U_FUND, roles: [] },
|
|
157
|
+
orgOwner: { kind: 'user', sub: U_ORG_OWNER, roles: [] },
|
|
158
|
+
orgAdmin: { kind: 'user', sub: U_ORG_ADMIN, roles: [] },
|
|
159
|
+
// The token claims a role the caller does not hold: authority is read from
|
|
160
|
+
// the database, never from the claim.
|
|
161
|
+
orgMember: { kind: 'user', sub: U_ORG_MEMBER, roles: ['fund_operator'] },
|
|
162
|
+
fundManager: { kind: 'user', sub: U_FUND_MANAGER, roles: [] },
|
|
163
|
+
fundTrader: { kind: 'user', sub: U_FUND_TRADER, roles: [] },
|
|
164
|
+
founder: { kind: 'user', sub: U_FOUNDER, roles: [] },
|
|
165
|
+
joiner: { kind: 'user', sub: U_JOINER, roles: [] },
|
|
96
166
|
};
|
|
97
167
|
const FLIP_LIVE = 'mutation Flip { updateOneTradingPolicy(where: { alpacaAccountId: "a1" }, data: { realtimeTradingEnabled: { set: true } }) { id realtimeTradingEnabled } }';
|
|
98
168
|
const FLIP_FUND = 'mutation FlipFund { updateOneTradingPolicy(where: { alpacaAccountId: "a2" }, data: { killSwitchEnabled: { set: true } }) { id } }';
|
|
@@ -113,6 +183,15 @@ const ROOT_ASSIGNMENT_OWN_FUND = `mutation { createOneFundAssignment(data: { fun
|
|
|
113
183
|
const RETENANT_ASSIGNMENT = `mutation { updateOneFundAssignment(where: { id: "fa1" }, data: { fund: { connect: { id: "${FUND_2}" } } }) { id } }`;
|
|
114
184
|
const BROKER_LABEL = (id) => `mutation { updateOneBrokerageAccount(where: { id: "${id}" }, data: { label: { set: "x" } }) { id } }`;
|
|
115
185
|
const ARM_UNDER_USER = (userId, accountId) => `mutation { updateOneUser(where: { id: "${userId}" }, data: { alpacaAccounts: { update: [{ where: { id: "${accountId}" }, data: { tradingPolicy: ${ARM} } }] } }) { id } }`;
|
|
186
|
+
// Entitlement rows: who may write a membership or a fund assignment.
|
|
187
|
+
const SET_MEMBERSHIP_ROLE = (id, role) => `mutation { updateOneOrgMembership(where: { id: "${id}" }, data: { role: { set: ${role} } }) { id } }`;
|
|
188
|
+
const DELETE_MEMBERSHIP = (id) => `mutation { deleteOneOrgMembership(where: { id: "${id}" }) { id } }`;
|
|
189
|
+
const CREATE_MEMBERSHIP = (orgId, userId, role) => `mutation { createOneOrgMembership(data: { organization: { connect: { id: "${orgId}" } }, user: { connect: { id: "${userId}" } }, role: ${role} }) { id } }`;
|
|
190
|
+
const CREATE_ASSIGNMENT = (fundId, userId, role) => `mutation { createOneFundAssignment(data: { fund: { connect: { id: "${fundId}" } }, user: { connect: { id: "${userId}" } }, role: ${role} }) { id } }`;
|
|
191
|
+
const SET_ASSIGNMENT_ROLE = (id, role) => `mutation { updateOneFundAssignment(where: { id: "${id}" }, data: { role: { set: ${role} } }) { id } }`;
|
|
192
|
+
const SET_MEMBERSHIP_ROLE_BY_PAIR = (orgId, userId, role) => `mutation { updateOneOrgMembership(where: { organizationId_userId: { organizationId: "${orgId}", userId: "${userId}" } }, data: { role: { set: ${role} } }) { id } }`;
|
|
193
|
+
/** The platform's fund-creation payload: the creator as operator and as the fund's first MANAGER. */
|
|
194
|
+
const CREATE_FUND_WITH_MANAGER = (userId) => `mutation { createOneFund(data: { name: "F", slug: "f", organization: { connect: { id: "${ORG_1}" } }, operator: { connect: { id: "${userId}" } }, assignments: { create: [{ user: { connect: { id: "${userId}" } }, role: MANAGER }] } }) { id } }`;
|
|
116
195
|
// Blocker 2: walks that leave the root's rows.
|
|
117
196
|
const ACCOUNT_CHAIN = 'mutation { updateOneAlpacaAccount(where: { id: "a1" }, data: { brokerageAccount: { update: { data: { fund: { update: { data: { name: { set: "x" } } } } } } } }) { id } }';
|
|
118
197
|
const MANAGED_FUND_OPERATOR = `mutation { updateOneUser(where: { id: "${U_FUND}" }, data: { managedFunds: { update: [{ where: { id: "${FUND_1}" }, data: { operator: { update: { data: { role: { set: ADMIN } } } } } }] } }) { id } }`;
|
|
@@ -188,6 +267,47 @@ export const SCENARIOS = [
|
|
|
188
267
|
enforcedModels: ['TradingPolicy', 'AlpacaAccount'],
|
|
189
268
|
},
|
|
190
269
|
{ name: 'b1/rootAssignment/fundUser/enforce', query: ROOT_ASSIGNMENT_OWN_FUND, principal: 'fundUser', mode: 'enforce' },
|
|
270
|
+
{ name: 'b1/rootAssignment/fundUser/shadow', query: ROOT_ASSIGNMENT_OWN_FUND, principal: 'fundUser', mode: 'shadow' },
|
|
271
|
+
// A member's own promotion, under both modes.
|
|
272
|
+
{ name: 'mem/promoteSelf/orgMember/enforce', query: SET_MEMBERSHIP_ROLE('om-member', 'OWNER'), principal: 'orgMember', mode: 'enforce' },
|
|
273
|
+
{ name: 'mem/promoteSelf/orgMember/shadow', query: SET_MEMBERSHIP_ROLE('om-member', 'OWNER'), principal: 'orgMember', mode: 'shadow' },
|
|
274
|
+
{ name: 'mem/promoteSelfByPair/orgMember/enforce', query: SET_MEMBERSHIP_ROLE_BY_PAIR(ORG_1, U_ORG_MEMBER, 'ADMIN'), principal: 'orgMember', mode: 'enforce' },
|
|
275
|
+
{ name: 'mem/selfManager/orgMember/enforce', query: CREATE_ASSIGNMENT(FUND_1, U_ORG_MEMBER, 'MANAGER'), principal: 'orgMember', mode: 'enforce' },
|
|
276
|
+
{ name: 'mem/selfManager/orgMember/shadow', query: CREATE_ASSIGNMENT(FUND_1, U_ORG_MEMBER, 'MANAGER'), principal: 'orgMember', mode: 'shadow' },
|
|
277
|
+
{ name: 'mem/selfManager/fundUser/enforce', query: SET_ASSIGNMENT_ROLE('fa1', 'MANAGER'), principal: 'fundUser', mode: 'enforce' },
|
|
278
|
+
// OWNER and ADMIN manage the organization's memberships; only OWNER touches an OWNER row.
|
|
279
|
+
{ name: 'mem/ownerSetsRole/orgOwner/enforce', query: SET_MEMBERSHIP_ROLE('om-member', 'ADMIN'), principal: 'orgOwner', mode: 'enforce' },
|
|
280
|
+
{ name: 'mem/ownerGrantsOwner/orgOwner/enforce', query: SET_MEMBERSHIP_ROLE('om-admin', 'OWNER'), principal: 'orgOwner', mode: 'enforce' },
|
|
281
|
+
{ name: 'mem/ownerRemoves/orgOwner/enforce', query: DELETE_MEMBERSHIP('om-member'), principal: 'orgOwner', mode: 'enforce' },
|
|
282
|
+
{ name: 'mem/adminSetsRole/orgAdmin/enforce', query: SET_MEMBERSHIP_ROLE('om-member', 'AUDITOR'), principal: 'orgAdmin', mode: 'enforce' },
|
|
283
|
+
{ name: 'mem/adminGrantsOwner/orgAdmin/enforce', query: SET_MEMBERSHIP_ROLE('om-admin', 'OWNER'), principal: 'orgAdmin', mode: 'enforce' },
|
|
284
|
+
{ name: 'mem/adminDemotesOwner/orgAdmin/enforce', query: SET_MEMBERSHIP_ROLE('om-owner', 'MEMBER'), principal: 'orgAdmin', mode: 'enforce' },
|
|
285
|
+
{ name: 'mem/adminRemovesOwner/orgAdmin/enforce', query: DELETE_MEMBERSHIP('om-owner'), principal: 'orgAdmin', mode: 'enforce' },
|
|
286
|
+
{ name: 'mem/adminAddsMember/orgAdmin/enforce', query: CREATE_MEMBERSHIP(ORG_1, U_STRANGER, 'COMPLIANCE_OFFICER'), principal: 'orgAdmin', mode: 'enforce' },
|
|
287
|
+
{ name: 'mem/otherOrg/orgOwner/enforce', query: SET_MEMBERSHIP_ROLE('om2', 'OWNER'), principal: 'orgOwner', mode: 'enforce' },
|
|
288
|
+
{ name: 'mem/missingRow/orgOwner/enforce', query: SET_MEMBERSHIP_ROLE('om-none', 'ADMIN'), principal: 'orgOwner', mode: 'enforce' },
|
|
289
|
+
// Self-service: the creator of an empty organization. A domain join made as the
|
|
290
|
+
// joiner carries no proof the backend can read (the email is the caller's own column).
|
|
291
|
+
{ name: 'mem/firstOwner/founder/enforce', query: CREATE_MEMBERSHIP(ORG_NEW, U_FOUNDER, 'OWNER'), principal: 'founder', mode: 'enforce' },
|
|
292
|
+
{ name: 'mem/claimOccupied/founder/enforce', query: CREATE_MEMBERSHIP(ORG_1, U_FOUNDER, 'OWNER'), principal: 'founder', mode: 'enforce' },
|
|
293
|
+
{ name: 'mem/firstOwnerForOther/founder/enforce', query: CREATE_MEMBERSHIP(ORG_NEW, U_STRANGER, 'OWNER'), principal: 'founder', mode: 'enforce' },
|
|
294
|
+
{ name: 'mem/domainJoin/joiner/enforce', query: CREATE_MEMBERSHIP(ORG_DOMAIN, U_JOINER, 'MEMBER'), principal: 'joiner', mode: 'enforce' },
|
|
295
|
+
// An invitation's acceptance carries no proof the backend can read.
|
|
296
|
+
{ name: 'mem/inviteAccept/stranger/enforce', query: CREATE_MEMBERSHIP(ORG_1, U_STRANGER, 'ADMIN'), principal: 'stranger', mode: 'enforce' },
|
|
297
|
+
// Fund assignments: org OWNER/ADMIN, or the fund's own MANAGER.
|
|
298
|
+
{ name: 'mem/ownerAssigns/orgOwner/enforce', query: CREATE_ASSIGNMENT(FUND_1, U_STRANGER, 'MANAGER'), principal: 'orgOwner', mode: 'enforce' },
|
|
299
|
+
{ name: 'mem/adminAssigns/orgAdmin/enforce', query: CREATE_ASSIGNMENT(FUND_1, U_STRANGER, 'TRADER'), principal: 'orgAdmin', mode: 'enforce' },
|
|
300
|
+
{ name: 'mem/managerAssigns/fundManager/enforce', query: CREATE_ASSIGNMENT(FUND_1, U_STRANGER, 'ANALYST'), principal: 'fundManager', mode: 'enforce' },
|
|
301
|
+
{ name: 'mem/managerSetsRole/fundManager/enforce', query: SET_ASSIGNMENT_ROLE('fa1', 'ANALYST'), principal: 'fundManager', mode: 'enforce' },
|
|
302
|
+
{ name: 'mem/managerOtherFund/fundManager/enforce', query: CREATE_ASSIGNMENT(FUND_2, U_STRANGER, 'ANALYST'), principal: 'fundManager', mode: 'enforce' },
|
|
303
|
+
{ name: 'mem/managerOtherFundRow/fundManager/enforce', query: SET_ASSIGNMENT_ROLE('fa2', 'VIEWER'), principal: 'fundManager', mode: 'enforce' },
|
|
304
|
+
{ name: 'mem/traderAssigns/fundTrader/enforce', query: CREATE_ASSIGNMENT(FUND_1, U_STRANGER, 'ANALYST'), principal: 'fundTrader', mode: 'enforce' },
|
|
305
|
+
// The authority read fails: refused, and only observed in shadow.
|
|
306
|
+
{ name: 'mem/readDown/orgOwner/enforce', query: SET_MEMBERSHIP_ROLE('om-member', 'ADMIN'), principal: 'orgOwner', mode: 'enforce', membershipReadsDown: true },
|
|
307
|
+
{ name: 'mem/readDown/orgOwner/shadow', query: SET_MEMBERSHIP_ROLE('om-member', 'ADMIN'), principal: 'orgOwner', mode: 'shadow', membershipReadsDown: true },
|
|
308
|
+
// The platform's fund creation writes the creator's MANAGER assignment nested.
|
|
309
|
+
{ name: 'mem/fundCreate/orgOwner/enforce', query: CREATE_FUND_WITH_MANAGER(U_ORG_OWNER), principal: 'orgOwner', mode: 'enforce' },
|
|
310
|
+
{ name: 'mem/ownerSetsRole/server/enforce', query: SET_MEMBERSHIP_ROLE('om-member', 'OWNER'), principal: 'server', mode: 'enforce' },
|
|
191
311
|
{ name: 'b1/retenantAssignment/fundUser/enforce', query: RETENANT_ASSIGNMENT, principal: 'fundUser', mode: 'enforce' },
|
|
192
312
|
{ name: 'b1/crossTenantBroker/stranger/enforce', query: BROKER_LABEL('ba2'), principal: 'stranger', mode: 'enforce' },
|
|
193
313
|
{ name: 'b1/tenantBroker/fundUser/enforce', query: BROKER_LABEL('ba1'), principal: 'fundUser', mode: 'enforce' },
|
|
@@ -295,14 +415,18 @@ function policyFacts(p) {
|
|
|
295
415
|
* fixture rows (the entitlement read and the guard's scope check), and
|
|
296
416
|
* recording reads and writes.
|
|
297
417
|
*/
|
|
298
|
-
function tenancyDelegates(write, read) {
|
|
418
|
+
function tenancyDelegates(write, read, reads, membershipReadsDown) {
|
|
299
419
|
const out = {};
|
|
300
420
|
for (const [delegate, rows] of Object.entries(TENANCY)) {
|
|
301
421
|
out[delegate] = {
|
|
302
422
|
findMany: ({ where }) => read(`${delegate}.findMany`, rows.filter((r) => matches(r, where))),
|
|
303
|
-
findUnique: ({ where }) => {
|
|
423
|
+
findUnique: ({ where, select }) => {
|
|
424
|
+
if (membershipReadsDown() && (delegate === 'orgMembership' || delegate === 'fundAssignment')) {
|
|
425
|
+
reads.push(`${delegate}.findUnique`);
|
|
426
|
+
return Promise.reject(new Error('membership table unavailable'));
|
|
427
|
+
}
|
|
304
428
|
const row = rows.find((r) => matches(r, where));
|
|
305
|
-
return read(`${delegate}.findUnique`, row ?
|
|
429
|
+
return read(`${delegate}.findUnique`, row ? project(delegate, row, select) : null);
|
|
306
430
|
},
|
|
307
431
|
create: () => write(`${delegate}.create`, { id: `${delegate}-new` }),
|
|
308
432
|
update: ({ where }) => write(`${delegate}.update`, { id: where.id }),
|
|
@@ -317,6 +441,7 @@ async function main() {
|
|
|
317
441
|
let enforcedModels = new Set();
|
|
318
442
|
let auditDown = false;
|
|
319
443
|
let credentialMode = 'enforce';
|
|
444
|
+
let membershipReadsDown = false;
|
|
320
445
|
let writes = [];
|
|
321
446
|
let reads = [];
|
|
322
447
|
let audit = [];
|
|
@@ -348,7 +473,7 @@ async function main() {
|
|
|
348
473
|
user: {
|
|
349
474
|
update: ({ where }) => write('user.update', { id: where.id }),
|
|
350
475
|
},
|
|
351
|
-
...tenancyDelegates(write, read),
|
|
476
|
+
...tenancyDelegates(write, read, { push: (name) => reads.push(name) }, () => membershipReadsDown),
|
|
352
477
|
auditLog: {
|
|
353
478
|
create: ({ data }) => {
|
|
354
479
|
if (auditDown)
|
|
@@ -395,6 +520,7 @@ async function main() {
|
|
|
395
520
|
enforcedModels = new Set(scenario.enforcedModels ?? []);
|
|
396
521
|
auditDown = scenario.auditDown === true;
|
|
397
522
|
credentialMode = scenario.credentialMode ?? 'enforce';
|
|
523
|
+
membershipReadsDown = scenario.membershipReadsDown === true;
|
|
398
524
|
writes = [];
|
|
399
525
|
reads = [];
|
|
400
526
|
audit = [];
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* policy or account row, that account.
|
|
5
5
|
*
|
|
6
6
|
* The decision itself lives in `src/auth/mutation-authorization.ts` (pure);
|
|
7
|
-
* this module installs it on the built schema, resolves the ownership
|
|
8
|
-
* user principal's write needs
|
|
7
|
+
* this module installs it on the built schema, resolves the ownership,
|
|
8
|
+
* tenancy and membership-role facts a user principal's write needs (read
|
|
9
|
+
* from the database for the mutation, never from the token), counts and logs
|
|
10
|
+
* every decision, and writes the
|
|
9
11
|
* attributed TradingPolicy audit rows (`./trading-policy-audit.ts`).
|
|
10
12
|
*
|
|
11
13
|
* ## Why it wraps the Mutation fields instead of being a global middleware
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* policy or account row, that account.
|
|
5
5
|
*
|
|
6
6
|
* The decision itself lives in `src/auth/mutation-authorization.ts` (pure);
|
|
7
|
-
* this module installs it on the built schema, resolves the ownership
|
|
8
|
-
* user principal's write needs
|
|
7
|
+
* this module installs it on the built schema, resolves the ownership,
|
|
8
|
+
* tenancy and membership-role facts a user principal's write needs (read
|
|
9
|
+
* from the database for the mutation, never from the token), counts and logs
|
|
10
|
+
* every decision, and writes the
|
|
9
11
|
* attributed TradingPolicy audit rows (`./trading-policy-audit.ts`).
|
|
10
12
|
*
|
|
11
13
|
* ## Why it wraps the Mutation fields instead of being a global middleware
|
|
@@ -53,6 +55,7 @@ import { defaultFieldResolver, GraphQLError, } from 'graphql';
|
|
|
53
55
|
import { Counter } from 'prom-client';
|
|
54
56
|
import { redactCredentials } from '../auth/credential-redaction.mjs';
|
|
55
57
|
import { classifyMutationField, effectiveModeFor, evaluateMutationAccess, getEnforcedModels, getMutationAuthMode, touchesAlwaysEnforced, } from '../auth/mutation-authorization.mjs';
|
|
58
|
+
import { isMembershipModel } from '../auth/membership-write-authority.mjs';
|
|
56
59
|
import { findNestedWrites } from '../auth/nested-write-inspector.mjs';
|
|
57
60
|
import { firstNestedRefusal, writesNestedModelRows } from '../auth/nested-write-policy.mjs';
|
|
58
61
|
import { GOVERNED_MODELS } from '../auth/tenancy-scope.mjs';
|
|
@@ -61,6 +64,7 @@ import { metricsRegistry } from '../config/metrics.mjs';
|
|
|
61
64
|
import { logger } from '../utils/logger.mjs';
|
|
62
65
|
import { credentialAccessForbidden, credentialFieldAccessTotal, findCredentialArgumentReferences, getCredentialFieldGuardMode, } from './credential-field-guard.mjs';
|
|
63
66
|
import { loadTouchedAccounts, ownershipOf, resolveNestedPolicyRows, } from './mutation-account-facts.mjs';
|
|
67
|
+
import { membershipWriteVerdict } from './mutation-membership-facts.mjs';
|
|
64
68
|
import { mandateVersionScopeOf, tenantScopeOf } from './mutation-tenant-facts.mjs';
|
|
65
69
|
import { actorFor, changeReasonFor, isDisarmOnlyPolicyWrite, mayTouchLiveAccount, mutationAuditBypassedTotal, touchesTradingSwitch, writeAttemptRow, writeResultRow, } from './trading-policy-audit.mjs';
|
|
66
70
|
/**
|
|
@@ -213,6 +217,20 @@ async function decide(principal, target, nested, args, touched, prisma, relation
|
|
|
213
217
|
return first;
|
|
214
218
|
}
|
|
215
219
|
}
|
|
220
|
+
if (first.reason === 'membership_authority_unresolved' && isMembershipModel(target.model)) {
|
|
221
|
+
try {
|
|
222
|
+
const membership = await membershipWriteVerdict(prisma, target.model, target, args, principal.sub);
|
|
223
|
+
const membershipAuthority = membership.kind === 'decided' ? membership.verdict : 'unresolved';
|
|
224
|
+
return evaluateMutationAccess(principal, target, { ...facts, membershipAuthority });
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
logger.error('[mutation-auth] membership authority could not be read; refusing as unresolved', {
|
|
228
|
+
mutation: target.fieldName,
|
|
229
|
+
error: error instanceof Error ? error.message : String(error),
|
|
230
|
+
});
|
|
231
|
+
return first;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
216
234
|
if (first.reason === 'tenant_unresolved' && (isGovernedModel(target.model) || target.model === 'MandateVersion')) {
|
|
217
235
|
try {
|
|
218
236
|
const tenantScope = isGovernedModel(target.model)
|