adaptic-backend 1.0.68 → 1.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/generated/typeStrings/Account.cjs +10 -78
- package/generated/typeStrings/Account.d.ts +1 -1
- package/generated/typeStrings/Account.d.ts.map +1 -1
- package/generated/typeStrings/Account.js.map +1 -1
- package/generated/typeStrings/Action.cjs +7 -71
- package/generated/typeStrings/Action.d.ts +1 -1
- package/generated/typeStrings/Action.d.ts.map +1 -1
- package/generated/typeStrings/Action.js.map +1 -1
- package/generated/typeStrings/Alert.cjs +10 -84
- package/generated/typeStrings/Alert.d.ts +1 -1
- package/generated/typeStrings/Alert.d.ts.map +1 -1
- package/generated/typeStrings/Alert.js.map +1 -1
- package/generated/typeStrings/AlpacaAccount.cjs +12 -88
- package/generated/typeStrings/AlpacaAccount.d.ts +1 -1
- package/generated/typeStrings/AlpacaAccount.d.ts.map +1 -1
- package/generated/typeStrings/AlpacaAccount.js.map +1 -1
- package/generated/typeStrings/Asset.cjs +9 -85
- package/generated/typeStrings/Asset.d.ts +1 -1
- package/generated/typeStrings/Asset.d.ts.map +1 -1
- package/generated/typeStrings/Asset.js.map +1 -1
- package/generated/typeStrings/Authenticator.cjs +10 -78
- package/generated/typeStrings/Authenticator.d.ts +1 -1
- package/generated/typeStrings/Authenticator.d.ts.map +1 -1
- package/generated/typeStrings/Authenticator.js.map +1 -1
- package/generated/typeStrings/Customer.cjs +10 -78
- package/generated/typeStrings/Customer.d.ts +1 -1
- package/generated/typeStrings/Customer.d.ts.map +1 -1
- package/generated/typeStrings/Customer.js.map +1 -1
- package/generated/typeStrings/EconomicEvent.cjs +1 -7
- package/generated/typeStrings/EconomicEvent.d.ts +1 -1
- package/generated/typeStrings/EconomicEvent.d.ts.map +1 -1
- package/generated/typeStrings/EconomicEvent.js.map +1 -1
- package/generated/typeStrings/NewsArticle.cjs +6 -46
- package/generated/typeStrings/NewsArticle.d.ts +1 -1
- package/generated/typeStrings/NewsArticle.d.ts.map +1 -1
- package/generated/typeStrings/NewsArticle.js.map +1 -1
- package/generated/typeStrings/NewsArticleAssetSentiment.cjs +6 -58
- package/generated/typeStrings/NewsArticleAssetSentiment.d.ts +1 -1
- package/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -1
- package/generated/typeStrings/Order.cjs +11 -85
- package/generated/typeStrings/Order.d.ts +1 -1
- package/generated/typeStrings/Order.d.ts.map +1 -1
- package/generated/typeStrings/Order.js.map +1 -1
- package/generated/typeStrings/Position.cjs +7 -55
- package/generated/typeStrings/Position.d.ts +1 -1
- package/generated/typeStrings/Position.d.ts.map +1 -1
- package/generated/typeStrings/Position.js.map +1 -1
- package/generated/typeStrings/Session.cjs +10 -78
- package/generated/typeStrings/Session.d.ts +1 -1
- package/generated/typeStrings/Session.d.ts.map +1 -1
- package/generated/typeStrings/Session.js.map +1 -1
- package/generated/typeStrings/Trade.cjs +11 -85
- package/generated/typeStrings/Trade.d.ts +1 -1
- package/generated/typeStrings/Trade.d.ts.map +1 -1
- package/generated/typeStrings/Trade.js.map +1 -1
- package/generated/typeStrings/User.cjs +10 -84
- package/generated/typeStrings/User.d.ts +1 -1
- package/generated/typeStrings/User.d.ts.map +1 -1
- package/generated/typeStrings/User.js.map +1 -1
- package/generated/typeStrings/VerificationToken.cjs +1 -3
- package/generated/typeStrings/VerificationToken.d.ts +1 -1
- package/generated/typeStrings/VerificationToken.d.ts.map +1 -1
- package/generated/typeStrings/VerificationToken.js.map +1 -1
- package/generated/typeStrings/index.d.ts +16 -16
- package/generated/typeStrings/index.d.ts.map +1 -1
- package/generated/typeStrings/index.js.map +1 -1
- package/package.json +1 -1
- package/server/generated/typeStrings/Account.d.ts +1 -1
- package/server/generated/typeStrings/Account.d.ts.map +1 -1
- package/server/generated/typeStrings/Account.js.map +1 -1
- package/server/generated/typeStrings/Account.mjs +10 -78
- package/server/generated/typeStrings/Action.d.ts +1 -1
- package/server/generated/typeStrings/Action.d.ts.map +1 -1
- package/server/generated/typeStrings/Action.js.map +1 -1
- package/server/generated/typeStrings/Action.mjs +7 -71
- package/server/generated/typeStrings/Alert.d.ts +1 -1
- package/server/generated/typeStrings/Alert.d.ts.map +1 -1
- package/server/generated/typeStrings/Alert.js.map +1 -1
- package/server/generated/typeStrings/Alert.mjs +10 -84
- package/server/generated/typeStrings/AlpacaAccount.d.ts +1 -1
- package/server/generated/typeStrings/AlpacaAccount.d.ts.map +1 -1
- package/server/generated/typeStrings/AlpacaAccount.js.map +1 -1
- package/server/generated/typeStrings/AlpacaAccount.mjs +12 -88
- package/server/generated/typeStrings/Asset.d.ts +1 -1
- package/server/generated/typeStrings/Asset.d.ts.map +1 -1
- package/server/generated/typeStrings/Asset.js.map +1 -1
- package/server/generated/typeStrings/Asset.mjs +9 -85
- package/server/generated/typeStrings/Authenticator.d.ts +1 -1
- package/server/generated/typeStrings/Authenticator.d.ts.map +1 -1
- package/server/generated/typeStrings/Authenticator.js.map +1 -1
- package/server/generated/typeStrings/Authenticator.mjs +10 -78
- package/server/generated/typeStrings/Customer.d.ts +1 -1
- package/server/generated/typeStrings/Customer.d.ts.map +1 -1
- package/server/generated/typeStrings/Customer.js.map +1 -1
- package/server/generated/typeStrings/Customer.mjs +10 -78
- package/server/generated/typeStrings/EconomicEvent.d.ts +1 -1
- package/server/generated/typeStrings/EconomicEvent.d.ts.map +1 -1
- package/server/generated/typeStrings/EconomicEvent.js.map +1 -1
- package/server/generated/typeStrings/EconomicEvent.mjs +1 -7
- package/server/generated/typeStrings/NewsArticle.d.ts +1 -1
- package/server/generated/typeStrings/NewsArticle.d.ts.map +1 -1
- package/server/generated/typeStrings/NewsArticle.js.map +1 -1
- package/server/generated/typeStrings/NewsArticle.mjs +6 -46
- package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts +1 -1
- package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -1
- package/server/generated/typeStrings/NewsArticleAssetSentiment.mjs +6 -58
- package/server/generated/typeStrings/Order.d.ts +1 -1
- package/server/generated/typeStrings/Order.d.ts.map +1 -1
- package/server/generated/typeStrings/Order.js.map +1 -1
- package/server/generated/typeStrings/Order.mjs +11 -85
- package/server/generated/typeStrings/Position.d.ts +1 -1
- package/server/generated/typeStrings/Position.d.ts.map +1 -1
- package/server/generated/typeStrings/Position.js.map +1 -1
- package/server/generated/typeStrings/Position.mjs +7 -55
- package/server/generated/typeStrings/Session.d.ts +1 -1
- package/server/generated/typeStrings/Session.d.ts.map +1 -1
- package/server/generated/typeStrings/Session.js.map +1 -1
- package/server/generated/typeStrings/Session.mjs +10 -78
- package/server/generated/typeStrings/Trade.d.ts +1 -1
- package/server/generated/typeStrings/Trade.d.ts.map +1 -1
- package/server/generated/typeStrings/Trade.js.map +1 -1
- package/server/generated/typeStrings/Trade.mjs +11 -85
- package/server/generated/typeStrings/User.d.ts +1 -1
- package/server/generated/typeStrings/User.d.ts.map +1 -1
- package/server/generated/typeStrings/User.js.map +1 -1
- package/server/generated/typeStrings/User.mjs +10 -84
- package/server/generated/typeStrings/VerificationToken.d.ts +1 -1
- package/server/generated/typeStrings/VerificationToken.d.ts.map +1 -1
- package/server/generated/typeStrings/VerificationToken.js.map +1 -1
- package/server/generated/typeStrings/VerificationToken.mjs +1 -3
- package/server/generated/typeStrings/index.d.ts +16 -16
- package/server/generated/typeStrings/index.d.ts.map +1 -1
- package/server/generated/typeStrings/index.js.map +1 -1
package/README.md
CHANGED
@@ -160,7 +160,7 @@ Types associated with your data models are available under the `types` namespace
|
|
160
160
|
|
161
161
|
```typescript
|
162
162
|
// types-example.ts
|
163
|
-
import { types } from 'adaptic-backend';
|
163
|
+
import { types } from 'adaptic-backend';
|
164
164
|
|
165
165
|
// Define a new user
|
166
166
|
const newUser: types.UserCreateInput = {
|
@@ -6,9 +6,7 @@ Your response should adhere to the following type definition for the "Account" t
|
|
6
6
|
|
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
|
-
export
|
10
|
-
// Unique identifier for the account.
|
11
|
-
id: string;
|
9
|
+
export type Account = {
|
12
10
|
// Reference to the user who owns this account.
|
13
11
|
userId: string;
|
14
12
|
// Type of the account (e.g., OAuth provider).
|
@@ -31,10 +29,6 @@ export interface Account {
|
|
31
29
|
id_token?: string;
|
32
30
|
// State of the session associated with the account.
|
33
31
|
session_state?: string;
|
34
|
-
// Timestamp when the account was created.
|
35
|
-
createdAt: Date;
|
36
|
-
// Timestamp when the account was last updated.
|
37
|
-
updatedAt: Date;
|
38
32
|
// Relation to the User model.
|
39
33
|
user: User;
|
40
34
|
}
|
@@ -56,9 +50,7 @@ export enum SubscriptionPlan {
|
|
56
50
|
BUSINESS = "BUSINESS"
|
57
51
|
}
|
58
52
|
|
59
|
-
export
|
60
|
-
// Unique identifier for the customer.
|
61
|
-
id: number;
|
53
|
+
export type Customer = {
|
62
54
|
// Reference to the authenticated user associated with the customer.
|
63
55
|
authUserId: string;
|
64
56
|
// Name of the customer.
|
@@ -73,17 +65,11 @@ export interface Customer {
|
|
73
65
|
stripePriceId?: string;
|
74
66
|
// End date of the current billing period in Stripe.
|
75
67
|
stripeCurrentPeriodEnd?: Date;
|
76
|
-
// Timestamp when the customer was created.
|
77
|
-
createdAt: Date;
|
78
|
-
// Timestamp when the customer was last updated.
|
79
|
-
updatedAt: Date;
|
80
68
|
// List of users associated with the customer.
|
81
69
|
users: User[];
|
82
70
|
}
|
83
71
|
|
84
|
-
export
|
85
|
-
// Unique identifier for the session.
|
86
|
-
id: string;
|
72
|
+
export type Session = {
|
87
73
|
// Token associated with the session for authentication.
|
88
74
|
sessionToken: string;
|
89
75
|
// Reference to the user who owns this session.
|
@@ -92,15 +78,9 @@ export interface Session {
|
|
92
78
|
expires: Date;
|
93
79
|
// Relation to the User model.
|
94
80
|
user: User;
|
95
|
-
// Timestamp when the session was created.
|
96
|
-
createdAt: Date;
|
97
|
-
// Timestamp when the session was last updated.
|
98
|
-
updatedAt: Date;
|
99
81
|
}
|
100
82
|
|
101
|
-
export
|
102
|
-
// Unique identifier for the authenticator.
|
103
|
-
id: string;
|
83
|
+
export type Authenticator = {
|
104
84
|
// Reference to the user who owns this authenticator.
|
105
85
|
userId: string;
|
106
86
|
// Unique credential ID for the authenticator.
|
@@ -111,10 +91,6 @@ export interface Authenticator {
|
|
111
91
|
counter: number;
|
112
92
|
// Relation to the User model.
|
113
93
|
user: User;
|
114
|
-
// Timestamp when the authenticator was created.
|
115
|
-
createdAt: Date;
|
116
|
-
// Timestamp when the authenticator was last updated.
|
117
|
-
updatedAt: Date;
|
118
94
|
}
|
119
95
|
|
120
96
|
export enum TradeStatus {
|
@@ -124,26 +100,12 @@ export enum TradeStatus {
|
|
124
100
|
COMPLETED = "COMPLETED"
|
125
101
|
}
|
126
102
|
|
127
|
-
// Simplified reference to Asset.
|
128
|
-
export interface Asset {
|
129
|
-
// Unique identifier for the asset.
|
130
|
-
id: string;
|
131
|
-
}
|
132
|
-
|
133
103
|
export enum OptionContractType {
|
134
104
|
CALL = "CALL",
|
135
105
|
PUT = "PUT"
|
136
106
|
}
|
137
107
|
|
138
|
-
|
139
|
-
export interface Action {
|
140
|
-
// Unique identifier for the action.
|
141
|
-
id: string;
|
142
|
-
}
|
143
|
-
|
144
|
-
export interface Trade {
|
145
|
-
// Unique identifier for the trade.
|
146
|
-
id: string;
|
108
|
+
export type Trade = {
|
147
109
|
// Reference to the Alpaca account used for the trade.
|
148
110
|
alpacaAccountId: string;
|
149
111
|
// Reference to the asset being traded.
|
@@ -164,10 +126,6 @@ export interface Trade {
|
|
164
126
|
confidence: number;
|
165
127
|
// Timestamp when the trade was executed.
|
166
128
|
timestamp: Date;
|
167
|
-
// Timestamp when the trade record was created.
|
168
|
-
createdAt: Date;
|
169
|
-
// Timestamp when the trade record was last updated.
|
170
|
-
updatedAt: Date;
|
171
129
|
// Current status of the trade.
|
172
130
|
status: TradeStatus;
|
173
131
|
// Relation to the AlpacaAccount model.
|
@@ -199,9 +157,7 @@ export enum OrderStatus {
|
|
199
157
|
REJECTED = "REJECTED"
|
200
158
|
}
|
201
159
|
|
202
|
-
export
|
203
|
-
// Unique identifier for the order.
|
204
|
-
id: string;
|
160
|
+
export type Order = {
|
205
161
|
// Reference to the Alpaca account used for the order.
|
206
162
|
alpacaAccountId: string;
|
207
163
|
// Reference to the asset being ordered.
|
@@ -219,10 +175,6 @@ export interface Order {
|
|
219
175
|
stopLoss?: number;
|
220
176
|
// Current status of the order, defined by OrderStatus enum.
|
221
177
|
status: OrderStatus;
|
222
|
-
// Timestamp when the order was created.
|
223
|
-
createdAt: Date;
|
224
|
-
// Timestamp when the order was last updated.
|
225
|
-
updatedAt: Date;
|
226
178
|
// Timestamp when the action was executed.
|
227
179
|
executionTime?: Date;
|
228
180
|
// The Alpaca account this order is associated with.
|
@@ -235,9 +187,7 @@ export interface Order {
|
|
235
187
|
fee?: number;
|
236
188
|
}
|
237
189
|
|
238
|
-
export
|
239
|
-
// Unique identifier for the position.
|
240
|
-
id: string;
|
190
|
+
export type Position = {
|
241
191
|
// Reference to the associated asset.
|
242
192
|
assetId: string;
|
243
193
|
// Relation to the Asset model.
|
@@ -281,9 +231,7 @@ export enum AlertType {
|
|
281
231
|
INFO = "INFO"
|
282
232
|
}
|
283
233
|
|
284
|
-
export
|
285
|
-
// Unique identifier for the alert.
|
286
|
-
id: string;
|
234
|
+
export type Alert = {
|
287
235
|
// Reference to the Alpaca account associated with the alert.
|
288
236
|
alpacaAccountId: string;
|
289
237
|
// Message content of the alert.
|
@@ -292,17 +240,11 @@ export interface Alert {
|
|
292
240
|
type: AlertType;
|
293
241
|
// Indicates whether the alert has been read by the user.
|
294
242
|
isRead: boolean;
|
295
|
-
// Timestamp when the alert was created.
|
296
|
-
createdAt: Date;
|
297
|
-
// Timestamp when the alert was last updated.
|
298
|
-
updatedAt: Date;
|
299
243
|
// Relation to the AlpacaAccount model.
|
300
244
|
alpacaAccount: AlpacaAccount;
|
301
245
|
}
|
302
246
|
|
303
|
-
export
|
304
|
-
// Unique identifier for the Alpaca account.
|
305
|
-
id: string;
|
247
|
+
export type AlpacaAccount = {
|
306
248
|
// The type of Alpaca account (PAPER or LIVE).
|
307
249
|
type: AlpacaAccountType;
|
308
250
|
// API key for authenticating requests to Alpaca.
|
@@ -317,10 +259,6 @@ export interface AlpacaAccount {
|
|
317
259
|
user: User;
|
318
260
|
// Foreign key referencing the User.
|
319
261
|
userId: string;
|
320
|
-
// Timestamp when the Alpaca account was created.
|
321
|
-
createdAt: Date;
|
322
|
-
// Timestamp when the Alpaca account was last updated.
|
323
|
-
updatedAt: Date;
|
324
262
|
// List of trades executed through this Alpaca account.
|
325
263
|
trades: Trade[];
|
326
264
|
// List of orders placed through this Alpaca account.
|
@@ -331,9 +269,7 @@ export interface AlpacaAccount {
|
|
331
269
|
alerts: Alert[];
|
332
270
|
}
|
333
271
|
|
334
|
-
export
|
335
|
-
// Unique identifier for the user.
|
336
|
-
id: string;
|
272
|
+
export type User = {
|
337
273
|
// The user's full name.
|
338
274
|
name?: string;
|
339
275
|
// The user's email address, must be unique.
|
@@ -342,10 +278,6 @@ export interface User {
|
|
342
278
|
emailVerified?: Date;
|
343
279
|
// URL to the user's profile image.
|
344
280
|
image?: string;
|
345
|
-
// Timestamp when the user account was created.
|
346
|
-
createdAt: Date;
|
347
|
-
// Timestamp when the user account was last updated.
|
348
|
-
updatedAt: Date;
|
349
281
|
// The role assigned to the user, determining permissions.
|
350
282
|
role: UserRole;
|
351
283
|
// A short biography or description of 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 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 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 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 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 enum TradeStatus {\n PENDING = \"PENDING\",\n OPEN = \"OPEN\",\n PARTIAL = \"PARTIAL\",\n COMPLETED = \"COMPLETED\"\n}\n\n// Simplified reference to Asset.\nexport interface Asset {\n// Unique identifier for the asset.\n id: string;\n}\n\nexport enum OptionContractType {\n CALL = \"CALL\",\n PUT = \"PUT\"\n}\n\n// Simplified reference to Action.\nexport interface Action {\n// Unique identifier for the action.\n id: string;\n}\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 // 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 OrderType {\n MARKET = \"MARKET\",\n LIMIT = \"LIMIT\",\n STOP = \"STOP\",\n STOP_LIMIT = \"STOP_LIMIT\"\n}\n\nexport enum OrderSide {\n BUY = \"BUY\",\n SELL = \"SELL\"\n}\n\nexport enum OrderStatus {\n PENDING = \"PENDING\",\n FILLED = \"FILLED\",\n CANCELLED = \"CANCELLED\",\n REJECTED = \"REJECTED\"\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 // Reference to the action associated with the order.\n actionId: string;\n // Type of order, defined by OrderType enum.\n type: OrderType;\n // Side of the order (BUY or SELL).\n side: OrderSide;\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 stopLoss?: 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 // Timestamp when the action was executed.\n executionTime?: Date;\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 interface Position {\n // Unique identifier for the position.\n id: string;\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 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 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\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 // 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 OrderType {\n MARKET = \"MARKET\",\n LIMIT = \"LIMIT\",\n STOP = \"STOP\",\n STOP_LIMIT = \"STOP_LIMIT\"\n}\n\nexport enum OrderSide {\n BUY = \"BUY\",\n SELL = \"SELL\"\n}\n\nexport enum OrderStatus {\n PENDING = \"PENDING\",\n FILLED = \"FILLED\",\n CANCELLED = \"CANCELLED\",\n REJECTED = \"REJECTED\"\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 // Reference to the action associated with the order.\n actionId: string;\n // Type of order, defined by OrderType enum.\n type: OrderType;\n // Side of the order (BUY or SELL).\n side: OrderSide;\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 stopLoss?: number;\n // Current status of the order, defined by OrderStatus enum.\n status: OrderStatus;\n // Timestamp when the action was executed.\n executionTime?: Date;\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";
|
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,
|
1
|
+
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../../src/generated/typeStrings/Account.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,u7RA6S7B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Account.js","sourceRoot":"","sources":["../../../src/generated/typeStrings/Account.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG
|
1
|
+
{"version":3,"file":"Account.js","sourceRoot":"","sources":["../../../src/generated/typeStrings/Account.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6ShC,CAAC"}
|
@@ -6,9 +6,7 @@ Your response should adhere to the following type definition for the "Action" ty
|
|
6
6
|
|
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
|
-
export
|
10
|
-
// Unique identifier for the action.
|
11
|
-
id: string;
|
9
|
+
export type Action = {
|
12
10
|
// Sequence number of the action within the trade.
|
13
11
|
sequence: number;
|
14
12
|
// Reference to the trade this action is part of.
|
@@ -63,39 +61,13 @@ export enum UserRole {
|
|
63
61
|
USER = "USER"
|
64
62
|
}
|
65
63
|
|
66
|
-
// Simplified reference to Customer.
|
67
|
-
export interface Customer {
|
68
|
-
// Unique identifier for the customer.
|
69
|
-
id: number;
|
70
|
-
}
|
71
|
-
|
72
|
-
// Simplified reference to Account.
|
73
|
-
export interface Account {
|
74
|
-
// Unique identifier for the account.
|
75
|
-
id: string;
|
76
|
-
}
|
77
|
-
|
78
|
-
// Simplified reference to Session.
|
79
|
-
export interface Session {
|
80
|
-
// Unique identifier for the session.
|
81
|
-
id: string;
|
82
|
-
}
|
83
|
-
|
84
|
-
// Simplified reference to Authenticator.
|
85
|
-
export interface Authenticator {
|
86
|
-
// Unique identifier for the authenticator.
|
87
|
-
id: string;
|
88
|
-
}
|
89
|
-
|
90
64
|
export enum SubscriptionPlan {
|
91
65
|
FREE = "FREE",
|
92
66
|
PRO = "PRO",
|
93
67
|
BUSINESS = "BUSINESS"
|
94
68
|
}
|
95
69
|
|
96
|
-
export
|
97
|
-
// Unique identifier for the user.
|
98
|
-
id: string;
|
70
|
+
export type User = {
|
99
71
|
// The user's full name.
|
100
72
|
name?: string;
|
101
73
|
// The user's email address, must be unique.
|
@@ -104,10 +76,6 @@ export interface User {
|
|
104
76
|
emailVerified?: Date;
|
105
77
|
// URL to the user's profile image.
|
106
78
|
image?: string;
|
107
|
-
// Timestamp when the user account was created.
|
108
|
-
createdAt: Date;
|
109
|
-
// Timestamp when the user account was last updated.
|
110
|
-
updatedAt: Date;
|
111
79
|
// The role assigned to the user, determining permissions.
|
112
80
|
role: UserRole;
|
113
81
|
// A short biography or description of the user.
|
@@ -151,15 +119,7 @@ export enum OrderStatus {
|
|
151
119
|
REJECTED = "REJECTED"
|
152
120
|
}
|
153
121
|
|
154
|
-
|
155
|
-
export interface Asset {
|
156
|
-
// Unique identifier for the asset.
|
157
|
-
id: string;
|
158
|
-
}
|
159
|
-
|
160
|
-
export interface Order {
|
161
|
-
// Unique identifier for the order.
|
162
|
-
id: string;
|
122
|
+
export type Order = {
|
163
123
|
// Reference to the Alpaca account used for the order.
|
164
124
|
alpacaAccountId: string;
|
165
125
|
// Reference to the asset being ordered.
|
@@ -177,10 +137,6 @@ export interface Order {
|
|
177
137
|
stopLoss?: number;
|
178
138
|
// Current status of the order, defined by OrderStatus enum.
|
179
139
|
status: OrderStatus;
|
180
|
-
// Timestamp when the order was created.
|
181
|
-
createdAt: Date;
|
182
|
-
// Timestamp when the order was last updated.
|
183
|
-
updatedAt: Date;
|
184
140
|
// Timestamp when the action was executed.
|
185
141
|
executionTime?: Date;
|
186
142
|
// The Alpaca account this order is associated with.
|
@@ -193,9 +149,7 @@ export interface Order {
|
|
193
149
|
fee?: number;
|
194
150
|
}
|
195
151
|
|
196
|
-
export
|
197
|
-
// Unique identifier for the position.
|
198
|
-
id: string;
|
152
|
+
export type Position = {
|
199
153
|
// Reference to the associated asset.
|
200
154
|
assetId: string;
|
201
155
|
// Relation to the Asset model.
|
@@ -239,9 +193,7 @@ export enum AlertType {
|
|
239
193
|
INFO = "INFO"
|
240
194
|
}
|
241
195
|
|
242
|
-
export
|
243
|
-
// Unique identifier for the alert.
|
244
|
-
id: string;
|
196
|
+
export type Alert = {
|
245
197
|
// Reference to the Alpaca account associated with the alert.
|
246
198
|
alpacaAccountId: string;
|
247
199
|
// Message content of the alert.
|
@@ -250,17 +202,11 @@ export interface Alert {
|
|
250
202
|
type: AlertType;
|
251
203
|
// Indicates whether the alert has been read by the user.
|
252
204
|
isRead: boolean;
|
253
|
-
// Timestamp when the alert was created.
|
254
|
-
createdAt: Date;
|
255
|
-
// Timestamp when the alert was last updated.
|
256
|
-
updatedAt: Date;
|
257
205
|
// Relation to the AlpacaAccount model.
|
258
206
|
alpacaAccount: AlpacaAccount;
|
259
207
|
}
|
260
208
|
|
261
|
-
export
|
262
|
-
// Unique identifier for the Alpaca account.
|
263
|
-
id: string;
|
209
|
+
export type AlpacaAccount = {
|
264
210
|
// The type of Alpaca account (PAPER or LIVE).
|
265
211
|
type: AlpacaAccountType;
|
266
212
|
// API key for authenticating requests to Alpaca.
|
@@ -275,10 +221,6 @@ export interface AlpacaAccount {
|
|
275
221
|
user: User;
|
276
222
|
// Foreign key referencing the User.
|
277
223
|
userId: string;
|
278
|
-
// Timestamp when the Alpaca account was created.
|
279
|
-
createdAt: Date;
|
280
|
-
// Timestamp when the Alpaca account was last updated.
|
281
|
-
updatedAt: Date;
|
282
224
|
// List of trades executed through this Alpaca account.
|
283
225
|
trades: Trade[];
|
284
226
|
// List of orders placed through this Alpaca account.
|
@@ -294,9 +236,7 @@ export enum OptionContractType {
|
|
294
236
|
PUT = "PUT"
|
295
237
|
}
|
296
238
|
|
297
|
-
export
|
298
|
-
// Unique identifier for the trade.
|
299
|
-
id: string;
|
239
|
+
export type Trade = {
|
300
240
|
// Reference to the Alpaca account used for the trade.
|
301
241
|
alpacaAccountId: string;
|
302
242
|
// Reference to the asset being traded.
|
@@ -317,10 +257,6 @@ export interface Trade {
|
|
317
257
|
confidence: number;
|
318
258
|
// Timestamp when the trade was executed.
|
319
259
|
timestamp: Date;
|
320
|
-
// Timestamp when the trade record was created.
|
321
|
-
createdAt: Date;
|
322
|
-
// Timestamp when the trade record was last updated.
|
323
|
-
updatedAt: Date;
|
324
260
|
// Current status of the trade.
|
325
261
|
status: TradeStatus;
|
326
262
|
// Relation to the AlpacaAccount model.
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const ActionTypeString = "\nYour response should adhere to the following type definition for the \"Action\" type, and its nested object types (which include 'Trade', 'Order' types), as well as any ENUMS used by it (which include 'ActionType', 'ActionStatus' enums).\n\nImportantly, DO NOT include any annotations in your response (i.e. remove the ones we have provided for your reference below).\n\nexport
|
1
|
+
export declare const ActionTypeString = "\nYour response should adhere to the following type definition for the \"Action\" type, and its nested object types (which include 'Trade', 'Order' types), as well as any ENUMS used by it (which include 'ActionType', 'ActionStatus' enums).\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 Action = {\n // Sequence number of the action within the trade.\n sequence: number;\n // Reference to the trade this action is part of.\n tradeId: string;\n // Type of trade action, defined by ActionType enum.\n type: ActionType;\n // Reference to the order ID associated with the action.\n orderId?: string;\n // Additional notes or comments about the action.\n note: string;\n // Current status of the trade action.\n status: ActionStatus;\n // Fees associated with the action.\n fee?: number;\n // The trade this action is part of.\n trade: Trade;\n // The order associated with this action.\n order?: Order;\n}\n\nexport enum ActionType {\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 ActionStatus {\n STAGED = \"STAGED\",\n EXECUTED = \"EXECUTED\",\n COMPLETED = \"COMPLETED\"\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 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\nexport enum OrderType {\n MARKET = \"MARKET\",\n LIMIT = \"LIMIT\",\n STOP = \"STOP\",\n STOP_LIMIT = \"STOP_LIMIT\"\n}\n\nexport enum OrderSide {\n BUY = \"BUY\",\n SELL = \"SELL\"\n}\n\nexport enum OrderStatus {\n PENDING = \"PENDING\",\n FILLED = \"FILLED\",\n CANCELLED = \"CANCELLED\",\n REJECTED = \"REJECTED\"\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 // Reference to the action associated with the order.\n actionId: string;\n // Type of order, defined by OrderType enum.\n type: OrderType;\n // Side of the order (BUY or SELL).\n side: OrderSide;\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 stopLoss?: number;\n // Current status of the order, defined by OrderStatus enum.\n status: OrderStatus;\n // Timestamp when the action was executed.\n executionTime?: Date;\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 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\n";
|
2
2
|
//# sourceMappingURL=Action.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../src/generated/typeStrings/Action.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,
|
1
|
+
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../src/generated/typeStrings/Action.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,uzPA4Q5B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../src/generated/typeStrings/Action.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG
|
1
|
+
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../src/generated/typeStrings/Action.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Q/B,CAAC"}
|