@adminide-stack/marketplace-module-server 12.0.4-alpha.41 → 12.0.4-alpha.412
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/containers/module.d.ts +8 -0
- package/lib/containers/module.d.ts.map +1 -1
- package/lib/containers/module.js +15 -5
- package/lib/containers/module.js.map +1 -1
- package/lib/dataloaders/index.d.ts +1 -0
- package/lib/dataloaders/index.d.ts.map +1 -0
- package/lib/demo/test-graphql-examples.d.ts +73 -0
- package/lib/demo/test-graphql-examples.d.ts.map +1 -0
- package/lib/graphql/resolvers/form-templates-resolver.d.ts +220 -0
- package/lib/graphql/resolvers/form-templates-resolver.d.ts.map +1 -0
- package/lib/graphql/resolvers/form-templates-resolver.js +170 -0
- package/lib/graphql/resolvers/form-templates-resolver.js.map +1 -0
- package/lib/graphql/resolvers/gallery-resolver.d.ts +15 -0
- package/lib/graphql/resolvers/gallery-resolver.d.ts.map +1 -0
- package/lib/graphql/resolvers/gallery-resolver.js +35 -0
- package/lib/graphql/resolvers/gallery-resolver.js.map +1 -0
- package/lib/graphql/resolvers/index.d.ts +247 -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 +289 -0
- package/lib/graphql/resolvers/installed-extension-resolver.js.map +1 -0
- package/lib/graphql/resolvers/marketplace-form-resolver.d.ts +13 -0
- package/lib/graphql/resolvers/marketplace-form-resolver.d.ts.map +1 -0
- package/lib/graphql/resolvers/marketplace-form-resolver.js +90 -0
- package/lib/graphql/resolvers/marketplace-form-resolver.js.map +1 -0
- package/lib/graphql/resolvers/publisher-analytics-resolver.d.ts +14 -0
- package/lib/graphql/resolvers/publisher-analytics-resolver.d.ts.map +1 -0
- package/lib/graphql/resolvers/publisher-analytics-resolver.js +221 -0
- package/lib/graphql/resolvers/publisher-analytics-resolver.js.map +1 -0
- package/lib/graphql/resolvers/publisher-resolver.d.ts +5 -0
- package/lib/graphql/resolvers/publisher-resolver.d.ts.map +1 -0
- package/lib/graphql/resolvers/publisher-resolver.js +176 -0
- package/lib/graphql/resolvers/publisher-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/registry-extension-resolver.js +46 -0
- package/lib/graphql/resolvers/registry-extension-resolver.js.map +1 -0
- package/lib/graphql/schemas/extension-pricing.graphql +546 -0
- package/lib/graphql/schemas/extension-pricing.graphql.js +1 -0
- package/lib/graphql/schemas/extension-pricing.graphql.js.map +1 -0
- package/lib/graphql/schemas/extension-registry.graphql +107 -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/form-templates.graphql +269 -0
- package/lib/graphql/schemas/form-templates.graphql.js +1 -0
- package/lib/graphql/schemas/form-templates.graphql.js.map +1 -0
- package/lib/graphql/schemas/gallery-schema.graphql +247 -0
- package/lib/graphql/schemas/gallery-schema.graphql.js +1 -0
- package/lib/graphql/schemas/gallery-schema.graphql.js.map +1 -0
- package/lib/graphql/schemas/index.d.ts.map +1 -1
- package/lib/graphql/schemas/index.js +3 -4
- package/lib/graphql/schemas/index.js.map +1 -1
- package/lib/graphql/schemas/installed-extension.graphql +309 -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/publisher-analytics.graphql +305 -0
- package/lib/graphql/schemas/publisher-analytics.graphql.js +1 -0
- package/lib/graphql/schemas/publisher-analytics.graphql.js.map +1 -0
- package/lib/graphql/schemas/publisher.graphql +376 -0
- package/lib/graphql/schemas/publisher.graphql.js +1 -0
- package/lib/graphql/schemas/publisher.graphql.js.map +1 -0
- package/lib/graphql/schemas/service.graphql +196 -0
- package/lib/index.d.ts +3 -1
- 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 +1 -1
- package/lib/module.d.ts.map +1 -1
- package/lib/module.js +10 -23
- 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-gallery-repository.d.ts +17 -0
- package/lib/services/extension-gallery-repository.d.ts.map +1 -0
- package/lib/services/extension-gallery-repository.js +192 -0
- package/lib/services/extension-gallery-repository.js.map +1 -0
- package/lib/services/extension-gallery-service-new.d.ts +39 -0
- package/lib/services/extension-gallery-service-new.d.ts.map +1 -0
- package/lib/services/extension-gallery-service.d.ts +30 -0
- package/lib/services/extension-gallery-service.d.ts.map +1 -0
- package/lib/services/extension-gallery-service.js +311 -0
- package/lib/services/extension-gallery-service.js.map +1 -0
- package/lib/services/index.d.ts +6 -1
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/installed-extension-service-ext.d.ts +16 -0
- package/lib/services/installed-extension-service-ext.d.ts.map +1 -0
- package/lib/services/installed-extension-service-ext.js +485 -0
- package/lib/services/installed-extension-service-ext.js.map +1 -0
- package/lib/services/installed-extension-service.d.ts +96 -0
- package/lib/services/installed-extension-service.d.ts.map +1 -0
- package/lib/services/installed-extension-service.js +521 -0
- package/lib/services/installed-extension-service.js.map +1 -0
- package/lib/services/installed-extension-service.test.d.ts +1 -0
- package/lib/services/installed-extension-service.test.d.ts.map +1 -0
- package/lib/services/publisher-analytics-service.d.ts +128 -0
- package/lib/services/publisher-analytics-service.d.ts.map +1 -0
- package/lib/services/publisher-event-service.d.ts +48 -0
- package/lib/services/publisher-event-service.d.ts.map +1 -0
- package/lib/services/publisher-event-service.js +296 -0
- package/lib/services/publisher-event-service.js.map +1 -0
- package/lib/services/publisher-service-context.d.ts +1 -0
- package/lib/services/publisher-service-context.d.ts.map +1 -0
- package/lib/services/publisher-service.d.ts +60 -0
- package/lib/services/publisher-service.d.ts.map +1 -0
- package/lib/services/publisher-service.js +134 -0
- package/lib/services/publisher-service.js.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 +2 -1
- 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 +269 -0
- package/lib/store/models/installed-extension-model.js.map +1 -0
- package/lib/store/models/publisher-event-model.d.ts +11 -0
- package/lib/store/models/publisher-event-model.d.ts.map +1 -0
- package/lib/store/models/publisher-model.d.ts +5 -0
- package/lib/store/models/publisher-model.d.ts.map +1 -0
- package/lib/store/models/publisher-model.js +103 -0
- package/lib/store/models/publisher-model.js.map +1 -0
- package/lib/store/models/publisher-stats-model.d.ts +1 -0
- package/lib/store/models/publisher-stats-model.d.ts.map +1 -0
- 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 +73 -0
- package/lib/store/repositories/installed-extension-repository.d.ts.map +1 -0
- package/lib/store/repositories/installed-extension-repository.js +442 -0
- package/lib/store/repositories/installed-extension-repository.js.map +1 -0
- package/lib/store/repositories/publisher-analytics-repository.d.ts +1 -0
- package/lib/store/repositories/publisher-analytics-repository.d.ts.map +1 -0
- package/lib/store/repositories/publisher-repository.d.ts +19 -0
- package/lib/store/repositories/publisher-repository.d.ts.map +1 -0
- package/lib/store/repositories/publisher-repository.js +87 -0
- package/lib/store/repositories/publisher-repository.js.map +1 -0
- package/lib/templates/constants/DB_COLL_NAMES.ts.template +5 -0
- package/lib/templates/constants/SERVER_TYPES.ts.template +10 -4
- package/lib/templates/repositories/ExtensionGalleryRepository.ts.template +44 -0
- package/lib/templates/repositories/InstalledExtensionRepository.ts.template +94 -0
- package/lib/templates/repositories/MarketplacePublisherRepository.ts.template +24 -0
- package/lib/templates/repositories/RegistryExtensionRepository.ts.template +10 -15
- package/lib/templates/services/ExtensionGalleryDataLoader.ts.template +2 -0
- package/lib/templates/services/ExtensionGalleryService.ts.template +79 -0
- package/lib/templates/services/InstalledExtensionDataLoader.ts.template +2 -0
- package/lib/templates/services/InstalledExtensionService.ts.template +181 -0
- package/lib/templates/services/MarketplacePublisherService.ts.template +49 -0
- package/lib/templates/services/PublisherEventService.ts.template +56 -0
- package/lib/templates/services/RegistryExtensionService.ts.template +62 -18
- package/lib/tests/extension-integration.test.d.ts +1 -0
- package/lib/tests/extension-integration.test.d.ts.map +1 -0
- package/lib/tests/install-extension-graphql.test.d.ts +2 -0
- package/lib/tests/install-extension-graphql.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/lib/utils/publisherValidation.d.ts +23 -0
- package/lib/utils/publisherValidation.d.ts.map +1 -0
- package/lib/utils/publisherValidation.js +144 -0
- package/lib/utils/publisherValidation.js.map +1 -0
- package/package.json +15 -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 +0 -167
- 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/services/extension-service.d.ts +0 -54
- package/lib/services/extension-service.d.ts.map +0 -1
- package/lib/services/extension-service.js +0 -42
- package/lib/services/extension-service.js.map +0 -1
- package/lib/store/models/registry-extension-model.d.ts +0 -10
- package/lib/store/models/registry-extension-model.d.ts.map +0 -1
- package/lib/store/models/registry-extension-model.js +0 -62
- package/lib/store/models/registry-extension-model.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 +0 -135
- package/lib/store/repository/registry-extension-repository.js.map +0 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { IBaseMongoRepository, IInstalledExtensionModel, AsDomainType } from 'common/server';
|
|
2
|
+
import {
|
|
3
|
+
ICreateInstalledExtensionInput,
|
|
4
|
+
IUpdateInstalledExtensionInput,
|
|
5
|
+
IInstalledExtensionFilter,
|
|
6
|
+
} from '../services/InstalledExtensionService';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Repository interface for installed extensions data access layer
|
|
10
|
+
*/
|
|
11
|
+
export interface IInstalledExtensionRepository extends IBaseMongoRepository<IInstalledExtensionModel> {
|
|
12
|
+
/**
|
|
13
|
+
* Create a new installed extension record
|
|
14
|
+
*/
|
|
15
|
+
create<T = ICreateInstalledExtensionInput>(data: T): Promise<AsDomainType<IInstalledExtensionModel>>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Update an existing installed extension
|
|
19
|
+
*/
|
|
20
|
+
updateExtension(
|
|
21
|
+
orgId: string,
|
|
22
|
+
extensionId: string,
|
|
23
|
+
update: IUpdateInstalledExtensionInput,
|
|
24
|
+
): Promise<AsDomainType<IInstalledExtensionModel> | null>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Find a specific installed extension by organization and extension ObjectIds
|
|
28
|
+
*/
|
|
29
|
+
findByOrgAndExtensionId(orgId: string, extensionId: string): Promise<AsDomainType<IInstalledExtensionModel> | null>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Find installed extensions with optional filtering
|
|
33
|
+
*/
|
|
34
|
+
findExtensions(filter: IInstalledExtensionFilter): Promise<AsDomainType<IInstalledExtensionModel>[]>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Delete an installed extension
|
|
38
|
+
*/
|
|
39
|
+
deleteExtension(orgId: string, extensionId: string): Promise<boolean>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get installed extensions joined with registry information
|
|
43
|
+
*/
|
|
44
|
+
findWithRegistryInfo(filter: IInstalledExtensionFilter): Promise<any[]>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Check if extension exists for organization
|
|
48
|
+
*/
|
|
49
|
+
exists(orgId: string, extensionId: string): Promise<boolean>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Bulk update multiple extensions (useful for policy changes or admin actions)
|
|
53
|
+
*/
|
|
54
|
+
bulkUpdateExtensions(
|
|
55
|
+
orgId: string,
|
|
56
|
+
filter: Partial<IInstalledExtensionFilter>,
|
|
57
|
+
update: Partial<IUpdateInstalledExtensionInput>,
|
|
58
|
+
): Promise<number>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Get extension dependency graph for an organization
|
|
62
|
+
*/
|
|
63
|
+
getDependencyGraph(orgId: string): Promise<{
|
|
64
|
+
extensions: AsDomainType<IInstalledExtensionModel>[];
|
|
65
|
+
dependencies: Array<{
|
|
66
|
+
extensionId: string;
|
|
67
|
+
dependsOn: string[];
|
|
68
|
+
dependents: string[];
|
|
69
|
+
}>;
|
|
70
|
+
}>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Count installed extensions matching filter
|
|
74
|
+
*/
|
|
75
|
+
countExtensions(filter: IInstalledExtensionFilter): Promise<number>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Find extensions that need registry sync (stale registry status)
|
|
79
|
+
*/
|
|
80
|
+
findStaleExtensions(orgId: string, maxAge: number): Promise<AsDomainType<IInstalledExtensionModel>[]>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Update registry status for multiple extensions
|
|
84
|
+
*/
|
|
85
|
+
syncRegistryStatus(
|
|
86
|
+
updates: Array<{
|
|
87
|
+
orgId: string;
|
|
88
|
+
extensionId: string;
|
|
89
|
+
registryStatus: string;
|
|
90
|
+
latestVersion?: string;
|
|
91
|
+
isOrphaned: boolean;
|
|
92
|
+
}>,
|
|
93
|
+
): Promise<void>;
|
|
94
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IBaseMongoRepository, IMarketplacePublisherModel, AsDomainType } from 'common/server';
|
|
2
|
+
|
|
3
|
+
export interface IMarketplacePublisherRepository extends IBaseMongoRepository<IMarketplacePublisherModel> {
|
|
4
|
+
findByPublisherName(publisherName: string): Promise<AsDomainType<IMarketplacePublisherModel> | null>;
|
|
5
|
+
findPublishers(
|
|
6
|
+
search?: string,
|
|
7
|
+
orderBy?: string,
|
|
8
|
+
orderDirection?: 'ASC' | 'DESC',
|
|
9
|
+
limit?: number,
|
|
10
|
+
offset?: number,
|
|
11
|
+
): Promise<{
|
|
12
|
+
publishers: AsDomainType<IMarketplacePublisherModel>[];
|
|
13
|
+
totalCount: number;
|
|
14
|
+
}>;
|
|
15
|
+
updatePublisherStats(
|
|
16
|
+
publisherId: string,
|
|
17
|
+
stats: {
|
|
18
|
+
extensionCount?: number;
|
|
19
|
+
totalInstalls?: number;
|
|
20
|
+
averageRating?: number;
|
|
21
|
+
},
|
|
22
|
+
): Promise<AsDomainType<IMarketplacePublisherModel> | null>;
|
|
23
|
+
verifyPublisher(publisherId: string): Promise<AsDomainType<IMarketplacePublisherModel> | null>;
|
|
24
|
+
}
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IMarketplacePublishExtensionInput, IExtensionRelease, IBaseMongoRepository, IRegistryExtensionModel, IExtensionReleaseModel, AsDomainType } from 'common/server';
|
|
2
2
|
|
|
3
|
-
export interface
|
|
4
|
-
|
|
5
|
-
createdAt?: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface IRegistryExtensionRepository {
|
|
9
|
-
extensionReleases(extensionID: string): Promise<IExtensionRelease[]>;
|
|
3
|
+
export interface IRegistryExtensionRepository extends IBaseMongoRepository<IRegistryExtensionModel> {
|
|
4
|
+
extensionReleases(extensionSlug: string): Promise<AsDomainType<IExtensionReleaseModel>[]>;
|
|
10
5
|
|
|
11
|
-
createExtension(publisherId: string, name: string): Promise<
|
|
6
|
+
createExtension(publisherId: string, name: string): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
12
7
|
|
|
13
|
-
updateExtensionName(
|
|
8
|
+
updateExtensionName(extensionSlug: string, name: string): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
14
9
|
|
|
15
|
-
updateExtension(
|
|
10
|
+
updateExtension(extensionSlug: string, update: { installed?: boolean }): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
16
11
|
|
|
17
|
-
deleteExtension(
|
|
12
|
+
deleteExtension(extensionSlug: string): boolean | Promise<boolean>;
|
|
18
13
|
|
|
19
|
-
publishExtension(request:
|
|
14
|
+
publishExtension(request: IMarketplacePublishExtensionInput): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
20
15
|
|
|
21
|
-
findExtensions(first: number, query: string, local?: boolean, remote?: boolean, prioritizeExtensionIDs?: string[])
|
|
16
|
+
findExtensions(first: number, query: string, local?: boolean, remote?: boolean, prioritizeExtensionIDs?: string[]): Promise<AsDomainType<IRegistryExtensionModel>[]>;
|
|
22
17
|
|
|
23
|
-
findExtension(
|
|
18
|
+
findExtension(extensionSlug: string): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
24
19
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// from package: marketplace-server
|
|
2
|
+
import {
|
|
3
|
+
IGalleryExtension,
|
|
4
|
+
IExtensionIdentifier,
|
|
5
|
+
IExtensionManifest,
|
|
6
|
+
IGalleryPager,
|
|
7
|
+
AsDomainType,
|
|
8
|
+
IRegistryExtensionModel,
|
|
9
|
+
} from 'common/server';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Query options interface for gallery searches
|
|
13
|
+
*/
|
|
14
|
+
export interface IQueryOptions {
|
|
15
|
+
text?: string;
|
|
16
|
+
pageSize?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Service interface for managing extension gallery
|
|
21
|
+
* IMPORTANT: All service methods that return domain entities MUST use AsDomainType<IEntityModel>
|
|
22
|
+
* This ensures proper type compatibility between MongoDB models and GraphQL domain types
|
|
23
|
+
*/
|
|
24
|
+
export interface IExtensionGalleryService {
|
|
25
|
+
/**
|
|
26
|
+
* Check if gallery service is enabled
|
|
27
|
+
*/
|
|
28
|
+
isEnabled(): boolean;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Query extensions in gallery
|
|
32
|
+
*/
|
|
33
|
+
query(options?: IQueryOptions): Promise<IGalleryPager>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get a specific extension by identifier
|
|
37
|
+
*/
|
|
38
|
+
getExtension(identifier: IExtensionIdentifier | string): Promise<IGalleryExtension | null>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Download an extension
|
|
42
|
+
*/
|
|
43
|
+
download(extension: IGalleryExtension): Promise<string>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Get extension README content
|
|
47
|
+
*/
|
|
48
|
+
getReadme(extension: IGalleryExtension): Promise<string>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get extension manifest
|
|
52
|
+
*/
|
|
53
|
+
getManifest(extension: IGalleryExtension): Promise<IExtensionManifest | null>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get extension changelog
|
|
57
|
+
*/
|
|
58
|
+
getChangelog(extension: IGalleryExtension): Promise<string>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Get extension license
|
|
62
|
+
*/
|
|
63
|
+
getLicense(extension: IGalleryExtension): Promise<string>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Load compatible version of extension
|
|
67
|
+
*/
|
|
68
|
+
loadCompatibleVersion(extension: IGalleryExtension): Promise<IGalleryExtension>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* This file augments the ServerContext interface from the central apollo-context.
|
|
73
|
+
* Through declaration merging, the extensionGalleryService will be added to the ServerContext.
|
|
74
|
+
*/
|
|
75
|
+
declare module '../apollo-context' {
|
|
76
|
+
export interface ServerContext {
|
|
77
|
+
extensionGalleryService: IExtensionGalleryService;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IInstalledExtensionModel,
|
|
3
|
+
IInstallExtensionInput,
|
|
4
|
+
IExtensionPoliciesInput,
|
|
5
|
+
IExtensionSettingsInput,
|
|
6
|
+
AsDomainType,
|
|
7
|
+
IBaseService,
|
|
8
|
+
} from 'common/server';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Input type for creating installed extensions with additional server-side fields
|
|
12
|
+
*/
|
|
13
|
+
export interface ICreateInstalledExtensionInput extends IInstallExtensionInput {
|
|
14
|
+
extensionId: string; // ObjectId reference to extension registry
|
|
15
|
+
orgId: string; // Organization ID
|
|
16
|
+
installedVersion: string;
|
|
17
|
+
installedBy: string; // User ObjectId as string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Input type for updating installed extensions
|
|
22
|
+
*/
|
|
23
|
+
export interface IUpdateInstalledExtensionInput {
|
|
24
|
+
status?: string;
|
|
25
|
+
lifecycle?: {
|
|
26
|
+
registryStatus?: string;
|
|
27
|
+
isOrphaned?: boolean;
|
|
28
|
+
deprecationWarningShown?: boolean;
|
|
29
|
+
autoUpdateBlocked?: boolean;
|
|
30
|
+
lastRegistryCheck?: string;
|
|
31
|
+
};
|
|
32
|
+
policies?: IExtensionPoliciesInput;
|
|
33
|
+
settings?: IExtensionSettingsInput;
|
|
34
|
+
runtime?: {
|
|
35
|
+
activationState?: string;
|
|
36
|
+
lastActivated?: Date;
|
|
37
|
+
lastDeactivated?: Date;
|
|
38
|
+
activationError?: {
|
|
39
|
+
message: string;
|
|
40
|
+
code: string;
|
|
41
|
+
timestamp: string;
|
|
42
|
+
};
|
|
43
|
+
metrics?: {
|
|
44
|
+
activationTime: number;
|
|
45
|
+
memoryUsage: number;
|
|
46
|
+
lastMeasured: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
lastUpdatedBy?: string;
|
|
50
|
+
availableVersion?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Filter input for querying installed extensions
|
|
55
|
+
*/
|
|
56
|
+
export interface IInstalledExtensionFilter {
|
|
57
|
+
accountId?: string; // Account ID for filtering extensions by account
|
|
58
|
+
orgId?: string; // Organization ID for filtering extensions by organization
|
|
59
|
+
extension?: string; // ObjectId as string reference to extension registry
|
|
60
|
+
status?: string[];
|
|
61
|
+
'lifecycle.registryStatus'?: string[];
|
|
62
|
+
'lifecycle.isOrphaned'?: boolean;
|
|
63
|
+
'settings.effectiveEnabled'?: boolean;
|
|
64
|
+
installedBy?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Service interface for managing installed extensions
|
|
69
|
+
* This service handles the lifecycle of extensions after they've been installed from the registry
|
|
70
|
+
*/
|
|
71
|
+
export interface IInstalledExtensionService extends IBaseService<IInstalledExtensionModel> {
|
|
72
|
+
/**
|
|
73
|
+
* Install a new extension from the registry
|
|
74
|
+
*/
|
|
75
|
+
installExtension(input: ICreateInstalledExtensionInput, tenantId: string): Promise<AsDomainType<IInstalledExtensionModel>>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Uninstall an extension - now supports accountId and orgId based filtering
|
|
79
|
+
*/
|
|
80
|
+
uninstallExtension(
|
|
81
|
+
orgId: string,
|
|
82
|
+
extensionSlug: string,
|
|
83
|
+
uninstalledBy: string,
|
|
84
|
+
tenantId: string
|
|
85
|
+
): Promise<boolean>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Update an installed extension's configuration or status - now supports accountId and orgId based filtering
|
|
89
|
+
*/
|
|
90
|
+
updateInstalledExtension(
|
|
91
|
+
orgId: string,
|
|
92
|
+
extensionSlug: string,
|
|
93
|
+
update: IUpdateInstalledExtensionInput,
|
|
94
|
+
tenantId: string,
|
|
95
|
+
): Promise<AsDomainType<IInstalledExtensionModel>>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Get a specific installed extension - now supports accountId and orgId based filtering
|
|
99
|
+
*/
|
|
100
|
+
getInstalledExtension(
|
|
101
|
+
orgId: string,
|
|
102
|
+
extensionSlug: string,
|
|
103
|
+
): Promise<AsDomainType<IInstalledExtensionModel> | null>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Get all installed extensions with optional filtering - now supports accountId and orgId based filtering
|
|
107
|
+
*/
|
|
108
|
+
getInstalledExtensions(filter: IInstalledExtensionFilter): Promise<AsDomainType<IInstalledExtensionModel>[]>;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Enable/disable an installed extension - now supports accountId and orgId based filtering
|
|
112
|
+
*/
|
|
113
|
+
toggleExtension(
|
|
114
|
+
orgId: string,
|
|
115
|
+
extensionSlug: string,
|
|
116
|
+
enabled: boolean,
|
|
117
|
+
toggledBy: string,
|
|
118
|
+
tenantId: string,
|
|
119
|
+
): Promise<AsDomainType<IInstalledExtensionModel>>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Update extension settings/configuration - now supports accountId and orgId based filtering
|
|
123
|
+
*/
|
|
124
|
+
updateExtensionSettings(
|
|
125
|
+
orgId: string,
|
|
126
|
+
extensionSlug: string,
|
|
127
|
+
userConfig: Record<string, unknown>,
|
|
128
|
+
updatedBy: string,
|
|
129
|
+
tenantId: string,
|
|
130
|
+
): Promise<AsDomainType<IInstalledExtensionModel>>;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Check for extension updates and return available updates - now supports accountId and orgId based filtering
|
|
134
|
+
*/
|
|
135
|
+
checkForUpdates(
|
|
136
|
+
orgId: string,
|
|
137
|
+
extensionSlug?: string,
|
|
138
|
+
): Promise<
|
|
139
|
+
Array<{
|
|
140
|
+
extensionId: string;
|
|
141
|
+
extensionSlug: string;
|
|
142
|
+
currentVersion: string;
|
|
143
|
+
availableVersion: string;
|
|
144
|
+
isSecurityUpdate: boolean;
|
|
145
|
+
}>
|
|
146
|
+
>;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Update an extension to a newer version - now supports accountId and orgId based filtering
|
|
150
|
+
*/
|
|
151
|
+
updateExtensionVersion(
|
|
152
|
+
orgId: string,
|
|
153
|
+
extensionSlug: string,
|
|
154
|
+
targetVersion: string,
|
|
155
|
+
updatedBy: string,
|
|
156
|
+
tenantId: string
|
|
157
|
+
): Promise<AsDomainType<IInstalledExtensionModel>>;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Sync installed extensions with registry status (for orphaned, deprecated, etc.) - now supports accountId and orgId based filtering
|
|
161
|
+
*/
|
|
162
|
+
syncWithRegistry(orgId: string, tenantId: string): Promise<void>;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Get extensions that need attention (deprecated, orphaned, security updates, etc.) - now supports accountId and orgId based filtering
|
|
166
|
+
*/
|
|
167
|
+
getExtensionsNeedingAttention(orgId: string): Promise<AsDomainType<IInstalledExtensionModel>[]>;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Clean up deprecated or removed extensions based on policies - now supports accountId and orgId based filtering
|
|
171
|
+
*/
|
|
172
|
+
cleanupExtensions(
|
|
173
|
+
orgId: string,
|
|
174
|
+
tenantId: string,
|
|
175
|
+
dryRun?: boolean,
|
|
176
|
+
): Promise<{
|
|
177
|
+
removed: string[]; // Array of extension ObjectIds
|
|
178
|
+
deprecated: string[]; // Array of extension ObjectIds
|
|
179
|
+
warnings: string[];
|
|
180
|
+
}>;
|
|
181
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { IBaseService, IMarketplacePublisherModel, AsDomainType } from 'common/server';
|
|
2
|
+
|
|
3
|
+
export interface IMarketplacePublisherService extends IBaseService<IMarketplacePublisherModel> {
|
|
4
|
+
findById(id: string): Promise<AsDomainType<IMarketplacePublisherModel> | null>;
|
|
5
|
+
findByPublisherName(publisherName: string): Promise<AsDomainType<IMarketplacePublisherModel> | null>;
|
|
6
|
+
findPublishers(
|
|
7
|
+
search?: string,
|
|
8
|
+
orderBy?: string,
|
|
9
|
+
orderDirection?: 'ASC' | 'DESC',
|
|
10
|
+
first?: number,
|
|
11
|
+
after?: number,
|
|
12
|
+
): Promise<{
|
|
13
|
+
publishers: AsDomainType<IMarketplacePublisherModel>[];
|
|
14
|
+
totalCount: number;
|
|
15
|
+
}>;
|
|
16
|
+
createPublisher(data: {
|
|
17
|
+
displayName: string;
|
|
18
|
+
publisherName: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
website?: string;
|
|
21
|
+
domain?: string;
|
|
22
|
+
}): Promise<AsDomainType<IMarketplacePublisherModel>>;
|
|
23
|
+
updatePublisher(
|
|
24
|
+
publisherId: string,
|
|
25
|
+
data: {
|
|
26
|
+
displayName?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
website?: string;
|
|
29
|
+
avatarUrl?: string;
|
|
30
|
+
},
|
|
31
|
+
): Promise<AsDomainType<IMarketplacePublisherModel> | null>;
|
|
32
|
+
updatePublisherStats(
|
|
33
|
+
publisherId: string,
|
|
34
|
+
stats: {
|
|
35
|
+
extensionCount?: number;
|
|
36
|
+
totalInstalls?: number;
|
|
37
|
+
averageRating?: number;
|
|
38
|
+
},
|
|
39
|
+
): Promise<AsDomainType<IMarketplacePublisherModel> | null>;
|
|
40
|
+
verifyPublisher(publisherId: string): Promise<AsDomainType<IMarketplacePublisherModel> | null>;
|
|
41
|
+
getPublisherStats(publisherId: string): Promise<{
|
|
42
|
+
totalExtensions: number;
|
|
43
|
+
totalDownloads: number;
|
|
44
|
+
totalInstallations: number;
|
|
45
|
+
averageRating: number;
|
|
46
|
+
verifiedCount: number;
|
|
47
|
+
topExtension?: unknown; // TODO: Should be IRegistryExtension when available
|
|
48
|
+
} | null>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// from package: marketplace-server
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Service interface for managing publisher analytics events
|
|
5
|
+
*/
|
|
6
|
+
export interface IPublisherEventService {
|
|
7
|
+
recordEvent(event: {
|
|
8
|
+
publisherId: string;
|
|
9
|
+
extensionId?: string;
|
|
10
|
+
eventType: 'download' | 'install' | 'view' | 'rating';
|
|
11
|
+
value?: number;
|
|
12
|
+
metadata?: Record<string, unknown>;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
|
|
15
|
+
getPublisherStats(publisherId: string): Promise<{
|
|
16
|
+
totalDownloads: number;
|
|
17
|
+
totalInstalls: number;
|
|
18
|
+
totalViews: number;
|
|
19
|
+
totalRatings: number;
|
|
20
|
+
averageRating: number;
|
|
21
|
+
extensionCount: number;
|
|
22
|
+
lastUpdated: Date;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
getPublisherAnalytics(
|
|
26
|
+
publisherId: string,
|
|
27
|
+
startDate: Date,
|
|
28
|
+
endDate: Date,
|
|
29
|
+
granularity: string,
|
|
30
|
+
): Promise<
|
|
31
|
+
Array<{
|
|
32
|
+
date: Date;
|
|
33
|
+
downloads: number;
|
|
34
|
+
installs: number;
|
|
35
|
+
views: number;
|
|
36
|
+
ratings: number;
|
|
37
|
+
averageRating: number;
|
|
38
|
+
uniqueUsers: number;
|
|
39
|
+
}>
|
|
40
|
+
>;
|
|
41
|
+
|
|
42
|
+
getPublisherTrends(
|
|
43
|
+
publisherId: string,
|
|
44
|
+
days: number,
|
|
45
|
+
): Promise<{
|
|
46
|
+
downloadTrend: string;
|
|
47
|
+
downloadChange: number;
|
|
48
|
+
installTrend: string;
|
|
49
|
+
installChange: number;
|
|
50
|
+
viewTrend: string;
|
|
51
|
+
viewChange: number;
|
|
52
|
+
ratingTrend: string;
|
|
53
|
+
ratingChange: number;
|
|
54
|
+
trendScore: number;
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
@@ -1,19 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface IRegistryExtensionService {
|
|
4
|
-
extensionReleases(
|
|
5
|
-
|
|
6
|
-
createExtension(publisherId: string, name: string): Promise<
|
|
7
|
-
|
|
8
|
-
updateExtensionName(
|
|
9
|
-
|
|
10
|
-
updateExtension(
|
|
11
|
-
|
|
12
|
-
deleteExtension(
|
|
13
|
-
|
|
14
|
-
publishExtension(request:
|
|
15
|
-
|
|
16
|
-
findExtensions(first: number, query: string, local?: boolean, remote?: boolean, prioritizeExtensionIDs?: string[])
|
|
17
|
-
|
|
18
|
-
findExtension(
|
|
1
|
+
import { IMarketplacePublishExtensionInput, IExtensionRelease, IBaseService, IRegistryExtensionModel, AsDomainType } from 'common/server';
|
|
2
|
+
|
|
3
|
+
export interface IRegistryExtensionService extends IBaseService<AsDomainType<IRegistryExtensionModel>> {
|
|
4
|
+
extensionReleases(extensionSlug: string): Promise<IExtensionRelease[]>;
|
|
5
|
+
|
|
6
|
+
createExtension(publisherId: string, name: string): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
7
|
+
|
|
8
|
+
updateExtensionName(extensionSlug: string, name: string): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
9
|
+
|
|
10
|
+
updateExtension(extensionSlug: string, update: { installed?: boolean }): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
11
|
+
|
|
12
|
+
deleteExtension(extensionSlug: string): boolean | Promise<boolean>;
|
|
13
|
+
|
|
14
|
+
publishExtension(request: IMarketplacePublishExtensionInput): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
15
|
+
|
|
16
|
+
findExtensions(first: number, query: string, local?: boolean, remote?: boolean, prioritizeExtensionIDs?: string[]): Promise<AsDomainType<IRegistryExtensionModel>[]>;
|
|
17
|
+
|
|
18
|
+
findExtension(extensionSlug: string): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
19
|
+
|
|
20
|
+
// Enhanced marketplace features
|
|
21
|
+
formSubmission(input: {
|
|
22
|
+
extensionSlug: string;
|
|
23
|
+
formData: string;
|
|
24
|
+
submissionType: string;
|
|
25
|
+
metadata?: string;
|
|
26
|
+
}): Promise<{
|
|
27
|
+
success: boolean;
|
|
28
|
+
message?: string;
|
|
29
|
+
errors?: string[];
|
|
30
|
+
submissionId?: string;
|
|
31
|
+
data?: string;
|
|
32
|
+
}>;
|
|
33
|
+
|
|
34
|
+
validateExtension(input: {
|
|
35
|
+
manifest: string;
|
|
36
|
+
bundle?: string;
|
|
37
|
+
sourceMap?: string;
|
|
38
|
+
extensionSlug?: string;
|
|
39
|
+
version?: string;
|
|
40
|
+
}): Promise<{
|
|
41
|
+
isValid: boolean;
|
|
42
|
+
errors: Array<{ field: string; message: string; code?: string }>;
|
|
43
|
+
warnings: Array<{ field: string; message: string; code?: string }>;
|
|
44
|
+
metadata?: string;
|
|
45
|
+
}>;
|
|
46
|
+
|
|
47
|
+
publishExtensionEnhanced(input: {
|
|
48
|
+
extensionSlug: string;
|
|
49
|
+
manifest: string;
|
|
50
|
+
bundle: string;
|
|
51
|
+
sourceMap?: string;
|
|
52
|
+
version: string;
|
|
53
|
+
releaseNotes?: string;
|
|
54
|
+
force?: boolean;
|
|
55
|
+
preRelease?: boolean;
|
|
56
|
+
}): Promise<{
|
|
57
|
+
success: boolean;
|
|
58
|
+
extension?: AsDomainType<IRegistryExtensionModel>;
|
|
59
|
+
message?: string;
|
|
60
|
+
errors?: string[];
|
|
61
|
+
releaseId?: string;
|
|
62
|
+
}>;
|
|
19
63
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=extension-integration.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-integration.test.d.ts","sourceRoot":"","sources":["../../src/tests/extension-integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-extension-graphql.test.d.ts","sourceRoot":"","sources":["../../src/tests/install-extension-graphql.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=test-extension-services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-extension-services.d.ts","sourceRoot":"","sources":["../../src/tests/test-extension-services.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend validation utilities for publisher data
|
|
3
|
+
*/
|
|
4
|
+
export interface ValidationResult {
|
|
5
|
+
valid: boolean;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Validates a publisher name on the backend
|
|
10
|
+
* Ensures it doesn't contain characters that would break URL routing or extension slug parsing
|
|
11
|
+
*/
|
|
12
|
+
export declare function validatePublisherName(publisherName: string): ValidationResult;
|
|
13
|
+
/**
|
|
14
|
+
* Validates publisher data for creation or update
|
|
15
|
+
*/
|
|
16
|
+
export declare function validatePublisherData(data: {
|
|
17
|
+
publisherName: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
email?: string;
|
|
20
|
+
website?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
}): ValidationResult;
|
|
23
|
+
//# sourceMappingURL=publisherValidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publisherValidation.d.ts","sourceRoot":"","sources":["../../src/utils/publisherValidation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,gBAAgB,CA4E7E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,gBAAgB,CA2CnB"}
|