@cadenza.io/service 2.17.34 → 2.17.36
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/browser/index.js +5 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +5 -3
- package/dist/browser/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -22926,6 +22926,7 @@ declare class RestController {
|
|
|
22926
22926
|
private resolveTransportDiagnosticsOptions;
|
|
22927
22927
|
private ensureFetchClientDiagnostics;
|
|
22928
22928
|
private getErrorMessage;
|
|
22929
|
+
private resolveDelegationTimeoutMs;
|
|
22929
22930
|
private recordFetchClientError;
|
|
22930
22931
|
private collectFetchTransportDiagnostics;
|
|
22931
22932
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -22926,6 +22926,7 @@ declare class RestController {
|
|
|
22926
22926
|
private resolveTransportDiagnosticsOptions;
|
|
22927
22927
|
private ensureFetchClientDiagnostics;
|
|
22928
22928
|
private getErrorMessage;
|
|
22929
|
+
private resolveDelegationTimeoutMs;
|
|
22929
22930
|
private recordFetchClientError;
|
|
22930
22931
|
private collectFetchTransportDiagnostics;
|
|
22931
22932
|
/**
|
package/dist/index.js
CHANGED
|
@@ -4006,7 +4006,7 @@ var RestController = class _RestController {
|
|
|
4006
4006
|
service_instance_id: ctx.__serviceInstanceId,
|
|
4007
4007
|
role: "internal",
|
|
4008
4008
|
origin: internalOrigin,
|
|
4009
|
-
protocols: ["rest", "socket"],
|
|
4009
|
+
protocols: ctx.__useSocket ? ["rest", "socket"] : ["rest"],
|
|
4010
4010
|
...ctx.__securityProfile ? { security_profile: ctx.__securityProfile } : {}
|
|
4011
4011
|
});
|
|
4012
4012
|
}
|
|
@@ -4186,7 +4186,7 @@ var RestController = class _RestController {
|
|
|
4186
4186
|
method: "POST",
|
|
4187
4187
|
body: JSON.stringify(delegateCtx)
|
|
4188
4188
|
},
|
|
4189
|
-
|
|
4189
|
+
this.resolveDelegationTimeoutMs(delegateCtx)
|
|
4190
4190
|
);
|
|
4191
4191
|
if (resultContext?.errored || resultContext?.failed) {
|
|
4192
4192
|
fetchDiagnostics.delegationFailures++;
|
|
@@ -4440,6 +4440,12 @@ var RestController = class _RestController {
|
|
|
4440
4440
|
return String(error);
|
|
4441
4441
|
}
|
|
4442
4442
|
}
|
|
4443
|
+
resolveDelegationTimeoutMs(ctx) {
|
|
4444
|
+
const syncing = ctx?.__syncing === true || ctx?.__metadata?.__syncing === true || Array.isArray(ctx?.joinedContexts) && ctx.joinedContexts.some(
|
|
4445
|
+
(joinedCtx) => joinedCtx?.__syncing === true || joinedCtx?.__metadata?.__syncing === true
|
|
4446
|
+
);
|
|
4447
|
+
return syncing ? 12e4 : 3e4;
|
|
4448
|
+
}
|
|
4443
4449
|
recordFetchClientError(fetchId, serviceName, url, error) {
|
|
4444
4450
|
const state = this.ensureFetchClientDiagnostics(fetchId, serviceName, url);
|
|
4445
4451
|
const message = this.getErrorMessage(error);
|
|
@@ -10112,11 +10118,12 @@ var CadenzaService = class {
|
|
|
10112
10118
|
import_core5.default.interval("meta.sync_requested", { __syncing: false }, 18e4);
|
|
10113
10119
|
import_core5.default.schedule("meta.sync_requested", { __syncing: false }, 250);
|
|
10114
10120
|
}
|
|
10115
|
-
static normalizeDeclaredTransports(transports, serviceId) {
|
|
10121
|
+
static normalizeDeclaredTransports(transports, serviceId, useSocket) {
|
|
10116
10122
|
return (transports ?? []).map((transport) => normalizeServiceTransportConfig(transport)).filter(
|
|
10117
10123
|
(transport) => !!transport
|
|
10118
10124
|
).map((transport) => ({
|
|
10119
10125
|
...transport,
|
|
10126
|
+
protocols: transport.protocols && transport.protocols.length > 0 ? transport.protocols : useSocket ? ["rest", "socket"] : ["rest"],
|
|
10120
10127
|
uuid: (0, import_uuid7.v4)()
|
|
10121
10128
|
}));
|
|
10122
10129
|
}
|
|
@@ -10901,7 +10908,8 @@ var CadenzaService = class {
|
|
|
10901
10908
|
const isFrontend = !!options.isFrontend;
|
|
10902
10909
|
const declaredTransports = this.normalizeDeclaredTransports(
|
|
10903
10910
|
options.transports,
|
|
10904
|
-
serviceId
|
|
10911
|
+
serviceId,
|
|
10912
|
+
!!options.useSocket
|
|
10905
10913
|
);
|
|
10906
10914
|
this.serviceRegistry.isFrontend = isFrontend;
|
|
10907
10915
|
this.serviceRegistry.useSocket = !!options.useSocket;
|
|
@@ -10948,7 +10956,7 @@ var CadenzaService = class {
|
|
|
10948
10956
|
const relatedTransport = normalizeServiceTransportConfig({
|
|
10949
10957
|
role: isFrontend ? "public" : "internal",
|
|
10950
10958
|
origin: service[2].includes("://") ? service[2] : `http://${service[2]}`,
|
|
10951
|
-
protocols: ["rest", "socket"]
|
|
10959
|
+
protocols: options.useSocket ? ["rest", "socket"] : ["rest"]
|
|
10952
10960
|
});
|
|
10953
10961
|
this.emit("meta.initializing_service", {
|
|
10954
10962
|
serviceInstance: {
|