Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 1bb93e1

Browse files
authored
Merge pull request #75 from topcoder-platform/develop
Version 1.2
2 parents 385b097 + f0fdfee commit 1bb93e1

11 files changed

+799
-767
lines changed

models/Issue.js

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ const schema = new Schema({
3636
name: 'RepositoryIdIndex'
3737
}
3838
},
39+
repoUrl: {
40+
type: String
41+
},
3942
repositoryIdStr: {type: String, required: false},
4043
labels: {
4144
type: Array,

models/Project.js

-12
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,12 @@ const schema = new Schema({
2323
type: Number,
2424
required: true
2525
},
26-
repoUrl: {
27-
type: String,
28-
required: true,
29-
index: {
30-
global: true,
31-
rangeKey: 'archived',
32-
project: true,
33-
name: 'RepoUrlIndex'
34-
}
35-
},
36-
repoId: {type: String, required: false},
3726
rocketChatWebhook: {type: String, required: false},
3827
rocketChatChannelName: {type: String, required: false},
3928
archived: {type: String, required: true},
4029
owner: {type: String, required: true},
4130
secretWebhookKey: {type: String, required: true},
4231
copilot: {type: String, required: false},
43-
registeredWebhookId: {type: String, required: false},
4432
updatedAt: {
4533
type: Date,
4634
default: Date.now

models/Repository.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) 2018 TopCoder, Inc. All rights reserved.
3+
*/
4+
'use strict';
5+
6+
/**
7+
* Schema for project and repository mapping.
8+
* @author TCSCODER
9+
* @version 1.0
10+
*/
11+
const dynamoose = require('dynamoose');
12+
13+
const Schema = dynamoose.Schema;
14+
15+
const schema = new Schema({
16+
id: {
17+
type: String,
18+
hashKey: true,
19+
required: true
20+
},
21+
projectId: {
22+
type: String,
23+
required: true,
24+
index: {
25+
global: true,
26+
project: true,
27+
name: 'ProjectIdIndex'
28+
}
29+
},
30+
url: {
31+
type: String,
32+
required: true,
33+
index: {
34+
global: true,
35+
project: true,
36+
rangKey: 'archived',
37+
name: 'URLIndex'
38+
}
39+
},
40+
archived: {type: String, required: true},
41+
repoId: {type: String, required: false},
42+
registeredWebhookId: {type: String, required: false}
43+
});
44+
45+
module.exports = schema;

models/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ const models = {
4040
User: dynamoose.model('Topcoder_X.User', require('./User')),
4141
CopilotPayment: dynamoose.model('Topcoder_X.CopilotPayment', require('./CopilotPayment')),
4242
GithubUserMapping: dynamoose.model('Topcoder_X.GithubUserMapping', require('./GithubUserMapping')),
43-
GitlabUserMapping: dynamoose.model('Topcoder_X.GitlabUserMapping', require('./GitlabUserMapping'))
43+
GitlabUserMapping: dynamoose.model('Topcoder_X.GitlabUserMapping', require('./GitlabUserMapping')),
44+
Repository: dynamoose.model('Topcoder_X.Repository', require('./Repository'))
4445
};
4546
/* eslint-enable global-require */
4647

0 commit comments

Comments
 (0)