adaptic-backend 1.0.319 → 1.0.321

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 CHANGED
@@ -2270,7 +2270,7 @@ exports.Account = {
2270
2270
  const response = await client.query({ query: FIND_MANY_ACCOUNT, variables: filteredVariables });
2271
2271
  if (response.errors && response.errors.length > 0)
2272
2272
  throw new Error(response.errors[0].message);
2273
- if (response && response.data && response.data.Accounts) {
2273
+ if (response && response.data && response.data.accounts) {
2274
2274
  return response.data.accounts;
2275
2275
  }
2276
2276
  else {
package/Action.cjs CHANGED
@@ -801,7 +801,7 @@ exports.Action = {
801
801
  const response = await client.query({ query: FIND_MANY_ACTION, variables: filteredVariables });
802
802
  if (response.errors && response.errors.length > 0)
803
803
  throw new Error(response.errors[0].message);
804
- if (response && response.data && response.data.Actions) {
804
+ if (response && response.data && response.data.actions) {
805
805
  return response.data.actions;
806
806
  }
807
807
  else {
package/Alert.cjs CHANGED
@@ -2482,7 +2482,7 @@ exports.Alert = {
2482
2482
  const response = await client.query({ query: FIND_MANY_ALERT, variables: filteredVariables });
2483
2483
  if (response.errors && response.errors.length > 0)
2484
2484
  throw new Error(response.errors[0].message);
2485
- if (response && response.data && response.data.Alerts) {
2485
+ if (response && response.data && response.data.alerts) {
2486
2486
  return response.data.alerts;
2487
2487
  }
2488
2488
  else {
package/AlpacaAccount.cjs CHANGED
@@ -2099,7 +2099,7 @@ exports.AlpacaAccount = {
2099
2099
  const response = await client.query({ query: FIND_MANY_ALPACAACCOUNT, variables: filteredVariables });
2100
2100
  if (response.errors && response.errors.length > 0)
2101
2101
  throw new Error(response.errors[0].message);
2102
- if (response && response.data && response.data.AlpacaAccounts) {
2102
+ if (response && response.data && response.data.alpacaaccounts) {
2103
2103
  return response.data.alpacaAccounts;
2104
2104
  }
2105
2105
  else {
package/Asset.cjs CHANGED
@@ -1722,7 +1722,7 @@ exports.Asset = {
1722
1722
  const response = await client.query({ query: FIND_MANY_ASSET, variables: filteredVariables });
1723
1723
  if (response.errors && response.errors.length > 0)
1724
1724
  throw new Error(response.errors[0].message);
1725
- if (response && response.data && response.data.Assets) {
1725
+ if (response && response.data && response.data.assets) {
1726
1726
  return response.data.assets;
1727
1727
  }
1728
1728
  else {
package/Authenticator.cjs CHANGED
@@ -2314,7 +2314,7 @@ exports.Authenticator = {
2314
2314
  const response = await client.query({ query: FIND_MANY_AUTHENTICATOR, variables: filteredVariables });
2315
2315
  if (response.errors && response.errors.length > 0)
2316
2316
  throw new Error(response.errors[0].message);
2317
- if (response && response.data && response.data.Authenticators) {
2317
+ if (response && response.data && response.data.authenticators) {
2318
2318
  return response.data.authenticators;
2319
2319
  }
2320
2320
  else {
package/Customer.cjs CHANGED
@@ -2240,7 +2240,7 @@ exports.Customer = {
2240
2240
  const response = await client.query({ query: FIND_MANY_CUSTOMER, variables: filteredVariables });
2241
2241
  if (response.errors && response.errors.length > 0)
2242
2242
  throw new Error(response.errors[0].message);
2243
- if (response && response.data && response.data.Customers) {
2243
+ if (response && response.data && response.data.customers) {
2244
2244
  return response.data.customers;
2245
2245
  }
2246
2246
  else {
package/EconomicEvent.cjs CHANGED
@@ -469,7 +469,7 @@ exports.EconomicEvent = {
469
469
  const response = await client.query({ query: FIND_MANY_ECONOMICEVENT, variables: filteredVariables });
470
470
  if (response.errors && response.errors.length > 0)
471
471
  throw new Error(response.errors[0].message);
472
- if (response && response.data && response.data.EconomicEvents) {
472
+ if (response && response.data && response.data.economicevents) {
473
473
  return response.data.economicEvents;
474
474
  }
475
475
  else {
@@ -441,7 +441,7 @@ exports.MarketSentiment = {
441
441
  const response = await client.query({ query: FIND_MANY_MARKETSENTIMENT, variables: filteredVariables });
442
442
  if (response.errors && response.errors.length > 0)
443
443
  throw new Error(response.errors[0].message);
444
- if (response && response.data && response.data.MarketSentiments) {
444
+ if (response && response.data && response.data.marketsentiments) {
445
445
  return response.data.marketSentiments;
446
446
  }
447
447
  else {
package/NewsArticle.cjs CHANGED
@@ -1937,7 +1937,7 @@ exports.NewsArticle = {
1937
1937
  const response = await client.query({ query: FIND_MANY_NEWSARTICLE, variables: filteredVariables });
1938
1938
  if (response.errors && response.errors.length > 0)
1939
1939
  throw new Error(response.errors[0].message);
1940
- if (response && response.data && response.data.NewsArticles) {
1940
+ if (response && response.data && response.data.newsarticles) {
1941
1941
  return response.data.newsArticles;
1942
1942
  }
1943
1943
  else {
@@ -1746,7 +1746,7 @@ exports.NewsArticleAssetSentiment = {
1746
1746
  const response = await client.query({ query: FIND_MANY_NEWSARTICLEASSETSENTIMENT, variables: filteredVariables });
1747
1747
  if (response.errors && response.errors.length > 0)
1748
1748
  throw new Error(response.errors[0].message);
1749
- if (response && response.data && response.data.NewsArticleAssetSentiments) {
1749
+ if (response && response.data && response.data.newsarticleassetsentiments) {
1750
1750
  return response.data.newsArticleAssetSentiments;
1751
1751
  }
1752
1752
  else {
@@ -414,7 +414,7 @@ exports.ScheduledOptionOrder = {
414
414
  const response = await client.query({ query: FIND_MANY_SCHEDULEDOPTIONORDER, variables: filteredVariables });
415
415
  if (response.errors && response.errors.length > 0)
416
416
  throw new Error(response.errors[0].message);
417
- if (response && response.data && response.data.ScheduledOptionOrders) {
417
+ if (response && response.data && response.data.scheduledoptionorders) {
418
418
  return response.data.scheduledOptionOrders;
419
419
  }
420
420
  else {
package/Session.cjs CHANGED
@@ -2294,7 +2294,7 @@ exports.Session = {
2294
2294
  const response = await client.query({ query: FIND_MANY_SESSION, variables: filteredVariables });
2295
2295
  if (response.errors && response.errors.length > 0)
2296
2296
  throw new Error(response.errors[0].message);
2297
- if (response && response.data && response.data.Sessions) {
2297
+ if (response && response.data && response.data.sessions) {
2298
2298
  return response.data.sessions;
2299
2299
  }
2300
2300
  else {
package/Trade.cjs CHANGED
@@ -796,7 +796,7 @@ exports.Trade = {
796
796
  const response = await client.query({ query: FIND_MANY_TRADE, variables: filteredVariables });
797
797
  if (response.errors && response.errors.length > 0)
798
798
  throw new Error(response.errors[0].message);
799
- if (response && response.data && response.data.Trades) {
799
+ if (response && response.data && response.data.trades) {
800
800
  return response.data.trades;
801
801
  }
802
802
  else {
package/User.cjs CHANGED
@@ -1883,7 +1883,7 @@ exports.User = {
1883
1883
  const response = await client.query({ query: FIND_MANY_USER, variables: filteredVariables });
1884
1884
  if (response.errors && response.errors.length > 0)
1885
1885
  throw new Error(response.errors[0].message);
1886
- if (response && response.data && response.data.Users) {
1886
+ if (response && response.data && response.data.users) {
1887
1887
  return response.data.users;
1888
1888
  }
1889
1889
  else {
@@ -427,7 +427,7 @@ exports.VerificationToken = {
427
427
  const response = await client.query({ query: FIND_MANY_VERIFICATIONTOKEN, variables: filteredVariables });
428
428
  if (response.errors && response.errors.length > 0)
429
429
  throw new Error(response.errors[0].message);
430
- if (response && response.data && response.data.VerificationTokens) {
430
+ if (response && response.data && response.data.verificationtokens) {
431
431
  return response.data.verificationTokens;
432
432
  }
433
433
  else {
package/client.cjs CHANGED
@@ -68,32 +68,18 @@ async function getApolloClient() {
68
68
  const { ApolloClient, InMemoryCache, HttpLink, setContext, onError } = apolloModules;
69
69
  // Determine the GraphQL endpoint.
70
70
  const isProduction = process.env.NODE_ENV === "production";
71
- const httpUrl = isProduction
72
- ? process.env.NEXT_PUBLIC_BACKEND_HTTPS_URL || process.env.BACKEND_HTTPS_URL || "https://api.adaptic.ai/graphql"
73
- : "http://localhost:4000/graphql";
71
+ const httpUrl = process.env.NEXT_PUBLIC_BACKEND_HTTPS_URL || process.env.BACKEND_HTTPS_URL || (isProduction ? "https://api.adaptic.ai/graphql" : "http://localhost:4000/graphql");
74
72
  // Create the HTTP link. (Ensure that a global fetch is available.)
75
73
  const httpLinkInstance = new HttpLink({ uri: httpUrl, fetch });
76
74
  // Create the auth link.
77
75
  const authLink = setContext((request, prevContext) => {
78
- var _a;
79
- let authorization = '';
80
- const headers = request || prevContext.headers || {};
81
- if (request && request.context && request.context.headers && request.context.headers.authorization && request.context.headers.authorization !== '') {
82
- authorization = request.context.headers.authorization;
83
- }
84
- else if (prevContext && prevContext.headers && prevContext.headers.authorization && prevContext.headers.authorization !== '') {
85
- authorization = prevContext.headers.authorization;
86
- }
87
- else {
88
- // Retrieve the token from environment variables or other secure storage.
89
- const ctx = global.ctx;
90
- // get token from within request headers
91
- authorization = ((_a = ctx.connectionParams) === null || _a === void 0 ? void 0 : _a.authorization) || '';
92
- }
76
+ const headers = prevContext.headers || {};
77
+ // Retrieve the token from environment variables or other secure storage.
78
+ const token = process.env.NEXT_PUBLIC_SERVER_AUTH_TOKEN || process.env.SERVER_AUTH_TOKEN || "";
93
79
  return {
94
80
  headers: {
95
81
  ...headers,
96
- authorization: authorization,
82
+ authorization: token ? `Bearer ${token}` : "",
97
83
  connection: "keep-alive",
98
84
  },
99
85
  };
package/esm/Account.mjs CHANGED
@@ -2265,7 +2265,7 @@ export const Account = {
2265
2265
  const response = await client.query({ query: FIND_MANY_ACCOUNT, variables: filteredVariables });
2266
2266
  if (response.errors && response.errors.length > 0)
2267
2267
  throw new Error(response.errors[0].message);
2268
- if (response && response.data && response.data.Accounts) {
2268
+ if (response && response.data && response.data.accounts) {
2269
2269
  return response.data.accounts;
2270
2270
  }
2271
2271
  else {
package/esm/Action.mjs CHANGED
@@ -796,7 +796,7 @@ export const Action = {
796
796
  const response = await client.query({ query: FIND_MANY_ACTION, variables: filteredVariables });
797
797
  if (response.errors && response.errors.length > 0)
798
798
  throw new Error(response.errors[0].message);
799
- if (response && response.data && response.data.Actions) {
799
+ if (response && response.data && response.data.actions) {
800
800
  return response.data.actions;
801
801
  }
802
802
  else {
package/esm/Alert.mjs CHANGED
@@ -2477,7 +2477,7 @@ export const Alert = {
2477
2477
  const response = await client.query({ query: FIND_MANY_ALERT, variables: filteredVariables });
2478
2478
  if (response.errors && response.errors.length > 0)
2479
2479
  throw new Error(response.errors[0].message);
2480
- if (response && response.data && response.data.Alerts) {
2480
+ if (response && response.data && response.data.alerts) {
2481
2481
  return response.data.alerts;
2482
2482
  }
2483
2483
  else {
@@ -2094,7 +2094,7 @@ export const AlpacaAccount = {
2094
2094
  const response = await client.query({ query: FIND_MANY_ALPACAACCOUNT, variables: filteredVariables });
2095
2095
  if (response.errors && response.errors.length > 0)
2096
2096
  throw new Error(response.errors[0].message);
2097
- if (response && response.data && response.data.AlpacaAccounts) {
2097
+ if (response && response.data && response.data.alpacaaccounts) {
2098
2098
  return response.data.alpacaAccounts;
2099
2099
  }
2100
2100
  else {
package/esm/Asset.mjs CHANGED
@@ -1717,7 +1717,7 @@ export const Asset = {
1717
1717
  const response = await client.query({ query: FIND_MANY_ASSET, variables: filteredVariables });
1718
1718
  if (response.errors && response.errors.length > 0)
1719
1719
  throw new Error(response.errors[0].message);
1720
- if (response && response.data && response.data.Assets) {
1720
+ if (response && response.data && response.data.assets) {
1721
1721
  return response.data.assets;
1722
1722
  }
1723
1723
  else {
@@ -2309,7 +2309,7 @@ export const Authenticator = {
2309
2309
  const response = await client.query({ query: FIND_MANY_AUTHENTICATOR, variables: filteredVariables });
2310
2310
  if (response.errors && response.errors.length > 0)
2311
2311
  throw new Error(response.errors[0].message);
2312
- if (response && response.data && response.data.Authenticators) {
2312
+ if (response && response.data && response.data.authenticators) {
2313
2313
  return response.data.authenticators;
2314
2314
  }
2315
2315
  else {
package/esm/Customer.mjs CHANGED
@@ -2235,7 +2235,7 @@ export const Customer = {
2235
2235
  const response = await client.query({ query: FIND_MANY_CUSTOMER, variables: filteredVariables });
2236
2236
  if (response.errors && response.errors.length > 0)
2237
2237
  throw new Error(response.errors[0].message);
2238
- if (response && response.data && response.data.Customers) {
2238
+ if (response && response.data && response.data.customers) {
2239
2239
  return response.data.customers;
2240
2240
  }
2241
2241
  else {
@@ -464,7 +464,7 @@ export const EconomicEvent = {
464
464
  const response = await client.query({ query: FIND_MANY_ECONOMICEVENT, variables: filteredVariables });
465
465
  if (response.errors && response.errors.length > 0)
466
466
  throw new Error(response.errors[0].message);
467
- if (response && response.data && response.data.EconomicEvents) {
467
+ if (response && response.data && response.data.economicevents) {
468
468
  return response.data.economicEvents;
469
469
  }
470
470
  else {
@@ -436,7 +436,7 @@ export const MarketSentiment = {
436
436
  const response = await client.query({ query: FIND_MANY_MARKETSENTIMENT, variables: filteredVariables });
437
437
  if (response.errors && response.errors.length > 0)
438
438
  throw new Error(response.errors[0].message);
439
- if (response && response.data && response.data.MarketSentiments) {
439
+ if (response && response.data && response.data.marketsentiments) {
440
440
  return response.data.marketSentiments;
441
441
  }
442
442
  else {
@@ -1932,7 +1932,7 @@ export const NewsArticle = {
1932
1932
  const response = await client.query({ query: FIND_MANY_NEWSARTICLE, variables: filteredVariables });
1933
1933
  if (response.errors && response.errors.length > 0)
1934
1934
  throw new Error(response.errors[0].message);
1935
- if (response && response.data && response.data.NewsArticles) {
1935
+ if (response && response.data && response.data.newsarticles) {
1936
1936
  return response.data.newsArticles;
1937
1937
  }
1938
1938
  else {
@@ -1741,7 +1741,7 @@ export const NewsArticleAssetSentiment = {
1741
1741
  const response = await client.query({ query: FIND_MANY_NEWSARTICLEASSETSENTIMENT, variables: filteredVariables });
1742
1742
  if (response.errors && response.errors.length > 0)
1743
1743
  throw new Error(response.errors[0].message);
1744
- if (response && response.data && response.data.NewsArticleAssetSentiments) {
1744
+ if (response && response.data && response.data.newsarticleassetsentiments) {
1745
1745
  return response.data.newsArticleAssetSentiments;
1746
1746
  }
1747
1747
  else {
@@ -409,7 +409,7 @@ export const ScheduledOptionOrder = {
409
409
  const response = await client.query({ query: FIND_MANY_SCHEDULEDOPTIONORDER, variables: filteredVariables });
410
410
  if (response.errors && response.errors.length > 0)
411
411
  throw new Error(response.errors[0].message);
412
- if (response && response.data && response.data.ScheduledOptionOrders) {
412
+ if (response && response.data && response.data.scheduledoptionorders) {
413
413
  return response.data.scheduledOptionOrders;
414
414
  }
415
415
  else {
package/esm/Session.mjs CHANGED
@@ -2289,7 +2289,7 @@ export const Session = {
2289
2289
  const response = await client.query({ query: FIND_MANY_SESSION, variables: filteredVariables });
2290
2290
  if (response.errors && response.errors.length > 0)
2291
2291
  throw new Error(response.errors[0].message);
2292
- if (response && response.data && response.data.Sessions) {
2292
+ if (response && response.data && response.data.sessions) {
2293
2293
  return response.data.sessions;
2294
2294
  }
2295
2295
  else {
package/esm/Trade.mjs CHANGED
@@ -791,7 +791,7 @@ export const Trade = {
791
791
  const response = await client.query({ query: FIND_MANY_TRADE, variables: filteredVariables });
792
792
  if (response.errors && response.errors.length > 0)
793
793
  throw new Error(response.errors[0].message);
794
- if (response && response.data && response.data.Trades) {
794
+ if (response && response.data && response.data.trades) {
795
795
  return response.data.trades;
796
796
  }
797
797
  else {
package/esm/User.mjs CHANGED
@@ -1878,7 +1878,7 @@ export const User = {
1878
1878
  const response = await client.query({ query: FIND_MANY_USER, variables: filteredVariables });
1879
1879
  if (response.errors && response.errors.length > 0)
1880
1880
  throw new Error(response.errors[0].message);
1881
- if (response && response.data && response.data.Users) {
1881
+ if (response && response.data && response.data.users) {
1882
1882
  return response.data.users;
1883
1883
  }
1884
1884
  else {
@@ -422,7 +422,7 @@ export const VerificationToken = {
422
422
  const response = await client.query({ query: FIND_MANY_VERIFICATIONTOKEN, variables: filteredVariables });
423
423
  if (response.errors && response.errors.length > 0)
424
424
  throw new Error(response.errors[0].message);
425
- if (response && response.data && response.data.VerificationTokens) {
425
+ if (response && response.data && response.data.verificationtokens) {
426
426
  return response.data.verificationTokens;
427
427
  }
428
428
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,aAAa,IAAI,iBAAiB,EAClC,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAEpE,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,GACtB,CAAC;AAGF,MAAM,WAAW,aAAa;IAC5B,YAAY,EAA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AAO;YACL,OAAO,EAAE;gBACP,GAAG,OAAO;gBACV,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE;gBAC7C,UAAU,EAAE,YAAY;aACzB;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,kCAAkC;IAClC,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,EAAE;QAC5D,IAAI,aAAa,EAAE,CAAC;YAClB,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAO,EAAE,EAAE,CAC1D,OAAO,CAAC,KAAK,CACX,6BAA6B,OAAO,eAAe,SAAS,WAAW,IAAI,EAAE,CAC9E,CACF,CAAC;QACJ,CAAC;QACD,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,CAAC,KAAK,CAAC,oBAAoB,YAAY,EAAE,CAAC,CAAC;QACpD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,gCAAgC;IAChC,YAAY,GAAG,IAAI,YAAY,CAAC;QAC9B,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QACzD,KAAK,EAAE,IAAI,aAAa,EAAE;KAC3B,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,aAAa,GAAG,MAAM,iBAAiB,EAAE,CAAC;IAC5C,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC"}
package/esm/client.mjs CHANGED
@@ -30,31 +30,18 @@ export async function getApolloClient() {
30
30
  const { ApolloClient, InMemoryCache, HttpLink, setContext, onError } = apolloModules;
31
31
  // Determine the GraphQL endpoint.
32
32
  const isProduction = process.env.NODE_ENV === "production";
33
- const httpUrl = isProduction
34
- ? process.env.NEXT_PUBLIC_BACKEND_HTTPS_URL || process.env.BACKEND_HTTPS_URL || "https://api.adaptic.ai/graphql"
35
- : "http://localhost:4000/graphql";
33
+ const httpUrl = process.env.NEXT_PUBLIC_BACKEND_HTTPS_URL || process.env.BACKEND_HTTPS_URL || (isProduction ? "https://api.adaptic.ai/graphql" : "http://localhost:4000/graphql");
36
34
  // Create the HTTP link. (Ensure that a global fetch is available.)
37
35
  const httpLinkInstance = new HttpLink({ uri: httpUrl, fetch });
38
36
  // Create the auth link.
39
37
  const authLink = setContext((request, prevContext) => {
40
- let authorization = '';
41
- const headers = request || prevContext.headers || {};
42
- if (request && request.context && request.context.headers && request.context.headers.authorization && request.context.headers.authorization !== '') {
43
- authorization = request.context.headers.authorization;
44
- }
45
- else if (prevContext && prevContext.headers && prevContext.headers.authorization && prevContext.headers.authorization !== '') {
46
- authorization = prevContext.headers.authorization;
47
- }
48
- else {
49
- // Retrieve the token from environment variables or other secure storage.
50
- const ctx = global.ctx;
51
- // get token from within request headers
52
- authorization = ctx.connectionParams?.authorization || '';
53
- }
38
+ const headers = prevContext.headers || {};
39
+ // Retrieve the token from environment variables or other secure storage.
40
+ const token = process.env.NEXT_PUBLIC_SERVER_AUTH_TOKEN || process.env.SERVER_AUTH_TOKEN || "";
54
41
  return {
55
42
  headers: {
56
43
  ...headers,
57
- authorization: authorization,
44
+ authorization: token ? `Bearer ${token}` : "",
58
45
  connection: "keep-alive",
59
46
  },
60
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adaptic-backend",
3
- "version": "1.0.319",
3
+ "version": "1.0.321",
4
4
  "description": "Backend executable CRUD functions with dynamic variables construction, and type definitions for the Adaptic AI platform.",
5
5
  "type": "module",
6
6
  "types": "index.d.ts",