@adminide-stack/marketplace-module-server 12.0.4-alpha.91 → 12.0.4-alpha.95
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/Readme.md +321 -0
- package/lib/constants/extension-events.d.ts +136 -0
- package/lib/constants/extension-events.d.ts.map +1 -0
- package/lib/containers/module.d.ts +8 -0
- package/lib/containers/module.d.ts.map +1 -1
- package/lib/containers/module.js +9 -3
- package/lib/containers/module.js.map +1 -1
- package/lib/dataloaders/index.d.ts +2 -0
- package/lib/dataloaders/index.d.ts.map +1 -0
- package/lib/dataloaders/registry-extension-data-loader.d.ts +6 -0
- package/lib/dataloaders/registry-extension-data-loader.d.ts.map +1 -0
- package/lib/dataloaders/registry-extension-data-loader.js +6 -0
- package/lib/dataloaders/registry-extension-data-loader.js.map +1 -0
- package/lib/graphql/resolvers/index.d.ts +1 -1
- package/lib/graphql/resolvers/index.d.ts.map +1 -1
- package/lib/graphql/resolvers/index.js +1 -0
- package/lib/graphql/resolvers/index.js.map +1 -0
- package/lib/graphql/resolvers/installed-extension-resolver.d.ts +5 -0
- package/lib/graphql/resolvers/installed-extension-resolver.d.ts.map +1 -0
- package/lib/graphql/resolvers/installed-extension-resolver.js +183 -0
- package/lib/graphql/resolvers/installed-extension-resolver.js.map +1 -0
- package/lib/graphql/resolvers/registry-extension-resolver.d.ts +5 -0
- package/lib/graphql/resolvers/registry-extension-resolver.d.ts.map +1 -0
- package/lib/graphql/resolvers/{resolvers.js → registry-extension-resolver.js} +59 -47
- package/lib/graphql/resolvers/registry-extension-resolver.js.map +1 -0
- package/lib/graphql/schemas/extension-registry.graphql +74 -0
- package/lib/graphql/schemas/extension-registry.graphql.js +1 -0
- package/lib/graphql/schemas/extension-registry.graphql.js.map +1 -0
- package/lib/graphql/schemas/index.d.ts.map +1 -1
- package/lib/graphql/schemas/index.js +1 -4
- package/lib/graphql/schemas/index.js.map +1 -1
- package/lib/graphql/schemas/installed-extension.graphql +294 -0
- package/lib/graphql/schemas/installed-extension.graphql.js +1 -0
- package/lib/graphql/schemas/installed-extension.graphql.js.map +1 -0
- package/lib/graphql/schemas/service.graphql +181 -0
- package/lib/graphql/schemas/service.graphql.js +1 -0
- package/lib/graphql/schemas/service.graphql.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/module.d.ts.map +1 -1
- package/lib/module.js +6 -4
- package/lib/module.js.map +1 -1
- package/lib/plugins/extension-moleculer-service.d.ts +86 -0
- package/lib/plugins/extension-moleculer-service.d.ts.map +1 -0
- package/lib/plugins/index.d.ts +2 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/services/extension-service.d.ts +35 -47
- package/lib/services/extension-service.d.ts.map +1 -1
- package/lib/services/extension-service.js +33 -15
- package/lib/services/extension-service.js.map +1 -1
- package/lib/services/index.d.ts +2 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/installed-extension-service-ext.d.ts +13 -0
- package/lib/services/installed-extension-service-ext.d.ts.map +1 -0
- package/lib/services/installed-extension-service-ext.js +271 -0
- package/lib/services/installed-extension-service-ext.js.map +1 -0
- package/lib/services/installed-extension-service.d.ts +93 -0
- package/lib/services/installed-extension-service.d.ts.map +1 -0
- package/lib/services/installed-extension-service.js +400 -0
- package/lib/services/installed-extension-service.js.map +1 -0
- package/lib/services/installed-extension-service.test.d.ts +2 -0
- package/lib/services/installed-extension-service.test.d.ts.map +1 -0
- package/lib/store/index.d.ts +1 -1
- package/lib/store/index.d.ts.map +1 -1
- package/lib/store/models/index.d.ts +1 -0
- package/lib/store/models/index.d.ts.map +1 -1
- package/lib/store/models/installed-extension-model.d.ts +4 -0
- package/lib/store/models/installed-extension-model.d.ts.map +1 -0
- package/lib/store/models/installed-extension-model.js +297 -0
- package/lib/store/models/installed-extension-model.js.map +1 -0
- package/lib/store/models/registry-extension-model.d.ts +2 -7
- package/lib/store/models/registry-extension-model.d.ts.map +1 -1
- package/lib/store/models/registry-extension-model.js +40 -19
- package/lib/store/models/registry-extension-model.js.map +1 -1
- package/lib/store/repositories/index.d.ts +3 -0
- package/lib/store/repositories/index.d.ts.map +1 -0
- package/lib/store/repositories/installed-extension-repository.d.ts +71 -0
- package/lib/store/repositories/installed-extension-repository.d.ts.map +1 -0
- package/lib/store/repositories/installed-extension-repository.js +414 -0
- package/lib/store/repositories/installed-extension-repository.js.map +1 -0
- package/lib/store/repositories/registry-extension-repository.d.ts +54 -0
- package/lib/store/repositories/registry-extension-repository.d.ts.map +1 -0
- package/lib/store/{repository → repositories}/registry-extension-repository.js +44 -42
- package/lib/store/repositories/registry-extension-repository.js.map +1 -0
- package/lib/templates/constants/DB_COLL_NAMES.ts.template +5 -0
- package/lib/templates/constants/SERVER_TYPES.ts.template +3 -0
- package/lib/templates/repositories/InstalledExtensionRepository.ts.template +94 -0
- package/lib/templates/repositories/RegistryExtensionRepository.ts.template +10 -15
- package/lib/templates/services/InstalledExtensionDataLoader.ts.template +2 -0
- package/lib/templates/services/InstalledExtensionService.ts.template +168 -0
- package/lib/templates/services/RegistryExtensionDataLoader.ts.template +2 -0
- package/lib/templates/services/RegistryExtensionService.ts.template +10 -10
- package/lib/tests/extension-integration.test.d.ts +2 -0
- package/lib/tests/extension-integration.test.d.ts.map +1 -0
- package/lib/tests/test-extension-services.d.ts +1 -0
- package/lib/tests/test-extension-services.d.ts.map +1 -0
- package/package.json +12 -7
- package/lib/graphql/resolvers/resolvers.d.ts +0 -2
- package/lib/graphql/resolvers/resolvers.d.ts.map +0 -1
- package/lib/graphql/resolvers/resolvers.js.map +0 -1
- package/lib/graphql/schemas/extension.graphql +0 -57
- package/lib/graphql/schemas/extension.graphql.js +0 -1
- package/lib/graphql/schemas/extension.graphql.js.map +0 -1
- package/lib/store/repository/index.d.ts +0 -2
- package/lib/store/repository/index.d.ts.map +0 -1
- package/lib/store/repository/registry-extension-repository.d.ts +0 -31
- package/lib/store/repository/registry-extension-repository.d.ts.map +0 -1
- package/lib/store/repository/registry-extension-repository.js.map +0 -1
|
@@ -1,54 +1,42 @@
|
|
|
1
1
|
import { CdmLogger } from '@cdm-logger/core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { BaseService2 } from '@common-stack/store-mongo';
|
|
3
|
+
import { Disposable, DisposableCollection, Emitter } from '@adminide-stack/core';
|
|
4
|
+
import { IRegistryExtensionService, IRegistryExtensionRepository, IRegistryExtensionModel } from 'common/server';
|
|
5
|
+
export declare class RegistryExtensionService extends BaseService2<IRegistryExtensionModel> implements IRegistryExtensionService, Disposable {
|
|
4
6
|
private extensionRepository;
|
|
7
|
+
protected readonly onExtensionCreated: Emitter<{
|
|
8
|
+
extensionSlug: string;
|
|
9
|
+
publisherId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
}>;
|
|
13
|
+
protected readonly onExtensionUpdated: Emitter<{
|
|
14
|
+
extensionSlug: string;
|
|
15
|
+
changes: Record<string, unknown>;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}>;
|
|
18
|
+
protected readonly onExtensionDeleted: Emitter<{
|
|
19
|
+
extensionSlug: string;
|
|
20
|
+
deletedAt: string;
|
|
21
|
+
}>;
|
|
22
|
+
protected readonly onExtensionPublished: Emitter<{
|
|
23
|
+
extensionSlug: string;
|
|
24
|
+
version: string;
|
|
25
|
+
publishedAt: string;
|
|
26
|
+
}>;
|
|
27
|
+
protected readonly toDispose: DisposableCollection;
|
|
5
28
|
private logger;
|
|
6
29
|
constructor(extensionRepository: IRegistryExtensionRepository, logger: CdmLogger.ILogger);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
extensionIDWithoutRegistry?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
12
|
-
id: import("common").Scalars["ID"]["output"];
|
|
13
|
-
installed?: import("common").Maybe<import("common").Scalars["Boolean"]["output"]>;
|
|
14
|
-
isLocal?: import("common").Maybe<import("common").Scalars["Boolean"]["output"]>;
|
|
15
|
-
manifest?: import("common").Maybe<import("common").IExtensionManifest>;
|
|
16
|
-
name: import("common").Scalars["String"]["output"];
|
|
17
|
-
publisher?: import("common").Maybe<import("common").IRegistryPublisher>;
|
|
18
|
-
releases?: import("common").Maybe<Array<import("common").Maybe<import("common").IExtensionRelease>>>;
|
|
19
|
-
remoteURL?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
20
|
-
updatedAt?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
21
|
-
url?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
22
|
-
uuid: import("common").Scalars["String"]["output"];
|
|
23
|
-
version?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
24
|
-
viewerCanAdminister?: import("common").Maybe<import("common").Scalars["Boolean"]["output"]>;
|
|
25
|
-
} & import("common/server").IRepositoryDefault>;
|
|
26
|
-
updateExtensionName(extensionID: string, name: string): Promise<any>;
|
|
27
|
-
updateExtension(extensionID: string, update: {
|
|
30
|
+
dispose(): void;
|
|
31
|
+
createExtension(publisherId: string, name: string): Promise<import("common/server").AsDomainType<IRegistryExtensionModel>>;
|
|
32
|
+
updateExtensionName(extensionSlug: string, name: string): Promise<import("common/server").AsDomainType<IRegistryExtensionModel>>;
|
|
33
|
+
updateExtension(extensionSlug: string, update: {
|
|
28
34
|
installed?: boolean;
|
|
29
|
-
}): Promise<import("common").
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
installed?: import("common").Maybe<import("common").Scalars["Boolean"]["output"]>;
|
|
36
|
-
isLocal?: import("common").Maybe<import("common").Scalars["Boolean"]["output"]>;
|
|
37
|
-
manifest?: import("common").Maybe<import("common").IExtensionManifest>;
|
|
38
|
-
name: import("common").Scalars["String"]["output"];
|
|
39
|
-
publisher?: import("common").Maybe<import("common").IRegistryPublisher>;
|
|
40
|
-
releases?: import("common").Maybe<Array<import("common").Maybe<import("common").IExtensionRelease>>>;
|
|
41
|
-
remoteURL?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
42
|
-
updatedAt?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
43
|
-
url?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
44
|
-
uuid: import("common").Scalars["String"]["output"];
|
|
45
|
-
version?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
46
|
-
viewerCanAdminister?: import("common").Maybe<import("common").Scalars["Boolean"]["output"]>;
|
|
47
|
-
} & import("common/server").IRepositoryDefault>;
|
|
48
|
-
extensionReleases(extensionID: string): Promise<import("common").IExtensionRelease[]>;
|
|
49
|
-
deleteExtension(extensionID: string): Promise<boolean>;
|
|
50
|
-
publishExtension(request: any): Promise<any>;
|
|
51
|
-
findExtensions(first: number, query: string, local?: boolean, remote?: boolean, prioritizeExtensionIDs?: string[]): Promise<any>;
|
|
52
|
-
findExtension(extensionID: string): Promise<any>;
|
|
35
|
+
}): Promise<import("common/server").AsDomainType<IRegistryExtensionModel>>;
|
|
36
|
+
extensionReleases(extensionSlug: string): Promise<import("common/server").AsDomainType<import("common").IExtensionReleaseModel>[]>;
|
|
37
|
+
deleteExtension(extensionSlug: string): Promise<boolean>;
|
|
38
|
+
publishExtension(request: any): Promise<import("common/server").AsDomainType<IRegistryExtensionModel>>;
|
|
39
|
+
findExtensions(first: number, query: string, local?: boolean, remote?: boolean, prioritizeExtensionIDs?: string[]): Promise<import("common/server").AsDomainType<IRegistryExtensionModel>[]>;
|
|
40
|
+
findExtension(extensionSlug: string): Promise<import("common/server").AsDomainType<IRegistryExtensionModel>>;
|
|
53
41
|
}
|
|
54
42
|
//# sourceMappingURL=extension-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-service.d.ts","sourceRoot":"","sources":["../../src/services/extension-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,C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qBtE,iBAAiB,CAAC,aAAa,EAAE,MAAM;IAKvC,eAAe,CAAC,aAAa,EAAE,MAAM;IAIrC,gBAAgB,CAAC,OAAO,KAAA;IAIxB,cAAc,CACvB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,OAAO,EACf,MAAM,CAAC,EAAE,OAAO,EAChB,sBAAsB,CAAC,EAAE,MAAM,EAAE;IAKxB,aAAa,CAAC,aAAa,EAAE,MAAM;CAGnD"}
|
|
@@ -1,33 +1,51 @@
|
|
|
1
|
-
import {__decorate,__param,__metadata}from'tslib';import {injectable,inject}from'inversify';import'@cdm-logger/core';import {SERVER_TYPES}from'common/server';var RegistryExtensionService_1;
|
|
2
|
-
let RegistryExtensionService = RegistryExtensionService_1 = class RegistryExtensionService {
|
|
1
|
+
import {__decorate,__param,__metadata}from'tslib';import {injectable,inject}from'inversify';import'@cdm-logger/core';import {BaseService2}from'@common-stack/store-mongo';import {Emitter,DisposableCollection}from'@adminide-stack/core';import {SERVER_TYPES}from'common/server';var RegistryExtensionService_1;
|
|
2
|
+
let RegistryExtensionService = RegistryExtensionService_1 = class RegistryExtensionService extends BaseService2 {
|
|
3
3
|
extensionRepository;
|
|
4
|
+
onExtensionCreated = new Emitter();
|
|
5
|
+
onExtensionUpdated = new Emitter();
|
|
6
|
+
onExtensionDeleted = new Emitter();
|
|
7
|
+
onExtensionPublished = new Emitter();
|
|
8
|
+
toDispose = new DisposableCollection(this.onExtensionCreated, this.onExtensionUpdated, this.onExtensionDeleted, this.onExtensionPublished);
|
|
4
9
|
logger;
|
|
5
10
|
constructor(extensionRepository, logger) {
|
|
11
|
+
super(extensionRepository);
|
|
6
12
|
this.extensionRepository = extensionRepository;
|
|
7
13
|
this.logger = logger.child({
|
|
8
14
|
className: RegistryExtensionService_1.name
|
|
9
15
|
});
|
|
10
16
|
}
|
|
17
|
+
dispose() {
|
|
18
|
+
this.toDispose.dispose();
|
|
19
|
+
}
|
|
11
20
|
async createExtension(publisherId, name) {
|
|
12
21
|
return this.extensionRepository.createExtension(publisherId, name);
|
|
13
22
|
}
|
|
14
|
-
async updateExtensionName(
|
|
15
|
-
return this.extensionRepository.updateExtensionName(
|
|
23
|
+
async updateExtensionName(extensionSlug, name) {
|
|
24
|
+
return this.extensionRepository.updateExtensionName(extensionSlug, name);
|
|
16
25
|
}
|
|
17
|
-
async updateExtension(
|
|
18
|
-
const extension = await this.findExtension(
|
|
26
|
+
async updateExtension(extensionSlug, update) {
|
|
27
|
+
const extension = await this.findExtension(extensionSlug);
|
|
19
28
|
if (!extension) {
|
|
20
|
-
throw new Error(`Extension ${
|
|
29
|
+
throw new Error(`Extension ${extensionSlug} not found`);
|
|
30
|
+
}
|
|
31
|
+
const updatedExtension = await this.extensionRepository.updateExtension(extensionSlug, update);
|
|
32
|
+
// Fire events for extension lifecycle changes
|
|
33
|
+
if (updatedExtension) {
|
|
34
|
+
this.onExtensionUpdated.fire({
|
|
35
|
+
extensionSlug: updatedExtension.extensionSlug,
|
|
36
|
+
changes: update,
|
|
37
|
+
updatedAt: new Date().toISOString()
|
|
38
|
+
});
|
|
21
39
|
}
|
|
22
|
-
return
|
|
40
|
+
return updatedExtension;
|
|
23
41
|
}
|
|
24
42
|
// TODO: Add method to interface
|
|
25
|
-
async extensionReleases(
|
|
26
|
-
this.logger.debug(`Fetching releases for ${
|
|
27
|
-
return this.extensionRepository.extensionReleases(
|
|
43
|
+
async extensionReleases(extensionSlug) {
|
|
44
|
+
this.logger.debug(`Fetching releases for ${extensionSlug}`);
|
|
45
|
+
return this.extensionRepository.extensionReleases(extensionSlug);
|
|
28
46
|
}
|
|
29
|
-
async deleteExtension(
|
|
30
|
-
return this.extensionRepository.deleteExtension(
|
|
47
|
+
async deleteExtension(extensionSlug) {
|
|
48
|
+
return this.extensionRepository.deleteExtension(extensionSlug);
|
|
31
49
|
}
|
|
32
50
|
async publishExtension(request) {
|
|
33
51
|
return this.extensionRepository.publishExtension(request);
|
|
@@ -35,8 +53,8 @@ let RegistryExtensionService = RegistryExtensionService_1 = class RegistryExtens
|
|
|
35
53
|
async findExtensions(first, query, local, remote, prioritizeExtensionIDs) {
|
|
36
54
|
return this.extensionRepository.findExtensions(first, query, local, remote, prioritizeExtensionIDs);
|
|
37
55
|
}
|
|
38
|
-
async findExtension(
|
|
39
|
-
return this.extensionRepository.findExtension(
|
|
56
|
+
async findExtension(extensionSlug) {
|
|
57
|
+
return this.extensionRepository.findExtension(extensionSlug);
|
|
40
58
|
}
|
|
41
59
|
};
|
|
42
60
|
RegistryExtensionService = RegistryExtensionService_1 = __decorate([injectable(), __param(0, inject(SERVER_TYPES.IRegistryExtensionRepository)), __param(1, inject('Logger')), __metadata("design:paramtypes", [Object, Object])], RegistryExtensionService);export{RegistryExtensionService};//# sourceMappingURL=extension-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-service.js","sources":["../../src/services/extension-service.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extension-service.js","sources":["../../src/services/extension-service.ts"],"sourcesContent":[null],"names":[],"mappings":"mRACA,IAAA;4BAgB6B,GAAA,0BAAA,GAAA,MAAA,wBAAA,SAAA,YAAA,CAAA;qBACR;oBACD,GAAA,IAAA,OAAA,EAAA;oBACK,GAAA,IAAA,OAAA,EAAA;AAChB,EAAA,kBAAA,GAAA,IAAA,OAAA,EAAA;sBAEa,GAAmB,IAAA,OAAA,EAAA;sCACZ,CAAA,IAAA,CAAA,kBAAA,EAAA,IAAA,CAAA,kBAAA,EAAA,IAAA,CAAA,kBAAA,EAAA,IAAA,CAAA,oBAAA,CAAA;AACZ,EAAA,MAAA;iCACQ,EAAA,MAAA,EAAA;AAChB,IAAA,KAAA,CAAA,mBAAA,CAAA;IAEL,IAAS,CAAA,mBAA4B,GAAA,mBAAA;wBACZ,CAAA,KAAA,CAAA;2CACJ,CAAA;AAChB,KAAA,CAAA;;;kBAIc,CAAA,OAAA,EAAA;;AAEd,EAAA,MAAA,eAAA,CAAA,WAAA,EAAA,IAAA,EAAA;AAEL,IAAA,OAAA,IAAU,CAAA,mBAKR,CAAA,eAAA,CAAA,WAAA,EAAA,IAAA,CAAA;;AAMU,EAAA,MAAA,mBAAA,CAAA,aAAiD,EAAA,IAAA,EAAA;AAS7D,IAAA,OAAO,IAAI,CAAI,mBAAA,CAAA,mBAAA,CAAA,aAAA,EAAA,IAAA,CAAA;AAIF;AAIA,EAAA,MAAA,eAAmB,CAAC,aAAa,EAAE,MAAM,EAAE;AAI3C,IAAA,MAAA,SAAe,GAAc,MAAA,IAAA,CAAA,2BAAkB,CAAA;QAAE,CAAS,SAAC,EAAE;AAAS,MAAA,MAAA,IAAA,KAAA,CAAA,CAAA,UAAA,EAAA,aAAA,CAAA,UAAA,CAAA,CAAA;;IA0BtE,MAAe,gBAAc,GAAA,MAAE,IAAM,CAAA,mBAAA,CAAA,eAAA,CAAA,aAAA,EAAA,MAAA,CAAA;;IAQrC,IAAc,gBAClB,EAAE;MASe,IAAA,CAAA,kBAAc,CAAA,IAAQ,CAAA;AAGnD,QAAA,aAAA,EAAA,gBAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/services/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ServiceBroker } from 'moleculer';
|
|
2
|
+
import { CdmLogger } from '@cdm-logger/core';
|
|
3
|
+
import { IRegistryExtensionService, IInstalledExtensionRepository } from 'common/server';
|
|
4
|
+
import { InstalledExtensionService } from './installed-extension-service';
|
|
5
|
+
/**
|
|
6
|
+
* Extended InstalledExtensionService that handles Moleculer event broadcasting
|
|
7
|
+
* Follows the pattern of AccountService/AccountServiceExt
|
|
8
|
+
*/
|
|
9
|
+
export declare class InstalledExtensionServiceExt extends InstalledExtensionService {
|
|
10
|
+
constructor(repository: IInstalledExtensionRepository, registryService: IRegistryExtensionService, broker: ServiceBroker, logger: CdmLogger.ILogger);
|
|
11
|
+
private setupEventListeners;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=installed-extension-service-ext.d.ts.map
|
|
@@ -0,0 +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,EAOhC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E;;;GAGG;AACH,qBACa,4BAA6B,SAAQ,yBAAyB;gBAEf,UAAU,EAAE,6BAA6B,EAC7C,eAAe,EAAE,yBAAyB,EACrD,MAAM,EAAE,aAAa,EAC/B,MAAM,EAAE,SAAS,CAAC,OAAO;IAMxD,OAAO,CAAC,mBAAmB;CAsT9B"}
|
|
@@ -0,0 +1,271 @@
|
|
|
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,ConfigurationSchemaId,ContributionRegistryServiceEvent,MoleculerServiceName,SystemContributionExtensionNames,ExtensionServiceAction}from'common/server';import {InstalledExtensionService}from'./installed-extension-service.js';/**
|
|
2
|
+
* Extended InstalledExtensionService that handles Moleculer event broadcasting
|
|
3
|
+
* Follows the pattern of AccountService/AccountServiceExt
|
|
4
|
+
*/
|
|
5
|
+
let InstalledExtensionServiceExt = class InstalledExtensionServiceExt extends InstalledExtensionService {
|
|
6
|
+
constructor(repository, registryService, broker, logger) {
|
|
7
|
+
super(repository, registryService, broker, logger);
|
|
8
|
+
this.setupEventListeners();
|
|
9
|
+
}
|
|
10
|
+
setupEventListeners() {
|
|
11
|
+
// Listen to extension installed events
|
|
12
|
+
this.onExtensionInstalled.event(async event => {
|
|
13
|
+
console.log('_____>>>>>>> EXTENSION INSTALLLED EVENT IS GETTIN CALLED');
|
|
14
|
+
try {
|
|
15
|
+
// Get full extension data with metadata to extract contributions
|
|
16
|
+
const registryExtension = await this.registryExtensionService.findExtension(event.extensionSlug);
|
|
17
|
+
let configurationNodes = [];
|
|
18
|
+
let configurationDefaults = [];
|
|
19
|
+
if (registryExtension && registryExtension.manifest) {
|
|
20
|
+
console.log('Extension found with manifest:', event.extensionSlug);
|
|
21
|
+
console.log('Manifest object keys:', Object.keys(registryExtension.manifest));
|
|
22
|
+
// The manifest is now properly parsed by the model's virtual property
|
|
23
|
+
let contributes = null;
|
|
24
|
+
// Check if manifest has contributes directly (cast to access contributes property)
|
|
25
|
+
const manifestAny = registryExtension.manifest;
|
|
26
|
+
if (manifestAny.contributes) {
|
|
27
|
+
contributes = manifestAny.contributes;
|
|
28
|
+
console.log('Found parsed contributes:', Object.keys(contributes));
|
|
29
|
+
}
|
|
30
|
+
// Fallback: try to parse raw if contributes not found but raw exists
|
|
31
|
+
else if (registryExtension.manifest.raw) {
|
|
32
|
+
try {
|
|
33
|
+
const parsedManifest = JSON.parse(registryExtension.manifest.raw);
|
|
34
|
+
console.log('Parsed manifest keys:', Object.keys(parsedManifest));
|
|
35
|
+
contributes = parsedManifest.contributes;
|
|
36
|
+
console.log('Parsed contributes from manifest.raw:', contributes ? 'found' : 'not found');
|
|
37
|
+
if (contributes) {
|
|
38
|
+
console.log('Contributes keys:', Object.keys(contributes));
|
|
39
|
+
console.log('Configuration exists:', !!contributes.configuration);
|
|
40
|
+
if (contributes.configuration) {
|
|
41
|
+
console.log('Configuration data:', JSON.stringify(contributes.configuration, null, 2));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.warn('Failed to parse extension manifest.raw:', error);
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
console.log('No manifest.raw found');
|
|
49
|
+
}
|
|
50
|
+
// Extract configuration contributions if they exist
|
|
51
|
+
if (contributes && contributes.configuration) {
|
|
52
|
+
console.log('Configuration contributions found, processing...');
|
|
53
|
+
const configurations = Array.isArray(contributes.configuration) ? contributes.configuration : [contributes.configuration];
|
|
54
|
+
// Format contributions for configuration registry
|
|
55
|
+
configurationNodes = configurations.map(config => ({
|
|
56
|
+
id: `${event.extensionSlug}`,
|
|
57
|
+
title: config.title || registryExtension.name,
|
|
58
|
+
description: config.description || registryExtension.manifest.description,
|
|
59
|
+
properties: config.properties || {},
|
|
60
|
+
type: config.type || ['object'],
|
|
61
|
+
scope: 'WINDOW',
|
|
62
|
+
// Default scope
|
|
63
|
+
extensionInfo: {
|
|
64
|
+
id: event.extensionSlug,
|
|
65
|
+
displayName: registryExtension.name
|
|
66
|
+
}
|
|
67
|
+
}));
|
|
68
|
+
// Create configuration defaults
|
|
69
|
+
configurationDefaults = [{
|
|
70
|
+
source: {
|
|
71
|
+
id: event.extensionSlug,
|
|
72
|
+
displayName: registryExtension.name
|
|
73
|
+
},
|
|
74
|
+
overrides: {} // Default empty overrides
|
|
75
|
+
}];
|
|
76
|
+
console.log(`Processed ${configurationNodes.length} configuration nodes`);
|
|
77
|
+
} else {
|
|
78
|
+
console.log('No configuration contributions found in manifest');
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
console.log('No extension or manifest found for:', event.extensionSlug);
|
|
82
|
+
}
|
|
83
|
+
// Add the extension's enabled/disabled state to configuration nodes
|
|
84
|
+
// This tracks the extension status regardless of whether it has configuration contributions
|
|
85
|
+
const extensionStatusNode = {
|
|
86
|
+
id: `${event.extensionSlug}.status`,
|
|
87
|
+
title: `${registryExtension?.name || event.extensionSlug} Status`,
|
|
88
|
+
description: `Extension enabled/disabled status for ${event.extensionSlug}`,
|
|
89
|
+
properties: {
|
|
90
|
+
[`extensions.${event.extensionSlug}`]: {
|
|
91
|
+
type: 'boolean',
|
|
92
|
+
default: true,
|
|
93
|
+
// Default to enabled when installed
|
|
94
|
+
description: `Enable/disable ${event.extensionSlug} extension`,
|
|
95
|
+
scope: 'window'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
type: ['object'],
|
|
99
|
+
scope: 3 /* ConfigurationScope.WINDOW */,
|
|
100
|
+
extensionInfo: {
|
|
101
|
+
id: event.extensionSlug,
|
|
102
|
+
displayName: registryExtension?.name || event.extensionSlug
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
// Add the extension status node to configurationNodes
|
|
106
|
+
// configurationNodes.push(extensionStatusNode);
|
|
107
|
+
// Create the configuration node data that configuration registry expects
|
|
108
|
+
const configurationNode = {
|
|
109
|
+
schemaId: ConfigurationSchemaId.Configuration,
|
|
110
|
+
tenantId: event.tenantId,
|
|
111
|
+
extensionName: event.extensionSlug,
|
|
112
|
+
policyConfigs: event.policies || null,
|
|
113
|
+
configurationNodes,
|
|
114
|
+
configurationDefaults
|
|
115
|
+
};
|
|
116
|
+
const context = {
|
|
117
|
+
schemaId: ConfigurationSchemaId.Configuration,
|
|
118
|
+
tenantId: event.tenantId,
|
|
119
|
+
extensionName: event.extensionSlug,
|
|
120
|
+
accountId: event.installedBy
|
|
121
|
+
// Add other context fields as needed
|
|
122
|
+
};
|
|
123
|
+
console.log('Broadcasting configuration registry event with data:', {
|
|
124
|
+
configurationNode: {
|
|
125
|
+
...configurationNode,
|
|
126
|
+
configurationNodes: `${configurationNodes.length} nodes`
|
|
127
|
+
},
|
|
128
|
+
context
|
|
129
|
+
});
|
|
130
|
+
this.broker.broadcast(ContributionRegistryServiceEvent.ContributionNodeRegistryAdd, {
|
|
131
|
+
configurationNode,
|
|
132
|
+
context,
|
|
133
|
+
timestamp: new Date()
|
|
134
|
+
}, [MoleculerServiceName.ConfigurationRegistryService
|
|
135
|
+
// MoleculerServiceName.MailService, // Using MailService instead of NotificationService
|
|
136
|
+
]);
|
|
137
|
+
// Create separate configuration node for system extension status
|
|
138
|
+
const systemExtensionNode = {
|
|
139
|
+
schemaId: ConfigurationSchemaId.Configuration,
|
|
140
|
+
tenantId: event.tenantId,
|
|
141
|
+
extensionName: SystemContributionExtensionNames.SystemExtension,
|
|
142
|
+
policyConfigs: null,
|
|
143
|
+
configurationNodes: [extensionStatusNode]
|
|
144
|
+
};
|
|
145
|
+
const systemContext = {
|
|
146
|
+
schemaId: ConfigurationSchemaId.Configuration,
|
|
147
|
+
tenantId: event.tenantId,
|
|
148
|
+
extensionName: SystemContributionExtensionNames.SystemExtension,
|
|
149
|
+
accountId: event.installedBy
|
|
150
|
+
};
|
|
151
|
+
this.broker.broadcast(ContributionRegistryServiceEvent.ContributionNodeRegistryAdd, {
|
|
152
|
+
configurationNode: systemExtensionNode,
|
|
153
|
+
context: systemContext,
|
|
154
|
+
timestamp: new Date()
|
|
155
|
+
}, [MoleculerServiceName.ConfigurationRegistryService
|
|
156
|
+
// MoleculerServiceName.MailService, // Using MailService instead of NotificationService
|
|
157
|
+
]);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
console.error('Error processing extension installed event:', error);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
// Listen to extension uninstalled events
|
|
163
|
+
this.onExtensionUninstalled.event(async event => {
|
|
164
|
+
try {
|
|
165
|
+
// Remove extension status from configuration registry
|
|
166
|
+
const context = {
|
|
167
|
+
schemaId: ConfigurationSchemaId.Configuration,
|
|
168
|
+
tenantId: event.tenantId,
|
|
169
|
+
extensionName: event.extensionSlug,
|
|
170
|
+
accountId: event.uninstalledBy
|
|
171
|
+
};
|
|
172
|
+
// Remove the extension's own configuration registry entry
|
|
173
|
+
this.broker.broadcast(ContributionRegistryServiceEvent.ContributionNodeRegistryRemove, {
|
|
174
|
+
context,
|
|
175
|
+
timestamp: new Date()
|
|
176
|
+
}, [MoleculerServiceName.ConfigurationRegistryService]);
|
|
177
|
+
// Remove the extension status from system extensions
|
|
178
|
+
const systemContext = {
|
|
179
|
+
schemaId: ConfigurationSchemaId.Configuration,
|
|
180
|
+
tenantId: event.tenantId,
|
|
181
|
+
extensionName: SystemContributionExtensionNames.SystemExtension,
|
|
182
|
+
accountId: event.uninstalledBy
|
|
183
|
+
};
|
|
184
|
+
this.broker.broadcast(ContributionRegistryServiceEvent.ContributionNodeRegistryRemove, {
|
|
185
|
+
context: systemContext,
|
|
186
|
+
timestamp: new Date()
|
|
187
|
+
}, [MoleculerServiceName.ConfigurationRegistryService]);
|
|
188
|
+
} catch (error) {
|
|
189
|
+
console.error('Error processing extension uninstalled event:', error);
|
|
190
|
+
}
|
|
191
|
+
this.broker.broadcast(ExtensionServiceAction.OnExtensionUninstalled, {
|
|
192
|
+
event
|
|
193
|
+
}, [MoleculerServiceName.ConfigurationService, 'WorkbenchService',
|
|
194
|
+
// Using string literal as MoleculerServiceName.WorkbenchService doesn't exist
|
|
195
|
+
MoleculerServiceName.MailService // Using MailService instead of NotificationService
|
|
196
|
+
]);
|
|
197
|
+
});
|
|
198
|
+
// Listen to extension enabled events
|
|
199
|
+
this.onExtensionEnabled.event(event => {
|
|
200
|
+
this.broker.broadcast(ExtensionServiceAction.OnExtensionEnabled, {
|
|
201
|
+
event
|
|
202
|
+
}, [MoleculerServiceName.ConfigurationService, 'WorkbenchService' // Using string literal as MoleculerServiceName.WorkbenchService doesn't exist
|
|
203
|
+
]);
|
|
204
|
+
});
|
|
205
|
+
// Listen to extension disabled events
|
|
206
|
+
this.onExtensionDisabled.event(event => {
|
|
207
|
+
this.broker.broadcast(ExtensionServiceAction.OnExtensionDisabled, {
|
|
208
|
+
event
|
|
209
|
+
}, [MoleculerServiceName.ConfigurationService, 'WorkbenchService' // Using string literal as MoleculerServiceName.WorkbenchService doesn't exist
|
|
210
|
+
]);
|
|
211
|
+
});
|
|
212
|
+
// Listen to extension updated events
|
|
213
|
+
this.onExtensionUpdated.event(event => {
|
|
214
|
+
this.broker.broadcast(ExtensionServiceAction.OnExtensionUpdated, {
|
|
215
|
+
event
|
|
216
|
+
}, [MoleculerServiceName.ConfigurationService]);
|
|
217
|
+
});
|
|
218
|
+
// Listen to extension version updated events
|
|
219
|
+
this.onExtensionVersionUpdated.event(event => {
|
|
220
|
+
this.broker.broadcast(ExtensionServiceAction.OnExtensionVersionUpdated, {
|
|
221
|
+
event
|
|
222
|
+
}, [MoleculerServiceName.ConfigurationService, 'WorkbenchService',
|
|
223
|
+
// Using string literal as MoleculerServiceName.WorkbenchService doesn't exist
|
|
224
|
+
MoleculerServiceName.MailService // Using MailService instead of NotificationService
|
|
225
|
+
]);
|
|
226
|
+
});
|
|
227
|
+
// Listen to extension configuration updated events
|
|
228
|
+
this.onExtensionConfigurationUpdated.event(event => {
|
|
229
|
+
this.broker.broadcast(ExtensionServiceAction.OnExtensionConfigurationUpdated, {
|
|
230
|
+
event
|
|
231
|
+
}, [MoleculerServiceName.ConfigurationService, 'WorkbenchService' // Using string literal as MoleculerServiceName.WorkbenchService doesn't exist
|
|
232
|
+
]);
|
|
233
|
+
});
|
|
234
|
+
// Listen to extension sync completed events
|
|
235
|
+
this.onExtensionSyncCompleted.event(event => {
|
|
236
|
+
this.broker.broadcast(ExtensionServiceAction.OnExtensionSyncCompleted, {
|
|
237
|
+
event
|
|
238
|
+
}, [MoleculerServiceName.MailService // Using MailService instead of NotificationService
|
|
239
|
+
]);
|
|
240
|
+
});
|
|
241
|
+
// Listen to extension cleanup completed events
|
|
242
|
+
this.onExtensionCleanupCompleted.event(event => {
|
|
243
|
+
this.broker.broadcast(ExtensionServiceAction.OnExtensionCleanupCompleted, {
|
|
244
|
+
event
|
|
245
|
+
}, [MoleculerServiceName.MailService // Using MailService instead of NotificationService
|
|
246
|
+
]);
|
|
247
|
+
});
|
|
248
|
+
// Listen to extension activation failed events
|
|
249
|
+
this.onExtensionActivationFailed.event(event => {
|
|
250
|
+
this.broker.broadcast(ExtensionServiceAction.OnExtensionActivationFailed, {
|
|
251
|
+
event
|
|
252
|
+
}, [MoleculerServiceName.MailService // Using MailService instead of NotificationService
|
|
253
|
+
]);
|
|
254
|
+
});
|
|
255
|
+
// Listen to extension deprecated events
|
|
256
|
+
this.onExtensionDeprecated.event(event => {
|
|
257
|
+
this.broker.broadcast(ExtensionServiceAction.OnExtensionDeprecated, {
|
|
258
|
+
event
|
|
259
|
+
}, [MoleculerServiceName.MailService // Using MailService instead of NotificationService
|
|
260
|
+
]);
|
|
261
|
+
});
|
|
262
|
+
// Listen to extension orphaned events
|
|
263
|
+
this.onExtensionOrphaned.event(event => {
|
|
264
|
+
this.broker.broadcast(ExtensionServiceAction.OnExtensionOrphaned, {
|
|
265
|
+
event
|
|
266
|
+
}, [MoleculerServiceName.MailService // Using MailService instead of NotificationService
|
|
267
|
+
]);
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
InstalledExtensionServiceExt = __decorate([injectable(), __param(0, inject(SERVER_TYPES.IInstalledExtensionRepository)), __param(1, inject(SERVER_TYPES.IRegistryExtensionService)), __param(2, inject(CommonType.MOLECULER_BROKER)), __param(3, inject(CommonType.LOGGER)), __metadata("design:paramtypes", [Object, Object, ServiceBroker, Object])], InstalledExtensionServiceExt);export{InstalledExtensionServiceExt};//# sourceMappingURL=installed-extension-service-ext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installed-extension-service-ext.js","sources":["../../src/services/installed-extension-service-ext.ts"],"sourcesContent":[null],"names":[],"mappings":"6bAkCG;AACH;AAG4D;AASxD;AAsTH,IAAA,4BAAA,GAAA,MAAA,4BAAA,SAAA,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { CdmLogger } from '@cdm-logger/core';
|
|
2
|
+
import { ServiceBroker } from 'moleculer';
|
|
3
|
+
import { Disposable, DisposableCollection, Emitter } from '@adminide-stack/core';
|
|
4
|
+
import { IInstalledExtensionModel, ICreateInstalledExtensionInput, IUpdateInstalledExtensionInput, IRegistryExtensionService, IInstalledExtensionFilter, IInstalledExtensionService, IInstalledExtensionRepository, IExtensionInstalledEvent, IExtensionUninstalledEvent, IExtensionEnabledEvent, IExtensionDisabledEvent, IExtensionUpdatedEvent, IExtensionVersionUpdatedEvent, IExtensionStatusChangedEvent, IExtensionActivationFailedEvent, IExtensionDeprecatedEvent, IExtensionOrphanedEvent, IExtensionConfigurationUpdatedEvent, IExtensionSyncCompletedEvent, IExtensionCleanupCompletedEvent, AsDomainType } from 'common/server';
|
|
5
|
+
import { BaseService2 } from '@common-stack/store-mongo';
|
|
6
|
+
export declare class InstalledExtensionService extends BaseService2<IInstalledExtensionModel> implements IInstalledExtensionService, Disposable {
|
|
7
|
+
private installedExtensionRepository;
|
|
8
|
+
protected registryExtensionService: IRegistryExtensionService;
|
|
9
|
+
protected broker: ServiceBroker;
|
|
10
|
+
protected readonly onExtensionInstalled: Emitter<IExtensionInstalledEvent>;
|
|
11
|
+
protected readonly onExtensionUninstalled: Emitter<IExtensionUninstalledEvent>;
|
|
12
|
+
protected readonly onExtensionEnabled: Emitter<IExtensionEnabledEvent>;
|
|
13
|
+
protected readonly onExtensionDisabled: Emitter<IExtensionDisabledEvent>;
|
|
14
|
+
protected readonly onExtensionUpdated: Emitter<IExtensionUpdatedEvent>;
|
|
15
|
+
protected readonly onExtensionVersionUpdated: Emitter<IExtensionVersionUpdatedEvent>;
|
|
16
|
+
protected readonly onExtensionConfigurationUpdated: Emitter<IExtensionConfigurationUpdatedEvent>;
|
|
17
|
+
protected readonly onExtensionSyncCompleted: Emitter<IExtensionSyncCompletedEvent>;
|
|
18
|
+
protected readonly onExtensionCleanupCompleted: Emitter<IExtensionCleanupCompletedEvent>;
|
|
19
|
+
protected readonly onExtensionStatusChanged: Emitter<IExtensionStatusChangedEvent>;
|
|
20
|
+
protected readonly onExtensionActivationFailed: Emitter<IExtensionActivationFailedEvent>;
|
|
21
|
+
protected readonly onExtensionDeprecated: Emitter<IExtensionDeprecatedEvent>;
|
|
22
|
+
protected readonly onExtensionOrphaned: Emitter<IExtensionOrphanedEvent>;
|
|
23
|
+
protected readonly toDispose: DisposableCollection;
|
|
24
|
+
private logger;
|
|
25
|
+
constructor(installedExtensionRepository: IInstalledExtensionRepository, registryExtensionService: IRegistryExtensionService, broker: ServiceBroker, logger: CdmLogger.ILogger);
|
|
26
|
+
dispose(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Install a new extension from the registry
|
|
29
|
+
*/
|
|
30
|
+
installExtension(input: ICreateInstalledExtensionInput): Promise<AsDomainType<IInstalledExtensionModel>>;
|
|
31
|
+
/**
|
|
32
|
+
* Internal method to perform the actual installation after validation
|
|
33
|
+
*/
|
|
34
|
+
private doInstallExtension;
|
|
35
|
+
/**
|
|
36
|
+
* Uninstall an extension
|
|
37
|
+
*/
|
|
38
|
+
uninstallExtension(tenantId: string, extensionSlug: string, uninstalledBy: string): Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Update an installed extension's configuration or status
|
|
41
|
+
*/
|
|
42
|
+
updateInstalledExtension(tenantId: string, extensionSlug: string, update: IUpdateInstalledExtensionInput): Promise<AsDomainType<IInstalledExtensionModel>>;
|
|
43
|
+
/**
|
|
44
|
+
* Get a specific installed extension
|
|
45
|
+
*/
|
|
46
|
+
getInstalledExtension(tenantId: string, extensionSlug: string): Promise<AsDomainType<IInstalledExtensionModel> | null>;
|
|
47
|
+
/**
|
|
48
|
+
* Get all installed extensions for a tenant with optional filtering
|
|
49
|
+
*/
|
|
50
|
+
getInstalledExtensions(filter: IInstalledExtensionFilter): Promise<AsDomainType<IInstalledExtensionModel>[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Enable/disable an installed extension
|
|
53
|
+
*/
|
|
54
|
+
toggleExtension(tenantId: string, extensionSlug: string, enabled: boolean, toggledBy: string): Promise<AsDomainType<IInstalledExtensionModel>>;
|
|
55
|
+
/**
|
|
56
|
+
* Update extension settings/configuration
|
|
57
|
+
*/
|
|
58
|
+
updateExtensionSettings(tenantId: string, extensionSlug: string, userConfig: Record<string, unknown>, updatedBy: string): Promise<AsDomainType<IInstalledExtensionModel>>;
|
|
59
|
+
/**
|
|
60
|
+
* Check for extension updates and return available updates
|
|
61
|
+
*/
|
|
62
|
+
checkForUpdates(tenantId: string, extensionSlug?: string): Promise<Array<{
|
|
63
|
+
extensionSlug: string;
|
|
64
|
+
currentVersion: string;
|
|
65
|
+
availableVersion: string;
|
|
66
|
+
isSecurityUpdate: boolean;
|
|
67
|
+
}>>;
|
|
68
|
+
/**
|
|
69
|
+
* Update an extension to a newer version
|
|
70
|
+
*/
|
|
71
|
+
updateExtensionVersion(tenantId: string, extensionSlug: string, targetVersion: string, updatedBy: string): Promise<AsDomainType<IInstalledExtensionModel>>;
|
|
72
|
+
/**
|
|
73
|
+
* Sync installed extensions with registry status
|
|
74
|
+
*/
|
|
75
|
+
syncWithRegistry(tenantId: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Get extensions that need attention
|
|
78
|
+
*/
|
|
79
|
+
getExtensionsNeedingAttention(tenantId: string): Promise<AsDomainType<IInstalledExtensionModel>[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Clean up deprecated or removed extensions based on policies
|
|
82
|
+
*/
|
|
83
|
+
cleanupExtensions(tenantId: string, dryRun?: boolean): Promise<{
|
|
84
|
+
removed: string[];
|
|
85
|
+
deprecated: string[];
|
|
86
|
+
warnings: string[];
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Check if update is a security update (simplified logic)
|
|
90
|
+
*/
|
|
91
|
+
private isSecurityUpdate;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=installed-extension-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installed-extension-service.d.ts","sourceRoot":"","sources":["../../src/services/installed-extension-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EACH,wBAAwB,EACxB,8BAA8B,EAC9B,8BAA8B,EAE9B,yBAAyB,EAEzB,yBAAyB,EAEzB,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,6BAA6B,EAC7B,4BAA4B,EAC5B,+BAA+B,EAC/B,yBAAyB,EACzB,uBAAuB,EACvB,mCAAmC,EACnC,4BAA4B,EAC5B,+BAA+B,EAC/B,YAAY,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,qBACa,yBACT,SAAQ,YAAY,CAAC,wBAAwB,CAC7C,YAAW,0BAA0B,EAAE,UAAU;IAgD7C,OAAO,CAAC,4BAA4B;IAGpC,SAAS,CAAC,wBAAwB,EAAE,yBAAyB;IAG7D,SAAS,CAAC,MAAM,EAAE,aAAa;IApDnC,SAAS,CAAC,QAAQ,CAAC,oBAAoB,oCAA2C;IAElF,SAAS,CAAC,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