adaptic-backend 1.0.71 → 1.0.73

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 (121) hide show
  1. package/generated/typeStrings/Account.cjs +0 -211
  2. package/generated/typeStrings/Account.d.ts +1 -1
  3. package/generated/typeStrings/Account.d.ts.map +1 -1
  4. package/generated/typeStrings/Account.js.map +1 -1
  5. package/generated/typeStrings/Action.cjs +143 -195
  6. package/generated/typeStrings/Action.d.ts +1 -1
  7. package/generated/typeStrings/Action.d.ts.map +1 -1
  8. package/generated/typeStrings/Action.js.map +1 -1
  9. package/generated/typeStrings/Alert.cjs +100 -268
  10. package/generated/typeStrings/Alert.d.ts +1 -1
  11. package/generated/typeStrings/Alert.d.ts.map +1 -1
  12. package/generated/typeStrings/Alert.js.map +1 -1
  13. package/generated/typeStrings/AlpacaAccount.cjs +31 -177
  14. package/generated/typeStrings/AlpacaAccount.d.ts +1 -1
  15. package/generated/typeStrings/AlpacaAccount.d.ts.map +1 -1
  16. package/generated/typeStrings/AlpacaAccount.js.map +1 -1
  17. package/generated/typeStrings/Asset.cjs +31 -199
  18. package/generated/typeStrings/Asset.d.ts +1 -1
  19. package/generated/typeStrings/Asset.d.ts.map +1 -1
  20. package/generated/typeStrings/Asset.js.map +1 -1
  21. package/generated/typeStrings/Authenticator.cjs +0 -211
  22. package/generated/typeStrings/Authenticator.d.ts +1 -1
  23. package/generated/typeStrings/Authenticator.d.ts.map +1 -1
  24. package/generated/typeStrings/Authenticator.js.map +1 -1
  25. package/generated/typeStrings/Customer.cjs +0 -211
  26. package/generated/typeStrings/Customer.d.ts +1 -1
  27. package/generated/typeStrings/Customer.d.ts.map +1 -1
  28. package/generated/typeStrings/Customer.js.map +1 -1
  29. package/generated/typeStrings/NewsArticle.cjs +0 -169
  30. package/generated/typeStrings/NewsArticle.d.ts +1 -1
  31. package/generated/typeStrings/NewsArticle.d.ts.map +1 -1
  32. package/generated/typeStrings/NewsArticle.js.map +1 -1
  33. package/generated/typeStrings/NewsArticleAssetSentiment.cjs +100 -81
  34. package/generated/typeStrings/NewsArticleAssetSentiment.d.ts +1 -1
  35. package/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -1
  36. package/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -1
  37. package/generated/typeStrings/Order.cjs +31 -278
  38. package/generated/typeStrings/Order.d.ts +1 -1
  39. package/generated/typeStrings/Order.d.ts.map +1 -1
  40. package/generated/typeStrings/Order.js.map +1 -1
  41. package/generated/typeStrings/Position.cjs +67 -114
  42. package/generated/typeStrings/Position.d.ts +1 -1
  43. package/generated/typeStrings/Position.d.ts.map +1 -1
  44. package/generated/typeStrings/Position.js.map +1 -1
  45. package/generated/typeStrings/Session.cjs +0 -211
  46. package/generated/typeStrings/Session.d.ts +1 -1
  47. package/generated/typeStrings/Session.d.ts.map +1 -1
  48. package/generated/typeStrings/Session.js.map +1 -1
  49. package/generated/typeStrings/Trade.cjs +31 -278
  50. package/generated/typeStrings/Trade.d.ts +1 -1
  51. package/generated/typeStrings/Trade.d.ts.map +1 -1
  52. package/generated/typeStrings/Trade.js.map +1 -1
  53. package/generated/typeStrings/User.cjs +100 -222
  54. package/generated/typeStrings/User.d.ts +1 -1
  55. package/generated/typeStrings/User.d.ts.map +1 -1
  56. package/generated/typeStrings/User.js.map +1 -1
  57. package/generated/typeStrings/index.d.ts +14 -14
  58. package/index.cjs +3 -13
  59. package/index.d.ts +1 -1
  60. package/package.json +1 -1
  61. package/server/generated/typeStrings/Account.d.ts +1 -1
  62. package/server/generated/typeStrings/Account.d.ts.map +1 -1
  63. package/server/generated/typeStrings/Account.js.map +1 -1
  64. package/server/generated/typeStrings/Account.mjs +0 -211
  65. package/server/generated/typeStrings/Action.d.ts +1 -1
  66. package/server/generated/typeStrings/Action.d.ts.map +1 -1
  67. package/server/generated/typeStrings/Action.js.map +1 -1
  68. package/server/generated/typeStrings/Action.mjs +143 -195
  69. package/server/generated/typeStrings/Alert.d.ts +1 -1
  70. package/server/generated/typeStrings/Alert.d.ts.map +1 -1
  71. package/server/generated/typeStrings/Alert.js.map +1 -1
  72. package/server/generated/typeStrings/Alert.mjs +100 -268
  73. package/server/generated/typeStrings/AlpacaAccount.d.ts +1 -1
  74. package/server/generated/typeStrings/AlpacaAccount.d.ts.map +1 -1
  75. package/server/generated/typeStrings/AlpacaAccount.js.map +1 -1
  76. package/server/generated/typeStrings/AlpacaAccount.mjs +31 -177
  77. package/server/generated/typeStrings/Asset.d.ts +1 -1
  78. package/server/generated/typeStrings/Asset.d.ts.map +1 -1
  79. package/server/generated/typeStrings/Asset.js.map +1 -1
  80. package/server/generated/typeStrings/Asset.mjs +31 -199
  81. package/server/generated/typeStrings/Authenticator.d.ts +1 -1
  82. package/server/generated/typeStrings/Authenticator.d.ts.map +1 -1
  83. package/server/generated/typeStrings/Authenticator.js.map +1 -1
  84. package/server/generated/typeStrings/Authenticator.mjs +0 -211
  85. package/server/generated/typeStrings/Customer.d.ts +1 -1
  86. package/server/generated/typeStrings/Customer.d.ts.map +1 -1
  87. package/server/generated/typeStrings/Customer.js.map +1 -1
  88. package/server/generated/typeStrings/Customer.mjs +0 -211
  89. package/server/generated/typeStrings/NewsArticle.d.ts +1 -1
  90. package/server/generated/typeStrings/NewsArticle.d.ts.map +1 -1
  91. package/server/generated/typeStrings/NewsArticle.js.map +1 -1
  92. package/server/generated/typeStrings/NewsArticle.mjs +0 -169
  93. package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts +1 -1
  94. package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -1
  95. package/server/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -1
  96. package/server/generated/typeStrings/NewsArticleAssetSentiment.mjs +100 -81
  97. package/server/generated/typeStrings/Order.d.ts +1 -1
  98. package/server/generated/typeStrings/Order.d.ts.map +1 -1
  99. package/server/generated/typeStrings/Order.js.map +1 -1
  100. package/server/generated/typeStrings/Order.mjs +31 -278
  101. package/server/generated/typeStrings/Position.d.ts +1 -1
  102. package/server/generated/typeStrings/Position.d.ts.map +1 -1
  103. package/server/generated/typeStrings/Position.js.map +1 -1
  104. package/server/generated/typeStrings/Position.mjs +67 -114
  105. package/server/generated/typeStrings/Session.d.ts +1 -1
  106. package/server/generated/typeStrings/Session.d.ts.map +1 -1
  107. package/server/generated/typeStrings/Session.js.map +1 -1
  108. package/server/generated/typeStrings/Session.mjs +0 -211
  109. package/server/generated/typeStrings/Trade.d.ts +1 -1
  110. package/server/generated/typeStrings/Trade.d.ts.map +1 -1
  111. package/server/generated/typeStrings/Trade.js.map +1 -1
  112. package/server/generated/typeStrings/Trade.mjs +31 -278
  113. package/server/generated/typeStrings/User.d.ts +1 -1
  114. package/server/generated/typeStrings/User.d.ts.map +1 -1
  115. package/server/generated/typeStrings/User.js.map +1 -1
  116. package/server/generated/typeStrings/User.mjs +100 -222
  117. package/server/generated/typeStrings/index.d.ts +14 -14
  118. package/server/index.d.ts +1 -1
  119. package/server/index.d.ts.map +1 -1
  120. package/server/index.js.map +1 -1
  121. package/server/index.mjs +1 -1
@@ -7,14 +7,10 @@ Your response should adhere to the following type definition for the "Account" t
7
7
  Importantly, DO NOT include any annotations in your response (i.e. remove the ones we have provided for your reference below).
8
8
 
9
9
  export type Account = {
10
- // Reference to the user who owns this account.
11
- userId: string;
12
10
  // Type of the account (e.g., OAuth provider).
13
11
  type: string;
14
12
  // Provider of the account (e.g., Google, GitHub).
15
13
  provider: string;
16
- // Unique identifier provided by the external provider.
17
- providerAccountId: string;
18
14
  // Refresh token for the external account, if applicable.
19
15
  refresh_token?: string;
20
16
  // Access token for the external account, if applicable.
@@ -51,227 +47,28 @@ export enum SubscriptionPlan {
51
47
  }
52
48
 
53
49
  export type Customer = {
54
- // Reference to the authenticated user associated with the customer.
55
- authUserId: string;
56
50
  // Name of the customer.
57
51
  name?: string;
58
52
  // Subscription plan the customer is enrolled in.
59
53
  plan?: SubscriptionPlan;
60
- // Unique Stripe customer ID for billing.
61
- stripeCustomerId?: string;
62
- // Unique Stripe subscription ID.
63
- stripeSubscriptionId?: string;
64
- // Stripe price ID associated with the customer's subscription.
65
- stripePriceId?: string;
66
54
  // End date of the current billing period in Stripe.
67
55
  stripeCurrentPeriodEnd?: Date;
68
- // List of users associated with the customer.
69
- users: User[];
70
56
  }
71
57
 
72
58
  export type Session = {
73
59
  // Token associated with the session for authentication.
74
60
  sessionToken: string;
75
- // Reference to the user who owns this session.
76
- userId: string;
77
61
  // Expiration date and time of the session.
78
62
  expires: Date;
79
- // Relation to the User model.
80
- user: User;
81
63
  }
82
64
 
83
65
  export type Authenticator = {
84
- // Reference to the user who owns this authenticator.
85
- userId: string;
86
66
  // Unique credential ID for the authenticator.
87
67
  credentialID: string;
88
68
  // Public key associated with the authenticator.
89
69
  publicKey: string;
90
70
  // Counter for the number of authentication attempts.
91
71
  counter: number;
92
- // Relation to the User model.
93
- user: User;
94
- }
95
-
96
- export enum TradeStatus {
97
- PENDING = "PENDING",
98
- OPEN = "OPEN",
99
- PARTIAL = "PARTIAL",
100
- COMPLETED = "COMPLETED"
101
- }
102
-
103
- export enum OptionContractType {
104
- CALL = "CALL",
105
- PUT = "PUT"
106
- }
107
-
108
- export type Trade = {
109
- // Reference to the Alpaca account used for the trade.
110
- alpacaAccountId: string;
111
- // Reference to the asset being traded.
112
- assetId: string;
113
- // Quantity of the asset being traded.
114
- qty: number;
115
- // Price at which the asset was traded.
116
- price: number;
117
- // Total value of the trade (qty * price).
118
- total: number;
119
- // Signal that triggered the trade.
120
- signal: string;
121
- // Strategy used to execute the trade.
122
- strategy: string;
123
- // Analysis supporting the trade decision.
124
- analysis: string;
125
- // Confidence level in the trade decision.
126
- confidence: number;
127
- // Timestamp when the trade was executed.
128
- timestamp: Date;
129
- // Current status of the trade.
130
- status: TradeStatus;
131
- // Relation to the AlpacaAccount model.
132
- alpacaAccount: AlpacaAccount;
133
- // Relation to the Asset model.
134
- asset: Asset;
135
- // If the asset.type is OPTION, then provide type of contract (CALL or PUT).
136
- optionContractType?: OptionContractType;
137
- // List of actions associated with this trade.
138
- actions: Action[];
139
- }
140
-
141
- export enum OrderSide {
142
- BUY = "BUY",
143
- SELL = "SELL"
144
- }
145
-
146
- export enum OrderType {
147
- MARKET = "MARKET",
148
- LIMIT = "LIMIT",
149
- STOP = "STOP",
150
- STOP_LIMIT = "STOP_LIMIT",
151
- TRAILING_STOP = "TRAILING_STOP"
152
- }
153
-
154
- // Time in force enum (day, gtc, opg, cls, etc.).
155
- export enum TimeInForce {
156
- DAY = "DAY",
157
- GTC = "GTC",
158
- OPG = "OPG",
159
- CLS = "CLS",
160
- IOC = "IOC",
161
- FOK = "FOK"
162
- }
163
-
164
- export enum OrderStatus {
165
- NEW = "NEW",
166
- PARTIALLY_FILLED = "PARTIALLY_FILLED",
167
- FILLED = "FILLED",
168
- CANCELED = "CANCELED",
169
- REJECTED = "REJECTED",
170
- EXPIRED = "EXPIRED"
171
- }
172
-
173
- export type Order = {
174
- // Reference to the Alpaca account used for the order.
175
- alpacaAccountId: string;
176
- // Reference to the asset being ordered.
177
- assetId: string;
178
- // Quantity of the asset to be ordered.
179
- qty?: number;
180
- // Notional value of the order. Optional, used if qty is not provided.
181
- notional?: number;
182
- // Side of the order (BUY or SELL).
183
- side: OrderSide;
184
- // Type of order (market, limit, stop, stop_limit, trailing_stop).
185
- type: OrderType;
186
- // Time in force for the order (day, gtc, opg, cls, ioc, fok).
187
- timeInForce: TimeInForce;
188
- // Limit price for limit or stop-limit orders.
189
- limitPrice?: number;
190
- // Stop price for stop or stop-limit orders.
191
- stopPrice?: number;
192
- // Trailing price for trailing stop orders.
193
- trailPrice?: number;
194
- // Trailing percent for trailing stop orders.
195
- trailPercent?: number;
196
- // Whether the order is eligible for extended hours.
197
- extendedHours?: boolean;
198
- // Client-supplied identifier for the order.
199
- clientOrderId?: string;
200
- // Current status of the order.
201
- status: OrderStatus;
202
- // Timestamp when the order was submitted.
203
- submittedAt?: Date;
204
- // Timestamp when the order was filled.
205
- filledAt?: Date;
206
- // Average price at which the order was filled.
207
- filledAvgPrice?: number;
208
- // Reference to the action associated with the order.
209
- actionId: string;
210
- // The Alpaca account this order is associated with.
211
- alpacaAccount: AlpacaAccount;
212
- // The action this order is associated with.
213
- action: Action;
214
- // The asset this order is for.
215
- asset: Asset;
216
- // Fee associated with the order.
217
- fee?: number;
218
- }
219
-
220
- export type Position = {
221
- // Reference to the associated asset.
222
- assetId: string;
223
- // Relation to the Asset model.
224
- asset: Asset;
225
- // The average price at which the asset was acquired.
226
- averageEntryPrice: number;
227
- // Total quantity of the asset held.
228
- qty: number;
229
- // Quantity of the asset available for trading.
230
- qtyAvailable: number;
231
- // Current market value of the position.
232
- marketValue: number;
233
- // Total cost basis of the position.
234
- costBasis: number;
235
- // Unrealized profit or loss of the position.
236
- unrealizedPL: number;
237
- // Unrealized profit or loss as a percentage.
238
- unrealizedPLPC: number;
239
- // Unrealized intraday profit or loss.
240
- unrealisedIntradayPL: number;
241
- // Unrealized intraday profit or loss as a percentage.
242
- unrealisedIntradayPLPC: number;
243
- // Current price of the asset.
244
- currentPrice: number;
245
- // Last traded price of the asset.
246
- lastTradePrice: number;
247
- // Price change of the asset for the day.
248
- changeToday: number;
249
- // Indicates if the asset is marginable.
250
- assetMarginable: boolean;
251
- // Relation to the AlpacaAccount model, if applicable.
252
- alpacaAccount?: AlpacaAccount;
253
- // Foreign key referencing the AlpacaAccount.
254
- alpacaAccountId: string;
255
- }
256
-
257
- export enum AlertType {
258
- SUCCESS = "SUCCESS",
259
- WARNING = "WARNING",
260
- ERROR = "ERROR",
261
- INFO = "INFO"
262
- }
263
-
264
- export type Alert = {
265
- // Reference to the Alpaca account associated with the alert.
266
- alpacaAccountId: string;
267
- // Message content of the alert.
268
- message: string;
269
- // Type of the alert, defined by AlertType enum.
270
- type: AlertType;
271
- // Indicates whether the alert has been read by the user.
272
- isRead: boolean;
273
- // Relation to the AlpacaAccount model.
274
- alpacaAccount: AlpacaAccount;
275
72
  }
276
73
 
277
74
  export type AlpacaAccount = {
@@ -285,10 +82,6 @@ export type AlpacaAccount = {
285
82
  configuration?: any;
286
83
  // Indicates whether the market is currently open for trading.
287
84
  marketOpen: boolean;
288
- // Relation to the User model who owns this Alpaca account.
289
- user: User;
290
- // Foreign key referencing the User.
291
- userId: string;
292
85
  // List of trades executed through this Alpaca account.
293
86
  trades: Trade[];
294
87
  // List of orders placed through this Alpaca account.
@@ -318,10 +111,6 @@ export type User = {
318
111
  currentAccount: AlpacaAccountType;
319
112
  // Relation to the Customer model, if applicable.
320
113
  customer?: Customer;
321
- // Foreign key referencing the Customer.
322
- customerId?: number;
323
- // List of accounts associated with the user.
324
- accounts: Account[];
325
114
  // List of sessions associated with the user.
326
115
  sessions: Session[];
327
116
  // List of authenticators for the user.
@@ -1,2 +1,2 @@
1
- export declare const AccountTypeString = "\nYour response should adhere to the following type definition for the \"Account\" type, and its nested object types (which include 'User' type).\n\nImportantly, DO NOT include any annotations in your response (i.e. remove the ones we have provided for your reference below).\n\nexport type Account = {\n // Reference to the user who owns this account.\n userId: string;\n // Type of the account (e.g., OAuth provider).\n type: string;\n // Provider of the account (e.g., Google, GitHub).\n provider: string;\n // Unique identifier provided by the external provider.\n providerAccountId: string;\n // Refresh token for the external account, if applicable.\n refresh_token?: string;\n // Access token for the external account, if applicable.\n access_token?: string;\n // Expiration time of the access token.\n expires_at?: number;\n // Type of the token (e.g., Bearer).\n token_type?: string;\n // Scope of access granted by the token.\n scope?: string;\n // ID token for authentication, if applicable.\n id_token?: string;\n // State of the session associated with the account.\n session_state?: string;\n // Relation to the User model.\n user: User;\n}\n\nexport enum UserRole {\n OWNER = \"OWNER\",\n ADMIN = \"ADMIN\",\n USER = \"USER\"\n}\n\nexport enum AlpacaAccountType {\n PAPER = \"PAPER\",\n LIVE = \"LIVE\"\n}\n\nexport enum SubscriptionPlan {\n FREE = \"FREE\",\n PRO = \"PRO\",\n BUSINESS = \"BUSINESS\"\n}\n\nexport type Customer = {\n // Reference to the authenticated user associated with the customer.\n authUserId: string;\n // Name of the customer.\n name?: string;\n // Subscription plan the customer is enrolled in.\n plan?: SubscriptionPlan;\n // Unique Stripe customer ID for billing.\n stripeCustomerId?: string;\n // Unique Stripe subscription ID.\n stripeSubscriptionId?: string;\n // Stripe price ID associated with the customer's subscription.\n stripePriceId?: string;\n // End date of the current billing period in Stripe.\n stripeCurrentPeriodEnd?: Date;\n // List of users associated with the customer.\n users: User[];\n}\n\nexport type Session = {\n // Token associated with the session for authentication.\n sessionToken: string;\n // Reference to the user who owns this session.\n userId: string;\n // Expiration date and time of the session.\n expires: Date;\n // Relation to the User model.\n user: User;\n}\n\nexport type Authenticator = {\n // Reference to the user who owns this authenticator.\n userId: string;\n // Unique credential ID for the authenticator.\n credentialID: string;\n // Public key associated with the authenticator.\n publicKey: string;\n // Counter for the number of authentication attempts.\n counter: number;\n // Relation to the User model.\n user: User;\n}\n\nexport enum TradeStatus {\n PENDING = \"PENDING\",\n OPEN = \"OPEN\",\n PARTIAL = \"PARTIAL\",\n COMPLETED = \"COMPLETED\"\n}\n\nexport enum OptionContractType {\n CALL = \"CALL\",\n PUT = \"PUT\"\n}\n\nexport type Trade = {\n // Reference to the Alpaca account used for the trade.\n alpacaAccountId: string;\n // Reference to the asset being traded.\n assetId: string;\n // Quantity of the asset being traded.\n qty: number;\n // Price at which the asset was traded.\n price: number;\n // Total value of the trade (qty * price).\n total: number;\n // Signal that triggered the trade.\n signal: string;\n // Strategy used to execute the trade.\n strategy: string;\n // Analysis supporting the trade decision.\n analysis: string;\n // Confidence level in the trade decision.\n confidence: number;\n // Timestamp when the trade was executed.\n timestamp: Date;\n // Current status of the trade.\n status: TradeStatus;\n // Relation to the AlpacaAccount model.\n alpacaAccount: AlpacaAccount;\n // Relation to the Asset model.\n asset: Asset;\n // If the asset.type is OPTION, then provide type of contract (CALL or PUT).\n optionContractType?: OptionContractType;\n // List of actions associated with this trade.\n actions: Action[];\n}\n\nexport enum OrderSide {\n BUY = \"BUY\",\n SELL = \"SELL\"\n}\n\nexport enum OrderType {\n MARKET = \"MARKET\",\n LIMIT = \"LIMIT\",\n STOP = \"STOP\",\n STOP_LIMIT = \"STOP_LIMIT\",\n TRAILING_STOP = \"TRAILING_STOP\"\n}\n\n// Time in force enum (day, gtc, opg, cls, etc.).\nexport enum TimeInForce {\n DAY = \"DAY\",\n GTC = \"GTC\",\n OPG = \"OPG\",\n CLS = \"CLS\",\n IOC = \"IOC\",\n FOK = \"FOK\"\n}\n\nexport enum OrderStatus {\n NEW = \"NEW\",\n PARTIALLY_FILLED = \"PARTIALLY_FILLED\",\n FILLED = \"FILLED\",\n CANCELED = \"CANCELED\",\n REJECTED = \"REJECTED\",\n EXPIRED = \"EXPIRED\"\n}\n\nexport type Order = {\n // Reference to the Alpaca account used for the order.\n alpacaAccountId: string;\n // Reference to the asset being ordered.\n assetId: string;\n // Quantity of the asset to be ordered.\n qty?: number;\n // Notional value of the order. Optional, used if qty is not provided.\n notional?: number;\n // Side of the order (BUY or SELL).\n side: OrderSide;\n // Type of order (market, limit, stop, stop_limit, trailing_stop).\n type: OrderType;\n // Time in force for the order (day, gtc, opg, cls, ioc, fok).\n timeInForce: TimeInForce;\n // Limit price for limit or stop-limit orders.\n limitPrice?: number;\n // Stop price for stop or stop-limit orders.\n stopPrice?: number;\n // Trailing price for trailing stop orders.\n trailPrice?: number;\n // Trailing percent for trailing stop orders.\n trailPercent?: number;\n // Whether the order is eligible for extended hours.\n extendedHours?: boolean;\n // Client-supplied identifier for the order.\n clientOrderId?: string;\n // Current status of the order.\n status: OrderStatus;\n // Timestamp when the order was submitted.\n submittedAt?: Date;\n // Timestamp when the order was filled.\n filledAt?: Date;\n // Average price at which the order was filled.\n filledAvgPrice?: number;\n // Reference to the action associated with the order.\n actionId: string;\n // The Alpaca account this order is associated with.\n alpacaAccount: AlpacaAccount;\n // The action this order is associated with.\n action: Action;\n // The asset this order is for.\n asset: Asset;\n // Fee associated with the order.\n fee?: number;\n}\n\nexport type Position = {\n // Reference to the associated asset.\n assetId: string;\n // Relation to the Asset model.\n asset: Asset;\n // The average price at which the asset was acquired.\n averageEntryPrice: number;\n // Total quantity of the asset held.\n qty: number;\n // Quantity of the asset available for trading.\n qtyAvailable: number;\n // Current market value of the position.\n marketValue: number;\n // Total cost basis of the position.\n costBasis: number;\n // Unrealized profit or loss of the position.\n unrealizedPL: number;\n // Unrealized profit or loss as a percentage.\n unrealizedPLPC: number;\n // Unrealized intraday profit or loss.\n unrealisedIntradayPL: number;\n // Unrealized intraday profit or loss as a percentage.\n unrealisedIntradayPLPC: number;\n // Current price of the asset.\n currentPrice: number;\n // Last traded price of the asset.\n lastTradePrice: number;\n // Price change of the asset for the day.\n changeToday: number;\n // Indicates if the asset is marginable.\n assetMarginable: boolean;\n // Relation to the AlpacaAccount model, if applicable.\n alpacaAccount?: AlpacaAccount;\n // Foreign key referencing the AlpacaAccount.\n alpacaAccountId: string;\n}\n\nexport enum AlertType {\n SUCCESS = \"SUCCESS\",\n WARNING = \"WARNING\",\n ERROR = \"ERROR\",\n INFO = \"INFO\"\n}\n\nexport type Alert = {\n // Reference to the Alpaca account associated with the alert.\n alpacaAccountId: string;\n // Message content of the alert.\n message: string;\n // Type of the alert, defined by AlertType enum.\n type: AlertType;\n // Indicates whether the alert has been read by the user.\n isRead: boolean;\n // Relation to the AlpacaAccount model.\n alpacaAccount: AlpacaAccount;\n}\n\nexport type AlpacaAccount = {\n // The type of Alpaca account (PAPER or LIVE).\n type: AlpacaAccountType;\n // API key for authenticating requests to Alpaca.\n APIKey: string;\n // API secret for authenticating requests to Alpaca.\n APISecret: string;\n // JSON configuration settings for the Alpaca account.\n configuration?: any;\n // Indicates whether the market is currently open for trading.\n marketOpen: boolean;\n // Relation to the User model who owns this Alpaca account.\n user: User;\n // Foreign key referencing the User.\n userId: string;\n // List of trades executed through this Alpaca account.\n trades: Trade[];\n // List of orders placed through this Alpaca account.\n orders: Order[];\n // List of positions held in this Alpaca account.\n positions: Position[];\n // List of alerts generated for this Alpaca account.\n alerts: Alert[];\n}\n\nexport type User = {\n // The user's full name.\n name?: string;\n // The user's email address, must be unique.\n email?: string;\n // Timestamp when the user's email was verified.\n emailVerified?: Date;\n // URL to the user's profile image.\n image?: string;\n // The role assigned to the user, determining permissions.\n role: UserRole;\n // A short biography or description of the user.\n bio?: string;\n // The user's job title or position.\n jobTitle?: string;\n // The type of Alpaca account the user currently holds.\n currentAccount: AlpacaAccountType;\n // Relation to the Customer model, if applicable.\n customer?: Customer;\n // Foreign key referencing the Customer.\n customerId?: number;\n // List of accounts associated with the user.\n accounts: Account[];\n // List of sessions associated with the user.\n sessions: Session[];\n // List of authenticators for the user.\n authenticators: Authenticator[];\n // The subscription plan the user is enrolled in.\n plan?: SubscriptionPlan;\n // List of Alpaca accounts linked to the user.\n alpacaAccounts: AlpacaAccount[];\n}\n\n";
1
+ export declare const AccountTypeString = "\nYour response should adhere to the following type definition for the \"Account\" type, and its nested object types (which include 'User' type).\n\nImportantly, DO NOT include any annotations in your response (i.e. remove the ones we have provided for your reference below).\n\nexport type Account = {\n // Type of the account (e.g., OAuth provider).\n type: string;\n // Provider of the account (e.g., Google, GitHub).\n provider: string;\n // Refresh token for the external account, if applicable.\n refresh_token?: string;\n // Access token for the external account, if applicable.\n access_token?: string;\n // Expiration time of the access token.\n expires_at?: number;\n // Type of the token (e.g., Bearer).\n token_type?: string;\n // Scope of access granted by the token.\n scope?: string;\n // ID token for authentication, if applicable.\n id_token?: string;\n // State of the session associated with the account.\n session_state?: string;\n // Relation to the User model.\n user: User;\n}\n\nexport enum UserRole {\n OWNER = \"OWNER\",\n ADMIN = \"ADMIN\",\n USER = \"USER\"\n}\n\nexport enum AlpacaAccountType {\n PAPER = \"PAPER\",\n LIVE = \"LIVE\"\n}\n\nexport enum SubscriptionPlan {\n FREE = \"FREE\",\n PRO = \"PRO\",\n BUSINESS = \"BUSINESS\"\n}\n\nexport type Customer = {\n // Name of the customer.\n name?: string;\n // Subscription plan the customer is enrolled in.\n plan?: SubscriptionPlan;\n // End date of the current billing period in Stripe.\n stripeCurrentPeriodEnd?: Date;\n}\n\nexport type Session = {\n // Token associated with the session for authentication.\n sessionToken: string;\n // Expiration date and time of the session.\n expires: Date;\n}\n\nexport type Authenticator = {\n // Unique credential ID for the authenticator.\n credentialID: string;\n // Public key associated with the authenticator.\n publicKey: string;\n // Counter for the number of authentication attempts.\n counter: number;\n}\n\nexport type AlpacaAccount = {\n // The type of Alpaca account (PAPER or LIVE).\n type: AlpacaAccountType;\n // API key for authenticating requests to Alpaca.\n APIKey: string;\n // API secret for authenticating requests to Alpaca.\n APISecret: string;\n // JSON configuration settings for the Alpaca account.\n configuration?: any;\n // Indicates whether the market is currently open for trading.\n marketOpen: boolean;\n // List of trades executed through this Alpaca account.\n trades: Trade[];\n // List of orders placed through this Alpaca account.\n orders: Order[];\n // List of positions held in this Alpaca account.\n positions: Position[];\n // List of alerts generated for this Alpaca account.\n alerts: Alert[];\n}\n\nexport type User = {\n // The user's full name.\n name?: string;\n // The user's email address, must be unique.\n email?: string;\n // Timestamp when the user's email was verified.\n emailVerified?: Date;\n // URL to the user's profile image.\n image?: string;\n // The role assigned to the user, determining permissions.\n role: UserRole;\n // A short biography or description of the user.\n bio?: string;\n // The user's job title or position.\n jobTitle?: string;\n // The type of Alpaca account the user currently holds.\n currentAccount: AlpacaAccountType;\n // Relation to the Customer model, if applicable.\n customer?: Customer;\n // List of sessions associated with the user.\n sessions: Session[];\n // List of authenticators for the user.\n authenticators: Authenticator[];\n // The subscription plan the user is enrolled in.\n plan?: SubscriptionPlan;\n // List of Alpaca accounts linked to the user.\n alpacaAccounts: AlpacaAccount[];\n}\n\n";
2
2
  //# sourceMappingURL=Account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../../src/generated/typeStrings/Account.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,83TA2U7B,CAAC"}
1
+ {"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../../src/generated/typeStrings/Account.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,soHAwH7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Account.js","sourceRoot":"","sources":["../../../src/generated/typeStrings/Account.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2UhC,CAAC"}
1
+ {"version":3,"file":"Account.js","sourceRoot":"","sources":["../../../src/generated/typeStrings/Account.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwHhC,CAAC"}
@@ -9,12 +9,8 @@ Importantly, DO NOT include any annotations in your response (i.e. remove the on
9
9
  export type Action = {
10
10
  // Sequence number of the action within the trade.
11
11
  sequence: number;
12
- // Reference to the trade this action is part of.
13
- tradeId: string;
14
12
  // Type of trade action, defined by ActionType enum.
15
13
  type: ActionType;
16
- // Reference to the order ID associated with the action.
17
- orderId?: string;
18
14
  // Additional notes or comments about the action.
19
15
  note: string;
20
16
  // Current status of the trade action.
@@ -55,187 +51,6 @@ export enum AlpacaAccountType {
55
51
  LIVE = "LIVE"
56
52
  }
57
53
 
58
- export enum UserRole {
59
- OWNER = "OWNER",
60
- ADMIN = "ADMIN",
61
- USER = "USER"
62
- }
63
-
64
- export enum SubscriptionPlan {
65
- FREE = "FREE",
66
- PRO = "PRO",
67
- BUSINESS = "BUSINESS"
68
- }
69
-
70
- export type User = {
71
- // The user's full name.
72
- name?: string;
73
- // The user's email address, must be unique.
74
- email?: string;
75
- // Timestamp when the user's email was verified.
76
- emailVerified?: Date;
77
- // URL to the user's profile image.
78
- image?: string;
79
- // The role assigned to the user, determining permissions.
80
- role: UserRole;
81
- // A short biography or description of the user.
82
- bio?: string;
83
- // The user's job title or position.
84
- jobTitle?: string;
85
- // The type of Alpaca account the user currently holds.
86
- currentAccount: AlpacaAccountType;
87
- // Relation to the Customer model, if applicable.
88
- customer?: Customer;
89
- // Foreign key referencing the Customer.
90
- customerId?: number;
91
- // List of accounts associated with the user.
92
- accounts: Account[];
93
- // List of sessions associated with the user.
94
- sessions: Session[];
95
- // List of authenticators for the user.
96
- authenticators: Authenticator[];
97
- // The subscription plan the user is enrolled in.
98
- plan?: SubscriptionPlan;
99
- // List of Alpaca accounts linked to the user.
100
- alpacaAccounts: AlpacaAccount[];
101
- }
102
-
103
- export enum OrderSide {
104
- BUY = "BUY",
105
- SELL = "SELL"
106
- }
107
-
108
- export enum OrderType {
109
- MARKET = "MARKET",
110
- LIMIT = "LIMIT",
111
- STOP = "STOP",
112
- STOP_LIMIT = "STOP_LIMIT",
113
- TRAILING_STOP = "TRAILING_STOP"
114
- }
115
-
116
- // Time in force enum (day, gtc, opg, cls, etc.).
117
- export enum TimeInForce {
118
- DAY = "DAY",
119
- GTC = "GTC",
120
- OPG = "OPG",
121
- CLS = "CLS",
122
- IOC = "IOC",
123
- FOK = "FOK"
124
- }
125
-
126
- export enum OrderStatus {
127
- NEW = "NEW",
128
- PARTIALLY_FILLED = "PARTIALLY_FILLED",
129
- FILLED = "FILLED",
130
- CANCELED = "CANCELED",
131
- REJECTED = "REJECTED",
132
- EXPIRED = "EXPIRED"
133
- }
134
-
135
- export type Order = {
136
- // Reference to the Alpaca account used for the order.
137
- alpacaAccountId: string;
138
- // Reference to the asset being ordered.
139
- assetId: string;
140
- // Quantity of the asset to be ordered.
141
- qty?: number;
142
- // Notional value of the order. Optional, used if qty is not provided.
143
- notional?: number;
144
- // Side of the order (BUY or SELL).
145
- side: OrderSide;
146
- // Type of order (market, limit, stop, stop_limit, trailing_stop).
147
- type: OrderType;
148
- // Time in force for the order (day, gtc, opg, cls, ioc, fok).
149
- timeInForce: TimeInForce;
150
- // Limit price for limit or stop-limit orders.
151
- limitPrice?: number;
152
- // Stop price for stop or stop-limit orders.
153
- stopPrice?: number;
154
- // Trailing price for trailing stop orders.
155
- trailPrice?: number;
156
- // Trailing percent for trailing stop orders.
157
- trailPercent?: number;
158
- // Whether the order is eligible for extended hours.
159
- extendedHours?: boolean;
160
- // Client-supplied identifier for the order.
161
- clientOrderId?: string;
162
- // Current status of the order.
163
- status: OrderStatus;
164
- // Timestamp when the order was submitted.
165
- submittedAt?: Date;
166
- // Timestamp when the order was filled.
167
- filledAt?: Date;
168
- // Average price at which the order was filled.
169
- filledAvgPrice?: number;
170
- // Reference to the action associated with the order.
171
- actionId: string;
172
- // The Alpaca account this order is associated with.
173
- alpacaAccount: AlpacaAccount;
174
- // The action this order is associated with.
175
- action: Action;
176
- // The asset this order is for.
177
- asset: Asset;
178
- // Fee associated with the order.
179
- fee?: number;
180
- }
181
-
182
- export type Position = {
183
- // Reference to the associated asset.
184
- assetId: string;
185
- // Relation to the Asset model.
186
- asset: Asset;
187
- // The average price at which the asset was acquired.
188
- averageEntryPrice: number;
189
- // Total quantity of the asset held.
190
- qty: number;
191
- // Quantity of the asset available for trading.
192
- qtyAvailable: number;
193
- // Current market value of the position.
194
- marketValue: number;
195
- // Total cost basis of the position.
196
- costBasis: number;
197
- // Unrealized profit or loss of the position.
198
- unrealizedPL: number;
199
- // Unrealized profit or loss as a percentage.
200
- unrealizedPLPC: number;
201
- // Unrealized intraday profit or loss.
202
- unrealisedIntradayPL: number;
203
- // Unrealized intraday profit or loss as a percentage.
204
- unrealisedIntradayPLPC: number;
205
- // Current price of the asset.
206
- currentPrice: number;
207
- // Last traded price of the asset.
208
- lastTradePrice: number;
209
- // Price change of the asset for the day.
210
- changeToday: number;
211
- // Indicates if the asset is marginable.
212
- assetMarginable: boolean;
213
- // Relation to the AlpacaAccount model, if applicable.
214
- alpacaAccount?: AlpacaAccount;
215
- // Foreign key referencing the AlpacaAccount.
216
- alpacaAccountId: string;
217
- }
218
-
219
- export enum AlertType {
220
- SUCCESS = "SUCCESS",
221
- WARNING = "WARNING",
222
- ERROR = "ERROR",
223
- INFO = "INFO"
224
- }
225
-
226
- export type Alert = {
227
- // Reference to the Alpaca account associated with the alert.
228
- alpacaAccountId: string;
229
- // Message content of the alert.
230
- message: string;
231
- // Type of the alert, defined by AlertType enum.
232
- type: AlertType;
233
- // Indicates whether the alert has been read by the user.
234
- isRead: boolean;
235
- // Relation to the AlpacaAccount model.
236
- alpacaAccount: AlpacaAccount;
237
- }
238
-
239
54
  export type AlpacaAccount = {
240
55
  // The type of Alpaca account (PAPER or LIVE).
241
56
  type: AlpacaAccountType;
@@ -249,10 +64,6 @@ export type AlpacaAccount = {
249
64
  marketOpen: boolean;
250
65
  // Relation to the User model who owns this Alpaca account.
251
66
  user: User;
252
- // Foreign key referencing the User.
253
- userId: string;
254
- // List of trades executed through this Alpaca account.
255
- trades: Trade[];
256
67
  // List of orders placed through this Alpaca account.
257
68
  orders: Order[];
258
69
  // List of positions held in this Alpaca account.
@@ -261,16 +72,155 @@ export type AlpacaAccount = {
261
72
  alerts: Alert[];
262
73
  }
263
74
 
75
+ export enum AssetType {
76
+ STOCK = "STOCK",
77
+ ETF = "ETF",
78
+ MUTUAL_FUND = "MUTUAL_FUND",
79
+ CRYPTOCURRENCY = "CRYPTOCURRENCY",
80
+ INDEX = "INDEX",
81
+ COMMODITY = "COMMODITY",
82
+ CURRENCY = "CURRENCY",
83
+ OPTION = "OPTION",
84
+ FUTURE = "FUTURE",
85
+ BOND = "BOND",
86
+ WARRANT = "WARRANT",
87
+ ADR = "ADR",
88
+ GDR = "GDR",
89
+ UNIT = "UNIT",
90
+ RIGHT = "RIGHT",
91
+ REIT = "REIT",
92
+ STRUCTURED_PRODUCT = "STRUCTURED_PRODUCT",
93
+ SWAP = "SWAP",
94
+ SPOT = "SPOT",
95
+ FORWARD = "FORWARD",
96
+ OTHER = "OTHER"
97
+ }
98
+
99
+ export type Asset = {
100
+ // Ticker symbol of the asset, must be unique.
101
+ symbol: string;
102
+ // Full name of the asset, must be unique.
103
+ name: string;
104
+ // Type of the asset, defined by AssetType enum.
105
+ type: AssetType;
106
+ // URL to the asset's logo image.
107
+ logoUrl?: string;
108
+ // Description of the asset.
109
+ description?: string;
110
+ // Central Index Key for the asset.
111
+ cik?: string;
112
+ // Stock exchange where the asset is listed.
113
+ exchange?: string;
114
+ // Currency in which the asset is traded.
115
+ currency?: string;
116
+ // Country where the asset is based.
117
+ country?: string;
118
+ // Sector classification of the asset.
119
+ sector?: string;
120
+ // Industry classification of the asset.
121
+ industry?: string;
122
+ // Physical address associated with the asset.
123
+ address?: string;
124
+ // Official website of the asset.
125
+ officialSite?: string;
126
+ // Fiscal year-end date of the asset.
127
+ fiscalYearEnd?: string;
128
+ // Date of the latest financial quarter.
129
+ latestQuarter?: string;
130
+ // Market capitalization of the asset.
131
+ marketCapitalization?: string;
132
+ // Earnings Before Interest, Taxes, Depreciation, and Amortization.
133
+ ebitda?: string;
134
+ // Price-to-Earnings ratio.
135
+ peRatio?: string;
136
+ // Price/Earnings to Growth ratio.
137
+ pegRatio?: string;
138
+ // Book value per share.
139
+ bookValue?: string;
140
+ // Dividend per share.
141
+ dividendPerShare?: string;
142
+ // Dividend yield percentage.
143
+ dividendYield?: string;
144
+ // Earnings per share.
145
+ eps?: string;
146
+ // Revenue per share over the trailing twelve months.
147
+ revenuePerShareTTM?: string;
148
+ // Profit margin percentage.
149
+ profitMargin?: string;
150
+ // Operating margin over the trailing twelve months.
151
+ operatingMarginTTM?: string;
152
+ // Return on assets over the trailing twelve months.
153
+ returnOnAssetsTTM?: string;
154
+ // Return on equity over the trailing twelve months.
155
+ returnOnEquityTTM?: string;
156
+ // Total revenue over the trailing twelve months.
157
+ revenueTTM?: string;
158
+ // Gross profit over the trailing twelve months.
159
+ grossProfitTTM?: string;
160
+ // Diluted earnings per share over the trailing twelve months.
161
+ dilutedEPSTTM?: string;
162
+ // Year-over-year growth in quarterly earnings.
163
+ quarterlyEarningsGrowthYOY?: string;
164
+ // Year-over-year growth in quarterly revenue.
165
+ quarterlyRevenueGrowthYOY?: string;
166
+ // Analyst target price for the asset.
167
+ analystTargetPrice?: string;
168
+ // Percentage of analysts rating the asset as Strong Buy.
169
+ analystRatingStrongBuy?: string;
170
+ // Percentage of analysts rating the asset as Buy.
171
+ analystRatingBuy?: string;
172
+ // Percentage of analysts rating the asset as Hold.
173
+ analystRatingHold?: string;
174
+ // Percentage of analysts rating the asset as Sell.
175
+ analystRatingSell?: string;
176
+ // Percentage of analysts rating the asset as Strong Sell.
177
+ analystRatingStrongSell?: string;
178
+ // Trailing Price-to-Earnings ratio.
179
+ trailingPE?: string;
180
+ // Forward Price-to-Earnings ratio.
181
+ forwardPE?: string;
182
+ // Price-to-Sales ratio over the trailing twelve months.
183
+ priceToSalesRatioTTM?: string;
184
+ // Price-to-Book ratio.
185
+ priceToBookRatio?: string;
186
+ // Enterprise Value to Revenue ratio.
187
+ evToRevenue?: string;
188
+ // Enterprise Value to EBITDA ratio.
189
+ evToEbitda?: string;
190
+ // Beta coefficient measuring volatility.
191
+ beta?: string;
192
+ // 52-week high price of the asset.
193
+ week52High?: string;
194
+ // 52-week low price of the asset.
195
+ week52Low?: string;
196
+ // 50-day moving average price.
197
+ day50MovingAverage?: string;
198
+ // 200-day moving average price.
199
+ day200MovingAverage?: string;
200
+ // Total number of shares outstanding.
201
+ sharesOutstanding?: string;
202
+ // Date when the next dividend is paid.
203
+ dividendDate?: string;
204
+ // Date when the asset goes ex-dividend.
205
+ exDividendDate?: string;
206
+ // Last sell price of the asset.
207
+ sellPrice?: string;
208
+ // Last buy price of the asset.
209
+ buyPrice?: string;
210
+ // List of orders involving this asset.
211
+ orders: Order[];
212
+ // List of positions involving this asset.
213
+ positions: Position[];
214
+ // List of news article sentiments related to this asset.
215
+ newsMentions: NewsArticleAssetSentiment[];
216
+ }
217
+
264
218
  export enum OptionContractType {
265
219
  CALL = "CALL",
266
220
  PUT = "PUT"
267
221
  }
268
222
 
269
223
  export type Trade = {
270
- // Reference to the Alpaca account used for the trade.
271
- alpacaAccountId: string;
272
- // Reference to the asset being traded.
273
- assetId: string;
274
224
  // Quantity of the asset being traded.
275
225
  qty: number;
276
226
  // Price at which the asset was traded.
@@ -295,8 +245,6 @@ export type Trade = {
295
245
  asset: Asset;
296
246
  // If the asset.type is OPTION, then provide type of contract (CALL or PUT).
297
247
  optionContractType?: OptionContractType;
298
- // List of actions associated with this trade.
299
- actions: Action[];
300
248
  }
301
249
 
302
250
  `;