@adminide-stack/marketplace-module-server 12.0.4-alpha.92 → 13.0.1-alpha.0
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 +16 -5
- 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/publisher-data-loader.d.ts +6 -0
- package/lib/dataloaders/publisher-data-loader.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 +309 -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 +183 -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 +324 -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 +584 -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/migrations/dbMigrations/DropOldPublisherIndexMigration.d.ts +20 -0
- package/lib/migrations/dbMigrations/DropOldPublisherIndexMigration.d.ts.map +1 -0
- package/lib/migrations/dbMigrations/DropOldPublisherIndexMigration.js +61 -0
- package/lib/migrations/dbMigrations/DropOldPublisherIndexMigration.js.map +1 -0
- package/lib/migrations/index.d.ts +2 -0
- package/lib/migrations/index.d.ts.map +1 -0
- package/lib/module.d.ts +1 -1
- package/lib/module.d.ts.map +1 -1
- package/lib/module.js +12 -25
- 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 +334 -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 +518 -0
- package/lib/services/installed-extension-service-ext.js.map +1 -0
- package/lib/services/installed-extension-service.d.ts +110 -0
- package/lib/services/installed-extension-service.d.ts.map +1 -0
- package/lib/services/installed-extension-service.js +633 -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 +62 -0
- package/lib/services/publisher-service.d.ts.map +1 -0
- package/lib/services/publisher-service.js +135 -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 +117 -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 +77 -0
- package/lib/store/repositories/installed-extension-repository.d.ts.map +1 -0
- package/lib/store/repositories/installed-extension-repository.js +462 -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 +99 -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 +199 -0
- package/lib/templates/services/MarketplacePublisherService.ts.template +51 -0
- package/lib/templates/services/PublisherDataLoader.ts.template +3 -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 +16 -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,196 @@
|
|
|
1
|
+
|
|
2
|
+
extend enum MoleculerServiceName {
|
|
3
|
+
ExtensionService
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
extend enum SlotFillPluginName {
|
|
7
|
+
extension_publish_page_slot_fill
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
extend enum SlotFillEnum {
|
|
11
|
+
ExtensionPublishPageSlotFill
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
enum ExtensionServiceAction {
|
|
15
|
+
OnExtensionInstalled
|
|
16
|
+
OnExtensionUninstalled
|
|
17
|
+
OnExtensionEnabled
|
|
18
|
+
OnExtensionDisabled
|
|
19
|
+
OnExtensionUpdated
|
|
20
|
+
OnExtensionVersionUpdated
|
|
21
|
+
OnExtensionConfigurationUpdated
|
|
22
|
+
OnExtensionSyncCompleted
|
|
23
|
+
OnExtensionCleanupCompleted
|
|
24
|
+
OnExtensionStatusChanged
|
|
25
|
+
OnExtensionActivationFailed
|
|
26
|
+
OnExtensionDeprecated
|
|
27
|
+
OnExtensionOrphaned
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
# Extension Event Types for codegen
|
|
31
|
+
|
|
32
|
+
"""
|
|
33
|
+
Event fired when an extension is installed
|
|
34
|
+
"""
|
|
35
|
+
type ExtensionInstalledEvent {
|
|
36
|
+
extensionSlug: String!
|
|
37
|
+
tenantId: String!
|
|
38
|
+
installedBy: String!
|
|
39
|
+
installedVersion: String!
|
|
40
|
+
registryRef: String!
|
|
41
|
+
installedAt: String!
|
|
42
|
+
policies: JSON
|
|
43
|
+
settings: JSON
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
"""
|
|
47
|
+
Event fired when an extension is uninstalled
|
|
48
|
+
"""
|
|
49
|
+
type ExtensionUninstalledEvent {
|
|
50
|
+
extensionSlug: String!
|
|
51
|
+
tenantId: String!
|
|
52
|
+
uninstalledBy: String!
|
|
53
|
+
uninstalledAt: String!
|
|
54
|
+
wasEnabled: Boolean!
|
|
55
|
+
dependencies: [String!]
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
"""
|
|
59
|
+
Event fired when an extension is enabled
|
|
60
|
+
"""
|
|
61
|
+
type ExtensionEnabledEvent {
|
|
62
|
+
extensionSlug: String!
|
|
63
|
+
tenantId: String!
|
|
64
|
+
enabledBy: String!
|
|
65
|
+
enabledAt: String!
|
|
66
|
+
previousState: String!
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
"""
|
|
70
|
+
Event fired when an extension is disabled
|
|
71
|
+
"""
|
|
72
|
+
type ExtensionDisabledEvent {
|
|
73
|
+
extensionSlug: String!
|
|
74
|
+
tenantId: String!
|
|
75
|
+
disabledBy: String!
|
|
76
|
+
disabledAt: String!
|
|
77
|
+
reason: String! # 'user', 'admin', 'policy', 'system'
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
extend enum SlotFillPluginName {
|
|
81
|
+
extension_publish_page_slot_fill
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
extend enum SlotFillEnum {
|
|
85
|
+
ExtensionPublishPageSlotFill
|
|
86
|
+
}
|
|
87
|
+
"""
|
|
88
|
+
Event fired when an extension is updated
|
|
89
|
+
"""
|
|
90
|
+
type ExtensionUpdatedEvent {
|
|
91
|
+
extensionSlug: String!
|
|
92
|
+
tenantId: String!
|
|
93
|
+
updatedBy: String!
|
|
94
|
+
updatedAt: String!
|
|
95
|
+
changes: JSON! # { status?, settings?, policies?, runtime? }
|
|
96
|
+
previousVersion: String
|
|
97
|
+
newVersion: String
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
"""
|
|
101
|
+
Event fired when an extension version is updated
|
|
102
|
+
"""
|
|
103
|
+
type ExtensionVersionUpdatedEvent {
|
|
104
|
+
extensionSlug: String!
|
|
105
|
+
tenantId: String!
|
|
106
|
+
updatedBy: String!
|
|
107
|
+
fromVersion: String!
|
|
108
|
+
toVersion: String!
|
|
109
|
+
updatedAt: String!
|
|
110
|
+
isSecurityUpdate: Boolean!
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
"""
|
|
114
|
+
Event fired when extension configuration is updated
|
|
115
|
+
"""
|
|
116
|
+
type ExtensionConfigurationUpdatedEvent {
|
|
117
|
+
tenantId: String!
|
|
118
|
+
extensionSlug: String!
|
|
119
|
+
updatedBy: String!
|
|
120
|
+
updatedAt: String!
|
|
121
|
+
configType: String! # 'user' or 'system'
|
|
122
|
+
previousConfig: JSON
|
|
123
|
+
newConfig: JSON!
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
"""
|
|
127
|
+
Event fired when extension sync with registry is completed
|
|
128
|
+
"""
|
|
129
|
+
type ExtensionSyncCompletedEvent {
|
|
130
|
+
tenantId: String!
|
|
131
|
+
syncedAt: String!
|
|
132
|
+
extensionsChecked: Int!
|
|
133
|
+
extensionsUpdated: Int!
|
|
134
|
+
extensionsOrphaned: Int!
|
|
135
|
+
errors: [String!]
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
"""
|
|
139
|
+
Event fired when extension cleanup is completed
|
|
140
|
+
"""
|
|
141
|
+
type ExtensionCleanupCompletedEvent {
|
|
142
|
+
tenantId: String!
|
|
143
|
+
cleanedAt: String!
|
|
144
|
+
extensionsRemoved: [String!]!
|
|
145
|
+
extensionsDeprecated: [String!]!
|
|
146
|
+
warnings: [String!]
|
|
147
|
+
dryRun: Boolean!
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
"""
|
|
151
|
+
Event fired when extension status changes
|
|
152
|
+
"""
|
|
153
|
+
type ExtensionStatusChangedEvent {
|
|
154
|
+
tenantId: String!
|
|
155
|
+
extensionSlug: String!
|
|
156
|
+
previousStatus: String!
|
|
157
|
+
newStatus: String!
|
|
158
|
+
changedBy: String
|
|
159
|
+
changedAt: String!
|
|
160
|
+
reason: String
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
"""
|
|
164
|
+
Event fired when extension activation fails
|
|
165
|
+
"""
|
|
166
|
+
type ExtensionActivationFailedEvent {
|
|
167
|
+
tenantId: String!
|
|
168
|
+
extensionSlug: String!
|
|
169
|
+
failedAt: String!
|
|
170
|
+
error: JSON! # { message, code, stack }
|
|
171
|
+
attemptCount: Int!
|
|
172
|
+
willRetry: Boolean!
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
"""
|
|
176
|
+
Event fired when an extension is deprecated
|
|
177
|
+
"""
|
|
178
|
+
type ExtensionDeprecatedEvent {
|
|
179
|
+
tenantId: String!
|
|
180
|
+
extensionSlug: String!
|
|
181
|
+
deprecatedAt: String!
|
|
182
|
+
deprecationInfo: JSON! # { reason, alternative, gracePeriod }
|
|
183
|
+
affectedInstallations: Int!
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
"""
|
|
187
|
+
Event fired when an extension becomes orphaned (removed from registry)
|
|
188
|
+
"""
|
|
189
|
+
type ExtensionOrphanedEvent {
|
|
190
|
+
tenantId: String!
|
|
191
|
+
extensionSlug: String!
|
|
192
|
+
orphanedAt: String!
|
|
193
|
+
lastKnownVersion: String!
|
|
194
|
+
removalReason: String
|
|
195
|
+
policyAction: String! # 'keep', 'disable', 'remove'
|
|
196
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Feature } from '@common-stack/server-core';
|
|
2
|
-
declare const _default: Feature<
|
|
2
|
+
declare const _default: Feature<any, any>;
|
|
3
3
|
export default _default;
|
|
4
|
+
export * from './services';
|
|
5
|
+
export * from './store';
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;;AAGpD,wBAAmC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;;AAGpD,wBAAmC;AAEnC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Feature}from'@common-stack/server-core';import module from'./module.js';var index = new Feature(module);export{index as default};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {Feature}from'@common-stack/server-core';import module$1 from'./module.js';export{InstalledExtensionService}from'./services/installed-extension-service.js';export{InstalledExtensionServiceExt}from'./services/installed-extension-service-ext.js';export{MarketplacePublisherService}from'./services/publisher-service.js';export{PublisherEventService}from'./services/publisher-event-service.js';export{ExtensionGalleryService}from'./services/extension-gallery-service.js';export{ExtensionGalleryRepository}from'./services/extension-gallery-repository.js';export{InstalledExtensionModelFunc}from'./store/models/installed-extension-model.js';export{PublisherModelFunc,PublisherSchema}from'./store/models/publisher-model.js';export{InstalledExtensionRepository}from'./store/repositories/installed-extension-repository.js';export{MarketplacePublisherRepository}from'./store/repositories/publisher-repository.js';var index = new Feature(module$1);export{index as default};//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":["module"],"mappings":"84BAGA,YAAA,IAAA,OAAmC,CAAAA,QAAA,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IDatabaseMigration } from '@adminide-stack/core';
|
|
2
|
+
import type { Connection } from 'mongoose';
|
|
3
|
+
import { CdmLogger } from '@cdm-logger/core';
|
|
4
|
+
/**
|
|
5
|
+
* Migration to drop the old publisherName_1 index from MarketplacePublisher collection.
|
|
6
|
+
*
|
|
7
|
+
* Ensures:
|
|
8
|
+
* - No duplicate index issues
|
|
9
|
+
* - Safe to run multiple times
|
|
10
|
+
* - Works across all tenant databases
|
|
11
|
+
*/
|
|
12
|
+
export declare class DropOldPublisherNameIndexMigration implements IDatabaseMigration {
|
|
13
|
+
private readonly db;
|
|
14
|
+
id: string;
|
|
15
|
+
private readonly logger;
|
|
16
|
+
constructor(db: Connection, logger: CdmLogger.ILogger);
|
|
17
|
+
up(): Promise<void>;
|
|
18
|
+
down(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=DropOldPublisherIndexMigration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropOldPublisherIndexMigration.d.ts","sourceRoot":"","sources":["../../../src/migrations/dbMigrations/DropOldPublisherIndexMigration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C;;;;;;;GAOG;AACH,qBACa,kCAAmC,YAAW,kBAAkB;IAQrE,OAAO,CAAC,QAAQ,CAAC,EAAE;IANvB,EAAE,SAAyD;IAE3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;gBAItB,EAAE,EAAE,UAAU,EAE/B,MAAM,EAAE,SAAS,CAAC,OAAO;IAKhB,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAyBrC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {__decorate,__param,__metadata}from'tslib';import {injectable,inject}from'inversify';import'@cdm-logger/core';import {DB_COLL_NAMES}from'common/server';var DropOldPublisherNameIndexMigration_1;
|
|
2
|
+
/**
|
|
3
|
+
* Migration to drop the old publisherName_1 index from MarketplacePublisher collection.
|
|
4
|
+
*
|
|
5
|
+
* Ensures:
|
|
6
|
+
* - No duplicate index issues
|
|
7
|
+
* - Safe to run multiple times
|
|
8
|
+
* - Works across all tenant databases
|
|
9
|
+
*/
|
|
10
|
+
let DropOldPublisherNameIndexMigration = DropOldPublisherNameIndexMigration_1 = class DropOldPublisherNameIndexMigration {
|
|
11
|
+
db;
|
|
12
|
+
// Unique migration ID (important: DO NOT change once deployed)
|
|
13
|
+
id = `${DropOldPublisherNameIndexMigration_1.name}_20251117`;
|
|
14
|
+
logger;
|
|
15
|
+
constructor(db, logger) {
|
|
16
|
+
this.db = db;
|
|
17
|
+
this.logger = logger.child({
|
|
18
|
+
className: DropOldPublisherNameIndexMigration_1.name
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async up() {
|
|
22
|
+
this.logger.info('Starting DropOldPublisherNameIndexMigration...');
|
|
23
|
+
try {
|
|
24
|
+
const collection = this.db.collection(DB_COLL_NAMES.MarketplacePublisher);
|
|
25
|
+
// Fetch all indexes
|
|
26
|
+
const indexes = await collection.listIndexes().toArray();
|
|
27
|
+
const oldIndex = indexes.find(idx => idx.name === 'publisherName_1');
|
|
28
|
+
if (oldIndex) {
|
|
29
|
+
this.logger.info('Found old index publisherName_1. Dropping...');
|
|
30
|
+
await collection.dropIndex('publisherName_1');
|
|
31
|
+
this.logger.info('Successfully dropped publisherName_1 index.');
|
|
32
|
+
} else {
|
|
33
|
+
this.logger.info('No old index publisherName_1 found. Nothing to remove.');
|
|
34
|
+
}
|
|
35
|
+
} catch (error) {
|
|
36
|
+
this.logger.error('Failed to drop publisherName_1 index:', error);
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
this.logger.info('DropOldPublisherNameIndexMigration completed successfully.');
|
|
40
|
+
}
|
|
41
|
+
async down() {
|
|
42
|
+
this.logger.info('Rollback for DropOldPublisherNameIndexMigration...');
|
|
43
|
+
try {
|
|
44
|
+
const collection = this.db.collection(DB_COLL_NAMES.MarketplacePublisher);
|
|
45
|
+
// Restore the old index (optional)
|
|
46
|
+
this.logger.info('Recreating publisherName_1 index...');
|
|
47
|
+
await collection.createIndex({
|
|
48
|
+
publisherName: 1
|
|
49
|
+
}, {
|
|
50
|
+
name: 'publisherName_1',
|
|
51
|
+
background: false
|
|
52
|
+
});
|
|
53
|
+
this.logger.info('publisherName_1 index recreated successfully.');
|
|
54
|
+
} catch (error) {
|
|
55
|
+
this.logger.error('Failed to recreate publisherName_1 index:', error);
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
this.logger.info('Rollback completed.');
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
DropOldPublisherNameIndexMigration = DropOldPublisherNameIndexMigration_1 = __decorate([injectable(), __param(0, inject('MongoDBConnection')), __param(1, inject('Logger')), __metadata("design:paramtypes", [Function, Object])], DropOldPublisherNameIndexMigration);export{DropOldPublisherNameIndexMigration};//# sourceMappingURL=DropOldPublisherIndexMigration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropOldPublisherIndexMigration.js","sources":["../../../src/migrations/dbMigrations/DropOldPublisherIndexMigration.ts"],"sourcesContent":[null],"names":[],"mappings":"+JAAA,IAAA;;;;;;AAaG;AACH;;AAGI,IAAA,kCAA2D,GAAA,oCAAA,GAAA,MAAA,kCAAA,CAAA;AAE3D,EAAA,EAAA;AAIqB;AAOR,EAAA,EAAA,GAAE,CAAA,EAAI,oCAAa,CAAA,IAAA,CAAA,SAAA,CAAA;AA4BnB,EAAA,MAAI;AAyBpB,EAAA,WAAA,CAAA,EAAA,EAAA,MAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAC"}
|
package/lib/module.d.ts
CHANGED
package/lib/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;;AAmBpD,wBAWG"}
|
package/lib/module.js
CHANGED
|
@@ -1,29 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
container.get(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
var module = new Feature({
|
|
1
|
+
import {Feature}from'@common-stack/server-core';import {SERVER_TYPES}from'common/server';import {resolvers}from'./graphql/resolvers/index.js';import {schema}from'./graphql/schemas/index.js';import {extensionModule}from'./containers/module.js';const extensionServiceGen = container => ({
|
|
2
|
+
installedExtensionService: container.get(SERVER_TYPES.IInstalledExtensionService),
|
|
3
|
+
publisherEventService: container.get(SERVER_TYPES.IPublisherEventService),
|
|
4
|
+
marketplacePublisherService: container.get(SERVER_TYPES.IMarketplacePublisherService),
|
|
5
|
+
extensionGalleryService: container.get(SERVER_TYPES.IExtensionGalleryService)
|
|
6
|
+
});
|
|
7
|
+
var module$1 = new Feature({
|
|
8
8
|
schema,
|
|
9
|
-
createResolversFunc:
|
|
9
|
+
createResolversFunc: resolvers,
|
|
10
10
|
createContainerFunc: [extensionModule],
|
|
11
11
|
createServiceFunc: extensionServiceGen,
|
|
12
|
-
middleware: [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// for example, if `extension` is missing we should throw some valid error.
|
|
16
|
-
req.services.registryExtensionService.findExtension(`${req.params.accountName}/${req.params.extension}`, req.params.version).then(data => {
|
|
17
|
-
const release = find(data.releases, {
|
|
18
|
-
version: req.params.version || data.version
|
|
19
|
-
});
|
|
20
|
-
const bundle = get(release, 'bundle');
|
|
21
|
-
res.set('content-type', 'text/javascript');
|
|
22
|
-
res.send(bundle);
|
|
23
|
-
}).catch(err => res.status(500).json({
|
|
24
|
-
ok: false,
|
|
25
|
-
error: err.stack
|
|
26
|
-
}));
|
|
27
|
-
});
|
|
12
|
+
middleware: [() => {
|
|
13
|
+
// Registry extension middleware has been moved to the extension module
|
|
14
|
+
// This marketplace module now focuses on marketplace-specific functionality
|
|
28
15
|
}]
|
|
29
|
-
});export{module as default};//# sourceMappingURL=module.js.map
|
|
16
|
+
});export{module$1 as default};//# sourceMappingURL=module.js.map
|
package/lib/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Service, ServiceBroker } from 'moleculer';
|
|
2
|
+
import { Container } from 'inversify';
|
|
3
|
+
/**
|
|
4
|
+
* Extension Moleculer Service Plugin
|
|
5
|
+
* Handles incoming Moleculer broadcasts for extension events and manages
|
|
6
|
+
* configuration registry for contributions and extensions
|
|
7
|
+
*/
|
|
8
|
+
export declare class ExtensionMoleculerService extends Service {
|
|
9
|
+
private container;
|
|
10
|
+
constructor(broker: ServiceBroker, { container }: {
|
|
11
|
+
container: Container;
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Register extension contributions to configuration registry
|
|
15
|
+
*/
|
|
16
|
+
private registerExtensionContributions;
|
|
17
|
+
/**
|
|
18
|
+
* Unregister extension contributions from configuration registry
|
|
19
|
+
*/
|
|
20
|
+
private unregisterExtensionContributions;
|
|
21
|
+
/**
|
|
22
|
+
* Activate extension contributions
|
|
23
|
+
*/
|
|
24
|
+
private activateExtensionContributions;
|
|
25
|
+
/**
|
|
26
|
+
* Deactivate extension contributions
|
|
27
|
+
*/
|
|
28
|
+
private deactivateExtensionContributions;
|
|
29
|
+
/**
|
|
30
|
+
* Update contribution state in registry
|
|
31
|
+
*/
|
|
32
|
+
private updateContributionState;
|
|
33
|
+
/**
|
|
34
|
+
* Update extension configuration in registry
|
|
35
|
+
*/
|
|
36
|
+
private updateExtensionConfiguration;
|
|
37
|
+
/**
|
|
38
|
+
* Refresh contribution configuration
|
|
39
|
+
*/
|
|
40
|
+
private refreshContributionConfiguration;
|
|
41
|
+
/**
|
|
42
|
+
* Refresh extension contributions for new version
|
|
43
|
+
*/
|
|
44
|
+
private refreshExtensionContributions;
|
|
45
|
+
/**
|
|
46
|
+
* Update contribution version in registry
|
|
47
|
+
*/
|
|
48
|
+
private updateContributionVersion;
|
|
49
|
+
/**
|
|
50
|
+
* Handle orphaned extensions
|
|
51
|
+
*/
|
|
52
|
+
private handleOrphanedExtensions;
|
|
53
|
+
/**
|
|
54
|
+
* Handle deprecated extensions
|
|
55
|
+
*/
|
|
56
|
+
private handleDeprecatedExtensions;
|
|
57
|
+
/**
|
|
58
|
+
* Clean up contribution registry entries
|
|
59
|
+
*/
|
|
60
|
+
private cleanupContributionRegistry;
|
|
61
|
+
/**
|
|
62
|
+
* Mark contributions as failed
|
|
63
|
+
*/
|
|
64
|
+
private markContributionsAsFailed;
|
|
65
|
+
/**
|
|
66
|
+
* Mark contributions as deprecated
|
|
67
|
+
*/
|
|
68
|
+
private markContributionsAsDeprecated;
|
|
69
|
+
/**
|
|
70
|
+
* Mark contributions as orphaned
|
|
71
|
+
*/
|
|
72
|
+
private markContributionsAsOrphaned;
|
|
73
|
+
/**
|
|
74
|
+
* Get extension configuration
|
|
75
|
+
*/
|
|
76
|
+
private getExtensionConfiguration;
|
|
77
|
+
/**
|
|
78
|
+
* Get extension contributions
|
|
79
|
+
*/
|
|
80
|
+
private getExtensionContributions;
|
|
81
|
+
/**
|
|
82
|
+
* Get all active contributions for tenant
|
|
83
|
+
*/
|
|
84
|
+
private getActiveContributions;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=extension-moleculer-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-moleculer-service.d.ts","sourceRoot":"","sources":["../../src/plugins/extension-moleculer-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAiBtC;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,OAAO;IAClD,OAAO,CAAC,SAAS,CAAY;gBAEjB,MAAM,EAAE,aAAa,EAAE,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,SAAS,CAAA;KAAE;IA6Q1E;;OAEG;YACW,8BAA8B;IAc5C;;OAEG;YACW,gCAAgC;IAM9C;;OAEG;YACW,8BAA8B;IAM5C;;OAEG;YACW,gCAAgC;IAM9C;;OAEG;YACW,uBAAuB;IAMrC;;OAEG;YACW,4BAA4B;IAM1C;;OAEG;YACW,gCAAgC;IAM9C;;OAEG;YACW,6BAA6B;IAM3C;;OAEG;YACW,yBAAyB;IAMvC;;OAEG;YACW,wBAAwB;IAMtC;;OAEG;YACW,0BAA0B;IAMxC;;OAEG;YACW,2BAA2B;IAMzC;;OAEG;YACW,yBAAyB;IAMvC;;OAEG;YACW,6BAA6B;IAM3C;;OAEG;YACW,2BAA2B;IAMzC;;OAEG;YACW,yBAAyB;IAOvC;;OAEG;YACW,yBAAyB;IAOvC;;OAEG;YACW,sBAAsB;CAMvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CdmLogger } from '@cdm-logger/core';
|
|
2
|
+
import { IGalleryExtension, IExtensionGalleryRepository, IGalleryQueryResult } from 'common/server';
|
|
3
|
+
export declare class ExtensionGalleryRepository implements IExtensionGalleryRepository {
|
|
4
|
+
private readonly logger;
|
|
5
|
+
constructor(logger: CdmLogger.ILogger);
|
|
6
|
+
asset<T>(extensionSlug: string, version: string, asset: string): Promise<T>;
|
|
7
|
+
private buildAssetUrl;
|
|
8
|
+
private fetchHttpAsset;
|
|
9
|
+
private readLocalAsset;
|
|
10
|
+
get(id: string, fields: string[]): Promise<IGalleryExtension[]>;
|
|
11
|
+
private validateFields;
|
|
12
|
+
download(extension: IGalleryExtension): Promise<boolean>;
|
|
13
|
+
private verifyDownloadUrl;
|
|
14
|
+
query(query: Record<string, unknown>): Promise<IGalleryQueryResult>;
|
|
15
|
+
private extractFilters;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=extension-gallery-repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-gallery-repository.d.ts","sourceRoot":"","sources":["../../src/services/extension-gallery-repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAKpG,qBACa,0BAA2B,YAAW,2BAA2B;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,SAAS,CAAC,OAAO;IAI3D,KAAK,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAmBxF,OAAO,CAAC,aAAa;YAOP,cAAc;YAoCd,cAAc;IAmBf,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IA8B5E,OAAO,CAAC,cAAc;IA2BT,QAAQ,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;YA+BvD,iBAAiB;IAqBlB,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAkChF,OAAO,CAAC,cAAc;CAYzB"}
|