adaptic-backend 1.0.284 → 1.0.286
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/client.cjs +43 -55
- package/client.d.ts +11 -3
- package/esm/Account.js.map +1 -1
- package/esm/Action.js.map +1 -1
- package/esm/Alert.js.map +1 -1
- package/esm/AlpacaAccount.js.map +1 -1
- package/esm/Asset.js.map +1 -1
- package/esm/Authenticator.js.map +1 -1
- package/esm/Contract.js.map +1 -1
- package/esm/Customer.js.map +1 -1
- package/esm/Deliverable.js.map +1 -1
- package/esm/EconomicEvent.js.map +1 -1
- package/esm/MarketSentiment.js.map +1 -1
- package/esm/NewsArticle.js.map +1 -1
- package/esm/NewsArticleAssetSentiment.js.map +1 -1
- package/esm/Order.js.map +1 -1
- package/esm/Position.js.map +1 -1
- package/esm/ScheduledOptionOrder.js.map +1 -1
- package/esm/Session.js.map +1 -1
- package/esm/StopLoss.js.map +1 -1
- package/esm/TakeProfit.js.map +1 -1
- package/esm/Trade.js.map +1 -1
- package/esm/User.js.map +1 -1
- package/esm/VerificationToken.js.map +1 -1
- package/esm/client.d.ts +11 -3
- package/esm/client.d.ts.map +1 -1
- package/esm/client.js.map +1 -1
- package/esm/client.mjs +44 -48
- package/package.json +1 -1
package/client.cjs
CHANGED
@@ -1,63 +1,51 @@
|
|
1
1
|
"use strict";
|
2
|
-
// client.ts
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
3
|
exports.split = exports.onError = exports.setContext = exports.HttpLink = exports.InMemoryCache = exports.gql = exports.ApolloError = exports.ApolloClient = exports.client = void 0;
|
5
4
|
exports.getApolloClient = getApolloClient;
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
5
|
+
// Statically import runtime implementations for the client (browser) environment.
|
6
|
+
const client_1 = require("@apollo/client");
|
7
|
+
const context_cjs_1 = require("@apollo/client/link/context/context.cjs");
|
8
|
+
const error_cjs_1 = require("@apollo/client/link/error/error.cjs");
|
9
|
+
// Declare runtime variables that will eventually hold the proper implementations.
|
10
|
+
let ApolloClient;
|
11
|
+
let ApolloError;
|
12
|
+
let gql;
|
13
|
+
let InMemoryCache;
|
14
|
+
let HttpLink;
|
15
|
+
let setContext;
|
16
|
+
let onError;
|
17
|
+
let split;
|
18
|
+
// Detect if we are in a server-like environment (including AWS Lambda).
|
19
|
+
const isLambda = Boolean(process.env.AWS_EXECUTION_ENV);
|
20
|
+
const isServer = typeof window === "undefined";
|
21
|
+
// Conditional logic: on server (or AWS Lambda) use require(), on client use the static imports.
|
22
|
+
if (isServer || isLambda) {
|
23
|
+
// Server-side: Use require() to load the modules at runtime.
|
24
|
+
const pkg = require("@apollo/client");
|
25
|
+
exports.ApolloClient = ApolloClient = pkg.ApolloClient;
|
26
|
+
exports.InMemoryCache = InMemoryCache = pkg.InMemoryCache;
|
27
|
+
exports.HttpLink = HttpLink = pkg.HttpLink;
|
28
|
+
exports.gql = gql = pkg.gql;
|
29
|
+
exports.ApolloError = ApolloError = pkg.ApolloError;
|
30
|
+
exports.split = split = pkg.split;
|
31
|
+
// Require the additional packages for context and error links.
|
32
|
+
const contextPkg = require("@apollo/client/link/context/context.cjs");
|
33
|
+
exports.setContext = setContext = contextPkg.setContext;
|
34
|
+
const errorPkg = require("@apollo/client/link/error/error.cjs");
|
35
|
+
exports.onError = onError = errorPkg.onError;
|
27
36
|
}
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
/**
|
40
|
-
* Similarly, load onError from @apollo/client/link/error/error.cjs
|
41
|
-
*/
|
42
|
-
function loadOnError() {
|
43
|
-
const errorCjs = require("@apollo/client/link/error/" + "error.cjs");
|
44
|
-
const maybeDefault = errorCjs.default || {};
|
45
|
-
return errorCjs.onError || maybeDefault.onError;
|
37
|
+
else {
|
38
|
+
// Client-side: Use the statically imported implementations.
|
39
|
+
exports.ApolloClient = ApolloClient = client_1.ApolloClient;
|
40
|
+
exports.InMemoryCache = InMemoryCache = client_1.InMemoryCache;
|
41
|
+
exports.HttpLink = HttpLink = client_1.HttpLink;
|
42
|
+
exports.gql = gql = client_1.gql;
|
43
|
+
exports.ApolloError = ApolloError = client_1.ApolloError;
|
44
|
+
exports.setContext = setContext = context_cjs_1.setContext;
|
45
|
+
exports.onError = onError = error_cjs_1.onError;
|
46
|
+
exports.split = split = client_1.split;
|
46
47
|
}
|
47
|
-
//
|
48
|
-
const { ApolloClient, InMemoryCache, HttpLink, gql, ApolloError, split, } = loadApolloClientPackage();
|
49
|
-
exports.ApolloClient = ApolloClient;
|
50
|
-
exports.InMemoryCache = InMemoryCache;
|
51
|
-
exports.HttpLink = HttpLink;
|
52
|
-
exports.gql = gql;
|
53
|
-
exports.ApolloError = ApolloError;
|
54
|
-
exports.split = split;
|
55
|
-
const setContext = loadSetContext();
|
56
|
-
exports.setContext = setContext;
|
57
|
-
const onError = loadOnError();
|
58
|
-
exports.onError = onError;
|
59
|
-
// --- Apollo Client Setup ---
|
60
|
-
// Use the type-only alias for type annotations.
|
48
|
+
// Singleton instance for the Apollo Client.
|
61
49
|
let apolloClient = null;
|
62
50
|
/**
|
63
51
|
* Initializes a new Apollo Client instance.
|
@@ -107,6 +95,6 @@ function getApolloClient() {
|
|
107
95
|
}
|
108
96
|
return apolloClient;
|
109
97
|
}
|
110
|
-
// Export the singleton instance
|
98
|
+
// Export the singleton instance.
|
111
99
|
exports.client = getApolloClient();
|
112
100
|
//# sourceMappingURL=client.js.map
|
package/client.d.ts
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
import type { ApolloClient as ApolloClientType, InMemoryCache as InMemoryCacheType, HttpLink as HttpLinkType, NormalizedCacheObject } from "@apollo/client";
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
import { ApolloClient as ApolloClientImported, InMemoryCache as InMemoryCacheImported, HttpLink as HttpLinkImported, gql as gqlImported, ApolloError as ApolloErrorImported, split as splitImported } from "@apollo/client";
|
3
|
+
import { setContext as setContextImported } from "@apollo/client/link/context/context.cjs";
|
4
|
+
import { onError as onErrorImported } from "@apollo/client/link/error/error.cjs";
|
5
|
+
declare let ApolloClient: typeof ApolloClientImported;
|
6
|
+
declare let ApolloError: typeof ApolloErrorImported;
|
7
|
+
declare let gql: typeof gqlImported;
|
8
|
+
declare let InMemoryCache: typeof InMemoryCacheImported;
|
9
|
+
declare let HttpLink: typeof HttpLinkImported;
|
10
|
+
declare let setContext: typeof setContextImported;
|
11
|
+
declare let onError: typeof onErrorImported;
|
12
|
+
declare let split: typeof splitImported;
|
5
13
|
/**
|
6
14
|
* Retrieves the singleton Apollo Client instance.
|
7
15
|
* @returns ApolloClient instance.
|