@twin.org/dataspace-control-plane-service 0.9.1-next.6 → 0.9.1-next.8

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.
@@ -192,7 +192,7 @@ export class DataspaceControlPlaneService {
192
192
  this._trustComponent = ComponentFactory.get(options?.trustComponentType ?? "trust");
193
193
  this._overrideTrustGeneratorType = options?.config?.overrideTrustGeneratorType;
194
194
  this._dataPlanePath = Is.stringValue(options?.config?.dataPlanePath)
195
- ? StringHelper.trimTrailingSlashes(StringHelper.trimLeadingSlashes(options.config.dataPlanePath))
195
+ ? StringHelper.trimLeadingAndTrailingSlashes(options.config.dataPlanePath)
196
196
  : undefined;
197
197
  this._callbackPath = Is.stringValue(options?.config?.callbackPath)
198
198
  ? StringHelper.trimLeadingAndTrailingSlashes(options.config.callbackPath)
@@ -281,72 +281,6 @@ export class DataspaceControlPlaneService {
281
281
  });
282
282
  return;
283
283
  }
284
- await this._loggingComponent?.log({
285
- level: "info",
286
- ts: Date.now(),
287
- source: DataspaceControlPlaneService.CLASS_NAME,
288
- message: "populatingFederatedCatalogue"
289
- });
290
- let registeredCount = 0;
291
- let errorCount = 0;
292
- let totalDatasets = 0;
293
- // The platform component execute is used so that the dataset publication runs in the
294
- // tenant context, also works in single tenant mode
295
- await this._platformComponent.execute(async () => {
296
- // The tenant context id is set here for each system tenant
297
- let cursor;
298
- do {
299
- const page = await this._dataspaceAppDatasetStorage.query(undefined, undefined, undefined, cursor);
300
- if (Is.arrayValue(page.entities)) {
301
- for (const entity of page.entities) {
302
- const appDataset = entity;
303
- totalDatasets++;
304
- try {
305
- await this.publishAppDataset(appDataset);
306
- registeredCount++;
307
- await this._loggingComponent?.log({
308
- level: "debug",
309
- ts: Date.now(),
310
- source: DataspaceControlPlaneService.CLASS_NAME,
311
- message: "datasetRegistered",
312
- data: {
313
- datasetId: appDataset.id,
314
- appId: appDataset.appId,
315
- tenantId: appDataset.tenantId
316
- }
317
- });
318
- }
319
- catch (error) {
320
- errorCount++;
321
- await this._loggingComponent?.log({
322
- level: "error",
323
- ts: Date.now(),
324
- source: DataspaceControlPlaneService.CLASS_NAME,
325
- message: "datasetPublishFailed",
326
- error: BaseError.fromError(error),
327
- data: {
328
- datasetId: appDataset.id,
329
- appId: appDataset.appId,
330
- tenantId: appDataset.tenantId
331
- }
332
- });
333
- }
334
- }
335
- }
336
- cursor = page.cursor;
337
- } while (Is.stringValue(cursor));
338
- });
339
- await this._loggingComponent?.log({
340
- level: "info",
341
- ts: Date.now(),
342
- source: DataspaceControlPlaneService.CLASS_NAME,
343
- message: "federatedCataloguePopulated",
344
- data: {
345
- registeredCount,
346
- errorCount,
347
- totalDatasets
348
- }
349
- });
350
284
  if (this._taskScheduler) {
351
285
  await this._taskScheduler.addTask("control-plane-negotiation-cleanup", [
352
286
  {
@@ -560,12 +494,7 @@ export class DataspaceControlPlaneService {
560
494
  // Callback the provider POSTs DSP messages back to: mount path + `?organization=` so the inbound
561
495
  // POST routes to the right consumer tenant (mirrors buildCallbackUrl). The bare `origin` is kept for
562
496
  // the PUSH-inbox base below (a different mount).
563
- let callbackAddress = Is.stringValue(this._callbackPath)
564
- ? `${origin}/${this._callbackPath}`
565
- : origin;
566
- if (Is.stringValue(organizationIdentity)) {
567
- callbackAddress = HttpUrlHelper.addQueryStringParam(callbackAddress, ContextIdKeys.Organization, organizationIdentity);
568
- }
497
+ const callbackAddress = HttpUrlHelper.addQueryStringParam(Is.stringValue(this._callbackPath) ? `${origin}/${this._callbackPath}` : origin, ContextIdKeys.Organization, organizationIdentity);
569
498
  const transferRequestMessage = {
570
499
  "@context": [DataspaceProtocolContexts.Context],
571
500
  "@type": DataspaceProtocolTransferProcessTypes.TransferRequestMessage,