Skip to content
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

Fix lint #26

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b2c5415
style: fix style files grpc adapter
OsirisAnubiz Nov 1, 2024
b60be9f
style: fix style files protos upload
OsirisAnubiz Nov 1, 2024
df4b6fd
style: fix lint files protos files
OsirisAnubiz Nov 1, 2024
005bb33
style: fix lint gateway upload mutations
OsirisAnubiz Nov 1, 2024
3b2e754
style: fix lint files entrypoints service entrypoint
OsirisAnubiz Nov 1, 2024
9b186af
style: fix lint files core infrastructure module
OsirisAnubiz Nov 1, 2024
3246e98
style: fix list files core domain module
OsirisAnubiz Nov 1, 2024
5cc6352
style: fix lint files core application module
OsirisAnubiz Nov 1, 2024
ee5f683
style: fix lint files adapters
OsirisAnubiz Nov 1, 2024
610ccf8
style: fix lint files adapters buckets config adapter
OsirisAnubiz Nov 1, 2024
27ba249
style: fix lint files cqrs adapter
OsirisAnubiz Nov 1, 2024
f302006
feat: partial change nest to 10 version
OsirisAnubiz Nov 5, 2024
be537fd
feat: update files core infrastructure module
OsirisAnubiz Nov 6, 2024
82b85fa
feat: update files entrypoint dependency
OsirisAnubiz Nov 6, 2024
8c71e8c
feat: update files gateway nest dependencies
OsirisAnubiz Nov 6, 2024
aa70019
feat: update files gateway mutations dependencies
OsirisAnubiz Nov 6, 2024
a8b8237
feat: update files gateway upload types nest dependencies
OsirisAnubiz Nov 6, 2024
e3395a1
fix: dependency files core infrastructure module
OsirisAnubiz Nov 6, 2024
4064922
chore: remove package extentions
OsirisAnubiz Nov 6, 2024
32ccc0e
chore: add package extentions with versions
OsirisAnubiz Nov 6, 2024
5fc4374
chore: update atls dependency
OsirisAnubiz Nov 6, 2024
e300cfc
chore: update dependencies
OsirisAnubiz Nov 7, 2024
f95abdf
chore: partial fix build protos upload and files
OsirisAnubiz Nov 7, 2024
04ffcb7
fix: build files proto upload
OsirisAnubiz Nov 7, 2024
8cd535b
chore: update yarn
OsirisAnubiz Nov 7, 2024
79bfc9f
fix: typecheck
OsirisAnubiz Nov 7, 2024
8213c8f
chore: update atls core runtime
OsirisAnubiz Nov 7, 2024
faf130c
chore: update atls nestjs grpc playground
OsirisAnubiz Nov 7, 2024
4a7c5ce
chore: update uuid
OsirisAnubiz Nov 7, 2024
284efbf
chore: update types uuid
OsirisAnubiz Nov 7, 2024
b84c6ee
chore: delete not used grpc proto loader
OsirisAnubiz Nov 7, 2024
b566410
chore: update nestjs graphql
OsirisAnubiz Nov 7, 2024
142a48c
chore: update nestjs graphql
OsirisAnubiz Nov 7, 2024
4ddd296
chore: update types node
OsirisAnubiz Nov 7, 2024
91c7920
chore: update long
OsirisAnubiz Nov 7, 2024
5992892
chore: update jsonwebtoken
OsirisAnubiz Nov 7, 2024
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
5 changes: 1 addition & 4 deletions .config/husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commit message lint
yarn commit message lint
5 changes: 1 addition & 4 deletions .config/husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commit staged
yarn commit staged
5 changes: 1 addition & 4 deletions .config/husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commit message $@
yarn commit message $@
6,132 changes: 2,916 additions & 3,216 deletions .pnp.cjs

Large diffs are not rendered by default.

2,248 changes: 0 additions & 2,248 deletions .yarn/releases/yarn-0.0.1-git.20220304.hash-6afc8ff.cjs

This file was deleted.

2,248 changes: 0 additions & 2,248 deletions .yarn/releases/yarn-0.0.1-git.20220325.hash-c66fcd9.cjs

This file was deleted.

1,160 changes: 556 additions & 604 deletions .yarn/releases/yarn.cjs

Large diffs are not rendered by default.

76 changes: 17 additions & 59 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,71 +7,29 @@ enableGlobalCache: true
globalFolder: ../.yarn/berry

packageExtensions:
'@atls/nestjs-grpc-http-proxy@*':
'@nestjs/core@10.4.7':
dependencies:
express: '*'
'@atls/nestjs-grpc-reflection@*':
'@nestjs/websockets': '10.4.7'
'@nestjs/websockets@10.4.7':
dependencies:
long: '*'
protobufjs: '*'
'@atls/typeorm-logger@*':
'@nestjs/platform-socket.io': '10.4.7'
'@nestjs/microservices@10.4.7':
dependencies:
typeorm: '*'
'@grpc/grpc-js@*':
'@nestjs/websockets': '10.4.7'
'kafkajs': '2.2.4'
'@grpc/proto-loader': '0.7.13'
'ioredis': '5.4.1'
'amqplib': '0.10.4'
'amqp-connection-manager': '4.1.14'
'@atls/nestjs-grpc-reflection@0.0.15':
dependencies:
'@types/long': '*'
'@nestjs/common@*':
'long': '5.2.3'
'@atls/nestjs-grpc-reflection@0.0.14':
dependencies:
'@grpc/proto-loader': '*'
cache-manager: '*'
reflect-metadata: '*'
rxjs: '*'
'@nestjs/core@*':
'long': '5.2.3'
'@grpc/grpc-js@1.5.7':
dependencies:
'@nestjs/platform-express': '*'
'@nestjs/websockets': '*'
reflect-metadata: '*'
rxjs: '*'
'@nestjs/cqrs@*':
dependencies:
reflect-metadata: '*'
rxjs: '*'
'@nestjs/microservices@*':
dependencies:
'@grpc/grpc-js': '*'
'@grpc/proto-loader': '*'
'@nestjs/websockets': '*'
kafkajs: '*'
'@nestjs/typeorm@*':
dependencies:
rxjs: '*'
'@nestjs/websockets@*':
dependencies:
'@nestjs/platform-socket.io': '*'
debug@*:
dependencies:
supports-color: '*'
eslint-module-utils@*:
dependencies:
eslint-import-resolver-node: '*'
follow-redirects@*:
dependencies:
debug: '*'
pg-cursor@*:
dependencies:
pg: '*'
pino@*:
dependencies:
pino-pretty: '*'
typeorm@*:
dependencies:
pg: '*'
pg-query-stream: '*'
sqlite3: '*'
ws@*:
dependencies:
bufferutil: '*'
utf-8-validate: '*'
'long': '5.2.3'

pnpEnableEsmLoader: true

Expand Down
18 changes: 10 additions & 8 deletions files/adapters/buckets-config-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
"version": "0.0.1",
"private": true,
"license": "BSD-3-Clause",
"type": "module",
"main": "src/index.ts",
"dependencies": {
"@files/domain-module": "workspace:0.0.1"
"@files/domain-module": "workspace:*"
},
"devDependencies": {
"@atls/logger": "0.0.1",
"@nestjs/common": "^8.3.1",
"@nestjs/core": "^8.3.1",
"@nestjs/cqrs": "^8.0.2"
"@atls/logger": "0.0.2",
"@jest/globals": "29.7.0",
"@nestjs/common": "10.4.7",
"@nestjs/core": "10.4.7",
"@nestjs/cqrs": "10.2.8"
},
"peerDependencies": {
"@nestjs/common": "^8.0.4",
"@nestjs/core": "^8.0.4",
"@nestjs/cqrs": "^8.0.2"
"@nestjs/common": "^10",
"@nestjs/core": "^10",
"@nestjs/cqrs": "^10"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { FilesBucketsEnvConfig } from './files-application-env.config'
import { describe } from '@jest/globals'
import { afterAll } from '@jest/globals'
import { expect } from '@jest/globals'
import { it } from '@jest/globals'

import { FilesBucketsEnvConfig } from './files-application-env.config.js'

describe('files buckets env config', () => {
const originalEnv = process.env
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
import { Logger } from '@atls/logger'
import type { FilesBucketsConfigAdapterOptionsFactory } from '../module/index.js'
import type { FilesBucketsConfigAdapterModuleOptions } from '../module/index.js'

import { FilesBucketType } from '@files/domain-module'
import { Logger } from '@atls/logger'

import { FilesBucketsConfigAdapterOptionsFactory } from '../module'
import { FilesBucketsConfigAdapterModuleOptions } from '../module'
import { FilesBucketType } from '@files/domain-module'

type BucketCondition = {
type: string
length: {
min: number
max: number
}
}

type BucketConfig = {
name: string
type: FilesBucketType
bucket: string
path: string
hostname: string | undefined
expiration: number
conditions: BucketCondition
}

export class FilesBucketsEnvConfig implements FilesBucketsConfigAdapterOptionsFactory {
static FILES_BUCKETS_ENV_PREFIX = 'FILES_BUCKETS'

private readonly logger = new Logger(FilesBucketsEnvConfig.name)

static FILES_BUCKETS_ENV_PREFIX = 'FILES_BUCKETS'
createFilesBucketsConfigOptions(): FilesBucketsConfigAdapterModuleOptions {
return {
buckets: this.getBuckets(),
}
}

protected getAvailableBuckets(): string[] {
const bucketKeys: string[] = Object.keys(process.env).filter((key) =>
protected getAvailableBuckets(): Array<string> {
const bucketKeys: Array<string> = Object.keys(process.env).filter((key) =>
key.startsWith(FilesBucketsEnvConfig.FILES_BUCKETS_ENV_PREFIX))

return bucketKeys.reduce((result: string[], key) => {
return bucketKeys.reduce((result: Array<string>, key) => {
const [scope] = key
.replace(FilesBucketsEnvConfig.FILES_BUCKETS_ENV_PREFIX, '')
.substr(1)
Expand All @@ -29,13 +53,13 @@ export class FilesBucketsEnvConfig implements FilesBucketsConfigAdapterOptionsFa
}, [])
}

protected getValueFromEnv(...args) {
protected getValueFromEnv(...args: Array<string>): string {
const key = [FilesBucketsEnvConfig.FILES_BUCKETS_ENV_PREFIX, ...args].join('_').toUpperCase()

return process.env[key]
return process.env[key]!
}

protected getBucketConditions(scope: string) {
protected getBucketConditions(scope: string): BucketCondition {
// TODO: validate content type
let type = this.getValueFromEnv(scope, 'conditions', 'type')
let min = Number(this.getValueFromEnv(scope, 'conditions', 'length', 'min'))
Expand Down Expand Up @@ -70,7 +94,7 @@ export class FilesBucketsEnvConfig implements FilesBucketsConfigAdapterOptionsFa
}
}

protected getBucketConfig(scope: string) {
protected getBucketConfig(scope: string): BucketConfig {
const type = (this.getValueFromEnv(scope, 'type') as FilesBucketType) || FilesBucketType.PRIVATE
const bucket = this.getValueFromEnv(scope, 'bucket')
const path = this.getValueFromEnv(scope, 'path') || '/'
Expand Down Expand Up @@ -98,13 +122,7 @@ export class FilesBucketsEnvConfig implements FilesBucketsConfigAdapterOptionsFa
}
}

protected getBuckets() {
protected getBuckets(): Array<BucketConfig> {
return this.getAvailableBuckets().map((scope) => this.getBucketConfig(scope))
}

createFilesBucketsConfigOptions(): FilesBucketsConfigAdapterModuleOptions {
return {
buckets: this.getBuckets(),
}
}
}
2 changes: 1 addition & 1 deletion files/adapters/buckets-config-adapter/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './files-application-env.config'
export * from './files-application-env.config.js'
6 changes: 3 additions & 3 deletions files/adapters/buckets-config-adapter/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './registry'
export * from './config'
export * from './module'
export * from './registry/index.js'
export * from './config/index.js'
export * from './module/index.js'
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import { ModuleMetadata } from '@nestjs/common/interfaces'
import { Type } from '@nestjs/common/interfaces'

import { FilesBucket } from '@files/domain-module'
import type { FilesBucket } from '@files/domain-module'
import type { ModuleMetadata } from '@nestjs/common/interfaces'
import type { Type } from '@nestjs/common/interfaces'

export interface FilesBucketsConfigAdapterModuleOptions {
buckets: Array<FilesBucket>
}

export interface FilesBucketsConfigAdapterOptionsFactory {
createFilesBucketsConfigOptions():
| Promise<FilesBucketsConfigAdapterModuleOptions>
createFilesBucketsConfigOptions: () =>
| FilesBucketsConfigAdapterModuleOptions
| Promise<FilesBucketsConfigAdapterModuleOptions>
}

export interface FilesBucketsConfigAdapterModuleAsyncOptions
extends Pick<ModuleMetadata, 'imports'> {
useExisting?: Type<FilesBucketsConfigAdapterOptionsFactory>
useClass?: Type<FilesBucketsConfigAdapterOptionsFactory>
useFactory?: (
...args: any[]
) => Promise<FilesBucketsConfigAdapterModuleOptions> | FilesBucketsConfigAdapterModuleOptions
inject?: any[]
...args: Array<any>
) => FilesBucketsConfigAdapterModuleOptions | Promise<FilesBucketsConfigAdapterModuleOptions>
inject?: Array<any>
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { Provider } from '@nestjs/common'
import type { Provider } from '@nestjs/common'

import { FilesBucketsRegistry } from '../registry'
import { FILES_BUCKETS_MODULE_OPTIONS } from './files-buckets-config-adapter-module.constants'
import { FilesBucketsConfigAdapterModuleOptions } from './files-buckets-config-adapter-module.interfaces'
import type { FilesBucketsConfigAdapterModuleOptions } from './files-buckets-config-adapter-module.interfaces.js'

import { FilesBucketsRegistry } from '../registry/index.js'
import { FILES_BUCKETS_MODULE_OPTIONS } from './files-buckets-config-adapter-module.constants.js'

export const createFilesOptionsProvider = (
options?: FilesBucketsConfigAdapterModuleOptions
): Provider[] => [
): Array<Provider> => [
{
provide: FILES_BUCKETS_MODULE_OPTIONS,
useValue: options || {},
},
]

export const createFilesProvider = (): Provider[] => []
export const createFilesProvider = (): Array<Provider> => []

export const createFilesExportsProvider = (): Provider[] => [FilesBucketsRegistry]
export const createFilesExportsProvider = (): Array<Provider> => [FilesBucketsRegistry]
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { DynamicModule } from '@nestjs/common'
import { Module } from '@nestjs/common'
import { Provider } from '@nestjs/common'
import type { DynamicModule } from '@nestjs/common'
import type { Provider } from '@nestjs/common'

import { FILES_BUCKETS_MODULE_OPTIONS } from './files-buckets-config-adapter-module.constants'
import { FilesBucketsConfigAdapterModuleAsyncOptions } from './files-buckets-config-adapter-module.interfaces'
import { FilesBucketsConfigAdapterModuleOptions } from './files-buckets-config-adapter-module.interfaces'
import { FilesBucketsConfigAdapterOptionsFactory } from './files-buckets-config-adapter-module.interfaces'
import { createFilesExportsProvider } from './files-buckets-config-adapter-module.providers'
import { createFilesProvider } from './files-buckets-config-adapter-module.providers'
import { createFilesOptionsProvider } from './files-buckets-config-adapter-module.providers'
import type { FilesBucketsConfigAdapterModuleAsyncOptions } from './files-buckets-config-adapter-module.interfaces.js'
import type { FilesBucketsConfigAdapterModuleOptions } from './files-buckets-config-adapter-module.interfaces.js'
import type { FilesBucketsConfigAdapterOptionsFactory } from './files-buckets-config-adapter-module.interfaces.js'

import { Module } from '@nestjs/common'

import { FILES_BUCKETS_MODULE_OPTIONS } from './files-buckets-config-adapter-module.constants.js'
import { createFilesExportsProvider } from './files-buckets-config-adapter-module.providers.js'
import { createFilesProvider } from './files-buckets-config-adapter-module.providers.js'
import { createFilesOptionsProvider } from './files-buckets-config-adapter-module.providers.js'

@Module({})
export class FilesBucketsConfigAdapterModule {
Expand Down Expand Up @@ -40,7 +42,7 @@ export class FilesBucketsConfigAdapterModule {

private static createAsyncProviders(
options: FilesBucketsConfigAdapterModuleAsyncOptions
): Provider[] {
): Array<Provider> {
if (options.useExisting || options.useFactory) {
return [this.createAsyncOptionsProvider(options)]
}
Expand All @@ -67,7 +69,7 @@ export class FilesBucketsConfigAdapterModule {

return {
provide: FILES_BUCKETS_MODULE_OPTIONS,
useFactory: (optionsFactory: FilesBucketsConfigAdapterOptionsFactory) =>
useFactory: async (optionsFactory: FilesBucketsConfigAdapterOptionsFactory) =>
optionsFactory.createFilesBucketsConfigOptions(),
inject: [options.useExisting! || options.useClass!],
}
Expand Down
6 changes: 3 additions & 3 deletions files/adapters/buckets-config-adapter/src/module/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './files-buckets-config-adapter-module.constants'
export * from './files-buckets-config-adapter-module.interfaces'
export * from './files-buckets-config-adapter.module'
export * from './files-buckets-config-adapter-module.constants.js'
export * from './files-buckets-config-adapter-module.interfaces.js'
export * from './files-buckets-config-adapter.module.js'
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { FilesBucket } from '@files/domain-module'
import type { FilesBucketsRegistryPort } from '@files/domain-module'

import { Injectable } from '@nestjs/common'
import { Inject } from '@nestjs/common'

import { FilesBucket } from '@files/domain-module'
import { FilesBucketsRegistryPort } from '@files/domain-module'

import { FILES_BUCKETS_MODULE_OPTIONS } from '../module'
import { FilesBucketsConfigAdapterModuleOptions } from '../module'
import { FILES_BUCKETS_MODULE_OPTIONS } from '../module/index.js'
import { FilesBucketsConfigAdapterModuleOptions } from '../module/index.js'

@Injectable()
export class FilesBucketsRegistry implements FilesBucketsRegistryPort {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './files-buckets.registry'
export * from './files-buckets.registry.js'
Loading