@adaptic/backend-legacy 0.0.1054 → 0.0.1055
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/mutation-authorization.d.ts +4 -1
- package/esm/auth/mutation-authorization.mjs +15 -1
- package/esm/auth/tenancy-scope.d.ts +49 -8
- package/esm/auth/tenancy-scope.mjs +86 -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/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
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy fund tenancy (G-STR-06) on the served path, against a real Postgres
|
|
3
|
+
* built from the migration history.
|
|
4
|
+
*
|
|
5
|
+
* The schema is assembled as src/server.ts assembles it — generated resolvers
|
|
6
|
+
* minus server-only models, the strategy-draft resolver, the credential-field
|
|
7
|
+
* guard and tenancy scoping as global middlewares, the cortex authChecker over
|
|
8
|
+
* the authorization map, then the mutation guard installed on the built
|
|
9
|
+
* schema — and every operation runs through `graphql()` with a principal in
|
|
10
|
+
* the context. Both staged modes are left unset (`shadow`), because the claim
|
|
11
|
+
* under test is that the Strategy scope does not depend on them.
|
|
12
|
+
*
|
|
13
|
+
* Seeds two organizations, one fund in each, ALICE as a member of
|
|
14
|
+
* organization A and BOB assigned to fund B, one SYSTEM strategy, and a draft
|
|
15
|
+
* ALICE authored that sits in fund B (as if she had since left it). Needs
|
|
16
|
+
* `DESK_IT_DATABASE_URL` pointing at a disposable migrated database. Output is
|
|
17
|
+
* printed between `<<<RESULTS>>>` and `<<<END>>>`; seeded rows are removed.
|
|
18
|
+
*/
|
|
19
|
+
import 'reflect-metadata';
|
|
20
|
+
import { randomUUID } from 'node:crypto';
|
|
21
|
+
import { PrismaClient } from '@prisma/client';
|
|
22
|
+
import { buildSchema } from 'type-graphql';
|
|
23
|
+
import { graphql } from 'graphql';
|
|
24
|
+
import { resolvers } from '../generated/typegraphql-prisma/index.mjs';
|
|
25
|
+
import { withoutServerOnlyResolvers, withoutServerOnlySchemaSurface, } from '../config/server-only-models.mjs';
|
|
26
|
+
import { StrategyDraftResolver } from '../resolvers/custom/index.mjs';
|
|
27
|
+
import { createCredentialFieldGuardMiddleware } from '../middleware/credential-field-guard.mjs';
|
|
28
|
+
import { createTenancyScopingMiddleware } from '../middleware/tenancy-scoping.mjs';
|
|
29
|
+
import { installMutationAuthGuard } from '../middleware/mutation-auth-guard.mjs';
|
|
30
|
+
import { cortexAuthChecker } from '../auth/cortex-auth-checker.mjs';
|
|
31
|
+
import { applyCortexAuthorizationMap } from '../auth/authorization-map.mjs';
|
|
32
|
+
async function run(schema, prisma, principal, source, variableValues = {}) {
|
|
33
|
+
const result = await graphql({
|
|
34
|
+
schema,
|
|
35
|
+
source,
|
|
36
|
+
variableValues,
|
|
37
|
+
contextValue: { prisma, principal },
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
data: result.data ?? null,
|
|
41
|
+
errors: (result.errors ?? []).map((error) => error.message),
|
|
42
|
+
codes: (result.errors ?? []).map((error) => String(error.extensions?.code ?? '')),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const CREATE = `mutation ($fundId: String!, $name: String!) {
|
|
46
|
+
createStrategyDraft(fundId: $fundId, kind: thematic, displayName: $name, spec: { thesis: "Grid" }) { status id revision }
|
|
47
|
+
}`;
|
|
48
|
+
const SAVE = `mutation ($id: String!, $rev: DateTimeISO!) {
|
|
49
|
+
saveStrategyDraft(id: $id, expectedRevision: $rev, displayName: "Edited", spec: { thesis: "Edited" }) { status }
|
|
50
|
+
}`;
|
|
51
|
+
const LIST = `query ($prefix: String!) {
|
|
52
|
+
strategies(where: { key: { startsWith: $prefix } }, orderBy: [{ key: asc }]) { key fundId }
|
|
53
|
+
}`;
|
|
54
|
+
const ONE = `query ($id: String!) { strategy(where: { id: $id }) { id } }`;
|
|
55
|
+
async function main() {
|
|
56
|
+
const url = process.env.DESK_IT_DATABASE_URL;
|
|
57
|
+
if (!url)
|
|
58
|
+
throw new Error('DESK_IT_DATABASE_URL is not set');
|
|
59
|
+
delete process.env.MUTATION_AUTH_MODE;
|
|
60
|
+
delete process.env.MUTATION_AUTH_ENFORCE_MODELS;
|
|
61
|
+
delete process.env.TENANCY_SCOPING_MODE;
|
|
62
|
+
delete process.env.CORTEX_AUTHCHECKER_ENFORCE;
|
|
63
|
+
const prisma = new PrismaClient({ datasourceUrl: url });
|
|
64
|
+
applyCortexAuthorizationMap();
|
|
65
|
+
const schema = withoutServerOnlySchemaSurface(await buildSchema({
|
|
66
|
+
resolvers: [
|
|
67
|
+
...withoutServerOnlyResolvers(resolvers),
|
|
68
|
+
StrategyDraftResolver,
|
|
69
|
+
],
|
|
70
|
+
validate: false,
|
|
71
|
+
globalMiddlewares: [
|
|
72
|
+
createCredentialFieldGuardMiddleware(),
|
|
73
|
+
createTenancyScopingMiddleware(),
|
|
74
|
+
],
|
|
75
|
+
authChecker: cortexAuthChecker,
|
|
76
|
+
}));
|
|
77
|
+
installMutationAuthGuard(schema);
|
|
78
|
+
const tag = randomUUID().slice(0, 8);
|
|
79
|
+
const prefix = `str06-${tag}`;
|
|
80
|
+
const alice = await prisma.user.create({
|
|
81
|
+
data: { email: `str06-a-${tag}@example.test` },
|
|
82
|
+
});
|
|
83
|
+
const bob = await prisma.user.create({
|
|
84
|
+
data: { email: `str06-b-${tag}@example.test` },
|
|
85
|
+
});
|
|
86
|
+
const orgA = await prisma.organization.create({
|
|
87
|
+
data: { name: `A ${tag}`, slug: `str06-a-${tag}` },
|
|
88
|
+
});
|
|
89
|
+
const orgB = await prisma.organization.create({
|
|
90
|
+
data: { name: `B ${tag}`, slug: `str06-b-${tag}` },
|
|
91
|
+
});
|
|
92
|
+
const fundA = await prisma.fund.create({
|
|
93
|
+
data: { name: 'A', slug: `a-${tag}`, organizationId: orgA.id },
|
|
94
|
+
});
|
|
95
|
+
const fundB = await prisma.fund.create({
|
|
96
|
+
data: { name: 'B', slug: `b-${tag}`, organizationId: orgB.id },
|
|
97
|
+
});
|
|
98
|
+
await prisma.orgMembership.create({
|
|
99
|
+
data: { organizationId: orgA.id, userId: alice.id },
|
|
100
|
+
});
|
|
101
|
+
await prisma.fundAssignment.create({
|
|
102
|
+
data: { fundId: fundB.id, userId: bob.id },
|
|
103
|
+
});
|
|
104
|
+
await prisma.strategy.create({
|
|
105
|
+
data: { key: `${prefix}-0-system`, displayName: 'System' },
|
|
106
|
+
});
|
|
107
|
+
const aliceInB = await prisma.strategy.create({
|
|
108
|
+
data: {
|
|
109
|
+
key: `${prefix}-3-alice-in-b`,
|
|
110
|
+
displayName: 'Left behind',
|
|
111
|
+
origin: 'USER',
|
|
112
|
+
kind: 'thematic',
|
|
113
|
+
spec: { thesis: 'Grid' },
|
|
114
|
+
ownerUserId: alice.id,
|
|
115
|
+
fundId: fundB.id,
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
const ALICE = { kind: 'user', sub: alice.id, roles: [] };
|
|
119
|
+
const BOB = { kind: 'user', sub: bob.id, roles: [] };
|
|
120
|
+
const SERVICE = { kind: 'server' };
|
|
121
|
+
const steps = {};
|
|
122
|
+
const facts = {
|
|
123
|
+
fundA: fundA.id,
|
|
124
|
+
fundB: fundB.id,
|
|
125
|
+
prefix,
|
|
126
|
+
};
|
|
127
|
+
try {
|
|
128
|
+
steps.aliceCreatesInB = await run(schema, prisma, ALICE, CREATE, {
|
|
129
|
+
fundId: fundB.id,
|
|
130
|
+
name: 'Not mine',
|
|
131
|
+
});
|
|
132
|
+
steps.aliceCreatesInA = await run(schema, prisma, ALICE, CREATE, {
|
|
133
|
+
fundId: fundA.id,
|
|
134
|
+
name: 'Mine',
|
|
135
|
+
});
|
|
136
|
+
steps.bobCreatesInB = await run(schema, prisma, BOB, CREATE, {
|
|
137
|
+
fundId: fundB.id,
|
|
138
|
+
name: 'Bob',
|
|
139
|
+
});
|
|
140
|
+
const created = await prisma.strategy.findMany({
|
|
141
|
+
where: {
|
|
142
|
+
ownerUserId: { in: [alice.id, bob.id] },
|
|
143
|
+
key: { startsWith: 'desk-' },
|
|
144
|
+
},
|
|
145
|
+
select: { id: true, ownerUserId: true, fundId: true },
|
|
146
|
+
});
|
|
147
|
+
facts.created = created.map((row) => ({
|
|
148
|
+
owner: row.ownerUserId === alice.id ? 'alice' : 'bob',
|
|
149
|
+
fund: row.fundId === fundA.id
|
|
150
|
+
? 'A'
|
|
151
|
+
: row.fundId === fundB.id
|
|
152
|
+
? 'B'
|
|
153
|
+
: row.fundId,
|
|
154
|
+
}));
|
|
155
|
+
// Give the builder's rows the tag prefix so the list reads below see them.
|
|
156
|
+
for (const row of created) {
|
|
157
|
+
const who = row.ownerUserId === alice.id ? '1-alice-in-a' : '2-bob-in-b';
|
|
158
|
+
await prisma.strategy.update({
|
|
159
|
+
where: { id: row.id },
|
|
160
|
+
data: { key: `${prefix}-${who}` },
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
const bobDraft = created.find((row) => row.ownerUserId === bob.id);
|
|
164
|
+
steps.aliceList = await run(schema, prisma, ALICE, LIST, { prefix });
|
|
165
|
+
steps.bobList = await run(schema, prisma, BOB, LIST, { prefix });
|
|
166
|
+
steps.anonymousList = await run(schema, prisma, null, LIST, { prefix });
|
|
167
|
+
steps.serviceList = await run(schema, prisma, SERVICE, LIST, { prefix });
|
|
168
|
+
steps.aliceReadsBobsDraft = await run(schema, prisma, ALICE, ONE, {
|
|
169
|
+
id: bobDraft?.id ?? '',
|
|
170
|
+
});
|
|
171
|
+
steps.aliceReadsHerDraftInB = await run(schema, prisma, ALICE, ONE, {
|
|
172
|
+
id: aliceInB.id,
|
|
173
|
+
});
|
|
174
|
+
steps.aliceSavesHerDraftInB = await run(schema, prisma, ALICE, SAVE, {
|
|
175
|
+
id: aliceInB.id,
|
|
176
|
+
rev: aliceInB.updatedAt.toISOString(),
|
|
177
|
+
});
|
|
178
|
+
const after = await prisma.strategy.findUniqueOrThrow({
|
|
179
|
+
where: { id: aliceInB.id },
|
|
180
|
+
});
|
|
181
|
+
facts.aliceInBAfterSave = {
|
|
182
|
+
displayName: after.displayName,
|
|
183
|
+
fund: after.fundId === fundB.id ? 'B' : after.fundId,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
finally {
|
|
187
|
+
await prisma.strategy.deleteMany({
|
|
188
|
+
where: {
|
|
189
|
+
OR: [
|
|
190
|
+
{ key: { startsWith: prefix } },
|
|
191
|
+
{ ownerUserId: { in: [alice.id, bob.id] } },
|
|
192
|
+
],
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
await prisma.fundAssignment.deleteMany({ where: { userId: bob.id } });
|
|
196
|
+
await prisma.orgMembership.deleteMany({ where: { userId: alice.id } });
|
|
197
|
+
await prisma.fund.deleteMany({
|
|
198
|
+
where: { id: { in: [fundA.id, fundB.id] } },
|
|
199
|
+
});
|
|
200
|
+
await prisma.organization.deleteMany({
|
|
201
|
+
where: { id: { in: [orgA.id, orgB.id] } },
|
|
202
|
+
});
|
|
203
|
+
await prisma.user.deleteMany({ where: { id: { in: [alice.id, bob.id] } } });
|
|
204
|
+
await prisma.$disconnect();
|
|
205
|
+
}
|
|
206
|
+
process.stdout.write(`<<<RESULTS>>>${JSON.stringify({ steps, facts })}<<<END>>>\n`);
|
|
207
|
+
}
|
|
208
|
+
main().catch((error) => {
|
|
209
|
+
process.stderr.write(`harness failed: ${String(error)}\n`);
|
|
210
|
+
process.exit(1);
|
|
211
|
+
});
|
|
212
|
+
//# sourceMappingURL=strategy-fund-tenancy.harness.js.map
|
|
@@ -31,6 +31,11 @@ signal: \`{ hypothesis, inputs[], formula, universe, neutralise { sector, beta,
|
|
|
31
31
|
size }, allocationPct, paperSessions, promotionGate }\`. NULL means no draft
|
|
32
32
|
has been authored.
|
|
33
33
|
spec?: any;
|
|
34
|
+
// SHA-256 (hex) of the canonical JSON of the \`spec\` the backtest in
|
|
35
|
+
\`backtestJobId\` was run against (\`src/resolvers/custom/strategy-spec-hash.ts\`).
|
|
36
|
+
A backtest attests a spec only while this equals the hash of the stored
|
|
37
|
+
spec. NULL means no backtest is recorded against any spec.
|
|
38
|
+
backtestSpecHash?: string;
|
|
34
39
|
// The agent desk this strategy trades under. NULL means no operator has
|
|
35
40
|
assigned it yet: a strategy is never placed on a desk by default, because
|
|
36
41
|
the desk decides which autonomy matrix governs its orders and which desk's
|
|
@@ -49,6 +54,8 @@ enum StrategyOrigin {
|
|
|
49
54
|
enum StrategyLifecycleState {
|
|
50
55
|
DRAFT
|
|
51
56
|
|
|
57
|
+
PENDING_APPROVAL
|
|
58
|
+
|
|
52
59
|
SHADOW
|
|
53
60
|
|
|
54
61
|
ACTIVE
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const StrategyTypeString = "\n// Your response should adhere to the following type definition for the \"Strategy\" type.\n// Importantly, DO NOT include any annotations in your response (i.e., remove the ones we have provided for your reference below).\n\nexport type Strategy = {\n // Stable machine key, e.g. \"core-equity-llm-v1\". Matches the engine Tier A\n`StrategyRegistryEntry.key` column type exactly.\n key: string;\n // Operator/user-facing name.\n displayName: string;\n // Human-readable description of what the strategy does.\n description?: string;\n // Where the definition came from.\n origin: StrategyOrigin;\n // Lifecycle stage. New rows default to DRAFT so a strategy is never\nrecorded as live merely by virtue of existing.\n lifecycleState: StrategyLifecycleState;\n // SHA-256 (hex) of the canonical JSON manifest describing what this\nstrategy runs (prompt id, feature view, exit tiers). NULL means no\nmanifest is bound yet \u2014 it is genuinely unknown, never a placeholder.\n manifestHash?: string;\n // Authoring kind: a thematic basket or a signal strategy. NULL for strategies\nthat predate desk authoring.\n kind?: StrategyKind;\n // Authored specification (JSON). Thematic: `{ thesis, horizon, constituents[],\nweighting, allocationPct, maxNamePct, rebalance, exitRule, benchmark }`;\nsignal: `{ hypothesis, inputs[], formula, universe, neutralise { sector, beta,\nsize }, allocationPct, paperSessions, promotionGate }`. NULL means no draft\nhas been authored.\n spec?: any;\n // The agent desk this strategy trades under. NULL means no operator has\nassigned it yet: a strategy is never placed on a desk by default, because\nthe desk decides which autonomy matrix governs its orders and which desk's\nmetrics its fills count toward.\n desk?: DeskType;\n};\n\nenum StrategyOrigin {\n SYSTEM\n\n USER\n\n AI_GENERATED\n}\n\nenum StrategyLifecycleState {\n DRAFT\n\n SHADOW\n\n ACTIVE\n\n PAUSED\n\n RETIRED\n}\n\nenum StrategyKind {\n thematic\n\n signal\n}\n\nenum DeskType {\n EVENT\n\n THEMATIC\n\n SYSTEMATIC\n}\n\n";
|
|
1
|
+
export declare const StrategyTypeString = "\n// Your response should adhere to the following type definition for the \"Strategy\" type.\n// Importantly, DO NOT include any annotations in your response (i.e., remove the ones we have provided for your reference below).\n\nexport type Strategy = {\n // Stable machine key, e.g. \"core-equity-llm-v1\". Matches the engine Tier A\n`StrategyRegistryEntry.key` column type exactly.\n key: string;\n // Operator/user-facing name.\n displayName: string;\n // Human-readable description of what the strategy does.\n description?: string;\n // Where the definition came from.\n origin: StrategyOrigin;\n // Lifecycle stage. New rows default to DRAFT so a strategy is never\nrecorded as live merely by virtue of existing.\n lifecycleState: StrategyLifecycleState;\n // SHA-256 (hex) of the canonical JSON manifest describing what this\nstrategy runs (prompt id, feature view, exit tiers). NULL means no\nmanifest is bound yet \u2014 it is genuinely unknown, never a placeholder.\n manifestHash?: string;\n // Authoring kind: a thematic basket or a signal strategy. NULL for strategies\nthat predate desk authoring.\n kind?: StrategyKind;\n // Authored specification (JSON). Thematic: `{ thesis, horizon, constituents[],\nweighting, allocationPct, maxNamePct, rebalance, exitRule, benchmark }`;\nsignal: `{ hypothesis, inputs[], formula, universe, neutralise { sector, beta,\nsize }, allocationPct, paperSessions, promotionGate }`. NULL means no draft\nhas been authored.\n spec?: any;\n // SHA-256 (hex) of the canonical JSON of the `spec` the backtest in\n`backtestJobId` was run against (`src/resolvers/custom/strategy-spec-hash.ts`).\nA backtest attests a spec only while this equals the hash of the stored\nspec. NULL means no backtest is recorded against any spec.\n backtestSpecHash?: string;\n // The agent desk this strategy trades under. NULL means no operator has\nassigned it yet: a strategy is never placed on a desk by default, because\nthe desk decides which autonomy matrix governs its orders and which desk's\nmetrics its fills count toward.\n desk?: DeskType;\n};\n\nenum StrategyOrigin {\n SYSTEM\n\n USER\n\n AI_GENERATED\n}\n\nenum StrategyLifecycleState {\n DRAFT\n\n PENDING_APPROVAL\n\n SHADOW\n\n ACTIVE\n\n PAUSED\n\n RETIRED\n}\n\nenum StrategyKind {\n thematic\n\n signal\n}\n\nenum DeskType {\n EVENT\n\n THEMATIC\n\n SYSTEMATIC\n}\n\n";
|
|
2
2
|
//# sourceMappingURL=Strategy.d.ts.map
|
|
@@ -83,7 +83,7 @@ export declare const typeStrings: {
|
|
|
83
83
|
readonly mandateVersion: "\n// Your response should adhere to the following type definition for the \"MandateVersion\" type.\n// Importantly, DO NOT include any annotations in your response (i.e., remove the ones we have provided for your reference below).\n\nexport type MandateVersion = {\n // Relation to the parent Mandate.\n mandate: {\n // Human-readable mandate name.\n name: string;\n // Category of the mandate (strategy charter, firm ethos, approval matrix, risk policy, SOP).\n klass: MandateClass;\n };\n // Human-readable version label (e.g. 'v1', 'v2.1', '2026-Q3').\n versionLabel: string;\n // Monotonic version sequence within the mandate (1, 2, 3, …); orders the version history.\n versionSeq: number;\n // Lifecycle state of this version.\n status: MandateStatus;\n // Short human summary of what this version establishes or changes.\n summary?: string;\n // Autonomy matrix: desk → action → size bucket (four buckets) → 'auto' | 'notify' | 'approve' | 'forbidden' (JSON). Null means the version sets none.\n autonomy?: any;\n // Escalation triggers: `{ id, label, condition, route, deadlineMinutes | null, defaultAction, enabled }[]` (JSON). Null means none are set.\n triggers?: any;\n // Instrument permissions: `{ id, label, enabled }[]` (JSON). Null means none are set.\n instruments?: any;\n // Excluded symbols, sectors or issuers named by this version. Empty means no exclusions.\n exclusions: string[];\n // Relation to the authoring User.\n authoredBy?: {\n // The user's full name.\n name?: string;\n // The user's email address, must be unique.\n email?: string;\n };\n};\n\nenum MandateClass {\n STRATEGY_CHARTER\n\n FIRM_ETHOS\n\n APPROVAL_MATRIX\n\n RISK_POLICY\n\n SOP\n}\n\nenum MandateStatus {\n DRAFTED\n\n PROPOSED\n\n APPROVED\n\n SUPERSEDED\n\n ARCHIVED\n}\n\n";
|
|
84
84
|
readonly mandateRule: "\n// Your response should adhere to the following type definition for the \"MandateRule\" type.\n// Importantly, DO NOT include any annotations in your response (i.e., remove the ones we have provided for your reference below).\n\nexport type MandateRule = {\n // Relation to the parent MandateVersion.\n mandateVersion: {\n // Human-readable version label (e.g. 'v1', 'v2.1', '2026-Q3').\n versionLabel: string;\n };\n // Short label identifying the clause (platform MandateRule.label).\n label: string;\n // Human-readable clause text (platform MandateRule.detail).\n detail: string;\n // Control gate this clause imposes (platform MandateRule.control / GovActType).\n control: MandateControlGate;\n // Numeric threshold for the clause, if quantitative (platform MandateRule.threshold). Null for qualitative clauses.\n threshold?: number;\n // Unit of the threshold (e.g. '%', 'bps', 'USD', 'positions'); platform MandateRule.unit.\n unit?: string;\n // Direction/nature of the threshold (MAX/MIN/TARGET/TRIGGER); platform MandateRule.limitKind. Null for qualitative clauses.\n limitKind?: MandateLimitKind;\n // Stable code naming this rule within its version (e.g. `R-01`, `R-01b`); the\ndesk's limit gauges and the ledger cite it. Unique per mandate version.\nNull for a clause no gauge or ledger entry cites.\n ruleCode?: string;\n // The quantity the engine measures against `threshold`. Null for a\nqualitative clause, which no gauge can show. A rule naming a metric must\nalso carry `threshold`, `action`, `group` and `ruleCode` (database CHECK\n`mandate_rules_metric_complete_check`), because a limit gauge needs every\none of them.\n metricKey?: MandateMetric;\n // What the engine does when the measured quantity crosses `threshold`. Null\nfor a qualitative clause.\n action?: MandateAction;\n // The gauge group this rule is shown under on the desk. Null for a\nqualitative clause.\n group?: MandateRuleGroup;\n};\n\nenum MandateControlGate {\n AUTO\n\n NOTIFY\n\n APPROVAL\n\n PROPOSE\n\n HUMAN\n}\n\nenum MandateLimitKind {\n MAX\n\n MIN\n\n TARGET\n\n TRIGGER\n}\n\nenum MandateMetric {\n GROSS_LEVERAGE\n\n NET_EXPOSURE_RATIO\n\n SINGLE_NAME_CONCENTRATION\n\n MAX_SECTOR_CONCENTRATION\n\n DAILY_LOSS\n\n DRAWDOWN\n\n VAR_95\n\n VAR_99\n\n EXPECTED_SHORTFALL_95\n\n MARGIN_UTILIZATION\n\n OPEN_POSITIONS\n}\n\nenum MandateAction {\n BLOCK\n\n ESCALATE\n\n HALT\n\n DERISK\n}\n\nenum MandateRuleGroup {\n EXPOSURE\n\n LOSS\n\n LIQUIDITY\n}\n\n";
|
|
85
85
|
readonly mandateApproval: "\n// Your response should adhere to the following type definition for the \"MandateApproval\" type.\n// Importantly, DO NOT include any annotations in your response (i.e., remove the ones we have provided for your reference below).\n\nexport type MandateApproval = {\n // Relation to the MandateVersion.\n mandateVersion: {\n // Human-readable version label (e.g. 'v1', 'v2.1', '2026-Q3').\n versionLabel: string;\n // Lifecycle state of this version.\n status: MandateStatus;\n };\n // Governance action taken ('propose' | 'approve' | 'reject' | 'escalate' | 'supersede' | 'archive'); lowercase String matching the platform/engine decision contract. Kept as String, not an enum, per the five-enum mandate-store spec.\n action: string;\n // Relation to the deciding User.\n decidedBy?: {\n // The user's full name.\n name?: string;\n // The user's email address, must be unique.\n email?: string;\n };\n // Role under which the decision was made ('compliance_officer' | 'fund_operator' | …); lowercase String to match the platform contract.\n decidedByRole?: string;\n // Free-text rationale for the decision.\n rationale?: string;\n};\n\nenum MandateStatus {\n DRAFTED\n\n PROPOSED\n\n APPROVED\n\n SUPERSEDED\n\n ARCHIVED\n}\n\n";
|
|
86
|
-
readonly strategy: "\n// Your response should adhere to the following type definition for the \"Strategy\" type.\n// Importantly, DO NOT include any annotations in your response (i.e., remove the ones we have provided for your reference below).\n\nexport type Strategy = {\n // Stable machine key, e.g. \"core-equity-llm-v1\". Matches the engine Tier A\n`StrategyRegistryEntry.key` column type exactly.\n key: string;\n // Operator/user-facing name.\n displayName: string;\n // Human-readable description of what the strategy does.\n description?: string;\n // Where the definition came from.\n origin: StrategyOrigin;\n // Lifecycle stage. New rows default to DRAFT so a strategy is never\nrecorded as live merely by virtue of existing.\n lifecycleState: StrategyLifecycleState;\n // SHA-256 (hex) of the canonical JSON manifest describing what this\nstrategy runs (prompt id, feature view, exit tiers). NULL means no\nmanifest is bound yet — it is genuinely unknown, never a placeholder.\n manifestHash?: string;\n // Authoring kind: a thematic basket or a signal strategy. NULL for strategies\nthat predate desk authoring.\n kind?: StrategyKind;\n // Authored specification (JSON). Thematic: `{ thesis, horizon, constituents[],\nweighting, allocationPct, maxNamePct, rebalance, exitRule, benchmark }`;\nsignal: `{ hypothesis, inputs[], formula, universe, neutralise { sector, beta,\nsize }, allocationPct, paperSessions, promotionGate }`. NULL means no draft\nhas been authored.\n spec?: any;\n // The agent desk this strategy trades under. NULL means no operator has\nassigned it yet: a strategy is never placed on a desk by default, because\nthe desk decides which autonomy matrix governs its orders and which desk's\nmetrics its fills count toward.\n desk?: DeskType;\n};\n\nenum StrategyOrigin {\n SYSTEM\n\n USER\n\n AI_GENERATED\n}\n\nenum StrategyLifecycleState {\n DRAFT\n\n SHADOW\n\n ACTIVE\n\n PAUSED\n\n RETIRED\n}\n\nenum StrategyKind {\n thematic\n\n signal\n}\n\nenum DeskType {\n EVENT\n\n THEMATIC\n\n SYSTEMATIC\n}\n\n";
|
|
86
|
+
readonly strategy: "\n// Your response should adhere to the following type definition for the \"Strategy\" type.\n// Importantly, DO NOT include any annotations in your response (i.e., remove the ones we have provided for your reference below).\n\nexport type Strategy = {\n // Stable machine key, e.g. \"core-equity-llm-v1\". Matches the engine Tier A\n`StrategyRegistryEntry.key` column type exactly.\n key: string;\n // Operator/user-facing name.\n displayName: string;\n // Human-readable description of what the strategy does.\n description?: string;\n // Where the definition came from.\n origin: StrategyOrigin;\n // Lifecycle stage. New rows default to DRAFT so a strategy is never\nrecorded as live merely by virtue of existing.\n lifecycleState: StrategyLifecycleState;\n // SHA-256 (hex) of the canonical JSON manifest describing what this\nstrategy runs (prompt id, feature view, exit tiers). NULL means no\nmanifest is bound yet — it is genuinely unknown, never a placeholder.\n manifestHash?: string;\n // Authoring kind: a thematic basket or a signal strategy. NULL for strategies\nthat predate desk authoring.\n kind?: StrategyKind;\n // Authored specification (JSON). Thematic: `{ thesis, horizon, constituents[],\nweighting, allocationPct, maxNamePct, rebalance, exitRule, benchmark }`;\nsignal: `{ hypothesis, inputs[], formula, universe, neutralise { sector, beta,\nsize }, allocationPct, paperSessions, promotionGate }`. NULL means no draft\nhas been authored.\n spec?: any;\n // SHA-256 (hex) of the canonical JSON of the `spec` the backtest in\n`backtestJobId` was run against (`src/resolvers/custom/strategy-spec-hash.ts`).\nA backtest attests a spec only while this equals the hash of the stored\nspec. NULL means no backtest is recorded against any spec.\n backtestSpecHash?: string;\n // The agent desk this strategy trades under. NULL means no operator has\nassigned it yet: a strategy is never placed on a desk by default, because\nthe desk decides which autonomy matrix governs its orders and which desk's\nmetrics its fills count toward.\n desk?: DeskType;\n};\n\nenum StrategyOrigin {\n SYSTEM\n\n USER\n\n AI_GENERATED\n}\n\nenum StrategyLifecycleState {\n DRAFT\n\n PENDING_APPROVAL\n\n SHADOW\n\n ACTIVE\n\n PAUSED\n\n RETIRED\n}\n\nenum StrategyKind {\n thematic\n\n signal\n}\n\nenum DeskType {\n EVENT\n\n THEMATIC\n\n SYSTEMATIC\n}\n\n";
|
|
87
87
|
readonly strategySubscription: "\n// Your response should adhere to the following type definition for the \"StrategySubscription\" type.\n// Importantly, DO NOT include any annotations in your response (i.e., remove the ones we have provided for your reference below).\n\nexport type StrategySubscription = {\n // Lifecycle status of the opt-in.\n status: StrategySubscriptionStatus;\n // Units (sleeve shares) currently held under this subscription. A fresh\nsubscription genuinely holds zero, so `0` here is a true measurement and\nnot a stand-in for \"unknown\".\n units: number;\n // Cumulative net capital contributed to this sleeve, net of withdrawals.\n costBasis: number;\n // Cumulative realized P/L booked out of this sleeve.\n realizedPL: number;\n // Target share of account equity allocated to this strategy, as a 0..1\nfraction. NULL means NO ALLOCATION HAS BEEN DECIDED — deliberately\nnullable with NO default so that \"unallocated\" can never be read as a\n0% target. Consumers must render absence as absence; the platform\nStrategies grid renders it as an em-dash.\n targetAllocationPct?: number;\n // Base currency of the capital columns (ISO 4217).\n currency: string;\n // When the account first opted in.\n subscribedAt?: Date;\n // When a rebalance toward `targetAllocationPct` was last recorded against\nthis sleeve. NULL means none has been.\n lastRebalancedAt?: Date;\n};\n\nenum StrategySubscriptionStatus {\n ACTIVE\n\n PAUSED\n\n CLOSED\n}\n\n";
|
|
88
88
|
readonly featureFlagOverride: "\n// Your response should adhere to the following type definition for the \"FeatureFlagOverride\" type.\n// Importantly, DO NOT include any annotations in your response (i.e., remove the ones we have provided for your reference below).\n\nexport type FeatureFlagOverride = {\n // Flag key, e.g. 'desk_ia'.\n flag: string;\n // Whether the flag is on for this user or organization.\n enabled: boolean;\n // Principal that last set the override (user id or service name).\n updatedBy: string;\n};\n\n";
|
|
89
89
|
readonly follow: "\n// Your response should adhere to the following type definition for the \"Follow\" type.\n// Importantly, DO NOT include any annotations in your response (i.e., remove the ones we have provided for your reference below).\n\nexport type Follow = {\n // Relation to the Fund.\n fund: {\n // Fund display name.\n name: string;\n // URL-safe slug, unique within the owning organization.\n slug: string;\n };\n // What the follow points at.\n targetKind: FollowTargetKind;\n // Follow level 0..2 (0 watch, 1 propose, 2 act within the risk budget). Enforced by a CHECK constraint.\n level: number;\n // Risk budget as a percentage of fund NAV. Null means no budget is set, never zero.\n riskBudgetPctNav?: number;\n};\n\nenum FollowTargetKind {\n asset\n\n event\n}\n\n";
|