adaptic-backend 1.0.61 → 1.0.62

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 (152) hide show
  1. package/README.md +59 -26
  2. package/generated/typeStrings/Account.cjs +363 -0
  3. package/generated/typeStrings/Account.d.ts +2 -0
  4. package/generated/typeStrings/Account.d.ts.map +1 -0
  5. package/generated/typeStrings/Account.js.map +1 -0
  6. package/generated/typeStrings/Action.cjs +337 -0
  7. package/generated/typeStrings/Action.d.ts +2 -0
  8. package/generated/typeStrings/Action.d.ts.map +1 -0
  9. package/generated/typeStrings/Action.js.map +1 -0
  10. package/generated/typeStrings/Alert.cjs +493 -0
  11. package/generated/typeStrings/Alert.d.ts +2 -0
  12. package/generated/typeStrings/Alert.d.ts.map +1 -0
  13. package/generated/typeStrings/Alert.js.map +1 -0
  14. package/generated/typeStrings/AlpacaAccount.cjs +575 -0
  15. package/generated/typeStrings/AlpacaAccount.d.ts +2 -0
  16. package/generated/typeStrings/AlpacaAccount.d.ts.map +1 -0
  17. package/generated/typeStrings/AlpacaAccount.js.map +1 -0
  18. package/generated/typeStrings/Asset.cjs +536 -0
  19. package/generated/typeStrings/Asset.d.ts +2 -0
  20. package/generated/typeStrings/Asset.d.ts.map +1 -0
  21. package/generated/typeStrings/Asset.js.map +1 -0
  22. package/generated/typeStrings/Authenticator.cjs +363 -0
  23. package/generated/typeStrings/Authenticator.d.ts +2 -0
  24. package/generated/typeStrings/Authenticator.d.ts.map +1 -0
  25. package/generated/typeStrings/Authenticator.js.map +1 -0
  26. package/generated/typeStrings/Customer.cjs +363 -0
  27. package/generated/typeStrings/Customer.d.ts +2 -0
  28. package/generated/typeStrings/Customer.d.ts.map +1 -0
  29. package/generated/typeStrings/Customer.js.map +1 -0
  30. package/generated/typeStrings/EconomicEvent.cjs +33 -0
  31. package/generated/typeStrings/EconomicEvent.d.ts +2 -0
  32. package/generated/typeStrings/EconomicEvent.d.ts.map +1 -0
  33. package/generated/typeStrings/EconomicEvent.js.map +1 -0
  34. package/generated/typeStrings/NewsArticle.cjs +361 -0
  35. package/generated/typeStrings/NewsArticle.d.ts +2 -0
  36. package/generated/typeStrings/NewsArticle.d.ts.map +1 -0
  37. package/generated/typeStrings/NewsArticle.js.map +1 -0
  38. package/generated/typeStrings/NewsArticleAssetSentiment.cjs +386 -0
  39. package/generated/typeStrings/NewsArticleAssetSentiment.d.ts +2 -0
  40. package/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -0
  41. package/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -0
  42. package/generated/typeStrings/Order.cjs +521 -0
  43. package/generated/typeStrings/Order.d.ts +2 -0
  44. package/generated/typeStrings/Order.d.ts.map +1 -0
  45. package/generated/typeStrings/Order.js.map +1 -0
  46. package/generated/typeStrings/Position.cjs +419 -0
  47. package/generated/typeStrings/Position.d.ts +2 -0
  48. package/generated/typeStrings/Position.d.ts.map +1 -0
  49. package/generated/typeStrings/Position.js.map +1 -0
  50. package/generated/typeStrings/Session.cjs +363 -0
  51. package/generated/typeStrings/Session.d.ts +2 -0
  52. package/generated/typeStrings/Session.d.ts.map +1 -0
  53. package/generated/typeStrings/Session.js.map +1 -0
  54. package/generated/typeStrings/Trade.cjs +521 -0
  55. package/generated/typeStrings/Trade.d.ts +2 -0
  56. package/generated/typeStrings/Trade.d.ts.map +1 -0
  57. package/generated/typeStrings/Trade.js.map +1 -0
  58. package/generated/typeStrings/User.cjs +493 -0
  59. package/generated/typeStrings/User.d.ts +2 -0
  60. package/generated/typeStrings/User.d.ts.map +1 -0
  61. package/generated/typeStrings/User.js.map +1 -0
  62. package/generated/typeStrings/VerificationToken.cjs +21 -0
  63. package/generated/typeStrings/VerificationToken.d.ts +2 -0
  64. package/generated/typeStrings/VerificationToken.d.ts.map +1 -0
  65. package/generated/typeStrings/VerificationToken.js.map +1 -0
  66. package/generated/typeStrings/enums.cjs +100 -0
  67. package/generated/typeStrings/enums.d.ts +85 -0
  68. package/generated/typeStrings/enums.d.ts.map +1 -0
  69. package/generated/typeStrings/enums.js.map +1 -0
  70. package/generated/typeStrings/index.cjs +39 -0
  71. package/generated/typeStrings/index.d.ts +20 -0
  72. package/generated/typeStrings/index.d.ts.map +1 -0
  73. package/generated/typeStrings/index.js.map +1 -0
  74. package/index.cjs +25 -0
  75. package/index.d.ts +1 -0
  76. package/package.json +1 -1
  77. package/server/generated/typeStrings/Account.d.ts +2 -0
  78. package/server/generated/typeStrings/Account.d.ts.map +1 -0
  79. package/server/generated/typeStrings/Account.js.map +1 -0
  80. package/server/generated/typeStrings/Account.mjs +360 -0
  81. package/server/generated/typeStrings/Action.d.ts +2 -0
  82. package/server/generated/typeStrings/Action.d.ts.map +1 -0
  83. package/server/generated/typeStrings/Action.js.map +1 -0
  84. package/server/generated/typeStrings/Action.mjs +334 -0
  85. package/server/generated/typeStrings/Alert.d.ts +2 -0
  86. package/server/generated/typeStrings/Alert.d.ts.map +1 -0
  87. package/server/generated/typeStrings/Alert.js.map +1 -0
  88. package/server/generated/typeStrings/Alert.mjs +490 -0
  89. package/server/generated/typeStrings/AlpacaAccount.d.ts +2 -0
  90. package/server/generated/typeStrings/AlpacaAccount.d.ts.map +1 -0
  91. package/server/generated/typeStrings/AlpacaAccount.js.map +1 -0
  92. package/server/generated/typeStrings/AlpacaAccount.mjs +572 -0
  93. package/server/generated/typeStrings/Asset.d.ts +2 -0
  94. package/server/generated/typeStrings/Asset.d.ts.map +1 -0
  95. package/server/generated/typeStrings/Asset.js.map +1 -0
  96. package/server/generated/typeStrings/Asset.mjs +533 -0
  97. package/server/generated/typeStrings/Authenticator.d.ts +2 -0
  98. package/server/generated/typeStrings/Authenticator.d.ts.map +1 -0
  99. package/server/generated/typeStrings/Authenticator.js.map +1 -0
  100. package/server/generated/typeStrings/Authenticator.mjs +360 -0
  101. package/server/generated/typeStrings/Customer.d.ts +2 -0
  102. package/server/generated/typeStrings/Customer.d.ts.map +1 -0
  103. package/server/generated/typeStrings/Customer.js.map +1 -0
  104. package/server/generated/typeStrings/Customer.mjs +360 -0
  105. package/server/generated/typeStrings/EconomicEvent.d.ts +2 -0
  106. package/server/generated/typeStrings/EconomicEvent.d.ts.map +1 -0
  107. package/server/generated/typeStrings/EconomicEvent.js.map +1 -0
  108. package/server/generated/typeStrings/EconomicEvent.mjs +30 -0
  109. package/server/generated/typeStrings/NewsArticle.d.ts +2 -0
  110. package/server/generated/typeStrings/NewsArticle.d.ts.map +1 -0
  111. package/server/generated/typeStrings/NewsArticle.js.map +1 -0
  112. package/server/generated/typeStrings/NewsArticle.mjs +358 -0
  113. package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts +2 -0
  114. package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -0
  115. package/server/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -0
  116. package/server/generated/typeStrings/NewsArticleAssetSentiment.mjs +383 -0
  117. package/server/generated/typeStrings/Order.d.ts +2 -0
  118. package/server/generated/typeStrings/Order.d.ts.map +1 -0
  119. package/server/generated/typeStrings/Order.js.map +1 -0
  120. package/server/generated/typeStrings/Order.mjs +518 -0
  121. package/server/generated/typeStrings/Position.d.ts +2 -0
  122. package/server/generated/typeStrings/Position.d.ts.map +1 -0
  123. package/server/generated/typeStrings/Position.js.map +1 -0
  124. package/server/generated/typeStrings/Position.mjs +416 -0
  125. package/server/generated/typeStrings/Session.d.ts +2 -0
  126. package/server/generated/typeStrings/Session.d.ts.map +1 -0
  127. package/server/generated/typeStrings/Session.js.map +1 -0
  128. package/server/generated/typeStrings/Session.mjs +360 -0
  129. package/server/generated/typeStrings/Trade.d.ts +2 -0
  130. package/server/generated/typeStrings/Trade.d.ts.map +1 -0
  131. package/server/generated/typeStrings/Trade.js.map +1 -0
  132. package/server/generated/typeStrings/Trade.mjs +518 -0
  133. package/server/generated/typeStrings/User.d.ts +2 -0
  134. package/server/generated/typeStrings/User.d.ts.map +1 -0
  135. package/server/generated/typeStrings/User.js.map +1 -0
  136. package/server/generated/typeStrings/User.mjs +490 -0
  137. package/server/generated/typeStrings/VerificationToken.d.ts +2 -0
  138. package/server/generated/typeStrings/VerificationToken.d.ts.map +1 -0
  139. package/server/generated/typeStrings/VerificationToken.js.map +1 -0
  140. package/server/generated/typeStrings/VerificationToken.mjs +18 -0
  141. package/server/generated/typeStrings/enums.d.ts +85 -0
  142. package/server/generated/typeStrings/enums.d.ts.map +1 -0
  143. package/server/generated/typeStrings/enums.js.map +1 -0
  144. package/server/generated/typeStrings/enums.mjs +97 -0
  145. package/server/generated/typeStrings/index.d.ts +20 -0
  146. package/server/generated/typeStrings/index.d.ts.map +1 -0
  147. package/server/generated/typeStrings/index.js.map +1 -0
  148. package/server/generated/typeStrings/index.mjs +36 -0
  149. package/server/index.d.ts +1 -0
  150. package/server/index.d.ts.map +1 -1
  151. package/server/index.js.map +1 -1
  152. package/server/index.mjs +1 -0
@@ -0,0 +1,521 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TradeTypeString = void 0;
4
+ exports.TradeTypeString = `
5
+ Your response should adhere to the following type definition for the "Trade" type, and its nested object types (which include 'AlpacaAccount', 'Asset', 'Action' types), as well as any ENUMS used by it (which include 'TradeStatus' enum).
6
+
7
+ Importantly, DO NOT include any annotations in your response (i.e. remove the ones we have provided for your reference below).
8
+
9
+ export interface Trade {
10
+ // Unique identifier for the trade.
11
+ id: string;
12
+ // Reference to the Alpaca account used for the trade.
13
+ alpacaAccountId: string;
14
+ // Reference to the asset being traded.
15
+ assetId: string;
16
+ // Quantity of the asset being traded.
17
+ qty: number;
18
+ // Price at which the asset was traded.
19
+ price: number;
20
+ // Total value of the trade (qty * price).
21
+ total: number;
22
+ // Signal that triggered the trade.
23
+ signal: string;
24
+ // Strategy used to execute the trade.
25
+ strategy: string;
26
+ // Analysis supporting the trade decision.
27
+ analysis: string;
28
+ // Confidence level in the trade decision.
29
+ confidence: number;
30
+ // Timestamp when the trade was executed.
31
+ timestamp: Date;
32
+ // Timestamp when the trade record was created.
33
+ createdAt: Date;
34
+ // Timestamp when the trade record was last updated.
35
+ updatedAt: Date;
36
+ // Current status of the trade.
37
+ status: TradeStatus;
38
+ // Relation to the AlpacaAccount model.
39
+ alpacaAccount: AlpacaAccount;
40
+ // Relation to the Asset model.
41
+ asset: Asset;
42
+ // List of actions associated with this trade.
43
+ actions: Action[];
44
+ }
45
+
46
+ export enum TradeStatus {
47
+ PENDING = "PENDING",
48
+ OPEN = "OPEN",
49
+ PARTIAL = "PARTIAL",
50
+ COMPLETED = "COMPLETED"
51
+ }
52
+
53
+ export enum AlpacaAccountType {
54
+ PAPER = "PAPER",
55
+ LIVE = "LIVE"
56
+ }
57
+
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 interface Customer {
71
+ // Unique identifier for the customer.
72
+ id: number;
73
+ // Reference to the authenticated user associated with the customer.
74
+ authUserId: string;
75
+ // Name of the customer.
76
+ name?: string;
77
+ // Subscription plan the customer is enrolled in.
78
+ plan?: SubscriptionPlan;
79
+ // Unique Stripe customer ID for billing.
80
+ stripeCustomerId?: string;
81
+ // Unique Stripe subscription ID.
82
+ stripeSubscriptionId?: string;
83
+ // Stripe price ID associated with the customer's subscription.
84
+ stripePriceId?: string;
85
+ // End date of the current billing period in Stripe.
86
+ stripeCurrentPeriodEnd?: Date;
87
+ // Timestamp when the customer was created.
88
+ createdAt: Date;
89
+ // Timestamp when the customer was last updated.
90
+ updatedAt: Date;
91
+ // List of users associated with the customer.
92
+ users: User[];
93
+ }
94
+
95
+ export interface Account {
96
+ // Unique identifier for the account.
97
+ id: string;
98
+ // Reference to the user who owns this account.
99
+ userId: string;
100
+ // Type of the account (e.g., OAuth provider).
101
+ type: string;
102
+ // Provider of the account (e.g., Google, GitHub).
103
+ provider: string;
104
+ // Unique identifier provided by the external provider.
105
+ providerAccountId: string;
106
+ // Refresh token for the external account, if applicable.
107
+ refresh_token?: string;
108
+ // Access token for the external account, if applicable.
109
+ access_token?: string;
110
+ // Expiration time of the access token.
111
+ expires_at?: number;
112
+ // Type of the token (e.g., Bearer).
113
+ token_type?: string;
114
+ // Scope of access granted by the token.
115
+ scope?: string;
116
+ // ID token for authentication, if applicable.
117
+ id_token?: string;
118
+ // State of the session associated with the account.
119
+ session_state?: string;
120
+ // Timestamp when the account was created.
121
+ createdAt: Date;
122
+ // Timestamp when the account was last updated.
123
+ updatedAt: Date;
124
+ // Relation to the User model.
125
+ user: User;
126
+ }
127
+
128
+ export interface Session {
129
+ // Unique identifier for the session.
130
+ id: string;
131
+ // Token associated with the session for authentication.
132
+ sessionToken: string;
133
+ // Reference to the user who owns this session.
134
+ userId: string;
135
+ // Expiration date and time of the session.
136
+ expires: Date;
137
+ // Relation to the User model.
138
+ user: User;
139
+ // Timestamp when the session was created.
140
+ createdAt: Date;
141
+ // Timestamp when the session was last updated.
142
+ updatedAt: Date;
143
+ }
144
+
145
+ export interface Authenticator {
146
+ // Unique identifier for the authenticator.
147
+ id: string;
148
+ // Reference to the user who owns this authenticator.
149
+ userId: string;
150
+ // Unique credential ID for the authenticator.
151
+ credentialID: string;
152
+ // Public key associated with the authenticator.
153
+ publicKey: string;
154
+ // Counter for the number of authentication attempts.
155
+ counter: number;
156
+ // Relation to the User model.
157
+ user: User;
158
+ // Timestamp when the authenticator was created.
159
+ createdAt: Date;
160
+ // Timestamp when the authenticator was last updated.
161
+ updatedAt: Date;
162
+ }
163
+
164
+ export interface User {
165
+ // Unique identifier for the user.
166
+ id: string;
167
+ // The user's full name.
168
+ name?: string;
169
+ // The user's email address, must be unique.
170
+ email?: string;
171
+ // Timestamp when the user's email was verified.
172
+ emailVerified?: Date;
173
+ // URL to the user's profile image.
174
+ image?: string;
175
+ // Timestamp when the user account was created.
176
+ createdAt: Date;
177
+ // Timestamp when the user account was last updated.
178
+ updatedAt: Date;
179
+ // The role assigned to the user, determining permissions.
180
+ role: UserRole;
181
+ // A short biography or description of the user.
182
+ bio?: string;
183
+ // The user's job title or position.
184
+ jobTitle?: string;
185
+ // The type of Alpaca account the user currently holds.
186
+ currentAccount: AlpacaAccountType;
187
+ // Relation to the Customer model, if applicable.
188
+ customer?: Customer;
189
+ // Foreign key referencing the Customer.
190
+ customerId?: number;
191
+ // List of accounts associated with the user.
192
+ accounts: Account[];
193
+ // List of sessions associated with the user.
194
+ sessions: Session[];
195
+ // List of authenticators for the user.
196
+ authenticators: Authenticator[];
197
+ // The subscription plan the user is enrolled in.
198
+ plan?: SubscriptionPlan;
199
+ // List of Alpaca accounts linked to the user.
200
+ alpacaAccounts: AlpacaAccount[];
201
+ }
202
+
203
+ export enum OrderType {
204
+ MARKET = "MARKET",
205
+ LIMIT = "LIMIT",
206
+ STOP = "STOP",
207
+ STOP_LIMIT = "STOP_LIMIT"
208
+ }
209
+
210
+ export enum TradeAction {
211
+ BUY = "BUY",
212
+ GET_OPTION_CONTRACTS = "GET_OPTION_CONTRACTS",
213
+ EXERCISE_OPTION = "EXERCISE_OPTION",
214
+ SELL = "SELL",
215
+ CANCEL = "CANCEL",
216
+ ADJUST = "ADJUST",
217
+ HEDGE = "HEDGE"
218
+ }
219
+
220
+ export enum OrderStatus {
221
+ PENDING = "PENDING",
222
+ FILLED = "FILLED",
223
+ CANCELLED = "CANCELLED",
224
+ REJECTED = "REJECTED"
225
+ }
226
+
227
+ export enum AssetType {
228
+ STOCK = "STOCK",
229
+ ETF = "ETF",
230
+ MUTUAL_FUND = "MUTUAL_FUND",
231
+ CRYPTOCURRENCY = "CRYPTOCURRENCY",
232
+ INDEX = "INDEX",
233
+ COMMODITY = "COMMODITY",
234
+ CURRENCY = "CURRENCY",
235
+ OPTION = "OPTION",
236
+ FUTURE = "FUTURE",
237
+ BOND = "BOND",
238
+ WARRANT = "WARRANT",
239
+ ADR = "ADR",
240
+ GDR = "GDR",
241
+ UNIT = "UNIT",
242
+ RIGHT = "RIGHT",
243
+ REIT = "REIT",
244
+ STRUCTURED_PRODUCT = "STRUCTURED_PRODUCT",
245
+ SWAP = "SWAP",
246
+ SPOT = "SPOT",
247
+ FORWARD = "FORWARD",
248
+ OTHER = "OTHER"
249
+ }
250
+
251
+ // Simplified reference to Position.
252
+ export interface Position {
253
+ // Unique identifier for the position.
254
+ id: string;
255
+ }
256
+
257
+ // Simplified reference to NewsArticleAssetSentiment.
258
+ export interface NewsArticleAssetSentiment {
259
+ // Unique identifier for the sentiment record.
260
+ id: string;
261
+ }
262
+
263
+ export interface Asset {
264
+ // Unique identifier for the asset.
265
+ id: string;
266
+ // Ticker symbol of the asset, must be unique.
267
+ symbol: string;
268
+ // Full name of the asset, must be unique.
269
+ name: string;
270
+ // Type of the asset, defined by AssetType enum.
271
+ type: AssetType;
272
+ // URL to the asset's logo image.
273
+ logoUrl?: string;
274
+ // Description of the asset.
275
+ description?: string;
276
+ // Central Index Key for the asset.
277
+ cik?: string;
278
+ // Stock exchange where the asset is listed.
279
+ exchange?: string;
280
+ // Currency in which the asset is traded.
281
+ currency?: string;
282
+ // Country where the asset is based.
283
+ country?: string;
284
+ // Sector classification of the asset.
285
+ sector?: string;
286
+ // Industry classification of the asset.
287
+ industry?: string;
288
+ // Physical address associated with the asset.
289
+ address?: string;
290
+ // Official website of the asset.
291
+ officialSite?: string;
292
+ // Fiscal year-end date of the asset.
293
+ fiscalYearEnd?: string;
294
+ // Date of the latest financial quarter.
295
+ latestQuarter?: string;
296
+ // Market capitalization of the asset.
297
+ marketCapitalization?: string;
298
+ // Earnings Before Interest, Taxes, Depreciation, and Amortization.
299
+ ebitda?: string;
300
+ // Price-to-Earnings ratio.
301
+ peRatio?: string;
302
+ // Price/Earnings to Growth ratio.
303
+ pegRatio?: string;
304
+ // Book value per share.
305
+ bookValue?: string;
306
+ // Dividend per share.
307
+ dividendPerShare?: string;
308
+ // Dividend yield percentage.
309
+ dividendYield?: string;
310
+ // Earnings per share.
311
+ eps?: string;
312
+ // Revenue per share over the trailing twelve months.
313
+ revenuePerShareTTM?: string;
314
+ // Profit margin percentage.
315
+ profitMargin?: string;
316
+ // Operating margin over the trailing twelve months.
317
+ operatingMarginTTM?: string;
318
+ // Return on assets over the trailing twelve months.
319
+ returnOnAssetsTTM?: string;
320
+ // Return on equity over the trailing twelve months.
321
+ returnOnEquityTTM?: string;
322
+ // Total revenue over the trailing twelve months.
323
+ revenueTTM?: string;
324
+ // Gross profit over the trailing twelve months.
325
+ grossProfitTTM?: string;
326
+ // Diluted earnings per share over the trailing twelve months.
327
+ dilutedEPSTTM?: string;
328
+ // Year-over-year growth in quarterly earnings.
329
+ quarterlyEarningsGrowthYOY?: string;
330
+ // Year-over-year growth in quarterly revenue.
331
+ quarterlyRevenueGrowthYOY?: string;
332
+ // Analyst target price for the asset.
333
+ analystTargetPrice?: string;
334
+ // Percentage of analysts rating the asset as Strong Buy.
335
+ analystRatingStrongBuy?: string;
336
+ // Percentage of analysts rating the asset as Buy.
337
+ analystRatingBuy?: string;
338
+ // Percentage of analysts rating the asset as Hold.
339
+ analystRatingHold?: string;
340
+ // Percentage of analysts rating the asset as Sell.
341
+ analystRatingSell?: string;
342
+ // Percentage of analysts rating the asset as Strong Sell.
343
+ analystRatingStrongSell?: string;
344
+ // Trailing Price-to-Earnings ratio.
345
+ trailingPE?: string;
346
+ // Forward Price-to-Earnings ratio.
347
+ forwardPE?: string;
348
+ // Price-to-Sales ratio over the trailing twelve months.
349
+ priceToSalesRatioTTM?: string;
350
+ // Price-to-Book ratio.
351
+ priceToBookRatio?: string;
352
+ // Enterprise Value to Revenue ratio.
353
+ evToRevenue?: string;
354
+ // Enterprise Value to EBITDA ratio.
355
+ evToEbitda?: string;
356
+ // Beta coefficient measuring volatility.
357
+ beta?: string;
358
+ // 52-week high price of the asset.
359
+ week52High?: string;
360
+ // 52-week low price of the asset.
361
+ week52Low?: string;
362
+ // 50-day moving average price.
363
+ day50MovingAverage?: string;
364
+ // 200-day moving average price.
365
+ day200MovingAverage?: string;
366
+ // Total number of shares outstanding.
367
+ sharesOutstanding?: string;
368
+ // Date when the next dividend is paid.
369
+ dividendDate?: string;
370
+ // Date when the asset goes ex-dividend.
371
+ exDividendDate?: string;
372
+ // Timestamp when the asset was created in the database.
373
+ createdAt: Date;
374
+ // Timestamp when the asset was last updated in the database.
375
+ updatedAt: Date;
376
+ // List of trades involving this asset.
377
+ trades: Trade[];
378
+ // List of orders involving this asset.
379
+ orders: Order[];
380
+ // List of positions involving this asset.
381
+ positions: Position[];
382
+ // List of news article sentiments related to this asset.
383
+ newsMentions: NewsArticleAssetSentiment[];
384
+ }
385
+
386
+ export interface Order {
387
+ // Unique identifier for the order.
388
+ id: string;
389
+ // Reference to the Alpaca account used for the order.
390
+ alpacaAccountId: string;
391
+ // Reference to the asset being ordered.
392
+ assetId: string;
393
+ // Type of order, defined by OrderType enum.
394
+ type: OrderType;
395
+ // Action of the order, defined by TradeAction enum.
396
+ action: TradeAction;
397
+ // Quantity of the asset to be ordered.
398
+ qty: number;
399
+ // Price at which the asset is to be bought or sold.
400
+ price: number;
401
+ // Current status of the order, defined by OrderStatus enum.
402
+ status: OrderStatus;
403
+ // Timestamp when the order was created.
404
+ createdAt: Date;
405
+ // Timestamp when the order was last updated.
406
+ updatedAt: Date;
407
+ // Relation to the AlpacaAccount model.
408
+ alpacaAccount: AlpacaAccount;
409
+ // Relation to the Asset model.
410
+ asset: Asset;
411
+ }
412
+
413
+ export enum AlertType {
414
+ SUCCESS = "SUCCESS",
415
+ WARNING = "WARNING",
416
+ ERROR = "ERROR",
417
+ INFO = "INFO"
418
+ }
419
+
420
+ export interface Alert {
421
+ // Unique identifier for the alert.
422
+ id: string;
423
+ // Reference to the Alpaca account associated with the alert.
424
+ alpacaAccountId: string;
425
+ // Message content of the alert.
426
+ message: string;
427
+ // Type of the alert, defined by AlertType enum.
428
+ type: AlertType;
429
+ // Indicates whether the alert has been read by the user.
430
+ isRead: boolean;
431
+ // Timestamp when the alert was created.
432
+ createdAt: Date;
433
+ // Timestamp when the alert was last updated.
434
+ updatedAt: Date;
435
+ // Relation to the AlpacaAccount model.
436
+ alpacaAccount: AlpacaAccount;
437
+ }
438
+
439
+ export interface AlpacaAccount {
440
+ // Unique identifier for the Alpaca account.
441
+ id: string;
442
+ // The type of Alpaca account (PAPER or LIVE).
443
+ type: AlpacaAccountType;
444
+ // API key for authenticating requests to Alpaca.
445
+ APIKey: string;
446
+ // API secret for authenticating requests to Alpaca.
447
+ APISecret: string;
448
+ // JSON configuration settings for the Alpaca account.
449
+ configuration?: any;
450
+ // Indicates whether the market is currently open for trading.
451
+ marketOpen: boolean;
452
+ // Relation to the User model who owns this Alpaca account.
453
+ user: User;
454
+ // Foreign key referencing the User.
455
+ userId: string;
456
+ // Timestamp when the Alpaca account was created.
457
+ createdAt: Date;
458
+ // Timestamp when the Alpaca account was last updated.
459
+ updatedAt: Date;
460
+ // List of trades executed through this Alpaca account.
461
+ trades: Trade[];
462
+ // List of orders placed through this Alpaca account.
463
+ orders: Order[];
464
+ // List of positions held in this Alpaca account.
465
+ positions: Position[];
466
+ // List of alerts generated for this Alpaca account.
467
+ alerts: Alert[];
468
+ }
469
+
470
+ export enum TradeActionSide {
471
+ BUY = "BUY",
472
+ SELL = "SELL"
473
+ }
474
+
475
+ export enum TradeActionStatus {
476
+ STAGED = "STAGED",
477
+ EXECUTED = "EXECUTED",
478
+ COMPLETED = "COMPLETED"
479
+ }
480
+
481
+ export interface Action {
482
+ // Unique identifier for the action.
483
+ id: string;
484
+ // Reference to the trade this action is part of.
485
+ tradeId: string;
486
+ // Sequence number of the action within the trade.
487
+ sequence: number;
488
+ // Type of trade action, defined by TradeAction enum.
489
+ action: TradeAction;
490
+ // Type of hedge applied, if any.
491
+ hedgeType?: string;
492
+ // Price at which the hedge was executed.
493
+ hedgePrice?: number;
494
+ // Price at which the asset was bought.
495
+ buyPrice?: number;
496
+ // Price at which the asset was sold.
497
+ sellPrice?: number;
498
+ // Quantity of the asset involved in the action.
499
+ qty: number;
500
+ // Side of the trade action (BUY or SELL).
501
+ side: TradeActionSide;
502
+ // Type of order used in the action, defined by OrderType enum.
503
+ type: OrderType;
504
+ // Stop-loss price set for the action.
505
+ stopLoss?: number;
506
+ // Target price set for the action.
507
+ targetPrice?: number;
508
+ // Additional notes or comments about the action.
509
+ note: string;
510
+ // Timestamp when the action was executed.
511
+ executionTime?: Date;
512
+ // Current status of the trade action.
513
+ status: TradeActionStatus;
514
+ // Fees associated with the action.
515
+ fee?: number;
516
+ // Relation to the Trade model.
517
+ trade: Trade;
518
+ }
519
+
520
+ `;
521
+ //# sourceMappingURL=Trade.js.map
@@ -0,0 +1,2 @@
1
+ export declare const TradeTypeString = "\nYour response should adhere to the following type definition for the \"Trade\" type, and its nested object types (which include 'AlpacaAccount', 'Asset', 'Action' types), as well as any ENUMS used by it (which include 'TradeStatus' enum).\n\nImportantly, DO NOT include any annotations in your response (i.e. remove the ones we have provided for your reference below).\n\nexport interface Trade {\n // Unique identifier for the trade.\n id: string;\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 // Timestamp when the trade record was created.\n createdAt: Date;\n // Timestamp when the trade record was last updated.\n updatedAt: 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 // List of actions associated with this trade.\n actions: Action[];\n}\n\nexport enum TradeStatus {\n PENDING = \"PENDING\",\n OPEN = \"OPEN\",\n PARTIAL = \"PARTIAL\",\n COMPLETED = \"COMPLETED\"\n}\n\nexport enum AlpacaAccountType {\n PAPER = \"PAPER\",\n LIVE = \"LIVE\"\n}\n\nexport enum UserRole {\n OWNER = \"OWNER\",\n ADMIN = \"ADMIN\",\n USER = \"USER\"\n}\n\nexport enum SubscriptionPlan {\n FREE = \"FREE\",\n PRO = \"PRO\",\n BUSINESS = \"BUSINESS\"\n}\n\nexport interface Customer {\n // Unique identifier for the customer.\n id: number;\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 // Timestamp when the customer was created.\n createdAt: Date;\n // Timestamp when the customer was last updated.\n updatedAt: Date;\n // List of users associated with the customer.\n users: User[];\n}\n\nexport interface Account {\n // Unique identifier for the account.\n id: string;\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 // Timestamp when the account was created.\n createdAt: Date;\n // Timestamp when the account was last updated.\n updatedAt: Date;\n // Relation to the User model.\n user: User;\n}\n\nexport interface Session {\n // Unique identifier for the session.\n id: string;\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 // Timestamp when the session was created.\n createdAt: Date;\n // Timestamp when the session was last updated.\n updatedAt: Date;\n}\n\nexport interface Authenticator {\n // Unique identifier for the authenticator.\n id: string;\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 // Timestamp when the authenticator was created.\n createdAt: Date;\n // Timestamp when the authenticator was last updated.\n updatedAt: Date;\n}\n\nexport interface User {\n // Unique identifier for the user.\n id: string;\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 // Timestamp when the user account was created.\n createdAt: Date;\n // Timestamp when the user account was last updated.\n updatedAt: Date;\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\nexport enum OrderType {\n MARKET = \"MARKET\",\n LIMIT = \"LIMIT\",\n STOP = \"STOP\",\n STOP_LIMIT = \"STOP_LIMIT\"\n}\n\nexport enum TradeAction {\n BUY = \"BUY\",\n GET_OPTION_CONTRACTS = \"GET_OPTION_CONTRACTS\",\n EXERCISE_OPTION = \"EXERCISE_OPTION\",\n SELL = \"SELL\",\n CANCEL = \"CANCEL\",\n ADJUST = \"ADJUST\",\n HEDGE = \"HEDGE\"\n}\n\nexport enum OrderStatus {\n PENDING = \"PENDING\",\n FILLED = \"FILLED\",\n CANCELLED = \"CANCELLED\",\n REJECTED = \"REJECTED\"\n}\n\nexport enum AssetType {\n STOCK = \"STOCK\",\n ETF = \"ETF\",\n MUTUAL_FUND = \"MUTUAL_FUND\",\n CRYPTOCURRENCY = \"CRYPTOCURRENCY\",\n INDEX = \"INDEX\",\n COMMODITY = \"COMMODITY\",\n CURRENCY = \"CURRENCY\",\n OPTION = \"OPTION\",\n FUTURE = \"FUTURE\",\n BOND = \"BOND\",\n WARRANT = \"WARRANT\",\n ADR = \"ADR\",\n GDR = \"GDR\",\n UNIT = \"UNIT\",\n RIGHT = \"RIGHT\",\n REIT = \"REIT\",\n STRUCTURED_PRODUCT = \"STRUCTURED_PRODUCT\",\n SWAP = \"SWAP\",\n SPOT = \"SPOT\",\n FORWARD = \"FORWARD\",\n OTHER = \"OTHER\"\n}\n\n// Simplified reference to Position.\nexport interface Position {\n// Unique identifier for the position.\n id: string;\n}\n\n// Simplified reference to NewsArticleAssetSentiment.\nexport interface NewsArticleAssetSentiment {\n// Unique identifier for the sentiment record.\n id: string;\n}\n\nexport interface Asset {\n // Unique identifier for the asset.\n id: string;\n // Ticker symbol of the asset, must be unique.\n symbol: string;\n // Full name of the asset, must be unique.\n name: string;\n // Type of the asset, defined by AssetType enum.\n type: AssetType;\n // URL to the asset's logo image.\n logoUrl?: string;\n // Description of the asset.\n description?: string;\n // Central Index Key for the asset.\n cik?: string;\n // Stock exchange where the asset is listed.\n exchange?: string;\n // Currency in which the asset is traded.\n currency?: string;\n // Country where the asset is based.\n country?: string;\n // Sector classification of the asset.\n sector?: string;\n // Industry classification of the asset.\n industry?: string;\n // Physical address associated with the asset.\n address?: string;\n // Official website of the asset.\n officialSite?: string;\n // Fiscal year-end date of the asset.\n fiscalYearEnd?: string;\n // Date of the latest financial quarter.\n latestQuarter?: string;\n // Market capitalization of the asset.\n marketCapitalization?: string;\n // Earnings Before Interest, Taxes, Depreciation, and Amortization.\n ebitda?: string;\n // Price-to-Earnings ratio.\n peRatio?: string;\n // Price/Earnings to Growth ratio.\n pegRatio?: string;\n // Book value per share.\n bookValue?: string;\n // Dividend per share.\n dividendPerShare?: string;\n // Dividend yield percentage.\n dividendYield?: string;\n // Earnings per share.\n eps?: string;\n // Revenue per share over the trailing twelve months.\n revenuePerShareTTM?: string;\n // Profit margin percentage.\n profitMargin?: string;\n // Operating margin over the trailing twelve months.\n operatingMarginTTM?: string;\n // Return on assets over the trailing twelve months.\n returnOnAssetsTTM?: string;\n // Return on equity over the trailing twelve months.\n returnOnEquityTTM?: string;\n // Total revenue over the trailing twelve months.\n revenueTTM?: string;\n // Gross profit over the trailing twelve months.\n grossProfitTTM?: string;\n // Diluted earnings per share over the trailing twelve months.\n dilutedEPSTTM?: string;\n // Year-over-year growth in quarterly earnings.\n quarterlyEarningsGrowthYOY?: string;\n // Year-over-year growth in quarterly revenue.\n quarterlyRevenueGrowthYOY?: string;\n // Analyst target price for the asset.\n analystTargetPrice?: string;\n // Percentage of analysts rating the asset as Strong Buy.\n analystRatingStrongBuy?: string;\n // Percentage of analysts rating the asset as Buy.\n analystRatingBuy?: string;\n // Percentage of analysts rating the asset as Hold.\n analystRatingHold?: string;\n // Percentage of analysts rating the asset as Sell.\n analystRatingSell?: string;\n // Percentage of analysts rating the asset as Strong Sell.\n analystRatingStrongSell?: string;\n // Trailing Price-to-Earnings ratio.\n trailingPE?: string;\n // Forward Price-to-Earnings ratio.\n forwardPE?: string;\n // Price-to-Sales ratio over the trailing twelve months.\n priceToSalesRatioTTM?: string;\n // Price-to-Book ratio.\n priceToBookRatio?: string;\n // Enterprise Value to Revenue ratio.\n evToRevenue?: string;\n // Enterprise Value to EBITDA ratio.\n evToEbitda?: string;\n // Beta coefficient measuring volatility.\n beta?: string;\n // 52-week high price of the asset.\n week52High?: string;\n // 52-week low price of the asset.\n week52Low?: string;\n // 50-day moving average price.\n day50MovingAverage?: string;\n // 200-day moving average price.\n day200MovingAverage?: string;\n // Total number of shares outstanding.\n sharesOutstanding?: string;\n // Date when the next dividend is paid.\n dividendDate?: string;\n // Date when the asset goes ex-dividend.\n exDividendDate?: string;\n // Timestamp when the asset was created in the database.\n createdAt: Date;\n // Timestamp when the asset was last updated in the database.\n updatedAt: Date;\n // List of trades involving this asset.\n trades: Trade[];\n // List of orders involving this asset.\n orders: Order[];\n // List of positions involving this asset.\n positions: Position[];\n // List of news article sentiments related to this asset.\n newsMentions: NewsArticleAssetSentiment[];\n}\n\nexport interface Order {\n // Unique identifier for the order.\n id: string;\n // Reference to the Alpaca account used for the order.\n alpacaAccountId: string;\n // Reference to the asset being ordered.\n assetId: string;\n // Type of order, defined by OrderType enum.\n type: OrderType;\n // Action of the order, defined by TradeAction enum.\n action: TradeAction;\n // Quantity of the asset to be ordered.\n qty: number;\n // Price at which the asset is to be bought or sold.\n price: number;\n // Current status of the order, defined by OrderStatus enum.\n status: OrderStatus;\n // Timestamp when the order was created.\n createdAt: Date;\n // Timestamp when the order was last updated.\n updatedAt: Date;\n // Relation to the AlpacaAccount model.\n alpacaAccount: AlpacaAccount;\n // Relation to the Asset model.\n asset: Asset;\n}\n\nexport enum AlertType {\n SUCCESS = \"SUCCESS\",\n WARNING = \"WARNING\",\n ERROR = \"ERROR\",\n INFO = \"INFO\"\n}\n\nexport interface Alert {\n // Unique identifier for the alert.\n id: string;\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 // Timestamp when the alert was created.\n createdAt: Date;\n // Timestamp when the alert was last updated.\n updatedAt: Date;\n // Relation to the AlpacaAccount model.\n alpacaAccount: AlpacaAccount;\n}\n\nexport interface AlpacaAccount {\n // Unique identifier for the Alpaca account.\n id: string;\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 // Timestamp when the Alpaca account was created.\n createdAt: Date;\n // Timestamp when the Alpaca account was last updated.\n updatedAt: Date;\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 enum TradeActionSide {\n BUY = \"BUY\",\n SELL = \"SELL\"\n}\n\nexport enum TradeActionStatus {\n STAGED = \"STAGED\",\n EXECUTED = \"EXECUTED\",\n COMPLETED = \"COMPLETED\"\n}\n\nexport interface Action {\n // Unique identifier for the action.\n id: string;\n // Reference to the trade this action is part of.\n tradeId: string;\n // Sequence number of the action within the trade.\n sequence: number;\n // Type of trade action, defined by TradeAction enum.\n action: TradeAction;\n // Type of hedge applied, if any.\n hedgeType?: string;\n // Price at which the hedge was executed.\n hedgePrice?: number;\n // Price at which the asset was bought.\n buyPrice?: number;\n // Price at which the asset was sold.\n sellPrice?: number;\n // Quantity of the asset involved in the action.\n qty: number;\n // Side of the trade action (BUY or SELL).\n side: TradeActionSide;\n // Type of order used in the action, defined by OrderType enum.\n type: OrderType;\n // Stop-loss price set for the action.\n stopLoss?: number;\n // Target price set for the action.\n targetPrice?: number;\n // Additional notes or comments about the action.\n note: string;\n // Timestamp when the action was executed.\n executionTime?: Date;\n // Current status of the trade action.\n status: TradeActionStatus;\n // Fees associated with the action.\n fee?: number;\n // Relation to the Trade model.\n trade: Trade;\n}\n\n";
2
+ //# sourceMappingURL=Trade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Trade.d.ts","sourceRoot":"","sources":["../../../src/generated/typeStrings/Trade.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,mufAogB3B,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Trade.js","sourceRoot":"","sources":["../../../src/generated/typeStrings/Trade.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAogB9B,CAAC"}