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.
- package/README.md +59 -26
- package/generated/typeStrings/Account.cjs +363 -0
- package/generated/typeStrings/Account.d.ts +2 -0
- package/generated/typeStrings/Account.d.ts.map +1 -0
- package/generated/typeStrings/Account.js.map +1 -0
- package/generated/typeStrings/Action.cjs +337 -0
- package/generated/typeStrings/Action.d.ts +2 -0
- package/generated/typeStrings/Action.d.ts.map +1 -0
- package/generated/typeStrings/Action.js.map +1 -0
- package/generated/typeStrings/Alert.cjs +493 -0
- package/generated/typeStrings/Alert.d.ts +2 -0
- package/generated/typeStrings/Alert.d.ts.map +1 -0
- package/generated/typeStrings/Alert.js.map +1 -0
- package/generated/typeStrings/AlpacaAccount.cjs +575 -0
- package/generated/typeStrings/AlpacaAccount.d.ts +2 -0
- package/generated/typeStrings/AlpacaAccount.d.ts.map +1 -0
- package/generated/typeStrings/AlpacaAccount.js.map +1 -0
- package/generated/typeStrings/Asset.cjs +536 -0
- package/generated/typeStrings/Asset.d.ts +2 -0
- package/generated/typeStrings/Asset.d.ts.map +1 -0
- package/generated/typeStrings/Asset.js.map +1 -0
- package/generated/typeStrings/Authenticator.cjs +363 -0
- package/generated/typeStrings/Authenticator.d.ts +2 -0
- package/generated/typeStrings/Authenticator.d.ts.map +1 -0
- package/generated/typeStrings/Authenticator.js.map +1 -0
- package/generated/typeStrings/Customer.cjs +363 -0
- package/generated/typeStrings/Customer.d.ts +2 -0
- package/generated/typeStrings/Customer.d.ts.map +1 -0
- package/generated/typeStrings/Customer.js.map +1 -0
- package/generated/typeStrings/EconomicEvent.cjs +33 -0
- package/generated/typeStrings/EconomicEvent.d.ts +2 -0
- package/generated/typeStrings/EconomicEvent.d.ts.map +1 -0
- package/generated/typeStrings/EconomicEvent.js.map +1 -0
- package/generated/typeStrings/NewsArticle.cjs +361 -0
- package/generated/typeStrings/NewsArticle.d.ts +2 -0
- package/generated/typeStrings/NewsArticle.d.ts.map +1 -0
- package/generated/typeStrings/NewsArticle.js.map +1 -0
- package/generated/typeStrings/NewsArticleAssetSentiment.cjs +386 -0
- package/generated/typeStrings/NewsArticleAssetSentiment.d.ts +2 -0
- package/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -0
- package/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -0
- package/generated/typeStrings/Order.cjs +521 -0
- package/generated/typeStrings/Order.d.ts +2 -0
- package/generated/typeStrings/Order.d.ts.map +1 -0
- package/generated/typeStrings/Order.js.map +1 -0
- package/generated/typeStrings/Position.cjs +419 -0
- package/generated/typeStrings/Position.d.ts +2 -0
- package/generated/typeStrings/Position.d.ts.map +1 -0
- package/generated/typeStrings/Position.js.map +1 -0
- package/generated/typeStrings/Session.cjs +363 -0
- package/generated/typeStrings/Session.d.ts +2 -0
- package/generated/typeStrings/Session.d.ts.map +1 -0
- package/generated/typeStrings/Session.js.map +1 -0
- package/generated/typeStrings/Trade.cjs +521 -0
- package/generated/typeStrings/Trade.d.ts +2 -0
- package/generated/typeStrings/Trade.d.ts.map +1 -0
- package/generated/typeStrings/Trade.js.map +1 -0
- package/generated/typeStrings/User.cjs +493 -0
- package/generated/typeStrings/User.d.ts +2 -0
- package/generated/typeStrings/User.d.ts.map +1 -0
- package/generated/typeStrings/User.js.map +1 -0
- package/generated/typeStrings/VerificationToken.cjs +21 -0
- package/generated/typeStrings/VerificationToken.d.ts +2 -0
- package/generated/typeStrings/VerificationToken.d.ts.map +1 -0
- package/generated/typeStrings/VerificationToken.js.map +1 -0
- package/generated/typeStrings/enums.cjs +100 -0
- package/generated/typeStrings/enums.d.ts +85 -0
- package/generated/typeStrings/enums.d.ts.map +1 -0
- package/generated/typeStrings/enums.js.map +1 -0
- package/generated/typeStrings/index.cjs +39 -0
- package/generated/typeStrings/index.d.ts +20 -0
- package/generated/typeStrings/index.d.ts.map +1 -0
- package/generated/typeStrings/index.js.map +1 -0
- package/index.cjs +25 -0
- package/index.d.ts +1 -0
- package/package.json +1 -1
- package/server/generated/typeStrings/Account.d.ts +2 -0
- package/server/generated/typeStrings/Account.d.ts.map +1 -0
- package/server/generated/typeStrings/Account.js.map +1 -0
- package/server/generated/typeStrings/Account.mjs +360 -0
- package/server/generated/typeStrings/Action.d.ts +2 -0
- package/server/generated/typeStrings/Action.d.ts.map +1 -0
- package/server/generated/typeStrings/Action.js.map +1 -0
- package/server/generated/typeStrings/Action.mjs +334 -0
- package/server/generated/typeStrings/Alert.d.ts +2 -0
- package/server/generated/typeStrings/Alert.d.ts.map +1 -0
- package/server/generated/typeStrings/Alert.js.map +1 -0
- package/server/generated/typeStrings/Alert.mjs +490 -0
- package/server/generated/typeStrings/AlpacaAccount.d.ts +2 -0
- package/server/generated/typeStrings/AlpacaAccount.d.ts.map +1 -0
- package/server/generated/typeStrings/AlpacaAccount.js.map +1 -0
- package/server/generated/typeStrings/AlpacaAccount.mjs +572 -0
- package/server/generated/typeStrings/Asset.d.ts +2 -0
- package/server/generated/typeStrings/Asset.d.ts.map +1 -0
- package/server/generated/typeStrings/Asset.js.map +1 -0
- package/server/generated/typeStrings/Asset.mjs +533 -0
- package/server/generated/typeStrings/Authenticator.d.ts +2 -0
- package/server/generated/typeStrings/Authenticator.d.ts.map +1 -0
- package/server/generated/typeStrings/Authenticator.js.map +1 -0
- package/server/generated/typeStrings/Authenticator.mjs +360 -0
- package/server/generated/typeStrings/Customer.d.ts +2 -0
- package/server/generated/typeStrings/Customer.d.ts.map +1 -0
- package/server/generated/typeStrings/Customer.js.map +1 -0
- package/server/generated/typeStrings/Customer.mjs +360 -0
- package/server/generated/typeStrings/EconomicEvent.d.ts +2 -0
- package/server/generated/typeStrings/EconomicEvent.d.ts.map +1 -0
- package/server/generated/typeStrings/EconomicEvent.js.map +1 -0
- package/server/generated/typeStrings/EconomicEvent.mjs +30 -0
- package/server/generated/typeStrings/NewsArticle.d.ts +2 -0
- package/server/generated/typeStrings/NewsArticle.d.ts.map +1 -0
- package/server/generated/typeStrings/NewsArticle.js.map +1 -0
- package/server/generated/typeStrings/NewsArticle.mjs +358 -0
- package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts +2 -0
- package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -0
- package/server/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -0
- package/server/generated/typeStrings/NewsArticleAssetSentiment.mjs +383 -0
- package/server/generated/typeStrings/Order.d.ts +2 -0
- package/server/generated/typeStrings/Order.d.ts.map +1 -0
- package/server/generated/typeStrings/Order.js.map +1 -0
- package/server/generated/typeStrings/Order.mjs +518 -0
- package/server/generated/typeStrings/Position.d.ts +2 -0
- package/server/generated/typeStrings/Position.d.ts.map +1 -0
- package/server/generated/typeStrings/Position.js.map +1 -0
- package/server/generated/typeStrings/Position.mjs +416 -0
- package/server/generated/typeStrings/Session.d.ts +2 -0
- package/server/generated/typeStrings/Session.d.ts.map +1 -0
- package/server/generated/typeStrings/Session.js.map +1 -0
- package/server/generated/typeStrings/Session.mjs +360 -0
- package/server/generated/typeStrings/Trade.d.ts +2 -0
- package/server/generated/typeStrings/Trade.d.ts.map +1 -0
- package/server/generated/typeStrings/Trade.js.map +1 -0
- package/server/generated/typeStrings/Trade.mjs +518 -0
- package/server/generated/typeStrings/User.d.ts +2 -0
- package/server/generated/typeStrings/User.d.ts.map +1 -0
- package/server/generated/typeStrings/User.js.map +1 -0
- package/server/generated/typeStrings/User.mjs +490 -0
- package/server/generated/typeStrings/VerificationToken.d.ts +2 -0
- package/server/generated/typeStrings/VerificationToken.d.ts.map +1 -0
- package/server/generated/typeStrings/VerificationToken.js.map +1 -0
- package/server/generated/typeStrings/VerificationToken.mjs +18 -0
- package/server/generated/typeStrings/enums.d.ts +85 -0
- package/server/generated/typeStrings/enums.d.ts.map +1 -0
- package/server/generated/typeStrings/enums.js.map +1 -0
- package/server/generated/typeStrings/enums.mjs +97 -0
- package/server/generated/typeStrings/index.d.ts +20 -0
- package/server/generated/typeStrings/index.d.ts.map +1 -0
- package/server/generated/typeStrings/index.js.map +1 -0
- package/server/generated/typeStrings/index.mjs +36 -0
- package/server/index.d.ts +1 -0
- package/server/index.d.ts.map +1 -1
- package/server/index.js.map +1 -1
- package/server/index.mjs +1 -0
package/README.md
CHANGED
@@ -20,6 +20,7 @@ This package offers a robust backend solution tailored for the Adaptic AI platfo
|
|
20
20
|
- **Dynamically contructed variables and arguments**: No need to worry about constructing gql operations, simply pass through the data as an object that conforms to the model's type definition.
|
21
21
|
- **Server-Side and Client-Side Support**: Versatile usage in both environments, including AWS Lambda functions.
|
22
22
|
- **Enums Namespace**: Organized enums for consistent value usage across models.
|
23
|
+
- **TypeStrings Namespace**: TypeStrings const definitions that are stringified versions of the various model types (including any nested types or enums within them). This is useful when wanting to pass these on to an LLM as a reference (e.g. when asking it to return a specific type of data).
|
23
24
|
- **Automated Documentation**: The build script dynamically generates a list of all models and their CRUD resolvers in the `README.md`.
|
24
25
|
|
25
26
|
## Prerequisites
|
@@ -30,9 +31,7 @@ To use the `adaptic-backend` package, the only requirement is to ensure you have
|
|
30
31
|
|
31
32
|
Add the folowing to your `.env` file or add them as environment variables in your deployment environment:
|
32
33
|
|
33
|
-
- `
|
34
|
-
- `BACKEND_HTTPS_URL`: The HTTPS URL of your GraphQL server. E.g. `https://api.example.com/graphql`.
|
35
|
-
- `BACKEND_WS_URL`: The WebSocket URL of your GraphQL server. E.g. `wss://api.example.com/subscriptions`.
|
34
|
+
- `BACKEND_HTTPS_URL`: The HTTPS URL of your GraphQL server. E.g. `https://api.adaptic.ai/graphql` for production, and `https://localhost:4000/graphql` for local development.
|
36
35
|
|
37
36
|
Example `.env` file:
|
38
37
|
|
@@ -111,11 +110,11 @@ updateUser();
|
|
111
110
|
|
112
111
|
#### Server-Side Usage (Within a Lambda Function)
|
113
112
|
|
114
|
-
The only difference between client-side and server-side usage is the import statement. On the server-side, you import the functions from `adaptic-backend/server` instead of `adaptic-backend`, and you need to provide an Apollo Client instance to the functions with the use of 'fetch' for the HTTP link.
|
113
|
+
The only difference between client-side and server-side usage is the import statement. On the server-side, you import the functions from `adaptic-backend/server/index` instead of `adaptic-backend`, and you need to provide an Apollo Client instance to the functions with the use of 'fetch' for the HTTP link.
|
115
114
|
|
116
115
|
```javascript
|
117
116
|
// server-side/lambdaFunction.mjs
|
118
|
-
import adaptic from 'adaptic-backend/server';
|
117
|
+
import adaptic from 'adaptic-backend/server/index';
|
119
118
|
|
120
119
|
export const handler = async (event) => {
|
121
120
|
// Parse the incoming event data
|
@@ -157,7 +156,7 @@ export const handler = async (event) => {
|
|
157
156
|
|
158
157
|
### Types Namespace
|
159
158
|
|
160
|
-
Types associated with your data models are available under the `
|
159
|
+
Types associated with your data models are available under the `types` namespace. This provides type safety and consistency when working with your models.
|
161
160
|
|
162
161
|
```typescript
|
163
162
|
// types-example.ts
|
@@ -180,7 +179,7 @@ const updateUser: types.UserUpdateInput = {
|
|
180
179
|
|
181
180
|
### Enums Namespace
|
182
181
|
|
183
|
-
Enums associated with your data models are available under the `
|
182
|
+
Enums associated with your data models are available under the `enums` namespace. This provides type safety and consistency when working with your models.
|
184
183
|
|
185
184
|
```typescript
|
186
185
|
// enums-example.ts
|
@@ -195,29 +194,63 @@ const setUserRole = (role: enums.UserRole) => {
|
|
195
194
|
};
|
196
195
|
```
|
197
196
|
|
197
|
+
### TypeStrings Namespace
|
198
198
|
|
199
|
-
|
199
|
+
TypeStrings are stringified versions of the various model types (including any nested types or enums within them). These are available under the `typeStrings` namespace.
|
200
|
+
|
201
|
+
Their purpose is to provide a reference to the type of data being requested, which can be passed on to an LLM (Language Learning Model) as a reference within a prompt or query. This is useful when asking the LLM to return a specific type of data that should conform to the model's structure.
|
202
|
+
|
203
|
+
```typescript
|
204
|
+
|
205
|
+
// typeStrings-example.ts
|
206
|
+
|
207
|
+
import { typeStrings } from 'adaptic-backend';
|
208
|
+
|
209
|
+
// Use typeStrings in a prompt being sent to an LLM
|
210
|
+
const prompt = `
|
211
|
+
|
212
|
+
... some other prompt text
|
213
|
+
|
214
|
+
\${typeStrings.User}
|
215
|
+
|
216
|
+
`;
|
217
|
+
|
218
|
+
```
|
219
|
+
|
220
|
+
### Model CRUD Resolvers
|
221
|
+
|
222
|
+
The `adaptic-backend` package includes a comprehensive set of CRUD (Create, Read, Update, Delete) resolvers for each of your models. Each model has the following functions:
|
223
|
+
|
224
|
+
- `ModelName.create`: Create a single record.
|
225
|
+
- `ModelName.createMany`: Create multiple records.
|
226
|
+
- `ModelName.update`: Update a single record.
|
227
|
+
- `ModelName.delete`: Delete a single record.
|
228
|
+
- `ModelName.get`: Retrieve a single record by unique identifier.
|
229
|
+
- `ModelName.getAll`: Retrieve all records.
|
230
|
+
- `ModelName.findMany`: Retrieve multiple records based on criteria.
|
231
|
+
|
232
|
+
### Model TypeStrings, Types, and available CRUD Resolvers
|
200
233
|
|
201
234
|
The `adaptic-backend` package includes a comprehensive set of CRUD (Create, Read, Update, Delete) resolvers for each of your models. Each model has the following functions (available directly under the `adaptic` namespace) and types (under the `types` namespace):
|
202
235
|
|
203
|
-
| Model Name | Type | CRUD Resolvers |
|
204
|
-
|
205
|
-
| Account | `types.Account` | `adaptic.account.create`, `adaptic.account.createMany`, `adaptic.account.update`, `adaptic.account.delete`, `adaptic.account.get`, `adaptic.account.getAll`, `adaptic.account.findMany` |
|
206
|
-
| Action | `types.Action` | `adaptic.action.create`, `adaptic.action.createMany`, `adaptic.action.update`, `adaptic.action.delete`, `adaptic.action.get`, `adaptic.action.getAll`, `adaptic.action.findMany` |
|
207
|
-
| Alert | `types.Alert` | `adaptic.alert.create`, `adaptic.alert.createMany`, `adaptic.alert.update`, `adaptic.alert.delete`, `adaptic.alert.get`, `adaptic.alert.getAll`, `adaptic.alert.findMany` |
|
208
|
-
| AlpacaAccount | `types.AlpacaAccount` | `adaptic.alpacaAccount.create`, `adaptic.alpacaAccount.createMany`, `adaptic.alpacaAccount.update`, `adaptic.alpacaAccount.delete`, `adaptic.alpacaAccount.get`, `adaptic.alpacaAccount.getAll`, `adaptic.alpacaAccount.findMany` |
|
209
|
-
| Asset | `types.Asset` | `adaptic.asset.create`, `adaptic.asset.createMany`, `adaptic.asset.update`, `adaptic.asset.delete`, `adaptic.asset.get`, `adaptic.asset.getAll`, `adaptic.asset.findMany` |
|
210
|
-
| Authenticator | `types.Authenticator` | `adaptic.authenticator.create`, `adaptic.authenticator.createMany`, `adaptic.authenticator.update`, `adaptic.authenticator.delete`, `adaptic.authenticator.get`, `adaptic.authenticator.getAll`, `adaptic.authenticator.findMany` |
|
211
|
-
| Customer | `types.Customer` | `adaptic.customer.create`, `adaptic.customer.createMany`, `adaptic.customer.update`, `adaptic.customer.delete`, `adaptic.customer.get`, `adaptic.customer.getAll`, `adaptic.customer.findMany` |
|
212
|
-
| EconomicEvent | `types.EconomicEvent` | `adaptic.economicEvent.create`, `adaptic.economicEvent.createMany`, `adaptic.economicEvent.update`, `adaptic.economicEvent.delete`, `adaptic.economicEvent.get`, `adaptic.economicEvent.getAll`, `adaptic.economicEvent.findMany` |
|
213
|
-
| NewsArticle | `types.NewsArticle` | `adaptic.newsArticle.create`, `adaptic.newsArticle.createMany`, `adaptic.newsArticle.update`, `adaptic.newsArticle.delete`, `adaptic.newsArticle.get`, `adaptic.newsArticle.getAll`, `adaptic.newsArticle.findMany` |
|
214
|
-
| NewsArticleAssetSentiment | `types.NewsArticleAssetSentiment` | `adaptic.newsArticleAssetSentiment.create`, `adaptic.newsArticleAssetSentiment.createMany`, `adaptic.newsArticleAssetSentiment.update`, `adaptic.newsArticleAssetSentiment.delete`, `adaptic.newsArticleAssetSentiment.get`, `adaptic.newsArticleAssetSentiment.getAll`, `adaptic.newsArticleAssetSentiment.findMany` |
|
215
|
-
| Order | `types.Order` | `adaptic.order.create`, `adaptic.order.createMany`, `adaptic.order.update`, `adaptic.order.delete`, `adaptic.order.get`, `adaptic.order.getAll`, `adaptic.order.findMany` |
|
216
|
-
| Position | `types.Position` | `adaptic.position.create`, `adaptic.position.createMany`, `adaptic.position.update`, `adaptic.position.delete`, `adaptic.position.get`, `adaptic.position.getAll`, `adaptic.position.findMany` |
|
217
|
-
| Session | `types.Session` | `adaptic.session.create`, `adaptic.session.createMany`, `adaptic.session.update`, `adaptic.session.delete`, `adaptic.session.get`, `adaptic.session.getAll`, `adaptic.session.findMany` |
|
218
|
-
| Trade | `types.Trade` | `adaptic.trade.create`, `adaptic.trade.createMany`, `adaptic.trade.update`, `adaptic.trade.delete`, `adaptic.trade.get`, `adaptic.trade.getAll`, `adaptic.trade.findMany` |
|
219
|
-
| User | `types.User` | `adaptic.user.create`, `adaptic.user.createMany`, `adaptic.user.update`, `adaptic.user.delete`, `adaptic.user.get`, `adaptic.user.getAll`, `adaptic.user.findMany` |
|
220
|
-
| VerificationToken | `types.VerificationToken` | `adaptic.verificationToken.create`, `adaptic.verificationToken.createMany`, `adaptic.verificationToken.update`, `adaptic.verificationToken.delete`, `adaptic.verificationToken.get`, `adaptic.verificationToken.getAll`, `adaptic.verificationToken.findMany` |
|
236
|
+
| Model Name | TypeString | Type | CRUD Resolvers |
|
237
|
+
|------------|------------|------------|-----------------|
|
238
|
+
| Account | `typeStrings.Account` | `types.Account` | `adaptic.account.create`, `adaptic.account.createMany`, `adaptic.account.update`, `adaptic.account.delete`, `adaptic.account.get`, `adaptic.account.getAll`, `adaptic.account.findMany` |
|
239
|
+
| Action | `typeStrings.Action` | `types.Action` | `adaptic.action.create`, `adaptic.action.createMany`, `adaptic.action.update`, `adaptic.action.delete`, `adaptic.action.get`, `adaptic.action.getAll`, `adaptic.action.findMany` |
|
240
|
+
| Alert | `typeStrings.Alert` | `types.Alert` | `adaptic.alert.create`, `adaptic.alert.createMany`, `adaptic.alert.update`, `adaptic.alert.delete`, `adaptic.alert.get`, `adaptic.alert.getAll`, `adaptic.alert.findMany` |
|
241
|
+
| AlpacaAccount | `typeStrings.AlpacaAccount` | `types.AlpacaAccount` | `adaptic.alpacaAccount.create`, `adaptic.alpacaAccount.createMany`, `adaptic.alpacaAccount.update`, `adaptic.alpacaAccount.delete`, `adaptic.alpacaAccount.get`, `adaptic.alpacaAccount.getAll`, `adaptic.alpacaAccount.findMany` |
|
242
|
+
| Asset | `typeStrings.Asset` | `types.Asset` | `adaptic.asset.create`, `adaptic.asset.createMany`, `adaptic.asset.update`, `adaptic.asset.delete`, `adaptic.asset.get`, `adaptic.asset.getAll`, `adaptic.asset.findMany` |
|
243
|
+
| Authenticator | `typeStrings.Authenticator` | `types.Authenticator` | `adaptic.authenticator.create`, `adaptic.authenticator.createMany`, `adaptic.authenticator.update`, `adaptic.authenticator.delete`, `adaptic.authenticator.get`, `adaptic.authenticator.getAll`, `adaptic.authenticator.findMany` |
|
244
|
+
| Customer | `typeStrings.Customer` | `types.Customer` | `adaptic.customer.create`, `adaptic.customer.createMany`, `adaptic.customer.update`, `adaptic.customer.delete`, `adaptic.customer.get`, `adaptic.customer.getAll`, `adaptic.customer.findMany` |
|
245
|
+
| EconomicEvent | `typeStrings.EconomicEvent` | `types.EconomicEvent` | `adaptic.economicEvent.create`, `adaptic.economicEvent.createMany`, `adaptic.economicEvent.update`, `adaptic.economicEvent.delete`, `adaptic.economicEvent.get`, `adaptic.economicEvent.getAll`, `adaptic.economicEvent.findMany` |
|
246
|
+
| NewsArticle | `typeStrings.NewsArticle` | `types.NewsArticle` | `adaptic.newsArticle.create`, `adaptic.newsArticle.createMany`, `adaptic.newsArticle.update`, `adaptic.newsArticle.delete`, `adaptic.newsArticle.get`, `adaptic.newsArticle.getAll`, `adaptic.newsArticle.findMany` |
|
247
|
+
| NewsArticleAssetSentiment | `typeStrings.NewsArticleAssetSentiment` | `types.NewsArticleAssetSentiment` | `adaptic.newsArticleAssetSentiment.create`, `adaptic.newsArticleAssetSentiment.createMany`, `adaptic.newsArticleAssetSentiment.update`, `adaptic.newsArticleAssetSentiment.delete`, `adaptic.newsArticleAssetSentiment.get`, `adaptic.newsArticleAssetSentiment.getAll`, `adaptic.newsArticleAssetSentiment.findMany` |
|
248
|
+
| Order | `typeStrings.Order` | `types.Order` | `adaptic.order.create`, `adaptic.order.createMany`, `adaptic.order.update`, `adaptic.order.delete`, `adaptic.order.get`, `adaptic.order.getAll`, `adaptic.order.findMany` |
|
249
|
+
| Position | `typeStrings.Position` | `types.Position` | `adaptic.position.create`, `adaptic.position.createMany`, `adaptic.position.update`, `adaptic.position.delete`, `adaptic.position.get`, `adaptic.position.getAll`, `adaptic.position.findMany` |
|
250
|
+
| Session | `typeStrings.Session` | `types.Session` | `adaptic.session.create`, `adaptic.session.createMany`, `adaptic.session.update`, `adaptic.session.delete`, `adaptic.session.get`, `adaptic.session.getAll`, `adaptic.session.findMany` |
|
251
|
+
| Trade | `typeStrings.Trade` | `types.Trade` | `adaptic.trade.create`, `adaptic.trade.createMany`, `adaptic.trade.update`, `adaptic.trade.delete`, `adaptic.trade.get`, `adaptic.trade.getAll`, `adaptic.trade.findMany` |
|
252
|
+
| User | `typeStrings.User` | `types.User` | `adaptic.user.create`, `adaptic.user.createMany`, `adaptic.user.update`, `adaptic.user.delete`, `adaptic.user.get`, `adaptic.user.getAll`, `adaptic.user.findMany` |
|
253
|
+
| VerificationToken | `typeStrings.VerificationToken` | `types.VerificationToken` | `adaptic.verificationToken.create`, `adaptic.verificationToken.createMany`, `adaptic.verificationToken.update`, `adaptic.verificationToken.delete`, `adaptic.verificationToken.get`, `adaptic.verificationToken.getAll`, `adaptic.verificationToken.findMany` |
|
221
254
|
|
222
255
|
### Enums
|
223
256
|
|
@@ -0,0 +1,363 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AccountTypeString = void 0;
|
4
|
+
exports.AccountTypeString = `
|
5
|
+
Your response should adhere to the following type definition for the "Account" type, and its nested object types (which include 'User' type).
|
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 Account {
|
10
|
+
// Unique identifier for the account.
|
11
|
+
id: string;
|
12
|
+
// Reference to the user who owns this account.
|
13
|
+
userId: string;
|
14
|
+
// Type of the account (e.g., OAuth provider).
|
15
|
+
type: string;
|
16
|
+
// Provider of the account (e.g., Google, GitHub).
|
17
|
+
provider: string;
|
18
|
+
// Unique identifier provided by the external provider.
|
19
|
+
providerAccountId: string;
|
20
|
+
// Refresh token for the external account, if applicable.
|
21
|
+
refresh_token?: string;
|
22
|
+
// Access token for the external account, if applicable.
|
23
|
+
access_token?: string;
|
24
|
+
// Expiration time of the access token.
|
25
|
+
expires_at?: number;
|
26
|
+
// Type of the token (e.g., Bearer).
|
27
|
+
token_type?: string;
|
28
|
+
// Scope of access granted by the token.
|
29
|
+
scope?: string;
|
30
|
+
// ID token for authentication, if applicable.
|
31
|
+
id_token?: string;
|
32
|
+
// State of the session associated with the account.
|
33
|
+
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
|
+
// Relation to the User model.
|
39
|
+
user: User;
|
40
|
+
}
|
41
|
+
|
42
|
+
export enum UserRole {
|
43
|
+
OWNER = "OWNER",
|
44
|
+
ADMIN = "ADMIN",
|
45
|
+
USER = "USER"
|
46
|
+
}
|
47
|
+
|
48
|
+
export enum AlpacaAccountType {
|
49
|
+
PAPER = "PAPER",
|
50
|
+
LIVE = "LIVE"
|
51
|
+
}
|
52
|
+
|
53
|
+
export enum SubscriptionPlan {
|
54
|
+
FREE = "FREE",
|
55
|
+
PRO = "PRO",
|
56
|
+
BUSINESS = "BUSINESS"
|
57
|
+
}
|
58
|
+
|
59
|
+
export interface Customer {
|
60
|
+
// Unique identifier for the customer.
|
61
|
+
id: number;
|
62
|
+
// Reference to the authenticated user associated with the customer.
|
63
|
+
authUserId: string;
|
64
|
+
// Name of the customer.
|
65
|
+
name?: string;
|
66
|
+
// Subscription plan the customer is enrolled in.
|
67
|
+
plan?: SubscriptionPlan;
|
68
|
+
// Unique Stripe customer ID for billing.
|
69
|
+
stripeCustomerId?: string;
|
70
|
+
// Unique Stripe subscription ID.
|
71
|
+
stripeSubscriptionId?: string;
|
72
|
+
// Stripe price ID associated with the customer's subscription.
|
73
|
+
stripePriceId?: string;
|
74
|
+
// End date of the current billing period in Stripe.
|
75
|
+
stripeCurrentPeriodEnd?: Date;
|
76
|
+
// Timestamp when the customer was created.
|
77
|
+
createdAt: Date;
|
78
|
+
// Timestamp when the customer was last updated.
|
79
|
+
updatedAt: Date;
|
80
|
+
// List of users associated with the customer.
|
81
|
+
users: User[];
|
82
|
+
}
|
83
|
+
|
84
|
+
export interface Session {
|
85
|
+
// Unique identifier for the session.
|
86
|
+
id: string;
|
87
|
+
// Token associated with the session for authentication.
|
88
|
+
sessionToken: string;
|
89
|
+
// Reference to the user who owns this session.
|
90
|
+
userId: string;
|
91
|
+
// Expiration date and time of the session.
|
92
|
+
expires: Date;
|
93
|
+
// Relation to the User model.
|
94
|
+
user: User;
|
95
|
+
// Timestamp when the session was created.
|
96
|
+
createdAt: Date;
|
97
|
+
// Timestamp when the session was last updated.
|
98
|
+
updatedAt: Date;
|
99
|
+
}
|
100
|
+
|
101
|
+
export interface Authenticator {
|
102
|
+
// Unique identifier for the authenticator.
|
103
|
+
id: string;
|
104
|
+
// Reference to the user who owns this authenticator.
|
105
|
+
userId: string;
|
106
|
+
// Unique credential ID for the authenticator.
|
107
|
+
credentialID: string;
|
108
|
+
// Public key associated with the authenticator.
|
109
|
+
publicKey: string;
|
110
|
+
// Counter for the number of authentication attempts.
|
111
|
+
counter: number;
|
112
|
+
// Relation to the User model.
|
113
|
+
user: User;
|
114
|
+
// Timestamp when the authenticator was created.
|
115
|
+
createdAt: Date;
|
116
|
+
// Timestamp when the authenticator was last updated.
|
117
|
+
updatedAt: Date;
|
118
|
+
}
|
119
|
+
|
120
|
+
export enum TradeStatus {
|
121
|
+
PENDING = "PENDING",
|
122
|
+
OPEN = "OPEN",
|
123
|
+
PARTIAL = "PARTIAL",
|
124
|
+
COMPLETED = "COMPLETED"
|
125
|
+
}
|
126
|
+
|
127
|
+
// Simplified reference to Asset.
|
128
|
+
export interface Asset {
|
129
|
+
// Unique identifier for the asset.
|
130
|
+
id: string;
|
131
|
+
}
|
132
|
+
|
133
|
+
// Simplified reference to Action.
|
134
|
+
export interface Action {
|
135
|
+
// Unique identifier for the action.
|
136
|
+
id: string;
|
137
|
+
}
|
138
|
+
|
139
|
+
export interface Trade {
|
140
|
+
// Unique identifier for the trade.
|
141
|
+
id: string;
|
142
|
+
// Reference to the Alpaca account used for the trade.
|
143
|
+
alpacaAccountId: string;
|
144
|
+
// Reference to the asset being traded.
|
145
|
+
assetId: string;
|
146
|
+
// Quantity of the asset being traded.
|
147
|
+
qty: number;
|
148
|
+
// Price at which the asset was traded.
|
149
|
+
price: number;
|
150
|
+
// Total value of the trade (qty * price).
|
151
|
+
total: number;
|
152
|
+
// Signal that triggered the trade.
|
153
|
+
signal: string;
|
154
|
+
// Strategy used to execute the trade.
|
155
|
+
strategy: string;
|
156
|
+
// Analysis supporting the trade decision.
|
157
|
+
analysis: string;
|
158
|
+
// Confidence level in the trade decision.
|
159
|
+
confidence: number;
|
160
|
+
// Timestamp when the trade was executed.
|
161
|
+
timestamp: Date;
|
162
|
+
// Timestamp when the trade record was created.
|
163
|
+
createdAt: Date;
|
164
|
+
// Timestamp when the trade record was last updated.
|
165
|
+
updatedAt: Date;
|
166
|
+
// Current status of the trade.
|
167
|
+
status: TradeStatus;
|
168
|
+
// Relation to the AlpacaAccount model.
|
169
|
+
alpacaAccount: AlpacaAccount;
|
170
|
+
// Relation to the Asset model.
|
171
|
+
asset: Asset;
|
172
|
+
// List of actions associated with this trade.
|
173
|
+
actions: Action[];
|
174
|
+
}
|
175
|
+
|
176
|
+
export enum OrderType {
|
177
|
+
MARKET = "MARKET",
|
178
|
+
LIMIT = "LIMIT",
|
179
|
+
STOP = "STOP",
|
180
|
+
STOP_LIMIT = "STOP_LIMIT"
|
181
|
+
}
|
182
|
+
|
183
|
+
export enum TradeAction {
|
184
|
+
BUY = "BUY",
|
185
|
+
GET_OPTION_CONTRACTS = "GET_OPTION_CONTRACTS",
|
186
|
+
EXERCISE_OPTION = "EXERCISE_OPTION",
|
187
|
+
SELL = "SELL",
|
188
|
+
CANCEL = "CANCEL",
|
189
|
+
ADJUST = "ADJUST",
|
190
|
+
HEDGE = "HEDGE"
|
191
|
+
}
|
192
|
+
|
193
|
+
export enum OrderStatus {
|
194
|
+
PENDING = "PENDING",
|
195
|
+
FILLED = "FILLED",
|
196
|
+
CANCELLED = "CANCELLED",
|
197
|
+
REJECTED = "REJECTED"
|
198
|
+
}
|
199
|
+
|
200
|
+
export interface Order {
|
201
|
+
// Unique identifier for the order.
|
202
|
+
id: string;
|
203
|
+
// Reference to the Alpaca account used for the order.
|
204
|
+
alpacaAccountId: string;
|
205
|
+
// Reference to the asset being ordered.
|
206
|
+
assetId: string;
|
207
|
+
// Type of order, defined by OrderType enum.
|
208
|
+
type: OrderType;
|
209
|
+
// Action of the order, defined by TradeAction enum.
|
210
|
+
action: TradeAction;
|
211
|
+
// Quantity of the asset to be ordered.
|
212
|
+
qty: number;
|
213
|
+
// Price at which the asset is to be bought or sold.
|
214
|
+
price: number;
|
215
|
+
// Current status of the order, defined by OrderStatus enum.
|
216
|
+
status: OrderStatus;
|
217
|
+
// Timestamp when the order was created.
|
218
|
+
createdAt: Date;
|
219
|
+
// Timestamp when the order was last updated.
|
220
|
+
updatedAt: Date;
|
221
|
+
// Relation to the AlpacaAccount model.
|
222
|
+
alpacaAccount: AlpacaAccount;
|
223
|
+
// Relation to the Asset model.
|
224
|
+
asset: Asset;
|
225
|
+
}
|
226
|
+
|
227
|
+
export interface Position {
|
228
|
+
// Unique identifier for the position.
|
229
|
+
id: string;
|
230
|
+
// Reference to the associated asset.
|
231
|
+
assetId: string;
|
232
|
+
// Relation to the Asset model.
|
233
|
+
asset: Asset;
|
234
|
+
// The average price at which the asset was acquired.
|
235
|
+
averageEntryPrice: number;
|
236
|
+
// Total quantity of the asset held.
|
237
|
+
qty: number;
|
238
|
+
// Quantity of the asset available for trading.
|
239
|
+
qtyAvailable: number;
|
240
|
+
// Current market value of the position.
|
241
|
+
marketValue: number;
|
242
|
+
// Total cost basis of the position.
|
243
|
+
costBasis: number;
|
244
|
+
// Unrealized profit or loss of the position.
|
245
|
+
unrealizedPL: number;
|
246
|
+
// Unrealized profit or loss as a percentage.
|
247
|
+
unrealizedPLPC: number;
|
248
|
+
// Unrealized intraday profit or loss.
|
249
|
+
unrealisedIntradayPL: number;
|
250
|
+
// Unrealized intraday profit or loss as a percentage.
|
251
|
+
unrealisedIntradayPLPC: number;
|
252
|
+
// Current price of the asset.
|
253
|
+
currentPrice: number;
|
254
|
+
// Last traded price of the asset.
|
255
|
+
lastTradePrice: number;
|
256
|
+
// Price change of the asset for the day.
|
257
|
+
changeToday: number;
|
258
|
+
// Indicates if the asset is marginable.
|
259
|
+
assetMarginable: boolean;
|
260
|
+
// Relation to the AlpacaAccount model, if applicable.
|
261
|
+
alpacaAccount?: AlpacaAccount;
|
262
|
+
// Foreign key referencing the AlpacaAccount.
|
263
|
+
alpacaAccountId: string;
|
264
|
+
}
|
265
|
+
|
266
|
+
export enum AlertType {
|
267
|
+
SUCCESS = "SUCCESS",
|
268
|
+
WARNING = "WARNING",
|
269
|
+
ERROR = "ERROR",
|
270
|
+
INFO = "INFO"
|
271
|
+
}
|
272
|
+
|
273
|
+
export interface Alert {
|
274
|
+
// Unique identifier for the alert.
|
275
|
+
id: string;
|
276
|
+
// Reference to the Alpaca account associated with the alert.
|
277
|
+
alpacaAccountId: string;
|
278
|
+
// Message content of the alert.
|
279
|
+
message: string;
|
280
|
+
// Type of the alert, defined by AlertType enum.
|
281
|
+
type: AlertType;
|
282
|
+
// Indicates whether the alert has been read by the user.
|
283
|
+
isRead: boolean;
|
284
|
+
// Timestamp when the alert was created.
|
285
|
+
createdAt: Date;
|
286
|
+
// Timestamp when the alert was last updated.
|
287
|
+
updatedAt: Date;
|
288
|
+
// Relation to the AlpacaAccount model.
|
289
|
+
alpacaAccount: AlpacaAccount;
|
290
|
+
}
|
291
|
+
|
292
|
+
export interface AlpacaAccount {
|
293
|
+
// Unique identifier for the Alpaca account.
|
294
|
+
id: string;
|
295
|
+
// The type of Alpaca account (PAPER or LIVE).
|
296
|
+
type: AlpacaAccountType;
|
297
|
+
// API key for authenticating requests to Alpaca.
|
298
|
+
APIKey: string;
|
299
|
+
// API secret for authenticating requests to Alpaca.
|
300
|
+
APISecret: string;
|
301
|
+
// JSON configuration settings for the Alpaca account.
|
302
|
+
configuration?: any;
|
303
|
+
// Indicates whether the market is currently open for trading.
|
304
|
+
marketOpen: boolean;
|
305
|
+
// Relation to the User model who owns this Alpaca account.
|
306
|
+
user: User;
|
307
|
+
// Foreign key referencing the User.
|
308
|
+
userId: string;
|
309
|
+
// Timestamp when the Alpaca account was created.
|
310
|
+
createdAt: Date;
|
311
|
+
// Timestamp when the Alpaca account was last updated.
|
312
|
+
updatedAt: Date;
|
313
|
+
// List of trades executed through this Alpaca account.
|
314
|
+
trades: Trade[];
|
315
|
+
// List of orders placed through this Alpaca account.
|
316
|
+
orders: Order[];
|
317
|
+
// List of positions held in this Alpaca account.
|
318
|
+
positions: Position[];
|
319
|
+
// List of alerts generated for this Alpaca account.
|
320
|
+
alerts: Alert[];
|
321
|
+
}
|
322
|
+
|
323
|
+
export interface User {
|
324
|
+
// Unique identifier for the user.
|
325
|
+
id: string;
|
326
|
+
// The user's full name.
|
327
|
+
name?: string;
|
328
|
+
// The user's email address, must be unique.
|
329
|
+
email?: string;
|
330
|
+
// Timestamp when the user's email was verified.
|
331
|
+
emailVerified?: Date;
|
332
|
+
// URL to the user's profile image.
|
333
|
+
image?: string;
|
334
|
+
// Timestamp when the user account was created.
|
335
|
+
createdAt: Date;
|
336
|
+
// Timestamp when the user account was last updated.
|
337
|
+
updatedAt: Date;
|
338
|
+
// The role assigned to the user, determining permissions.
|
339
|
+
role: UserRole;
|
340
|
+
// A short biography or description of the user.
|
341
|
+
bio?: string;
|
342
|
+
// The user's job title or position.
|
343
|
+
jobTitle?: string;
|
344
|
+
// The type of Alpaca account the user currently holds.
|
345
|
+
currentAccount: AlpacaAccountType;
|
346
|
+
// Relation to the Customer model, if applicable.
|
347
|
+
customer?: Customer;
|
348
|
+
// Foreign key referencing the Customer.
|
349
|
+
customerId?: number;
|
350
|
+
// List of accounts associated with the user.
|
351
|
+
accounts: Account[];
|
352
|
+
// List of sessions associated with the user.
|
353
|
+
sessions: Session[];
|
354
|
+
// List of authenticators for the user.
|
355
|
+
authenticators: Authenticator[];
|
356
|
+
// The subscription plan the user is enrolled in.
|
357
|
+
plan?: SubscriptionPlan;
|
358
|
+
// List of Alpaca accounts linked to the user.
|
359
|
+
alpacaAccounts: AlpacaAccount[];
|
360
|
+
}
|
361
|
+
|
362
|
+
`;
|
363
|
+
//# sourceMappingURL=Account.js.map
|
@@ -0,0 +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\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 // 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 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 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 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";
|
2
|
+
//# sourceMappingURL=Account.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../../src/generated/typeStrings/Account.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,qrVAsW7B,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Account.js","sourceRoot":"","sources":["../../../src/generated/typeStrings/Account.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsWhC,CAAC"}
|