adaptic-backend 1.0.75 → 1.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/Account.cjs +255 -190
  2. package/Action.cjs +594 -524
  3. package/Alert.cjs +343 -278
  4. package/AlpacaAccount.cjs +1181 -1021
  5. package/Asset.cjs +478 -368
  6. package/Authenticator.cjs +276 -211
  7. package/Customer.cjs +255 -190
  8. package/NewsArticle.cjs +232 -212
  9. package/NewsArticleAssetSentiment.cjs +345 -290
  10. package/Order.cjs +676 -541
  11. package/Position.cjs +603 -488
  12. package/Session.cjs +279 -214
  13. package/Trade.cjs +748 -613
  14. package/User.cjs +394 -309
  15. package/package.json +1 -1
  16. package/server/Account.d.ts.map +1 -1
  17. package/server/Account.js.map +1 -1
  18. package/server/Account.mjs +255 -190
  19. package/server/Action.d.ts.map +1 -1
  20. package/server/Action.js.map +1 -1
  21. package/server/Action.mjs +594 -524
  22. package/server/Alert.d.ts.map +1 -1
  23. package/server/Alert.js.map +1 -1
  24. package/server/Alert.mjs +343 -278
  25. package/server/AlpacaAccount.d.ts.map +1 -1
  26. package/server/AlpacaAccount.js.map +1 -1
  27. package/server/AlpacaAccount.mjs +1181 -1021
  28. package/server/Asset.d.ts.map +1 -1
  29. package/server/Asset.js.map +1 -1
  30. package/server/Asset.mjs +478 -368
  31. package/server/Authenticator.d.ts.map +1 -1
  32. package/server/Authenticator.js.map +1 -1
  33. package/server/Authenticator.mjs +276 -211
  34. package/server/Customer.d.ts.map +1 -1
  35. package/server/Customer.js.map +1 -1
  36. package/server/Customer.mjs +255 -190
  37. package/server/NewsArticle.d.ts.map +1 -1
  38. package/server/NewsArticle.js.map +1 -1
  39. package/server/NewsArticle.mjs +232 -212
  40. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  41. package/server/NewsArticleAssetSentiment.js.map +1 -1
  42. package/server/NewsArticleAssetSentiment.mjs +345 -290
  43. package/server/Order.d.ts.map +1 -1
  44. package/server/Order.js.map +1 -1
  45. package/server/Order.mjs +676 -541
  46. package/server/Position.d.ts.map +1 -1
  47. package/server/Position.js.map +1 -1
  48. package/server/Position.mjs +603 -488
  49. package/server/Session.d.ts.map +1 -1
  50. package/server/Session.js.map +1 -1
  51. package/server/Session.mjs +279 -214
  52. package/server/Trade.d.ts.map +1 -1
  53. package/server/Trade.js.map +1 -1
  54. package/server/Trade.mjs +748 -613
  55. package/server/User.d.ts.map +1 -1
  56. package/server/User.js.map +1 -1
  57. package/server/User.mjs +394 -309
@@ -207,84 +207,109 @@ export const Customer = {
207
207
  stripeSubscriptionId: props.stripeSubscriptionId !== undefined ? props.stripeSubscriptionId : undefined,
208
208
  stripePriceId: props.stripePriceId !== undefined ? props.stripePriceId : undefined,
209
209
  stripeCurrentPeriodEnd: props.stripeCurrentPeriodEnd !== undefined ? props.stripeCurrentPeriodEnd : undefined,
210
- users: props.users ? {
211
- connectOrCreate: props.users.map((item) => ({
212
- where: {
213
- id: item.id !== undefined ? item.id : undefined,
214
- email: item.email !== undefined ? item.email : undefined,
215
- name: item.name !== undefined ? {
216
- equals: item.name
217
- } : undefined,
218
- },
219
- create: {
220
- name: item.name !== undefined ? item.name : undefined,
221
- email: item.email !== undefined ? item.email : undefined,
222
- emailVerified: item.emailVerified !== undefined ? item.emailVerified : undefined,
223
- image: item.image !== undefined ? item.image : undefined,
224
- role: item.role !== undefined ? item.role : undefined,
225
- bio: item.bio !== undefined ? item.bio : undefined,
226
- jobTitle: item.jobTitle !== undefined ? item.jobTitle : undefined,
227
- currentAccount: item.currentAccount !== undefined ? item.currentAccount : undefined,
228
- plan: item.plan !== undefined ? item.plan : undefined,
229
- accounts: item.accounts ? {
230
- connectOrCreate: item.accounts.map((item) => ({
231
- where: {
232
- id: item.id !== undefined ? item.id : undefined,
233
- },
234
- create: {
235
- type: item.type !== undefined ? item.type : undefined,
236
- provider: item.provider !== undefined ? item.provider : undefined,
237
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
238
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
239
- access_token: item.access_token !== undefined ? item.access_token : undefined,
240
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
241
- token_type: item.token_type !== undefined ? item.token_type : undefined,
242
- scope: item.scope !== undefined ? item.scope : undefined,
243
- id_token: item.id_token !== undefined ? item.id_token : undefined,
244
- session_state: item.session_state !== undefined ? item.session_state : undefined,
245
- },
246
- }))
247
- } : undefined,
248
- sessions: item.sessions ? {
249
- connectOrCreate: item.sessions.map((item) => ({
250
- where: {
251
- id: item.id !== undefined ? item.id : undefined,
252
- },
253
- create: {
254
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
255
- expires: item.expires !== undefined ? item.expires : undefined,
256
- },
257
- }))
258
- } : undefined,
259
- authenticators: item.authenticators ? {
260
- connectOrCreate: item.authenticators.map((item) => ({
261
- where: {
262
- id: item.id !== undefined ? item.id : undefined,
263
- },
264
- create: {
265
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
266
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
267
- counter: item.counter !== undefined ? item.counter : undefined,
268
- },
269
- }))
270
- } : undefined,
271
- alpacaAccounts: item.alpacaAccounts ? {
272
- connectOrCreate: item.alpacaAccounts.map((item) => ({
273
- where: {
274
- id: item.id !== undefined ? item.id : undefined,
275
- },
276
- create: {
277
- type: item.type !== undefined ? item.type : undefined,
278
- APIKey: item.APIKey !== undefined ? item.APIKey : undefined,
279
- APISecret: item.APISecret !== undefined ? item.APISecret : undefined,
280
- configuration: item.configuration !== undefined ? item.configuration : undefined,
281
- marketOpen: item.marketOpen !== undefined ? item.marketOpen : undefined,
282
- },
283
- }))
284
- } : undefined,
285
- },
286
- }))
287
- } : undefined,
210
+ users: props.users ?
211
+ typeof props.users[0] === 'object' && Object.keys(props.users).length === 1 && Object.keys(props.users)[0] === 'id'
212
+ ? { connect: props.users.map((item) => ({
213
+ id: item.id
214
+ }))
215
+ }
216
+ : { connectOrCreate: props.users.map((item) => ({
217
+ where: {
218
+ id: item.id !== undefined ? item.id : undefined,
219
+ email: item.email !== undefined ? item.email : undefined,
220
+ name: item.name !== undefined ? {
221
+ equals: item.name
222
+ } : undefined,
223
+ },
224
+ create: {
225
+ name: item.name !== undefined ? item.name : undefined,
226
+ email: item.email !== undefined ? item.email : undefined,
227
+ emailVerified: item.emailVerified !== undefined ? item.emailVerified : undefined,
228
+ image: item.image !== undefined ? item.image : undefined,
229
+ role: item.role !== undefined ? item.role : undefined,
230
+ bio: item.bio !== undefined ? item.bio : undefined,
231
+ jobTitle: item.jobTitle !== undefined ? item.jobTitle : undefined,
232
+ currentAccount: item.currentAccount !== undefined ? item.currentAccount : undefined,
233
+ plan: item.plan !== undefined ? item.plan : undefined,
234
+ accounts: item.accounts ?
235
+ typeof item.accounts[0] === 'object' && Object.keys(item.accounts).length === 1 && Object.keys(item.accounts)[0] === 'id'
236
+ ? { connect: item.accounts.map((item) => ({
237
+ id: item.id
238
+ }))
239
+ }
240
+ : { connectOrCreate: item.accounts.map((item) => ({
241
+ where: {
242
+ id: item.id !== undefined ? item.id : undefined,
243
+ },
244
+ create: {
245
+ type: item.type !== undefined ? item.type : undefined,
246
+ provider: item.provider !== undefined ? item.provider : undefined,
247
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
248
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
249
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
250
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
251
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
252
+ scope: item.scope !== undefined ? item.scope : undefined,
253
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
254
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
255
+ },
256
+ }))
257
+ } : undefined,
258
+ sessions: item.sessions ?
259
+ typeof item.sessions[0] === 'object' && Object.keys(item.sessions).length === 1 && Object.keys(item.sessions)[0] === 'id'
260
+ ? { connect: item.sessions.map((item) => ({
261
+ id: item.id
262
+ }))
263
+ }
264
+ : { connectOrCreate: item.sessions.map((item) => ({
265
+ where: {
266
+ id: item.id !== undefined ? item.id : undefined,
267
+ },
268
+ create: {
269
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
270
+ expires: item.expires !== undefined ? item.expires : undefined,
271
+ },
272
+ }))
273
+ } : undefined,
274
+ authenticators: item.authenticators ?
275
+ typeof item.authenticators[0] === 'object' && Object.keys(item.authenticators).length === 1 && Object.keys(item.authenticators)[0] === 'id'
276
+ ? { connect: item.authenticators.map((item) => ({
277
+ id: item.id
278
+ }))
279
+ }
280
+ : { connectOrCreate: item.authenticators.map((item) => ({
281
+ where: {
282
+ id: item.id !== undefined ? item.id : undefined,
283
+ },
284
+ create: {
285
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
286
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
287
+ counter: item.counter !== undefined ? item.counter : undefined,
288
+ },
289
+ }))
290
+ } : undefined,
291
+ alpacaAccounts: item.alpacaAccounts ?
292
+ typeof item.alpacaAccounts[0] === 'object' && Object.keys(item.alpacaAccounts).length === 1 && Object.keys(item.alpacaAccounts)[0] === 'id'
293
+ ? { connect: item.alpacaAccounts.map((item) => ({
294
+ id: item.id
295
+ }))
296
+ }
297
+ : { connectOrCreate: item.alpacaAccounts.map((item) => ({
298
+ where: {
299
+ id: item.id !== undefined ? item.id : undefined,
300
+ },
301
+ create: {
302
+ type: item.type !== undefined ? item.type : undefined,
303
+ APIKey: item.APIKey !== undefined ? item.APIKey : undefined,
304
+ APISecret: item.APISecret !== undefined ? item.APISecret : undefined,
305
+ configuration: item.configuration !== undefined ? item.configuration : undefined,
306
+ marketOpen: item.marketOpen !== undefined ? item.marketOpen : undefined,
307
+ },
308
+ }))
309
+ } : undefined,
310
+ },
311
+ }))
312
+ } : undefined,
288
313
  },
289
314
  };
290
315
  const filteredVariables = removeUndefinedProps(variables);
@@ -758,62 +783,82 @@ export const Customer = {
758
783
  jobTitle: item.jobTitle !== undefined ? item.jobTitle : undefined,
759
784
  currentAccount: item.currentAccount !== undefined ? item.currentAccount : undefined,
760
785
  plan: item.plan !== undefined ? item.plan : undefined,
761
- accounts: item.accounts ? {
762
- connectOrCreate: item.accounts.map((item) => ({
763
- where: {
764
- id: item.id !== undefined ? item.id : undefined,
765
- },
766
- create: {
767
- type: item.type !== undefined ? item.type : undefined,
768
- provider: item.provider !== undefined ? item.provider : undefined,
769
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
770
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
771
- access_token: item.access_token !== undefined ? item.access_token : undefined,
772
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
773
- token_type: item.token_type !== undefined ? item.token_type : undefined,
774
- scope: item.scope !== undefined ? item.scope : undefined,
775
- id_token: item.id_token !== undefined ? item.id_token : undefined,
776
- session_state: item.session_state !== undefined ? item.session_state : undefined,
777
- },
778
- }))
779
- } : undefined,
780
- sessions: item.sessions ? {
781
- connectOrCreate: item.sessions.map((item) => ({
782
- where: {
783
- id: item.id !== undefined ? item.id : undefined,
784
- },
785
- create: {
786
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
787
- expires: item.expires !== undefined ? item.expires : undefined,
788
- },
789
- }))
790
- } : undefined,
791
- authenticators: item.authenticators ? {
792
- connectOrCreate: item.authenticators.map((item) => ({
793
- where: {
794
- id: item.id !== undefined ? item.id : undefined,
795
- },
796
- create: {
797
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
798
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
799
- counter: item.counter !== undefined ? item.counter : undefined,
800
- },
801
- }))
802
- } : undefined,
803
- alpacaAccounts: item.alpacaAccounts ? {
804
- connectOrCreate: item.alpacaAccounts.map((item) => ({
805
- where: {
806
- id: item.id !== undefined ? item.id : undefined,
807
- },
808
- create: {
809
- type: item.type !== undefined ? item.type : undefined,
810
- APIKey: item.APIKey !== undefined ? item.APIKey : undefined,
811
- APISecret: item.APISecret !== undefined ? item.APISecret : undefined,
812
- configuration: item.configuration !== undefined ? item.configuration : undefined,
813
- marketOpen: item.marketOpen !== undefined ? item.marketOpen : undefined,
814
- },
815
- }))
816
- } : undefined,
786
+ accounts: item.accounts ?
787
+ typeof item.accounts[0] === 'object' && Object.keys(item.accounts).length === 1 && Object.keys(item.accounts)[0] === 'id'
788
+ ? { connect: item.accounts.map((item) => ({
789
+ id: item.id
790
+ }))
791
+ }
792
+ : { connectOrCreate: item.accounts.map((item) => ({
793
+ where: {
794
+ id: item.id !== undefined ? item.id : undefined,
795
+ },
796
+ create: {
797
+ type: item.type !== undefined ? item.type : undefined,
798
+ provider: item.provider !== undefined ? item.provider : undefined,
799
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
800
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
801
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
802
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
803
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
804
+ scope: item.scope !== undefined ? item.scope : undefined,
805
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
806
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
807
+ },
808
+ }))
809
+ } : undefined,
810
+ sessions: item.sessions ?
811
+ typeof item.sessions[0] === 'object' && Object.keys(item.sessions).length === 1 && Object.keys(item.sessions)[0] === 'id'
812
+ ? { connect: item.sessions.map((item) => ({
813
+ id: item.id
814
+ }))
815
+ }
816
+ : { connectOrCreate: item.sessions.map((item) => ({
817
+ where: {
818
+ id: item.id !== undefined ? item.id : undefined,
819
+ },
820
+ create: {
821
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
822
+ expires: item.expires !== undefined ? item.expires : undefined,
823
+ },
824
+ }))
825
+ } : undefined,
826
+ authenticators: item.authenticators ?
827
+ typeof item.authenticators[0] === 'object' && Object.keys(item.authenticators).length === 1 && Object.keys(item.authenticators)[0] === 'id'
828
+ ? { connect: item.authenticators.map((item) => ({
829
+ id: item.id
830
+ }))
831
+ }
832
+ : { connectOrCreate: item.authenticators.map((item) => ({
833
+ where: {
834
+ id: item.id !== undefined ? item.id : undefined,
835
+ },
836
+ create: {
837
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
838
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
839
+ counter: item.counter !== undefined ? item.counter : undefined,
840
+ },
841
+ }))
842
+ } : undefined,
843
+ alpacaAccounts: item.alpacaAccounts ?
844
+ typeof item.alpacaAccounts[0] === 'object' && Object.keys(item.alpacaAccounts).length === 1 && Object.keys(item.alpacaAccounts)[0] === 'id'
845
+ ? { connect: item.alpacaAccounts.map((item) => ({
846
+ id: item.id
847
+ }))
848
+ }
849
+ : { connectOrCreate: item.alpacaAccounts.map((item) => ({
850
+ where: {
851
+ id: item.id !== undefined ? item.id : undefined,
852
+ },
853
+ create: {
854
+ type: item.type !== undefined ? item.type : undefined,
855
+ APIKey: item.APIKey !== undefined ? item.APIKey : undefined,
856
+ APISecret: item.APISecret !== undefined ? item.APISecret : undefined,
857
+ configuration: item.configuration !== undefined ? item.configuration : undefined,
858
+ marketOpen: item.marketOpen !== undefined ? item.marketOpen : undefined,
859
+ },
860
+ }))
861
+ } : undefined,
817
862
  },
818
863
  }))
819
864
  } : undefined,
@@ -1071,62 +1116,82 @@ export const Customer = {
1071
1116
  jobTitle: item.jobTitle !== undefined ? item.jobTitle : undefined,
1072
1117
  currentAccount: item.currentAccount !== undefined ? item.currentAccount : undefined,
1073
1118
  plan: item.plan !== undefined ? item.plan : undefined,
1074
- accounts: item.accounts ? {
1075
- connectOrCreate: item.accounts.map((item) => ({
1076
- where: {
1077
- id: item.id !== undefined ? item.id : undefined,
1078
- },
1079
- create: {
1080
- type: item.type !== undefined ? item.type : undefined,
1081
- provider: item.provider !== undefined ? item.provider : undefined,
1082
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
1083
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
1084
- access_token: item.access_token !== undefined ? item.access_token : undefined,
1085
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
1086
- token_type: item.token_type !== undefined ? item.token_type : undefined,
1087
- scope: item.scope !== undefined ? item.scope : undefined,
1088
- id_token: item.id_token !== undefined ? item.id_token : undefined,
1089
- session_state: item.session_state !== undefined ? item.session_state : undefined,
1090
- },
1091
- }))
1092
- } : undefined,
1093
- sessions: item.sessions ? {
1094
- connectOrCreate: item.sessions.map((item) => ({
1095
- where: {
1096
- id: item.id !== undefined ? item.id : undefined,
1097
- },
1098
- create: {
1099
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
1100
- expires: item.expires !== undefined ? item.expires : undefined,
1101
- },
1102
- }))
1103
- } : undefined,
1104
- authenticators: item.authenticators ? {
1105
- connectOrCreate: item.authenticators.map((item) => ({
1106
- where: {
1107
- id: item.id !== undefined ? item.id : undefined,
1108
- },
1109
- create: {
1110
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
1111
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
1112
- counter: item.counter !== undefined ? item.counter : undefined,
1113
- },
1114
- }))
1115
- } : undefined,
1116
- alpacaAccounts: item.alpacaAccounts ? {
1117
- connectOrCreate: item.alpacaAccounts.map((item) => ({
1118
- where: {
1119
- id: item.id !== undefined ? item.id : undefined,
1120
- },
1121
- create: {
1122
- type: item.type !== undefined ? item.type : undefined,
1123
- APIKey: item.APIKey !== undefined ? item.APIKey : undefined,
1124
- APISecret: item.APISecret !== undefined ? item.APISecret : undefined,
1125
- configuration: item.configuration !== undefined ? item.configuration : undefined,
1126
- marketOpen: item.marketOpen !== undefined ? item.marketOpen : undefined,
1127
- },
1128
- }))
1129
- } : undefined,
1119
+ accounts: item.accounts ?
1120
+ typeof item.accounts[0] === 'object' && Object.keys(item.accounts).length === 1 && Object.keys(item.accounts)[0] === 'id'
1121
+ ? { connect: item.accounts.map((item) => ({
1122
+ id: item.id
1123
+ }))
1124
+ }
1125
+ : { connectOrCreate: item.accounts.map((item) => ({
1126
+ where: {
1127
+ id: item.id !== undefined ? item.id : undefined,
1128
+ },
1129
+ create: {
1130
+ type: item.type !== undefined ? item.type : undefined,
1131
+ provider: item.provider !== undefined ? item.provider : undefined,
1132
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
1133
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
1134
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
1135
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
1136
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
1137
+ scope: item.scope !== undefined ? item.scope : undefined,
1138
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
1139
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
1140
+ },
1141
+ }))
1142
+ } : undefined,
1143
+ sessions: item.sessions ?
1144
+ typeof item.sessions[0] === 'object' && Object.keys(item.sessions).length === 1 && Object.keys(item.sessions)[0] === 'id'
1145
+ ? { connect: item.sessions.map((item) => ({
1146
+ id: item.id
1147
+ }))
1148
+ }
1149
+ : { connectOrCreate: item.sessions.map((item) => ({
1150
+ where: {
1151
+ id: item.id !== undefined ? item.id : undefined,
1152
+ },
1153
+ create: {
1154
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
1155
+ expires: item.expires !== undefined ? item.expires : undefined,
1156
+ },
1157
+ }))
1158
+ } : undefined,
1159
+ authenticators: item.authenticators ?
1160
+ typeof item.authenticators[0] === 'object' && Object.keys(item.authenticators).length === 1 && Object.keys(item.authenticators)[0] === 'id'
1161
+ ? { connect: item.authenticators.map((item) => ({
1162
+ id: item.id
1163
+ }))
1164
+ }
1165
+ : { connectOrCreate: item.authenticators.map((item) => ({
1166
+ where: {
1167
+ id: item.id !== undefined ? item.id : undefined,
1168
+ },
1169
+ create: {
1170
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
1171
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
1172
+ counter: item.counter !== undefined ? item.counter : undefined,
1173
+ },
1174
+ }))
1175
+ } : undefined,
1176
+ alpacaAccounts: item.alpacaAccounts ?
1177
+ typeof item.alpacaAccounts[0] === 'object' && Object.keys(item.alpacaAccounts).length === 1 && Object.keys(item.alpacaAccounts)[0] === 'id'
1178
+ ? { connect: item.alpacaAccounts.map((item) => ({
1179
+ id: item.id
1180
+ }))
1181
+ }
1182
+ : { connectOrCreate: item.alpacaAccounts.map((item) => ({
1183
+ where: {
1184
+ id: item.id !== undefined ? item.id : undefined,
1185
+ },
1186
+ create: {
1187
+ type: item.type !== undefined ? item.type : undefined,
1188
+ APIKey: item.APIKey !== undefined ? item.APIKey : undefined,
1189
+ APISecret: item.APISecret !== undefined ? item.APISecret : undefined,
1190
+ configuration: item.configuration !== undefined ? item.configuration : undefined,
1191
+ marketOpen: item.marketOpen !== undefined ? item.marketOpen : undefined,
1192
+ },
1193
+ }))
1194
+ } : undefined,
1130
1195
  },
1131
1196
  }))
1132
1197
  } : undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"NewsArticle.d.ts","sourceRoot":"","sources":["../../src/NewsArticle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAKnG;;GAEG;AAEH,eAAO,MAAM,WAAW;IAEtB;;;;OAIG;kBAEiB,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IA4S9D;;;;OAIG;sBACqB,eAAe,EAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IA6C7E;;;;OAIG;kBACiB,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAilB9D;;;;OAIG;sBACqB,eAAe,EAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAua7E;;;;OAIG;kBACiB,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IA8M9D;;;;OAIG;eACc,eAAe,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAiNlE;;;OAGG;cACa,OAAO,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC;IAsMjD;;;;OAIG;oBACmB,eAAe,GAAG,OAAO,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC;CAyN1E,CAAC"}
1
+ {"version":3,"file":"NewsArticle.d.ts","sourceRoot":"","sources":["../../src/NewsArticle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAKnG;;GAEG;AAEH,eAAO,MAAM,WAAW;IAEtB;;;;OAIG;kBAEiB,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAsT9D;;;;OAIG;sBACqB,eAAe,EAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IA6C7E;;;;OAIG;kBACiB,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAslB9D;;;;OAIG;sBACqB,eAAe,EAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IA4a7E;;;;OAIG;kBACiB,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IA8M9D;;;;OAIG;eACc,eAAe,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAiNlE;;;OAGG;cACa,OAAO,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC;IAsMjD;;;;OAIG;oBACmB,eAAe,GAAG,OAAO,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC;CAyN1E,CAAC"}