@aui.io/aui-client 3.1.1 → 3.1.2
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/dist/cjs/ApolloClientWrapper.d.ts +6 -5
- package/dist/cjs/ApolloClientWrapper.js +9 -6
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/ApolloClientWrapper.d.mts +6 -5
- package/dist/esm/ApolloClientWrapper.mjs +9 -6
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -39,11 +39,12 @@ export declare class ApolloClient extends _GeneratedClient {
|
|
|
39
39
|
keyType: PublishableKeyType;
|
|
40
40
|
}>;
|
|
41
41
|
/**
|
|
42
|
-
* Open a messaging WebSocket session. The bearer token is
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
42
|
+
* Open a messaging WebSocket session. The bearer token is passed as the first
|
|
43
|
+
* subprotocol (with `aui-websocket` second) — the gateway reads auth from
|
|
44
|
+
* Sec-WebSocket-Protocol, the only upgrade header a browser can set. The token is
|
|
45
|
+
* also sent as an Authorization header for Node. Built here (rather than via the
|
|
46
|
+
* generated session resource) so the generated code stays vanilla — Fern emits
|
|
47
|
+
* protocols: [] and forwards only per-call headers, neither of which the server accepts.
|
|
47
48
|
*/
|
|
48
49
|
connect(args?: ApolloClient.ConnectArgs): Promise<SessionSocket>;
|
|
49
50
|
}
|
|
@@ -176,11 +176,12 @@ class ApolloClient extends Client_js_1.ApolloClient {
|
|
|
176
176
|
return this._tokenAuth.getContext();
|
|
177
177
|
}
|
|
178
178
|
/**
|
|
179
|
-
* Open a messaging WebSocket session. The bearer token is
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
179
|
+
* Open a messaging WebSocket session. The bearer token is passed as the first
|
|
180
|
+
* subprotocol (with `aui-websocket` second) — the gateway reads auth from
|
|
181
|
+
* Sec-WebSocket-Protocol, the only upgrade header a browser can set. The token is
|
|
182
|
+
* also sent as an Authorization header for Node. Built here (rather than via the
|
|
183
|
+
* generated session resource) so the generated code stays vanilla — Fern emits
|
|
184
|
+
* protocols: [] and forwards only per-call headers, neither of which the server accepts.
|
|
184
185
|
*/
|
|
185
186
|
connect() {
|
|
186
187
|
return __awaiter(this, arguments, void 0, function* (args = {}) {
|
|
@@ -189,7 +190,9 @@ class ApolloClient extends Client_js_1.ApolloClient {
|
|
|
189
190
|
const headers = Object.assign(Object.assign({}, (token ? { Authorization: `Bearer ${token}` } : {})), args.headers);
|
|
190
191
|
const socket = new core.ReconnectingWebSocket({
|
|
191
192
|
url: core.url.join(this._env.production, SESSION_WS_PATH),
|
|
192
|
-
|
|
193
|
+
// Order matters: the gateway treats the FIRST subprotocol as the token and
|
|
194
|
+
// requires `aui-websocket` to follow. This is what makes browser WS auth work.
|
|
195
|
+
protocols: token ? [token, WS_SUBPROTOCOL] : [WS_SUBPROTOCOL],
|
|
193
196
|
queryParameters: {},
|
|
194
197
|
headers,
|
|
195
198
|
options: {
|
package/dist/cjs/Client.js
CHANGED
|
@@ -61,8 +61,8 @@ class ApolloClient {
|
|
|
61
61
|
this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: (0, headers_js_1.mergeHeaders)({
|
|
62
62
|
"X-Fern-Language": "JavaScript",
|
|
63
63
|
"X-Fern-SDK-Name": "@aui.io/aui-client",
|
|
64
|
-
"X-Fern-SDK-Version": "3.1.
|
|
65
|
-
"User-Agent": "@aui.io/aui-client/3.1.
|
|
64
|
+
"X-Fern-SDK-Version": "3.1.2",
|
|
65
|
+
"User-Agent": "@aui.io/aui-client/3.1.2",
|
|
66
66
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
67
67
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
68
68
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.1.
|
|
1
|
+
export declare const SDK_VERSION = "3.1.2";
|
package/dist/cjs/version.js
CHANGED
|
@@ -39,11 +39,12 @@ export declare class ApolloClient extends _GeneratedClient {
|
|
|
39
39
|
keyType: PublishableKeyType;
|
|
40
40
|
}>;
|
|
41
41
|
/**
|
|
42
|
-
* Open a messaging WebSocket session. The bearer token is
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
42
|
+
* Open a messaging WebSocket session. The bearer token is passed as the first
|
|
43
|
+
* subprotocol (with `aui-websocket` second) — the gateway reads auth from
|
|
44
|
+
* Sec-WebSocket-Protocol, the only upgrade header a browser can set. The token is
|
|
45
|
+
* also sent as an Authorization header for Node. Built here (rather than via the
|
|
46
|
+
* generated session resource) so the generated code stays vanilla — Fern emits
|
|
47
|
+
* protocols: [] and forwards only per-call headers, neither of which the server accepts.
|
|
47
48
|
*/
|
|
48
49
|
connect(args?: ApolloClient.ConnectArgs): Promise<SessionSocket>;
|
|
49
50
|
}
|
|
@@ -140,11 +140,12 @@ export class ApolloClient extends _GeneratedClient {
|
|
|
140
140
|
return this._tokenAuth.getContext();
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
|
-
* Open a messaging WebSocket session. The bearer token is
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
143
|
+
* Open a messaging WebSocket session. The bearer token is passed as the first
|
|
144
|
+
* subprotocol (with `aui-websocket` second) — the gateway reads auth from
|
|
145
|
+
* Sec-WebSocket-Protocol, the only upgrade header a browser can set. The token is
|
|
146
|
+
* also sent as an Authorization header for Node. Built here (rather than via the
|
|
147
|
+
* generated session resource) so the generated code stays vanilla — Fern emits
|
|
148
|
+
* protocols: [] and forwards only per-call headers, neither of which the server accepts.
|
|
148
149
|
*/
|
|
149
150
|
connect() {
|
|
150
151
|
return __awaiter(this, arguments, void 0, function* (args = {}) {
|
|
@@ -153,7 +154,9 @@ export class ApolloClient extends _GeneratedClient {
|
|
|
153
154
|
const headers = Object.assign(Object.assign({}, (token ? { Authorization: `Bearer ${token}` } : {})), args.headers);
|
|
154
155
|
const socket = new core.ReconnectingWebSocket({
|
|
155
156
|
url: core.url.join(this._env.production, SESSION_WS_PATH),
|
|
156
|
-
|
|
157
|
+
// Order matters: the gateway treats the FIRST subprotocol as the token and
|
|
158
|
+
// requires `aui-websocket` to follow. This is what makes browser WS auth work.
|
|
159
|
+
protocols: token ? [token, WS_SUBPROTOCOL] : [WS_SUBPROTOCOL],
|
|
157
160
|
queryParameters: {},
|
|
158
161
|
headers,
|
|
159
162
|
options: {
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -25,8 +25,8 @@ export class ApolloClient {
|
|
|
25
25
|
this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: mergeHeaders({
|
|
26
26
|
"X-Fern-Language": "JavaScript",
|
|
27
27
|
"X-Fern-SDK-Name": "@aui.io/aui-client",
|
|
28
|
-
"X-Fern-SDK-Version": "3.1.
|
|
29
|
-
"User-Agent": "@aui.io/aui-client/3.1.
|
|
28
|
+
"X-Fern-SDK-Version": "3.1.2",
|
|
29
|
+
"User-Agent": "@aui.io/aui-client/3.1.2",
|
|
30
30
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
31
31
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
32
32
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.1.
|
|
1
|
+
export declare const SDK_VERSION = "3.1.2";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "3.1.
|
|
1
|
+
export const SDK_VERSION = "3.1.2";
|