Skip to content

read challenges from ES #18

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 2 commits into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ The following parameters can be set in config files or in env variables:
- AMAZON.IS_LOCAL_DB: Use Amazon DynamoDB Local or server.
- AMAZON.DYNAMODB_URL: The local url if using Amazon DynamoDB Local
- AMAZON.ATTACHMENT_S3_BUCKET: the AWS S3 bucket to store attachments
- ES: config object for Elasticsearch
- ES.HOST: Elasticsearch host
- ES.API_VERSION: Elasticsearch API version
- ES.ES_INDEX: Elasticsearch index name
- ES.ES_TYPE: Elasticsearch index type
- FILE_UPLOAD_SIZE_LIMIT: the file upload size limit in bytes
- CHALLENGES_API_URL: TC challenges API base URL
- GROUPS_API_URL: TC groups API base URL
Expand Down Expand Up @@ -67,7 +72,7 @@ Go to `mock-api` folder and run command `npm run start` to start the mock-api li
1. Drop/delete tables: `npm run drop-tables`
2. Creating tables: `npm run create-tables`
3. Seed/Insert data to tables: `npm run seed-tables`
4. Initialize database in default environment: `npm run init-db`
4. Initialize/Clear database in default environment: `npm run init-db`
5. View table data in default environment: `npm run view-data <ModelName>`, ModelName can be `Challenge`, `ChallengeType`, `ChallengeSetting`, `AuditLog`, `Phase`, `TimelineTemplate`or `Attachment`

### Notes
Expand Down
9 changes: 9 additions & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ module.exports = {
ATTACHMENT_S3_BUCKET: process.env.ATTACHMENT_S3_BUCKET || 'my-testing-bucket-12345',
S3_API_VERSION: process.env.S3_API_VERSION || '2006-03-01'
},

ES: {
// above AWS_REGION is used if we use AWS ES
HOST: process.env.ES_HOST || 'localhost:9200',
API_VERSION: process.env.ES_API_VERSION || '6.3',
ES_INDEX: process.env.ES_INDEX || 'challenge',
ES_TYPE: process.env.ES_TYPE || '_doc' // ES 6.x accepts only 1 Type per index and it's mandatory to define it
},

// in bytes
FILE_UPLOAD_SIZE_LIMIT: process.env.FILE_UPLOAD_SIZE_LIMIT
? Number(process.env.FILE_UPLOAD_SIZE_LIMIT) : 50 * 1024 * 1024, // 50M
Expand Down
80 changes: 74 additions & 6 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,39 +53,107 @@ paths:
parameters:
- $ref: '#/parameters/page'
- $ref: '#/parameters/perPage'
- name: id
in: query
description: Filter by id, exact match
required: false
type: string
format: UUID
- name: typeId
in: query
description: Filter by type id, exact match
required: false
type: string
format: UUID
- name: track
in: query
description: Filter by track, case-insensitive, partial matches are allowed.
required: false
type: string
- name: name
in: query
description: Filter by name, case-insensitive, partial matches are allowed.
required: false
type: string
- name: description
in: query
description: Filter by description. Partial matches are allowed.
description: Filter by description, case-insensitive, partial matches are allowed.
required: false
type: string
- name: timelineTemplateId
in: query
description: Filter by timeline template id, exact match
required: false
type: string
format: UUID
- name: reviewType
in: query
description: Filter by review type, case-insensitive, partial matches are allowed.
required: false
type: string
- name: tag
in: query
description: Filter by tag name, case-insensitive, partial matches are allowed.
required: false
type: string
- name: projectId
in: query
description: Filter by project id, exact match.
required: false
type: integer
- name: forumId
in: query
description: Filter by forum id, exact match.
required: false
type: integer
- name: legacyId
in: query
description: Filter by legacy id, exact match.
required: false
type: integer
- name: status
in: query
description: Filter by status, case-insensitive, partial matches are allowed.
required: false
type: string
enum: ['Draft', 'Canceled', 'Active', 'Completed']
- name: group
in: query
description: Filter by group name, case-insensitive, partial matches are allowed.
required: false
type: string
- name: createdDateStart
in: query
description: Filter by createdDate (lower bound of date range)
description: Filter by created date (lower bound of date range)
required: false
type: string
format: date-time
- name: createdDateEnd
in: query
description: Filter by createdDate (upper bound of date range)
description: Filter by created date (upper bound of date range)
required: false
type: string
format: date-time
- name: updatedDateStart
in: query
description: Filter by updatedDate (lower bound of date range)
description: Filter by updated date (lower bound of date range)
required: false
type: string
format: date-time
- name: updatedDateEnd
in: query
description: Filter by updatedDate (upper bound of date range)
description: Filter by updated date (upper bound of date range)
required: false
type: string
format: date-time
- name: createdBy
in: query
description: Filter by 'createdBy' field
description: Filter by 'createdBy' field, case-insensitive, partial matches are allowed.
required: false
type: string
- name: updatedBy
in: query
description: Filter by 'updatedBy' field, case-insensitive, partial matches are allowed.
required: false
type: string
responses:
Expand Down
Loading