munierujp / aws-lambda-ts-architecture-example Goto Github PK
View Code? Open in Web Editor NEWArchitecture for AWS Lambda with TypeScript
License: MIT License
Architecture for AWS Lambda with TypeScript
License: MIT License
in src/usecases/userGetter.ts
:
import type { User } from '../domain/models'
in test/usecases/userGetter.test.ts
:
import type { User } from '../../src/domain/models'
~
is alias for root dir.
in src/usecases/userGetter.ts
:
import type { User } from '~/domain/models'
in test/usecases/userGetter.test.ts
:
import type { User } from '~/domain/models'
This issue provides visibility into Renovate updates and their statuses. Learn more
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@jest/types
, @types/jest
, jest
)@jest/types
, jest
, ts-jest
)Add test for validation in test/handlers/users_userId.test.ts
update Node to v14.17.0
https://docs.aws.amazon.com/lambda/latest/dg/lambda-nodejs.html
replace tsconfigs to @tsconfig/node12
import { userGetter } from '../usecases'
const executor = new userGetter.Executor({
userId,
userRepo
})
const result = await executor.execute()
import { UserGetter } from '../usecases'
const userGettter = new UserGetter({ userRepo })
const result = await userGettter.get(userId)
remove lambda-tester
"clean": "rimraf dist",
"prebuild": "npm run clean",
The name "Interfaces" is the same as TypeScript's Interfaces, which is confusing.
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
Follow RFC 7807 as error response format
Add get
method (private method) to UserRepository (src/interfaces/dynamodb/UserRepository.ts
) and use it in findById
method.
export class UserRepository implements repositories.UserRepository {
async findById (id: string): Promise<User> {
const user = await this.get({ id })
return user as User
}
private async get (key) {
const result = await this.db.get({
TableName: this.tableName,
Key: key
}).promise()
const item = result.Item
if (item === undefined || isEmpty(item)) {
throw new UserNotFoundError('user not found')
}
return item
}
}
const userRepo = new UserRepository({
db,
tableName: 'users'
})
const userRepo = new UserRepository(db)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.