Skip to content

Commit e0f4fbe

Browse files
author
vikasrohit
authored
Merge pull request #98 from topcoder-platform/dev
Production Release for Project Plan
2 parents bdefbf1 + 4d1bc17 commit e0f4fbe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+12767
-850
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ workflows:
7676
- test
7777
filters:
7878
branches:
79-
only: 'dev'
79+
only: ['dev', 'feature/dev-challenges']
8080
- deployProd:
8181
requires:
8282
- test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Run image:
7171
`docker run -p 3000:3000 -i -t -e DB_HOST=172.17.0.1 tc_projects_services`
7272
You may replace 172.17.0.1 with your docker0 IP.
7373

74-
You can paste **swagger.yaml** to [swagger editor](http://editor.swagger.io/) or import **postman.json** to verify endpoints.
74+
You can paste **swagger.yaml** to [swagger editor](http://editor.swagger.io/) or import **postman.json** and **postman_environment.json** to verify endpoints.
7575

7676
#### Deploying without docker
7777
If you don't want to use docker to deploy to localhost. You can simply run `npm run start` from root of project. This should start the server on default port `3000`.

config/custom-environment-variables.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"VALID_ISSUERS": "VALID_ISSUERS",
3232
"jwksUri": "JWKS_URI",
3333
"busApiUrl": "BUS_API_URL",
34+
"messageApiUrl": "MESSAGE_SERVICE_URL",
3435
"AUTH0_URL" : "AUTH0_URL",
3536
"AUTH0_CLIENT_ID": "AUTH0_CLIENT_ID",
3637
"AUTH0_CLIENT_SECRET": "AUTH0_CLIENT_SECRET",

config/default.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@
3333
},
3434
"analyticsKey": "",
3535
"VALID_ISSUERS": "[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\"]",
36-
"busApiUrl": "http://api.topcoder-dev.com",
36+
"validIssuers": "[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\"]",
37+
"jwksUri": "",
38+
"busApiUrl": "http://api.topcoder-dev.com/v5",
39+
"messageApiUrl": "http://api.topcoder-dev.com/v5",
40+
"busApiToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoicHJvamVjdC1zZXJ2aWNlIiwiaWF0IjoxNTEyNzQ3MDgyLCJleHAiOjE1MjEzODcwODJ9.PHuNcFDaotGAL8RhQXQMdpL8yOKXxjB5DbBIodmt7RE",
3741
"HEALTH_CHECK_URL": "_health",
42+
"maxPhaseProductCount": 1,
3843
"AUTH0_CLIENT_ID": "",
3944
"AUTH0_CLIENT_SECRET": "",
4045
"AUTH0_AUDIENCE": "",

local/mock-services/authMiddleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = function def(req, res, next) {
2-
if (req.method === 'POST' && req.url === '/authorizations/') {
2+
if (req.method === 'POST' && (req.url === '/authorizations/' || req.url === '/authorizations')) {
33
const resp = {
44
id: '1',
55
result: {

local/mock-services/server.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ server.use(authMiddleware);
2323
// add additional search route for project members
2424
server.get('/v3/members/_search', (req, res) => {
2525
const fields = _.isString(req.query.fields) ? req.query.fields.split(',') : [];
26-
const filter = _.isString(req.query.query) ? req.query.query.split(' OR ') : [];
26+
const filter = _.isString(req.query.query) ?
27+
req.query.query.replace('%2520', ' ').replace('%20', ' ').split(' OR ') : [];
2728
const criteria = _.map(filter, (single) => {
28-
const ret = { };
29+
const ret = {};
2930
const splitted = single.split(':');
3031
// if the result can be parsed successfully
3132
const parsed = jsprim.parseInteger(splitted[1], { allowTrailing: true, trimWhitespace: true });

local/mock-services/services.json

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,156 @@
9999
}
100100
},
101101
"version": "v3"
102+
},
103+
{
104+
"id": "test_customer1",
105+
"result": {
106+
"success": true,
107+
"status": 200,
108+
"metadata": null,
109+
"content": {
110+
"maxRating": {
111+
"rating": 1114,
112+
"track": "DATA_SCIENCE",
113+
"subTrack": "SRM"
114+
},
115+
"createdBy": "40011578",
116+
"updatedBy": "40011578",
117+
"userId": 40051331,
118+
"firstName": "Firstname",
119+
"lastName": "Lastname",
120+
"quote": "It is a mistake to think you can solve any major problems just with potatoes.",
121+
"description": null,
122+
"otherLangName": null,
123+
"handle": "test_customer1",
124+
"handleLower": "test_customer1",
125+
"status": "ACTIVE",
126+
"email": "test_customer1@email.com",
127+
"addresses": [
128+
{
129+
"streetAddr1": "100 Main Street",
130+
"streetAddr2": "",
131+
"city": "Chicago",
132+
"zip": "60601",
133+
"stateCode": "IL",
134+
"type": "HOME",
135+
"updatedAt": null,
136+
"createdAt": null,
137+
"createdBy": null,
138+
"updatedBy": null
139+
}
140+
],
141+
"homeCountryCode": "USA",
142+
"competitionCountryCode": "USA",
143+
"photoURL": null,
144+
"tracks": [
145+
"DEVELOP"
146+
],
147+
"updatedAt": "2015-12-02T14:00Z",
148+
"createdAt": "2014-04-10T10:55Z"
149+
}
150+
},
151+
"version": "v3"
152+
},
153+
{
154+
"id": "test_copilot1",
155+
"result": {
156+
"success": true,
157+
"status": 200,
158+
"metadata": null,
159+
"content": {
160+
"maxRating": {
161+
"rating": 1114,
162+
"track": "DATA_SCIENCE",
163+
"subTrack": "SRM"
164+
},
165+
"createdBy": "40011578",
166+
"updatedBy": "40011578",
167+
"userId": 40051332,
168+
"firstName": "Firstname",
169+
"lastName": "Lastname",
170+
"quote": "It is a mistake to think you can solve any major problems just with potatoes.",
171+
"description": null,
172+
"otherLangName": null,
173+
"handle": "test_copilot1",
174+
"handleLower": "test_copilot1",
175+
"status": "ACTIVE",
176+
"email": "test_copilot1@email.com",
177+
"addresses": [
178+
{
179+
"streetAddr1": "100 Main Street",
180+
"streetAddr2": "",
181+
"city": "Chicago",
182+
"zip": "60601",
183+
"stateCode": "IL",
184+
"type": "HOME",
185+
"updatedAt": null,
186+
"createdAt": null,
187+
"createdBy": null,
188+
"updatedBy": null
189+
}
190+
],
191+
"homeCountryCode": "USA",
192+
"competitionCountryCode": "USA",
193+
"photoURL": null,
194+
"tracks": [
195+
"DEVELOP"
196+
],
197+
"updatedAt": "2015-12-02T14:00Z",
198+
"createdAt": "2014-04-10T10:55Z"
199+
}
200+
},
201+
"version": "v3"
202+
},
203+
{
204+
"id": "test_manager1",
205+
"result": {
206+
"success": true,
207+
"status": 200,
208+
"metadata": null,
209+
"content": {
210+
"maxRating": {
211+
"rating": 1114,
212+
"track": "DATA_SCIENCE",
213+
"subTrack": "SRM"
214+
},
215+
"createdBy": "40011578",
216+
"updatedBy": "40011578",
217+
"userId": 40051333,
218+
"firstName": "Firstname",
219+
"lastName": "Lastname",
220+
"quote": "It is a mistake to think you can solve any major problems just with potatoes.",
221+
"description": null,
222+
"otherLangName": null,
223+
"handle": "test_manager1",
224+
"handleLower": "test_manager1",
225+
"status": "ACTIVE",
226+
"email": "test_manager1@email.com",
227+
"addresses": [
228+
{
229+
"streetAddr1": "100 Main Street",
230+
"streetAddr2": "",
231+
"city": "Chicago",
232+
"zip": "60601",
233+
"stateCode": "IL",
234+
"type": "HOME",
235+
"updatedAt": null,
236+
"createdAt": null,
237+
"createdBy": null,
238+
"updatedBy": null
239+
}
240+
],
241+
"homeCountryCode": "USA",
242+
"competitionCountryCode": "USA",
243+
"photoURL": null,
244+
"tracks": [
245+
"DEVELOP"
246+
],
247+
"updatedAt": "2015-12-02T14:00Z",
248+
"createdAt": "2014-04-10T10:55Z"
249+
}
250+
},
251+
"version": "v3"
102252
}
103253
]
104254
}

0 commit comments

Comments
 (0)