Gathering detailed insights and metrics for @gapi/sequelize
Gathering detailed insights and metrics for @gapi/sequelize
Gathering detailed insights and metrics for @gapi/sequelize
Gathering detailed insights and metrics for @gapi/sequelize
npm install @gapi/sequelize
Typescript
Module System
Node Version
NPM Version
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
798 Commits
1 Watchers
20 Branches
1 Contributors
Updated on Jan 31, 2020
Latest Version
1.8.151
Package Id
@gapi/sequelize@1.8.151
Unpacked Size
11.31 kB
Size
3.84 kB
File Count
13
NPM Version
6.14.18
Node Version
14.21.3
Published on
Jun 18, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
1
1$ npm install @gapi/sequelize --save
1 2import { Module } from '@rxdi/core'; 3import { SequelizeModule } from '@gapi/sequelize'; 4 5@Module({ 6 imports: [ 7 SequelizeModule.forRoot({ 8 dialect: 'postgres', 9 host: process.env.DB_HOST || '', 10 port: process.env.DB_PORT || 5432, 11 username: process.env.DB_USERNAME || '', 12 password: process.env.DB_PASSWORD || '', 13 database: process.env.DB_NAME || 'your-database', 14 storage: ':memory:', 15 logging: false, 16 modelPaths: [process.cwd() + '/src/models'], 17 force: false 18 }) 19 ] 20}) 21export class CoreModule { }
1 2import { 3 Table, 4 Column, 5 Model, 6 CreatedAt, 7 UpdatedAt, 8 DeletedAt, 9 PrimaryKey, 10 AutoIncrement, 11 HasMany, 12 DataType, 13 BelongsToMany 14} from 'sequelize-typescript'; 15 16export interface UserSettings { 17 sidebar: boolean; 18} 19 20@Table 21export class User extends Model<User> { 22 23 @PrimaryKey 24 @AutoIncrement 25 @Column 26 id: number; 27 28 @Column 29 name: string; 30 31 @Column({ 32 type: DataType.ENUM({ values: ['ADMIN', 'USER'] }) 33 }) 34 type: 'ADMIN' | 'USER'; 35 36 @Column({ 37 type: DataType.JSONB, 38 allowNull: true 39 }) 40 settings: UserSettings; 41 42 43 @CreatedAt 44 creationDate: Date; 45 46 @UpdatedAt 47 updatedOn: Date; 48 49 @DeletedAt 50 deletionDate: Date; 51 52} 53
1import { Service } from "@rxdi/core"; 2import { UserType } from "../types/user.type"; 3import { User } from '../../../models/User'; 4 5@Service() 6export class AnotherService { 7 trimFirstLetter(username: string): string { 8 return username.charAt(1); 9 } 10} 11 12@Service() 13export class UserService { 14 constructor( 15 private anotherService: AnotherService 16 ) { } 17 18 async findUser(id: number): Promise<User> { 19 return await User.findOne({ where: { id: id } }); 20 } 21 22 async addUser(user: User): Promise<User> { 23 return await User.create(user); 24 } 25 26 async deleteUser(id: number) { 27 return await User.destroy({ where: { id: id } }); 28 } 29 30 async updateUser(user: User) { 31 return await User.update(user, { 32 where: { 33 id: user.id 34 } 35 }) 36 } 37 38} 39
1import { Service } from '@rxdi/core'; 2import { SequelizeService } from '@gapi/sequelize'; 3 4@Service() 5export class SequelizePrivateService extends SequelizeService implements SequelizeService { 6 sequelize: Sequelize; 7 constructor() { 8 super({ 9 dialect: 'postgres', 10 host: process.env.DB_HOST || '', 11 port: process.env.DB_PORT || '5432', 12 username: process.env.DB_USERNAME || '', 13 password: process.env.DB_PASSWORD || '', 14 name: process.env.DB_NAME || 'your-database', 15 storage: ':memory:', 16 logging: false, 17 modelPaths: [process.cwd() + '/src/models'], 18 force: false 19 }) 20 } 21} 22
1import { Module } from '@rxdi/core'; 2import { SequelizeModule } from '@gapi/sequelize'; 3import { SequelizePrivateService } from './services/sequelize/sequelize.service.ts'; 4 5@Module({ 6 services: [SequelizePrivateService] 7}) 8export class CoreModule { } 9
TODO: Better documentation...
Enjoy ! :)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
21 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More