@adaptic/backend 0.0.1057 → 0.0.1058

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/auth/authorization-map.cjs +306 -0
  2. package/auth/authorization-map.d.ts +143 -0
  3. package/auth/cortex-auth-checker.cjs +172 -0
  4. package/auth/cortex-auth-checker.d.ts +114 -0
  5. package/auth/credential-fields.cjs +51 -0
  6. package/auth/credential-fields.d.ts +19 -0
  7. package/auth/credential-redaction.cjs +134 -0
  8. package/auth/credential-redaction.d.ts +60 -0
  9. package/auth/graphql-auth-shadow.cjs +317 -0
  10. package/auth/graphql-auth-shadow.d.ts +194 -0
  11. package/auth/membership-write-authority.cjs +131 -0
  12. package/auth/membership-write-authority.d.ts +110 -0
  13. package/auth/mutation-authorization.cjs +376 -0
  14. package/auth/mutation-authorization.d.ts +261 -0
  15. package/auth/nested-write-inspector.cjs +189 -0
  16. package/auth/nested-write-inspector.d.ts +94 -0
  17. package/auth/nested-write-policy.cjs +189 -0
  18. package/auth/nested-write-policy.d.ts +99 -0
  19. package/auth/service-token.cjs +316 -0
  20. package/auth/service-token.d.ts +94 -0
  21. package/auth/tenancy-scope.cjs +736 -0
  22. package/auth/tenancy-scope.d.ts +347 -0
  23. package/auth/token-verifier.cjs +451 -0
  24. package/auth/token-verifier.d.ts +153 -0
  25. package/auth/totp.cjs +265 -0
  26. package/auth/totp.d.ts +111 -0
  27. package/auth/user-write-content.cjs +116 -0
  28. package/auth/user-write-content.d.ts +47 -0
  29. package/auth/ws-auth-context.cjs +75 -0
  30. package/auth/ws-auth-context.d.ts +69 -0
  31. package/config/jwtConfig.cjs +52 -0
  32. package/config/jwtConfig.d.ts +16 -0
  33. package/config/metrics.cjs +356 -0
  34. package/config/metrics.d.ts +128 -0
  35. package/config/persisted-queries.cjs +122 -0
  36. package/config/persisted-queries.d.ts +40 -0
  37. package/config/server-only-models.cjs +166 -0
  38. package/config/server-only-models.d.ts +89 -0
  39. package/config/tracing.d.ts +24 -0
  40. package/generated/typegraphql-prisma/enhance.cjs +3 -3
  41. package/generated/typegraphql-prisma/index.cjs +6 -6
  42. package/generated/typegraphql-prisma/resolvers/crud/args.index.cjs +95 -95
  43. package/generated/typegraphql-prisma/resolvers/outputs/index.cjs +1 -1
  44. package/generated/typegraphql-prisma/resolvers/relations/args.index.cjs +32 -32
  45. package/middleware/audit-log-write-redaction.cjs +143 -0
  46. package/middleware/audit-log-write-redaction.d.ts +82 -0
  47. package/middleware/audit-logger.cjs +378 -0
  48. package/middleware/audit-logger.d.ts +158 -0
  49. package/middleware/audit-payload-guard.cjs +107 -0
  50. package/middleware/audit-payload-guard.d.ts +85 -0
  51. package/middleware/auth.cjs +66 -0
  52. package/middleware/auth.d.ts +41 -0
  53. package/middleware/credential-field-guard.cjs +514 -0
  54. package/middleware/credential-field-guard.d.ts +173 -0
  55. package/middleware/generated-type-names.cjs +77 -0
  56. package/middleware/generated-type-names.d.ts +44 -0
  57. package/middleware/graphql-validation-plugin.cjs +310 -0
  58. package/middleware/graphql-validation-plugin.d.ts +98 -0
  59. package/middleware/guard-log-throttle.cjs +89 -0
  60. package/middleware/guard-log-throttle.d.ts +80 -0
  61. package/middleware/index.cjs +57 -0
  62. package/middleware/index.d.ts +14 -0
  63. package/middleware/input-validator.cjs +220 -0
  64. package/middleware/input-validator.d.ts +63 -0
  65. package/middleware/mandate-version-validation.cjs +131 -0
  66. package/middleware/mandate-version-validation.d.ts +41 -0
  67. package/middleware/mutation-account-facts.cjs +223 -0
  68. package/middleware/mutation-account-facts.d.ts +143 -0
  69. package/middleware/mutation-auth-guard.cjs +536 -0
  70. package/middleware/mutation-auth-guard.d.ts +100 -0
  71. package/middleware/mutation-membership-facts.cjs +276 -0
  72. package/middleware/mutation-membership-facts.d.ts +133 -0
  73. package/middleware/mutation-tenant-facts.cjs +132 -0
  74. package/middleware/mutation-tenant-facts.d.ts +81 -0
  75. package/middleware/query-complexity.cjs +182 -0
  76. package/middleware/query-complexity.d.ts +56 -0
  77. package/middleware/rate-limiter.cjs +223 -0
  78. package/middleware/rate-limiter.d.ts +93 -0
  79. package/middleware/rate-tier.cjs +111 -0
  80. package/middleware/rate-tier.d.ts +56 -0
  81. package/middleware/soft-delete.cjs +175 -0
  82. package/middleware/soft-delete.d.ts +146 -0
  83. package/middleware/tenancy-scoping.cjs +229 -0
  84. package/middleware/tenancy-scoping.d.ts +67 -0
  85. package/middleware/trading-policy-audit.cjs +353 -0
  86. package/middleware/trading-policy-audit.d.ts +184 -0
  87. package/middleware/types.cjs +17 -0
  88. package/middleware/types.d.ts +87 -0
  89. package/middleware/validation-examples.cjs +398 -0
  90. package/middleware/validation-examples.d.ts +76 -0
  91. package/package.json +10 -2
  92. package/readers/index.cjs +15 -0
  93. package/readers/index.d.ts +10 -0
  94. package/readers/intraday-lane-prefs.cjs +76 -0
  95. package/readers/intraday-lane-prefs.d.ts +45 -0
  96. package/esm/config/__tests__/server-only-surface.harness.d.ts +0 -12
  97. package/esm/config/__tests__/server-only-surface.harness.mjs +0 -41
  98. package/esm/middleware/__tests__/audit-log-write-redaction.harness.d.ts +0 -144
  99. package/esm/middleware/__tests__/audit-log-write-redaction.harness.mjs +0 -920
  100. package/esm/middleware/__tests__/credential-field-coverage.harness.d.ts +0 -55
  101. package/esm/middleware/__tests__/credential-field-coverage.harness.mjs +0 -440
  102. package/esm/middleware/__tests__/credential-field-guard.harness.d.ts +0 -34
  103. package/esm/middleware/__tests__/credential-field-guard.harness.mjs +0 -212
  104. package/esm/middleware/__tests__/mutation-auth-guard.harness.d.ts +0 -56
  105. package/esm/middleware/__tests__/mutation-auth-guard.harness.mjs +0 -575
  106. package/esm/middleware/__tests__/rate-limit-test-utils.d.ts +0 -60
  107. package/esm/middleware/__tests__/rate-limit-test-utils.mjs +0 -85
  108. package/esm/middleware/__tests__/ts-node-harness.d.ts +0 -10
  109. package/esm/middleware/__tests__/ts-node-harness.mjs +0 -71
  110. package/health.cjs +0 -274
  111. package/server.cjs +0 -607
@@ -14,99 +14,99 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./ABTest/args.cjs"), exports);
18
- __exportStar(require("./Account/args.cjs"), exports);
19
- __exportStar(require("./AccountDecisionRecord/args.cjs"), exports);
20
- __exportStar(require("./AccountLinkingRequest/args.cjs"), exports);
21
- __exportStar(require("./AccountRiskMetrics/args.cjs"), exports);
22
- __exportStar(require("./Action/args.cjs"), exports);
23
- __exportStar(require("./AdaConversation/args.cjs"), exports);
24
- __exportStar(require("./AdaMessage/args.cjs"), exports);
25
- __exportStar(require("./Alert/args.cjs"), exports);
26
- __exportStar(require("./Allocation/args.cjs"), exports);
27
- __exportStar(require("./AlpacaAccount/args.cjs"), exports);
28
- __exportStar(require("./AnalyticsConfiguration/args.cjs"), exports);
29
- __exportStar(require("./AnalyticsSnapshot/args.cjs"), exports);
30
- __exportStar(require("./Asset/args.cjs"), exports);
31
- __exportStar(require("./AuditLog/args.cjs"), exports);
32
- __exportStar(require("./Authenticator/args.cjs"), exports);
33
- __exportStar(require("./AutoFollowRule/args.cjs"), exports);
34
- __exportStar(require("./BrokerageAccount/args.cjs"), exports);
35
- __exportStar(require("./Configuration/args.cjs"), exports);
36
- __exportStar(require("./ConflictEvent/args.cjs"), exports);
37
- __exportStar(require("./ConnectionHealthSnapshot/args.cjs"), exports);
38
- __exportStar(require("./Customer/args.cjs"), exports);
39
- __exportStar(require("./DeadLetterMessage/args.cjs"), exports);
40
- __exportStar(require("./DecisionMemorySummary/args.cjs"), exports);
41
- __exportStar(require("./DeskDecision/args.cjs"), exports);
42
- __exportStar(require("./EconomicEvent/args.cjs"), exports);
43
- __exportStar(require("./EquityBar/args.cjs"), exports);
44
- __exportStar(require("./Event/args.cjs"), exports);
45
- __exportStar(require("./EventSnapshot/args.cjs"), exports);
46
- __exportStar(require("./FeatureFlagOverride/args.cjs"), exports);
47
- __exportStar(require("./FeatureImportanceAnalysis/args.cjs"), exports);
48
- __exportStar(require("./Follow/args.cjs"), exports);
49
- __exportStar(require("./Fund/args.cjs"), exports);
50
- __exportStar(require("./FundAssignment/args.cjs"), exports);
51
- __exportStar(require("./Holding/args.cjs"), exports);
52
- __exportStar(require("./InstitutionalFlowSignal/args.cjs"), exports);
53
- __exportStar(require("./InstitutionalHolding/args.cjs"), exports);
54
- __exportStar(require("./InstitutionalSentimentAlerts/args.cjs"), exports);
55
- __exportStar(require("./InstitutionalSentimentErrors/args.cjs"), exports);
56
- __exportStar(require("./InstitutionalSentimentHistory/args.cjs"), exports);
57
- __exportStar(require("./InstitutionalSentimentMetrics/args.cjs"), exports);
58
- __exportStar(require("./Investor/args.cjs"), exports);
59
- __exportStar(require("./InvestorDocument/args.cjs"), exports);
60
- __exportStar(require("./InvestorTransaction/args.cjs"), exports);
61
- __exportStar(require("./InviteToken/args.cjs"), exports);
62
- __exportStar(require("./LinkedProvider/args.cjs"), exports);
63
- __exportStar(require("./LlmConfiguration/args.cjs"), exports);
64
- __exportStar(require("./MLModelVersion/args.cjs"), exports);
65
- __exportStar(require("./MLTrainingData/args.cjs"), exports);
66
- __exportStar(require("./Mandate/args.cjs"), exports);
67
- __exportStar(require("./MandateApproval/args.cjs"), exports);
68
- __exportStar(require("./MandateRule/args.cjs"), exports);
69
- __exportStar(require("./MandateVersion/args.cjs"), exports);
70
- __exportStar(require("./MarketSentiment/args.cjs"), exports);
71
- __exportStar(require("./ModelArtifact/args.cjs"), exports);
72
- __exportStar(require("./ModelVersion/args.cjs"), exports);
73
- __exportStar(require("./ModelVersionArtifact/args.cjs"), exports);
74
- __exportStar(require("./NewsArticle/args.cjs"), exports);
75
- __exportStar(require("./NewsArticleAssetSentiment/args.cjs"), exports);
76
- __exportStar(require("./NotificationDelivery/args.cjs"), exports);
77
- __exportStar(require("./NotificationEvent/args.cjs"), exports);
78
- __exportStar(require("./NotificationPreference/args.cjs"), exports);
79
- __exportStar(require("./OptionsContract/args.cjs"), exports);
80
- __exportStar(require("./OptionsGreeksHistory/args.cjs"), exports);
81
- __exportStar(require("./OptionsPosition/args.cjs"), exports);
82
- __exportStar(require("./OptionsPositionEvent/args.cjs"), exports);
83
- __exportStar(require("./OptionsTradeExecution/args.cjs"), exports);
84
- __exportStar(require("./OrgMembership/args.cjs"), exports);
85
- __exportStar(require("./Organization/args.cjs"), exports);
86
- __exportStar(require("./PolicyOverlay/args.cjs"), exports);
87
- __exportStar(require("./PortfolioGreeksHistory/args.cjs"), exports);
88
- __exportStar(require("./PushSubscription/args.cjs"), exports);
89
- __exportStar(require("./RiskEscalationEvent/args.cjs"), exports);
90
- __exportStar(require("./ScheduledOptionOrder/args.cjs"), exports);
91
- __exportStar(require("./Session/args.cjs"), exports);
92
- __exportStar(require("./SignalGeneratorMetrics/args.cjs"), exports);
93
- __exportStar(require("./SignalLineage/args.cjs"), exports);
94
- __exportStar(require("./SignalOutcome/args.cjs"), exports);
95
- __exportStar(require("./SignalPriorityQueue/args.cjs"), exports);
96
- __exportStar(require("./Strategy/args.cjs"), exports);
97
- __exportStar(require("./StrategyHealthSnapshot/args.cjs"), exports);
98
- __exportStar(require("./StrategySubscription/args.cjs"), exports);
99
- __exportStar(require("./SyncEvent/args.cjs"), exports);
100
- __exportStar(require("./SystemAlert/args.cjs"), exports);
101
- __exportStar(require("./TaxDocument/args.cjs"), exports);
102
- __exportStar(require("./Trade/args.cjs"), exports);
103
- __exportStar(require("./TradeAuditEvent/args.cjs"), exports);
104
- __exportStar(require("./TradeExecutionHistory/args.cjs"), exports);
105
- __exportStar(require("./TradeOutcome/args.cjs"), exports);
106
- __exportStar(require("./TradeRestatement/args.cjs"), exports);
107
- __exportStar(require("./TradingPolicy/args.cjs"), exports);
108
- __exportStar(require("./User/args.cjs"), exports);
109
- __exportStar(require("./UserTotp/args.cjs"), exports);
110
- __exportStar(require("./VerificationToken/args.cjs"), exports);
111
- __exportStar(require("./WaitlistEntry/args.cjs"), exports);
17
+ __exportStar(require("./ABTest/args/index.cjs"), exports);
18
+ __exportStar(require("./Account/args/index.cjs"), exports);
19
+ __exportStar(require("./AccountDecisionRecord/args/index.cjs"), exports);
20
+ __exportStar(require("./AccountLinkingRequest/args/index.cjs"), exports);
21
+ __exportStar(require("./AccountRiskMetrics/args/index.cjs"), exports);
22
+ __exportStar(require("./Action/args/index.cjs"), exports);
23
+ __exportStar(require("./AdaConversation/args/index.cjs"), exports);
24
+ __exportStar(require("./AdaMessage/args/index.cjs"), exports);
25
+ __exportStar(require("./Alert/args/index.cjs"), exports);
26
+ __exportStar(require("./Allocation/args/index.cjs"), exports);
27
+ __exportStar(require("./AlpacaAccount/args/index.cjs"), exports);
28
+ __exportStar(require("./AnalyticsConfiguration/args/index.cjs"), exports);
29
+ __exportStar(require("./AnalyticsSnapshot/args/index.cjs"), exports);
30
+ __exportStar(require("./Asset/args/index.cjs"), exports);
31
+ __exportStar(require("./AuditLog/args/index.cjs"), exports);
32
+ __exportStar(require("./Authenticator/args/index.cjs"), exports);
33
+ __exportStar(require("./AutoFollowRule/args/index.cjs"), exports);
34
+ __exportStar(require("./BrokerageAccount/args/index.cjs"), exports);
35
+ __exportStar(require("./Configuration/args/index.cjs"), exports);
36
+ __exportStar(require("./ConflictEvent/args/index.cjs"), exports);
37
+ __exportStar(require("./ConnectionHealthSnapshot/args/index.cjs"), exports);
38
+ __exportStar(require("./Customer/args/index.cjs"), exports);
39
+ __exportStar(require("./DeadLetterMessage/args/index.cjs"), exports);
40
+ __exportStar(require("./DecisionMemorySummary/args/index.cjs"), exports);
41
+ __exportStar(require("./DeskDecision/args/index.cjs"), exports);
42
+ __exportStar(require("./EconomicEvent/args/index.cjs"), exports);
43
+ __exportStar(require("./EquityBar/args/index.cjs"), exports);
44
+ __exportStar(require("./Event/args/index.cjs"), exports);
45
+ __exportStar(require("./EventSnapshot/args/index.cjs"), exports);
46
+ __exportStar(require("./FeatureFlagOverride/args/index.cjs"), exports);
47
+ __exportStar(require("./FeatureImportanceAnalysis/args/index.cjs"), exports);
48
+ __exportStar(require("./Follow/args/index.cjs"), exports);
49
+ __exportStar(require("./Fund/args/index.cjs"), exports);
50
+ __exportStar(require("./FundAssignment/args/index.cjs"), exports);
51
+ __exportStar(require("./Holding/args/index.cjs"), exports);
52
+ __exportStar(require("./InstitutionalFlowSignal/args/index.cjs"), exports);
53
+ __exportStar(require("./InstitutionalHolding/args/index.cjs"), exports);
54
+ __exportStar(require("./InstitutionalSentimentAlerts/args/index.cjs"), exports);
55
+ __exportStar(require("./InstitutionalSentimentErrors/args/index.cjs"), exports);
56
+ __exportStar(require("./InstitutionalSentimentHistory/args/index.cjs"), exports);
57
+ __exportStar(require("./InstitutionalSentimentMetrics/args/index.cjs"), exports);
58
+ __exportStar(require("./Investor/args/index.cjs"), exports);
59
+ __exportStar(require("./InvestorDocument/args/index.cjs"), exports);
60
+ __exportStar(require("./InvestorTransaction/args/index.cjs"), exports);
61
+ __exportStar(require("./InviteToken/args/index.cjs"), exports);
62
+ __exportStar(require("./LinkedProvider/args/index.cjs"), exports);
63
+ __exportStar(require("./LlmConfiguration/args/index.cjs"), exports);
64
+ __exportStar(require("./MLModelVersion/args/index.cjs"), exports);
65
+ __exportStar(require("./MLTrainingData/args/index.cjs"), exports);
66
+ __exportStar(require("./Mandate/args/index.cjs"), exports);
67
+ __exportStar(require("./MandateApproval/args/index.cjs"), exports);
68
+ __exportStar(require("./MandateRule/args/index.cjs"), exports);
69
+ __exportStar(require("./MandateVersion/args/index.cjs"), exports);
70
+ __exportStar(require("./MarketSentiment/args/index.cjs"), exports);
71
+ __exportStar(require("./ModelArtifact/args/index.cjs"), exports);
72
+ __exportStar(require("./ModelVersion/args/index.cjs"), exports);
73
+ __exportStar(require("./ModelVersionArtifact/args/index.cjs"), exports);
74
+ __exportStar(require("./NewsArticle/args/index.cjs"), exports);
75
+ __exportStar(require("./NewsArticleAssetSentiment/args/index.cjs"), exports);
76
+ __exportStar(require("./NotificationDelivery/args/index.cjs"), exports);
77
+ __exportStar(require("./NotificationEvent/args/index.cjs"), exports);
78
+ __exportStar(require("./NotificationPreference/args/index.cjs"), exports);
79
+ __exportStar(require("./OptionsContract/args/index.cjs"), exports);
80
+ __exportStar(require("./OptionsGreeksHistory/args/index.cjs"), exports);
81
+ __exportStar(require("./OptionsPosition/args/index.cjs"), exports);
82
+ __exportStar(require("./OptionsPositionEvent/args/index.cjs"), exports);
83
+ __exportStar(require("./OptionsTradeExecution/args/index.cjs"), exports);
84
+ __exportStar(require("./OrgMembership/args/index.cjs"), exports);
85
+ __exportStar(require("./Organization/args/index.cjs"), exports);
86
+ __exportStar(require("./PolicyOverlay/args/index.cjs"), exports);
87
+ __exportStar(require("./PortfolioGreeksHistory/args/index.cjs"), exports);
88
+ __exportStar(require("./PushSubscription/args/index.cjs"), exports);
89
+ __exportStar(require("./RiskEscalationEvent/args/index.cjs"), exports);
90
+ __exportStar(require("./ScheduledOptionOrder/args/index.cjs"), exports);
91
+ __exportStar(require("./Session/args/index.cjs"), exports);
92
+ __exportStar(require("./SignalGeneratorMetrics/args/index.cjs"), exports);
93
+ __exportStar(require("./SignalLineage/args/index.cjs"), exports);
94
+ __exportStar(require("./SignalOutcome/args/index.cjs"), exports);
95
+ __exportStar(require("./SignalPriorityQueue/args/index.cjs"), exports);
96
+ __exportStar(require("./Strategy/args/index.cjs"), exports);
97
+ __exportStar(require("./StrategyHealthSnapshot/args/index.cjs"), exports);
98
+ __exportStar(require("./StrategySubscription/args/index.cjs"), exports);
99
+ __exportStar(require("./SyncEvent/args/index.cjs"), exports);
100
+ __exportStar(require("./SystemAlert/args/index.cjs"), exports);
101
+ __exportStar(require("./TaxDocument/args/index.cjs"), exports);
102
+ __exportStar(require("./Trade/args/index.cjs"), exports);
103
+ __exportStar(require("./TradeAuditEvent/args/index.cjs"), exports);
104
+ __exportStar(require("./TradeExecutionHistory/args/index.cjs"), exports);
105
+ __exportStar(require("./TradeOutcome/args/index.cjs"), exports);
106
+ __exportStar(require("./TradeRestatement/args/index.cjs"), exports);
107
+ __exportStar(require("./TradingPolicy/args/index.cjs"), exports);
108
+ __exportStar(require("./User/args/index.cjs"), exports);
109
+ __exportStar(require("./UserTotp/args/index.cjs"), exports);
110
+ __exportStar(require("./VerificationToken/args/index.cjs"), exports);
111
+ __exportStar(require("./WaitlistEntry/args/index.cjs"), exports);
112
112
  //# sourceMappingURL=args.index.js.map
@@ -1465,5 +1465,5 @@ var WaitlistEntryMinAggregate_1 = require("./WaitlistEntryMinAggregate.cjs");
1465
1465
  Object.defineProperty(exports, "WaitlistEntryMinAggregate", { enumerable: true, get: function () { return WaitlistEntryMinAggregate_1.WaitlistEntryMinAggregate; } });
1466
1466
  var WaitlistEntrySumAggregate_1 = require("./WaitlistEntrySumAggregate.cjs");
1467
1467
  Object.defineProperty(exports, "WaitlistEntrySumAggregate", { enumerable: true, get: function () { return WaitlistEntrySumAggregate_1.WaitlistEntrySumAggregate; } });
1468
- __exportStar(require("./args.cjs"), exports);
1468
+ __exportStar(require("./args/index.cjs"), exports);
1469
1469
  //# sourceMappingURL=index.js.map
@@ -14,36 +14,36 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./AdaConversation/args.cjs"), exports);
18
- __exportStar(require("./AlpacaAccount/args.cjs"), exports);
19
- __exportStar(require("./Asset/args.cjs"), exports);
20
- __exportStar(require("./BrokerageAccount/args.cjs"), exports);
21
- __exportStar(require("./Customer/args.cjs"), exports);
22
- __exportStar(require("./DeskDecision/args.cjs"), exports);
23
- __exportStar(require("./FeatureFlagOverride/args.cjs"), exports);
24
- __exportStar(require("./Fund/args.cjs"), exports);
25
- __exportStar(require("./Holding/args.cjs"), exports);
26
- __exportStar(require("./Investor/args.cjs"), exports);
27
- __exportStar(require("./InvestorDocument/args.cjs"), exports);
28
- __exportStar(require("./InvestorTransaction/args.cjs"), exports);
29
- __exportStar(require("./InviteToken/args.cjs"), exports);
30
- __exportStar(require("./Mandate/args.cjs"), exports);
31
- __exportStar(require("./MandateApproval/args.cjs"), exports);
32
- __exportStar(require("./MandateVersion/args.cjs"), exports);
33
- __exportStar(require("./ModelArtifact/args.cjs"), exports);
34
- __exportStar(require("./ModelVersion/args.cjs"), exports);
35
- __exportStar(require("./NewsArticle/args.cjs"), exports);
36
- __exportStar(require("./NewsArticleAssetSentiment/args.cjs"), exports);
37
- __exportStar(require("./NotificationEvent/args.cjs"), exports);
38
- __exportStar(require("./OptionsContract/args.cjs"), exports);
39
- __exportStar(require("./OptionsPosition/args.cjs"), exports);
40
- __exportStar(require("./Organization/args.cjs"), exports);
41
- __exportStar(require("./PolicyOverlay/args.cjs"), exports);
42
- __exportStar(require("./RiskEscalationEvent/args.cjs"), exports);
43
- __exportStar(require("./Strategy/args.cjs"), exports);
44
- __exportStar(require("./TaxDocument/args.cjs"), exports);
45
- __exportStar(require("./Trade/args.cjs"), exports);
46
- __exportStar(require("./TradingPolicy/args.cjs"), exports);
47
- __exportStar(require("./User/args.cjs"), exports);
48
- __exportStar(require("./WaitlistEntry/args.cjs"), exports);
17
+ __exportStar(require("./AdaConversation/args/index.cjs"), exports);
18
+ __exportStar(require("./AlpacaAccount/args/index.cjs"), exports);
19
+ __exportStar(require("./Asset/args/index.cjs"), exports);
20
+ __exportStar(require("./BrokerageAccount/args/index.cjs"), exports);
21
+ __exportStar(require("./Customer/args/index.cjs"), exports);
22
+ __exportStar(require("./DeskDecision/args/index.cjs"), exports);
23
+ __exportStar(require("./FeatureFlagOverride/args/index.cjs"), exports);
24
+ __exportStar(require("./Fund/args/index.cjs"), exports);
25
+ __exportStar(require("./Holding/args/index.cjs"), exports);
26
+ __exportStar(require("./Investor/args/index.cjs"), exports);
27
+ __exportStar(require("./InvestorDocument/args/index.cjs"), exports);
28
+ __exportStar(require("./InvestorTransaction/args/index.cjs"), exports);
29
+ __exportStar(require("./InviteToken/args/index.cjs"), exports);
30
+ __exportStar(require("./Mandate/args/index.cjs"), exports);
31
+ __exportStar(require("./MandateApproval/args/index.cjs"), exports);
32
+ __exportStar(require("./MandateVersion/args/index.cjs"), exports);
33
+ __exportStar(require("./ModelArtifact/args/index.cjs"), exports);
34
+ __exportStar(require("./ModelVersion/args/index.cjs"), exports);
35
+ __exportStar(require("./NewsArticle/args/index.cjs"), exports);
36
+ __exportStar(require("./NewsArticleAssetSentiment/args/index.cjs"), exports);
37
+ __exportStar(require("./NotificationEvent/args/index.cjs"), exports);
38
+ __exportStar(require("./OptionsContract/args/index.cjs"), exports);
39
+ __exportStar(require("./OptionsPosition/args/index.cjs"), exports);
40
+ __exportStar(require("./Organization/args/index.cjs"), exports);
41
+ __exportStar(require("./PolicyOverlay/args/index.cjs"), exports);
42
+ __exportStar(require("./RiskEscalationEvent/args/index.cjs"), exports);
43
+ __exportStar(require("./Strategy/args/index.cjs"), exports);
44
+ __exportStar(require("./TaxDocument/args/index.cjs"), exports);
45
+ __exportStar(require("./Trade/args/index.cjs"), exports);
46
+ __exportStar(require("./TradingPolicy/args/index.cjs"), exports);
47
+ __exportStar(require("./User/args/index.cjs"), exports);
48
+ __exportStar(require("./WaitlistEntry/args/index.cjs"), exports);
49
49
  //# sourceMappingURL=args.index.js.map
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ /**
3
+ * Stored-credential values never reach an `AuditLog` row written through the
4
+ * server's Prisma client, whoever writes it.
5
+ *
6
+ * ## Why this exists
7
+ *
8
+ * An audit row is readable far more widely than the credential column it
9
+ * copies, so a key stored in one is a second, unguarded copy of the secret.
10
+ * The GraphQL audit plugin (`./audit-logger`) and the TradingPolicy audit
11
+ * trail (`./trading-policy-audit`) each redact the payload they build, but a
12
+ * row can be written without either of them: the generated
13
+ * `createOneAuditLog`, `createManyAuditLog`, `createManyAndReturnAuditLog`,
14
+ * `updateOneAuditLog`, `updateManyAuditLog` and `upsertOneAuditLog` mutations
15
+ * hand their arguments to Prisma as the caller sent them, and so would any
16
+ * other server-side `auditLog` write. Redaction that depends on each writer
17
+ * remembering to call it holds only for the writers that remember.
18
+ *
19
+ * This extension applies the redaction where every one of those paths
20
+ * converges — the Prisma client the server hands to resolvers, plugins and
21
+ * guards — so it holds regardless of caller. In every row an `AuditLog`
22
+ * operation writes (under `data`, `create` or `update`, one row or many),
23
+ * each column value that holds a credential-named key is replaced by its
24
+ * {@link redactCredentials} copy before the query engine sees it: the same
25
+ * function and key set the audit payload guard applies on read, so a stored
26
+ * row is already what an unprivileged reader is served. The operation is
27
+ * recognised by the arguments it carries rather than by its name, so a write
28
+ * operation Prisma adds later is covered without an edit here.
29
+ *
30
+ * ## Why redaction by key name is enough here
31
+ *
32
+ * The rule recognises a credential by the name of the key that holds it, so
33
+ * it holds when every recorded value sits under its column's own name. The
34
+ * audit plugin, the one writer that records what callers send, resolves each
35
+ * mutation's arguments from the executed field, so a credential passed as
36
+ * `APIKey: $key` is recorded at `input.APIKey` rather than under the
37
+ * operation's variable name; and the vocabulary is held to every
38
+ * credential-shaped column in the Prisma schema by its own test. A caller
39
+ * that writes an audit row directly and stores a credential under a name that
40
+ * is no credential column's is not recognised: no rule keyed on names can see
41
+ * it, and one keyed on value shapes would rewrite credential-free rows.
42
+ *
43
+ * ## What it leaves alone, and what it replaces without a credential
44
+ *
45
+ * A column value in which redaction would replace nothing
46
+ * ({@link credentialKeyPaths} is empty) is passed on exactly as received, so
47
+ * a row without a credential is written as the unextended client would write
48
+ * it — including Prisma's `DbNull` / `JsonNull` sentinels and `Date` values,
49
+ * which a redaction pass would otherwise turn into `{}` and an ISO string. A
50
+ * credential key that holds nothing (absent, `null`, or an update's
51
+ * `{ set: null }`) replaces nothing, so a clear stays visible as a clear.
52
+ * Reads, deletes and filters carry no row payload and pass through untouched.
53
+ *
54
+ * The redaction walks a value only to a fixed depth (`MAX_DEPTH` in
55
+ * `auth/credential-redaction`): whatever sits 12 or more levels inside a
56
+ * column value cannot be inspected, so it is replaced with the placeholder
57
+ * whether or not it holds a credential, and that column is not passed on
58
+ * unchanged. Treating a value it cannot inspect as a credential is the
59
+ * fail-closed choice, and it is the same limit the audit plugin, the
60
+ * TradingPolicy trail and the read guard apply.
61
+ *
62
+ * @module middleware/audit-log-write-redaction
63
+ */
64
+ Object.defineProperty(exports, "__esModule", { value: true });
65
+ exports.ROW_PAYLOAD_ARGS = void 0;
66
+ exports.redactAuditLogWriteArgs = redactAuditLogWriteArgs;
67
+ exports.withAuditLogWriteRedaction = withAuditLogWriteRedaction;
68
+ const credential_redaction_1 = require("../auth/credential-redaction.cjs");
69
+ /** Argument keys through which a Prisma operation writes row content. */
70
+ exports.ROW_PAYLOAD_ARGS = ['data', 'create', 'update'];
71
+ function isRecord(value) {
72
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
73
+ }
74
+ /** One row with each credential-bearing column value redacted; the same row when none is. */
75
+ function redactRow(row) {
76
+ if (!isRecord(row))
77
+ return row;
78
+ let out;
79
+ for (const [column, value] of Object.entries(row)) {
80
+ if ((0, credential_redaction_1.credentialKeyPaths)(value).length === 0)
81
+ continue;
82
+ out !== null && out !== void 0 ? out : (out = { ...row });
83
+ out[column] = (0, credential_redaction_1.redactCredentials)(value);
84
+ }
85
+ return out !== null && out !== void 0 ? out : row;
86
+ }
87
+ /** A row payload (one row or many) redacted; the same payload when nothing needed it. */
88
+ function redactPayload(payload) {
89
+ if (!Array.isArray(payload))
90
+ return redactRow(payload);
91
+ const rows = payload.map(redactRow);
92
+ return rows.some((row, index) => row !== payload[index]) ? rows : payload;
93
+ }
94
+ /**
95
+ * The arguments of an `AuditLog` operation with every credential value in the
96
+ * rows it writes redacted. Returns the same object when nothing needed
97
+ * redacting, so an operation without a credential reaches Prisma unchanged.
98
+ *
99
+ * @param args - The operation's arguments as Prisma received them.
100
+ * @returns The arguments to execute.
101
+ */
102
+ function redactAuditLogWriteArgs(args) {
103
+ if (!isRecord(args))
104
+ return args;
105
+ let out;
106
+ for (const key of exports.ROW_PAYLOAD_ARGS) {
107
+ const payload = args[key];
108
+ if (payload === undefined)
109
+ continue;
110
+ const redacted = redactPayload(payload);
111
+ if (redacted === payload)
112
+ continue;
113
+ out !== null && out !== void 0 ? out : (out = { ...args });
114
+ out[key] = redacted;
115
+ }
116
+ // Cast justified: `out` is `args` with row payloads replaced by redacted
117
+ // copies of the same shape, so it satisfies whatever `args` satisfied.
118
+ return (out !== null && out !== void 0 ? out : args);
119
+ }
120
+ /**
121
+ * Apply AuditLog write redaction to a Prisma client.
122
+ *
123
+ * @param client - The client to wrap.
124
+ * @returns The client with every `AuditLog` write redacted.
125
+ */
126
+ function withAuditLogWriteRedaction(client) {
127
+ const extended = client.$extends({
128
+ name: 'audit-log-write-redaction',
129
+ query: {
130
+ auditLog: {
131
+ $allOperations({ args, query }) {
132
+ return query(redactAuditLogWriteArgs(args));
133
+ },
134
+ },
135
+ },
136
+ });
137
+ // Prisma types an extended client as a structurally distinct object even
138
+ // though this extension only rewrites query arguments and adds, removes and
139
+ // renames nothing on the model surface; the assertion states that at this
140
+ // one boundary, as `withFindManyGuard` does.
141
+ return extended;
142
+ }
143
+ //# sourceMappingURL=audit-log-write-redaction.js.map
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Stored-credential values never reach an `AuditLog` row written through the
3
+ * server's Prisma client, whoever writes it.
4
+ *
5
+ * ## Why this exists
6
+ *
7
+ * An audit row is readable far more widely than the credential column it
8
+ * copies, so a key stored in one is a second, unguarded copy of the secret.
9
+ * The GraphQL audit plugin (`./audit-logger`) and the TradingPolicy audit
10
+ * trail (`./trading-policy-audit`) each redact the payload they build, but a
11
+ * row can be written without either of them: the generated
12
+ * `createOneAuditLog`, `createManyAuditLog`, `createManyAndReturnAuditLog`,
13
+ * `updateOneAuditLog`, `updateManyAuditLog` and `upsertOneAuditLog` mutations
14
+ * hand their arguments to Prisma as the caller sent them, and so would any
15
+ * other server-side `auditLog` write. Redaction that depends on each writer
16
+ * remembering to call it holds only for the writers that remember.
17
+ *
18
+ * This extension applies the redaction where every one of those paths
19
+ * converges — the Prisma client the server hands to resolvers, plugins and
20
+ * guards — so it holds regardless of caller. In every row an `AuditLog`
21
+ * operation writes (under `data`, `create` or `update`, one row or many),
22
+ * each column value that holds a credential-named key is replaced by its
23
+ * {@link redactCredentials} copy before the query engine sees it: the same
24
+ * function and key set the audit payload guard applies on read, so a stored
25
+ * row is already what an unprivileged reader is served. The operation is
26
+ * recognised by the arguments it carries rather than by its name, so a write
27
+ * operation Prisma adds later is covered without an edit here.
28
+ *
29
+ * ## Why redaction by key name is enough here
30
+ *
31
+ * The rule recognises a credential by the name of the key that holds it, so
32
+ * it holds when every recorded value sits under its column's own name. The
33
+ * audit plugin, the one writer that records what callers send, resolves each
34
+ * mutation's arguments from the executed field, so a credential passed as
35
+ * `APIKey: $key` is recorded at `input.APIKey` rather than under the
36
+ * operation's variable name; and the vocabulary is held to every
37
+ * credential-shaped column in the Prisma schema by its own test. A caller
38
+ * that writes an audit row directly and stores a credential under a name that
39
+ * is no credential column's is not recognised: no rule keyed on names can see
40
+ * it, and one keyed on value shapes would rewrite credential-free rows.
41
+ *
42
+ * ## What it leaves alone, and what it replaces without a credential
43
+ *
44
+ * A column value in which redaction would replace nothing
45
+ * ({@link credentialKeyPaths} is empty) is passed on exactly as received, so
46
+ * a row without a credential is written as the unextended client would write
47
+ * it — including Prisma's `DbNull` / `JsonNull` sentinels and `Date` values,
48
+ * which a redaction pass would otherwise turn into `{}` and an ISO string. A
49
+ * credential key that holds nothing (absent, `null`, or an update's
50
+ * `{ set: null }`) replaces nothing, so a clear stays visible as a clear.
51
+ * Reads, deletes and filters carry no row payload and pass through untouched.
52
+ *
53
+ * The redaction walks a value only to a fixed depth (`MAX_DEPTH` in
54
+ * `auth/credential-redaction`): whatever sits 12 or more levels inside a
55
+ * column value cannot be inspected, so it is replaced with the placeholder
56
+ * whether or not it holds a credential, and that column is not passed on
57
+ * unchanged. Treating a value it cannot inspect as a credential is the
58
+ * fail-closed choice, and it is the same limit the audit plugin, the
59
+ * TradingPolicy trail and the read guard apply.
60
+ *
61
+ * @module middleware/audit-log-write-redaction
62
+ */
63
+ import type { PrismaClient } from '@prisma/client';
64
+ /** Argument keys through which a Prisma operation writes row content. */
65
+ export declare const ROW_PAYLOAD_ARGS: readonly ["data", "create", "update"];
66
+ /**
67
+ * The arguments of an `AuditLog` operation with every credential value in the
68
+ * rows it writes redacted. Returns the same object when nothing needed
69
+ * redacting, so an operation without a credential reaches Prisma unchanged.
70
+ *
71
+ * @param args - The operation's arguments as Prisma received them.
72
+ * @returns The arguments to execute.
73
+ */
74
+ export declare function redactAuditLogWriteArgs<T>(args: T): T;
75
+ /**
76
+ * Apply AuditLog write redaction to a Prisma client.
77
+ *
78
+ * @param client - The client to wrap.
79
+ * @returns The client with every `AuditLog` write redacted.
80
+ */
81
+ export declare function withAuditLogWriteRedaction(client: PrismaClient): PrismaClient;
82
+ //# sourceMappingURL=audit-log-write-redaction.d.ts.map