@genesislcap/foundation-comms 14.499.0 → 14.500.0

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.
@@ -3,6 +3,7 @@ import type { Metadata, SchemaResponse } from '../metadata';
3
3
  import { MetaCache } from '../metadata';
4
4
  import { ConnectEventsEmitter } from './connect.events';
5
5
  import { ConnectConfig } from './connect.types';
6
+ import { HttpTransport } from './httpTransport';
6
7
  import { CommitParams, DataserverParams, Message, MessageBuilder, RequestParams, ResourcesMessage } from './message';
7
8
  import type { SocketObservable } from './socket';
8
9
  import { Socket } from './socket';
@@ -185,13 +186,33 @@ export declare class DefaultConnect implements Connect {
185
186
  private metaCache;
186
187
  private events;
187
188
  private config;
189
+ private transport;
188
190
  isWorking: boolean;
189
191
  get isConnected(): boolean;
190
192
  get isConnectedSubject(): BehaviorSubject<boolean>;
191
193
  get isConnected$(): Observable<boolean>;
192
194
  get host(): string;
193
- constructor(socket: Socket, messageBuilder: MessageBuilder, metaCache: MetaCache, events: ConnectEventsEmitter, config: ConnectConfig);
195
+ constructor(socket: Socket, messageBuilder: MessageBuilder, metaCache: MetaCache, events: ConnectEventsEmitter, config: ConnectConfig, transport: HttpTransport);
194
196
  httpMode(): boolean;
197
+ /**
198
+ * Whether request/reply and event traffic should be sent over HTTP while the primary
199
+ * connection stays on the WebSocket. Toggled by the `FORCE_HTTP_REQREP` env var or the
200
+ * `?feature.forceHttpReqRep` URL flag. Streaming (`stream`/`snapshot`) always uses the socket.
201
+ * @internal
202
+ */
203
+ private get useHttpReqRep();
204
+ /**
205
+ * The `http(s)://` host derived from the socket's (`ws(s)://`) host, used when routing
206
+ * request/reply and event traffic over HTTP.
207
+ * @internal
208
+ */
209
+ private get httpHost();
210
+ /**
211
+ * Sends an event/commit or metadata-style message, routing it over HTTP (POST) when
212
+ * `useHttpReqRep` is active and falling back to the WebSocket otherwise.
213
+ * @internal
214
+ */
215
+ private sendReqRep;
195
216
  /**
196
217
  * @deprecated - Please reference `User` from `@genesislcap/foundation-user` instead.
197
218
  */
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../src/connect/connect.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAEL,YAAY,EACZ,gBAAgB,EAEhB,OAAO,EACP,cAAc,EACd,aAAa,EACb,gBAAgB,EACjB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAE5C;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IAEvD;;;;;;;OAOG;IACH,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC;IAEpF;;;;OAIG;IACH,QAAQ,IAAI,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CA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MAAM,CAAC,EAAE,gBAAgB,GACxB,gBAAgB,CAAC,OAAO,CAAC;IAef,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMrE,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKnD,UAAU,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMrD,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,GAAE,OAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAmC9E,aAAa,CACxB,YAAY,EAAE,MAAM,EACpB,QAAQ,GAAE,OAAc,GACvB,OAAO,CAAC,cAAc,CAAC;IAiC1B,OAAO,CAAC,gBAAgB,CAAuC;IAElD,OAAO,CAClB,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,aAAa,EACtB,QAAQ,GAAE,OAAe,GACxB,OAAO,CAAC,OAAO,CAAC;IAqCb,qBAAqB,CACzB,MAAM,CAAC,EAAE,aAAa,EACtB,QAAQ,GAAE,OAAc,GACvB,OAAO,CAAC,gBAAgB,CAAC;IAef,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;CAWrF;AAID;;;GAGG;AACH,eAAO,MAAM,SAAS,+DAAkE,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,OAAO,+DAEnB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC"}
@@ -6,6 +6,7 @@ import { Session } from '../session';
6
6
  import type { Connect } from './connect';
7
7
  import { Http } from './http';
8
8
  import { HttpConnectConfig } from './http.connect.types';
9
+ import { HttpTransport } from './httpTransport';
9
10
  import { CommitParams, Message, MessageBuilder, RequestParams, ResourcesMessage } from './message';
10
11
  import { SocketObservable } from './socket';
11
12
  /**
@@ -19,6 +20,7 @@ export declare class DefaultHttpConnect implements Connect {
19
20
  private metaCache;
20
21
  private serializer;
21
22
  private config;
23
+ private transport;
22
24
  host: string;
23
25
  isWorking: boolean;
24
26
  private _isConnected;
@@ -51,7 +53,7 @@ export declare class DefaultHttpConnect implements Connect {
51
53
  * @internal
52
54
  */
53
55
  private ongoingRefresh;
54
- constructor(http: Http, messageBuilder: MessageBuilder, session: Session, metaCache: MetaCache, serializer: JSONSerializer, config: HttpConnectConfig);
56
+ constructor(http: Http, messageBuilder: MessageBuilder, session: Session, metaCache: MetaCache, serializer: JSONSerializer, config: HttpConnectConfig, transport: HttpTransport);
55
57
  /**
56
58
  * Attempts to refresh the session when a 401 Unauthorized error is received.
57
59
  * Uses a lock mechanism to prevent multiple tabs from trying to reauthenticate simultaneously.
@@ -91,8 +93,6 @@ export declare class DefaultHttpConnect implements Connect {
91
93
  private maybeTurbo;
92
94
  private updateIntervals;
93
95
  private handlePollingIntervalMapUpdate;
94
- private static getBody;
95
- private static getUrl;
96
96
  }
97
97
  /**
98
98
  * The DI token for the Connect interface (HTTP-only).
@@ -1 +1 @@
1
- {"version":3,"file":"http.connect.d.ts","sourceRoot":"","sources":["../../../src/connect/http.connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D,OAAO,EACL,eAAe,EAMf,UAAU,EAMX,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAEL,YAAY,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,GAAG,EAAE,QAAQ,GAAE,OAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAkBjF,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAYpF,OAAO,CAAC,UAAU;IAkDlB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,8BAA8B;CAkBvC;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,+DAAsE,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { Http } from './http';
2
+ import { Message, MessageBuilder } from './message';
3
+ /**
4
+ * Sends Connect {@link Message}s over HTTP.
5
+ *
6
+ * @remarks
7
+ * Encapsulates the URL, body and header construction shared by the HTTP-only Connect
8
+ * ({@link DefaultHttpConnect}) and the WebSocket-primary Connect ({@link DefaultConnect}) when
9
+ * request/reply and event traffic is routed over HTTP. Keeping this in one place means both
10
+ * transports build endpoints identically.
11
+ * @internal
12
+ */
13
+ export interface HttpTransport {
14
+ /**
15
+ * Normalises a (possibly `ws(s)://`) host to an `http(s)://` host with a trailing slash.
16
+ * @param host - The host to normalise. Returns `''` when no host is provided.
17
+ */
18
+ toHttpHost(host?: string): string;
19
+ /**
20
+ * POSTs a message and resolves with the reply.
21
+ * @remarks Used for events, commits, metadata, schema and resources lookups.
22
+ * @param host - The `http(s)://` host to send to.
23
+ * @param message - The message to send.
24
+ */
25
+ post(host: string, message: Message<any>): Promise<Message>;
26
+ /**
27
+ * GETs a message and resolves with the reply.
28
+ * @remarks Used for `DATA_LOGON` polling where the endpoint carries no query string.
29
+ * @param host - The `http(s)://` host to send to.
30
+ * @param message - The message to send.
31
+ */
32
+ get(host: string, message: Message<any>): Promise<Message>;
33
+ /**
34
+ * GETs a `REQUEST_SERVER` message, encoding its `REQUEST`/`DETAILS` params as a query string.
35
+ * @param host - The `http(s)://` host to send to.
36
+ * @param requestMessage - The request message to send.
37
+ */
38
+ requestServer(host: string, requestMessage: Message<any>): Promise<Message>;
39
+ }
40
+ /**
41
+ * The default implementation of the `HttpTransport` interface.
42
+ * @internal
43
+ */
44
+ export declare class DefaultHttpTransport implements HttpTransport {
45
+ private http;
46
+ private messageBuilder;
47
+ constructor(http: Http, messageBuilder: MessageBuilder);
48
+ toHttpHost(host?: string): string;
49
+ post(host: string, message: Message<any>): Promise<Message>;
50
+ get(host: string, message: Message<any>): Promise<Message>;
51
+ requestServer(host: string, requestMessage: Message<any>): Promise<Message>;
52
+ private static getBody;
53
+ private static getUrl;
54
+ }
55
+ /**
56
+ * The DI token for the `HttpTransport` interface.
57
+ * @internal
58
+ */
59
+ export declare const HttpTransport: import("@microsoft/fast-foundation").InterfaceSymbol<HttpTransport>;
60
+ //# sourceMappingURL=httpTransport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"httpTransport.d.ts","sourceRoot":"","sources":["../../../src/connect/httpTransport.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAoB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEtE;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE5D;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE3D;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7E;AAED;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,aAAa;IAEhD,OAAO,CAAC,IAAI;IACF,OAAO,CAAC,cAAc;gBADxB,IAAI,EAAE,IAAI,EACA,cAAc,EAAE,cAAc;IAGjD,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM;IAkBjC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAO3D,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAM1D,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAuClF,OAAO,CAAC,MAAM,CAAC,OAAO;IAItB,OAAO,CAAC,MAAM,CAAC,MAAM;CAUtB;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,qEAEzB,CAAC"}
@@ -5,6 +5,7 @@ export * from './connect.types';
5
5
  export * from './http';
6
6
  export * from './http.connect';
7
7
  export * from './http.connect.types';
8
+ export * from './httpTransport';
8
9
  export * from './message';
9
10
  export * from './reconnectStrategy';
10
11
  export * from './serializers';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connect/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connect/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { __awaiter, __decorate, __param } from "tslib";
2
- import { FORCE_HTTP, GENESIS_SOCKET_URL, isFeatureActivated } from '@genesislcap/foundation-utils';
2
+ import { FORCE_HTTP, FORCE_HTTP_REQREP, GENESIS_SOCKET_URL, isFeatureActivated, } from '@genesislcap/foundation-utils';
3
3
  import { observable } from '@microsoft/fast-element';
4
4
  import { DI } from '@microsoft/fast-foundation';
5
5
  import { scan } from 'rxjs';
@@ -8,6 +8,7 @@ import { logger } from '../utils';
8
8
  import { ConnectEventsEmitter } from './connect.events';
9
9
  import { ConnectConfig } from './connect.types';
10
10
  import { HttpConnect } from './http.connect';
11
+ import { HttpTransport } from './httpTransport';
11
12
  import { buildRequestCacheKey, EventMessageType, MessageBuilder, } from './message';
12
13
  import { Socket } from './socket';
13
14
  import { updateState } from './updateState';
@@ -29,18 +30,46 @@ let DefaultConnect = class DefaultConnect {
29
30
  get host() {
30
31
  return this.socket.host;
31
32
  }
32
- constructor(socket, messageBuilder, metaCache, events, config) {
33
+ constructor(socket, messageBuilder, metaCache, events, config, transport) {
33
34
  this.socket = socket;
34
35
  this.messageBuilder = messageBuilder;
35
36
  this.metaCache = metaCache;
36
37
  this.events = events;
37
38
  this.config = config;
39
+ this.transport = transport;
38
40
  this.isWorking = false;
39
41
  this.inFlightRequests = new Map();
40
42
  }
41
43
  httpMode() {
42
44
  return false;
43
45
  }
46
+ /**
47
+ * Whether request/reply and event traffic should be sent over HTTP while the primary
48
+ * connection stays on the WebSocket. Toggled by the `FORCE_HTTP_REQREP` env var or the
49
+ * `?feature.forceHttpReqRep` URL flag. Streaming (`stream`/`snapshot`) always uses the socket.
50
+ * @internal
51
+ */
52
+ get useHttpReqRep() {
53
+ return FORCE_HTTP_REQREP === 'true' || isFeatureActivated('forceHttpReqRep');
54
+ }
55
+ /**
56
+ * The `http(s)://` host derived from the socket's (`ws(s)://`) host, used when routing
57
+ * request/reply and event traffic over HTTP.
58
+ * @internal
59
+ */
60
+ get httpHost() {
61
+ return this.transport.toHttpHost(this.socket.host);
62
+ }
63
+ /**
64
+ * Sends an event/commit or metadata-style message, routing it over HTTP (POST) when
65
+ * `useHttpReqRep` is active and falling back to the WebSocket otherwise.
66
+ * @internal
67
+ */
68
+ sendReqRep(message) {
69
+ return this.useHttpReqRep
70
+ ? this.transport.post(this.httpHost, message)
71
+ : this.socket.send(message);
72
+ }
44
73
  /**
45
74
  * @deprecated - Please reference `User` from `@genesislcap/foundation-user` instead.
46
75
  */
@@ -141,7 +170,7 @@ let DefaultConnect = class DefaultConnect {
141
170
  let error;
142
171
  try {
143
172
  this.isWorking = true;
144
- const metaResponse = yield this.socket.send(metaRequestMessage);
173
+ const metaResponse = yield this.sendReqRep(metaRequestMessage);
145
174
  details = (_a = metaResponse === null || metaResponse === void 0 ? void 0 : metaResponse.DETAILS) !== null && _a !== void 0 ? _a : {};
146
175
  if (Object.keys(details).length) {
147
176
  this.metaCache.setMetadataFor(resourceName, details);
@@ -173,7 +202,7 @@ let DefaultConnect = class DefaultConnect {
173
202
  let jsonSchema;
174
203
  try {
175
204
  this.isWorking = true;
176
- jsonSchema = (_a = (yield this.socket.send(metaRequestMessage))) !== null && _a !== void 0 ? _a : {};
205
+ jsonSchema = (_a = (yield this.sendReqRep(metaRequestMessage))) !== null && _a !== void 0 ? _a : {};
177
206
  if (Object.keys(jsonSchema).length) {
178
207
  this.metaCache.setJsonSchemaFor(resourceName, jsonSchema);
179
208
  }
@@ -201,7 +230,11 @@ let DefaultConnect = class DefaultConnect {
201
230
  }
202
231
  const requestMessage = this.messageBuilder.createRequestMessage(resourceName, params);
203
232
  logger.debug(`${requestMessage.MESSAGE_TYPE} (request server) message created -> `, requestMessage);
204
- const promise = this.socket.send(requestMessage).finally(() => {
233
+ // REQUEST_SERVER messages go out as a GET (query-string encoded) over HTTP, mirroring the
234
+ // HTTP-only Connect, otherwise they travel over the socket.
235
+ const promise = (this.useHttpReqRep
236
+ ? this.transport.requestServer(this.httpHost, requestMessage)
237
+ : this.socket.send(requestMessage)).finally(() => {
205
238
  this.inFlightRequests.delete(cacheKey);
206
239
  });
207
240
  this.inFlightRequests.set(cacheKey, promise);
@@ -222,7 +255,7 @@ let DefaultConnect = class DefaultConnect {
222
255
  }
223
256
  const requestMessage = this.messageBuilder.createResourcesMessage(params);
224
257
  logger.debug(`${requestMessage.MESSAGE_TYPE} (resources) message created -> `, requestMessage);
225
- const resources = yield this.socket.send(requestMessage);
258
+ const resources = yield this.sendReqRep(requestMessage);
226
259
  this.metaCache.setResources(resources);
227
260
  return resources;
228
261
  });
@@ -231,7 +264,7 @@ let DefaultConnect = class DefaultConnect {
231
264
  return __awaiter(this, void 0, void 0, function* () {
232
265
  const msg = this.messageBuilder.createCommitMessage(eventName, params);
233
266
  logger.debug(`${msg.MESSAGE_TYPE} (commit) message created -> `, msg);
234
- const promise = this.socket.send(msg);
267
+ const promise = this.sendReqRep(msg);
235
268
  this.events.onCommitEvent(eventName, msg);
236
269
  return promise.then((response) => {
237
270
  this.events.onCommitResponseEvent(eventName, response);
@@ -248,7 +281,8 @@ DefaultConnect = __decorate([
248
281
  __param(1, MessageBuilder),
249
282
  __param(2, MetaCache),
250
283
  __param(3, ConnectEventsEmitter),
251
- __param(4, ConnectConfig)
284
+ __param(4, ConnectConfig),
285
+ __param(5, HttpTransport)
252
286
  ], DefaultConnect);
253
287
  export { DefaultConnect };
254
288
  const useHttpConnect = FORCE_HTTP === 'true' || isFeatureActivated('forceHttp');
@@ -10,6 +10,7 @@ import { Session } from '../session';
10
10
  import { logger } from '../utils';
11
11
  import { Http } from './http';
12
12
  import { HttpConnectConfig } from './http.connect.types';
13
+ import { HttpTransport } from './httpTransport';
13
14
  import { buildRequestCacheKey, EventMessageType, MessageBuilder, MessageType, } from './message';
14
15
  import { SessionRefreshResult, tryRefreshSession } from './sessionRefresh';
15
16
  import { updateState } from './updateState';
@@ -25,7 +26,7 @@ let DefaultHttpConnect = DefaultHttpConnect_1 = class DefaultHttpConnect {
25
26
  this._isConnected = value;
26
27
  this.isConnectedSubject.next(this._isConnected);
27
28
  }
28
- constructor(http, messageBuilder, session, metaCache, serializer, config) {
29
+ constructor(http, messageBuilder, session, metaCache, serializer, config, transport) {
29
30
  var _a;
30
31
  this.http = http;
31
32
  this.messageBuilder = messageBuilder;
@@ -33,6 +34,7 @@ let DefaultHttpConnect = DefaultHttpConnect_1 = class DefaultHttpConnect {
33
34
  this.metaCache = metaCache;
34
35
  this.serializer = serializer;
35
36
  this.config = config;
37
+ this.transport = transport;
36
38
  this.isWorking = false;
37
39
  this._isConnected = false;
38
40
  // TODO: Deprecated
@@ -122,10 +124,7 @@ let DefaultHttpConnect = DefaultHttpConnect_1 = class DefaultHttpConnect {
122
124
  throw new Error('Cannot send message: session refresh failed');
123
125
  }
124
126
  }
125
- return this.http.post(DefaultHttpConnect_1.getUrl(this.host, message), {
126
- body: DefaultHttpConnect_1.getBody(message),
127
- headers: this.messageBuilder.createHTTPHeadersFromMessage(message),
128
- });
127
+ return this.transport.post(this.host, message);
129
128
  });
130
129
  }
131
130
  httpMode() {
@@ -139,15 +138,9 @@ let DefaultHttpConnect = DefaultHttpConnect_1 = class DefaultHttpConnect {
139
138
  }
140
139
  connect(host) {
141
140
  return __awaiter(this, void 0, void 0, function* () {
142
- this.host = host;
143
- // below will convert the host to http one if someone is
144
- // using the feature flag to force http mode but set api host as ws url
145
- if (this.host.startsWith('ws')) {
146
- this.host = this.host.replace('ws', 'http');
147
- }
148
- if (!this.host.endsWith('/')) {
149
- this.host = this.host.concat('/');
150
- }
141
+ // converts the host to an http one if someone is using the feature flag to
142
+ // force http mode but set the api host as a ws url, and ensures a trailing slash
143
+ this.host = this.transport.toHttpHost(host);
151
144
  return this.checkHost().then((connected) => {
152
145
  this.isConnected = connected;
153
146
  this.session.setSessionStorageItem('hostUrl', this.host);
@@ -239,9 +232,7 @@ let DefaultHttpConnect = DefaultHttpConnect_1 = class DefaultHttpConnect {
239
232
  throw new Error('Cannot get message: session refresh failed');
240
233
  }
241
234
  }
242
- return this.http.get(DefaultHttpConnect_1.getUrl(this.host, message), {
243
- headers: this.messageBuilder.createHTTPHeadersFromMessage(message),
244
- });
235
+ return this.transport.get(this.host, message);
245
236
  });
246
237
  }
247
238
  getMoreRows(sourceRef) {
@@ -308,39 +299,9 @@ let DefaultHttpConnect = DefaultHttpConnect_1 = class DefaultHttpConnect {
308
299
  }
309
300
  const requestMessage = this.messageBuilder.createRequestMessage(resourceName, params);
310
301
  logger.debug(`HTTP MODE! - ${requestMessage.MESSAGE_TYPE} (request server) message created -> `, requestMessage);
311
- // REQUEST_SERVER messages use GET method in HTTP mode
312
- // GET requests cannot have a body, so we convert REQUEST and DETAILS params to query string
313
- let url = DefaultHttpConnect_1.getUrl(this.host, requestMessage);
314
- const queryParts = [];
315
- if (requestMessage.REQUEST && Object.keys(requestMessage.REQUEST).length > 0) {
316
- Object.keys(requestMessage.REQUEST).forEach((key) => {
317
- const value = requestMessage.REQUEST[key];
318
- if (value !== undefined && value !== null && !Number.isNaN(value)) {
319
- // Server expects REQUEST.FIELD_NAME=value format
320
- // Using dot notation which the server converts internally
321
- queryParts.push(`REQUEST.${key}=${encodeURIComponent(String(value))}`);
322
- }
323
- });
324
- }
325
- // Note: Server expects these as plain parameters (e.g., MAX_ROWS=250)
326
- // The server converts them to DETAILS.FIELD_NAME internally
327
- if (requestMessage.DETAILS) {
328
- Object.keys(requestMessage.DETAILS).forEach((key) => {
329
- const value = requestMessage.DETAILS[key];
330
- if (value !== undefined && value !== null && !Number.isNaN(value)) {
331
- queryParts.push(`${key}=${encodeURIComponent(String(value))}`);
332
- }
333
- });
334
- }
335
- if (queryParts.length > 0) {
336
- url = `${url}?${queryParts.join('&')}`;
337
- }
338
- logger.debug(`HTTP MODE! - REQUEST_SERVER GET URL: ${url}`);
339
- const promise = this.http
340
- .get(url, {
341
- headers: this.messageBuilder.createHTTPHeadersFromMessage(requestMessage),
342
- })
343
- .finally(() => {
302
+ // REQUEST_SERVER messages use the GET method in HTTP mode; the transport encodes the
303
+ // REQUEST/DETAILS params as a query string since GET requests cannot carry a body.
304
+ const promise = this.transport.requestServer(this.host, requestMessage).finally(() => {
344
305
  this.inFlightRequests.delete(cacheKey);
345
306
  });
346
307
  this.inFlightRequests.set(cacheKey, promise);
@@ -441,18 +402,6 @@ let DefaultHttpConnect = DefaultHttpConnect_1 = class DefaultHttpConnect {
441
402
  .forEach((s) => { var _a; return (_a = s === null || s === void 0 ? void 0 : s.POLLING_FREQUENCY) === null || _a === void 0 ? void 0 : _a.next(newFreq); });
442
403
  }
443
404
  }
444
- static getBody(message) {
445
- return JSON.stringify(message);
446
- }
447
- static getUrl(host, message) {
448
- const type = message.MESSAGE_TYPE;
449
- let apiEndpoint = message.MESSAGE_TYPE.replace(/_/g, '-').toLowerCase();
450
- // for DATA_LOGON we go by resource name
451
- if (type === EventMessageType.DATA_LOGON) {
452
- apiEndpoint = message.DETAILS.DATASOURCE_NAME.replace(/_/g, '-').toLowerCase();
453
- }
454
- return `${host}${apiEndpoint}`;
455
- }
456
405
  };
457
406
  /**
458
407
  * Amount of time (in milliseconds) to wait when another tab is handling session reauthentication.
@@ -484,7 +433,8 @@ DefaultHttpConnect = DefaultHttpConnect_1 = __decorate([
484
433
  __param(2, Session),
485
434
  __param(3, MetaCache),
486
435
  __param(4, JSONSerializer),
487
- __param(5, HttpConnectConfig)
436
+ __param(5, HttpConnectConfig),
437
+ __param(6, HttpTransport)
488
438
  ], DefaultHttpConnect);
489
439
  export { DefaultHttpConnect };
490
440
  /**
@@ -0,0 +1,99 @@
1
+ var DefaultHttpTransport_1;
2
+ import { __decorate, __param } from "tslib";
3
+ import { DI } from '@microsoft/fast-foundation';
4
+ import { logger } from '../utils';
5
+ import { Http } from './http';
6
+ import { EventMessageType, MessageBuilder } from './message';
7
+ /**
8
+ * The default implementation of the `HttpTransport` interface.
9
+ * @internal
10
+ */
11
+ let DefaultHttpTransport = DefaultHttpTransport_1 = class DefaultHttpTransport {
12
+ constructor(http, messageBuilder) {
13
+ this.http = http;
14
+ this.messageBuilder = messageBuilder;
15
+ }
16
+ toHttpHost(host) {
17
+ // guard against a missing host (e.g. before the socket has connected, or mock connections
18
+ // in tests) so callers never hit `Cannot read properties of undefined (reading 'startsWith')`
19
+ if (!host) {
20
+ return '';
21
+ }
22
+ let normalised = host;
23
+ // converts a ws host to an http one, e.g. when a consumer forces HTTP mode but
24
+ // configures the api host as a ws url
25
+ if (normalised.startsWith('ws')) {
26
+ normalised = normalised.replace('ws', 'http');
27
+ }
28
+ if (!normalised.endsWith('/')) {
29
+ normalised = normalised.concat('/');
30
+ }
31
+ return normalised;
32
+ }
33
+ post(host, message) {
34
+ return this.http.post(DefaultHttpTransport_1.getUrl(host, message), {
35
+ body: DefaultHttpTransport_1.getBody(message),
36
+ headers: this.messageBuilder.createHTTPHeadersFromMessage(message),
37
+ });
38
+ }
39
+ get(host, message) {
40
+ return this.http.get(DefaultHttpTransport_1.getUrl(host, message), {
41
+ headers: this.messageBuilder.createHTTPHeadersFromMessage(message),
42
+ });
43
+ }
44
+ requestServer(host, requestMessage) {
45
+ // REQUEST_SERVER messages use the GET method in HTTP mode.
46
+ // GET requests cannot have a body, so we convert REQUEST and DETAILS params to a query string.
47
+ let url = DefaultHttpTransport_1.getUrl(host, requestMessage);
48
+ const queryParts = [];
49
+ if (requestMessage.REQUEST && Object.keys(requestMessage.REQUEST).length > 0) {
50
+ Object.keys(requestMessage.REQUEST).forEach((key) => {
51
+ const value = requestMessage.REQUEST[key];
52
+ if (value !== undefined && value !== null && !Number.isNaN(value)) {
53
+ // Server expects REQUEST.FIELD_NAME=value format.
54
+ // Using dot notation which the server converts internally.
55
+ queryParts.push(`REQUEST.${key}=${encodeURIComponent(String(value))}`);
56
+ }
57
+ });
58
+ }
59
+ // Note: Server expects these as plain parameters (e.g., MAX_ROWS=250).
60
+ // The server converts them to DETAILS.FIELD_NAME internally.
61
+ if (requestMessage.DETAILS) {
62
+ Object.keys(requestMessage.DETAILS).forEach((key) => {
63
+ const value = requestMessage.DETAILS[key];
64
+ if (value !== undefined && value !== null && !Number.isNaN(value)) {
65
+ queryParts.push(`${key}=${encodeURIComponent(String(value))}`);
66
+ }
67
+ });
68
+ }
69
+ if (queryParts.length > 0) {
70
+ url = `${url}?${queryParts.join('&')}`;
71
+ }
72
+ logger.debug(`HTTP transport - REQUEST_SERVER GET URL: ${url}`);
73
+ return this.http.get(url, {
74
+ headers: this.messageBuilder.createHTTPHeadersFromMessage(requestMessage),
75
+ });
76
+ }
77
+ static getBody(message) {
78
+ return JSON.stringify(message);
79
+ }
80
+ static getUrl(host, message) {
81
+ const type = message.MESSAGE_TYPE;
82
+ let apiEndpoint = message.MESSAGE_TYPE.replace(/_/g, '-').toLowerCase();
83
+ // for DATA_LOGON we go by resource name
84
+ if (type === EventMessageType.DATA_LOGON) {
85
+ apiEndpoint = message.DETAILS.DATASOURCE_NAME.replace(/_/g, '-').toLowerCase();
86
+ }
87
+ return `${host}${apiEndpoint}`;
88
+ }
89
+ };
90
+ DefaultHttpTransport = DefaultHttpTransport_1 = __decorate([
91
+ __param(0, Http),
92
+ __param(1, MessageBuilder)
93
+ ], DefaultHttpTransport);
94
+ export { DefaultHttpTransport };
95
+ /**
96
+ * The DI token for the `HttpTransport` interface.
97
+ * @internal
98
+ */
99
+ export const HttpTransport = DI.createInterface((x) => x.singleton(DefaultHttpTransport));
@@ -5,6 +5,7 @@ export * from './connect.types';
5
5
  export * from './http';
6
6
  export * from './http.connect';
7
7
  export * from './http.connect.types';
8
+ export * from './httpTransport';
8
9
  export * from './message';
9
10
  export * from './reconnectStrategy';
10
11
  export * from './serializers';
@@ -11814,6 +11814,15 @@
11814
11814
  "text": "ConnectConfig",
11815
11815
  "canonicalReference": "@genesislcap/foundation-comms!ConnectConfig:interface"
11816
11816
  },
11817
+ {
11818
+ "kind": "Content",
11819
+ "text": ", transport: "
11820
+ },
11821
+ {
11822
+ "kind": "Reference",
11823
+ "text": "HttpTransport",
11824
+ "canonicalReference": "@genesislcap/foundation-comms!HttpTransport:interface"
11825
+ },
11817
11826
  {
11818
11827
  "kind": "Content",
11819
11828
  "text": ");"
@@ -11862,6 +11871,14 @@
11862
11871
  "endIndex": 10
11863
11872
  },
11864
11873
  "isOptional": false
11874
+ },
11875
+ {
11876
+ "parameterName": "transport",
11877
+ "parameterTypeTokenRange": {
11878
+ "startIndex": 11,
11879
+ "endIndex": 12
11880
+ },
11881
+ "isOptional": false
11865
11882
  }
11866
11883
  ]
11867
11884
  },
@@ -18174,6 +18191,15 @@
18174
18191
  "text": "HttpConnectConfig",
18175
18192
  "canonicalReference": "@genesislcap/foundation-comms!HttpConnectConfig:interface"
18176
18193
  },
18194
+ {
18195
+ "kind": "Content",
18196
+ "text": ", transport: "
18197
+ },
18198
+ {
18199
+ "kind": "Reference",
18200
+ "text": "HttpTransport",
18201
+ "canonicalReference": "@genesislcap/foundation-comms!HttpTransport:interface"
18202
+ },
18177
18203
  {
18178
18204
  "kind": "Content",
18179
18205
  "text": ");"
@@ -18230,6 +18256,14 @@
18230
18256
  "endIndex": 12
18231
18257
  },
18232
18258
  "isOptional": false
18259
+ },
18260
+ {
18261
+ "parameterName": "transport",
18262
+ "parameterTypeTokenRange": {
18263
+ "startIndex": 13,
18264
+ "endIndex": 14
18265
+ },
18266
+ "isOptional": false
18233
18267
  }
18234
18268
  ]
18235
18269
  },
@@ -1860,13 +1860,33 @@ export declare class DefaultConnect implements Connect {
1860
1860
  private metaCache;
1861
1861
  private events;
1862
1862
  private config;
1863
+ private transport;
1863
1864
  isWorking: boolean;
1864
1865
  get isConnected(): boolean;
1865
1866
  get isConnectedSubject(): BehaviorSubject<boolean>;
1866
1867
  get isConnected$(): Observable<boolean>;
1867
1868
  get host(): string;
1868
- constructor(socket: Socket, messageBuilder: MessageBuilder, metaCache: MetaCache, events: ConnectEventsEmitter, config: ConnectConfig);
1869
+ constructor(socket: Socket, messageBuilder: MessageBuilder, metaCache: MetaCache, events: ConnectEventsEmitter, config: ConnectConfig, transport: HttpTransport);
1869
1870
  httpMode(): boolean;
1871
+ /**
1872
+ * Whether request/reply and event traffic should be sent over HTTP while the primary
1873
+ * connection stays on the WebSocket. Toggled by the `FORCE_HTTP_REQREP` env var or the
1874
+ * `?feature.forceHttpReqRep` URL flag. Streaming (`stream`/`snapshot`) always uses the socket.
1875
+ * @internal
1876
+ */
1877
+ private get useHttpReqRep();
1878
+ /**
1879
+ * The `http(s)://` host derived from the socket's (`ws(s)://`) host, used when routing
1880
+ * request/reply and event traffic over HTTP.
1881
+ * @internal
1882
+ */
1883
+ private get httpHost();
1884
+ /**
1885
+ * Sends an event/commit or metadata-style message, routing it over HTTP (POST) when
1886
+ * `useHttpReqRep` is active and falling back to the WebSocket otherwise.
1887
+ * @internal
1888
+ */
1889
+ private sendReqRep;
1870
1890
  /**
1871
1891
  * @deprecated - Please reference `User` from `@genesislcap/foundation-user` instead.
1872
1892
  */
@@ -2175,6 +2195,7 @@ export declare class DefaultHttpConnect implements Connect {
2175
2195
  private metaCache;
2176
2196
  private serializer;
2177
2197
  private config;
2198
+ private transport;
2178
2199
  host: string;
2179
2200
  isWorking: boolean;
2180
2201
  private _isConnected;
@@ -2207,7 +2228,7 @@ export declare class DefaultHttpConnect implements Connect {
2207
2228
  * @internal
2208
2229
  */
2209
2230
  private ongoingRefresh;
2210
- constructor(http: Http, messageBuilder: MessageBuilder, session: Session, metaCache: MetaCache, serializer: JSONSerializer, config: HttpConnectConfig);
2231
+ constructor(http: Http, messageBuilder: MessageBuilder, session: Session, metaCache: MetaCache, serializer: JSONSerializer, config: HttpConnectConfig, transport: HttpTransport);
2211
2232
  /**
2212
2233
  * Attempts to refresh the session when a 401 Unauthorized error is received.
2213
2234
  * Uses a lock mechanism to prevent multiple tabs from trying to reauthenticate simultaneously.
@@ -2247,8 +2268,6 @@ export declare class DefaultHttpConnect implements Connect {
2247
2268
  private maybeTurbo;
2248
2269
  private updateIntervals;
2249
2270
  private handlePollingIntervalMapUpdate;
2250
- private static getBody;
2251
- private static getUrl;
2252
2271
  }
2253
2272
 
2254
2273
  /**
@@ -2257,6 +2276,22 @@ export declare class DefaultHttpConnect implements Connect {
2257
2276
  */
2258
2277
  export declare const defaultHttpConnectConfig: HttpConnectConfig;
2259
2278
 
2279
+ /**
2280
+ * The default implementation of the `HttpTransport` interface.
2281
+ * @internal
2282
+ */
2283
+ export declare class DefaultHttpTransport implements HttpTransport {
2284
+ private http;
2285
+ private messageBuilder;
2286
+ constructor(http: Http, messageBuilder: MessageBuilder);
2287
+ toHttpHost(host?: string): string;
2288
+ post(host: string, message: Message<any>): Promise<Message>;
2289
+ get(host: string, message: Message<any>): Promise<Message>;
2290
+ requestServer(host: string, requestMessage: Message<any>): Promise<Message>;
2291
+ private static getBody;
2292
+ private static getUrl;
2293
+ }
2294
+
2260
2295
  /**
2261
2296
  * The default implementation for the KVStorage interface.
2262
2297
  * @alpha
@@ -3340,6 +3375,50 @@ export declare interface HttpRequestInit extends RequestInit {
3340
3375
  serializer?: JSONSerializer;
3341
3376
  }
3342
3377
 
3378
+ /**
3379
+ * Sends Connect {@link Message}s over HTTP.
3380
+ *
3381
+ * @remarks
3382
+ * Encapsulates the URL, body and header construction shared by the HTTP-only Connect
3383
+ * ({@link DefaultHttpConnect}) and the WebSocket-primary Connect ({@link DefaultConnect}) when
3384
+ * request/reply and event traffic is routed over HTTP. Keeping this in one place means both
3385
+ * transports build endpoints identically.
3386
+ * @internal
3387
+ */
3388
+ export declare interface HttpTransport {
3389
+ /**
3390
+ * Normalises a (possibly `ws(s)://`) host to an `http(s)://` host with a trailing slash.
3391
+ * @param host - The host to normalise. Returns `''` when no host is provided.
3392
+ */
3393
+ toHttpHost(host?: string): string;
3394
+ /**
3395
+ * POSTs a message and resolves with the reply.
3396
+ * @remarks Used for events, commits, metadata, schema and resources lookups.
3397
+ * @param host - The `http(s)://` host to send to.
3398
+ * @param message - The message to send.
3399
+ */
3400
+ post(host: string, message: Message<any>): Promise<Message>;
3401
+ /**
3402
+ * GETs a message and resolves with the reply.
3403
+ * @remarks Used for `DATA_LOGON` polling where the endpoint carries no query string.
3404
+ * @param host - The `http(s)://` host to send to.
3405
+ * @param message - The message to send.
3406
+ */
3407
+ get(host: string, message: Message<any>): Promise<Message>;
3408
+ /**
3409
+ * GETs a `REQUEST_SERVER` message, encoding its `REQUEST`/`DETAILS` params as a query string.
3410
+ * @param host - The `http(s)://` host to send to.
3411
+ * @param requestMessage - The request message to send.
3412
+ */
3413
+ requestServer(host: string, requestMessage: Message<any>): Promise<Message>;
3414
+ }
3415
+
3416
+ /**
3417
+ * The DI token for the `HttpTransport` interface.
3418
+ * @internal
3419
+ */
3420
+ export declare const HttpTransport: InterfaceSymbol<HttpTransport>;
3421
+
3343
3422
  /**
3344
3423
  * Index Detail definition.
3345
3424
  * @public
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-comms",
3
3
  "description": "Genesis Foundation UI Comms",
4
- "version": "14.499.0",
4
+ "version": "14.500.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -77,24 +77,24 @@
77
77
  }
78
78
  },
79
79
  "devDependencies": {
80
- "@genesislcap/foundation-testing": "14.499.0",
81
- "@genesislcap/genx": "14.499.0",
82
- "@genesislcap/rollup-builder": "14.499.0",
83
- "@genesislcap/ts-builder": "14.499.0",
84
- "@genesislcap/uvu-playwright-builder": "14.499.0",
85
- "@genesislcap/vite-builder": "14.499.0",
86
- "@genesislcap/webpack-builder": "14.499.0",
80
+ "@genesislcap/foundation-testing": "14.500.0",
81
+ "@genesislcap/genx": "14.500.0",
82
+ "@genesislcap/rollup-builder": "14.500.0",
83
+ "@genesislcap/ts-builder": "14.500.0",
84
+ "@genesislcap/uvu-playwright-builder": "14.500.0",
85
+ "@genesislcap/vite-builder": "14.500.0",
86
+ "@genesislcap/webpack-builder": "14.500.0",
87
87
  "@types/js-cookie": "^3.0.2",
88
88
  "@types/json-schema": "^7.0.11",
89
89
  "@types/webappsec-credential-management": "^0.6.2",
90
90
  "sinon": "^17.0.1"
91
91
  },
92
92
  "dependencies": {
93
- "@genesislcap/foundation-broadcast-channel": "14.499.0",
94
- "@genesislcap/foundation-logger": "14.499.0",
95
- "@genesislcap/foundation-user": "14.499.0",
96
- "@genesislcap/foundation-utils": "14.499.0",
97
- "@genesislcap/web-core": "14.499.0",
93
+ "@genesislcap/foundation-broadcast-channel": "14.500.0",
94
+ "@genesislcap/foundation-logger": "14.500.0",
95
+ "@genesislcap/foundation-user": "14.500.0",
96
+ "@genesislcap/foundation-utils": "14.500.0",
97
+ "@genesislcap/web-core": "14.500.0",
98
98
  "@microsoft/fast-element": "1.14.0",
99
99
  "@microsoft/fast-foundation": "2.50.0",
100
100
  "bowser": "^2.11.0",
@@ -112,5 +112,5 @@
112
112
  "publishConfig": {
113
113
  "access": "public"
114
114
  },
115
- "gitHead": "49903bfdc57c5c5a7dd0d711d9717908df0b7ac7"
115
+ "gitHead": "71f449cda804427acfa5d246da83d1044f2cb2c4"
116
116
  }