@into-cps-association/libms 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/DEVELOPER.md +11 -29
  2. package/README.md +64 -35
  3. package/config/http.json +1 -0
  4. package/config/libms.yaml.default +12 -0
  5. package/dist/src/app.module.js +5 -6
  6. package/dist/src/app.module.js.map +1 -1
  7. package/dist/src/bootstrap.js +11 -21
  8. package/dist/src/bootstrap.js.map +1 -1
  9. package/dist/src/config/config.interface.d.ts +14 -0
  10. package/dist/src/config/config.interface.js +2 -0
  11. package/dist/src/config/config.interface.js.map +1 -0
  12. package/dist/src/config/config.model.d.ts +14 -0
  13. package/dist/src/config/config.model.js +2 -0
  14. package/dist/src/config/config.model.js.map +1 -0
  15. package/dist/src/config/config.module.d.ts +2 -0
  16. package/dist/src/config/config.module.js +33 -0
  17. package/dist/src/config/config.module.js.map +1 -0
  18. package/dist/src/config/config.service.d.ts +17 -0
  19. package/dist/src/config/config.service.js +61 -0
  20. package/dist/src/config/config.service.js.map +1 -0
  21. package/dist/src/config/util.d.ts +1 -0
  22. package/dist/src/config/util.js +5 -0
  23. package/dist/src/config/util.js.map +1 -0
  24. package/dist/src/files/files-service.factory.d.ts +2 -2
  25. package/dist/src/files/files-service.factory.js +4 -1
  26. package/dist/src/files/files-service.factory.js.map +1 -1
  27. package/dist/src/files/files.module.js +2 -2
  28. package/dist/src/files/files.module.js.map +1 -1
  29. package/dist/src/files/git/git-files.service.d.ts +4 -2
  30. package/dist/src/files/git/git-files.service.js +31 -20
  31. package/dist/src/files/git/git-files.service.js.map +1 -1
  32. package/dist/src/files/interfaces/files.service.interface.d.ts +1 -0
  33. package/dist/src/files/local/local-files.service.d.ts +3 -2
  34. package/dist/src/files/local/local-files.service.js +12 -4
  35. package/dist/src/files/local/local-files.service.js.map +1 -1
  36. package/dist/src/main.d.ts +4 -1
  37. package/dist/test/cloudcmd/cloudcmd.spec.js +3 -3
  38. package/dist/test/cloudcmd/cloudcmd.spec.js.map +1 -1
  39. package/dist/test/e2e/app.e2e.spec.js +18 -12
  40. package/dist/test/e2e/app.e2e.spec.js.map +1 -1
  41. package/dist/test/integration/files.service.integration.spec.js +6 -6
  42. package/dist/test/integration/files.service.integration.spec.js.map +1 -1
  43. package/dist/test/testUtil.d.ts +7 -1
  44. package/dist/test/testUtil.js +20 -17
  45. package/dist/test/testUtil.js.map +1 -1
  46. package/dist/test/unit/files-service.factory.unit.spec.js +20 -8
  47. package/dist/test/unit/files-service.factory.unit.spec.js.map +1 -1
  48. package/dist/test/unit/files.resolver.unit.spec.js +1 -0
  49. package/dist/test/unit/files.resolver.unit.spec.js.map +1 -1
  50. package/dist/test/unit/git-files.service.unit.spec.js +6 -5
  51. package/dist/test/unit/git-files.service.unit.spec.js.map +1 -1
  52. package/dist/test/unit/local-files.service.unit.spec.js +36 -21
  53. package/dist/test/unit/local-files.service.unit.spec.js.map +1 -1
  54. package/dist/tsconfig.tsbuildinfo +1 -1
  55. package/eslint.config.js +5 -0
  56. package/libms.yaml.sample +12 -0
  57. package/package.json +10 -8
  58. package/src/app.module.ts +6 -7
  59. package/src/bootstrap.ts +14 -21
  60. package/src/config/config.interface.ts +14 -0
  61. package/src/config/config.model.ts +13 -0
  62. package/src/config/config.module.ts +23 -0
  63. package/src/config/config.service.ts +54 -0
  64. package/src/config/util.ts +5 -0
  65. package/src/files/files-service.factory.ts +5 -3
  66. package/src/files/files.module.ts +3 -3
  67. package/src/files/git/git-files.service.ts +28 -21
  68. package/src/files/interfaces/files.service.interface.ts +1 -0
  69. package/src/files/local/local-files.service.ts +13 -4
  70. package/src/main.ts +1 -1
  71. package/test/cloudcmd/cloudcmd.spec.ts +4 -4
  72. package/test/data/user2/tools/large_file.md +1 -0
  73. package/test/e2e/app.e2e.spec.ts +23 -13
  74. package/test/integration/files.service.integration.spec.ts +9 -10
  75. package/test/jest-e2e.json +3 -0
  76. package/test/libms.test.yaml +6 -0
  77. package/test/testUtil.ts +23 -19
  78. package/test/unit/files-service.factory.unit.spec.ts +22 -11
  79. package/test/unit/files.resolver.unit.spec.ts +1 -0
  80. package/test/unit/git-files.service.unit.spec.ts +6 -5
  81. package/test/unit/local-files.service.unit.spec.ts +41 -25
  82. package/test/update-config.js +25 -0
  83. package/config/.env.default +0 -6
package/DEVELOPER.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Developer Instructions
2
2
 
3
+ ## Prerequisites
4
+
5
+ The **pm2** package needs to be available for tests.
6
+ You can install the same by executing
7
+
8
+ ```bash
9
+ npm install -g pm2
10
+ ```
11
+
3
12
  ## :gear: Configure
4
13
 
5
14
  This microservice needs library assets and configuration
@@ -26,34 +35,7 @@ yarn clean # Deletes "build", "coverage", "dist" and other temp files
26
35
  ```
27
36
 
28
37
  **NOTE:** The integration, end-to-end and http tests require a valid
29
- `.env` file. Here is a sample file.
30
-
31
- ```ini
32
- PORT='4001'
33
- MODE='local'
34
- LOCAL_PATH ='/Users/<Username>/DTaaS/files'
35
- LOG_LEVEL='debug'
36
- APOLLO_PATH='/lib'
37
- GRAPHQL_PLAYGROUND='true'
38
- ```
39
-
40
- Here is another with `git` mode.
41
-
42
- ```ini
43
- PORT='4001'
44
- MODE='git'
45
- LOCAL_PATH ='/Users/<Username>/DTaaS/files'
46
- LOG_LEVEL='debug'
47
- APOLLO_PATH='/lib'
48
- GRAPHQL_PLAYGROUND='true'
49
-
50
- GIT_USER1_REPO_URL='<git repo url>'
51
- GIT_USER1_API_TOKEN='<TOKEN>'
52
- ...
53
- GIT_USERX_REPO_URL='<git repo url>'
54
- GIT_USERX_API_TOKEN='<TOKEN>'
55
- ```
56
-
38
+ configuration. This configuration is already set in `libms.test.yaml` file.
57
39
 
58
40
  ## Service Endpoint
59
41
 
@@ -99,7 +81,7 @@ for more information publishing docker images.
99
81
  The default registry for npm packages is [npmjs](https://registry.npmjs.org).
100
82
 
101
83
  ```bash
102
- sudo npm install -g @into-cps-association/libms
84
+ npm install -g @into-cps-association/libms
103
85
  ```
104
86
 
105
87
  The steps for publishing the package to npmjs are listed in
package/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # Overview
2
2
 
3
- The **lib microservice** is a simplified file manager providing graphQL API.
4
- It has two features:
3
+ The **lib microservice** is a simplified file manager which serves files
4
+ from local file system or public git repositories. It is possible to
5
5
 
6
- * provide a listing of directory contents.
7
- * transfer a file to user.
6
+ * Upload and download files from web browser
7
+ * Query available files and download them using GraphQL API
8
+ * Clone public git repositories and serve them as local files
8
9
 
9
10
  ## :arrow_down: Install
10
11
 
@@ -14,14 +15,9 @@ The default registry for npm packages is [npmjs](https://registry.npmjs.org).
14
15
  Install the package with the following commands
15
16
 
16
17
  ```bash
17
- sudo npm install -g @into-cps-association/libms
18
+ npm install -g @into-cps-association/libms
18
19
  ```
19
20
 
20
- The package on [npmjs](https://registry.npmjs.org) is published
21
- less frequently than the one on Github NPM Registry. But
22
- the package on npmjs is more stable version of libms and should
23
- be used for production purposes.
24
-
25
21
  ### Github NPM Registry
26
22
 
27
23
  The package is also available in Github
@@ -30,8 +26,8 @@ The package is also available in Github
30
26
  Set the registry and install the package with the following commands
31
27
 
32
28
  ```bash
33
- sudo npm config set @into-cps-association:registry https://npm.pkg.github.com
34
- sudo npm install -g @into-cps-association/libms
29
+ npm config set @into-cps-association:registry https://npm.pkg.github.com
30
+ npm install -g @into-cps-association/libms
35
31
  ```
36
32
 
37
33
  The _npm install_ command asks for username and password. The username is
@@ -45,29 +41,61 @@ needs to have _read:packages_ scope.
45
41
  The microservices requires config specified in INI format.
46
42
  The template configuration file is:
47
43
 
48
- ```ini
49
- PORT='4001'
50
- MODE='local' or 'gitlab'
51
- LOCAL_PATH ='/Users/<Username>/DTaaS/files'
52
- LOG_LEVEL='debug'
53
- APOLLO_PATH='/lib' or ''
54
- GRAPHQL_PLAYGROUND='false' or 'true'
55
-
56
- #Only needed if git mode
57
- GIT_USER1_REPO_URL='<git repo url>'
58
- GIT_USER1_API_TOKEN='<TOKEN>'
59
- ...
60
- GIT_USERX_REPO_URL='<git repo url>'
61
- GIT_USERX_API_TOKEN='<TOKEN>'
62
-
44
+ ```yaml
45
+ port: '4001'
46
+ mode: 'git' # either git or local
47
+ local-path: 'files'
48
+ log-level: 'debug'
49
+ apollo-path: '/lib'
50
+ graphql-playground: 'true'
51
+
52
+ git-repos:
53
+ - user-1:
54
+ repo-url: 'https://github.com/isomorphic-git/lightning-fs'
55
+ - user-2:
56
+ repo-url: 'https://gitlab.com/dtaas/user2.git'
57
+ - common:
58
+ repo-url: 'https://gitlab.com/dtaas/common'
63
59
  ```
64
60
 
65
- The `LOCAL_PATH` variable is the absolute filepath to the
61
+ The `local-path` variable is the relative filepath to the
66
62
  location of the local directory which will be served to users
67
63
  by the Library microservice.
68
64
 
69
65
  Replace the default values the appropriate values for your setup.
70
- Please save this config in a file.
66
+ Please save this config in a file as a yaml file, for example as `libms.yaml`.
67
+
68
+ ### Operation Modes
69
+
70
+ The mode indicates the backend storage for the files.
71
+ There are two possible modes - `local` and `git`.
72
+ The files available in the `local-path` are served to users in `local` mode.
73
+ In the `git` mode, the remote git repos are cloned and they are
74
+ served to users as local files.
75
+
76
+ #### git mode
77
+
78
+ A fragment of the config for `git` mode is:
79
+
80
+ ```yaml
81
+ ...
82
+ git-repos:
83
+ - user-1:
84
+ repo-url: 'https://github.com/isomorphic-git/lightning-fs'
85
+ - user-2:
86
+ repo-url: 'https://gitlab.com/dtaas/user2.git'
87
+ - common:
88
+ repo-url: 'https://gitlab.com/dtaas/common'
89
+ ```
90
+
91
+ Here, `user-1`, `user-2` and `common` are the local directories into which
92
+ the remote git repositories get cloned. The name of the repository need not
93
+ match with the local directory name. For example, the above configuration
94
+ enables library microservice to clone
95
+ `https://github.com/isomorphic-git/lightning-fs` repository into
96
+ `user-1` directory. Any git server accessible over
97
+ HTTP(S) protocol is supported.
98
+ The `.git` suffix is optional.
71
99
 
72
100
  ## :rocket: Use
73
101
 
@@ -81,7 +109,7 @@ The lib microservice is a file server. It supports file transfer
81
109
  over GraphQL and HTTP protocols.
82
110
 
83
111
  Options:
84
- -c, --config <file> provide the config file (default .env)
112
+ -c, --config <file> provide the config file (default libms.yaml)
85
113
  -H, --http <file> enable the HTTP server with the specified config
86
114
  -h, --help display help for libms
87
115
  ```
@@ -90,9 +118,9 @@ Both the options are not mandatory.
90
118
 
91
119
  ### Configuration file
92
120
 
93
- The config is saved `.env` file by convention. If `-c` is not specified
121
+ The config is saved `libms.yaml` file by convention. If `-c` is not specified
94
122
  The **libms** looks for
95
- `.env` file in the working directory from which it is run.
123
+ `libms.yaml` file in the working directory from which it is run.
96
124
  If you want to run **libms** without explicitly specifying the configuration
97
125
  file, run
98
126
 
@@ -107,11 +135,11 @@ libms -c FILE-PATH
107
135
  libms --config FILE-PATH
108
136
  ```
109
137
 
110
- If the environment file is named something other than `.env`,
111
- for example as `config/.env.default`, you can run
138
+ If the environment file is named something other than `libms.yaml`,
139
+ for example as `config/libms.yaml.default`, you can run
112
140
 
113
141
  ```sh
114
- libms -c "config/.env.default"
142
+ libms -c "config/libms.yaml.default"
115
143
  ```
116
144
 
117
145
  You can press `Ctl+C` to halt the application.
@@ -150,6 +178,7 @@ libms --http FILE-PATH
150
178
  "confirmCopy": true,
151
179
  "confirmMove": true,
152
180
  "showConfig": false,
181
+ "showDotFiles": false,
153
182
  "showFileName": true,
154
183
  "contact": false,
155
184
  "configDialog": false,
package/config/http.json CHANGED
@@ -15,6 +15,7 @@
15
15
  "confirmCopy": true,
16
16
  "confirmMove": true,
17
17
  "showConfig": false,
18
+ "showDotFiles": false,
18
19
  "showFileName": true,
19
20
  "contact": false,
20
21
  "configDialog": false,
@@ -0,0 +1,12 @@
1
+ port: '4001'
2
+ mode: 'git'
3
+ local-path: '..\..\files'
4
+ log-level: 'debug'
5
+ apollo-path: '/lib'
6
+ graphql-playground: 'true'
7
+
8
+ git-repos:
9
+ - user-1:
10
+ repo-url: 'https://github.com/isomorphic-git/lightning-fs'
11
+ - user-2:
12
+ repo-url: 'https://github.com/isomorphic-git/lightning-fs'
@@ -4,27 +4,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { ConfigModule, ConfigService } from '@nestjs/config';
8
7
  import { Module } from '@nestjs/common';
9
8
  import { GraphQLModule } from '@nestjs/graphql';
10
9
  import { ApolloDriver } from '@nestjs/apollo';
11
10
  import { join } from 'path';
12
11
  import FilesModule from './files/files.module.js';
12
+ import { ConfigModule } from './config/config.module.js';
13
+ import { CONFIG_SERVICE } from './config/config.interface.js';
13
14
  let AppModule = class AppModule {
14
15
  };
15
16
  AppModule = __decorate([
16
17
  Module({
17
18
  imports: [
18
- ConfigModule.forRoot({
19
- isGlobal: true,
20
- }),
19
+ ConfigModule,
21
20
  GraphQLModule.forRootAsync({
22
21
  driver: ApolloDriver,
23
22
  useFactory: (configService) => ({
24
23
  autoSchemaFile: join(process.cwd(), 'src/schema.gql'),
25
- path: configService.get('APOLLO_PATH'),
24
+ path: configService.getApolloPath(),
26
25
  }),
27
- inject: [ConfigService],
26
+ inject: [CONFIG_SERVICE],
28
27
  }),
29
28
  FilesModule,
30
29
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../src/app.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,WAAW,MAAM,yBAAyB,CA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AAE,gBAAgB,CAAC;oBACrD,IAAI,EAAE,aAAa,CAAC,aAAa,EAAE;iBACpC,CAAC;gBACF,MAAM,EAAE,CAAC,cAAc,CAAC;aACzB,CAAC;YACF,WAAW;SACZ;KACF,CAAC;GACmB,SAAS,CAAG;eAAZ,SAAS"}
@@ -1,30 +1,20 @@
1
1
  import { NestFactory } from '@nestjs/core';
2
- import { ConfigService } from '@nestjs/config';
3
- import * as dotenv from 'dotenv';
4
2
  import AppModule from './app.module.js';
5
3
  import cloudCMD from './cloudcmd/cloudcmd.js';
4
+ import { Logger } from '@nestjs/common';
5
+ import { CONFIG_SERVICE } from './config/config.interface.js';
6
6
  export default async function bootstrap(options) {
7
- const configFile = dotenv.config({
8
- path: options?.config ?? '.env',
9
- override: true,
10
- });
11
- if (configFile.error && process.env.LOCAL_PATH === undefined) {
12
- console.error(configFile.error);
13
- if (options.runHelp) {
14
- options.runHelp();
15
- }
16
- else {
17
- process.exit(1);
18
- }
19
- }
7
+ const logger = new Logger(bootstrap.name);
8
+ if (process.env.LIBMS_CONFIG_PATH == null)
9
+ process.env.LIBMS_CONFIG_PATH = options.config ?? 'libms.yaml';
20
10
  const app = await NestFactory.create(AppModule);
21
- const configService = app.get(ConfigService);
22
- const port = configService.get('PORT');
23
- const localPath = configService.get('LOCAL_PATH');
24
- const mode = configService.get('MODE');
25
- console.log(`\x1b[32mStarting libms in \x1b[33m${mode} \x1b[32mmode, serving files from \x1b[34m${localPath} \x1b[32mon port \x1b[35m${port}\x1b[0m`);
11
+ const configService = app.get(CONFIG_SERVICE);
12
+ const port = configService.getPort();
13
+ const localPath = configService.getLocalPath();
14
+ const mode = configService.getMode();
15
+ logger.log(`\x1b[32mStarting libms in \x1b[33m${mode} \x1b[32mmode, serving files from \x1b[34m${localPath} \x1b[32mon port \x1b[35m${port}\x1b[0m`);
26
16
  if (options.httpServer) {
27
- cloudCMD(app, options.httpServer, configService.get('LOCAL_PATH'));
17
+ cloudCMD(app, options.httpServer, configService.getLocalP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AAS,4BAA4B,IAAI,SAAS,CACzI,CAAC;IAEF,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QACvB,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,YAAY,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { GitRepo } from './config.model';
2
+ export declare const CONFIG_SERVICE = "CONFIG_SERVICE";
3
+ export interface IConfig {
4
+ loadConfig(configPath: string): Promise<void>;
5
+ getLocalPath(): string;
6
+ getApolloPath(): string;
7
+ getMode(): string;
8
+ getPort(): number;
9
+ getLogLevel(): string;
10
+ getGraphqlPlayground(): string;
11
+ getGitRepos(): {
12
+ [key: string]: GitRepo;
13
+ }[];
14
+ }
@@ -0,0 +1,2 @@
1
+ export const CONFIG_SERVICE = 'CONFIG_SERVICE';
2
+ //# sourceMappingURL=config.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.interface.js","sourceRoot":"","sources":["../../../src/config/config.interface.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,14 @@
1
+ export type ConfigValues = {
2
+ port: number;
3
+ 'local-path': string;
4
+ mode: string;
5
+ 'log-level': string;
6
+ 'apollo-path': string;
7
+ 'graphql-playground': string;
8
+ 'git-repos': {
9
+ [key: string]: GitRepo;
10
+ }[];
11
+ };
12
+ export type GitRepo = {
13
+ 'repo-url': string;
14
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=config.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.model.js","sourceRoot":"","sources":["../../../src/config/config.model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare class ConfigModule {
2
+ }
@@ -0,0 +1,33 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Global, Module } from '@nestjs/common';
8
+ import * as nestConfig from '@nestjs/config';
9
+ import Config from './config.service.js';
10
+ import { CONFIG_SERVICE } from './config.interface.js';
11
+ let ConfigModule = class ConfigModule {
12
+ };
13
+ ConfigModule = __decorate([
14
+ Global(),
15
+ Module({
16
+ imports: [nestConfig.ConfigModule.forRoot({ isGlobal: true })],
17
+ providers: [
18
+ {
19
+ provide: CONFIG_SERVICE,
20
+ useFactory: async (envConfigservice) => {
21
+ const confPath = envConfigservice.get('LIBMS_CONFIG_PATH');
22
+ const config = new Config();
23
+ await config.loadConfig(confPath);
24
+ return config;
25
+ },
26
+ inject: [nestConfig.ConfigService],
27
+ },
28
+ ],
29
+ exports: [CONFIG_SERVICE],
30
+ })
31
+ ], ConfigModule);
32
+ export { ConfigModule };
33
+ //# sourceMappingURL=config.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.module.js","sourceRoot":"","sources":["../../../src/config/config.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAC7C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAmBhD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,YAAY;IAjBxB,MAAM,EAAE;IACR,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9D,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,cAAc;gBACvB,UAAU,EAAE,KAAK,EAAE,gBAA0C,EAAE,EAAE;oBAC/D,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,CAAS,mBAAmB,CAAC,CAAC;oBACnE,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;oBAC5B,MAAM,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;oBAClC,OAAO,MAAM,CAAC;gBAChB,CAAC;gBACD,MAAM,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC;aACnC;SACF;QACD,OAAO,EAAE,CAAC,cAAc,CAAC;KAC1B,CAAC;GACW,YAAY,CAAG"}
@@ -0,0 +1,17 @@
1
+ import { GitRepo } from './config.model.js';
2
+ import { IConfig } from './config.interface.js';
3
+ export default class Config implements IConfig {
4
+ private configValues;
5
+ private logger;
6
+ constructor();
7
+ loadConfig(configPath: string): Promise<void>;
8
+ getLocalPath(): string;
9
+ getApolloPath(): string;
10
+ getMode(): string;
11
+ getPort(): number;
12
+ getLogLevel(): string;
13
+ getGraphqlPlayground(): string;
14
+ getGitRepos(): {
15
+ [key: string]: GitRepo;
16
+ }[];
17
+ }
@@ -0,0 +1,61 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var Config_1;
11
+ import { readFileSync } from 'fs';
12
+ import * as yaml from 'js-yaml';
13
+ import { Injectable, Logger } from '@nestjs/common';
14
+ import resolveFile from './util.js';
15
+ let Config = Config_1 = class Config {
16
+ configValues;
17
+ logger;
18
+ constructor() {
19
+ this.logger = new Logger(Config_1.name);
20
+ }
21
+ async loadConfig(configPath) {
22
+ if (configPath !== undefined) {
23
+ try {
24
+ const configFile = readFileSync(resolveFile(configPath), 'utf8');
25
+ this.configValues = yaml.load(configFile);
26
+ }
27
+ catch (e) {
28
+ this.logger.error('Error loading config file', e);
29
+ process.exit(1);
30
+ }
31
+ }
32
+ this.logger.log('Config loaded', this.configValues);
33
+ }
34
+ getLocalPath() {
35
+ return this.configValues['local-path'];
36
+ }
37
+ getApolloPath() {
38
+ return this.configValues['apollo-path'];
39
+ }
40
+ getMode() {
41
+ return this.configValues['mode'];
42
+ }
43
+ getPort() {
44
+ return this.configValues['port'];
45
+ }
46
+ getLogLevel() {
47
+ return this.configValues['log-level'];
48
+ }
49
+ getGraphqlPlayground() {
50
+ return this.configValues['graphql-playground'];
51
+ }
52
+ getGitRepos() {
53
+ return this.configValues['git-repos'];
54
+ }
55
+ };
56
+ Config = Config_1 = __decorate([
57
+ Injectable(),
58
+ __metadata("design:paramtypes", [])
59
+ ], Config);
60
+ export default Config;
61
+ //# sourceMappingURL=config.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.service.js","sourceRoot":"","sources":["../../../src/config/config.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,WAAW,MAAM,WAAW,CAAC;AAIrB,IAAM,MAAM,cAAZ,MAAM,MAAM;I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AAM;IAD1B,UAAU,EAAE;;GACQ,MAAM,CA6C1B;eA7CoB,MAAM"}
@@ -0,0 +1 @@
1
+ export default function resolveFile(name: string): string;
@@ -0,0 +1,5 @@
1
+ import path from 'node:path';
2
+ export default function resolveFile(name) {
3
+ return path.resolve(name);
4
+ }
5
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/config/util.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,IAAY;IAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
@@ -1,5 +1,5 @@
1
- import { ConfigService } from '@nestjs/config';
2
1
  import { IFilesService } from './interfaces/files.service.interface.js';
2
+ import { IConfig } from 'src/config/config.interface.js';
3
3
  export default class FilesServiceFactory {
4
- static create(configService: ConfigService, fileServices: IFilesService[]): IFilesService;
4
+ static create(configService: IConfig, fileServices: IFilesService[]): IFilesService;
5
5
  }
@@ -7,11 +7,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { Injectable } from '@nestjs/common';
8
8
  let FilesServiceFactory = class FilesServiceFactory {
9
9
  static create(configService, fileServices) {
10
- const mode = configService.get('MODE');
10
+ const mode = configService.getMode();
11
11
  const service = fileServices.find((s) => s.getMode() == mode);
12
12
  if (service == undefined) {
13
13
  throw new Error(`Invalid MODE: ${mode}`);
14
14
  }
15
+ else {
16
+ service.init();
17
+ }
15
18
  return service;
16
19
  }
17
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"files-service.factory.js","sourceRoot":"","sources":["../../../src/files/files-service.factory.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK7B,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACtC,MAAM,CAAC,MAAM,CACX,aAA4B,EAC5B,YAA6B;QAE7B,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,CAAS,MAAM,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,CAAC;QAE9D,IAAI,OAAO,IAAI,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AAboB,mBAAmB;IADvC,UAAU,EAAE;GACQ,mBAAmB,CAavC;eAboB,mBAAmB"}
1
+ {"version":3,"file":"files-service.factory.js","sourceRoot":"","sources":["../../../src/files/files-service.factory.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK7B,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACtC,MAAM,CAAC,MAAM,CACX,aAAsB,EACtB,YAA6B;QAE7B,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,CAAC;QAE9D,IAAI,OAAO,IAAI,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AAfoB,mBAAmB;IADvC,UAAU,EAAE;GACQ,mBAAmB,CAevC;eAfoB,mBAAmB"}
@@ -12,7 +12,7 @@ import LocalFilesService from './local/local-files.service.js';
12
12
  import GitFilesService from './git/git-files.service.js';
13
13
  import { FILE_SERVICE } from './interfaces/files.service.interface.js';
14
14
  import FilesServiceFactory from './files-service.factory.js';
15
- import { ConfigService } from '@nestjs/config';
15
+ import { CONFIG_SERVICE } from '../config/config.interface.js';
16
16
  let FilesModule = class FilesModule {
17
17
  };
18
18
  FilesModule = __decorate([
@@ -26,7 +26,7 @@ FilesModule = __decorate([
26
26
  const fileServices = [localFilesService, gitFilesService];
27
27
  return FilesServiceFactory.create(configService, fileServices);
28
28
  },
29
- inject: [ConfigService, LocalFilesService, GitFilesService],
29
+ inject: [CONFIG_SERVICE, LocalFilesService, GitFilesService],
30
30
  },
31
31
  ],
32
32
  })
@@ -1 +1 @@
1
- {"version":3,"file":"files.module.js","sourceRoot":"","sources":["../../../src/files/files.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAoBhC,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,WAAW;IAlB/B,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,gBAAgB,EAAE,cAAc,CAAC;QAC3C,SAAS,EAAE;YACT,aAAa;YACb;gBACE,OAAO,EAAE,YAAY;gBACrB,UAAU,EAAE,CACV,aAA4B,EAC5B,iBAAoC,EACpC,eAAgC,EAChC,EAAE;oBACF,MAAM,YAAY,GAAG,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;oBAC1D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 @@
1
1
  import { Project } from 'src/types.js';
2
2
  import { IFilesService } from '../interfaces/files.service.interface.js';
3
3
  import { CONFIG_MODE } from '../../enums/config-mode.enum.js';
4
- import { ConfigService } from '@nestjs/config';
4
+ import Config from '../../config/config.service.js';
5
5
  export default class GitFilesService implements IFilesService {
6
6
  private configService;
7
7
  private readonly dataPath;
8
+ private readonly logger;
8
9
  private localFilesService;
9
- constructor(configService: ConfigService);
10
+ constructor(configService: Config);
11
+ init(): Promise<any>;
10
12
  private cloneRepositories;
11
13
  getMode(): CONFIG_MODE;
12
14
  listDirectory(path: string): Promise<Project>;