@tronsfey/ucli-server 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 (247) hide show
  1. package/README.md +423 -0
  2. package/README.zh.md +404 -0
  3. package/assets/logo.svg +138 -0
  4. package/dist/admin-ui/assets/index-BjdBylCY.css +1 -0
  5. package/dist/admin-ui/assets/index-CDwKIMTJ.js +117 -0
  6. package/dist/admin-ui/assets/remixicon-B25hvfAs.eot +0 -0
  7. package/dist/admin-ui/assets/remixicon-BTtOSOPh.svg +9709 -0
  8. package/dist/admin-ui/assets/remixicon-CZw4FkzQ.woff2 +0 -0
  9. package/dist/admin-ui/assets/remixicon-S6an_USy.woff +0 -0
  10. package/dist/admin-ui/assets/remixicon-sqouR8Ox.ttf +0 -0
  11. package/dist/admin-ui/dist/assets/index-BjdBylCY.css +1 -0
  12. package/dist/admin-ui/dist/assets/index-CDwKIMTJ.js +117 -0
  13. package/dist/admin-ui/dist/assets/index-CppEl63e.css +1 -0
  14. package/dist/admin-ui/dist/assets/index-DBkeGfMQ.js +117 -0
  15. package/dist/admin-ui/dist/assets/index-ss5EmsBH.js +117 -0
  16. package/dist/admin-ui/dist/assets/remixicon-B25hvfAs.eot +0 -0
  17. package/dist/admin-ui/dist/assets/remixicon-BTtOSOPh.svg +9709 -0
  18. package/dist/admin-ui/dist/assets/remixicon-CZw4FkzQ.woff2 +0 -0
  19. package/dist/admin-ui/dist/assets/remixicon-S6an_USy.woff +0 -0
  20. package/dist/admin-ui/dist/assets/remixicon-sqouR8Ox.ttf +0 -0
  21. package/dist/admin-ui/dist/index.html +14 -0
  22. package/dist/admin-ui/index.html +14 -0
  23. package/dist/app.module.d.ts +3 -0
  24. package/dist/app.module.d.ts.map +1 -0
  25. package/dist/app.module.js +65 -0
  26. package/dist/app.module.js.map +1 -0
  27. package/dist/auth/admin.guard.d.ts +8 -0
  28. package/dist/auth/admin.guard.d.ts.map +1 -0
  29. package/dist/auth/admin.guard.js +34 -0
  30. package/dist/auth/admin.guard.js.map +1 -0
  31. package/dist/auth/auth.module.d.ts +3 -0
  32. package/dist/auth/auth.module.d.ts.map +1 -0
  33. package/dist/auth/auth.module.js +24 -0
  34. package/dist/auth/auth.module.js.map +1 -0
  35. package/dist/auth/decorators/jwt-payload.decorator.d.ts +2 -0
  36. package/dist/auth/decorators/jwt-payload.decorator.d.ts.map +1 -0
  37. package/dist/auth/decorators/jwt-payload.decorator.js +10 -0
  38. package/dist/auth/decorators/jwt-payload.decorator.js.map +1 -0
  39. package/dist/auth/group-token.guard.d.ts +11 -0
  40. package/dist/auth/group-token.guard.d.ts.map +1 -0
  41. package/dist/auth/group-token.guard.js +53 -0
  42. package/dist/auth/group-token.guard.js.map +1 -0
  43. package/dist/cache/cache.interface.d.ts +8 -0
  44. package/dist/cache/cache.interface.d.ts.map +1 -0
  45. package/dist/cache/cache.interface.js +3 -0
  46. package/dist/cache/cache.interface.js.map +1 -0
  47. package/dist/cache/cache.module.d.ts +5 -0
  48. package/dist/cache/cache.module.d.ts.map +1 -0
  49. package/dist/cache/cache.module.js +56 -0
  50. package/dist/cache/cache.module.js.map +1 -0
  51. package/dist/cache/cache.token.d.ts +2 -0
  52. package/dist/cache/cache.token.d.ts.map +1 -0
  53. package/dist/cache/cache.token.js +5 -0
  54. package/dist/cache/cache.token.js.map +1 -0
  55. package/dist/cache/memory/memory-cache.adapter.d.ts +15 -0
  56. package/dist/cache/memory/memory-cache.adapter.d.ts.map +1 -0
  57. package/dist/cache/memory/memory-cache.adapter.js +52 -0
  58. package/dist/cache/memory/memory-cache.adapter.js.map +1 -0
  59. package/dist/cache/redis/redis-cache.adapter.d.ts +16 -0
  60. package/dist/cache/redis/redis-cache.adapter.d.ts.map +1 -0
  61. package/dist/cache/redis/redis-cache.adapter.js +63 -0
  62. package/dist/cache/redis/redis-cache.adapter.js.map +1 -0
  63. package/dist/config/app-config.module.d.ts +3 -0
  64. package/dist/config/app-config.module.d.ts.map +1 -0
  65. package/dist/config/app-config.module.js +100 -0
  66. package/dist/config/app-config.module.js.map +1 -0
  67. package/dist/config/app-config.service.d.ts +29 -0
  68. package/dist/config/app-config.service.d.ts.map +1 -0
  69. package/dist/config/app-config.service.js +66 -0
  70. package/dist/config/app-config.service.js.map +1 -0
  71. package/dist/crypto/crypto.module.d.ts +3 -0
  72. package/dist/crypto/crypto.module.d.ts.map +1 -0
  73. package/dist/crypto/crypto.module.js +22 -0
  74. package/dist/crypto/crypto.module.js.map +1 -0
  75. package/dist/crypto/encryption.service.d.ts +9 -0
  76. package/dist/crypto/encryption.service.d.ts.map +1 -0
  77. package/dist/crypto/encryption.service.js +59 -0
  78. package/dist/crypto/encryption.service.js.map +1 -0
  79. package/dist/crypto/jwt.service.d.ts +28 -0
  80. package/dist/crypto/jwt.service.d.ts.map +1 -0
  81. package/dist/crypto/jwt.service.js +72 -0
  82. package/dist/crypto/jwt.service.js.map +1 -0
  83. package/dist/groups/dto/create-group.dto.d.ts +5 -0
  84. package/dist/groups/dto/create-group.dto.d.ts.map +1 -0
  85. package/dist/groups/dto/create-group.dto.js +34 -0
  86. package/dist/groups/dto/create-group.dto.js.map +1 -0
  87. package/dist/groups/groups.controller.d.ts +9 -0
  88. package/dist/groups/groups.controller.d.ts.map +1 -0
  89. package/dist/groups/groups.controller.js +60 -0
  90. package/dist/groups/groups.controller.js.map +1 -0
  91. package/dist/groups/groups.module.d.ts +3 -0
  92. package/dist/groups/groups.module.d.ts.map +1 -0
  93. package/dist/groups/groups.module.js +25 -0
  94. package/dist/groups/groups.module.js.map +1 -0
  95. package/dist/groups/groups.service.d.ts +9 -0
  96. package/dist/groups/groups.service.d.ts.map +1 -0
  97. package/dist/groups/groups.service.js +45 -0
  98. package/dist/groups/groups.service.js.map +1 -0
  99. package/dist/health/health.controller.d.ts +13 -0
  100. package/dist/health/health.controller.d.ts.map +1 -0
  101. package/dist/health/health.controller.js +68 -0
  102. package/dist/health/health.controller.js.map +1 -0
  103. package/dist/health/health.module.d.ts +3 -0
  104. package/dist/health/health.module.d.ts.map +1 -0
  105. package/dist/health/health.module.js +22 -0
  106. package/dist/health/health.module.js.map +1 -0
  107. package/dist/main.d.ts +3 -0
  108. package/dist/main.d.ts.map +1 -0
  109. package/dist/main.js +109 -0
  110. package/dist/main.js.map +1 -0
  111. package/dist/mcp/admin-mcp.controller.d.ts +13 -0
  112. package/dist/mcp/admin-mcp.controller.d.ts.map +1 -0
  113. package/dist/mcp/admin-mcp.controller.js +105 -0
  114. package/dist/mcp/admin-mcp.controller.js.map +1 -0
  115. package/dist/mcp/client-mcp.controller.d.ts +9 -0
  116. package/dist/mcp/client-mcp.controller.d.ts.map +1 -0
  117. package/dist/mcp/client-mcp.controller.js +63 -0
  118. package/dist/mcp/client-mcp.controller.js.map +1 -0
  119. package/dist/mcp/dto/create-mcp.dto.d.ts +11 -0
  120. package/dist/mcp/dto/create-mcp.dto.d.ts.map +1 -0
  121. package/dist/mcp/dto/create-mcp.dto.js +74 -0
  122. package/dist/mcp/dto/create-mcp.dto.js.map +1 -0
  123. package/dist/mcp/dto/update-mcp.dto.d.ts +11 -0
  124. package/dist/mcp/dto/update-mcp.dto.d.ts.map +1 -0
  125. package/dist/mcp/dto/update-mcp.dto.js +71 -0
  126. package/dist/mcp/dto/update-mcp.dto.js.map +1 -0
  127. package/dist/mcp/mcp.module.d.ts +3 -0
  128. package/dist/mcp/mcp.module.d.ts.map +1 -0
  129. package/dist/mcp/mcp.module.js +26 -0
  130. package/dist/mcp/mcp.module.js.map +1 -0
  131. package/dist/mcp/mcp.service.d.ts +16 -0
  132. package/dist/mcp/mcp.service.d.ts.map +1 -0
  133. package/dist/mcp/mcp.service.js +78 -0
  134. package/dist/mcp/mcp.service.js.map +1 -0
  135. package/dist/metrics/metrics.controller.d.ts +12 -0
  136. package/dist/metrics/metrics.controller.d.ts.map +1 -0
  137. package/dist/metrics/metrics.controller.js +71 -0
  138. package/dist/metrics/metrics.controller.js.map +1 -0
  139. package/dist/metrics/metrics.module.d.ts +3 -0
  140. package/dist/metrics/metrics.module.d.ts.map +1 -0
  141. package/dist/metrics/metrics.module.js +20 -0
  142. package/dist/metrics/metrics.module.js.map +1 -0
  143. package/dist/oas/admin-oas.controller.d.ts +12 -0
  144. package/dist/oas/admin-oas.controller.d.ts.map +1 -0
  145. package/dist/oas/admin-oas.controller.js +96 -0
  146. package/dist/oas/admin-oas.controller.js.map +1 -0
  147. package/dist/oas/client-oas.controller.d.ts +9 -0
  148. package/dist/oas/client-oas.controller.d.ts.map +1 -0
  149. package/dist/oas/client-oas.controller.js +63 -0
  150. package/dist/oas/client-oas.controller.js.map +1 -0
  151. package/dist/oas/dto/create-oas.dto.d.ts +12 -0
  152. package/dist/oas/dto/create-oas.dto.d.ts.map +1 -0
  153. package/dist/oas/dto/create-oas.dto.js +82 -0
  154. package/dist/oas/dto/create-oas.dto.js.map +1 -0
  155. package/dist/oas/dto/update-oas.dto.d.ts +12 -0
  156. package/dist/oas/dto/update-oas.dto.d.ts.map +1 -0
  157. package/dist/oas/dto/update-oas.dto.js +77 -0
  158. package/dist/oas/dto/update-oas.dto.js.map +1 -0
  159. package/dist/oas/oas.module.d.ts +3 -0
  160. package/dist/oas/oas.module.d.ts.map +1 -0
  161. package/dist/oas/oas.module.js +26 -0
  162. package/dist/oas/oas.module.js.map +1 -0
  163. package/dist/oas/oas.service.d.ts +16 -0
  164. package/dist/oas/oas.service.d.ts.map +1 -0
  165. package/dist/oas/oas.service.js +79 -0
  166. package/dist/oas/oas.service.js.map +1 -0
  167. package/dist/otel/otel.d.ts +25 -0
  168. package/dist/otel/otel.d.ts.map +1 -0
  169. package/dist/otel/otel.js +61 -0
  170. package/dist/otel/otel.js.map +1 -0
  171. package/dist/storage/interfaces/repos.interface.d.ts +158 -0
  172. package/dist/storage/interfaces/repos.interface.d.ts.map +1 -0
  173. package/dist/storage/interfaces/repos.interface.js +4 -0
  174. package/dist/storage/interfaces/repos.interface.js.map +1 -0
  175. package/dist/storage/memory/memory-group.repo.d.ts +9 -0
  176. package/dist/storage/memory/memory-group.repo.d.ts.map +1 -0
  177. package/dist/storage/memory/memory-group.repo.js +33 -0
  178. package/dist/storage/memory/memory-group.repo.js.map +1 -0
  179. package/dist/storage/memory/memory-mcp.repo.d.ts +13 -0
  180. package/dist/storage/memory/memory-mcp.repo.d.ts.map +1 -0
  181. package/dist/storage/memory/memory-mcp.repo.js +65 -0
  182. package/dist/storage/memory/memory-mcp.repo.js.map +1 -0
  183. package/dist/storage/memory/memory-oas.repo.d.ts +13 -0
  184. package/dist/storage/memory/memory-oas.repo.d.ts.map +1 -0
  185. package/dist/storage/memory/memory-oas.repo.js +55 -0
  186. package/dist/storage/memory/memory-oas.repo.js.map +1 -0
  187. package/dist/storage/memory/memory-token.repo.d.ts +11 -0
  188. package/dist/storage/memory/memory-token.repo.d.ts.map +1 -0
  189. package/dist/storage/memory/memory-token.repo.js +39 -0
  190. package/dist/storage/memory/memory-token.repo.js.map +1 -0
  191. package/dist/storage/storage.module.d.ts +5 -0
  192. package/dist/storage/storage.module.d.ts.map +1 -0
  193. package/dist/storage/storage.module.js +84 -0
  194. package/dist/storage/storage.module.js.map +1 -0
  195. package/dist/storage/storage.tokens.d.ts +5 -0
  196. package/dist/storage/storage.tokens.d.ts.map +1 -0
  197. package/dist/storage/storage.tokens.js +8 -0
  198. package/dist/storage/storage.tokens.js.map +1 -0
  199. package/dist/storage/typeorm/entities/group.entity.d.ts +12 -0
  200. package/dist/storage/typeorm/entities/group.entity.d.ts.map +1 -0
  201. package/dist/storage/typeorm/entities/group.entity.js +57 -0
  202. package/dist/storage/typeorm/entities/group.entity.js.map +1 -0
  203. package/dist/storage/typeorm/entities/mcp-entry.entity.d.ts +16 -0
  204. package/dist/storage/typeorm/entities/mcp-entry.entity.d.ts.map +1 -0
  205. package/dist/storage/typeorm/entities/mcp-entry.entity.js +82 -0
  206. package/dist/storage/typeorm/entities/mcp-entry.entity.js.map +1 -0
  207. package/dist/storage/typeorm/entities/oas-entry.entity.d.ts +17 -0
  208. package/dist/storage/typeorm/entities/oas-entry.entity.d.ts.map +1 -0
  209. package/dist/storage/typeorm/entities/oas-entry.entity.js +87 -0
  210. package/dist/storage/typeorm/entities/oas-entry.entity.js.map +1 -0
  211. package/dist/storage/typeorm/entities/token.entity.d.ts +13 -0
  212. package/dist/storage/typeorm/entities/token.entity.d.ts.map +1 -0
  213. package/dist/storage/typeorm/entities/token.entity.js +68 -0
  214. package/dist/storage/typeorm/entities/token.entity.js.map +1 -0
  215. package/dist/storage/typeorm/typeorm-group.repo.d.ts +12 -0
  216. package/dist/storage/typeorm/typeorm-group.repo.d.ts.map +1 -0
  217. package/dist/storage/typeorm/typeorm-group.repo.js +50 -0
  218. package/dist/storage/typeorm/typeorm-group.repo.js.map +1 -0
  219. package/dist/storage/typeorm/typeorm-mcp.repo.d.ts +15 -0
  220. package/dist/storage/typeorm/typeorm-mcp.repo.d.ts.map +1 -0
  221. package/dist/storage/typeorm/typeorm-mcp.repo.js +88 -0
  222. package/dist/storage/typeorm/typeorm-mcp.repo.js.map +1 -0
  223. package/dist/storage/typeorm/typeorm-oas.repo.d.ts +15 -0
  224. package/dist/storage/typeorm/typeorm-oas.repo.d.ts.map +1 -0
  225. package/dist/storage/typeorm/typeorm-oas.repo.js +92 -0
  226. package/dist/storage/typeorm/typeorm-oas.repo.js.map +1 -0
  227. package/dist/storage/typeorm/typeorm-token.repo.d.ts +13 -0
  228. package/dist/storage/typeorm/typeorm-token.repo.d.ts.map +1 -0
  229. package/dist/storage/typeorm/typeorm-token.repo.js +56 -0
  230. package/dist/storage/typeorm/typeorm-token.repo.js.map +1 -0
  231. package/dist/tokens/dto/issue-token.dto.d.ts +6 -0
  232. package/dist/tokens/dto/issue-token.dto.d.ts.map +1 -0
  233. package/dist/tokens/dto/issue-token.dto.js +41 -0
  234. package/dist/tokens/dto/issue-token.dto.js.map +1 -0
  235. package/dist/tokens/tokens.controller.d.ts +12 -0
  236. package/dist/tokens/tokens.controller.d.ts.map +1 -0
  237. package/dist/tokens/tokens.controller.js +89 -0
  238. package/dist/tokens/tokens.controller.js.map +1 -0
  239. package/dist/tokens/tokens.module.d.ts +3 -0
  240. package/dist/tokens/tokens.module.d.ts.map +1 -0
  241. package/dist/tokens/tokens.module.js +27 -0
  242. package/dist/tokens/tokens.module.js.map +1 -0
  243. package/dist/tokens/tokens.service.d.ts +25 -0
  244. package/dist/tokens/tokens.service.d.ts.map +1 -0
  245. package/dist/tokens/tokens.service.js +69 -0
  246. package/dist/tokens/tokens.service.js.map +1 -0
  247. package/package.json +81 -0
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OASEntryEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const group_entity_1 = require("./group.entity");
15
+ let OASEntryEntity = class OASEntryEntity {
16
+ id;
17
+ groupId;
18
+ name;
19
+ description;
20
+ remoteUrl;
21
+ baseEndpoint;
22
+ authType;
23
+ authConfig;
24
+ cacheTtl;
25
+ enabled;
26
+ createdAt;
27
+ updatedAt;
28
+ group;
29
+ };
30
+ exports.OASEntryEntity = OASEntryEntity;
31
+ __decorate([
32
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
33
+ __metadata("design:type", String)
34
+ ], OASEntryEntity.prototype, "id", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ name: 'group_id' }),
37
+ __metadata("design:type", String)
38
+ ], OASEntryEntity.prototype, "groupId", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ length: 100, unique: true }),
41
+ __metadata("design:type", String)
42
+ ], OASEntryEntity.prototype, "name", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ type: 'text', default: '' }),
45
+ __metadata("design:type", String)
46
+ ], OASEntryEntity.prototype, "description", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ name: 'remote_url', length: 2048 }),
49
+ __metadata("design:type", String)
50
+ ], OASEntryEntity.prototype, "remoteUrl", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ name: 'base_endpoint', length: 2048, nullable: true }),
53
+ __metadata("design:type", Object)
54
+ ], OASEntryEntity.prototype, "baseEndpoint", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.Column)({ name: 'auth_type', length: 20 }),
57
+ __metadata("design:type", String)
58
+ ], OASEntryEntity.prototype, "authType", void 0);
59
+ __decorate([
60
+ (0, typeorm_1.Column)({ name: 'auth_config', type: 'text' }),
61
+ __metadata("design:type", String)
62
+ ], OASEntryEntity.prototype, "authConfig", void 0);
63
+ __decorate([
64
+ (0, typeorm_1.Column)({ name: 'cache_ttl', default: 3600 }),
65
+ __metadata("design:type", Number)
66
+ ], OASEntryEntity.prototype, "cacheTtl", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.Column)({ default: true }),
69
+ __metadata("design:type", Boolean)
70
+ ], OASEntryEntity.prototype, "enabled", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
73
+ __metadata("design:type", Date)
74
+ ], OASEntryEntity.prototype, "createdAt", void 0);
75
+ __decorate([
76
+ (0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
77
+ __metadata("design:type", Date)
78
+ ], OASEntryEntity.prototype, "updatedAt", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.ManyToOne)(() => group_entity_1.GroupEntity, g => g.oasEntries, { onDelete: 'CASCADE' }),
81
+ (0, typeorm_1.JoinColumn)({ name: 'group_id' }),
82
+ __metadata("design:type", group_entity_1.GroupEntity)
83
+ ], OASEntryEntity.prototype, "group", void 0);
84
+ exports.OASEntryEntity = OASEntryEntity = __decorate([
85
+ (0, typeorm_1.Entity)('oas_entries')
86
+ ], OASEntryEntity);
87
+ //# sourceMappingURL=oas-entry.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oas-entry.entity.js","sourceRoot":"","sources":["../../../../src/storage/typeorm/entities/oas-entry.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA2H;AAC3H,iDAA4C;AAGrC,IAAM,cAAc,GAApB,MAAM,cAAc;IAEzB,EAAE,CAAS;IAGX,OAAO,CAAS;IAGhB,IAAI,CAAS;IAGb,WAAW,CAAS;IAGpB,SAAS,CAAS;IAGlB,YAAY,CAAgB;IAG5B,QAAQ,CAAS;IAGjB,UAAU,CAAS;IAGnB,QAAQ,CAAS;IAGjB,OAAO,CAAU;IAGjB,SAAS,CAAO;IAGhB,SAAS,CAAO;IAIhB,KAAK,CAAc;CACpB,CAAA;AAxCY,wCAAc;AAEzB;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;0CACpB;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;;+CACb;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;4CACzB;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;mDAClB;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;iDAC3B;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACpC;AAG5B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;gDACzB;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAC3B;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;gDAC5B;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACT;AAGjB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC7B,IAAI;iDAAA;AAGhB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC7B,IAAI;iDAAA;AAIhB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACxE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;8BACzB,0BAAW;6CAAA;yBAvCR,cAAc;IAD1B,IAAA,gBAAM,EAAC,aAAa,CAAC;GACT,cAAc,CAwC1B"}
@@ -0,0 +1,13 @@
1
+ import { GroupEntity } from './group.entity';
2
+ export declare class TokenEntity {
3
+ id: string;
4
+ groupId: string;
5
+ name: string;
6
+ jti: string;
7
+ scopes: string[];
8
+ expiresAt: Date | null;
9
+ revokedAt: Date | null;
10
+ createdAt: Date;
11
+ group: GroupEntity;
12
+ }
13
+ //# sourceMappingURL=token.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.entity.d.ts","sourceRoot":"","sources":["../../../../src/storage/typeorm/entities/token.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,qBACa,WAAW;IAEtB,EAAE,EAAG,MAAM,CAAA;IAGX,OAAO,EAAG,MAAM,CAAA;IAGhB,IAAI,EAAG,MAAM,CAAA;IAGb,GAAG,EAAG,MAAM,CAAA;IAIZ,MAAM,EAAG,MAAM,EAAE,CAAA;IAGjB,SAAS,EAAG,IAAI,GAAG,IAAI,CAAA;IAGvB,SAAS,EAAG,IAAI,GAAG,IAAI,CAAA;IAGvB,SAAS,EAAG,IAAI,CAAA;IAIhB,KAAK,EAAG,WAAW,CAAA;CACpB"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TokenEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const group_entity_1 = require("./group.entity");
15
+ let TokenEntity = class TokenEntity {
16
+ id;
17
+ groupId;
18
+ name;
19
+ jti;
20
+ // Stored as comma-separated string — compatible with MySQL and PostgreSQL
21
+ scopes;
22
+ expiresAt;
23
+ revokedAt;
24
+ createdAt;
25
+ group;
26
+ };
27
+ exports.TokenEntity = TokenEntity;
28
+ __decorate([
29
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
30
+ __metadata("design:type", String)
31
+ ], TokenEntity.prototype, "id", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ name: 'group_id' }),
34
+ __metadata("design:type", String)
35
+ ], TokenEntity.prototype, "groupId", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ length: 200 }),
38
+ __metadata("design:type", String)
39
+ ], TokenEntity.prototype, "name", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ length: 64, unique: true }),
42
+ __metadata("design:type", String)
43
+ ], TokenEntity.prototype, "jti", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: 'simple-array', default: '' }),
46
+ __metadata("design:type", Array)
47
+ ], TokenEntity.prototype, "scopes", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ name: 'expires_at', nullable: true, type: 'datetime' }),
50
+ __metadata("design:type", Object)
51
+ ], TokenEntity.prototype, "expiresAt", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ name: 'revoked_at', nullable: true, type: 'datetime' }),
54
+ __metadata("design:type", Object)
55
+ ], TokenEntity.prototype, "revokedAt", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
58
+ __metadata("design:type", Date)
59
+ ], TokenEntity.prototype, "createdAt", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.ManyToOne)(() => group_entity_1.GroupEntity, g => g.tokens, { onDelete: 'CASCADE' }),
62
+ (0, typeorm_1.JoinColumn)({ name: 'group_id' }),
63
+ __metadata("design:type", group_entity_1.GroupEntity)
64
+ ], TokenEntity.prototype, "group", void 0);
65
+ exports.TokenEntity = TokenEntity = __decorate([
66
+ (0, typeorm_1.Entity)('tokens')
67
+ ], TokenEntity);
68
+ //# sourceMappingURL=token.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.entity.js","sourceRoot":"","sources":["../../../../src/storage/typeorm/entities/token.entity.ts"],"names":[],"mappings":";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AU,EAAE,CAAC;8BACzB,0BAAW;0CAAA;sBA5BR,WAAW;IADvB,IAAA,gBAAM,EAAC,QAAQ,CAAC;GACJ,WAAW,CA6BvB"}
@@ -0,0 +1,12 @@
1
+ import { Repository } from 'typeorm';
2
+ import { GroupEntity } from './entities/group.entity';
3
+ import type { Group, IGroupRepo, CreateGroupInput } from '../interfaces/repos.interface';
4
+ export declare class TypeORMGroupRepo implements IGroupRepo {
5
+ private readonly repo;
6
+ constructor(repo: Repository<GroupEntity>);
7
+ create(data: CreateGroupInput): Promise<Group>;
8
+ findAll(): Promise<Group[]>;
9
+ findById(id: string): Promise<Group | null>;
10
+ findByName(name: string): Promise<Group | null>;
11
+ }
12
+ //# sourceMappingURL=typeorm-group.repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-group.repo.d.ts","sourceRoot":"","sources":["../../../src/storage/typeorm/typeorm-group.repo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAMxF,qBACa,gBAAiB,YAAW,UAAU;IACN,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC;IAEnF,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC;IAK9C,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAI3B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAK3C,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAItD"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.TypeORMGroupRepo = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const typeorm_1 = require("@nestjs/typeorm");
18
+ const typeorm_2 = require("typeorm");
19
+ const group_entity_1 = require("./entities/group.entity");
20
+ function toGroup(e) {
21
+ return { id: e.id, name: e.name, description: e.description, createdAt: e.createdAt, updatedAt: e.updatedAt };
22
+ }
23
+ let TypeORMGroupRepo = class TypeORMGroupRepo {
24
+ repo;
25
+ constructor(repo) {
26
+ this.repo = repo;
27
+ }
28
+ async create(data) {
29
+ const entity = this.repo.create(data);
30
+ return toGroup(await this.repo.save(entity));
31
+ }
32
+ async findAll() {
33
+ return (await this.repo.find({ order: { createdAt: 'ASC' } })).map(toGroup);
34
+ }
35
+ async findById(id) {
36
+ const e = await this.repo.findOneBy({ id });
37
+ return e ? toGroup(e) : null;
38
+ }
39
+ async findByName(name) {
40
+ const e = await this.repo.findOneBy({ name });
41
+ return e ? toGroup(e) : null;
42
+ }
43
+ };
44
+ exports.TypeORMGroupRepo = TypeORMGroupRepo;
45
+ exports.TypeORMGroupRepo = TypeORMGroupRepo = __decorate([
46
+ (0, common_1.Injectable)(),
47
+ __param(0, (0, typeorm_1.InjectRepository)(group_entity_1.GroupEntity)),
48
+ __metadata("design:paramtypes", [typeorm_2.Repository])
49
+ ], TypeORMGroupRepo);
50
+ //# sourceMappingURL=typeorm-group.repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-group.repo.js","sourceRoot":"","sources":["../../../src/storage/typeorm/typeorm-group.repo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,6CAAkD;AAClD,qCAAoC;AACpC,0DAAqD;AAGrD,SAAS,OAAO,CAAC,CAAc;IAC7B,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAA;AAC/G,CAAC;AAGM,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACiC;IAA5D,YAA4D,IAA6B;QAA7B,SAAI,GAAJ,IAAI,CAAyB;IAAG,CAAC;IAE7F,KAAK,CAAC,MAAM,CAAC,IAAsB;QACjC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACrC,OAAO,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IAC9C,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAC7E,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAU;QACvB,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QAC3C,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC9B,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAY;QAC3B,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;QAC7C,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC9B,CAAC;CACF,CAAA;AArBY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,0BAAgB,EAAC,0BAAW,CAAC,CAAA;qCAAwB,oBAAU;GADjE,gBAAgB,CAqB5B"}
@@ -0,0 +1,15 @@
1
+ import { Repository } from 'typeorm';
2
+ import { McpEntryEntity } from './entities/mcp-entry.entity';
3
+ import type { McpEntry, IMCPRepo, CreateMcpInput, UpdateMcpInput } from '../interfaces/repos.interface';
4
+ export declare class TypeORMMCPRepo implements IMCPRepo {
5
+ private readonly repo;
6
+ constructor(repo: Repository<McpEntryEntity>);
7
+ create(data: CreateMcpInput): Promise<McpEntry>;
8
+ findAll(): Promise<McpEntry[]>;
9
+ findByGroup(groupId: string): Promise<McpEntry[]>;
10
+ findById(id: string): Promise<McpEntry | null>;
11
+ findByName(name: string): Promise<McpEntry | null>;
12
+ update(id: string, data: UpdateMcpInput): Promise<McpEntry>;
13
+ delete(id: string): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=typeorm-mcp.repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-mcp.repo.d.ts","sourceRoot":"","sources":["../../../src/storage/typeorm/typeorm-mcp.repo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAiB,MAAM,+BAA+B,CAAA;AAYtH,qBACa,cAAe,YAAW,QAAQ;IACC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC;IAEzF,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAS/C,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAI9B,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAIjD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAK9C,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAKlD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAgB3D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxC"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.TypeORMMCPRepo = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const typeorm_1 = require("@nestjs/typeorm");
18
+ const typeorm_2 = require("typeorm");
19
+ const mcp_entry_entity_1 = require("./entities/mcp-entry.entity");
20
+ function toEntry(e) {
21
+ return {
22
+ id: e.id, groupId: e.groupId, name: e.name, description: e.description,
23
+ transport: e.transport,
24
+ serverUrl: e.serverUrl, command: e.command,
25
+ authConfig: e.authConfig, // encrypted string
26
+ enabled: e.enabled, createdAt: e.createdAt, updatedAt: e.updatedAt,
27
+ };
28
+ }
29
+ let TypeORMMCPRepo = class TypeORMMCPRepo {
30
+ repo;
31
+ constructor(repo) {
32
+ this.repo = repo;
33
+ }
34
+ async create(data) {
35
+ const entity = this.repo.create({
36
+ groupId: data.groupId, name: data.name, description: data.description ?? '',
37
+ transport: data.transport, serverUrl: data.serverUrl ?? null, command: data.command ?? null,
38
+ authConfig: data.authConfig,
39
+ });
40
+ return toEntry(await this.repo.save(entity));
41
+ }
42
+ async findAll() {
43
+ return (await this.repo.find({ order: { createdAt: 'ASC' } })).map(toEntry);
44
+ }
45
+ async findByGroup(groupId) {
46
+ return (await this.repo.find({ where: { groupId }, order: { name: 'ASC' } })).map(toEntry);
47
+ }
48
+ async findById(id) {
49
+ const e = await this.repo.findOneBy({ id });
50
+ return e ? toEntry(e) : null;
51
+ }
52
+ async findByName(name) {
53
+ const e = await this.repo.findOneBy({ name });
54
+ return e ? toEntry(e) : null;
55
+ }
56
+ async update(id, data) {
57
+ const updateData = {};
58
+ if (data.name !== undefined)
59
+ updateData.name = data.name;
60
+ if (data.description !== undefined)
61
+ updateData.description = data.description;
62
+ if (data.transport !== undefined)
63
+ updateData.transport = data.transport;
64
+ if (data.serverUrl !== undefined)
65
+ updateData.serverUrl = data.serverUrl;
66
+ if (data.command !== undefined)
67
+ updateData.command = data.command;
68
+ if (data.authConfig !== undefined)
69
+ updateData.authConfig = data.authConfig;
70
+ if (data.enabled !== undefined)
71
+ updateData.enabled = data.enabled;
72
+ await this.repo.update(id, updateData);
73
+ const updated = await this.repo.findOneBy({ id });
74
+ if (!updated)
75
+ throw Object.assign(new Error(`McpEntry not found: ${id}`), { code: 'NOT_FOUND' });
76
+ return toEntry(updated);
77
+ }
78
+ async delete(id) {
79
+ await this.repo.delete(id);
80
+ }
81
+ };
82
+ exports.TypeORMMCPRepo = TypeORMMCPRepo;
83
+ exports.TypeORMMCPRepo = TypeORMMCPRepo = __decorate([
84
+ (0, common_1.Injectable)(),
85
+ __param(0, (0, typeorm_1.InjectRepository)(mcp_entry_entity_1.McpEntryEntity)),
86
+ __metadata("design:paramtypes", [typeorm_2.Repository])
87
+ ], TypeORMMCPRepo);
88
+ //# sourceMappingURL=typeorm-mcp.repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-mcp.repo.js","sourceRoot":"","sources":["../../../src/storage/typeorm/typeorm-mcp.repo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,6CAAkD;AAClD,qCAAoC;AACpC,kEAA4D;AAG5D,SAAS,OAAO,CAAC,CAAiB;IAChC,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW;QACtE,SAAS,EAAE,CAAC,CAAC,SAA6B;QAC1C,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO;QAC1C,UAAU,EAAE,CAAC,CAAC,UAAsC,EAAE,mBAAmB;QACzE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS;KACnE,CAAA;AACH,CAAC;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc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C,OAAO;YAAE,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,uBAAuB,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAA;QAChG,OAAO,OAAO,CAAC,OAAO,CAAC,CAAA;IACzB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAC5B,CAAC;CACF,CAAA;AAjDY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,0BAAgB,EAAC,iCAAc,CAAC,CAAA;qCAAwB,oBAAU;GADpE,cAAc,CAiD1B"}
@@ -0,0 +1,15 @@
1
+ import { Repository } from 'typeorm';
2
+ import { OASEntryEntity } from './entities/oas-entry.entity';
3
+ import type { OASEntry, IOASRepo, CreateOASInput, UpdateOASInput } from '../interfaces/repos.interface';
4
+ export declare class TypeORMOASRepo implements IOASRepo {
5
+ private readonly repo;
6
+ constructor(repo: Repository<OASEntryEntity>);
7
+ create(data: CreateOASInput): Promise<OASEntry>;
8
+ findAll(): Promise<OASEntry[]>;
9
+ findByGroup(groupId: string): Promise<OASEntry[]>;
10
+ findById(id: string): Promise<OASEntry | null>;
11
+ findByName(name: string): Promise<OASEntry | null>;
12
+ update(id: string, data: UpdateOASInput): Promise<OASEntry>;
13
+ delete(id: string): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=typeorm-oas.repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-oas.repo.d.ts","sourceRoot":"","sources":["../../../src/storage/typeorm/typeorm-oas.repo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAwB,MAAM,+BAA+B,CAAA;AAa7H,qBACa,cAAe,YAAW,QAAQ;IACC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC;IAEzF,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAU/C,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAI9B,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAIjD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAK9C,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAKlD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiB3D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxC"}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.TypeORMOASRepo = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const typeorm_1 = require("@nestjs/typeorm");
18
+ const typeorm_2 = require("typeorm");
19
+ const oas_entry_entity_1 = require("./entities/oas-entry.entity");
20
+ function toEntry(e) {
21
+ return {
22
+ id: e.id, groupId: e.groupId, name: e.name, description: e.description,
23
+ remoteUrl: e.remoteUrl, baseEndpoint: e.baseEndpoint,
24
+ authType: e.authType,
25
+ authConfig: e.authConfig, // encrypted string
26
+ cacheTtl: e.cacheTtl, enabled: e.enabled,
27
+ createdAt: e.createdAt, updatedAt: e.updatedAt,
28
+ };
29
+ }
30
+ let TypeORMOASRepo = class TypeORMOASRepo {
31
+ repo;
32
+ constructor(repo) {
33
+ this.repo = repo;
34
+ }
35
+ async create(data) {
36
+ const entity = this.repo.create({
37
+ groupId: data.groupId, name: data.name, description: data.description ?? '',
38
+ remoteUrl: data.remoteUrl, baseEndpoint: data.baseEndpoint ?? null,
39
+ authType: data.authType, authConfig: data.authConfig,
40
+ cacheTtl: data.cacheTtl ?? 3600,
41
+ });
42
+ return toEntry(await this.repo.save(entity));
43
+ }
44
+ async findAll() {
45
+ return (await this.repo.find({ order: { createdAt: 'ASC' } })).map(toEntry);
46
+ }
47
+ async findByGroup(groupId) {
48
+ return (await this.repo.find({ where: { groupId }, order: { name: 'ASC' } })).map(toEntry);
49
+ }
50
+ async findById(id) {
51
+ const e = await this.repo.findOneBy({ id });
52
+ return e ? toEntry(e) : null;
53
+ }
54
+ async findByName(name) {
55
+ const e = await this.repo.findOneBy({ name });
56
+ return e ? toEntry(e) : null;
57
+ }
58
+ async update(id, data) {
59
+ const updateData = {};
60
+ if (data.name !== undefined)
61
+ updateData.name = data.name;
62
+ if (data.description !== undefined)
63
+ updateData.description = data.description;
64
+ if (data.remoteUrl !== undefined)
65
+ updateData.remoteUrl = data.remoteUrl;
66
+ if (data.baseEndpoint !== undefined)
67
+ updateData.baseEndpoint = data.baseEndpoint;
68
+ if (data.authType !== undefined)
69
+ updateData.authType = data.authType;
70
+ if (data.authConfig !== undefined)
71
+ updateData.authConfig = data.authConfig;
72
+ if (data.cacheTtl !== undefined)
73
+ updateData.cacheTtl = data.cacheTtl;
74
+ if (data.enabled !== undefined)
75
+ updateData.enabled = data.enabled;
76
+ await this.repo.update(id, updateData);
77
+ const updated = await this.repo.findOneBy({ id });
78
+ if (!updated)
79
+ throw Object.assign(new Error(`OASEntry not found: ${id}`), { code: 'NOT_FOUND' });
80
+ return toEntry(updated);
81
+ }
82
+ async delete(id) {
83
+ await this.repo.delete(id);
84
+ }
85
+ };
86
+ exports.TypeORMOASRepo = TypeORMOASRepo;
87
+ exports.TypeORMOASRepo = TypeORMOASRepo = __decorate([
88
+ (0, common_1.Injectable)(),
89
+ __param(0, (0, typeorm_1.InjectRepository)(oas_entry_entity_1.OASEntryEntity)),
90
+ __metadata("design:paramtypes", [typeorm_2.Repository])
91
+ ], TypeORMOASRepo);
92
+ //# sourceMappingURL=typeorm-oas.repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-oas.repo.js","sourceRoot":"","sources":["../../../src/storage/typeorm/typeorm-oas.repo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,6CAAkD;AAClD,qCAAoC;AACpC,kEAA4D;AAG5D,SAAS,OAAO,CAAC,CAAiB;IAChC,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW;QACtE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY;QACpD,QAAQ,EAAE,CAAC,CAAC,QAAoB;QAChC,UAAU,EAAE,CAAC,CAAC,UAAmC,EAAE,mBAAmB;QACtE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,CAA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,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAAE,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAEjE,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QACtC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QACjD,IAAI,CAAC,OAAO;YAAE,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,uBAAuB,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAA;QAChG,OAAO,OAAO,CAAC,OAAO,CAAC,CAAA;IACzB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAC5B,CAAC;CACF,CAAA;AAnDY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,0BAAgB,EAAC,iCAAc,CAAC,CAAA;qCAAwB,oBAAU;GADpE,cAAc,CAmD1B"}
@@ -0,0 +1,13 @@
1
+ import { Repository } from 'typeorm';
2
+ import { TokenEntity } from './entities/token.entity';
3
+ import type { Token, ITokenRepo, CreateTokenInput } from '../interfaces/repos.interface';
4
+ export declare class TypeORMTokenRepo implements ITokenRepo {
5
+ private readonly repo;
6
+ constructor(repo: Repository<TokenEntity>);
7
+ create(data: CreateTokenInput): Promise<Token>;
8
+ findById(id: string): Promise<Token | null>;
9
+ findByJti(jti: string): Promise<Token | null>;
10
+ findByGroup(groupId: string): Promise<Token[]>;
11
+ revoke(id: string, revokedAt: Date): Promise<void>;
12
+ }
13
+ //# sourceMappingURL=typeorm-token.repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-token.repo.d.ts","sourceRoot":"","sources":["../../../src/storage/typeorm/typeorm-token.repo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAMxF,qBACa,gBAAiB,YAAW,UAAU;IACN,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC;IAEnF,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC;IAQ9C,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAK3C,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAK7C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAI9C,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzD"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.TypeORMTokenRepo = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const typeorm_1 = require("@nestjs/typeorm");
18
+ const typeorm_2 = require("typeorm");
19
+ const token_entity_1 = require("./entities/token.entity");
20
+ function toToken(e) {
21
+ return { id: e.id, groupId: e.groupId, name: e.name, jti: e.jti, scopes: e.scopes, expiresAt: e.expiresAt, revokedAt: e.revokedAt, createdAt: e.createdAt };
22
+ }
23
+ let TypeORMTokenRepo = class TypeORMTokenRepo {
24
+ repo;
25
+ constructor(repo) {
26
+ this.repo = repo;
27
+ }
28
+ async create(data) {
29
+ const entity = this.repo.create({
30
+ groupId: data.groupId, name: data.name, jti: data.jti,
31
+ scopes: data.scopes, expiresAt: data.expiresAt,
32
+ });
33
+ return toToken(await this.repo.save(entity));
34
+ }
35
+ async findById(id) {
36
+ const e = await this.repo.findOneBy({ id });
37
+ return e ? toToken(e) : null;
38
+ }
39
+ async findByJti(jti) {
40
+ const e = await this.repo.findOneBy({ jti });
41
+ return e ? toToken(e) : null;
42
+ }
43
+ async findByGroup(groupId) {
44
+ return (await this.repo.find({ where: { groupId }, order: { createdAt: 'DESC' } })).map(toToken);
45
+ }
46
+ async revoke(id, revokedAt) {
47
+ await this.repo.update(id, { revokedAt });
48
+ }
49
+ };
50
+ exports.TypeORMTokenRepo = TypeORMTokenRepo;
51
+ exports.TypeORMTokenRepo = TypeORMTokenRepo = __decorate([
52
+ (0, common_1.Injectable)(),
53
+ __param(0, (0, typeorm_1.InjectRepository)(token_entity_1.TokenEntity)),
54
+ __metadata("design:paramtypes", [typeorm_2.Repository])
55
+ ], TypeORMTokenRepo);
56
+ //# sourceMappingURL=typeorm-token.repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-token.repo.js","sourceRoot":"","sources":["../../../src/storage/typeorm/typeorm-token.repo.ts"],"names":[],"mappings":";;;;;;;;;;;;;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,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;QAC5C,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC9B,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAe;QAC/B,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAClG,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,SAAe;QACtC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA;AA5BY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,0BAAgB,EAAC,0BAAW,CAAC,CAAA;qCAAwB,oBAAU;GADjE,gBAAgB,CA4B5B"}
@@ -0,0 +1,6 @@
1
+ export declare class IssueTokenDto {
2
+ name: string;
3
+ scopes?: string[];
4
+ ttlSec?: number;
5
+ }
6
+ //# sourceMappingURL=issue-token.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issue-token.dto.d.ts","sourceRoot":"","sources":["../../../src/tokens/dto/issue-token.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,aAAa;IAIxB,IAAI,EAAG,MAAM,CAAA;IAMb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IAMjB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.IssueTokenDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ class IssueTokenDto {
16
+ name;
17
+ scopes;
18
+ ttlSec;
19
+ }
20
+ exports.IssueTokenDto = IssueTokenDto;
21
+ __decorate([
22
+ (0, swagger_1.ApiProperty)({ example: 'agent-prod', description: 'Human-readable token label' }),
23
+ (0, class_validator_1.IsString)(),
24
+ (0, class_validator_1.Length)(1, 200),
25
+ __metadata("design:type", String)
26
+ ], IssueTokenDto.prototype, "name", void 0);
27
+ __decorate([
28
+ (0, swagger_1.ApiPropertyOptional)({ example: ['read', 'write'], description: 'Token scopes (optional)', type: [String] }),
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.IsArray)(),
31
+ (0, class_validator_1.IsString)({ each: true }),
32
+ __metadata("design:type", Array)
33
+ ], IssueTokenDto.prototype, "scopes", void 0);
34
+ __decorate([
35
+ (0, swagger_1.ApiPropertyOptional)({ example: 86400, description: 'Token TTL in seconds (0 or omit = no expiry)' }),
36
+ (0, class_validator_1.IsOptional)(),
37
+ (0, class_validator_1.IsInt)(),
38
+ (0, class_validator_1.Min)(0),
39
+ __metadata("design:type", Number)
40
+ ], IssueTokenDto.prototype, "ttlSec", void 0);
41
+ //# sourceMappingURL=issue-token.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issue-token.dto.js","sourceRoot":"","sources":["../../../src/tokens/dto/issue-token.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmF;AACnF,6CAAkE;AAElE,MAAa,aAAa;IAIxB,IAAI,CAAS;IAMb,MAAM,CAAW;IAMjB,MAAM,CAAS;CAChB;AAjBD,sCAiBC;AAbC;IAHC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;IACjF,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAM,EAAC,CAAC,EAAE,GAAG,CAAC;;2CACF;AAMb;IAJC,IAAA,6BAAmB,EAAC,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;IAC3G,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;6CACR;AAMjB;IAJC,IAAA,6BAAmB,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;IACpG,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;6CACQ"}