adaptic-backend 1.0.286 → 1.0.287
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 +73 -20
- package/client.d.ts +6 -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 +6 -3
- package/esm/client.d.ts.map +1 -1
- package/esm/client.js.map +1 -1
- package/esm/client.mjs +30 -13
- package/package.json +1 -1
package/client.cjs
CHANGED
@@ -1,12 +1,57 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
19
|
+
var ownKeys = function(o) {
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
+
var ar = [];
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
+
return ar;
|
24
|
+
};
|
25
|
+
return ownKeys(o);
|
26
|
+
};
|
27
|
+
return function (mod) {
|
28
|
+
if (mod && mod.__esModule) return mod;
|
29
|
+
var result = {};
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
+
__setModuleDefault(result, mod);
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
})();
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
37
|
+
};
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
39
|
exports.split = exports.onError = exports.setContext = exports.HttpLink = exports.InMemoryCache = exports.gql = exports.ApolloError = exports.ApolloClient = exports.client = void 0;
|
4
40
|
exports.getApolloClient = getApolloClient;
|
5
|
-
//
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
41
|
+
// ==========================
|
42
|
+
// 2. Static (Client-side) Imports
|
43
|
+
// Use default import and destructuring so that CommonJS modules export correctly in ESM.
|
44
|
+
// ==========================
|
45
|
+
const pkg = __importStar(require("@apollo/client"));
|
46
|
+
const { ApolloClient: ApolloClientImported, InMemoryCache: InMemoryCacheImported, HttpLink: HttpLinkImported, gql: gqlImported, ApolloError: ApolloErrorImported, split: splitImported, } = pkg;
|
47
|
+
const context_cjs_1 = __importDefault(require("@apollo/client/link/context/context.cjs"));
|
48
|
+
const { setContext: setContextImported } = context_cjs_1.default;
|
49
|
+
const error_cjs_1 = __importDefault(require("@apollo/client/link/error/error.cjs"));
|
50
|
+
const { onError: onErrorImported } = error_cjs_1.default;
|
51
|
+
// ==========================
|
52
|
+
// 3. Declare Runtime Variables
|
53
|
+
// These variables will eventually be assigned the proper implementations based on the runtime.
|
54
|
+
// ==========================
|
10
55
|
let ApolloClient;
|
11
56
|
let ApolloError;
|
12
57
|
let gql;
|
@@ -15,12 +60,15 @@ let HttpLink;
|
|
15
60
|
let setContext;
|
16
61
|
let onError;
|
17
62
|
let split;
|
18
|
-
//
|
63
|
+
// ==========================
|
64
|
+
// 4. Environment Detection & Conditional Assignment
|
65
|
+
// We check if we are in a server environment (including AWS Lambda)
|
66
|
+
// ==========================
|
19
67
|
const isLambda = Boolean(process.env.AWS_EXECUTION_ENV);
|
20
68
|
const isServer = typeof window === "undefined";
|
21
|
-
// Conditional logic: on server (or AWS Lambda) use require(), on client use the static imports.
|
22
69
|
if (isServer || isLambda) {
|
23
|
-
// Server-side
|
70
|
+
// --- Server-side (or AWS Lambda) ---
|
71
|
+
// Use require() to load the modules synchronously at runtime.
|
24
72
|
const pkg = require("@apollo/client");
|
25
73
|
exports.ApolloClient = ApolloClient = pkg.ApolloClient;
|
26
74
|
exports.InMemoryCache = InMemoryCache = pkg.InMemoryCache;
|
@@ -28,24 +76,27 @@ if (isServer || isLambda) {
|
|
28
76
|
exports.gql = gql = pkg.gql;
|
29
77
|
exports.ApolloError = ApolloError = pkg.ApolloError;
|
30
78
|
exports.split = split = pkg.split;
|
31
|
-
//
|
79
|
+
// Load additional submodules.
|
32
80
|
const contextPkg = require("@apollo/client/link/context/context.cjs");
|
33
81
|
exports.setContext = setContext = contextPkg.setContext;
|
34
82
|
const errorPkg = require("@apollo/client/link/error/error.cjs");
|
35
83
|
exports.onError = onError = errorPkg.onError;
|
36
84
|
}
|
37
85
|
else {
|
38
|
-
// Client-side
|
39
|
-
|
40
|
-
exports.
|
41
|
-
exports.
|
42
|
-
exports.
|
43
|
-
exports.
|
44
|
-
exports.
|
45
|
-
exports.
|
46
|
-
exports.
|
86
|
+
// --- Client-side ---
|
87
|
+
// Use the statically imported implementations.
|
88
|
+
exports.ApolloClient = ApolloClient = ApolloClientImported;
|
89
|
+
exports.InMemoryCache = InMemoryCache = InMemoryCacheImported;
|
90
|
+
exports.HttpLink = HttpLink = HttpLinkImported;
|
91
|
+
exports.gql = gql = gqlImported;
|
92
|
+
exports.ApolloError = ApolloError = ApolloErrorImported;
|
93
|
+
exports.setContext = setContext = setContextImported;
|
94
|
+
exports.onError = onError = onErrorImported;
|
95
|
+
exports.split = split = splitImported;
|
47
96
|
}
|
48
|
-
//
|
97
|
+
// ==========================
|
98
|
+
// 5. Apollo Client Initialization & Singleton Pattern
|
99
|
+
// ==========================
|
49
100
|
let apolloClient = null;
|
50
101
|
/**
|
51
102
|
* Initializes a new Apollo Client instance.
|
@@ -95,6 +146,8 @@ function getApolloClient() {
|
|
95
146
|
}
|
96
147
|
return apolloClient;
|
97
148
|
}
|
98
|
-
//
|
149
|
+
// ==========================
|
150
|
+
// 6. Exports
|
151
|
+
// ==========================
|
99
152
|
exports.client = getApolloClient();
|
100
153
|
//# sourceMappingURL=client.js.map
|
package/client.d.ts
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
import type { ApolloClient as ApolloClientType, InMemoryCache as InMemoryCacheType, HttpLink as HttpLinkType, NormalizedCacheObject } from "@apollo/client";
|
2
|
-
import
|
3
|
-
|
4
|
-
import
|
2
|
+
import * as pkg from "@apollo/client";
|
3
|
+
declare const ApolloClientImported: typeof ApolloClientType, InMemoryCacheImported: typeof InMemoryCacheType, HttpLinkImported: typeof HttpLinkType, gqlImported: typeof pkg.gql, ApolloErrorImported: typeof pkg.ApolloError, splitImported: typeof pkg.ApolloLink.split;
|
4
|
+
import contextPkg from "@apollo/client/link/context/context.cjs";
|
5
|
+
declare const setContextImported: typeof contextPkg.setContext;
|
6
|
+
import errorPkg from "@apollo/client/link/error/error.cjs";
|
7
|
+
declare const onErrorImported: typeof errorPkg.onError;
|
5
8
|
declare let ApolloClient: typeof ApolloClientImported;
|
6
9
|
declare let ApolloError: typeof ApolloErrorImported;
|
7
10
|
declare let gql: typeof gqlImported;
|