Skip to content

[PROD] Release 1.5 #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 73 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
ffd1a2f
allow setting status during Job/JobCandidate/ResourceBooking creation
imcaizheng Jan 26, 2021
10749dd
Winner submission for Topcoder TaaS API - Improve Local Setup
imcaizheng Jan 30, 2021
cc6c548
Create a script to import Jobs data from Recruit CRM
imcaizheng Feb 1, 2021
c76ed1d
Merge pull request #121 from imcaizheng/feature/improve-local-setup
maxceem Feb 1, 2021
b067dc7
Revert "Winner submission for Topcoder TaaS API - Improve Local Setup"
maxceem Feb 2, 2021
f3610a8
Merge pull request #123 from topcoder-platform/revert-121-feature/imp…
maxceem Feb 2, 2021
a871d2c
feat: improve local setup
maxceem Feb 2, 2021
c6f0dc5
docs: improve README
maxceem Feb 2, 2021
d359adf
Merge pull request #124 from topcoder-platform/feature/improve-local-…
maxceem Feb 2, 2021
66d3a76
Merge pull request #120 from imcaizheng/recruit-crm-job-import
maxceem Feb 2, 2021
6e52f14
docs: rename Bookings API to TaaS API
maxceem Feb 2, 2021
76a20ca
RCRM Import script: add total records created or being already exist …
imcaizheng Feb 2, 2021
2c58fad
final fixes
Feb 3, 2021
e9b48b3
Merge pull request #125 from imcaizheng/recruit-crm-job-import
maxceem Feb 3, 2021
cb03be8
Fix to RCRM Import script: compare endDate with today date
imcaizheng Feb 3, 2021
f785c99
Merge pull request #127 from imcaizheng/recruit-crm-job-import
maxceem Feb 3, 2021
2fd35a1
Merge pull request #126 from shailesh-02/dev
maxceem Feb 3, 2021
faded40
chore: improve local:init and local:reset
maxceem Feb 3, 2021
f9a65a9
Merge pull request #128 from topcoder-platform/feature/data-scripts
maxceem Feb 3, 2021
e07acb4
Merge branch 'feature/data-scripts' of github.com:topcoder-platform/t…
maxceem Feb 3, 2021
5fda963
Merge pull request #129 from topcoder-platform/feature/data-scripts
maxceem Feb 3, 2021
cceef5d
Merge pull request #117 from imcaizheng/allow-setting-status-during-c…
maxceem Feb 3, 2021
2f84be7
ndex Data Script: Include the `id` field inside the body of a document
imcaizheng Feb 4, 2021
b555891
Merge pull request #131 from imcaizheng/include-id-field-when-index
maxceem Feb 4, 2021
837bc3e
chore: remove redundant config
maxceem Feb 4, 2021
cc983de
fix: don't index soft-deleted records
maxceem Feb 4, 2021
28979e5
fix: local:init should't fail if index not exists
maxceem Feb 4, 2021
7d847dc
chore: don't use port 5000 as we use it for auth
maxceem Feb 4, 2021
fea3c45
fix: allow empty "description" and "resourceType"
maxceem Feb 4, 2021
80bfd18
remove the clearObject function
imcaizheng Feb 6, 2021
afa07b0
Post data to Kafka Events from created/updated in DB
imcaizheng Feb 6, 2021
5648217
Merge pull request #135 from imcaizheng/fix/remove-function-clear-object
maxceem Feb 6, 2021
89d253a
Allow null values in request body for optional fields
imcaizheng Feb 7, 2021
52e3542
resolve conflict from upstream/dev
imcaizheng Feb 7, 2021
7badd0a
Merge pull request #139 from imcaizheng/fix/request-body-allow-null-v…
maxceem Feb 7, 2021
e68f038
enable paranoid mode for models
imcaizheng Feb 7, 2021
30c7474
fix: allow empty when PUT jobs
maxceem Feb 7, 2021
77865d5
remove manually setting createdAt and updatedAt
imcaizheng Feb 7, 2021
9657d71
Return invites and members property for teams
imcaizheng Feb 8, 2021
94f7b37
Fix: use snakecase for timestamps fields in DB
imcaizheng Feb 8, 2021
a0f0f7a
fix example values for members and invites in Swagger document
imcaizheng Feb 8, 2021
df97ad4
Merge pull request #136 from imcaizheng/post-event-with-payload-from-…
maxceem Feb 9, 2021
9562310
Merge pull request #140 from imcaizheng/team-service-include-members-…
maxceem Feb 9, 2021
e2e1084
Remove `endDate` from Job and add `duration` to Job
imcaizheng Feb 9, 2021
331a855
Remove the endDate parameter from searching jobs in Postman
imcaizheng Feb 9, 2021
1d19d13
Fix PUT operations: fully replace the content of a record with a new one
imcaizheng Feb 9, 2021
bc9915e
Merge pull request #145 from imcaizheng/job-replace-end-date-with-dur…
nkumar-topcoder Feb 10, 2021
3d107fa
Resolve conflict
imcaizheng Feb 10, 2021
c887a76
Merge pull request #146 from imcaizheng/full-update-full-record
maxceem Feb 10, 2021
1a5d2de
add new endpoint `POST /taas-teams/email`
imcaizheng Feb 15, 2021
941e694
Merge pull request #149 from imcaizheng/new-endpoint-team-email
maxceem Feb 15, 2021
929ae69
fix: email Kafka Event Payload
maxceem Feb 15, 2021
a1ed7e1
chore: use any Node 12 version
maxceem Feb 15, 2021
8ec5de1
chore: remove not real config values
maxceem Feb 15, 2021
fbcc1af
add new endpoint POST /taas-teams/:id/members
imcaizheng Feb 19, 2021
5fcd8b4
check whether the user can access the project before adding members
imcaizheng Feb 19, 2021
a1a2a52
Merge pull request #150 from imcaizheng/new-endpoint-add-members
maxceem Feb 20, 2021
4f58107
fix: create members endpoint
maxceem Feb 21, 2021
88cdea5
fix: allow multiple email addresses
maxceem Feb 22, 2021
ba6a8c7
fix: email event format
maxceem Feb 23, 2021
847f797
fix: format email body as HTML
maxceem Feb 23, 2021
f62169a
fix: format email body as HTML no XML
maxceem Feb 23, 2021
79eb119
Revert "fix: format email body as HTML no XML"
maxceem Feb 23, 2021
25d313e
Revert "fix: format email body as HTML"
maxceem Feb 23, 2021
45fcdac
Merge branch 'master' into dev
maxceem Feb 23, 2021
6f7abdd
Merge branch 'master' into dev
maxceem Feb 24, 2021
9533a0d
debug: removed extra debug
maxceem Feb 24, 2021
80ac1cf
Create 3 proxy endpoints for project members/invites
imcaizheng Feb 24, 2021
46c69e6
Merge pull request #158 from imcaizheng/add-members-invites-proxy-end…
maxceem Feb 24, 2021
187d79d
fix: add members case-insesitive way
maxceem Feb 24, 2021
3c82b7e
Fix candidates list in `GET /taas-teams/:teamId/jobs/:jobId`
imcaizheng Feb 24, 2021
d635fd9
Merge branch 'master' into dev
maxceem Feb 25, 2021
c82c025
Merge pull request #160 from imcaizheng/get-team-job-fix-candidates-list
maxceem Feb 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12
298 changes: 189 additions & 109 deletions README.md

Large diffs are not rendered by default.

40 changes: 0 additions & 40 deletions Verification.md

This file was deleted.

4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ app.use((err, req, res, next) => {
}

if (err.response) {
// extract error message from V3 API
errorResponse.message = _.get(err, 'response.body.result.content')
// extract error message from V3/V5 API
errorResponse.message = _.get(err, 'response.body.result.content.message') || _.get(err, 'response.body.message')
}

if (_.isUndefined(errorResponse.message)) {
Expand Down
23 changes: 0 additions & 23 deletions config/config.json

This file was deleted.

64 changes: 62 additions & 2 deletions config/default.js
Original file line number Diff line number Diff line change
@@ -1,63 +1,123 @@
require('dotenv').config()
module.exports = {
// the log level, default is 'debug'
LOG_LEVEL: process.env.LOG_LEVEL || 'debug',
// the server port, default is 3000
PORT: process.env.PORT || 3000,
// the server api base path
BASE_PATH: process.env.BASE_PATH || '/api/v5',

// The authorization secret used during token verification.
AUTH_SECRET: process.env.AUTH_SECRET || 'mysecret',
// The valid issuer of tokens, a json array contains valid issuer.
VALID_ISSUERS: process.env.VALID_ISSUERS || '["https://api.topcoder-dev.com", "https://api.topcoder.com", "https://topcoder-dev.auth0.com/", "https://auth.topcoder-dev.com/"]',
// Auth0 URL, used to get TC M2M token
AUTH0_URL: process.env.AUTH0_URL,
// Auth0 audience, used to get TC M2M token
AUTH0_AUDIENCE: process.env.AUTH0_AUDIENCE,
// Auth0 audience for U-Bahn
AUTH0_AUDIENCE_UBAHN: process.env.AUTH0_AUDIENCE_UBAHN,
// Auth0 token cache time, used to get TC M2M token
TOKEN_CACHE_TIME: process.env.TOKEN_CACHE_TIME,
// Auth0 client id, used to get TC M2M token
AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID,
// Auth0 client secret, used to get TC M2M token
AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET,
// Proxy Auth0 URL, used to get TC M2M token
AUTH0_PROXY_SERVER_URL: process.env.AUTH0_PROXY_SERVER_URL,

m2m: {
M2M_AUDIT_USER_ID: process.env.M2M_AUDIT_USER_ID || '00000000-0000-0000-0000-000000000000',
M2M_AUDIT_HANDLE: process.env.M2M_AUDIT_HANDLE || 'TopcoderService'
},

// the Topcoder v5 url
TC_API: process.env.TC_API || 'https://api.topcoder-dev.com/v5',
// the organization id
ORG_ID: process.env.ORG_ID || '36ed815b-3da1-49f1-a043-aaed0a4e81ad',
// the referenced skill provider id
TOPCODER_SKILL_PROVIDER_ID: process.env.TOPCODER_SKILL_PROVIDER_ID || '9cc0795a-6e12-4c84-9744-15858dba1861',

TOPCODER_USERS_API: process.env.TOPCODER_USERS_API || 'https://api.topcoder-dev.com/v3/users',
// the api to find topcoder members
TOPCODER_MEMBERS_API: process.env.TOPCODER_MEMBERS_API || 'https://api.topcoder-dev.com/v3/members',
// rate limit of requests to user api
MAX_PARALLEL_REQUEST_TOPCODER_USERS_API: process.env.MAX_PARALLEL_REQUEST_TOPCODER_USERS_API || 100,

// PostgreSQL database url.
DATABASE_URL: process.env.DATABASE_URL || 'postgres://postgres:postgres@localhost:5432/postgres',
// string - PostgreSQL database target schema
DB_SCHEMA_NAME: process.env.DB_SCHEMA_NAME || 'bookings',
// the project service url
PROJECT_API_URL: process.env.PROJECT_API_URL || 'https://api.topcoder-dev.com',

// the default path for importing and exporting data
DEFAULT_DATA_FILE_PATH: './data/demo-data.json',

esConfig: {
// the elasticsearch host
HOST: process.env.ES_HOST || 'http://localhost:9200',

ELASTICCLOUD: {
// The elastic cloud id, if your elasticsearch instance is hosted on elastic cloud. DO NOT provide a value for ES_HOST if you are using this
id: process.env.ELASTICCLOUD_ID,
// The elastic cloud username for basic authentication. Provide this only if your elasticsearch instance is hosted on elastic cloud
username: process.env.ELASTICCLOUD_USERNAME,
// The elastic cloud password for basic authentication. Provide this only if your elasticsearch instance is hosted on elastic cloud
password: process.env.ELASTICCLOUD_PASSWORD
},

// The Amazon region to use when using AWS Elasticsearch service
AWS_REGION: process.env.AWS_REGION || 'us-east-1', // AWS Region to be used if we use AWS ES

// the job index
ES_INDEX_JOB: process.env.ES_INDEX_JOB || 'job',
// the job candidate index
ES_INDEX_JOB_CANDIDATE: process.env.ES_INDEX_JOB_CANDIDATE || 'job_candidate',
ES_INDEX_RESOURCE_BOOKING: process.env.ES_INDEX_RESOURCE_BOOKING || 'resource_booking'
// the resource booking index
ES_INDEX_RESOURCE_BOOKING: process.env.ES_INDEX_RESOURCE_BOOKING || 'resource_booking',

// the max bulk size in MB for ES indexing
MAX_BULK_REQUEST_SIZE_MB: process.env.MAX_BULK_REQUEST_SIZE_MB || 20,
// the max number of documents per bulk for ES indexing
MAX_BULK_NUM_DOCUMENTS: process.env.MAX_BULK_NUM_DOCUMENTS || 100
},

// Topcoder Bus API URL
BUSAPI_URL: process.env.BUSAPI_URL || 'https://api.topcoder-dev.com/v5',
// The error topic at which bus api will publish any errors
KAFKA_ERROR_TOPIC: process.env.KAFKA_ERROR_TOPIC || 'common.error.reporting',
// The originator value for the kafka messages
KAFKA_MESSAGE_ORIGINATOR: process.env.KAFKA_MESSAGE_ORIGINATOR || 'taas-api',
// topics for job service
// the create job entity Kafka message topic
TAAS_JOB_CREATE_TOPIC: process.env.TAAS_JOB_CREATE_TOPIC || 'taas.job.create',
// the update job entity Kafka message topic
TAAS_JOB_UPDATE_TOPIC: process.env.TAAS_JOB_UPDATE_TOPIC || 'taas.job.update',
// the delete job entity Kafka message topic
TAAS_JOB_DELETE_TOPIC: process.env.TAAS_JOB_DELETE_TOPIC || 'taas.job.delete',
// topics for jobcandidate service
// the create job candidate entity Kafka message topic
TAAS_JOB_CANDIDATE_CREATE_TOPIC: process.env.TAAS_JOB_CANDIDATE_CREATE_TOPIC || 'taas.jobcandidate.create',
// the update job candidate entity Kafka message topic
TAAS_JOB_CANDIDATE_UPDATE_TOPIC: process.env.TAAS_JOB_CANDIDATE_UPDATE_TOPIC || 'taas.jobcandidate.update',
// the delete job candidate entity Kafka message topic
TAAS_JOB_CANDIDATE_DELETE_TOPIC: process.env.TAAS_JOB_CANDIDATE_DELETE_TOPIC || 'taas.jobcandidate.delete',
// topics for job service
// the create resource booking entity Kafka message topic
TAAS_RESOURCE_BOOKING_CREATE_TOPIC: process.env.TAAS_RESOURCE_BOOKING_CREATE_TOPIC || 'taas.resourcebooking.create',
// the update resource booking entity Kafka message topic
TAAS_RESOURCE_BOOKING_UPDATE_TOPIC: process.env.TAAS_RESOURCE_BOOKING_UPDATE_TOPIC || 'taas.resourcebooking.update',
TAAS_RESOURCE_BOOKING_DELETE_TOPIC: process.env.TAAS_RESOURCE_BOOKING_DELETE_TOPIC || 'taas.resourcebooking.delete'
// the delete resource booking entity Kafka message topic
TAAS_RESOURCE_BOOKING_DELETE_TOPIC: process.env.TAAS_RESOURCE_BOOKING_DELETE_TOPIC || 'taas.resourcebooking.delete',

// the Kafka message topic for sending email
EMAIL_TOPIC: process.env.EMAIL_TOPIC || 'external.action.email',
// the emails address for receiving the issue report
// REPORT_ISSUE_EMAILS may contain comma-separated list of email which is converted to array
REPORT_ISSUE_EMAILS: (process.env.REPORT_ISSUE_EMAILS || '').split(','),
// SendGrid email template ID for reporting issue
REPORT_ISSUE_SENDGRID_TEMPLATE_ID: process.env.REPORT_ISSUE_SENDGRID_TEMPLATE_ID,
// the URL where TaaS App is hosted
TAAS_APP_URL: process.env.TAAS_APP_URL || 'https://platform.topcoder-dev.com/taas/myteams'
}
43 changes: 43 additions & 0 deletions config/email_template.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Configure email templates.
* Variables can be used inside the subject and the message of a template(enclosed in double curly braces).
*/

const config = require('config')

module.exports = {
/* Report a general issue for a team.
*
* - projectId: the project ID. Example: 123412
* - projectName: the project name. Example: "TaaS API Misc Updates"
* - reportText: the body of reported issue. Example: "I have issue with ... \n ... Thank you in advance!"
*/
'team-issue-report': {
subject: 'Issue Reported on TaaS Team {{projectName}} ({{projectId}}).',
body: 'Project Name: {{projectName}}' + '\n' +
'Project ID: {{projectId}}' + '\n' +
`Project URL: ${config.TAAS_APP_URL}/{{projectId}}` + '\n' +
'\n' +
'{{reportText}}',
recipients: config.REPORT_ISSUE_EMAILS,
sendgridTemplateId: config.REPORT_ISSUE_SENDGRID_TEMPLATE_ID
},
/* Report issue for a particular member
*
* - userHandle: the user handle. Example: "bili_2021"
* - projectId: the project ID. Example: 123412
* - projectName: the project name. Example: "TaaS API Misc Updates"
* - reportText: the body of reported issue. Example: "I have issue with ... \n ... Thank you in advance!"
*/
'member-issue-report': {
subject: 'Issue Reported for member {{userHandle}} on TaaS Team {{projectName}} ({{projectId}}).',
body: 'User Handle: {{userHandle}}' + '\n' +
'Project Name: {{projectName}}' + '\n' +
'Project ID: {{projectId}}' + '\n' +
`Project URL: ${config.TAAS_APP_URL}/{{projectId}}` + '\n' +
'\n' +
'{{reportText}}',
recipients: config.REPORT_ISSUE_EMAILS,
sendgridTemplateId: config.REPORT_ISSUE_SENDGRID_TEMPLATE_ID
}
}
Loading