adaptic-backend 1.0.78 → 1.0.79
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/Account.cjs +45 -54
- package/Alert.cjs +45 -54
- package/AlpacaAccount.cjs +80 -96
- package/Asset.cjs +35 -42
- package/Authenticator.cjs +45 -54
- package/Customer.cjs +65 -78
- package/NewsArticle.cjs +5 -6
- package/NewsArticleAssetSentiment.cjs +45 -54
- package/Order.cjs +90 -108
- package/Position.cjs +90 -108
- package/Session.cjs +45 -54
- package/Trade.cjs +95 -114
- package/User.cjs +80 -96
- package/package.json +1 -1
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +45 -54
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +45 -54
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +80 -96
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +35 -42
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +45 -54
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +65 -78
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +5 -6
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +45 -54
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +90 -108
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +90 -108
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +45 -54
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +95 -114
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +80 -96
package/Customer.cjs
CHANGED
@@ -210,12 +210,11 @@ exports.Customer = {
|
|
210
210
|
stripePriceId: props.stripePriceId !== undefined ? props.stripePriceId : undefined,
|
211
211
|
stripeCurrentPeriodEnd: props.stripeCurrentPeriodEnd !== undefined ? props.stripeCurrentPeriodEnd : undefined,
|
212
212
|
users: props.users ?
|
213
|
-
Array.isArray(props.users) && props.users.length > 0
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
}
|
213
|
+
Array.isArray(props.users) && props.users.length > 0 && props.users.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
214
|
+
connect: props.users.map((item) => ({
|
215
|
+
id: item.id
|
216
|
+
}))
|
217
|
+
}
|
219
218
|
: { connectOrCreate: props.users.map((item) => ({
|
220
219
|
where: {
|
221
220
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -235,12 +234,11 @@ exports.Customer = {
|
|
235
234
|
currentAccount: item.currentAccount !== undefined ? item.currentAccount : undefined,
|
236
235
|
plan: item.plan !== undefined ? item.plan : undefined,
|
237
236
|
accounts: item.accounts ?
|
238
|
-
Array.isArray(item.accounts) && item.accounts.length > 0
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
}
|
237
|
+
Array.isArray(item.accounts) && item.accounts.length > 0 && item.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
238
|
+
connect: item.accounts.map((item) => ({
|
239
|
+
id: item.id
|
240
|
+
}))
|
241
|
+
}
|
244
242
|
: { connectOrCreate: item.accounts.map((item) => ({
|
245
243
|
where: {
|
246
244
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -260,12 +258,11 @@ exports.Customer = {
|
|
260
258
|
}))
|
261
259
|
} : undefined,
|
262
260
|
sessions: item.sessions ?
|
263
|
-
Array.isArray(item.sessions) && item.sessions.length > 0
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
}
|
261
|
+
Array.isArray(item.sessions) && item.sessions.length > 0 && item.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
262
|
+
connect: item.sessions.map((item) => ({
|
263
|
+
id: item.id
|
264
|
+
}))
|
265
|
+
}
|
269
266
|
: { connectOrCreate: item.sessions.map((item) => ({
|
270
267
|
where: {
|
271
268
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -277,12 +274,11 @@ exports.Customer = {
|
|
277
274
|
}))
|
278
275
|
} : undefined,
|
279
276
|
authenticators: item.authenticators ?
|
280
|
-
Array.isArray(item.authenticators) && item.authenticators.length > 0
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
}
|
277
|
+
Array.isArray(item.authenticators) && item.authenticators.length > 0 && item.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
278
|
+
connect: item.authenticators.map((item) => ({
|
279
|
+
id: item.id
|
280
|
+
}))
|
281
|
+
}
|
286
282
|
: { connectOrCreate: item.authenticators.map((item) => ({
|
287
283
|
where: {
|
288
284
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -295,12 +291,11 @@ exports.Customer = {
|
|
295
291
|
}))
|
296
292
|
} : undefined,
|
297
293
|
alpacaAccounts: item.alpacaAccounts ?
|
298
|
-
Array.isArray(item.alpacaAccounts) && item.alpacaAccounts.length > 0
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
}
|
294
|
+
Array.isArray(item.alpacaAccounts) && item.alpacaAccounts.length > 0 && item.alpacaAccounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
295
|
+
connect: item.alpacaAccounts.map((item) => ({
|
296
|
+
id: item.id
|
297
|
+
}))
|
298
|
+
}
|
304
299
|
: { connectOrCreate: item.alpacaAccounts.map((item) => ({
|
305
300
|
where: {
|
306
301
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -791,12 +786,11 @@ exports.Customer = {
|
|
791
786
|
currentAccount: item.currentAccount !== undefined ? item.currentAccount : undefined,
|
792
787
|
plan: item.plan !== undefined ? item.plan : undefined,
|
793
788
|
accounts: item.accounts ?
|
794
|
-
Array.isArray(item.accounts) && item.accounts.length > 0
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
}
|
789
|
+
Array.isArray(item.accounts) && item.accounts.length > 0 && item.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
790
|
+
connect: item.accounts.map((item) => ({
|
791
|
+
id: item.id
|
792
|
+
}))
|
793
|
+
}
|
800
794
|
: { connectOrCreate: item.accounts.map((item) => ({
|
801
795
|
where: {
|
802
796
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -816,12 +810,11 @@ exports.Customer = {
|
|
816
810
|
}))
|
817
811
|
} : undefined,
|
818
812
|
sessions: item.sessions ?
|
819
|
-
Array.isArray(item.sessions) && item.sessions.length > 0
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
}
|
813
|
+
Array.isArray(item.sessions) && item.sessions.length > 0 && item.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
814
|
+
connect: item.sessions.map((item) => ({
|
815
|
+
id: item.id
|
816
|
+
}))
|
817
|
+
}
|
825
818
|
: { connectOrCreate: item.sessions.map((item) => ({
|
826
819
|
where: {
|
827
820
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -833,12 +826,11 @@ exports.Customer = {
|
|
833
826
|
}))
|
834
827
|
} : undefined,
|
835
828
|
authenticators: item.authenticators ?
|
836
|
-
Array.isArray(item.authenticators) && item.authenticators.length > 0
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
}
|
829
|
+
Array.isArray(item.authenticators) && item.authenticators.length > 0 && item.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
830
|
+
connect: item.authenticators.map((item) => ({
|
831
|
+
id: item.id
|
832
|
+
}))
|
833
|
+
}
|
842
834
|
: { connectOrCreate: item.authenticators.map((item) => ({
|
843
835
|
where: {
|
844
836
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -851,12 +843,11 @@ exports.Customer = {
|
|
851
843
|
}))
|
852
844
|
} : undefined,
|
853
845
|
alpacaAccounts: item.alpacaAccounts ?
|
854
|
-
Array.isArray(item.alpacaAccounts) && item.alpacaAccounts.length > 0
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
}
|
846
|
+
Array.isArray(item.alpacaAccounts) && item.alpacaAccounts.length > 0 && item.alpacaAccounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
847
|
+
connect: item.alpacaAccounts.map((item) => ({
|
848
|
+
id: item.id
|
849
|
+
}))
|
850
|
+
}
|
860
851
|
: { connectOrCreate: item.alpacaAccounts.map((item) => ({
|
861
852
|
where: {
|
862
853
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1128,12 +1119,11 @@ exports.Customer = {
|
|
1128
1119
|
currentAccount: item.currentAccount !== undefined ? item.currentAccount : undefined,
|
1129
1120
|
plan: item.plan !== undefined ? item.plan : undefined,
|
1130
1121
|
accounts: item.accounts ?
|
1131
|
-
Array.isArray(item.accounts) && item.accounts.length > 0
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
}
|
1122
|
+
Array.isArray(item.accounts) && item.accounts.length > 0 && item.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1123
|
+
connect: item.accounts.map((item) => ({
|
1124
|
+
id: item.id
|
1125
|
+
}))
|
1126
|
+
}
|
1137
1127
|
: { connectOrCreate: item.accounts.map((item) => ({
|
1138
1128
|
where: {
|
1139
1129
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1153,12 +1143,11 @@ exports.Customer = {
|
|
1153
1143
|
}))
|
1154
1144
|
} : undefined,
|
1155
1145
|
sessions: item.sessions ?
|
1156
|
-
Array.isArray(item.sessions) && item.sessions.length > 0
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
}
|
1146
|
+
Array.isArray(item.sessions) && item.sessions.length > 0 && item.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1147
|
+
connect: item.sessions.map((item) => ({
|
1148
|
+
id: item.id
|
1149
|
+
}))
|
1150
|
+
}
|
1162
1151
|
: { connectOrCreate: item.sessions.map((item) => ({
|
1163
1152
|
where: {
|
1164
1153
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1170,12 +1159,11 @@ exports.Customer = {
|
|
1170
1159
|
}))
|
1171
1160
|
} : undefined,
|
1172
1161
|
authenticators: item.authenticators ?
|
1173
|
-
Array.isArray(item.authenticators) && item.authenticators.length > 0
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
}
|
1162
|
+
Array.isArray(item.authenticators) && item.authenticators.length > 0 && item.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1163
|
+
connect: item.authenticators.map((item) => ({
|
1164
|
+
id: item.id
|
1165
|
+
}))
|
1166
|
+
}
|
1179
1167
|
: { connectOrCreate: item.authenticators.map((item) => ({
|
1180
1168
|
where: {
|
1181
1169
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1188,12 +1176,11 @@ exports.Customer = {
|
|
1188
1176
|
}))
|
1189
1177
|
} : undefined,
|
1190
1178
|
alpacaAccounts: item.alpacaAccounts ?
|
1191
|
-
Array.isArray(item.alpacaAccounts) && item.alpacaAccounts.length > 0
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
}
|
1179
|
+
Array.isArray(item.alpacaAccounts) && item.alpacaAccounts.length > 0 && item.alpacaAccounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1180
|
+
connect: item.alpacaAccounts.map((item) => ({
|
1181
|
+
id: item.id
|
1182
|
+
}))
|
1183
|
+
}
|
1197
1184
|
: { connectOrCreate: item.alpacaAccounts.map((item) => ({
|
1198
1185
|
where: {
|
1199
1186
|
id: item.id !== undefined ? item.id : undefined,
|
package/NewsArticle.cjs
CHANGED
@@ -211,12 +211,11 @@ exports.NewsArticle = {
|
|
211
211
|
topics: props.topics !== undefined ? props.topics : undefined,
|
212
212
|
logo: props.logo !== undefined ? props.logo : undefined,
|
213
213
|
assets: props.assets ?
|
214
|
-
Array.isArray(props.assets) && props.assets.length > 0
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
}
|
214
|
+
Array.isArray(props.assets) && props.assets.length > 0 && props.assets.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
215
|
+
connect: props.assets.map((item) => ({
|
216
|
+
id: item.id
|
217
|
+
}))
|
218
|
+
}
|
220
219
|
: { connectOrCreate: props.assets.map((item) => ({
|
221
220
|
where: {
|
222
221
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -336,12 +336,11 @@ exports.NewsArticleAssetSentiment = {
|
|
336
336
|
sellPrice: props.asset.sellPrice !== undefined ? props.asset.sellPrice : undefined,
|
337
337
|
buyPrice: props.asset.buyPrice !== undefined ? props.asset.buyPrice : undefined,
|
338
338
|
trades: props.asset.trades ?
|
339
|
-
Array.isArray(props.asset.trades) && props.asset.trades.length > 0
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
}
|
339
|
+
Array.isArray(props.asset.trades) && props.asset.trades.length > 0 && props.asset.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
340
|
+
connect: props.asset.trades.map((item) => ({
|
341
|
+
id: item.id
|
342
|
+
}))
|
343
|
+
}
|
345
344
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
346
345
|
where: {
|
347
346
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -361,12 +360,11 @@ exports.NewsArticleAssetSentiment = {
|
|
361
360
|
}))
|
362
361
|
} : undefined,
|
363
362
|
orders: props.asset.orders ?
|
364
|
-
Array.isArray(props.asset.orders) && props.asset.orders.length > 0
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
}
|
363
|
+
Array.isArray(props.asset.orders) && props.asset.orders.length > 0 && props.asset.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
364
|
+
connect: props.asset.orders.map((item) => ({
|
365
|
+
id: item.id
|
366
|
+
}))
|
367
|
+
}
|
370
368
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
371
369
|
where: {
|
372
370
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -392,12 +390,11 @@ exports.NewsArticleAssetSentiment = {
|
|
392
390
|
}))
|
393
391
|
} : undefined,
|
394
392
|
positions: props.asset.positions ?
|
395
|
-
Array.isArray(props.asset.positions) && props.asset.positions.length > 0
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
}
|
393
|
+
Array.isArray(props.asset.positions) && props.asset.positions.length > 0 && props.asset.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
394
|
+
connect: props.asset.positions.map((item) => ({
|
395
|
+
id: item.id
|
396
|
+
}))
|
397
|
+
}
|
401
398
|
: { connectOrCreate: props.asset.positions.map((item) => ({
|
402
399
|
where: {
|
403
400
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1235,12 +1232,11 @@ exports.NewsArticleAssetSentiment = {
|
|
1235
1232
|
sellPrice: props.asset.sellPrice !== undefined ? props.asset.sellPrice : undefined,
|
1236
1233
|
buyPrice: props.asset.buyPrice !== undefined ? props.asset.buyPrice : undefined,
|
1237
1234
|
trades: props.asset.trades ?
|
1238
|
-
Array.isArray(props.asset.trades) && props.asset.trades.length > 0
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
}
|
1235
|
+
Array.isArray(props.asset.trades) && props.asset.trades.length > 0 && props.asset.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1236
|
+
connect: props.asset.trades.map((item) => ({
|
1237
|
+
id: item.id
|
1238
|
+
}))
|
1239
|
+
}
|
1244
1240
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
1245
1241
|
where: {
|
1246
1242
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1260,12 +1256,11 @@ exports.NewsArticleAssetSentiment = {
|
|
1260
1256
|
}))
|
1261
1257
|
} : undefined,
|
1262
1258
|
orders: props.asset.orders ?
|
1263
|
-
Array.isArray(props.asset.orders) && props.asset.orders.length > 0
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
}
|
1259
|
+
Array.isArray(props.asset.orders) && props.asset.orders.length > 0 && props.asset.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1260
|
+
connect: props.asset.orders.map((item) => ({
|
1261
|
+
id: item.id
|
1262
|
+
}))
|
1263
|
+
}
|
1269
1264
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
1270
1265
|
where: {
|
1271
1266
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1291,12 +1286,11 @@ exports.NewsArticleAssetSentiment = {
|
|
1291
1286
|
}))
|
1292
1287
|
} : undefined,
|
1293
1288
|
positions: props.asset.positions ?
|
1294
|
-
Array.isArray(props.asset.positions) && props.asset.positions.length > 0
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
}
|
1289
|
+
Array.isArray(props.asset.positions) && props.asset.positions.length > 0 && props.asset.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1290
|
+
connect: props.asset.positions.map((item) => ({
|
1291
|
+
id: item.id
|
1292
|
+
}))
|
1293
|
+
}
|
1300
1294
|
: { connectOrCreate: props.asset.positions.map((item) => ({
|
1301
1295
|
where: {
|
1302
1296
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1886,12 +1880,11 @@ exports.NewsArticleAssetSentiment = {
|
|
1886
1880
|
sellPrice: prop.asset.sellPrice !== undefined ? prop.asset.sellPrice : undefined,
|
1887
1881
|
buyPrice: prop.asset.buyPrice !== undefined ? prop.asset.buyPrice : undefined,
|
1888
1882
|
trades: prop.asset.trades ?
|
1889
|
-
Array.isArray(prop.asset.trades) && prop.asset.trades.length > 0
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
}
|
1883
|
+
Array.isArray(prop.asset.trades) && prop.asset.trades.length > 0 && prop.asset.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1884
|
+
connect: prop.asset.trades.map((item) => ({
|
1885
|
+
id: item.id
|
1886
|
+
}))
|
1887
|
+
}
|
1895
1888
|
: { connectOrCreate: prop.asset.trades.map((item) => ({
|
1896
1889
|
where: {
|
1897
1890
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1911,12 +1904,11 @@ exports.NewsArticleAssetSentiment = {
|
|
1911
1904
|
}))
|
1912
1905
|
} : undefined,
|
1913
1906
|
orders: prop.asset.orders ?
|
1914
|
-
Array.isArray(prop.asset.orders) && prop.asset.orders.length > 0
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
}
|
1907
|
+
Array.isArray(prop.asset.orders) && prop.asset.orders.length > 0 && prop.asset.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1908
|
+
connect: prop.asset.orders.map((item) => ({
|
1909
|
+
id: item.id
|
1910
|
+
}))
|
1911
|
+
}
|
1920
1912
|
: { connectOrCreate: prop.asset.orders.map((item) => ({
|
1921
1913
|
where: {
|
1922
1914
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1942,12 +1934,11 @@ exports.NewsArticleAssetSentiment = {
|
|
1942
1934
|
}))
|
1943
1935
|
} : undefined,
|
1944
1936
|
positions: prop.asset.positions ?
|
1945
|
-
Array.isArray(prop.asset.positions) && prop.asset.positions.length > 0
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
1950
|
-
}
|
1937
|
+
Array.isArray(prop.asset.positions) && prop.asset.positions.length > 0 && prop.asset.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1938
|
+
connect: prop.asset.positions.map((item) => ({
|
1939
|
+
id: item.id
|
1940
|
+
}))
|
1941
|
+
}
|
1951
1942
|
: { connectOrCreate: prop.asset.positions.map((item) => ({
|
1952
1943
|
where: {
|
1953
1944
|
id: item.id !== undefined ? item.id : undefined,
|