@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,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend validation utilities for publisher data
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Validates a publisher name on the backend
|
|
6
|
+
* Ensures it doesn't contain characters that would break URL routing or extension slug parsing
|
|
7
|
+
*/
|
|
8
|
+
function validatePublisherName(publisherName) {
|
|
9
|
+
if (!publisherName || publisherName.trim().length === 0) {
|
|
10
|
+
return {
|
|
11
|
+
valid: false,
|
|
12
|
+
error: 'Publisher name is required'
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const trimmed = publisherName.trim();
|
|
16
|
+
// Check minimum length
|
|
17
|
+
if (trimmed.length < 2) {
|
|
18
|
+
return {
|
|
19
|
+
valid: false,
|
|
20
|
+
error: 'Publisher name must be at least 2 characters long'
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
// Check maximum length
|
|
24
|
+
if (trimmed.length > 50) {
|
|
25
|
+
return {
|
|
26
|
+
valid: false,
|
|
27
|
+
error: 'Publisher name must be less than 50 characters'
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
// Check for invalid characters that would break routing or parsing
|
|
31
|
+
if (trimmed.includes('/')) {
|
|
32
|
+
return {
|
|
33
|
+
valid: false,
|
|
34
|
+
error: 'Publisher name cannot contain forward slashes (/)'
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (trimmed.includes('.')) {
|
|
38
|
+
return {
|
|
39
|
+
valid: false,
|
|
40
|
+
error: 'Publisher name cannot contain dots (.)'
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (trimmed.includes('\\')) {
|
|
44
|
+
return {
|
|
45
|
+
valid: false,
|
|
46
|
+
error: 'Publisher name cannot contain backslashes (\\)'
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
// Check for other URL-unsafe characters
|
|
50
|
+
const urlUnsafeChars = ['?', '#', '&', '%', '+', '=', '<', '>', '"', '`', '{', '}', '|', '^', '[', ']', '@', ':', ';', ',', ' '];
|
|
51
|
+
for (const char of urlUnsafeChars) {
|
|
52
|
+
if (trimmed.includes(char)) {
|
|
53
|
+
return {
|
|
54
|
+
valid: false,
|
|
55
|
+
error: `Publisher name cannot contain the character: ${char}`
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Check if it starts or ends with special characters
|
|
60
|
+
if (trimmed.startsWith('-') || trimmed.endsWith('-')) {
|
|
61
|
+
return {
|
|
62
|
+
valid: false,
|
|
63
|
+
error: 'Publisher name cannot start or end with hyphens'
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (trimmed.startsWith('_') || trimmed.endsWith('_')) {
|
|
67
|
+
return {
|
|
68
|
+
valid: false,
|
|
69
|
+
error: 'Publisher name cannot start or end with underscores'
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// Only allow alphanumeric characters, hyphens, and underscores
|
|
73
|
+
const validPattern = /^[a-zA-Z0-9]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$/;
|
|
74
|
+
if (!validPattern.test(trimmed)) {
|
|
75
|
+
return {
|
|
76
|
+
valid: false,
|
|
77
|
+
error: 'Publisher name can only contain letters, numbers, hyphens, and underscores'
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
valid: true
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Validates publisher data for creation or update
|
|
86
|
+
*/
|
|
87
|
+
function validatePublisherData(data) {
|
|
88
|
+
// Validate publisher name
|
|
89
|
+
const nameValidation = validatePublisherName(data.publisherName);
|
|
90
|
+
if (!nameValidation.valid) {
|
|
91
|
+
return nameValidation;
|
|
92
|
+
}
|
|
93
|
+
// Validate display name
|
|
94
|
+
if (!data.displayName || data.displayName.trim().length === 0) {
|
|
95
|
+
return {
|
|
96
|
+
valid: false,
|
|
97
|
+
error: 'Display name is required'
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (data.displayName.trim().length > 100) {
|
|
101
|
+
return {
|
|
102
|
+
valid: false,
|
|
103
|
+
error: 'Display name must be less than 100 characters'
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
// Validate email if provided
|
|
107
|
+
if (data.email && data.email.trim().length > 0) {
|
|
108
|
+
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
109
|
+
if (!emailPattern.test(data.email)) {
|
|
110
|
+
return {
|
|
111
|
+
valid: false,
|
|
112
|
+
error: 'Please provide a valid email address'
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Validate website if provided
|
|
117
|
+
if (data.website && data.website.trim().length > 0) {
|
|
118
|
+
try {
|
|
119
|
+
const url = new URL(data.website);
|
|
120
|
+
// URL constructor validates the URL format
|
|
121
|
+
if (!url.protocol.startsWith('http')) {
|
|
122
|
+
return {
|
|
123
|
+
valid: false,
|
|
124
|
+
error: 'Website must use http or https protocol'
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
} catch {
|
|
128
|
+
return {
|
|
129
|
+
valid: false,
|
|
130
|
+
error: 'Website must be a valid URL'
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// Validate description length if provided
|
|
135
|
+
if (data.description && data.description.length > 1000) {
|
|
136
|
+
return {
|
|
137
|
+
valid: false,
|
|
138
|
+
error: 'Description must be less than 1000 characters'
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
valid: true
|
|
143
|
+
};
|
|
144
|
+
}export{validatePublisherData,validatePublisherName};//# sourceMappingURL=publisherValidation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publisherValidation.js","sources":["../../src/utils/publisherValidation.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;AAEG;AAEH;;;AAGC;AAED,SAAA,qBAAA,CAAA,aAAA,EAAA;;;AAGG,MAAA,KAAA,EAAA,KAAA;AACH,MAAA,KAAA,EAAA;AA8EA,KAAA;;AAEG,EAAA,MAAA,OAAA,GAAA,aAAA,CAAA,IAAA,EAAA;AACH;MACI,OAAA,CAAA,YAAsB;IACtB,OAAA;MACA,KAAM,EAAE,KAAM;MACd,KAAO,EAAC;KACR;AACH,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminide-stack/marketplace-module-server",
|
|
3
|
-
"version": "12.0.4-alpha.
|
|
3
|
+
"version": "12.0.4-alpha.412",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"watch": "yarn build:lib:watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@adminide-stack/extension-api": "12.0.4-alpha.
|
|
24
|
+
"@adminide-stack/extension-api": "12.0.4-alpha.412",
|
|
25
25
|
"nanoid": "^5.1.5"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"common": "12.0.4-alpha.
|
|
28
|
+
"common": "12.0.4-alpha.412"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"graphql-tag": ">=2.0.0"
|
|
@@ -36,18 +36,26 @@
|
|
|
36
36
|
"cdecode": {
|
|
37
37
|
"common": {
|
|
38
38
|
"constants": [
|
|
39
|
-
"./${libDir}/templates/constants/SERVER_TYPES.ts.template"
|
|
39
|
+
"./${libDir}/templates/constants/SERVER_TYPES.ts.template",
|
|
40
|
+
"./${libDir}/templates/constants/DB_COLL_NAMES.ts.template"
|
|
40
41
|
],
|
|
41
42
|
"services": [
|
|
42
|
-
"./${libDir}/templates/services/
|
|
43
|
+
"./${libDir}/templates/services/InstalledExtensionService.ts.template",
|
|
44
|
+
"./${libDir}/templates/services/InstalledExtensionDataLoader.ts.template",
|
|
45
|
+
"./${libDir}/templates/services/MarketplacePublisherService.ts.template",
|
|
46
|
+
"./${libDir}/templates/services/PublisherEventService.ts.template",
|
|
47
|
+
"./${libDir}/templates/services/ExtensionGalleryService.ts.template",
|
|
48
|
+
"./${libDir}/templates/services/ExtensionGalleryDataLoader.ts.template"
|
|
43
49
|
],
|
|
44
50
|
"repositories": [
|
|
45
|
-
"./${libDir}/templates/repositories/
|
|
51
|
+
"./${libDir}/templates/repositories/InstalledExtensionRepository.ts.template",
|
|
52
|
+
"./${libDir}/templates/repositories/MarketplacePublisherRepository.ts.template",
|
|
53
|
+
"./${libDir}/templates/repositories/ExtensionGalleryRepository.ts.template"
|
|
46
54
|
]
|
|
47
55
|
}
|
|
48
56
|
},
|
|
49
57
|
"typescript": {
|
|
50
58
|
"definition": "lib/index.d.ts"
|
|
51
59
|
},
|
|
52
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "49ebdad1366ea930ec9f66b1ef7e0398f32fb314"
|
|
53
61
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/graphql/resolvers/resolvers.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,QAAQ,EAAE,GAuMrB,CAAC"}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import*as url from'url';const bundleUrlGenerator = (extensionID, version) => url.resolve(process.env.BACKEND_URL, `_registry/${extensionID}/${version}`);
|
|
2
|
-
const resolver = (pubsub, logger) => ({
|
|
3
|
-
Contributes: {
|
|
4
|
-
menus: root => {
|
|
5
|
-
let result;
|
|
6
|
-
// const manifest = JSON.parse(root.manifest);
|
|
7
|
-
// console.log('manifest======>', manifest);
|
|
8
|
-
const menus = root.menus;
|
|
9
|
-
console.log('menus=========>', menus);
|
|
10
|
-
try {
|
|
11
|
-
result = {
|
|
12
|
-
commandPalette: menus['commandPalette'] || [],
|
|
13
|
-
explorer: {
|
|
14
|
-
context: menus['explorer/context'] || []
|
|
15
|
-
},
|
|
16
|
-
editor: {
|
|
17
|
-
context: menus['editor/context'] || [],
|
|
18
|
-
title: {
|
|
19
|
-
own: menus['editor/title'] || [],
|
|
20
|
-
context: menus['editor/title/context'] || []
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
debug: {
|
|
24
|
-
callstack: {
|
|
25
|
-
context: menus['debug/callstack/context'] || []
|
|
26
|
-
},
|
|
27
|
-
toolbar: menus['debug/toolbar'] || []
|
|
28
|
-
},
|
|
29
|
-
scm: {
|
|
30
|
-
title: menus['scm/title'] || [],
|
|
31
|
-
resourceGroup: {
|
|
32
|
-
context: menus['scm/resourceGroup/context'] || []
|
|
33
|
-
},
|
|
34
|
-
resource: {
|
|
35
|
-
context: menus['scm/resource/context'] || []
|
|
36
|
-
},
|
|
37
|
-
change: {
|
|
38
|
-
title: menus['scm/change/title'] || []
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
view: {
|
|
42
|
-
title: menus['view/title'] || [],
|
|
43
|
-
item: {
|
|
44
|
-
context: menus['view/item/context'] || []
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
touchBar: menus['touchBar'] || []
|
|
48
|
-
};
|
|
49
|
-
} catch (err) {
|
|
50
|
-
console.log('err', err);
|
|
51
|
-
}
|
|
52
|
-
console.log('result====>', result, result.editor);
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
ExtensionRegistry: {
|
|
57
|
-
async extensions(root, args, ctx) {
|
|
58
|
-
logger && logger.debug('args [%j]', args);
|
|
59
|
-
const nodes = await ctx.registryExtensionService.findExtensions(args.first, args.query, args.local, args.remote, args.prioritizeExtensionIDs);
|
|
60
|
-
return {
|
|
61
|
-
nodes
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
|
-
async extension(root, args, ctx) {
|
|
65
|
-
return ctx.registryExtensionService.findExtension(args.extensionID);
|
|
66
|
-
},
|
|
67
|
-
async releases(root, args, ctx) {
|
|
68
|
-
return ctx.registryExtensionService.extensionReleases(args.extensionID);
|
|
69
|
-
},
|
|
70
|
-
async publishers(root, args, ctx) {},
|
|
71
|
-
async viewerPublishers(root, args, ctx) {},
|
|
72
|
-
async localExtensionIDPrefix(root, args, ctx) {}
|
|
73
|
-
},
|
|
74
|
-
ExtensionRelease: {
|
|
75
|
-
bundleURL: root => bundleUrlGenerator(root.extensionID, root.version)
|
|
76
|
-
},
|
|
77
|
-
ExtensionManifest: {
|
|
78
|
-
bundleURL: ({
|
|
79
|
-
version,
|
|
80
|
-
extensionID
|
|
81
|
-
}) => bundleUrlGenerator(extensionID, version)
|
|
82
|
-
},
|
|
83
|
-
RegistryExtension: {
|
|
84
|
-
manifest: root => {
|
|
85
|
-
let result;
|
|
86
|
-
// console.log('root=================>', JSON.parse(root.manifest));
|
|
87
|
-
try {
|
|
88
|
-
result = {
|
|
89
|
-
...JSON.parse(root.manifest),
|
|
90
|
-
extensionID: root.extensionID,
|
|
91
|
-
raw: root.manifest
|
|
92
|
-
};
|
|
93
|
-
} catch (err) {}
|
|
94
|
-
return result;
|
|
95
|
-
},
|
|
96
|
-
url: root => bundleUrlGenerator(root.extensionID, root.version)
|
|
97
|
-
},
|
|
98
|
-
Query: {
|
|
99
|
-
// namespace for running all extension registry queries
|
|
100
|
-
extensionRegistry() {
|
|
101
|
-
return {};
|
|
102
|
-
},
|
|
103
|
-
/// DEPRECATED: Remove all fo the following resolvers as they moved to namespace ExtensionRegistry
|
|
104
|
-
async extensions(root, args, ctx) {
|
|
105
|
-
logger && logger.debug('args [%j]', args);
|
|
106
|
-
let nodes = await ctx.registryExtensionService.findExtensions(args.first, args.query, args.local, args.remote, args.prioritizeExtensionIDs);
|
|
107
|
-
// const res = { nodes: {...nodes, manifest: JSON.parse(nodes[0].manifest)} };
|
|
108
|
-
// console.log('nodes==>', nodes);
|
|
109
|
-
// nodes = nodes.map(el => {
|
|
110
|
-
// return {
|
|
111
|
-
// ...JSON.parse(JSON.stringify(el)),
|
|
112
|
-
// manifest: JSON.parse(el.manifest),
|
|
113
|
-
// };
|
|
114
|
-
// });
|
|
115
|
-
// console.log('nodes=======after>', nodes);
|
|
116
|
-
return {
|
|
117
|
-
nodes
|
|
118
|
-
};
|
|
119
|
-
},
|
|
120
|
-
async extension(root, args, ctx) {
|
|
121
|
-
return ctx.registryExtensionService.findExtension(args.extensionID);
|
|
122
|
-
},
|
|
123
|
-
async releases(root, args, ctx) {
|
|
124
|
-
return ctx.registryExtensionService.extensionReleases(args.extensionID);
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
Mutation: {
|
|
128
|
-
async createExtension(root, args, ctx) {
|
|
129
|
-
const extension = await ctx.registryExtensionService.createExtension(args.publisher, args.name);
|
|
130
|
-
return {
|
|
131
|
-
extension
|
|
132
|
-
};
|
|
133
|
-
},
|
|
134
|
-
updateExtension(root, args, ctx) {
|
|
135
|
-
return ctx.registryExtensionService.updateExtensionName(args.extension, args.name);
|
|
136
|
-
},
|
|
137
|
-
deleteExtension(root, args, ctx) {
|
|
138
|
-
return ctx.registryExtensionService.deleteExtension(args.extension);
|
|
139
|
-
},
|
|
140
|
-
async installExtension(root, args, ctx) {
|
|
141
|
-
const extension = await ctx.registryExtensionService.findExtension(args.extensionID);
|
|
142
|
-
if (!extension) {
|
|
143
|
-
throw new Error(`Extension ${args.extensionID} not found`);
|
|
144
|
-
}
|
|
145
|
-
return ctx.registryExtensionService.updateExtension(args.extensionID, {
|
|
146
|
-
installed: true
|
|
147
|
-
});
|
|
148
|
-
},
|
|
149
|
-
async uninstallExtension(root, args, ctx) {
|
|
150
|
-
const extension = await ctx.registryExtensionService.findExtension(args.extensionID);
|
|
151
|
-
if (!extension) {
|
|
152
|
-
throw new Error(`Extension ${args.extensionID} not found`);
|
|
153
|
-
}
|
|
154
|
-
return ctx.registryExtensionService.updateExtension(args.extensionID, {
|
|
155
|
-
installed: false
|
|
156
|
-
});
|
|
157
|
-
},
|
|
158
|
-
async publishExtension(root, args, ctx) {
|
|
159
|
-
const extension = await ctx.registryExtensionService.publishExtension({
|
|
160
|
-
...args
|
|
161
|
-
});
|
|
162
|
-
return {
|
|
163
|
-
extension
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});export{resolver};//# sourceMappingURL=resolvers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
extend type Mutation {
|
|
2
|
-
"""Install an extension in the registry."""
|
|
3
|
-
installExtension(extensionID: String!): RegistryExtension!
|
|
4
|
-
|
|
5
|
-
"""Uninstall an extension from the registry."""
|
|
6
|
-
uninstallExtension(extensionID: String!): RegistryExtension!
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
type RegistryExtension implements Node {
|
|
10
|
-
"""The unique, opaque, permanent ID of the extension."""
|
|
11
|
-
id: ID!
|
|
12
|
-
|
|
13
|
-
"""The UUID of the extension."""
|
|
14
|
-
uuid: String!
|
|
15
|
-
|
|
16
|
-
"""The publisher of the extension."""
|
|
17
|
-
publisher: RegistryPublisher
|
|
18
|
-
|
|
19
|
-
"""The qualified, unique name that refers to this extension."""
|
|
20
|
-
extensionID: String
|
|
21
|
-
|
|
22
|
-
"""The extension ID without the registry name."""
|
|
23
|
-
extensionIDWithoutRegistry: String
|
|
24
|
-
|
|
25
|
-
"""The name of the extension."""
|
|
26
|
-
name: String!
|
|
27
|
-
|
|
28
|
-
"""Latest Published version."""
|
|
29
|
-
version: String
|
|
30
|
-
|
|
31
|
-
"""The activation events for this extension."""
|
|
32
|
-
activationEvents: [String!]
|
|
33
|
-
|
|
34
|
-
"""The extension manifest."""
|
|
35
|
-
manifest: ExtensionManifest
|
|
36
|
-
|
|
37
|
-
"""The date when this extension was last updated on the registry."""
|
|
38
|
-
updatedAt: String
|
|
39
|
-
|
|
40
|
-
"""The URL to the extension on this CDECode site."""
|
|
41
|
-
url: String
|
|
42
|
-
|
|
43
|
-
"""The URL to the extension on the extension registry where it lives."""
|
|
44
|
-
remoteURL: String
|
|
45
|
-
|
|
46
|
-
"""Whether the registry extension is published on this CDECode site."""
|
|
47
|
-
isLocal: Boolean
|
|
48
|
-
|
|
49
|
-
"""Whether the viewer has admin privileges on this registry extension."""
|
|
50
|
-
viewerCanAdminister: Boolean
|
|
51
|
-
|
|
52
|
-
"""Extension Releases."""
|
|
53
|
-
releases: [ExtensionRelease!]
|
|
54
|
-
|
|
55
|
-
"""Whether the extension is installed."""
|
|
56
|
-
installed: Boolean
|
|
57
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var extensionSchema = "extend type Mutation {\n \"\"\"Install an extension in the registry.\"\"\"\n installExtension(extensionID: String!): RegistryExtension!\n\n \"\"\"Uninstall an extension from the registry.\"\"\"\n uninstallExtension(extensionID: String!): RegistryExtension!\n}\n\ntype RegistryExtension implements Node {\n \"\"\"The unique, opaque, permanent ID of the extension.\"\"\"\n id: ID!\n\n \"\"\"The UUID of the extension.\"\"\"\n uuid: String!\n\n \"\"\"The publisher of the extension.\"\"\"\n publisher: RegistryPublisher\n\n \"\"\"The qualified, unique name that refers to this extension.\"\"\"\n extensionID: String\n\n \"\"\"The extension ID without the registry name.\"\"\"\n extensionIDWithoutRegistry: String\n\n \"\"\"The name of the extension.\"\"\"\n name: String!\n\n \"\"\"Latest Published version.\"\"\"\n version: String\n\n \"\"\"The activation events for this extension.\"\"\"\n activationEvents: [String!]\n\n \"\"\"The extension manifest.\"\"\"\n manifest: ExtensionManifest\n\n \"\"\"The date when this extension was last updated on the registry.\"\"\"\n updatedAt: String\n\n \"\"\"The URL to the extension on this CDECode site.\"\"\"\n url: String\n\n \"\"\"The URL to the extension on the extension registry where it lives.\"\"\"\n remoteURL: String\n\n \"\"\"Whether the registry extension is published on this CDECode site.\"\"\"\n isLocal: Boolean\n\n \"\"\"Whether the viewer has admin privileges on this registry extension.\"\"\"\n viewerCanAdminister: Boolean\n\n \"\"\"Extension Releases.\"\"\"\n releases: [ExtensionRelease!]\n\n \"\"\"Whether the extension is installed.\"\"\"\n installed: Boolean\n}\n";export{extensionSchema as default};//# sourceMappingURL=extension.graphql.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.graphql.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { CdmLogger } from '@cdm-logger/core';
|
|
2
|
-
import { IRegistryExtensionService, IRegistryExtensionRepository } from 'common/server';
|
|
3
|
-
export declare class RegistryExtensionService implements IRegistryExtensionService {
|
|
4
|
-
private extensionRepository;
|
|
5
|
-
private logger;
|
|
6
|
-
constructor(extensionRepository: IRegistryExtensionRepository, logger: CdmLogger.ILogger);
|
|
7
|
-
createExtension(publisherId: string, name: string): Promise<import("common").INode & {
|
|
8
|
-
__typename?: "RegistryExtension";
|
|
9
|
-
activationEvents?: import("common").Maybe<Array<import("common").Maybe<import("common").Scalars["String"]["output"]>>>;
|
|
10
|
-
extensionID?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
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: {
|
|
28
|
-
installed?: boolean;
|
|
29
|
-
}): Promise<import("common").INode & {
|
|
30
|
-
__typename?: "RegistryExtension";
|
|
31
|
-
activationEvents?: import("common").Maybe<Array<import("common").Maybe<import("common").Scalars["String"]["output"]>>>;
|
|
32
|
-
extensionID?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
33
|
-
extensionIDWithoutRegistry?: import("common").Maybe<import("common").Scalars["String"]["output"]>;
|
|
34
|
-
id: import("common").Scalars["ID"]["output"];
|
|
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>;
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=extension-service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension-service.d.ts","sourceRoot":"","sources":["../../src/services/extension-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAgB,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAEtG,qBACa,wBAAyB,YAAW,yBAAyB;IAKlE,OAAO,CAAC,mBAAmB;IAJ/B,OAAO,CAAC,MAAM,CAAoB;gBAItB,mBAAmB,EAAE,4BAA4B,EAGzD,MAAM,EAAE,SAAS,CAAC,OAAO;IAKhB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;+EA4Cw4ta,kCAAiB;6CAA4G,kCAAiB;4DAA2G,kCAAiB;YAAkF,8BAAc;2CAAiF,mCAAkB;yCAA8G,mCAAkB;;cAAyI,kCAAkB;;;2CAA4R,kCAAiB;2CAA6G,kCAAiB;qCAAuF,kCAAiB;cAA4D,kCAAkB;yCAAqE,kCAAiB;qDAA4H,mCAAkB;;IAxCt+wa,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAIrD,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;;+EAoCq3ta,kCAAiB;6CAA4G,kCAAiB;4DAA2G,kCAAiB;YAAkF,8BAAc;2CAAiF,mCAAkB;yCAA8G,mCAAkB;;cAAyI,kCAAkB;;;2CAA4R,kCAAiB;2CAA6G,kCAAiB;qCAAuF,kCAAiB;cAA4D,kCAAkB;yCAAqE,kCAAiB;qDAA4H,mCAAkB;;IA3Bt+wa,iBAAiB,CAAC,WAAW,EAAE,MAAM;IAKrC,eAAe,CAAC,WAAW,EAAE,MAAM;IAInC,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,WAAW,EAAE,MAAM;CAGjD"}
|
|
@@ -1,42 +0,0 @@
|
|
|
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 {
|
|
3
|
-
extensionRepository;
|
|
4
|
-
logger;
|
|
5
|
-
constructor(extensionRepository, logger) {
|
|
6
|
-
this.extensionRepository = extensionRepository;
|
|
7
|
-
this.logger = logger.child({
|
|
8
|
-
className: RegistryExtensionService_1.name
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
async createExtension(publisherId, name) {
|
|
12
|
-
return this.extensionRepository.createExtension(publisherId, name);
|
|
13
|
-
}
|
|
14
|
-
async updateExtensionName(extensionID, name) {
|
|
15
|
-
return this.extensionRepository.updateExtensionName(extensionID, name);
|
|
16
|
-
}
|
|
17
|
-
async updateExtension(extensionID, update) {
|
|
18
|
-
const extension = await this.findExtension(extensionID);
|
|
19
|
-
if (!extension) {
|
|
20
|
-
throw new Error(`Extension ${extensionID} not found`);
|
|
21
|
-
}
|
|
22
|
-
return this.extensionRepository.updateExtension(extensionID, update);
|
|
23
|
-
}
|
|
24
|
-
// TODO: Add method to interface
|
|
25
|
-
async extensionReleases(extensionID) {
|
|
26
|
-
this.logger.debug(`Fetching releases for ${extensionID}`);
|
|
27
|
-
return this.extensionRepository.extensionReleases(extensionID);
|
|
28
|
-
}
|
|
29
|
-
async deleteExtension(extensionID) {
|
|
30
|
-
return this.extensionRepository.deleteExtension(extensionID);
|
|
31
|
-
}
|
|
32
|
-
async publishExtension(request) {
|
|
33
|
-
return this.extensionRepository.publishExtension(request);
|
|
34
|
-
}
|
|
35
|
-
async findExtensions(first, query, local, remote, prioritizeExtensionIDs) {
|
|
36
|
-
return this.extensionRepository.findExtensions(first, query, local, remote, prioritizeExtensionIDs);
|
|
37
|
-
}
|
|
38
|
-
async findExtension(extensionID) {
|
|
39
|
-
return this.extensionRepository.findExtension(extensionID);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension-service.js","sources":["../../src/services/extension-service.ts"],"sourcesContent":[null],"names":[],"mappings":"8JACA,IAAA;AASgB,IAAA,wBAAA,GAAA,0BAAiD,GAAA,MAAA,wBAGhC,CAAA;AAKhB,EAAA,mBAA2B;;;kDA4C4iua;;eAA4N,EAAA,0BAAA,CAAA;;;;eAA8X,CAAA,mBAAA,CAAA,eAAA,CAAA,WAAA,EAAA,IAAA,CAAA;;;uDAA6S,CAAA,WAAA,EAAA,IAAA,CAAA;;qCAAqN,MAAiB,EAAA;mBAA8E,GAAA,MAAA,IAAA,CAAA,aAAA,CAAA,WAAA,CAAA;;yDAAoO,CAAA,CAAA;;AAxCt+wa,IAAA,OAAA,IAAA,CAAA,mBAA+B,CAAA,eAAgB,CAAM,WAAA,EAAA,MAAA,CAAA;AAIrD;;AAAoE,EAAA,MAAA,iBAAA,CAAA,WAAA,EAAA;;;;;eAoC+tua,CAAA,mBAAA,CAAA,eAAA,CAAA,WAAA,CAAA;;;;;;;;;iDAAi5B,CAAA,WAAA,CAAA;;;qDAAgS,GAAkB,UAAA,CAAA,CAAA,UAAA,EAAA,EAAA,OAAA,CAAA,CAAA,EAAA,MAAA,CAAA,YAAA,CAAA,4BAAA,CAAA,CAAA,EAAA,OAAA,CAAA,CAAA,EAAA,MAAA,CAAA,QAAA,CAAA,CAAA,EAAA,UAAA,CAAA,mBAAA,EAAA,CAAA,MAAA,EAAA,MAAA,CAAA,CAAA,CAAA,EAAA,wBAAA,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Model, Document, Connection } from 'mongoose';
|
|
2
|
-
import { IRegistryExtension as IRegistryExtensionRecord } from 'common/server';
|
|
3
|
-
export interface IRegistryExtensionModel extends Document, IRegistryExtensionRecord {
|
|
4
|
-
id: any;
|
|
5
|
-
type: string;
|
|
6
|
-
publisherId: string;
|
|
7
|
-
}
|
|
8
|
-
export type RegistryExtensionModelType = Model<IRegistryExtensionModel>;
|
|
9
|
-
export declare const RegistryExtensionModelFunc: (db: Connection) => RegistryExtensionModelType;
|
|
10
|
-
//# sourceMappingURL=registry-extension-model.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry-extension-model.d.ts","sourceRoot":"","sources":["../../../src/store/models/registry-extension-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,EAAE,QAAQ,EAAY,UAAU,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAG/E,MAAM,WAAW,uBAAwB,SAAQ,QAAQ,EAAE,wBAAwB;IAC/E,EAAE,EAAE,GAAG,CAAC;IACR,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACvB;AAuDD,MAAM,MAAM,0BAA0B,GAAG,KAAK,CAAC,uBAAuB,CAAC,CAAC;AACxE,eAAO,MAAM,0BAA0B,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,0BACc,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import {find}from'lodash-es';import {Schema}from'mongoose';import {customAlphabet}from'nanoid';const createRandom = customAlphabet('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 15);
|
|
2
|
-
const RegistryExtensionReleaseSchema = new Schema({
|
|
3
|
-
creatorUserId: {
|
|
4
|
-
type: String
|
|
5
|
-
},
|
|
6
|
-
releaseVersion: {
|
|
7
|
-
type: String
|
|
8
|
-
},
|
|
9
|
-
extensionID: String,
|
|
10
|
-
activationEvents: [String],
|
|
11
|
-
type: String,
|
|
12
|
-
manifest: {
|
|
13
|
-
type: String
|
|
14
|
-
},
|
|
15
|
-
version: {
|
|
16
|
-
type: String
|
|
17
|
-
},
|
|
18
|
-
bundle: {
|
|
19
|
-
type: String
|
|
20
|
-
},
|
|
21
|
-
sourceMap: {
|
|
22
|
-
type: String
|
|
23
|
-
}
|
|
24
|
-
}, {
|
|
25
|
-
strict: false
|
|
26
|
-
});
|
|
27
|
-
const RegistryExtensionSchema = new Schema({
|
|
28
|
-
type: String,
|
|
29
|
-
version: String,
|
|
30
|
-
extensionID: String,
|
|
31
|
-
publisherId: String,
|
|
32
|
-
activationEvents: [String],
|
|
33
|
-
uuid: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: () => createRandom()
|
|
36
|
-
},
|
|
37
|
-
name: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: () => createRandom()
|
|
40
|
-
},
|
|
41
|
-
releases: [{
|
|
42
|
-
type: RegistryExtensionReleaseSchema
|
|
43
|
-
}]
|
|
44
|
-
}, {
|
|
45
|
-
strict: false
|
|
46
|
-
});
|
|
47
|
-
RegistryExtensionSchema.virtual('manifest').get(function () {
|
|
48
|
-
const release = find(this.releases, {
|
|
49
|
-
version: this.version
|
|
50
|
-
});
|
|
51
|
-
return release.manifest || {};
|
|
52
|
-
});
|
|
53
|
-
RegistryExtensionSchema.virtual('id').get(function () {
|
|
54
|
-
return this._id.toHexString();
|
|
55
|
-
});
|
|
56
|
-
RegistryExtensionSchema.set('toJSON', {
|
|
57
|
-
virtuals: true
|
|
58
|
-
});
|
|
59
|
-
RegistryExtensionSchema.set('toObject', {
|
|
60
|
-
virtuals: true
|
|
61
|
-
});
|
|
62
|
-
const RegistryExtensionModelFunc = db => db.model('extension', RegistryExtensionSchema);export{RegistryExtensionModelFunc};//# sourceMappingURL=registry-extension-model.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry-extension-model.js","sources":["../../../src/store/models/registry-extension-model.ts"],"sourcesContent":[null],"names":[],"mappings":"qGAMM,YAAM,GAAA,cAAA,CAAA,gEAAA,EAAA,EAAA,CAAA;MACJ,8BAAS,GAAA,IAAA,MAAA,CAAA;eACF,EAAE;AAChB,IAAA,IAAA,EAAA;AAuDD,GAAA;AACA,EAAO,cAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/store/repository/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
|