-
Notifications
You must be signed in to change notification settings - Fork 17
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
EW-1061 TBA #5330
Draft
psachmann
wants to merge
141
commits into
main
Choose a base branch
from
EW-1061
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,943
−1,560
Draft
EW-1061 TBA #5330
Changes from 4 commits
Commits
Show all changes
141 commits
Select commit
Hold shift + click to select a range
cc5da6f
EW-1060 testing the new export via a test endpoint
Fshmit 7729acc
EW-1060 moved linked task to lesson dto
Fshmit 8f27d25
updating esbuild and plugins for esbuild
psachmann 837b4eb
generating files storage api client
psachmann 8015b36
adding files storage client factory and module infrastructure
psachmann 7e4dff8
working on export service
psachmann 414b696
EW-1060 implemented new cc export service via microservice
Fshmit cf66e8f
EW-1060 resolved dependecy of the new cc mapper
Fshmit b456cb8
EW-1060 deleted testing dto of cc export
Fshmit 4eb2890
EW-1060 created some classes instead of interfaces
Fshmit c403e2e
Regenerate lesson api client.
mkreuzkam-cap a531b70
EW-1060 implemented new mapping of lesson content
Fshmit 718f309
EW-1060 modified mapper
Fshmit f980547
Merge branch 'main' into EW-1060
Fshmit 4d198a5
EW-1060 modified mapper of lesson dto
Fshmit 0d53c29
EW-1060 removed items from api property
Fshmit 224c556
Regenerate lesson client.
mkreuzkam-cap ef5334b
regen lesson api.
mkreuzkam-cap 3e2a730
EW-1060 modified mapper of lesson content
Fshmit 709ea25
EW-1060 edited common cartridge mapper
Fshmit a0e6a54
changing factory to adapter
psachmann 3180245
adding file resource to common cartridge
psachmann 0329142
trying file export for boards
psachmann fc5d3e3
EW-1060 added control options of course element
Fshmit 93b64f2
adding file export for tasks and boards
psachmann 43a870d
adding modules to the learn room
psachmann 0a0815b
Merge branch 'main' into EW-1060
Fshmit adc14a1
added logging
psachmann 5f0d0d1
changing parent id
psachmann 4c0f984
changing search id for download files
psachmann dafc36f
changing download mechanics
psachmann d12111c
EW-1060 changed endpoint name of new export
Fshmit 9a145fa
adding logging for files storage service
psachmann 8f7f5b8
EW-1060 changed export endpoint to POST
Fshmit b2c2efd
adding debug logging
psachmann b62b481
adding more debug logging
psachmann 693f7a4
removing some debug logs
psachmann 7686177
changing async code execution
psachmann 794c806
EW-1060 modified mapping of some cc elements
Fshmit 1a29854
temp changes
psachmann 3b0217e
fixing imports for a module
psachmann cc05476
changing the base path
psachmann eaf41d7
changing logging
psachmann 0140db4
changing logging
psachmann 02cc85c
EW-1060 deleted the old export endpoint of cc- microservice
Fshmit 9d9785d
logging
psachmann 5a7daf3
changing logging
psachmann 650f810
changing download mechanics
psachmann 0f4a3be
Merge branch 'main' into EW-1060
Fshmit 2782c16
updating open api definitions
psachmann 5071702
adding some logging
psachmann 7f5f981
changing factory
psachmann 5578a04
changing logging
psachmann ad4c11e
changing logging
psachmann f6dac90
adding logging
psachmann 21379f7
some changes
psachmann 4f89b36
some changes
psachmann c20152e
some changes
psachmann 37af823
changing something
psachmann 94c3e50
changing something
psachmann 9bb6d90
changes
psachmann 5a7cc81
changes
psachmann 3534737
some changes
psachmann ae47b7b
some changes
psachmann a6cab7f
changes
psachmann 258a86b
changes
psachmann 2a019fc
changes
psachmann 34bd381
changes
psachmann b7b79bb
changes
psachmann a632b43
changes
psachmann d4c975f
changes
psachmann 6a443d2
changing controller
psachmann 45a9835
some changes
psachmann 71c464e
some changes
psachmann 6ce857e
updating files storage api
psachmann c2b7542
some changes
psachmann 0c0377c
Merge branch 'EW-1060' into EW-1061
psachmann c7c5851
adding logging
psachmann bf2160a
some changes
psachmann e81ff22
EW-1060 fixed export of cards
Fshmit 1dbe5e9
changing file resource manifest type
psachmann 21e7abe
some bug fixes, probably
psachmann 6dce2d3
hopefully fixing encoding errors
psachmann 17e7942
changing to streams
psachmann fc9689c
logging
psachmann a7a930a
logging
psachmann 780159a
some changes
psachmann 32d7989
changes
psachmann 0f0c026
changes
psachmann 4a4f81c
changes
psachmann d39d76b
changes
psachmann fc75f8b
changes
psachmann c3ca32d
changes
psachmann 00018e9
changes
psachmann e2e87ed
updating the cc micro service
psachmann d692683
EW-1060 fixed export of cards
Fshmit 5487ca8
updating dependencies for c module
psachmann 4a69fb5
naming resources
psachmann ae156b7
EW-1060 changed showen title of a card
Fshmit bc495cc
changes
psachmann e1e1a3e
changing mappers
psachmann 988fcf2
trimming file captions
psachmann 41af4d7
removing temp folder
psachmann 62fa3b6
EW-1060 modified test of export uc
Fshmit dfd978c
removing dead code and linting
psachmann 152a54a
reverting two files
psachmann 9655871
adding tests
psachmann 1f13353
EW-1060 added some logs
Fshmit 1a2323c
Merge branch 'main' into EW-1060
Fshmit c882d53
changes
psachmann c28b45b
some changes
psachmann aa8f20f
Merge branch 'main' into EW-1061
psachmann f799b1d
EW-1060 added test for cc controller
Fshmit 32f2fdd
reverting some files and code cleanup
psachmann ae2804d
reverting file and adding unit tests
psachmann d6102ef
EW-1060 changed some variables name
Fshmit e50495d
EW-1060 added logger module to imports
Fshmit a8789fe
adding unit tests
psachmann fa5b609
Merge branch 'main' into EW-1061
psachmann 485741c
EW-1060 merge main into 1060
Fshmit e502948
adding unit tests and test factories
psachmann 6f6929a
adding unit tests
psachmann 1de75b3
moving method into adapter
psachmann 131bf44
EW-1060 merge main
Fshmit 0599ed3
EW-1060 added tests for cc export service
Fshmit 8823b3b
fixing compile errors
psachmann cf76d3f
adding unit tests
psachmann 034c819
code refactoring
psachmann 4db3c4b
adding check and check:watch npm scripts
psachmann 15d468e
Merge branch 'EW-1060' into EW-1061
psachmann 69f8718
Merge branch 'main' into EW-1061
psachmann 594b5ed
fixing imports
psachmann 6fb8493
linting
psachmann e94d6bc
skipping one test suit
psachmann 780540d
skipping another test suit
psachmann a050214
removing unused test
psachmann 7ec329b
Merge branch 'main' into EW-1061
psachmann 6a209e9
Merge remote-tracking branch 'origin/main' into EW-1061
psachmann 89ffd9b
fixing merge error
psachmann c1ed7ce
Merge branch 'main' into EW-1061
psachmann d08f33e
removing linter warnings
psachmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
apps/server/src/infra/files-storage-client/files-storage-client.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface FilesStorageClientConfig { | ||
FILES_STORAGE__SERVICE_BASE_URL: string; | ||
} |
43 changes: 43 additions & 0 deletions
43
apps/server/src/infra/files-storage-client/files-storage-client.factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Inject, Injectable, UnauthorizedException } from '@nestjs/common'; | ||
import { ConfigService } from '@nestjs/config'; | ||
import { REQUEST } from '@nestjs/core'; | ||
import { extractJwtFromHeader } from '@shared/common'; | ||
import { Request } from 'express'; | ||
import { FilesStorageClientConfig } from './files-storage-client.config'; | ||
import { Configuration, FileApiFactory, FileApiInterface } from './generated'; | ||
|
||
@Injectable() | ||
export class FilesStorageClientFactory { | ||
constructor( | ||
@Inject(REQUEST) private readonly request: Request, | ||
private readonly configService: ConfigService<FilesStorageClientConfig, true> | ||
) {} | ||
|
||
/** | ||
* Creates a new file client and configures it with the provided token or the token from the request. | ||
* @param token can be provided to override the token from the request. | ||
* @returns fully configured file client. | ||
*/ | ||
public createFileClient(token?: string): FileApiInterface { | ||
const client = FileApiFactory( | ||
new Configuration({ | ||
accessToken: this.getJwt(token), | ||
basePath: this.configService.getOrThrow<string>('FILES_STORAGE__SERVICE_BASE_URL'), | ||
}) | ||
); | ||
|
||
return client; | ||
} | ||
|
||
private getJwt(token?: string): () => string { | ||
return () => { | ||
const jwt = token ?? extractJwtFromHeader(this.request); | ||
|
||
if (!jwt) { | ||
throw new UnauthorizedException(); | ||
} | ||
|
||
return jwt; | ||
}; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
apps/server/src/infra/files-storage-client/files-storage-client.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { FilesStorageClientFactory } from './files-storage-client.factory'; | ||
|
||
// TODO: Rename the module, because there is another module with the same name | ||
@Module({ | ||
providers: [FilesStorageClientFactory], | ||
exports: [FilesStorageClientFactory], | ||
}) | ||
export class FilesStorageClientModule {} |
4 changes: 4 additions & 0 deletions
4
apps/server/src/infra/files-storage-client/generated/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
wwwroot/*.js | ||
node_modules | ||
typings | ||
dist |
1 change: 1 addition & 0 deletions
1
apps/server/src/infra/files-storage-client/generated/.npmignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm |
23 changes: 23 additions & 0 deletions
23
apps/server/src/infra/files-storage-client/generated/.openapi-generator-ignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
12 changes: 12 additions & 0 deletions
12
apps/server/src/infra/files-storage-client/generated/.openapi-generator/FILES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.gitignore | ||
.npmignore | ||
.openapi-generator-ignore | ||
api.ts | ||
api/file-api.ts | ||
base.ts | ||
common.ts | ||
configuration.ts | ||
git_push.sh | ||
index.ts | ||
models/file-record-response.ts | ||
models/index.ts |
18 changes: 18 additions & 0 deletions
18
apps/server/src/infra/files-storage-client/generated/api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Schulcloud-Verbund-Software Server API | ||
* This is v3 of Schulcloud-Verbund-Software Server. Checkout /docs for v1. | ||
* | ||
* The version of the OpenAPI document: 3.0 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
|
||
export * from './api/file-api'; | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let's talk about this file