@adminide-stack/marketplace-module-server 12.0.4-alpha.375 → 12.0.4-alpha.378

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.
@@ -1,6 +1,6 @@
1
1
  import { ServiceBroker } from 'moleculer';
2
2
  import { CdmLogger } from '@cdm-logger/core';
3
- import { IRegistryExtensionService, IInstalledExtensionRepository, ISlugService } from 'common/server';
3
+ import { IRegistryExtensionService, IInstalledExtensionRepository, ISlugService, IRedisCacheManager } from 'common/server';
4
4
  import { InstalledExtensionService } from './installed-extension-service';
5
5
  /**
6
6
  * Extended InstalledExtensionService that handles Moleculer event broadcasting
@@ -8,7 +8,9 @@ import { InstalledExtensionService } from './installed-extension-service';
8
8
  */
9
9
  export declare class InstalledExtensionServiceExt extends InstalledExtensionService {
10
10
  protected slugService: ISlugService;
11
- constructor(repository: IInstalledExtensionRepository, registryService: IRegistryExtensionService, slugService: ISlugService, broker: ServiceBroker, logger: CdmLogger.ILogger);
11
+ protected readonly redisCacheManager: IRedisCacheManager;
12
+ constructor(repository: IInstalledExtensionRepository, registryService: IRegistryExtensionService, slugService: ISlugService, redisCacheManager: IRedisCacheManager, broker: ServiceBroker, logger: CdmLogger.ILogger);
12
13
  private setupEventListeners;
14
+ private dropCache;
13
15
  }
14
16
  //# sourceMappingURL=installed-extension-service-ext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installed-extension-service-ext.d.ts","sourceRoot":"","sources":["../../src/services/installed-extension-service-ext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAgBH,yBAAyB,EACzB,6BAA6B,EAO7B,YAAY,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AA0D1E;;;GAGG;AACH,qBACa,4BAA6B,SAAQ,yBAAyB;IAKnE,SAAS,CAAC,WAAW,EAAE,YAAY;gBAHiB,UAAU,EAAE,6BAA6B,EAC7C,eAAe,EAAE,yBAAyB,EAEhF,WAAW,EAAE,YAAY,EACE,MAAM,EAAE,aAAa,EAC/B,MAAM,EAAE,SAAS,CAAC,OAAO;IAMxD,OAAO,CAAC,mBAAmB;CAie9B"}
1
+ {"version":3,"file":"installed-extension-service-ext.d.ts","sourceRoot":"","sources":["../../src/services/installed-extension-service-ext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAgBH,yBAAyB,EACzB,6BAA6B,EAO7B,YAAY,EACZ,kBAAkB,EACrB,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AA0D1E;;;GAGG;AACH,qBACa,4BAA6B,SAAQ,yBAAyB;IAKnE,SAAS,CAAC,WAAW,EAAE,YAAY;IAEnC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,kBAAkB;gBALJ,UAAU,EAAE,6BAA6B,EAC7C,eAAe,EAAE,yBAAyB,EAEhF,WAAW,EAAE,YAAY,EAEhB,iBAAiB,EAAE,kBAAkB,EACnB,MAAM,EAAE,aAAa,EAC/B,MAAM,EAAE,SAAS,CAAC,OAAO;IAMxD,OAAO,CAAC,mBAAmB;YAoeb,SAAS;CAsD1B"}
@@ -1,4 +1,4 @@
1
- import {__decorate,__param,__metadata}from'tslib';import {injectable,inject}from'inversify';import {ServiceBroker}from'moleculer';import {CommonType}from'@common-stack/core';import'@cdm-logger/core';import {SERVER_TYPES,ContributionFragmentName,ConfigurationSchemaId,SystemContributionExtensionNames,ExtensionServiceAction,MoleculerServiceName}from'common/server';import {InstalledExtensionService}from'./installed-extension-service.js';/**
1
+ import {__decorate,__param,__metadata}from'tslib';import {injectable,inject}from'inversify';import {ServiceBroker}from'moleculer';import {CommonType}from'@common-stack/core';import'@cdm-logger/core';import {SERVER_TYPES,ContributionFragmentName,ConfigurationSchemaId,SystemContributionExtensionNames,ExtensionServiceAction,MoleculerServiceName}from'common/server';import {GetCurrentPagePermissionsDocument,GetAllIntegrationConfigurationsDocument,GetContributionRolesDocument,GetPageSettingsDocument}from'common/graphql';import {DEFAULT_CONTRIBUTION_TENANT_ID}from'@adminide-stack/core';import {InstalledExtensionService}from'./installed-extension-service.js';/**
2
2
  * Convert scope string values from package.json to ConfigurationScope enum numbers
3
3
  * Maps: "application" -> 1, "machine" -> 2, "window" -> 3, "resource" -> 4
4
4
  */
@@ -51,9 +51,11 @@ function processConfigurationProperties(properties) {
51
51
  */
52
52
  let InstalledExtensionServiceExt = class InstalledExtensionServiceExt extends InstalledExtensionService {
53
53
  slugService;
54
- constructor(repository, registryService, slugService, broker, logger) {
54
+ redisCacheManager;
55
+ constructor(repository, registryService, slugService, redisCacheManager, broker, logger) {
55
56
  super(repository, registryService, slugService, broker, logger);
56
57
  this.slugService = slugService;
58
+ this.redisCacheManager = redisCacheManager;
57
59
  this.setupEventListeners();
58
60
  }
59
61
  setupEventListeners() {
@@ -253,6 +255,7 @@ let InstalledExtensionServiceExt = class InstalledExtensionServiceExt extends In
253
255
  } else {
254
256
  console.log('\nℹ️ STEP 2: Skipping extension configuration (no contributions found)');
255
257
  }
258
+ await this.dropCache();
256
259
  console.log('\n=== EXTENSION INSTALLATION COMPLETED ===');
257
260
  console.log('System Extension Registered:', systemExtensionRegistered ? '✅' : '❌');
258
261
  console.log('Extension Config Created:', extensionConfigCreated ? '✅' : 'ℹ️ Not needed');
@@ -349,6 +352,7 @@ let InstalledExtensionServiceExt = class InstalledExtensionServiceExt extends In
349
352
  }
350
353
  // Uninstallation is successful if system extension is updated
351
354
  uninstallationSuccessful = systemExtensionUpdated;
355
+ await this.dropCache();
352
356
  console.log('\n=== EXTENSION UNINSTALLATION COMPLETED ===');
353
357
  console.log('Extension Config Removed:', extensionConfigRemoved ? '✅' : 'ℹ️ Not found');
354
358
  console.log('System Extension Updated:', systemExtensionUpdated ? '✅' : '❌');
@@ -445,5 +449,59 @@ let InstalledExtensionServiceExt = class InstalledExtensionServiceExt extends In
445
449
  ]);
446
450
  });
447
451
  }
452
+ async dropCache() {
453
+ const cacheContext = {
454
+ tenantId: DEFAULT_CONTRIBUTION_TENANT_ID
455
+ };
456
+ const cachesToClear = [{
457
+ name: 'Current Page Permissions',
458
+ document: GetCurrentPagePermissionsDocument
459
+ }, {
460
+ name: 'All Integration Configurations',
461
+ document: GetAllIntegrationConfigurationsDocument
462
+ }, {
463
+ name: 'Get Contribution Roles',
464
+ document: GetContributionRolesDocument
465
+ }, {
466
+ name: 'GetPageSettings',
467
+ document: GetPageSettingsDocument
468
+ }];
469
+ console.log('Start dropping queries cache');
470
+ const results = await Promise.allSettled(cachesToClear.map(async cache => {
471
+ try {
472
+ await this.redisCacheManager.del(cache.document, null, cacheContext, true);
473
+ console.log('Dropped %s', cache.name);
474
+ return {
475
+ name: cache.name,
476
+ success: true
477
+ };
478
+ } catch (error) {
479
+ return {
480
+ name: cache.name,
481
+ success: false,
482
+ error
483
+ };
484
+ }
485
+ }));
486
+ const failures = results.filter(result => result.status === 'fulfilled' && !result.value.success);
487
+ if (failures.length > 0) {
488
+ console.log('Failed to drop some caches');
489
+ failures.forEach(failure => {
490
+ const {
491
+ error,
492
+ name
493
+ } = failure.value;
494
+ if (error instanceof Error) {
495
+ console.log(error, 'Failed to drop %s', name);
496
+ } else {
497
+ console.log({
498
+ error
499
+ }, 'Failed to drop %s', name);
500
+ }
501
+ });
502
+ } else {
503
+ console.log('Successfully dropped all query caches');
504
+ }
505
+ }
448
506
  };
449
- InstalledExtensionServiceExt = __decorate([injectable(), __param(0, inject(SERVER_TYPES.IInstalledExtensionRepository)), __param(1, inject(SERVER_TYPES.IRegistryExtensionService)), __param(2, inject(SERVER_TYPES.SlugService)), __param(3, inject(CommonType.MOLECULER_BROKER)), __param(4, inject(CommonType.LOGGER)), __metadata("design:paramtypes", [Object, Object, Object, ServiceBroker, Object])], InstalledExtensionServiceExt);export{InstalledExtensionServiceExt};//# sourceMappingURL=installed-extension-service-ext.js.map
507
+ InstalledExtensionServiceExt = __decorate([injectable(), __param(0, inject(SERVER_TYPES.IInstalledExtensionRepository)), __param(1, inject(SERVER_TYPES.IRegistryExtensionService)), __param(2, inject(SERVER_TYPES.SlugService)), __param(3, inject(SERVER_TYPES.IRedisCacheManager)), __param(4, inject(CommonType.MOLECULER_BROKER)), __param(5, inject(CommonType.LOGGER)), __metadata("design:paramtypes", [Object, Object, Object, Object, ServiceBroker, Object])], InstalledExtensionServiceExt);export{InstalledExtensionServiceExt};//# sourceMappingURL=installed-extension-service-ext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"installed-extension-service-ext.js","sources":["../../src/services/installed-extension-service-ext.ts"],"sourcesContent":[null],"names":[],"mappings":"qbA2FG;AACH;;AAG4D;AAWxD,SAAA,0BAA2B,CAAA,KAAA,EAAA;AAie9B,EAAA,IAAA,OAAA,KAAA,KAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"installed-extension-service-ext.js","sources":["../../src/services/installed-extension-service-ext.ts"],"sourcesContent":[null],"names":[],"mappings":";AA4GQ;;AAQJ;mCAoeuB,CAAA,KAAA,EAAA;AAsD1B,EAAA,IAAA,OAAA,KAAA,KAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminide-stack/marketplace-module-server",
3
- "version": "12.0.4-alpha.375",
3
+ "version": "12.0.4-alpha.378",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "UNLICENSED",
6
6
  "author": "CDMBase LLC",
@@ -21,11 +21,11 @@
21
21
  "watch": "yarn build:lib:watch"
22
22
  },
23
23
  "dependencies": {
24
- "@adminide-stack/extension-api": "12.0.4-alpha.375",
24
+ "@adminide-stack/extension-api": "12.0.4-alpha.378",
25
25
  "nanoid": "^5.1.5"
26
26
  },
27
27
  "devDependencies": {
28
- "common": "12.0.4-alpha.375"
28
+ "common": "12.0.4-alpha.378"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "graphql-tag": ">=2.0.0"
@@ -57,5 +57,5 @@
57
57
  "typescript": {
58
58
  "definition": "lib/index.d.ts"
59
59
  },
60
- "gitHead": "e0663f453877f0e6bebceb7299162c0007de7fba"
60
+ "gitHead": "2d5c934551731086b17785a74a15979c4c5edf61"
61
61
  }