Skip to content

Commit

Permalink
feat: releasing WasedaTime Careers (#389)
Browse files Browse the repository at this point in the history
* fix: fixing multiple lambda functions (#286)

* fix: fixing redundant data requirements described in the schema (#287)

* fix: fixing multiple lambda functions

* fix: fixing api schema

* fix: fixed schema and some lambdas (#288)

* fix: scraper and period location (#289)

* feat: adding new case for scrapper for instance multiple periods and multiple locations

* feat: adding case of multiple locations and periods devided with a slash

* feat: updated get single thread lambda role to all access to db (#290)

* feat: enabling multi-line evaluation criteria scraping (#291)

* feat: adding regex to scrape multiple eval criterias

* feat: enabling multiple line of criteria

* chore(deps): update dependency @types/jest to v29.5.1 (#284)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update typescript-eslint monorepo to v5.59.6 (#283)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: applying hotfix changes to branch develop

* feat: adding case 3 for merging period and location for exceptions (#295)

* chore(deps): update pnpm/action-setup action to v2.2.4 (#228)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chores: simple update

* fix: refactoring forum table keys (#298)

* fix: refactoring forum table keys

* fix: first deleting the table

* feat: exporting table arn

* feat: destroying table forum (#299)

* feat: destroying table forum

* feat: exporting table name and arn to disconnect api service

* feat: continue destorying the forum table (#300)

* feat: continue destorying the forum table

* feat: disconnecting endpoint and stop exporting table arn

* feat: finishing refactoring forum functionaility (#301)

* feat: changing parameters for uid (#302)

* feat: changing parameters for uid

* fix: fixing conditional statements

* feat: adding default value

* feat: github why are you doing this stop this please

* fix: small changes

* fix: fix get-course (#303)

* feat: fixing cron

* fix: fix get eval criteria (#306)

* fix-get-eval-criteria

* fix: fix get-eval-criteria

* fix: fixing pnpm version to 6 (#309)

* feat: adding oauth for flutter app (#310)

* feat: adding oauth for flutter app

* fix: fixing typo

* fix: hotfix for conditional (#311)

* fix: fixing the fucking delete and patch

* feat: i might have solved the fucking issue

* feat: add mod flag (#312)

* feat: adding mod flag to get all threads lambda

* feat: adding mod flag to board threads

* fix: multiple lambdas related forums (#313)

* fix: update node version

* feat: fixing get functionality

* fix: getting rid of default values

* fix: final fix please

* fix: taking out int

* fix: lets make it work

* feat: adding school filtering

* fix: adding contigency

* fix: fixing bool

* fix: fixing bull for starting index

* feat: adding some loggings

* fix: fixing indexing

* chore: adding logging for debug

* feat: adding end index to message response

* fix: fixing schema to array

* feat: adding tags filtering to lambda

* feat: adding filitering and pagination functionality to board thread api

* fix: fixing small typos

* feat: contacting two lambdas to one

* feat: fixing

* fix: adding default

* feat: adding loggings for debugging

* feat: fixing sorting logic

* feat: refactoring sorting method

* feat: adding builtin dynamo pagination

* feat: reverting changes back to original built in pagination requires more examination

* feat: returning the created thread item for smooth UX

* feat: popping uid for secruity measures

* feat: adding thread comment to retunred data without uid exposure

* feat: adding mod flag

* feat: adding backend functionality for like

* feat: passing thread id back to client

* fix: fixing like logic

* fix: fixing logic for likes

* fix: refixing the fucking likes feature

* feat: major update into main from develop

* feat: renaming actions names

* feat: adding magic command to get rid of the table

* feat: destroying table on stage dev

* fix: fixing export value

* fix: what the fuck is happening

* fix: finalizing db reset

* feat: disconnecting service

* chore: small stuff

* feat: destroying table

* fix: commenting out export value method

* feat: rebuilding tables

* feat: rebuilding table what just happened

* feat: fixing git workflows and adding environment variables to amplfi… (#321)

* feat: fixing git workflows and adding environment variables to amplfiy configurations

* fix: variable instantiation error fixed

* fix: adding some error loggings to figure out the issue

* feat: adding additional API base url for VITE for forums

* fix: fixing variable name typo

* feat: adding needed variables to github actions yaml

* fix: fixing buildspec due to git merge conflicts

* fix: fixing basepath for dev env

* fix: refixing public base path

* feat: thread comment count (#322)

* feat: added comment count to post thread

* feat: update comment count

* feat: schema update new action

* chore: empty commit

* chore: test

* chore: update count change

* feat: adding newComment flag

* chore: small changes due to git merge conflict

---------

Co-authored-by: Jason Park <[email protected]>

* fix: messed up update expressions

* feat: adding more logic to patch and get threads related to likes and comments

* feat: adding new action of comment count decrease to patch thread lambda

* chore: adding logging statements

* fix: accidently deleted handler

* feat: adding increase and decrease action to schema

* fix: fixing envvar base path for app root

* fix: is it because of the space

* feat: adding logging statements

* chore: deleting condition expression

* feat: adding functionalities for user thread (#324)

* feat: adding functionalities for user thread

* chore: typo fix

* feat: changing schema model to an empty model

* fix: resource error fix

* fix: authorizer not working why

* feat: why isint it working

* feat: adding authorizer to user thread fetch

* chore: making response data dict concise

* fix: fixing conditional expressions to include 1

* feat: connecting thread forum bucket and dynamodb (#326)

* feat: adding connection to db for forum images and commenting out graphql stuff

* chore: commenting out graphql stuff

* chore: fixing identical names

* chore: fixing identical construct names in forumthreadfunctions

* chore: identical identifier in forum thread functions

* Revert "feat: connecting thread forum bucket and dynamodb (#326)"

This reverts commit 2df6f4a.

* feat: init forum image table (#327)

* feat: init forum image table

* feat: instantiating forum thread image data pipeline

* feat: threadimgdatapipeline

* feat: adding permissions and envvar for forum thread (#328)

* feat: adding permissions

* feat: adding test lambda for post (#329)

* feat: adding test post thread with images

* feat: taking board_id outo of path to data payload

* fix: fixing resource method

* feat: creating test lambda for forum get single thread (#330)

* chore: fixing typo

* feat: adding split to properly decode base64

* feat: adding image functionality to threads (#331)

* fix: adding boardid from path parameters

* feat: changing access control for forums (#332)

* feat: changing access control for forums

* fix: removing block public access

* feat: init thumbnail and ads processors (#333)

* test: test code for ads

* chore: test code update

* feat: adding thumbnail feature

* feat: adding sync image

* fix: fix function name

---------

Co-authored-by: Y.H LIEN <[email protected]>

* chore: changing logical id name

* feat: enabling public access

* fix: fixing public access

* feat: defining public read

* fix: fixing in two different stacks

* feat: removal policy destroy

* feat: destroying buckets

* feat: oh no

* feat: adding processor

* feat: adding different table name

* feat: adding prefix with wildcards

* fix: adding github ssh rsa as trusted

* feat: adding images for board view also (#334)

* feat: adding images for board view also

* fix: removing policies

* feat: adding forum thread notification (#337)

* feat: adding gsi univid by threadid for table threads for thread notification

* feat: adding lambda for notification

* feat: creating lambda functions and rest api

* fix: fixing Univ Id to univ id

* fix: adding logging to lambda

* fix: hotfix

* fix: hot fix duplicate index names

* fix: changing index name

* fix: hotfix deleting GSI

* fix: reverting changes to recreate the GSI

* fix: stringifying univ id

* feat: test code forum ads api  (#340)

* feat: test code for forum ads api

* feat: test code for lambda function syncadsimgs

* feat: new test code for lambda function syncadsimgs

* feat: new test code for lambda function syncadsimgs

* feat: test code for lambda function get-omgs-list

* feat: test code for lambda function get-omgs-list 2

* feat: test code for lambda get imgs list

* feat: test code for lambda get imgs list 2

* feat: forum ads api (#341)

* feat: test code for forum ads api

* feat: test code for lambda function syncadsimgs

* feat: new test code for lambda function syncadsimgs

* feat: new test code for lambda function syncadsimgs

* feat: test code for lambda function get-omgs-list

* feat: test code for lambda function get-omgs-list 2

* feat: test code for lambda get imgs list

* feat: test code for lambda get imgs list 2

* feat: test code for lambda get imgs list 3

* chore: solve the existed name problem of DBReadRole

* fix: adsApi lambda function problem (#342)

* fix: forum ads api second (#343)

* fix: adsApi lambda function problem

* fix: adsApi lambda function problem second

* fix: forum ads api third (#344)

* fix: adsApi lambda function problem

* fix: adsApi lambda function problem second

* fix: adsApi lambda function problem third

* chore: fix sync imgs (#345)

* feat: refinesyncimgs (#346)

* chore: fix sync imgs

* chore: fix sync imgs2

* chore: fix sync imgs3

* feat: refinesyncimgs3 (#347)

* chore: fix sync imgs

* chore: fix sync imgs2

* chore: fix sync imgs3

* chore: fix sync imgs5

* feat: refinesyncimgs (#348)

* chore: fix sync imgs

* chore: fix sync imgs2

* chore: fix sync imgs3

* chore: fix sync imgs5

* fix: syncimgsneo

* feat: refinesyncimgsneo (#349)

* chore: fix sync imgs

* chore: fix sync imgs2

* chore: fix sync imgs3

* chore: fix sync imgs5

* fix: syncimgsneo

* fix: syncimgsneo2

* feat: updatesyncimgs (#350)

* chore: fix sync imgs

* chore: fix sync imgs2

* chore: fix sync imgs3

* chore: fix sync imgs5

* fix: syncimgsneo

* fix: syncimgsneo2

* fix: syncimgsneo3

* fix: syncimgsneo4

* feat: neosyncimgs (#351)

* chore: fix sync imgs

* chore: fix sync imgs2

* chore: fix sync imgs3

* chore: fix sync imgs5

* fix: syncimgsneo

* fix: syncimgsneo2

* fix: syncimgsneo3

* fix: syncimgsneo4

* fix: syncimgsneo

* fix: my new fix (#353)

* fix: my new fix2 (#354)

* feat: implement forum comment author (#355)

* feat: implement forum comment author new (#356)

* feat: implement forum comment author new2 (#357)

* feat: exporting value for career (#358)

* feat: exporting value for carreer

* fix: changing authro to author in get comments lambda

* feat: getting rid of stack reference connection (#359)

* feat: get adsnew (#360)

* feat: improve getads lambda

* feat: improve getads lambda2

* feat: imporve get ads (#361)

* feat: update ad count feature (#363)

* feat: adding lambdas and rest api services for micro service career (#362)

* feat: career api services made with sync pipeline functions

* feat: adding career sync

* feat: career rest api services

* feat: adding sync lambda

* feat: adding lambdas

* feat: retrieving monthly data (#364)

* fix: fixing key from thread id to univ id

* fix: disabling authorizer for thread teest

* fix: fixing type error

* fix: fixing type for keycondition expressions

* fix: changing logic to get 10 most recent

* feat: adding indexname

* fix: adding logging for debug

* feat: adding extended encoder for encode a set to a list

* feat: adding base function for bedrock (#365)

* fix: fixing logical identifier

* fix: fixing logical id for snyc role

* feat: init prompt engineering (#366)

* feat: init prompt engineering

* feat: chaning return value

* fix: fixing prompt

* chore: fixing prompt

* chore: fixing prompt to direct json response

* chore: finalizing prompt generation

* fix: encrease timeout for inject lambda

* chore: returning none for inject threads

* fix: fixing table name

* feat: update boto3 layer (#367)

* feat: updating boto3 layer for bedrock

* feat: adding latest boto 3 layer to inject function

* fix: fixing layer version name

* feat: updating boto 3 again

* chore: adding print to debug inject threads

* feat: adding boto3 python packages (#368)

* feat: successful boto3 upgrade testing prompt generation

* feat: legendary moment to test out bedrock (#369)

* fix: direct fix follow the prompt convention

* feat: adding temperatuire for prompt

* fix: solving type error for fetched data

* fix: fixing list comprehension

* fix: fixing type

* feat: finalizing injecting thread (#370)

* fix: fixing module import of datetime utils

* fix: fixing prompt

* fix: fixing prompt back

* fix: fixing prompt to ensure format

* fix: adding another prompt restraint

* fix: prompt engineering sucks

* feat: inject comment2 (#372)

* feat: inject-comments

* feat: inject-comments2

* feat: inject-comments2

* feat: inject-comments3 (#373)

* feat: inject-comments4 (#374)

* feat: inject-comments5 (#375)

* feat: inject-comments6 (#376)

* fix: inject-comments (#377)

* feat: user profile api2 (#379)

* feat: user profile api

* feat: user profile api2

* feat: user profile api3

* feat: user profile api3

* feat: lambda function update (#380)

* feat: user profile api5 (#382)

* fix: fix rest api deployment error on profile api

* fix: fix rest api deployment error on profile api2

* fix: fix rest api deployment error on profile api2

* fix: database custom tablename deployment error (#383)

* feat: update post-profile lambda (#384)

* feat: adding authorizer to get user profile lambda

* feat: adding authorizer to delete and get

* feat: update profile lambda (#385)

* feat: updating profile schema

* feat: updating schema for post and patch for user profile api

* feat: changing logic for post profile lambda

* feat: adding function extract and format date

* feat: adding print statements for debugging

* feat: adding more print statements

* feat: fixing logic for post profile

* fix: chaning string to integer

* fix: fixing patch profile

* fix: aws reserve name fix

* fix: get-career urls

* fix: sync-career property names

* fix: fix sync career lambda

* feat: fixing image url generation

* chore: fixing logical error in get career lambda

* chore: pushing unsaved changes in get career

* fix: sync career was neglecting the image extensions

* feat: adding micro app (#386)

* feat: adding debug prints and job id generation for sync career

* chore(deps): update dependency pillow to v10 [security] (#336)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: career post application lambda creation (#387)

* feat: creation of lambda which posts and updates career table for application

* feat: adding some user data into api post application

* fix: changing integration to post from get for career rest functions

* fix: changing id and role name

* fix: fixing db resource to db client for more functionality

* feat: popping data and fixing data type for transact  (#388)

* feat: fixing post application lambda

* fix: pop user information

* chore: cleaning up unused object

---------

Co-authored-by: Y.H LIEN <[email protected]>

* feat: adding applicant count

* feat: adding type fix

* fix: get career lambda and add applied flag

* fix: fixing expression attribute name and update expressions for lambda patch profile

* fix: fixing keys for patch profile

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Y.H LIEN <[email protected]>
Co-authored-by: Y.H LIEN <[email protected]>
  • Loading branch information
4 people authored Nov 17, 2023
1 parent 1ad464c commit 481c937
Show file tree
Hide file tree
Showing 2,082 changed files with 1,805,171 additions and 333 deletions.
50 changes: 25 additions & 25 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ env:
node: true
root: true
plugins:
- "@typescript-eslint"
- '@typescript-eslint'
- import
parser: "@typescript-eslint/parser"
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 2018
sourceType: module
project: "./tsconfig.json"
project: './tsconfig.json'
extends:
- "eslint:recommended"
- "plugin:@typescript-eslint/eslint-recommended"
- "plugin:@typescript-eslint/recommended"
- "plugin:import/typescript"
- 'eslint:recommended'
- 'plugin:@typescript-eslint/eslint-recommended'
- 'plugin:@typescript-eslint/recommended'
- 'plugin:import/typescript'
settings:
import/parsers:
"@typescript-eslint/parser":
- ".ts"
- ".tsx"
'@typescript-eslint/parser':
- '.ts'
- '.tsx'
import/resolver:
node: { }
node: {}
typescript:
project: "./tsconfig.json"
project: './tsconfig.json'
alwaysTryTypes: true
ignorePatterns:
- "*.js"
- "!.projenrc.js"
- "*.d.ts"
- '*.js'
- '!.projenrc.js'
- '*.d.ts'
- node_modules/
- "*.generated.ts"
- '*.generated.ts'
- coverage
rules:
indent:
- 'off'
"@typescript-eslint/indent":
'@typescript-eslint/indent':
- error
- 2
quotes:
Expand Down Expand Up @@ -81,7 +81,7 @@ rules:
- error
- multi-line
- consistent
"@typescript-eslint/member-delimiter-style":
'@typescript-eslint/member-delimiter-style':
- error
semi:
- error
Expand All @@ -97,13 +97,13 @@ rules:
quote-props:
- error
- consistent-as-needed
"@typescript-eslint/no-require-imports":
'@typescript-eslint/no-require-imports':
- error
import/no-extraneous-dependencies:
- error
- devDependencies:
- "**/test/**"
- "**/build-tools/**"
- '**/test/**'
- '**/build-tools/**'
optionalDependencies: false
peerDependencies: true
import/no-unresolved:
Expand All @@ -120,25 +120,25 @@ rules:
- error
no-shadow:
- 'off'
"@typescript-eslint/no-shadow":
'@typescript-eslint/no-shadow':
- error
key-spacing:
- error
no-multiple-empty-lines:
- error
"@typescript-eslint/no-floating-promises":
'@typescript-eslint/no-floating-promises':
- error
no-return-await:
- 'off'
"@typescript-eslint/return-await":
'@typescript-eslint/return-await':
- error
no-trailing-spaces:
- error
dot-notation:
- error
no-bitwise:
- error
"@typescript-eslint/member-ordering":
'@typescript-eslint/member-ordering':
- error
- default:
- public-static-field
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
COGNITO_AFFILIATE_REGION: ${{ secrets.COGNITO_AFFILIATE_REGION }}
AWS_USER_POOL_ID: ${{secrets.AWS_USER_POOL_ID}}
GOOGLE_OAUTH_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
GOOGLE_OAUTH_CLIENT_SECRET: ${{ secrets.GOOGLE_OAUTH_CLIENT_SECRET }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
Expand All @@ -24,6 +25,7 @@ env:
DEPLOY_KEY: ${{ secrets.FEEDS_DEPLOY_PRIVATE_KEY }}
MASTER_VITE_GA_ID: ${{secrets.VITE_GA_ID}}
DEV_VITE_GA_ID: ${{secrets.DEV_VITE_GA_ID}}
UID: ${{secrets.UID}}
STAGE: dev

jobs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
COGNITO_AFFILIATE_REGION: ${{ secrets.COGNITO_AFFILIATE_REGION }}
AWS_USER_POOL_ID: ${{secrets.AWS_USER_POOL_ID}}
GOOGLE_OAUTH_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
GOOGLE_OAUTH_CLIENT_SECRET: ${{ secrets.GOOGLE_OAUTH_CLIENT_SECRET }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
Expand All @@ -31,6 +32,7 @@ env:
DEPLOY_KEY: ${{ secrets.FEEDS_DEPLOY_PRIVATE_KEY }}
MASTER_VITE_GA_ID: ${{secrets.VITE_GA_ID}}
DEV_VITE_GA_ID: ${{secrets.DEV_VITE_GA_ID}}
UID: ${{secrets.UID}}
STAGE: dev

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
COGNITO_AFFILIATE_REGION: ${{ secrets.COGNITO_AFFILIATE_REGION }}
AWS_USER_POOL_ID: ${{secrets.AWS_USER_POOL_ID}}
GOOGLE_OAUTH_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
GOOGLE_OAUTH_CLIENT_SECRET: ${{ secrets.GOOGLE_OAUTH_CLIENT_SECRET }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
Expand Down
164 changes: 164 additions & 0 deletions lib/configs/api-gateway/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,170 @@ export const forumCommentPatchReqSchema: apigw.JsonSchema = {
required: ['data'],
};

export const userProfileGetRespSchema: apigw.JsonSchema = {
schema: apigw.JsonSchemaVersion.DRAFT7,
type: apigw.JsonSchemaType.OBJECT,
properties: {
data: {
type: apigw.JsonSchemaType.OBJECT,
properties: {
name: {
type: apigw.JsonSchemaType.STRING,
},
email: {
type: apigw.JsonSchemaType.STRING,
},
year: {
type: apigw.JsonSchemaType.STRING,
},
class_of: {
type: apigw.JsonSchemaType.STRING,
},
language: {
type: apigw.JsonSchemaType.ARRAY,
items: {
type: apigw.JsonSchemaType.OBJECT,
properties: {
language: { type: apigw.JsonSchemaType.STRING },
level: { type: apigw.JsonSchemaType.STRING },
},
},
},
interests: {
type: apigw.JsonSchemaType.ARRAY,
items: { type: apigw.JsonSchemaType.STRING },
},
school: {
type: apigw.JsonSchemaType.STRING,
},
created_at: {
type: apigw.JsonSchemaType.STRING,
},
updated_at: {
type: apigw.JsonSchemaType.STRING,
},
},
required: [
'name',
'email',
'year',
'class_of',
'languages',
'interests',
'school',
'create_at',
'updated_at',
],
},
message: {
type: apigw.JsonSchemaType.STRING,
},
},
required: ['success', 'data', 'message'],
};

export const userProfilePostReqSchema: apigw.JsonSchema = {
schema: apigw.JsonSchemaVersion.DRAFT7,
type: apigw.JsonSchemaType.OBJECT,
properties: {
data: {
type: apigw.JsonSchemaType.OBJECT,
properties: {
name: {
type: apigw.JsonSchemaType.STRING,
},
email: {
type: apigw.JsonSchemaType.STRING,
},
year: {
type: apigw.JsonSchemaType.STRING,
},
class_of: {
type: apigw.JsonSchemaType.STRING,
},
languages: {
type: apigw.JsonSchemaType.ARRAY,
items: {
type: apigw.JsonSchemaType.OBJECT,
properties: {
language: { type: apigw.JsonSchemaType.STRING },
level: { type: apigw.JsonSchemaType.STRING },
},
},
},
interests: {
type: apigw.JsonSchemaType.ARRAY,
items: { type: apigw.JsonSchemaType.STRING },
},
school: {
type: apigw.JsonSchemaType.STRING,
},
},
required: [
'name',
'email',
'year',
'class_of',
'languages',
'interests',
'school',
],
},
},
required: ['data'],
};

export const userProfilePatchReqSchema: apigw.JsonSchema = {
schema: apigw.JsonSchemaVersion.DRAFT7,
type: apigw.JsonSchemaType.OBJECT,
properties: {
data: {
type: apigw.JsonSchemaType.OBJECT,
properties: {
name: {
type: apigw.JsonSchemaType.STRING,
},
email: {
type: apigw.JsonSchemaType.STRING,
},
year: {
type: apigw.JsonSchemaType.STRING,
},
class_of: {
type: apigw.JsonSchemaType.STRING,
},
languages: {
type: apigw.JsonSchemaType.ARRAY,
items: {
type: apigw.JsonSchemaType.OBJECT,
properties: {
language: { type: apigw.JsonSchemaType.STRING },
level: { type: apigw.JsonSchemaType.STRING },
},
},
},
interests: {
type: apigw.JsonSchemaType.ARRAY,
items: { type: apigw.JsonSchemaType.STRING },
},
school: {
type: apigw.JsonSchemaType.STRING,
},
},
required: [
'name',
'email',
'year',
'class_of',
'languages',
'interests',
'school',
],
},
},
required: ['data'],
};

export const baseJsonApiSchema: apigw.JsonSchema = {
schema: apigw.JsonSchemaVersion.DRAFT7,
type: apigw.JsonSchemaType.OBJECT,
Expand Down
3 changes: 2 additions & 1 deletion lib/configs/common/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const enum DataEndpoint {
COURSE,
THREAD,
COMMENT,
ADS, //! New ADS value
ADS,
PROFILE, //! New ADS value
}

export enum OperationEndpoint {
Expand Down
5 changes: 4 additions & 1 deletion lib/configs/lambda/environment.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export const GOOGLE_API_SERVICE_ACCOUNT_INFO = process.env.GOOGLE_API_SERVICE_ACCOUNT_INFO!;
export const GOOGLE_API_SERVICE_ACCOUNT_INFO =
process.env.GOOGLE_API_SERVICE_ACCOUNT_INFO!;

export const SLACK_WEBHOOK_URL = process.env.SLACK_WEBHOOK_URL!;

export const AWS_USER_POOL_ID = process.env.AWS_USER_POOL_ID!;
Binary file not shown.
Binary file not shown.
54 changes: 54 additions & 0 deletions lib/configs/lambda/python_packages/bin/jp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!c:\users\joonb\appdata\local\programs\python\python39\python.exe

import sys
import json
import argparse
from pprint import pformat

import jmespath
from jmespath import exceptions


def main():
parser = argparse.ArgumentParser()
parser.add_argument('expression')
parser.add_argument('-f', '--filename',
help=('The filename containing the input data. '
'If a filename is not given then data is '
'read from stdin.'))
parser.add_argument('--ast', action='store_true',
help=('Pretty print the AST, do not search the data.'))
args = parser.parse_args()
expression = args.expression
if args.ast:
# Only print the AST
expression = jmespath.compile(args.expression)
sys.stdout.write(pformat(expression.parsed))
sys.stdout.write('\n')
return 0
if args.filename:
with open(args.filename, 'r') as f:
data = json.load(f)
else:
data = sys.stdin.read()
data = json.loads(data)
try:
sys.stdout.write(json.dumps(
jmespath.search(expression, data), indent=4, ensure_ascii=False))
sys.stdout.write('\n')
except exceptions.ArityError as e:
sys.stderr.write("invalid-arity: %s\n" % e)
return 1
except exceptions.JMESPathTypeError as e:
sys.stderr.write("invalid-type: %s\n" % e)
return 1
except exceptions.UnknownFunctionError as e:
sys.stderr.write("unknown-function: %s\n" % e)
return 1
except exceptions.ParseError as e:
sys.stderr.write("syntax-error: %s\n" % e)
return 1


if __name__ == '__main__':
sys.exit(main())
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip
Loading

0 comments on commit 481c937

Please sign in to comment.