@adminide-stack/marketplace-module-server 12.0.4-alpha.106 → 12.0.4-alpha.108
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/lib/store/repositories/registry-extension-repository.d.ts +7 -43
- package/lib/store/repositories/registry-extension-repository.d.ts.map +1 -1
- package/lib/store/repositories/registry-extension-repository.js +12 -10
- package/lib/store/repositories/registry-extension-repository.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,54 +1,18 @@
|
|
|
1
1
|
import * as mongoose from 'mongoose';
|
|
2
2
|
import { CdmLogger } from '@cdm-logger/core';
|
|
3
|
-
import { IExtensionRelease, IRegistryExtensionRepository, IRegistryExtensionModel, AsDomainType } from 'common/server';
|
|
3
|
+
import { IExtensionRelease, IRegistryExtensionRepository, IRegistryExtensionModel, AsDomainType, IPublishRequest } from 'common/server';
|
|
4
4
|
import { BaseMongoRepository } from '@common-stack/store-mongo';
|
|
5
5
|
export declare class RegistryExtensionRepository extends BaseMongoRepository<IRegistryExtensionModel> implements IRegistryExtensionRepository {
|
|
6
6
|
constructor(db: mongoose.Connection, logger: CdmLogger.ILogger, options?: any);
|
|
7
|
-
createExtension(publisherId: string, name: string): Promise<
|
|
8
|
-
|
|
9
|
-
}> & Omit<IRegistryExtensionModel & {
|
|
10
|
-
id: string;
|
|
11
|
-
} & Required<{
|
|
12
|
-
_id: import("bson").ObjectID;
|
|
13
|
-
}>, never>>;
|
|
14
|
-
updateExtensionName(extensionSlug: string, name: string): Promise<mongoose.Document<unknown, any, IRegistryExtensionModel & {
|
|
15
|
-
id: string;
|
|
16
|
-
}> & Omit<IRegistryExtensionModel & {
|
|
17
|
-
id: string;
|
|
18
|
-
} & Required<{
|
|
19
|
-
_id: import("bson").ObjectID;
|
|
20
|
-
}>, never>>;
|
|
7
|
+
createExtension(publisherId: string, name: string): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
8
|
+
updateExtensionName(extensionSlug: string, name: string): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
21
9
|
updateExtension(extensionSlug: string, update: {
|
|
22
10
|
installed?: boolean;
|
|
23
|
-
}): Promise<
|
|
24
|
-
id: string;
|
|
25
|
-
}> & Omit<IRegistryExtensionModel & {
|
|
26
|
-
id: string;
|
|
27
|
-
} & Required<{
|
|
28
|
-
_id: import("bson").ObjectID;
|
|
29
|
-
}>, never>>;
|
|
11
|
+
}): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
30
12
|
deleteExtension(extensionSlug: any): Promise<boolean>;
|
|
31
13
|
extensionReleases(extensionSlug: string): Promise<AsDomainType<IExtensionRelease>[]>;
|
|
32
|
-
publishExtension(request:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
id: string;
|
|
36
|
-
} & Required<{
|
|
37
|
-
_id: import("bson").ObjectID;
|
|
38
|
-
}>, never>>;
|
|
39
|
-
findExtensions(first: number, query: string, local?: boolean, remote?: boolean, prioritizeExtensionIDs?: string[]): Promise<(mongoose.Document<unknown, any, IRegistryExtensionModel & {
|
|
40
|
-
id: string;
|
|
41
|
-
}> & Omit<IRegistryExtensionModel & {
|
|
42
|
-
id: string;
|
|
43
|
-
} & Required<{
|
|
44
|
-
_id: import("bson").ObjectID;
|
|
45
|
-
}>, never>)[]>;
|
|
46
|
-
findExtension(extensionSlug: string, version?: string): Promise<mongoose.Document<unknown, any, IRegistryExtensionModel & {
|
|
47
|
-
id: string;
|
|
48
|
-
}> & Omit<IRegistryExtensionModel & {
|
|
49
|
-
id: string;
|
|
50
|
-
} & Required<{
|
|
51
|
-
_id: import("bson").ObjectID;
|
|
52
|
-
}>, never>>;
|
|
14
|
+
publishExtension(request: IPublishRequest): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
15
|
+
findExtensions(first: number, query: string, local?: boolean, remote?: boolean, prioritizeExtensionIDs?: string[]): Promise<AsDomainType<IRegistryExtensionModel>[]>;
|
|
16
|
+
findExtension(extensionSlug: string): Promise<AsDomainType<IRegistryExtensionModel>>;
|
|
53
17
|
}
|
|
54
18
|
//# sourceMappingURL=registry-extension-repository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-extension-repository.d.ts","sourceRoot":"","sources":["../../../src/store/repositories/registry-extension-repository.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"registry-extension-repository.d.ts","sourceRoot":"","sources":["../../../src/store/repositories/registry-extension-repository.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACH,iBAAiB,EACjB,4BAA4B,EAC5B,uBAAuB,EACvB,YAAY,EACZ,eAAe,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,qBACa,2BACT,SAAQ,mBAAmB,CAAC,uBAAuB,CACnD,YAAW,4BAA4B;gBAGN,EAAE,EAAE,QAAQ,CAAC,UAAU,EAClC,MAAM,EAAE,SAAS,CAAC,OAAO,EACP,OAAO,CAAC,EAAE,GAAG;IASxC,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAcjD,mBAAmB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAOvD,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;IAOtE,eAAe,CAAC,aAAa,KAAA;IAW7B,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAMpF,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;IA2D1F,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,GAClC,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,EAAE,CAAC;IAKtC,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;CAMpG"}
|
|
@@ -19,7 +19,7 @@ let RegistryExtensionRepository = RegistryExtensionRepository_1 = class Registry
|
|
|
19
19
|
releases: null,
|
|
20
20
|
extensionSlug: ''
|
|
21
21
|
});
|
|
22
|
-
return result;
|
|
22
|
+
return result.toObject();
|
|
23
23
|
}
|
|
24
24
|
async updateExtensionName(extensionSlug, name) {
|
|
25
25
|
this.logger.trace('updateExtensionName with extension [%s], name [%s]', extensionSlug, name);
|
|
@@ -32,9 +32,10 @@ let RegistryExtensionRepository = RegistryExtensionRepository_1 = class Registry
|
|
|
32
32
|
}, {
|
|
33
33
|
upsert: true
|
|
34
34
|
});
|
|
35
|
-
|
|
35
|
+
const result = await this.model.findOne({
|
|
36
36
|
extensionSlug
|
|
37
37
|
}).exec();
|
|
38
|
+
return result?.toObject();
|
|
38
39
|
}
|
|
39
40
|
async updateExtension(extensionSlug, update) {
|
|
40
41
|
this.logger.trace('updateExtension with extension [%s], update [%j]', extensionSlug, update);
|
|
@@ -45,9 +46,10 @@ let RegistryExtensionRepository = RegistryExtensionRepository_1 = class Registry
|
|
|
45
46
|
}, {
|
|
46
47
|
upsert: true
|
|
47
48
|
});
|
|
48
|
-
|
|
49
|
+
const result = await this.model.findOne({
|
|
49
50
|
extensionSlug
|
|
50
51
|
}).exec();
|
|
52
|
+
return result?.toObject();
|
|
51
53
|
}
|
|
52
54
|
async deleteExtension(extensionSlug) {
|
|
53
55
|
try {
|
|
@@ -113,25 +115,25 @@ let RegistryExtensionRepository = RegistryExtensionRepository_1 = class Registry
|
|
|
113
115
|
upsert: true
|
|
114
116
|
});
|
|
115
117
|
}
|
|
116
|
-
|
|
118
|
+
const result = await this.model.findOne({
|
|
117
119
|
extensionSlug: request.extensionSlug
|
|
118
120
|
}).exec();
|
|
121
|
+
return result?.toObject();
|
|
119
122
|
} catch (err) {
|
|
120
123
|
this.logger.error(err, 'publishExtension was failed for request [%j] with error[%o]', request);
|
|
121
124
|
throw new Error('Extension publish was failed');
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
127
|
async findExtensions(first, query, local, remote, prioritizeExtensionIDs) {
|
|
125
|
-
|
|
128
|
+
const results = await this.model.find({}).exec();
|
|
129
|
+
return results.map(result => result.toObject());
|
|
126
130
|
}
|
|
127
|
-
async findExtension(extensionSlug
|
|
131
|
+
async findExtension(extensionSlug) {
|
|
128
132
|
const q = {
|
|
129
133
|
extensionSlug
|
|
130
134
|
};
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
return this.model.findOne(q);
|
|
135
|
+
const result = await this.model.findOne(q).exec();
|
|
136
|
+
return result?.toObject();
|
|
135
137
|
}
|
|
136
138
|
};
|
|
137
139
|
RegistryExtensionRepository = RegistryExtensionRepository_1 = __decorate([injectable(), __param(0, inject('MongoDBConnection')), __param(1, inject('Logger')), __param(2, inject('MongoOptions')), __param(2, optional()), __metadata("design:paramtypes", [mongoose.Connection, Object, Object])], RegistryExtensionRepository);export{RegistryExtensionRepository};//# sourceMappingURL=registry-extension-repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-extension-repository.js","sources":["../../../src/store/repositories/registry-extension-repository.ts"],"sourcesContent":[null],"names":[],"mappings":"0YAGA,IAAA,6BAA0B
|
|
1
|
+
{"version":3,"file":"registry-extension-repository.js","sources":["../../../src/store/repositories/registry-extension-repository.ts"],"sourcesContent":[null],"names":[],"mappings":"0YAGA,IAAA,6BAA0B;+BAkD2D,GAAA,6BAAA,GAAA,MAAA,2BAAA,SAAA,mBAAA,CAAA;AAAE,EAAA,WAAA,CAAA,EAAA,EAAA,MAAA,EAAA,OAAA,EAAA;IAOtE,KAAe,CAAA,0BAAc,EAAA,EAAA,EAAA,MAAA,EAAA,OAAA,CAAA;AAW7B,IAAA,IAAA,CAAA,EAAA,EAAA;MAMgB,MAAA,IAAA,KAAC,CAAO,oCAAwC,CAAA;AA2DhE;IAWA,IAAa,CAAA,MAAA,GAAC,MAAa,CAAA,KAAA,CAAA;AAM3C,MAAA,SAAA,EAAA,6BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
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.108",
|
|
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.108",
|
|
25
25
|
"nanoid": "^5.1.5"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"common": "12.0.4-alpha.
|
|
28
|
+
"common": "12.0.4-alpha.108"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"graphql-tag": ">=2.0.0"
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"typescript": {
|
|
55
55
|
"definition": "lib/index.d.ts"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "c073a5b9d3df35dc18af6f5b1177d48461285e15"
|
|
58
58
|
}
|