@kumori/aurora-backend-handler 1.0.50 → 1.0.51

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.
@@ -208,63 +208,52 @@ export const restartService = async (data: Service, security: string) => {
208
208
  }
209
209
  };
210
210
  const generateLinkBody = (data: Service, link: Link) => {
211
- console.log("[Backend Handler] generateLinkBody - Link:", link);
212
- console.log("[Backend Handler] generateLinkBody - Service:", data);
211
+ const isOrigin = data.name === link.origin;
212
+ const isTarget = data.name === link.target;
213
+
214
+ const originInClient = isOrigin
215
+ ? data.clientChannels.find(
216
+ (channel) =>
217
+ channel.name === link.originChannel ||
218
+ channel.from === link.originChannel,
219
+ )
220
+ : undefined;
221
+ const originInServer = isOrigin
222
+ ? data.serverChannels.find(
223
+ (channel) =>
224
+ channel.name === link.originChannel ||
225
+ channel.from === link.originChannel,
226
+ )
227
+ : undefined;
228
+ const originInDuplex = isOrigin
229
+ ? data.duplexChannels.find(
230
+ (channel) =>
231
+ channel.name === link.originChannel ||
232
+ channel.from === link.originChannel,
233
+ )
234
+ : undefined;
235
+ const targetInClient = isTarget
236
+ ? data.clientChannels.find(
237
+ (channel) =>
238
+ channel.name === link.targetChannel ||
239
+ channel.from === link.targetChannel,
240
+ )
241
+ : undefined;
242
+ const targetInServer = isTarget
243
+ ? data.serverChannels.find(
244
+ (channel) =>
245
+ channel.name === link.targetChannel ||
246
+ channel.from === link.targetChannel,
247
+ )
248
+ : undefined;
249
+ const targetInDuplex = isTarget
250
+ ? data.duplexChannels.find(
251
+ (channel) =>
252
+ channel.name === link.targetChannel ||
253
+ channel.from === link.targetChannel,
254
+ )
255
+ : undefined;
213
256
 
214
- const originInClient = data.clientChannels.find(
215
- (channel) =>
216
- channel.name === link.originChannel ||
217
- channel.from === link.originChannel,
218
- );
219
- const originInServer = data.serverChannels.find(
220
- (channel) =>
221
- channel.name === link.originChannel ||
222
- channel.from === link.originChannel,
223
- );
224
- const originInDuplex = data.duplexChannels.find(
225
- (channel) =>
226
- channel.name === link.originChannel ||
227
- channel.from === link.originChannel,
228
- );
229
- const targetInClient = data.clientChannels.find(
230
- (channel) =>
231
- channel.name === link.targetChannel ||
232
- channel.from === link.targetChannel,
233
- );
234
- const targetInServer = data.serverChannels.find(
235
- (channel) =>
236
- channel.name === link.targetChannel ||
237
- channel.from === link.targetChannel,
238
- );
239
- const targetInDuplex = data.duplexChannels.find(
240
- (channel) =>
241
- channel.name === link.targetChannel ||
242
- channel.from === link.targetChannel,
243
- );
244
- console.log(
245
- "[Backend Handler] generateLinkBody - Origin in client:",
246
- originInClient,
247
- );
248
- console.log(
249
- "[Backend Handler] generateLinkBody - Origin in server:",
250
- originInServer,
251
- );
252
- console.log(
253
- "[Backend Handler] generateLinkBody - Origin in duplex:",
254
- originInDuplex,
255
- );
256
- console.log(
257
- "[Backend Handler] generateLinkBody - Target in client:",
258
- targetInClient,
259
- );
260
- console.log(
261
- "[Backend Handler] generateLinkBody - Target in server:",
262
- targetInServer,
263
- );
264
- console.log(
265
- "[Backend Handler] generateLinkBody - Target in duplex:",
266
- targetInDuplex,
267
- );
268
257
  let linkBody;
269
258
  if (originInClient) {
270
259
  linkBody = {
@@ -334,7 +323,6 @@ const generateLinkBody = (data: Service, link: Link) => {
334
323
  };
335
324
  }
336
325
 
337
- console.log("[Backend Handler] generateLinkBody - Link body:", linkBody);
338
326
  return linkBody;
339
327
  };
340
328
  export const linkPendingServices = async (service: Service, token: string) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-backend-handler",
3
- "version": "1.0.50",
3
+ "version": "1.0.51",
4
4
  "description": "backend handler",
5
5
  "main": "backend-handler.ts",
6
6
  "scripts": {