@into-cps-association/libms 0.4.5 → 0.5.0

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 (127) hide show
  1. package/DEVELOPER.md +80 -0
  2. package/DOCKER.md +295 -0
  3. package/README.md +8 -0
  4. package/compose.lib.dev.yml +9 -0
  5. package/compose.lib.yml +8 -0
  6. package/dist/src/app.module.d.ts +2 -1
  7. package/dist/src/app.module.js +14 -16
  8. package/dist/src/app.module.js.map +1 -1
  9. package/dist/src/bootstrap.d.ts +3 -3
  10. package/dist/src/bootstrap.js +13 -13
  11. package/dist/src/bootstrap.js.map +1 -1
  12. package/dist/src/cloudcmd/cloudcmd.d.ts +1 -5
  13. package/dist/src/cloudcmd/cloudcmd.js +15 -9
  14. package/dist/src/cloudcmd/cloudcmd.js.map +1 -1
  15. package/dist/src/enums/config-mode.enum.d.ts +4 -0
  16. package/dist/src/enums/config-mode.enum.js +6 -0
  17. package/dist/src/enums/config-mode.enum.js.map +1 -0
  18. package/dist/src/files/files-service.factory.d.ts +5 -0
  19. package/dist/src/files/files-service.factory.js +22 -0
  20. package/dist/src/files/files-service.factory.js.map +1 -0
  21. package/dist/src/files/files.module.d.ts +2 -1
  22. package/dist/src/files/files.module.js +23 -9
  23. package/dist/src/files/files.module.js.map +1 -1
  24. package/dist/src/files/files.resolver.d.ts +8 -0
  25. package/dist/src/files/{resolvers/files.resolver.js → files.resolver.js} +14 -14
  26. package/dist/src/files/files.resolver.js.map +1 -0
  27. package/dist/src/files/git/git-files.module.d.ts +2 -0
  28. package/dist/src/files/git/git-files.module.js +19 -0
  29. package/dist/src/files/git/git-files.module.js.map +1 -0
  30. package/dist/src/files/git/git-files.service.d.ts +14 -0
  31. package/dist/src/files/git/git-files.service.js +67 -0
  32. package/dist/src/files/git/git-files.service.js.map +1 -0
  33. package/dist/src/files/interfaces/files.service.interface.d.ts +6 -3
  34. package/dist/src/files/interfaces/files.service.interface.js +1 -2
  35. package/dist/src/files/interfaces/files.service.interface.js.map +1 -1
  36. package/dist/src/files/local/local-files.module.d.ts +2 -0
  37. package/dist/src/files/local/local-files.module.js +18 -0
  38. package/dist/src/files/local/local-files.module.js.map +1 -0
  39. package/dist/src/files/local/local-files.service.d.ts +14 -0
  40. package/dist/src/files/{services → local}/local-files.service.js +17 -15
  41. package/dist/src/files/local/local-files.service.js.map +1 -0
  42. package/dist/src/main.js +4 -6
  43. package/dist/src/main.js.map +1 -1
  44. package/dist/src/types.d.ts +19 -19
  45. package/dist/src/types.js +56 -59
  46. package/dist/src/types.js.map +1 -1
  47. package/dist/test/cloudcmd/cloudcmd.spec.js +14 -16
  48. package/dist/test/cloudcmd/cloudcmd.spec.js.map +1 -1
  49. package/dist/test/e2e/app.e2e.spec.js +18 -18
  50. package/dist/test/e2e/app.e2e.spec.js.map +1 -1
  51. package/dist/test/integration/files.service.integration.spec.js +28 -19
  52. package/dist/test/integration/files.service.integration.spec.js.map +1 -1
  53. package/dist/test/testUtil.d.ts +66 -68
  54. package/dist/test/testUtil.js +21 -23
  55. package/dist/test/testUtil.js.map +1 -1
  56. package/dist/test/unit/files-service.factory.unit.spec.js +22 -16
  57. package/dist/test/unit/files-service.factory.unit.spec.js.map +1 -1
  58. package/dist/test/unit/files.resolver.unit.spec.js +26 -24
  59. package/dist/test/unit/files.resolver.unit.spec.js.map +1 -1
  60. package/dist/test/unit/git-files.service.unit.spec.d.ts +1 -0
  61. package/dist/test/unit/git-files.service.unit.spec.js +55 -0
  62. package/dist/test/unit/git-files.service.unit.spec.js.map +1 -0
  63. package/dist/test/unit/local-files.service.unit.spec.js +23 -24
  64. package/dist/test/unit/local-files.service.unit.spec.js.map +1 -1
  65. package/dist/tsconfig.tsbuildinfo +1 -1
  66. package/eslint.config.js +60 -0
  67. package/jest.config.ts +47 -0
  68. package/package.json +55 -48
  69. package/src/app.module.ts +1 -1
  70. package/src/bootstrap.ts +7 -3
  71. package/src/cloudcmd/cloudcmd.ts +11 -3
  72. package/src/enums/config-mode.enum.ts +4 -0
  73. package/src/files/files-service.factory.ts +19 -0
  74. package/src/files/files.module.ts +24 -4
  75. package/src/files/{resolvers/files.resolver.ts → files.resolver.ts} +9 -8
  76. package/src/files/git/git-files.module.ts +9 -0
  77. package/src/files/git/git-files.service.ts +58 -0
  78. package/src/files/interfaces/files.service.interface.ts +4 -1
  79. package/src/files/local/local-files.module.ts +8 -0
  80. package/src/files/{services → local}/local-files.service.ts +15 -10
  81. package/src/main.ts +1 -1
  82. package/test/cloudcmd/cloudcmd.spec.ts +4 -6
  83. package/test/e2e/app.e2e.spec.ts +4 -3
  84. package/test/integration/files.service.integration.spec.ts +19 -4
  85. package/test/testUtil.ts +3 -0
  86. package/test/unit/files-service.factory.unit.spec.ts +24 -10
  87. package/test/unit/files.resolver.unit.spec.ts +19 -12
  88. package/test/unit/git-files.service.unit.spec.ts +81 -0
  89. package/test/unit/local-files.service.unit.spec.ts +4 -2
  90. package/tsconfig.json +10 -7
  91. package/.env +0 -6
  92. package/.eslintignore +0 -6
  93. package/.eslintrc +0 -53
  94. package/coverage/clover.xml +0 -162
  95. package/coverage/cobertura-coverage.xml +0 -306
  96. package/coverage/coverage-final.json +0 -8
  97. package/coverage/lcov-report/base.css +0 -224
  98. package/coverage/lcov-report/block-navigation.js +0 -87
  99. package/coverage/lcov-report/favicon.png +0 -0
  100. package/coverage/lcov-report/index.html +0 -176
  101. package/coverage/lcov-report/prettify.css +0 -1
  102. package/coverage/lcov-report/prettify.js +0 -2
  103. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  104. package/coverage/lcov-report/sorter.js +0 -196
  105. package/coverage/lcov-report/src/bootstrap.ts.html +0 -196
  106. package/coverage/lcov-report/src/cloudcmd/cloudcmd.ts.html +0 -181
  107. package/coverage/lcov-report/src/cloudcmd/index.html +0 -116
  108. package/coverage/lcov-report/src/files/files.module.ts.html +0 -112
  109. package/coverage/lcov-report/src/files/index.html +0 -116
  110. package/coverage/lcov-report/src/files/resolvers/files.resolver.ts.html +0 -154
  111. package/coverage/lcov-report/src/files/resolvers/index.html +0 -116
  112. package/coverage/lcov-report/src/files/services/files-service.factory.ts.html +0 -151
  113. package/coverage/lcov-report/src/files/services/index.html +0 -131
  114. package/coverage/lcov-report/src/files/services/local-files.service.ts.html +0 -313
  115. package/coverage/lcov-report/src/index.html +0 -131
  116. package/coverage/lcov-report/src/types.ts.html +0 -361
  117. package/coverage/lcov.info +0 -237
  118. package/dist/src/files/resolvers/files.resolver.d.ts +0 -8
  119. package/dist/src/files/resolvers/files.resolver.js.map +0 -1
  120. package/dist/src/files/services/files-service.factory.d.ts +0 -12
  121. package/dist/src/files/services/files-service.factory.js +0 -40
  122. package/dist/src/files/services/files-service.factory.js.map +0 -1
  123. package/dist/src/files/services/local-files.service.d.ts +0 -11
  124. package/dist/src/files/services/local-files.service.js.map +0 -1
  125. package/jest.config.json +0 -30
  126. package/src/files/services/files-service.factory.ts +0 -22
  127. /package/{pm2.config.js → pm2.config.cjs} +0 -0
package/dist/src/types.js CHANGED
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
2
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
3
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -8,174 +7,172 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
7
  var __metadata = (this && this.__metadata) || function (k, v) {
9
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Query = exports.Project = exports.Repository = exports.RepositoryBlobConnection = exports.RepositoryBlob = exports.Tree = exports.TreeConnection = exports.TreeEdge = exports.TreeEntry = exports.BlobConnection = exports.BlobEdge = exports.Blob = void 0;
13
- const graphql_1 = require("@nestjs/graphql");
10
+ import { Field, ObjectType } from '@nestjs/graphql';
14
11
  let Blob = class Blob {
15
12
  name;
16
13
  type;
17
14
  };
18
- exports.Blob = Blob;
19
15
  __decorate([
20
- (0, graphql_1.Field)(),
16
+ Field(),
21
17
  __metadata("design:type", String)
22
18
  ], Blob.prototype, "name", void 0);
23
19
  __decorate([
24
- (0, graphql_1.Field)(),
20
+ Field(),
25
21
  __metadata("design:type", String)
26
22
  ], Blob.prototype, "type", void 0);
27
- exports.Blob = Blob = __decorate([
28
- (0, graphql_1.ObjectType)()
23
+ Blob = __decorate([
24
+ ObjectType()
29
25
  ], Blob);
26
+ export { Blob };
30
27
  let BlobEdge = class BlobEdge {
31
28
  node;
32
29
  };
33
- exports.BlobEdge = BlobEdge;
34
30
  __decorate([
35
- (0, graphql_1.Field)(() => Blob),
31
+ Field(() => Blob),
36
32
  __metadata("design:type", Blob)
37
33
  ], BlobEdge.prototype, "node", void 0);
38
- exports.BlobEdge = BlobEdge = __decorate([
39
- (0, graphql_1.ObjectType)()
34
+ BlobEdge = __decorate([
35
+ ObjectType()
40
36
  ], BlobEdge);
37
+ export { BlobEdge };
41
38
  let BlobConnection = class BlobConnection {
42
39
  edges;
43
40
  };
44
- exports.BlobConnection = BlobConnection;
45
41
  __decorate([
46
- (0, graphql_1.Field)(() => [BlobEdge]),
42
+ Field(() => [BlobEdge]),
47
43
  __metadata("design:type", Array)
48
44
  ], BlobConnection.prototype, "edges", void 0);
49
- exports.BlobConnection = BlobConnection = __decorate([
50
- (0, graphql_1.ObjectType)()
45
+ BlobConnection = __decorate([
46
+ ObjectType()
51
47
  ], BlobConnection);
48
+ export { BlobConnection };
52
49
  let TreeEntry = class TreeEntry {
53
50
  name;
54
51
  type;
55
52
  };
56
- exports.TreeEntry = TreeEntry;
57
53
  __decorate([
58
- (0, graphql_1.Field)(),
54
+ Field(),
59
55
  __metadata("design:type", String)
60
56
  ], TreeEntry.prototype, "name", void 0);
61
57
  __decorate([
62
- (0, graphql_1.Field)(),
58
+ Field(),
63
59
  __metadata("design:type", String)
64
60
  ], TreeEntry.prototype, "type", void 0);
65
- exports.TreeEntry = TreeEntry = __decorate([
66
- (0, graphql_1.ObjectType)()
61
+ TreeEntry = __decorate([
62
+ ObjectType()
67
63
  ], TreeEntry);
64
+ export { TreeEntry };
68
65
  let TreeEdge = class TreeEdge {
69
66
  node;
70
67
  };
71
- exports.TreeEdge = TreeEdge;
72
68
  __decorate([
73
- (0, graphql_1.Field)(() => TreeEntry),
69
+ Field(() => TreeEntry),
74
70
  __metadata("design:type", TreeEntry)
75
71
  ], TreeEdge.prototype, "node", void 0);
76
- exports.TreeEdge = TreeEdge = __decorate([
77
- (0, graphql_1.ObjectType)()
72
+ TreeEdge = __decorate([
73
+ ObjectType()
78
74
  ], TreeEdge);
75
+ export { TreeEdge };
79
76
  let TreeConnection = class TreeConnection {
80
77
  edges;
81
78
  };
82
- exports.TreeConnection = TreeConnection;
83
79
  __decorate([
84
- (0, graphql_1.Field)(() => [TreeEdge]),
80
+ Field(() => [TreeEdge]),
85
81
  __metadata("design:type", Array)
86
82
  ], TreeConnection.prototype, "edges", void 0);
87
- exports.TreeConnection = TreeConnection = __decorate([
88
- (0, graphql_1.ObjectType)()
83
+ TreeConnection = __decorate([
84
+ ObjectType()
89
85
  ], TreeConnection);
86
+ export { TreeConnection };
90
87
  let Tree = class Tree {
91
88
  blobs;
92
89
  trees;
93
90
  };
94
- exports.Tree = Tree;
95
91
  __decorate([
96
- (0, graphql_1.Field)(),
92
+ Field(),
97
93
  __metadata("design:type", BlobConnection)
98
94
  ], Tree.prototype, "blobs", void 0);
99
95
  __decorate([
100
- (0, graphql_1.Field)(),
96
+ Field(),
101
97
  __metadata("design:type", TreeConnection)
102
98
  ], Tree.prototype, "trees", void 0);
103
- exports.Tree = Tree = __decorate([
104
- (0, graphql_1.ObjectType)()
99
+ Tree = __decorate([
100
+ ObjectType()
105
101
  ], Tree);
102
+ export { Tree };
106
103
  let RepositoryBlob = class RepositoryBlob {
107
104
  name;
108
105
  rawBlob;
109
106
  rawTextBlob;
110
107
  };
111
- exports.RepositoryBlob = RepositoryBlob;
112
108
  __decorate([
113
- (0, graphql_1.Field)(),
109
+ Field(),
114
110
  __metadata("design:type", String)
115
111
  ], RepositoryBlob.prototype, "name", void 0);
116
112
  __decorate([
117
- (0, graphql_1.Field)(),
113
+ Field(),
118
114
  __metadata("design:type", String)
119
115
  ], RepositoryBlob.prototype, "rawBlob", void 0);
120
116
  __decorate([
121
- (0, graphql_1.Field)(),
117
+ Field(),
122
118
  __metadata("design:type", String)
123
119
  ], RepositoryBlob.prototype, "rawTextBlob", void 0);
124
- exports.RepositoryBlob = RepositoryBlob = __decorate([
125
- (0, graphql_1.ObjectType)()
120
+ RepositoryBlob = __decorate([
121
+ ObjectType()
126
122
  ], RepositoryBlob);
123
+ export { RepositoryBlob };
127
124
  let RepositoryBlobConnection = class RepositoryBlobConnection {
128
125
  nodes;
129
126
  };
130
- exports.RepositoryBlobConnection = RepositoryBlobConnection;
131
127
  __decorate([
132
- (0, graphql_1.Field)(() => [RepositoryBlob]),
128
+ Field(() => [RepositoryBlob]),
133
129
  __metadata("design:type", Array)
134
130
  ], RepositoryBlobConnection.prototype, "nodes", void 0);
135
- exports.RepositoryBlobConnection = RepositoryBlobConnection = __decorate([
136
- (0, graphql_1.ObjectType)()
131
+ RepositoryBlobConnection = __decorate([
132
+ ObjectType()
137
133
  ], RepositoryBlobConnection);
134
+ export { RepositoryBlobConnection };
138
135
  let Repository = class Repository {
139
136
  tree;
140
137
  blobs;
141
138
  };
142
- exports.Repository = Repository;
143
139
  __decorate([
144
- (0, graphql_1.Field)(),
140
+ Field(),
145
141
  __metadata("design:type", Tree)
146
142
  ], Repository.prototype, "tree", void 0);
147
143
  __decorate([
148
- (0, graphql_1.Field)(),
144
+ Field(),
149
145
  __metadata("design:type", RepositoryBlobConnection)
150
146
  ], Repository.prototype, "blobs", void 0);
151
- exports.Repository = Repository = __decorate([
152
- (0, graphql_1.ObjectType)()
147
+ Repository = __decorate([
148
+ ObjectType()
153
149
  ], Repository);
150
+ export { Repository };
154
151
  let Project = class Project {
155
152
  repository;
156
153
  };
157
- exports.Project = Project;
158
154
  __decorate([
159
- (0, graphql_1.Field)(() => Repository),
155
+ Field(() => Repository),
160
156
  __metadata("design:type", Repository)
161
157
  ], Project.prototype, "repository", void 0);
162
- exports.Project = Project = __decorate([
163
- (0, graphql_1.ObjectType)()
158
+ Project = __decorate([
159
+ ObjectType()
164
160
  ], Project);
161
+ export { Project };
165
162
  let Query = class Query {
166
163
  listDirectory;
167
164
  readFile;
168
165
  };
169
- exports.Query = Query;
170
166
  __decorate([
171
- (0, graphql_1.Field)(),
167
+ Field(),
172
168
  __metadata("design:type", Project)
173
169
  ], Query.prototype, "listDirectory", void 0);
174
170
  __decorate([
175
- (0, graphql_1.Field)(),
171
+ Field(),
176
172
  __metadata("design:type", Project)
177
173
  ], Query.prototype, "readFile", void 0);
178
- exports.Query = Query = __decorate([
179
- (0, graphql_1.ObjectType)()
174
+ Query = __decorate([
175
+ ObjectType()
180
176
  ], Query);
177
+ export { Query };
181
178
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAoD;AAG7C,IAAM,IAAI,GAAV,MAAM,IAAI;IAEf,IAAI,CAAS;IAGb,IAAI,CAAS;CACd,CAAA;AANY,oBAAI;AAEf;IADC,IAAA,eAAK,GAAE;;kCACK;AAGb;IADC,IAAA,eAAK,GAAE;;kCACK;eALF,IAAI;IADhB,IAAA,oBAAU,GAAE;GACA,IAAI,CAMhB;AAGM,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAEnB,IAAI,CAAO;CACZ,CAAA;AAHY,4BAAQ;AAEnB;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC;8BACZ,IAAI;sCAAC;mBAFA,QAAQ;IADpB,IAAA,oBAAU,GAAE;GACA,QAAQ,CAGp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ALP,KAAK;IADjB,UAAU,EAAE;GACA,KAAK,CAMjB"}
@@ -1,34 +1,32 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const axios_1 = require("axios");
4
- const promises_1 = require("fs/promises");
5
- const dotenv_1 = require("dotenv");
1
+ import axios from 'axios';
2
+ import { unlink, writeFile } from 'fs/promises';
3
+ import { config } from 'dotenv';
6
4
  describe('cloudcmd test for the application', () => {
7
5
  beforeAll(async () => {
8
- (0, dotenv_1.config)();
9
- await (0, promises_1.writeFile)(`${process.env.LOCAL_PATH}/test.txt`, 'content12345');
6
+ config();
7
+ await writeFile(`${process.env.LOCAL_PATH}/test.txt`, 'content12345');
10
8
  await new Promise((resolve) => setTimeout(resolve, 8000));
11
9
  }, 10000);
12
10
  afterAll(async () => {
13
- await (0, promises_1.unlink)(`${process.env.LOCAL_PATH}/test.txt`);
14
- await (0, promises_1.unlink)(`${process.env.LOCAL_PATH}/uploadTest.txt`);
11
+ await unlink(`${process.env.LOCAL_PATH}/test.txt`);
12
+ await unlink(`${process.env.LOCAL_PATH}/uploadTest.txt`);
15
13
  }, 10000);
16
14
  it('should return the correct directory that is set as root', async () => {
17
- const response = await axios_1.default.get(`http://localhost:${process.env.PORT}${process.env.APOLLO_PATH}/files/api/v1/fs`, {
15
+ const response = await axios.get(`http://localhost:${process.env.PORT}${process.env.APOLLO_PATH}/files/api/v1/fs`, {
18
16
  responseType: 'json',
19
17
  });
20
- console.log(response.data);
21
18
  expect(response.data.path).toEqual('/');
22
- expect(response.data.files[0].name).toEqual('common');
23
- expect(response.data.files[1].name).toEqual('user1');
24
- expect(response.data.files[2].name).toEqual('user2');
19
+ const fileNames = response.data.files.map((file) => file.name);
20
+ expect(fileNames).toContain('common');
21
+ expect(fileNames).toContain('user1');
22
+ expect(fileNames).toContain('user2');
25
23
  }, 10000);
26
24
  it('should return the content of a file that is uplaoded to cloudcmd ', async () => {
27
- const response = await axios_1.default.get(`http://localhost:${process.env.PORT}${process.env.APOLLO_PATH}/files/api/v1/fs/test.txt`);
25
+ const response = await axios.get(`http://localhost:${process.env.PORT}${process.env.APOLLO_PATH}/files/api/v1/fs/test.txt`);
28
26
  expect(response.data).toEqual('content12345');
29
27
  }, 10000);
30
28
  it('should upload a file to cloudcmd', async () => {
31
- const response = await axios_1.default.put(`http://localhost:${process.env.PORT}${process.env.APOLLO_PATH}/files/api/v1/fs/uploadTest.txt`, 'some content', { responseType: 'text' });
29
+ const response = await axios.put(`http://localhost:${process.env.PORT}${process.env.APOLLO_PATH}/files/api/v1/fs/uploadTest.txt`, 'some content', { responseType: 'text' });
32
30
  expect(response.data).toEqual('save: ok("uploadTest.txt")');
33
31
  }, 10000);
34
32
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cloudcmd.spec.js","sourceRoot":"","sources":["../../../test/cloudcmd/cloudcmd.spec.ts"],"names":[],"mappings":";;AAAA,iCAA0B;AAC1B,0CAAgD;AAChD,mCAAgC;AAEhC,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;IACjD,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAA,eAAM,GAAE,CAAC;QAET,MAAM,IAAA,oBAAS,EAAC,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,WAAW,EAAE,cAAc,CAAC,CAAC;QAEtE,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAC5D,CAAC,EAAE,KAAK,CAAC,CAAC;IAEV,QAAQ,CAAC,KAAK,IAAI,EAAE;QAClB,MAAM,IAAA,iBAAM,EAAC,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,WAAW,CAAC,CAAC;QACnD,MAAM,IAAA,iBAAM,EAAC,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,iBAAiB,CAAC,CAAC;IAC3D,CAAC,EAAE,KAAK,CAAC,CAAC;IAEV,EAAE,CAAC,yDAAyD,EAAE,KAAK,I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-1,23 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const testing_1 = require("@nestjs/testing");
4
- const request = require("supertest");
5
- const cross_fetch_1 = require("cross-fetch");
6
- const client_1 = require("@apollo/client");
7
- const app_module_1 = require("../../src/app.module");
8
- const testUtil_1 = require("../testUtil");
9
- const client = new client_1.ApolloClient({
10
- link: new client_1.HttpLink({
1
+ import { describe, it, expect } from '@jest/globals';
2
+ import { Test } from '@nestjs/testing';
3
+ import request from 'supertest';
4
+ import fetch from 'cross-fetch';
5
+ import { ApolloClient, InMemoryCache, gql, } from '@apollo/client/core/core.cjs';
6
+ import { HttpLink } from '@apollo/client/link/http/http.cjs';
7
+ import AppModule from '../../src/app.module';
8
+ import { e2eReadFile, e2elistDirectory, expectedFileContentResponse, expectedListDirectoryResponse, } from '../testUtil';
9
+ const client = new ApolloClient({
10
+ link: new HttpLink({
11
11
  uri: `http://localhost:${process.env.PORT}${process.env.APOLLO_PATH}`,
12
- fetch: cross_fetch_1.default,
12
+ fetch,
13
13
  }),
14
- cache: new client_1.InMemoryCache({ addTypename: false }),
14
+ cache: new InMemoryCache({ addTypename: false }),
15
15
  });
16
16
  describe('End to End test for the application', () => {
17
17
  let app;
18
18
  beforeAll(async () => {
19
- const moduleFixture = await testing_1.Test.createTestingModule({
20
- imports: [app_module_1.default],
19
+ const moduleFixture = await Test.createTestingModule({
20
+ imports: [AppModule],
21
21
  }).compile();
22
22
  app = moduleFixture.createNestApplication();
23
23
  await app.init();
@@ -38,16 +38,16 @@ describe('End to End test for the application', () => {
38
38
  expect({ data }).toEqual(expectedResponse);
39
39
  }
40
40
  it('should return the directory contents requested with HTTP POST query', async () => {
41
- await HTTPQuery(testUtil_1.e2elistDirectory, testUtil_1.expectedListDirectoryResponse);
41
+ await HTTPQuery(e2elistDirectory, expectedListDirectoryResponse);
42
42
  }, 10000);
43
43
  it('should return the file content requested with HTTP POST query', async () => {
44
- await HTTPQuery(testUtil_1.e2eReadFile, testUtil_1.expectedFileContentResponse);
44
+ await HTTPQuery(e2eReadFile, expectedFileContentResponse);
45
45
  }, 10000);
46
46
  it('should return the directory contents requested with GraphQL query', async () => {
47
- await GraphQLQuery((0, client_1.gql)(testUtil_1.e2elistDirectory), testUtil_1.expectedListDirectoryResponse);
47
+ await GraphQLQuery(gql(e2elistDirectory), expectedListDirectoryResponse);
48
48
  }, 10000);
49
49
  it('should return the file content requested with GraphQL query', async () => {
50
- await GraphQLQuery((0, client_1.gql)(testUtil_1.e2eReadFile), testUtil_1.expectedFileContentResponse);
50
+ await GraphQLQuery(gql(e2eReadFile), expectedFileContentResponse);
51
51
  }, 10000);
52
52
  });
53
53
  //# sourceMappingURL=app.e2e.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.e2e.spec.js","sourceRoot":"","sources":["../../../test/e2e/app.e2e.spec.ts"],"names":[],"mappings":";;AAAA,6CAAsD;AAEtD,qCAAqC;AACrC,6CAAgC;AAChC,2CAMwB;AACxB,qDAA6C;AAC7C,0CAKqB;AAErB,MAAM,MAAM,GAAG,IAAI,qBAAY,CAAC;IAC9B,IAAI,EAAE,IAAI,iBAAQ,CAAC;QACjB,GAAG,EAAE,oBAAoB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;QACrE,KAAK,EAAL,qBAAK;KACN,CAAC;IACF,KAAK,EAAE,IAAI,sBAAa,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;CACjD,CAAC,CAAC;AAEH,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;IACnD,IAAI,GAAqB,CAAC;IAE1B,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,aAAa,GAAkB,MAAM,cAAI,CAAC,mBAAmB,CAAC;YAClE,OAAO,EAAE,CAAC,oBAAS,CAAC;SACrB,CAAC,CAAC,OAAO,EAAE,CAAC;QACb,GAAG,GAAG,aAAa,CAAC,qBAAqB,EAAE,CAAC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,CAAC;IAC7C,CAAC;IACD,EAAE,CAAC,qEAAqE,EAAE,KAAK,IAAI,EAAE;QACnF,MAAM,SAAS,CAAC,gBAAgB,EAAE,6BAA6B,CAAC,CAAC;IACnE,CAAC,EAAE,KAAK,CAAC,CAAC;IAEV,EAAE,CAAC,+DAA+D,EAAE,KAAK,IAAI,EAAE;QAC7E,MAAM,SAAS,CAAC,WAAW,EAAE,2BAA2B,CAAC,CAAC;IAC5D,CAAC,EAAE,KAAK,CAAC,CAAC;IAEV,EAAE,CAAC,mEAAmE,EAAE,KAAK,IAAI,EAAE;QACjF,MAAM,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,6BAA6B,CAAC,CAAC;IAC3E,CAAC,EAAE,KAAK,CAAC,CAAC;IAEV,EAAE,CAAC,6DAA6D,EAAE,KAAK,IAAI,EAAE;QAC3E,MAAM,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,2BAA2B,CAAC,CAAC;IACpE,CAAC,EAAE,KAAK,CAAC,CAAC;AACZ,CAAC,CAAC,CAAC"}
@@ -1,25 +1,34 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const testing_1 = require("@nestjs/testing");
4
- const config_1 = require("@nestjs/config");
5
- const files_resolver_1 = require("../../src/files/resolvers/files.resolver");
6
- const files_service_factory_1 = require("../../src/files/services/files-service.factory");
7
- const local_files_service_1 = require("../../src/files/services/local-files.service");
8
- const testUtil_1 = require("../testUtil");
1
+ import { describe, it, expect, jest } from '@jest/globals';
2
+ import { Test } from '@nestjs/testing';
3
+ import { ConfigService } from '@nestjs/config';
4
+ import FilesResolver from '../../src/files/files.resolver';
5
+ import LocalFilesService from '../../src/files/local/local-files.service';
6
+ import { pathToTestDirectory, pathToTestFileContent, testDirectory, testFileContent, MockConfigService, } from '../testUtil';
7
+ import GitFilesService from '../../src/files/git/git-files.service';
8
+ import { FILE_SERVICE } from '../../src/files/interfaces/files.service.interface';
9
+ import FilesServiceFactory from '../../src/files/files-service.factory';
9
10
  describe('Integration tests for FilesResolver', () => {
10
11
  let filesResolver;
11
12
  let mockConfigService;
12
13
  beforeEach(async () => {
13
- mockConfigService = new testUtil_1.MockConfigService();
14
- const module = await testing_1.Test.createTestingModule({
14
+ mockConfigService = new MockConfigService();
15
+ const module = await Test.createTestingModule({
15
16
  providers: [
16
- files_resolver_1.default,
17
- files_service_factory_1.default,
18
- local_files_service_1.default,
19
- { provide: config_1.ConfigService, useClass: testUtil_1.MockConfigService },
17
+ FilesResolver,
18
+ {
19
+ provide: FILE_SERVICE,
20
+ useFactory: (configService, localFilesService, gitFilesService) => {
21
+ const fileServices = [localFilesService, gitFilesService];
22
+ return FilesServiceFactory.create(configService, fileServices);
23
+ },
24
+ inject: [ConfigService, LocalFilesService, GitFilesService],
25
+ },
26
+ LocalFilesService,
27
+ GitFilesService,
28
+ { provide: ConfigService, useClass: MockConfigService },
20
29
  ],
21
30
  }).compile();
22
- filesResolver = module.get(files_resolver_1.default);
31
+ filesResolver = module.get(FilesResolver);
23
32
  });
24
33
  afterEach(() => {
25
34
  jest.clearAllMocks();
@@ -35,14 +44,14 @@ describe('Integration tests for FilesResolver', () => {
35
44
  });
36
45
  describe('listDirectory', () => {
37
46
  it('should list files', async () => {
38
- const files = await filesResolver.listDirectory(testUtil_1.pathToTestDirectory);
39
- expect(files).toEqual(testUtil_1.testDirectory);
47
+ const files = await filesResolver.listDirectory(pathToTestDirectory);
48
+ expect(files).toEqual(testDirectory);
40
49
  });
41
50
  });
42
51
  describe('readFile', () => {
43
52
  it('should read file', async () => {
44
- const content = await filesResolver.readFile(testUtil_1.pathToTestFileContent);
45
- expect(content).toEqual(testUtil_1.testFileContent);
53
+ const content = await filesResolver.readFile(pathToTestFileContent);
54
+ expect(content).toEqual(testFileContent);
46
55
  });
47
56
  });
48
57
  });
@@ -1 +1 @@
1
- {"version":3,"file":"files.service.integration.spec.js","sourceRoot":"","sources":["../../../test/integration/files.service.integration.spec.ts"],"names":[],"mappings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AAM,aAAa,CAAC,aAAa,CAAC,8BAAmB,CAAC,CAAC;oBACrE,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,wBAAa,CAAC,CAAC;gBACvC,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;gBACxB,EAAE,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;oBAChC,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,gCAAqB,CAAC,CAAC;oBACpE,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,0BAAe,CAAC,CAAC;gBAC3C,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"files.service.integration.spec.js","sourceRoot":"","sources":["../../../test/integration/files.service.integration.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAiB,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,iBAAiB,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,eAAe,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAClF,OAAO,mBAAmB,MAAM,uCAAuC,CAAC;AAExE,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;IACnD,IAAI,aAA4B,CAAC;IACjC,IAAI,iBAAoC,CAAC;IAEzC,UAAU,CAAC,KAAK,IAAI,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GAAG,EAAE;gBAC7B,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;oBACjC,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;oBACrE,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;gBACvC,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;gBACxB,EAAE,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;oBAChC,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;oBACpE,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;gBAC3C,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1,90 +1,88 @@
1
1
  export declare const readFileActualContent: string[];
2
- export declare const pathToTestDirectory = 'user2';
2
+ export declare const pathToTestDirectory = "user2";
3
3
  export declare const testDirectory: {
4
- repository: {
5
- tree: {
6
- blobs: {
7
- edges: any[];
8
- };
9
- trees: {
10
- edges: {
11
- node: {
12
- name: string;
13
- type: string;
14
- };
15
- }[];
16
- };
4
+ repository: {
5
+ tree: {
6
+ blobs: {
7
+ edges: any[];
8
+ };
9
+ trees: {
10
+ edges: {
11
+ node: {
12
+ name: string;
13
+ type: string;
14
+ };
15
+ }[];
16
+ };
17
+ };
17
18
  };
18
- };
19
19
  };
20
- export declare const testFileName = 'README.md';
21
- export declare const fstestFileContent = 'content123';
22
- export declare const pathToTestFileContent = 'user2/tools/README.md';
20
+ export declare const testFileName = "README.md";
21
+ export declare const fstestFileContent = "content123";
22
+ export declare const pathToTestFileContent = "user2/tools/README.md";
23
23
  export declare const testFileArray: string[];
24
24
  export declare const testFileContent: {
25
- repository: {
26
- blobs: {
27
- nodes: {
28
- name: string;
29
- rawBlob: string;
30
- rawTextBlob: string;
31
- }[];
25
+ repository: {
26
+ blobs: {
27
+ nodes: {
28
+ name: string;
29
+ rawBlob: string;
30
+ rawTextBlob: string;
31
+ }[];
32
+ };
32
33
  };
33
- };
34
34
  };
35
35
  export declare function sleep(ms: any): void;
36
36
  export declare class MockConfigService {
37
- get(key: string): string;
37
+ get(key: string): string;
38
38
  }
39
39
  export declare const mockReadFileResponseData: {
40
- project: {
41
- __typename: string;
42
- repository: {
43
- __typename: string;
44
- blobs: {
45
- nodes: {
46
- __typename: string;
47
- name: string;
48
- rawBlob: string;
49
- rawTextBlob: string;
50
- }[];
51
- };
40
+ project: {
41
+ __typename: string;
42
+ repository: {
43
+ __typename: string;
44
+ blobs: {
45
+ nodes: {
46
+ __typename: string;
47
+ name: string;
48
+ rawBlob: string;
49
+ rawTextBlob: string;
50
+ }[];
51
+ };
52
+ };
52
53
  };
53
- };
54
54
  };
55
55
  export declare const expectedListDirectoryResponse: {
56
- data: {
57
- listDirectory: {
58
- repository: {
59
- tree: {
60
- trees: {
61
- edges: {
62
- node: {
63
- name: string;
64
- };
65
- }[];
66
- };
56
+ data: {
57
+ listDirectory: {
58
+ repository: {
59
+ tree: {
60
+ trees: {
61
+ edges: {
62
+ node: {
63
+ name: string;
64
+ };
65
+ }[];
66
+ };
67
+ };
68
+ };
67
69
  };
68
- };
69
70
  };
70
- };
71
71
  };
72
72
  export declare const expectedFileContentResponse: {
73
- data: {
74
- readFile: {
75
- repository: {
76
- blobs: {
77
- nodes: {
78
- name: string;
79
- rawBlob: string;
80
- rawTextBlob: string;
81
- }[];
73
+ data: {
74
+ readFile: {
75
+ repository: {
76
+ blobs: {
77
+ nodes: {
78
+ name: string;
79
+ rawBlob: string;
80
+ rawTextBlob: string;
81
+ }[];
82
+ };
83
+ };
82
84
  };
83
- };
84
85
  };
85
- };
86
86
  };
87
- export declare const e2elistDirectory =
88
- 'query {\n listDirectory(path:"user2")\n {\n repository{\n tree{\n trees{\n edges{\n node{\n name\n \n }\n }\n }\n }\n }\n }\n}';
89
- export declare const e2eReadFile =
90
- 'query {\n readFile(path:"user2/tools/README.md") {\n repository {\n blobs {\n nodes {\n name\n rawBlob\n rawTextBlob\n }\n }\n }\n }\n}';
87
+ export declare const e2elistDirectory = "query {\n listDirectory(path:\"user2\")\n {\n repository{\n tree{\n trees{\n edges{\n node{\n name\n \n }\n }\n }\n }\n }\n }\n}";
88
+ export declare const e2eReadFile = "query {\n readFile(path:\"user2/tools/README.md\") {\n repository {\n blobs {\n nodes {\n name\n rawBlob\n rawTextBlob\n }\n }\n }\n }\n}";