@things-factory/operato-codelingua 9.0.0-beta.26 → 9.0.0-beta.27
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/package.json +9 -6
- package/dist-client/bootstrap.d.ts +0 -8
- package/dist-client/bootstrap.js +0 -179
- package/dist-client/bootstrap.js.map +0 -1
- package/dist-client/icons/menu-icons.d.ts +0 -5
- package/dist-client/icons/menu-icons.js +0 -84
- package/dist-client/icons/menu-icons.js.map +0 -1
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +0 -2
- package/dist-client/index.js.map +0 -1
- package/dist-client/pages/git-project/git-project-list-page.d.ts +0 -55
- package/dist-client/pages/git-project/git-project-list-page.js +0 -406
- package/dist-client/pages/git-project/git-project-list-page.js.map +0 -1
- package/dist-client/route.d.ts +0 -1
- package/dist-client/route.js +0 -8
- package/dist-client/route.js.map +0 -1
- package/dist-client/themes/dark.css +0 -51
- package/dist-client/themes/light.css +0 -51
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-client/viewparts/menu-tools.d.ts +0 -17
- package/dist-client/viewparts/menu-tools.js +0 -172
- package/dist-client/viewparts/menu-tools.js.map +0 -1
- package/dist-client/viewparts/user-circle.d.ts +0 -5
- package/dist-client/viewparts/user-circle.js +0 -26
- package/dist-client/viewparts/user-circle.js.map +0 -1
- package/dist-server/controllers/github-controller.d.ts +0 -3
- package/dist-server/controllers/github-controller.js +0 -85
- package/dist-server/controllers/github-controller.js.map +0 -1
- package/dist-server/controllers/index.d.ts +0 -0
- package/dist-server/controllers/index.js +0 -1
- package/dist-server/controllers/index.js.map +0 -1
- package/dist-server/index.d.ts +0 -4
- package/dist-server/index.js +0 -9
- package/dist-server/index.js.map +0 -1
- package/dist-server/middlewares/index.d.ts +0 -1
- package/dist-server/middlewares/index.js +0 -7
- package/dist-server/middlewares/index.js.map +0 -1
- package/dist-server/migrations/index.d.ts +0 -1
- package/dist-server/migrations/index.js +0 -12
- package/dist-server/migrations/index.js.map +0 -1
- package/dist-server/routers/github-webhook-router.d.ts +0 -1
- package/dist-server/routers/github-webhook-router.js +0 -37
- package/dist-server/routers/github-webhook-router.js.map +0 -1
- package/dist-server/routes.d.ts +0 -1
- package/dist-server/routes.js +0 -28
- package/dist-server/routes.js.map +0 -1
- package/dist-server/service/git-project/git-project-mutation.d.ts +0 -12
- package/dist-server/service/git-project/git-project-mutation.js +0 -170
- package/dist-server/service/git-project/git-project-mutation.js.map +0 -1
- package/dist-server/service/git-project/git-project-query.d.ts +0 -11
- package/dist-server/service/git-project/git-project-query.js +0 -79
- package/dist-server/service/git-project/git-project-query.js.map +0 -1
- package/dist-server/service/git-project/git-project-type.d.ts +0 -27
- package/dist-server/service/git-project/git-project-type.js +0 -105
- package/dist-server/service/git-project/git-project-type.js.map +0 -1
- package/dist-server/service/git-project/git-project.d.ts +0 -34
- package/dist-server/service/git-project/git-project.js +0 -126
- package/dist-server/service/git-project/git-project.js.map +0 -1
- package/dist-server/service/git-project/index.d.ts +0 -6
- package/dist-server/service/git-project/index.js +0 -10
- package/dist-server/service/git-project/index.js.map +0 -1
- package/dist-server/service/index.d.ts +0 -5
- package/dist-server/service/index.js +0 -19
- package/dist-server/service/index.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GitProjectMutation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const typeorm_1 = require("typeorm");
|
|
7
|
-
const git_project_1 = require("./git-project");
|
|
8
|
-
const git_project_type_1 = require("./git-project-type");
|
|
9
|
-
const github_controller_1 = require("../../controllers/github-controller");
|
|
10
|
-
let GitProjectMutation = class GitProjectMutation {
|
|
11
|
-
async createGitProject(gitProject, context) {
|
|
12
|
-
const { domain, user, tx } = context.state;
|
|
13
|
-
const result = await tx.getRepository(git_project_1.GitProject).save(Object.assign(Object.assign({}, gitProject), { domain, creator: user, updater: user }));
|
|
14
|
-
return result;
|
|
15
|
-
}
|
|
16
|
-
async updateGitProject(id, patch, context) {
|
|
17
|
-
const { domain, user, tx } = context.state;
|
|
18
|
-
const repository = tx.getRepository(git_project_1.GitProject);
|
|
19
|
-
const gitProject = await repository.findOne({
|
|
20
|
-
where: { domain: { id: domain.id }, id }
|
|
21
|
-
});
|
|
22
|
-
const result = await repository.save(Object.assign(Object.assign(Object.assign({}, gitProject), patch), { updater: user }));
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
async updateMultipleGitProject(patches, context) {
|
|
26
|
-
const { domain, user, tx } = context.state;
|
|
27
|
-
let results = [];
|
|
28
|
-
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
29
|
-
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
30
|
-
const gitProjectRepo = tx.getRepository(git_project_1.GitProject);
|
|
31
|
-
if (_createRecords.length > 0) {
|
|
32
|
-
for (let i = 0; i < _createRecords.length; i++) {
|
|
33
|
-
const newRecord = _createRecords[i];
|
|
34
|
-
const result = await gitProjectRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
35
|
-
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (_updateRecords.length > 0) {
|
|
39
|
-
for (let i = 0; i < _updateRecords.length; i++) {
|
|
40
|
-
const updateRecord = _updateRecords[i];
|
|
41
|
-
const gitProject = await gitProjectRepo.findOneBy({ id: updateRecord.id });
|
|
42
|
-
const result = await gitProjectRepo.save(Object.assign(Object.assign(Object.assign({}, gitProject), updateRecord), { updater: user }));
|
|
43
|
-
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return results;
|
|
47
|
-
}
|
|
48
|
-
async deleteGitProject(id, context) {
|
|
49
|
-
const { domain, tx } = context.state;
|
|
50
|
-
await tx.getRepository(git_project_1.GitProject).delete({ domain: { id: domain.id }, id });
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
async deleteGitProjects(ids, context) {
|
|
54
|
-
const { domain, tx } = context.state;
|
|
55
|
-
await tx.getRepository(git_project_1.GitProject).delete({
|
|
56
|
-
domain: { id: domain.id },
|
|
57
|
-
id: (0, typeorm_1.In)(ids)
|
|
58
|
-
});
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
async importGitProjects(gitProjects, context) {
|
|
62
|
-
const { domain, tx } = context.state;
|
|
63
|
-
await Promise.all(gitProjects.map(async (gitProject) => {
|
|
64
|
-
const createdGitProject = await tx.getRepository(git_project_1.GitProject).save(Object.assign({ domain }, gitProject));
|
|
65
|
-
}));
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
async registerGithubWebhook(id, context) {
|
|
69
|
-
const { domain, tx } = context.state;
|
|
70
|
-
const repository = tx.getRepository(git_project_1.GitProject);
|
|
71
|
-
const gitProject = await repository.findOne({ where: { domain: { id: domain.id }, id } });
|
|
72
|
-
if (!gitProject) {
|
|
73
|
-
throw new Error('GitProject not found');
|
|
74
|
-
}
|
|
75
|
-
const webhook = await (0, github_controller_1.registerWebhook)(gitProject.apiKey, gitProject.name, gitProject.webhookUrl);
|
|
76
|
-
gitProject.state = git_project_1.GitProjectStatus.REGISTERED;
|
|
77
|
-
await repository.save(gitProject);
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
async unregisterGithubWebhook(id, context) {
|
|
81
|
-
const { domain, tx } = context.state;
|
|
82
|
-
const repository = tx.getRepository(git_project_1.GitProject);
|
|
83
|
-
const gitProject = await repository.findOne({ where: { domain: { id: domain.id }, id } });
|
|
84
|
-
if (!gitProject) {
|
|
85
|
-
throw new Error('GitProject not found');
|
|
86
|
-
}
|
|
87
|
-
await (0, github_controller_1.unregisterWebhook)(gitProject.apiKey, gitProject.name, gitProject.webhookUrl);
|
|
88
|
-
gitProject.state = git_project_1.GitProjectStatus.READY;
|
|
89
|
-
await repository.save(gitProject);
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
exports.GitProjectMutation = GitProjectMutation;
|
|
94
|
-
tslib_1.__decorate([
|
|
95
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
96
|
-
(0, type_graphql_1.Mutation)(returns => git_project_1.GitProject, { description: 'To create new GitProject' }),
|
|
97
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('gitProject')),
|
|
98
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
99
|
-
tslib_1.__metadata("design:type", Function),
|
|
100
|
-
tslib_1.__metadata("design:paramtypes", [git_project_type_1.NewGitProject, Object]),
|
|
101
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
102
|
-
], GitProjectMutation.prototype, "createGitProject", null);
|
|
103
|
-
tslib_1.__decorate([
|
|
104
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
105
|
-
(0, type_graphql_1.Mutation)(returns => git_project_1.GitProject, { description: 'To modify GitProject information' }),
|
|
106
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
107
|
-
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
108
|
-
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
109
|
-
tslib_1.__metadata("design:type", Function),
|
|
110
|
-
tslib_1.__metadata("design:paramtypes", [String, git_project_type_1.GitProjectPatch, Object]),
|
|
111
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
112
|
-
], GitProjectMutation.prototype, "updateGitProject", null);
|
|
113
|
-
tslib_1.__decorate([
|
|
114
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
115
|
-
(0, type_graphql_1.Mutation)(returns => [git_project_1.GitProject], { description: "To modify multiple GitProjects' information" }),
|
|
116
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [git_project_type_1.GitProjectPatch])),
|
|
117
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
118
|
-
tslib_1.__metadata("design:type", Function),
|
|
119
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
120
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
121
|
-
], GitProjectMutation.prototype, "updateMultipleGitProject", null);
|
|
122
|
-
tslib_1.__decorate([
|
|
123
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
124
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete GitProject' }),
|
|
125
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
126
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
127
|
-
tslib_1.__metadata("design:type", Function),
|
|
128
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
129
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
130
|
-
], GitProjectMutation.prototype, "deleteGitProject", null);
|
|
131
|
-
tslib_1.__decorate([
|
|
132
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
133
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple GitProjects' }),
|
|
134
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
135
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
136
|
-
tslib_1.__metadata("design:type", Function),
|
|
137
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
138
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
139
|
-
], GitProjectMutation.prototype, "deleteGitProjects", null);
|
|
140
|
-
tslib_1.__decorate([
|
|
141
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
142
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple GitProjects' }),
|
|
143
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('gitProjects', type => [git_project_type_1.GitProjectPatch])),
|
|
144
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
145
|
-
tslib_1.__metadata("design:type", Function),
|
|
146
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
147
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
148
|
-
], GitProjectMutation.prototype, "importGitProjects", null);
|
|
149
|
-
tslib_1.__decorate([
|
|
150
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
151
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To register GitHub webhook' }),
|
|
152
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
153
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
154
|
-
tslib_1.__metadata("design:type", Function),
|
|
155
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
156
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
157
|
-
], GitProjectMutation.prototype, "registerGithubWebhook", null);
|
|
158
|
-
tslib_1.__decorate([
|
|
159
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
160
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To unregister GitHub webhook' }),
|
|
161
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
162
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
163
|
-
tslib_1.__metadata("design:type", Function),
|
|
164
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
165
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
166
|
-
], GitProjectMutation.prototype, "unregisterGithubWebhook", null);
|
|
167
|
-
exports.GitProjectMutation = GitProjectMutation = tslib_1.__decorate([
|
|
168
|
-
(0, type_graphql_1.Resolver)(git_project_1.GitProject)
|
|
169
|
-
], GitProjectMutation);
|
|
170
|
-
//# sourceMappingURL=git-project-mutation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-project-mutation.js","sourceRoot":"","sources":["../../../server/service/git-project/git-project-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,+CAA4D;AAC5D,yDAAmE;AACnE,2EAAwF;AAGjF,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,gBAAgB,CACD,UAAyB,EACrC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAC,IAAI,iCACjD,UAAU,KACb,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CACT,EAAU,EACP,KAAsB,EAC7B,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAA;QAC/C,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,+CAC/B,UAAU,GACV,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,wBAAwB,CACe,OAA0B,EAC9D,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK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A,IAAA,kBAAG,GAAE,CAAA;;;;iEAgB1D;6BAzKU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CA0K9B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { GitProject, GitProjectStatus } from './git-project'\nimport { NewGitProject, GitProjectPatch } from './git-project-type'\nimport { registerWebhook, unregisterWebhook } from '../../controllers/github-controller'\n\n@Resolver(GitProject)\nexport class GitProjectMutation {\n @Directive('@transaction')\n @Mutation(returns => GitProject, { description: 'To create new GitProject' })\n async createGitProject(\n @Arg('gitProject') gitProject: NewGitProject,\n @Ctx() context: ResolverContext\n ): Promise<GitProject> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(GitProject).save({\n ...gitProject,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => GitProject, { description: 'To modify GitProject information' })\n async updateGitProject(\n @Arg('id') id: string,\n @Arg('patch') patch: GitProjectPatch,\n @Ctx() context: ResolverContext\n ): Promise<GitProject> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(GitProject)\n const gitProject = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...gitProject,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GitProject], { description: \"To modify multiple GitProjects' information\" })\n async updateMultipleGitProject(\n @Arg('patches', type => [GitProjectPatch]) patches: GitProjectPatch[],\n @Ctx() context: ResolverContext\n ): Promise<GitProject[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const gitProjectRepo = tx.getRepository(GitProject)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await gitProjectRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const gitProject = await gitProjectRepo.findOneBy({ id: updateRecord.id })\n\n const result = await gitProjectRepo.save({\n ...gitProject,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete GitProject' })\n async deleteGitProject(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(GitProject).delete({ domain: { id: domain.id }, id })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple GitProjects' })\n async deleteGitProjects(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(GitProject).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple GitProjects' })\n async importGitProjects(\n @Arg('gitProjects', type => [GitProjectPatch]) gitProjects: GitProjectPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n gitProjects.map(async (gitProject: GitProjectPatch) => {\n const createdGitProject: GitProject = await tx.getRepository(GitProject).save({ domain, ...gitProject })\n })\n )\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To register GitHub webhook' })\n async registerGithubWebhook(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n const repository = tx.getRepository(GitProject)\n const gitProject = await repository.findOne({ where: { domain: { id: domain.id }, id } })\n\n if (!gitProject) {\n throw new Error('GitProject not found')\n }\n\n const webhook = await registerWebhook(gitProject.apiKey, gitProject.name, gitProject.webhookUrl)\n\n gitProject.state = GitProjectStatus.REGISTERED\n await repository.save(gitProject)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To unregister GitHub webhook' })\n async unregisterGithubWebhook(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n const repository = tx.getRepository(GitProject)\n const gitProject = await repository.findOne({ where: { domain: { id: domain.id }, id } })\n\n if (!gitProject) {\n throw new Error('GitProject not found')\n }\n\n await unregisterWebhook(gitProject.apiKey, gitProject.name, gitProject.webhookUrl)\n\n gitProject.state = GitProjectStatus.READY\n await repository.save(gitProject)\n\n return true\n }\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Domain, ListParam } from '@things-factory/shell';
|
|
2
|
-
import { User } from '@things-factory/auth-base';
|
|
3
|
-
import { GitProject } from './git-project';
|
|
4
|
-
import { GitProjectList } from './git-project-type';
|
|
5
|
-
export declare class GitProjectQuery {
|
|
6
|
-
gitProject(id: string, context: ResolverContext): Promise<GitProject>;
|
|
7
|
-
gitProjects(params: ListParam, context: ResolverContext): Promise<GitProjectList>;
|
|
8
|
-
domain(gitProject: GitProject): Promise<Domain>;
|
|
9
|
-
updater(gitProject: GitProject): Promise<User>;
|
|
10
|
-
creator(gitProject: GitProject): Promise<User>;
|
|
11
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GitProjectQuery = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const shell_1 = require("@things-factory/shell");
|
|
7
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
-
const git_project_1 = require("./git-project");
|
|
9
|
-
const git_project_type_1 = require("./git-project-type");
|
|
10
|
-
let GitProjectQuery = class GitProjectQuery {
|
|
11
|
-
async gitProject(id, context) {
|
|
12
|
-
const { domain } = context.state;
|
|
13
|
-
return await (0, shell_1.getRepository)(git_project_1.GitProject).findOne({
|
|
14
|
-
where: { domain: { id: domain.id }, id }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
async gitProjects(params, context) {
|
|
18
|
-
const { domain } = context.state;
|
|
19
|
-
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
20
|
-
domain,
|
|
21
|
-
params,
|
|
22
|
-
repository: await (0, shell_1.getRepository)(git_project_1.GitProject),
|
|
23
|
-
searchables: ['name', 'description']
|
|
24
|
-
});
|
|
25
|
-
const [items, total] = await queryBuilder.getManyAndCount();
|
|
26
|
-
return { items, total };
|
|
27
|
-
}
|
|
28
|
-
async domain(gitProject) {
|
|
29
|
-
return gitProject.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: gitProject.domainId }));
|
|
30
|
-
}
|
|
31
|
-
async updater(gitProject) {
|
|
32
|
-
return gitProject.updaterId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: gitProject.updaterId }));
|
|
33
|
-
}
|
|
34
|
-
async creator(gitProject) {
|
|
35
|
-
return gitProject.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: gitProject.creatorId }));
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.GitProjectQuery = GitProjectQuery;
|
|
39
|
-
tslib_1.__decorate([
|
|
40
|
-
(0, type_graphql_1.Query)(returns => git_project_1.GitProject, { nullable: true, description: 'To fetch a GitProject' }),
|
|
41
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
42
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
43
|
-
tslib_1.__metadata("design:type", Function),
|
|
44
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
45
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
46
|
-
], GitProjectQuery.prototype, "gitProject", null);
|
|
47
|
-
tslib_1.__decorate([
|
|
48
|
-
(0, type_graphql_1.Query)(returns => git_project_type_1.GitProjectList, { description: 'To fetch multiple GitProjects' }),
|
|
49
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
|
50
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
51
|
-
tslib_1.__metadata("design:type", Function),
|
|
52
|
-
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
53
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
54
|
-
], GitProjectQuery.prototype, "gitProjects", null);
|
|
55
|
-
tslib_1.__decorate([
|
|
56
|
-
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
57
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
58
|
-
tslib_1.__metadata("design:type", Function),
|
|
59
|
-
tslib_1.__metadata("design:paramtypes", [git_project_1.GitProject]),
|
|
60
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
61
|
-
], GitProjectQuery.prototype, "domain", null);
|
|
62
|
-
tslib_1.__decorate([
|
|
63
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
64
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
65
|
-
tslib_1.__metadata("design:type", Function),
|
|
66
|
-
tslib_1.__metadata("design:paramtypes", [git_project_1.GitProject]),
|
|
67
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
68
|
-
], GitProjectQuery.prototype, "updater", null);
|
|
69
|
-
tslib_1.__decorate([
|
|
70
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
71
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
72
|
-
tslib_1.__metadata("design:type", Function),
|
|
73
|
-
tslib_1.__metadata("design:paramtypes", [git_project_1.GitProject]),
|
|
74
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
75
|
-
], GitProjectQuery.prototype, "creator", null);
|
|
76
|
-
exports.GitProjectQuery = GitProjectQuery = tslib_1.__decorate([
|
|
77
|
-
(0, type_graphql_1.Resolver)(git_project_1.GitProject)
|
|
78
|
-
], GitProjectQuery);
|
|
79
|
-
//# sourceMappingURL=git-project-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-project-query.js","sourceRoot":"","sources":["../../../server/service/git-project/git-project-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAwB;QACrE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CAA0B,MAAiB,EAAS,OAAwB;QAC3F,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC;YAC3C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,UAAsB;QACzC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C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;0BAvCU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAwC3B","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { GitProject } from './git-project'\nimport { GitProjectList } from './git-project-type'\n\n@Resolver(GitProject)\nexport class GitProjectQuery {\n @Query(returns => GitProject!, { nullable: true, description: 'To fetch a GitProject' })\n async gitProject(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<GitProject> {\n const { domain } = context.state\n\n return await getRepository(GitProject).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => GitProjectList, { description: 'To fetch multiple GitProjects' })\n async gitProjects(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<GitProjectList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(GitProject),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() gitProject: GitProject): Promise<Domain> {\n return gitProject.domainId && (await getRepository(Domain).findOneBy({ id: gitProject.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() gitProject: GitProject): Promise<User> {\n return gitProject.updaterId && (await getRepository(User).findOneBy({ id: gitProject.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() gitProject: GitProject): Promise<User> {\n return gitProject.creatorId && (await getRepository(User).findOneBy({ id: gitProject.creatorId }))\n }\n}\n"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { GitProject, GitProjectStatus, GitProjectLanguage } from './git-project';
|
|
2
|
-
export declare class NewGitProject {
|
|
3
|
-
name: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
repositoryUrl?: string;
|
|
6
|
-
apiKey?: string;
|
|
7
|
-
language?: GitProjectLanguage;
|
|
8
|
-
state?: GitProjectStatus;
|
|
9
|
-
active?: boolean;
|
|
10
|
-
params?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare class GitProjectPatch {
|
|
13
|
-
id?: string;
|
|
14
|
-
name?: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
repositoryUrl?: string;
|
|
17
|
-
webhookUrl?: string;
|
|
18
|
-
apiKey?: string;
|
|
19
|
-
language?: GitProjectLanguage;
|
|
20
|
-
state?: GitProjectStatus;
|
|
21
|
-
active?: boolean;
|
|
22
|
-
cuFlag?: string;
|
|
23
|
-
}
|
|
24
|
-
export declare class GitProjectList {
|
|
25
|
-
items: GitProject[];
|
|
26
|
-
total: number;
|
|
27
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GitProjectList = exports.GitProjectPatch = exports.NewGitProject = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const git_project_1 = require("./git-project");
|
|
7
|
-
let NewGitProject = class NewGitProject {
|
|
8
|
-
};
|
|
9
|
-
exports.NewGitProject = NewGitProject;
|
|
10
|
-
tslib_1.__decorate([
|
|
11
|
-
(0, type_graphql_1.Field)(),
|
|
12
|
-
tslib_1.__metadata("design:type", String)
|
|
13
|
-
], NewGitProject.prototype, "name", void 0);
|
|
14
|
-
tslib_1.__decorate([
|
|
15
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
16
|
-
tslib_1.__metadata("design:type", String)
|
|
17
|
-
], NewGitProject.prototype, "description", void 0);
|
|
18
|
-
tslib_1.__decorate([
|
|
19
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
20
|
-
tslib_1.__metadata("design:type", String)
|
|
21
|
-
], NewGitProject.prototype, "repositoryUrl", void 0);
|
|
22
|
-
tslib_1.__decorate([
|
|
23
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
24
|
-
tslib_1.__metadata("design:type", String)
|
|
25
|
-
], NewGitProject.prototype, "apiKey", void 0);
|
|
26
|
-
tslib_1.__decorate([
|
|
27
|
-
(0, type_graphql_1.Field)(type => git_project_1.GitProjectLanguage, { nullable: true }),
|
|
28
|
-
tslib_1.__metadata("design:type", String)
|
|
29
|
-
], NewGitProject.prototype, "language", void 0);
|
|
30
|
-
tslib_1.__decorate([
|
|
31
|
-
(0, type_graphql_1.Field)(type => git_project_1.GitProjectStatus, { nullable: true }),
|
|
32
|
-
tslib_1.__metadata("design:type", String)
|
|
33
|
-
], NewGitProject.prototype, "state", void 0);
|
|
34
|
-
tslib_1.__decorate([
|
|
35
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
36
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
37
|
-
], NewGitProject.prototype, "active", void 0);
|
|
38
|
-
tslib_1.__decorate([
|
|
39
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
40
|
-
tslib_1.__metadata("design:type", String)
|
|
41
|
-
], NewGitProject.prototype, "params", void 0);
|
|
42
|
-
exports.NewGitProject = NewGitProject = tslib_1.__decorate([
|
|
43
|
-
(0, type_graphql_1.InputType)()
|
|
44
|
-
], NewGitProject);
|
|
45
|
-
let GitProjectPatch = class GitProjectPatch {
|
|
46
|
-
};
|
|
47
|
-
exports.GitProjectPatch = GitProjectPatch;
|
|
48
|
-
tslib_1.__decorate([
|
|
49
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
50
|
-
tslib_1.__metadata("design:type", String)
|
|
51
|
-
], GitProjectPatch.prototype, "id", void 0);
|
|
52
|
-
tslib_1.__decorate([
|
|
53
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
54
|
-
tslib_1.__metadata("design:type", String)
|
|
55
|
-
], GitProjectPatch.prototype, "name", void 0);
|
|
56
|
-
tslib_1.__decorate([
|
|
57
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
58
|
-
tslib_1.__metadata("design:type", String)
|
|
59
|
-
], GitProjectPatch.prototype, "description", void 0);
|
|
60
|
-
tslib_1.__decorate([
|
|
61
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
62
|
-
tslib_1.__metadata("design:type", String)
|
|
63
|
-
], GitProjectPatch.prototype, "repositoryUrl", void 0);
|
|
64
|
-
tslib_1.__decorate([
|
|
65
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
66
|
-
tslib_1.__metadata("design:type", String)
|
|
67
|
-
], GitProjectPatch.prototype, "webhookUrl", void 0);
|
|
68
|
-
tslib_1.__decorate([
|
|
69
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
70
|
-
tslib_1.__metadata("design:type", String)
|
|
71
|
-
], GitProjectPatch.prototype, "apiKey", void 0);
|
|
72
|
-
tslib_1.__decorate([
|
|
73
|
-
(0, type_graphql_1.Field)(type => git_project_1.GitProjectLanguage, { nullable: true }),
|
|
74
|
-
tslib_1.__metadata("design:type", String)
|
|
75
|
-
], GitProjectPatch.prototype, "language", void 0);
|
|
76
|
-
tslib_1.__decorate([
|
|
77
|
-
(0, type_graphql_1.Field)(type => git_project_1.GitProjectStatus, { nullable: true }),
|
|
78
|
-
tslib_1.__metadata("design:type", String)
|
|
79
|
-
], GitProjectPatch.prototype, "state", void 0);
|
|
80
|
-
tslib_1.__decorate([
|
|
81
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
82
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
83
|
-
], GitProjectPatch.prototype, "active", void 0);
|
|
84
|
-
tslib_1.__decorate([
|
|
85
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
86
|
-
tslib_1.__metadata("design:type", String)
|
|
87
|
-
], GitProjectPatch.prototype, "cuFlag", void 0);
|
|
88
|
-
exports.GitProjectPatch = GitProjectPatch = tslib_1.__decorate([
|
|
89
|
-
(0, type_graphql_1.InputType)()
|
|
90
|
-
], GitProjectPatch);
|
|
91
|
-
let GitProjectList = class GitProjectList {
|
|
92
|
-
};
|
|
93
|
-
exports.GitProjectList = GitProjectList;
|
|
94
|
-
tslib_1.__decorate([
|
|
95
|
-
(0, type_graphql_1.Field)(type => [git_project_1.GitProject]),
|
|
96
|
-
tslib_1.__metadata("design:type", Array)
|
|
97
|
-
], GitProjectList.prototype, "items", void 0);
|
|
98
|
-
tslib_1.__decorate([
|
|
99
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
100
|
-
tslib_1.__metadata("design:type", Number)
|
|
101
|
-
], GitProjectList.prototype, "total", void 0);
|
|
102
|
-
exports.GitProjectList = GitProjectList = tslib_1.__decorate([
|
|
103
|
-
(0, type_graphql_1.ObjectType)()
|
|
104
|
-
], GitProjectList);
|
|
105
|
-
//# sourceMappingURL=git-project-type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-project-type.js","sourceRoot":"","sources":["../../../server/service/git-project/git-project-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAItF,+CAAgF;AAGzE,IAAM,aAAa,GAAnB,MAAM,aAAa;CAwBzB,CAAA;AAxBY,sCAAa;AAExB;IADC,IAAA,oBAAK,GAAE;;2CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACJ;AAGtB;IADC,IAAA,oBAAK,EAA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EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC5B;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;0BA7BJ,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CA8B3B;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,CAAC;;6CACT;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;yBALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { GitProject, GitProjectStatus, GitProjectLanguage } from './git-project'\n\n@InputType()\nexport class NewGitProject {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n repositoryUrl?: string\n\n @Field({ nullable: true })\n apiKey?: string\n\n @Field(type => GitProjectLanguage, { nullable: true })\n language?: GitProjectLanguage\n\n @Field(type => GitProjectStatus, { nullable: true })\n state?: GitProjectStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n}\n\n@InputType()\nexport class GitProjectPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n repositoryUrl?: string\n\n @Field({ nullable: true })\n webhookUrl?: string\n\n @Field({ nullable: true })\n apiKey?: string\n\n @Field(type => GitProjectLanguage, { nullable: true })\n language?: GitProjectLanguage\n\n @Field(type => GitProjectStatus, { nullable: true })\n state?: GitProjectStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class GitProjectList {\n @Field(type => [GitProject])\n items: GitProject[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Domain } from '@things-factory/shell';
|
|
2
|
-
import { User } from '@things-factory/auth-base';
|
|
3
|
-
export declare enum GitProjectStatus {
|
|
4
|
-
REGISTERED = "REGISTERED",
|
|
5
|
-
READY = "READY"
|
|
6
|
-
}
|
|
7
|
-
export declare enum GitProjectLanguage {
|
|
8
|
-
javascript = "javascript",
|
|
9
|
-
typescript = "typescript",
|
|
10
|
-
java = "java",
|
|
11
|
-
python = "python",
|
|
12
|
-
c = "c",
|
|
13
|
-
cpp = "cpp"
|
|
14
|
-
}
|
|
15
|
-
export declare class GitProject {
|
|
16
|
-
readonly id: string;
|
|
17
|
-
domain?: Domain;
|
|
18
|
-
domainId?: string;
|
|
19
|
-
name?: string;
|
|
20
|
-
description?: string;
|
|
21
|
-
repositoryUrl?: string;
|
|
22
|
-
language?: GitProjectLanguage;
|
|
23
|
-
apiKey?: string;
|
|
24
|
-
active?: boolean;
|
|
25
|
-
state?: GitProjectStatus;
|
|
26
|
-
params?: string;
|
|
27
|
-
createdAt?: Date;
|
|
28
|
-
updatedAt?: Date;
|
|
29
|
-
creator?: User;
|
|
30
|
-
creatorId?: string;
|
|
31
|
-
updater?: User;
|
|
32
|
-
updaterId?: string;
|
|
33
|
-
get webhookUrl(): string;
|
|
34
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GitProject = exports.GitProjectLanguage = exports.GitProjectStatus = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const typeorm_1 = require("typeorm");
|
|
6
|
-
const type_graphql_1 = require("type-graphql");
|
|
7
|
-
const shell_1 = require("@things-factory/shell");
|
|
8
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
-
var GitProjectStatus;
|
|
10
|
-
(function (GitProjectStatus) {
|
|
11
|
-
GitProjectStatus["REGISTERED"] = "REGISTERED";
|
|
12
|
-
GitProjectStatus["READY"] = "READY";
|
|
13
|
-
})(GitProjectStatus || (exports.GitProjectStatus = GitProjectStatus = {}));
|
|
14
|
-
(0, type_graphql_1.registerEnumType)(GitProjectStatus, {
|
|
15
|
-
name: 'GitProjectStatus',
|
|
16
|
-
description: 'state enumeration of a gitProject'
|
|
17
|
-
});
|
|
18
|
-
var GitProjectLanguage;
|
|
19
|
-
(function (GitProjectLanguage) {
|
|
20
|
-
GitProjectLanguage["javascript"] = "javascript";
|
|
21
|
-
GitProjectLanguage["typescript"] = "typescript";
|
|
22
|
-
GitProjectLanguage["java"] = "java";
|
|
23
|
-
GitProjectLanguage["python"] = "python";
|
|
24
|
-
GitProjectLanguage["c"] = "c";
|
|
25
|
-
GitProjectLanguage["cpp"] = "cpp";
|
|
26
|
-
})(GitProjectLanguage || (exports.GitProjectLanguage = GitProjectLanguage = {}));
|
|
27
|
-
(0, type_graphql_1.registerEnumType)(GitProjectLanguage, {
|
|
28
|
-
name: 'GitProjectLanguage',
|
|
29
|
-
description: 'language enumeration of a gitProject'
|
|
30
|
-
});
|
|
31
|
-
let GitProject = class GitProject {
|
|
32
|
-
get webhookUrl() {
|
|
33
|
-
return `https://codelingua.hatiolab.com/github-webhook/${this.id}`;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
exports.GitProject = GitProject;
|
|
37
|
-
tslib_1.__decorate([
|
|
38
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
39
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
40
|
-
tslib_1.__metadata("design:type", String)
|
|
41
|
-
], GitProject.prototype, "id", void 0);
|
|
42
|
-
tslib_1.__decorate([
|
|
43
|
-
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
44
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
-
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
46
|
-
], GitProject.prototype, "domain", void 0);
|
|
47
|
-
tslib_1.__decorate([
|
|
48
|
-
(0, typeorm_1.RelationId)((gitProject) => gitProject.domain),
|
|
49
|
-
tslib_1.__metadata("design:type", String)
|
|
50
|
-
], GitProject.prototype, "domainId", void 0);
|
|
51
|
-
tslib_1.__decorate([
|
|
52
|
-
(0, typeorm_1.Column)(),
|
|
53
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
54
|
-
tslib_1.__metadata("design:type", String)
|
|
55
|
-
], GitProject.prototype, "name", void 0);
|
|
56
|
-
tslib_1.__decorate([
|
|
57
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
58
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
59
|
-
tslib_1.__metadata("design:type", String)
|
|
60
|
-
], GitProject.prototype, "description", void 0);
|
|
61
|
-
tslib_1.__decorate([
|
|
62
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
63
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
64
|
-
tslib_1.__metadata("design:type", String)
|
|
65
|
-
], GitProject.prototype, "repositoryUrl", void 0);
|
|
66
|
-
tslib_1.__decorate([
|
|
67
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
68
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
69
|
-
tslib_1.__metadata("design:type", String)
|
|
70
|
-
], GitProject.prototype, "language", void 0);
|
|
71
|
-
tslib_1.__decorate([
|
|
72
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
73
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
74
|
-
tslib_1.__metadata("design:type", String)
|
|
75
|
-
], GitProject.prototype, "apiKey", void 0);
|
|
76
|
-
tslib_1.__decorate([
|
|
77
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
78
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
79
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
80
|
-
], GitProject.prototype, "active", void 0);
|
|
81
|
-
tslib_1.__decorate([
|
|
82
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
83
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
84
|
-
tslib_1.__metadata("design:type", String)
|
|
85
|
-
], GitProject.prototype, "state", void 0);
|
|
86
|
-
tslib_1.__decorate([
|
|
87
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
88
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
89
|
-
tslib_1.__metadata("design:type", String)
|
|
90
|
-
], GitProject.prototype, "params", void 0);
|
|
91
|
-
tslib_1.__decorate([
|
|
92
|
-
(0, typeorm_1.CreateDateColumn)(),
|
|
93
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
94
|
-
tslib_1.__metadata("design:type", Date)
|
|
95
|
-
], GitProject.prototype, "createdAt", void 0);
|
|
96
|
-
tslib_1.__decorate([
|
|
97
|
-
(0, typeorm_1.UpdateDateColumn)(),
|
|
98
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
99
|
-
tslib_1.__metadata("design:type", Date)
|
|
100
|
-
], GitProject.prototype, "updatedAt", void 0);
|
|
101
|
-
tslib_1.__decorate([
|
|
102
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
103
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
104
|
-
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
105
|
-
], GitProject.prototype, "creator", void 0);
|
|
106
|
-
tslib_1.__decorate([
|
|
107
|
-
(0, typeorm_1.RelationId)((gitProject) => gitProject.creator),
|
|
108
|
-
tslib_1.__metadata("design:type", String)
|
|
109
|
-
], GitProject.prototype, "creatorId", void 0);
|
|
110
|
-
tslib_1.__decorate([
|
|
111
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
112
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
113
|
-
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
114
|
-
], GitProject.prototype, "updater", void 0);
|
|
115
|
-
tslib_1.__decorate([
|
|
116
|
-
(0, typeorm_1.RelationId)((gitProject) => gitProject.updater),
|
|
117
|
-
tslib_1.__metadata("design:type", String)
|
|
118
|
-
], GitProject.prototype, "updaterId", void 0);
|
|
119
|
-
exports.GitProject = GitProject = tslib_1.__decorate([
|
|
120
|
-
(0, typeorm_1.Entity)(),
|
|
121
|
-
(0, typeorm_1.Index)('ix_git_project_0', (gitProject) => [gitProject.domain, gitProject.name], {
|
|
122
|
-
unique: true
|
|
123
|
-
}),
|
|
124
|
-
(0, type_graphql_1.ObjectType)({ description: 'Entity for GitProject' })
|
|
125
|
-
], GitProject);
|
|
126
|
-
//# sourceMappingURL=git-project.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-project.js","sourceRoot":"","sources":["../../../server/service/git-project/git-project.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,6CAAyB,CAAA;IACzB,mCAAe,CAAA;AACjB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAA,+BAAgB,EAAC,gBAAgB,EAAE;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,mCAAmC;CACjD,CAAC,CAAA;AAEF,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,+CAAyB,CAAA;IACzB,mCAAa,CAAA;IACb,uCAAiB,CAAA;IACjB,6BA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,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;2CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CACzC;qBAhEP,UAAU;IALtB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE;QAC3F,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;GACxC,UAAU,CAqEtB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport enum GitProjectStatus {\n REGISTERED = 'REGISTERED',\n READY = 'READY'\n}\n\nregisterEnumType(GitProjectStatus, {\n name: 'GitProjectStatus',\n description: 'state enumeration of a gitProject'\n})\n\nexport enum GitProjectLanguage {\n javascript = 'javascript',\n typescript = 'typescript',\n java = 'java',\n python = 'python',\n c = 'c',\n cpp = 'cpp'\n}\n\nregisterEnumType(GitProjectLanguage, {\n name: 'GitProjectLanguage',\n description: 'language enumeration of a gitProject'\n})\n\n@Entity()\n@Index('ix_git_project_0', (gitProject: GitProject) => [gitProject.domain, gitProject.name], {\n unique: true\n})\n@ObjectType({ description: 'Entity for GitProject' })\nexport class GitProject {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((gitProject: GitProject) => gitProject.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n repositoryUrl?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n language?: GitProjectLanguage\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n apiKey?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: GitProjectStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n params?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((gitProject: GitProject) => gitProject.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((gitProject: GitProject) => gitProject.updater)\n updaterId?: string\n\n get webhookUrl(): string {\n return `https://codelingua.hatiolab.com/github-webhook/${this.id}`\n }\n}\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { GitProject } from './git-project';
|
|
2
|
-
import { GitProjectQuery } from './git-project-query';
|
|
3
|
-
import { GitProjectMutation } from './git-project-mutation';
|
|
4
|
-
export declare const entities: (typeof GitProject)[];
|
|
5
|
-
export declare const resolvers: (typeof GitProjectQuery | typeof GitProjectMutation)[];
|
|
6
|
-
export declare const subscribers: any[];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
-
const git_project_1 = require("./git-project");
|
|
5
|
-
const git_project_query_1 = require("./git-project-query");
|
|
6
|
-
const git_project_mutation_1 = require("./git-project-mutation");
|
|
7
|
-
exports.entities = [git_project_1.GitProject];
|
|
8
|
-
exports.resolvers = [git_project_query_1.GitProjectQuery, git_project_mutation_1.GitProjectMutation];
|
|
9
|
-
exports.subscribers = [];
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/git-project/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,2DAAqD;AACrD,iEAA2D;AAE9C,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA;AACjD,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { GitProject } from './git-project'\nimport { GitProjectQuery } from './git-project-query'\nimport { GitProjectMutation } from './git-project-mutation'\n\nexport const entities = [GitProject]\nexport const resolvers = [GitProjectQuery, GitProjectMutation]\nexport const subscribers = []\n"]}
|