@kosha-ai/server 0.0.6 → 1.0.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 (210) hide show
  1. package/dist/auth/api-key.guard.d.ts +7 -2
  2. package/dist/auth/api-key.guard.d.ts.map +1 -1
  3. package/dist/auth/api-key.guard.js +28 -8
  4. package/dist/auth/auth.factory.d.ts +15 -1
  5. package/dist/auth/auth.factory.d.ts.map +1 -1
  6. package/dist/auth/auth.factory.js +48 -2
  7. package/dist/bootstrap.d.ts.map +1 -1
  8. package/dist/bootstrap.js +24 -6
  9. package/dist/config/kosha-config.d.ts +21 -0
  10. package/dist/config/kosha-config.d.ts.map +1 -1
  11. package/dist/config/kosha-config.js +31 -2
  12. package/dist/configurations/configurations.controller.d.ts +11 -136
  13. package/dist/configurations/configurations.controller.d.ts.map +1 -1
  14. package/dist/configurations/configurations.controller.js +58 -25
  15. package/dist/configurations/configurations.module.d.ts.map +1 -1
  16. package/dist/configurations/configurations.module.js +4 -1
  17. package/dist/configurations/configurations.repository.d.ts +43 -0
  18. package/dist/configurations/configurations.repository.d.ts.map +1 -0
  19. package/dist/configurations/configurations.repository.js +76 -0
  20. package/dist/configurations/configurations.service.d.ts +38 -194
  21. package/dist/configurations/configurations.service.d.ts.map +1 -1
  22. package/dist/configurations/configurations.service.js +118 -110
  23. package/dist/configurations/dto/create-configuration.dto.d.ts +8 -0
  24. package/dist/configurations/dto/create-configuration.dto.d.ts.map +1 -0
  25. package/dist/configurations/dto/create-configuration.dto.js +54 -0
  26. package/dist/configurations/dto/update-configuration.dto.d.ts +7 -0
  27. package/dist/configurations/dto/update-configuration.dto.d.ts.map +1 -0
  28. package/dist/configurations/dto/update-configuration.dto.js +39 -0
  29. package/dist/connect/connect.controller.d.ts +6 -8
  30. package/dist/connect/connect.controller.d.ts.map +1 -1
  31. package/dist/connect/connect.controller.js +45 -15
  32. package/dist/connect/connect.module.d.ts.map +1 -1
  33. package/dist/connect/connect.module.js +4 -2
  34. package/dist/connect/connect.repository.d.ts +78 -0
  35. package/dist/connect/connect.repository.d.ts.map +1 -0
  36. package/dist/connect/connect.repository.js +146 -0
  37. package/dist/connect/connect.service.d.ts +28 -19
  38. package/dist/connect/connect.service.d.ts.map +1 -1
  39. package/dist/connect/connect.service.js +149 -163
  40. package/dist/connect/dto/create-connect-session.dto.d.ts +8 -0
  41. package/dist/connect/dto/create-connect-session.dto.d.ts.map +1 -0
  42. package/dist/connect/dto/create-connect-session.dto.js +55 -0
  43. package/dist/connect/dto/create-test-session.dto.d.ts +10 -0
  44. package/dist/connect/dto/create-test-session.dto.d.ts.map +1 -0
  45. package/dist/connect/dto/create-test-session.dto.js +34 -0
  46. package/dist/connections/connections.controller.d.ts +8 -61
  47. package/dist/connections/connections.controller.d.ts.map +1 -1
  48. package/dist/connections/connections.controller.js +31 -9
  49. package/dist/connections/connections.module.d.ts.map +1 -1
  50. package/dist/connections/connections.module.js +4 -1
  51. package/dist/connections/connections.repository.d.ts +24 -0
  52. package/dist/connections/connections.repository.d.ts.map +1 -0
  53. package/dist/connections/connections.repository.js +66 -0
  54. package/dist/connections/connections.service.d.ts +24 -69
  55. package/dist/connections/connections.service.d.ts.map +1 -1
  56. package/dist/connections/connections.service.js +59 -56
  57. package/dist/connections/dto/list-connections.dto.d.ts +5 -0
  58. package/dist/connections/dto/list-connections.dto.d.ts.map +1 -0
  59. package/dist/connections/dto/list-connections.dto.js +25 -0
  60. package/dist/connections/environment-connections.controller.d.ts +26 -0
  61. package/dist/connections/environment-connections.controller.d.ts.map +1 -0
  62. package/dist/connections/environment-connections.controller.js +81 -0
  63. package/dist/connections/environment-connections.module.d.ts +11 -0
  64. package/dist/connections/environment-connections.module.d.ts.map +1 -0
  65. package/dist/connections/environment-connections.module.js +21 -0
  66. package/dist/credentials/credentials.module.d.ts +3 -0
  67. package/dist/credentials/credentials.module.d.ts.map +1 -0
  68. package/dist/credentials/credentials.module.js +15 -0
  69. package/dist/credentials/credentials.repository.d.ts +8 -0
  70. package/dist/credentials/credentials.repository.d.ts.map +1 -0
  71. package/dist/credentials/credentials.repository.js +21 -0
  72. package/dist/credentials/credentials.service.d.ts +45 -0
  73. package/dist/credentials/credentials.service.d.ts.map +1 -0
  74. package/dist/credentials/credentials.service.js +135 -0
  75. package/dist/crypto/credential-envelope.d.ts +56 -0
  76. package/dist/crypto/credential-envelope.d.ts.map +1 -0
  77. package/dist/crypto/credential-envelope.js +70 -0
  78. package/dist/crypto/crypto.service.d.ts +8 -0
  79. package/dist/crypto/crypto.service.d.ts.map +1 -1
  80. package/dist/crypto/crypto.service.js +12 -0
  81. package/dist/egress/ca.service.d.ts +36 -0
  82. package/dist/egress/ca.service.d.ts.map +1 -0
  83. package/dist/egress/ca.service.js +117 -0
  84. package/dist/egress/dto/mint-grant.dto.d.ts +7 -0
  85. package/dist/egress/dto/mint-grant.dto.d.ts.map +1 -0
  86. package/dist/egress/dto/mint-grant.dto.js +44 -0
  87. package/dist/egress/egress.controller.d.ts +18 -0
  88. package/dist/egress/egress.controller.d.ts.map +1 -0
  89. package/dist/egress/egress.controller.js +80 -0
  90. package/dist/egress/egress.listener.d.ts +39 -0
  91. package/dist/egress/egress.listener.d.ts.map +1 -0
  92. package/dist/egress/egress.listener.js +328 -0
  93. package/dist/egress/egress.module.d.ts +7 -0
  94. package/dist/egress/egress.module.d.ts.map +1 -0
  95. package/dist/egress/egress.module.js +31 -0
  96. package/dist/egress/egress.repository.d.ts +58 -0
  97. package/dist/egress/egress.repository.d.ts.map +1 -0
  98. package/dist/egress/egress.repository.js +116 -0
  99. package/dist/egress/grants.service.d.ts +77 -0
  100. package/dist/egress/grants.service.d.ts.map +1 -0
  101. package/dist/egress/grants.service.js +159 -0
  102. package/dist/egress/host-rules.service.d.ts +35 -0
  103. package/dist/egress/host-rules.service.d.ts.map +1 -0
  104. package/dist/egress/host-rules.service.js +48 -0
  105. package/dist/environments/dto/create-environment.dto.d.ts +6 -0
  106. package/dist/environments/dto/create-environment.dto.d.ts.map +1 -0
  107. package/dist/environments/dto/create-environment.dto.js +34 -0
  108. package/dist/environments/dto/update-environment.dto.d.ts +5 -0
  109. package/dist/environments/dto/update-environment.dto.d.ts.map +1 -0
  110. package/dist/environments/dto/update-environment.dto.js +24 -0
  111. package/dist/environments/environments.controller.d.ts +53 -0
  112. package/dist/environments/environments.controller.d.ts.map +1 -0
  113. package/dist/environments/environments.controller.js +101 -0
  114. package/dist/environments/environments.module.d.ts +3 -0
  115. package/dist/environments/environments.module.d.ts.map +1 -0
  116. package/dist/environments/environments.module.js +15 -0
  117. package/dist/environments/environments.repository.d.ts +37 -0
  118. package/dist/environments/environments.repository.d.ts.map +1 -0
  119. package/dist/environments/environments.repository.js +82 -0
  120. package/dist/environments/environments.service.d.ts +43 -0
  121. package/dist/environments/environments.service.d.ts.map +1 -0
  122. package/dist/environments/environments.service.js +124 -0
  123. package/dist/generated/prisma/browser.d.ts +17 -35
  124. package/dist/generated/prisma/browser.d.ts.map +1 -1
  125. package/dist/generated/prisma/client.d.ts +17 -35
  126. package/dist/generated/prisma/client.d.ts.map +1 -1
  127. package/dist/generated/prisma/commonInputTypes.d.ts +104 -145
  128. package/dist/generated/prisma/commonInputTypes.d.ts.map +1 -1
  129. package/dist/generated/prisma/enums.d.ts +1 -21
  130. package/dist/generated/prisma/enums.d.ts.map +1 -1
  131. package/dist/generated/prisma/enums.js +1 -18
  132. package/dist/generated/prisma/internal/class.d.ts +24 -46
  133. package/dist/generated/prisma/internal/class.d.ts.map +1 -1
  134. package/dist/generated/prisma/internal/class.js +4 -4
  135. package/dist/generated/prisma/internal/prismaNamespace.d.ts +258 -472
  136. package/dist/generated/prisma/internal/prismaNamespace.d.ts.map +1 -1
  137. package/dist/generated/prisma/internal/prismaNamespace.js +45 -83
  138. package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +45 -85
  139. package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts.map +1 -1
  140. package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +45 -83
  141. package/dist/generated/prisma/models/Account.d.ts +344 -26
  142. package/dist/generated/prisma/models/Account.d.ts.map +1 -1
  143. package/dist/generated/prisma/models/Configuration.d.ts +218 -851
  144. package/dist/generated/prisma/models/Configuration.d.ts.map +1 -1
  145. package/dist/generated/prisma/models/EgressGrant.d.ts +1535 -0
  146. package/dist/generated/prisma/models/EgressGrant.d.ts.map +1 -0
  147. package/dist/generated/prisma/models/Environment.d.ts +1644 -0
  148. package/dist/generated/prisma/models/Environment.d.ts.map +1 -0
  149. package/dist/generated/prisma/models/Invitation.d.ts +42 -1
  150. package/dist/generated/prisma/models/Invitation.d.ts.map +1 -1
  151. package/dist/generated/prisma/models/Organization.d.ts +183 -322
  152. package/dist/generated/prisma/models/Organization.d.ts.map +1 -1
  153. package/dist/generated/prisma/models/Session.d.ts +36 -1
  154. package/dist/generated/prisma/models/Session.d.ts.map +1 -1
  155. package/dist/generated/prisma/models/Team.d.ts +1498 -0
  156. package/dist/generated/prisma/models/Team.d.ts.map +1 -0
  157. package/dist/generated/prisma/models/TeamMember.d.ts +1281 -0
  158. package/dist/generated/prisma/models/TeamMember.d.ts.map +1 -0
  159. package/dist/generated/prisma/models/User.d.ts +338 -2
  160. package/dist/generated/prisma/models/User.d.ts.map +1 -1
  161. package/dist/generated/prisma/models.d.ts +4 -6
  162. package/dist/generated/prisma/models.d.ts.map +1 -1
  163. package/dist/index.d.ts +20 -5
  164. package/dist/index.d.ts.map +1 -1
  165. package/dist/index.js +17 -3
  166. package/dist/integrations/integrations.controller.d.ts +2 -1
  167. package/dist/integrations/integrations.controller.d.ts.map +1 -1
  168. package/dist/integrations/integrations.module.d.ts.map +1 -1
  169. package/dist/integrations/integrations.module.js +0 -2
  170. package/dist/kosha.module.d.ts.map +1 -1
  171. package/dist/kosha.module.js +13 -3
  172. package/dist/proxy/proxy.controller.d.ts +8 -3
  173. package/dist/proxy/proxy.controller.d.ts.map +1 -1
  174. package/dist/proxy/proxy.controller.js +26 -10
  175. package/dist/proxy/proxy.module.d.ts.map +1 -1
  176. package/dist/proxy/proxy.module.js +5 -3
  177. package/dist/proxy/proxy.repository.d.ts +24 -0
  178. package/dist/proxy/proxy.repository.d.ts.map +1 -0
  179. package/dist/proxy/proxy.repository.js +47 -0
  180. package/dist/proxy/proxy.service.d.ts +17 -21
  181. package/dist/proxy/proxy.service.d.ts.map +1 -1
  182. package/dist/proxy/proxy.service.js +61 -110
  183. package/package.json +9 -4
  184. package/prisma/migrations/20260929101936_init/migration.sql +345 -0
  185. package/prisma/migrations/20260930102529_connection_config/migration.sql +2 -0
  186. package/prisma/schema.prisma +103 -178
  187. package/dist/generated/prisma/models/ConnectSession.d.ts +0 -1606
  188. package/dist/generated/prisma/models/ConnectSession.d.ts.map +0 -1
  189. package/dist/generated/prisma/models/Connection.d.ts +0 -1949
  190. package/dist/generated/prisma/models/Connection.d.ts.map +0 -1
  191. package/dist/generated/prisma/models/ConnectionCredential.d.ts +0 -1293
  192. package/dist/generated/prisma/models/ConnectionCredential.d.ts.map +0 -1
  193. package/dist/generated/prisma/models/EndUser.d.ts +0 -1539
  194. package/dist/generated/prisma/models/EndUser.d.ts.map +0 -1
  195. package/dist/generated/prisma/models/OAuthState.d.ts +0 -1404
  196. package/dist/generated/prisma/models/OAuthState.d.ts.map +0 -1
  197. package/dist/generated/prisma/models/OAuthState.js +0 -1
  198. package/dist/generated/prisma/models/Provider.d.ts +0 -1462
  199. package/dist/generated/prisma/models/Provider.d.ts.map +0 -1
  200. package/dist/generated/prisma/models/Provider.js +0 -1
  201. package/dist/integrations/provider-sync.service.d.ts +0 -24
  202. package/dist/integrations/provider-sync.service.d.ts.map +0 -1
  203. package/dist/integrations/provider-sync.service.js +0 -74
  204. package/prisma/migrations/20260908000000_init/migration.sql +0 -209
  205. package/prisma/migrations/20260908161813_add_connect_domain/migration.sql +0 -173
  206. package/prisma/migrations/20260916000000_add_configuration_slug/migration.sql +0 -15
  207. /package/dist/generated/prisma/models/{ConnectSession.js → EgressGrant.js} +0 -0
  208. /package/dist/generated/prisma/models/{Connection.js → Environment.js} +0 -0
  209. /package/dist/generated/prisma/models/{ConnectionCredential.js → Team.js} +0 -0
  210. /package/dist/generated/prisma/models/{EndUser.js → TeamMember.js} +0 -0
@@ -1,76 +1,109 @@
1
1
  import { __decorate, __metadata, __param } from "tslib";
2
- import { Body, Controller, Delete, Get, Param, Patch, Post, } from '@nestjs/common';
2
+ import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post, } from '@nestjs/common';
3
+ import { ApiConflictResponse, ApiCreatedResponse, ApiNotFoundResponse, ApiOkResponse, ApiOperation, ApiTags, } from '@nestjs/swagger';
3
4
  import { Session } from '@thallesp/nestjs-better-auth';
4
5
  import { getActiveOrganizationId } from '../common/active-organization.js';
5
- import { ConfigurationsService, } from './configurations.service.js';
6
+ import { ConfigurationsService } from './configurations.service.js';
7
+ import { CreateConfigurationDto } from './dto/create-configuration.dto.js';
8
+ import { UpdateConfigurationDto } from './dto/update-configuration.dto.js';
6
9
  /**
7
- * Admin-facing. Session authenticated and scoped to the caller's active
8
- * organization — never accepts an organizationId from the request.
10
+ * Admin-facing, and nested under the environment a configuration belongs to.
11
+ * Session authenticated: the organization comes from the session, never from
12
+ * the request, and the environment is checked against it.
9
13
  */
10
14
  let ConfigurationsController = class ConfigurationsController {
11
15
  configurations;
12
16
  constructor(configurations) {
13
17
  this.configurations = configurations;
14
18
  }
15
- list(session) {
16
- return this.configurations.list(getActiveOrganizationId(session));
19
+ list(session, environmentId) {
20
+ return this.configurations.list(getActiveOrganizationId(session), session.user.id, environmentId);
17
21
  }
18
- get(session, id) {
19
- return this.configurations.get(getActiveOrganizationId(session), id);
22
+ get(session, environmentId, id) {
23
+ return this.configurations.get(getActiveOrganizationId(session), session.user.id, environmentId, id);
20
24
  }
21
- create(session, body) {
22
- return this.configurations.create(getActiveOrganizationId(session), body);
25
+ create(session, environmentId, body) {
26
+ return this.configurations.create(getActiveOrganizationId(session), session.user.id, environmentId, body);
23
27
  }
24
- update(session, id, body) {
25
- return this.configurations.update(getActiveOrganizationId(session), id, body);
28
+ update(session, environmentId, id, body) {
29
+ return this.configurations.update(getActiveOrganizationId(session), session.user.id, environmentId, id, body);
26
30
  }
27
- async remove(session, id) {
28
- await this.configurations.remove(getActiveOrganizationId(session), id);
31
+ async remove(session, environmentId, id) {
32
+ await this.configurations.remove(getActiveOrganizationId(session), session.user.id, environmentId, id);
29
33
  return { id, deleted: true };
30
34
  }
31
35
  };
32
36
  __decorate([
33
37
  Get(),
38
+ ApiOperation({ summary: 'List the configurations in one environment' }),
39
+ ApiOkResponse({ description: 'Configurations, newest first.' }),
34
40
  __param(0, Session()),
41
+ __param(1, Param('environmentId')),
35
42
  __metadata("design:type", Function),
36
- __metadata("design:paramtypes", [Object]),
43
+ __metadata("design:paramtypes", [Object, String]),
37
44
  __metadata("design:returntype", void 0)
38
45
  ], ConfigurationsController.prototype, "list", null);
39
46
  __decorate([
40
47
  Get(':id'),
48
+ ApiOperation({ summary: 'Get one configuration' }),
49
+ ApiNotFoundResponse({ description: 'No such configuration here.' }),
41
50
  __param(0, Session()),
42
- __param(1, Param('id')),
51
+ __param(1, Param('environmentId')),
52
+ __param(2, Param('id')),
43
53
  __metadata("design:type", Function),
44
- __metadata("design:paramtypes", [Object, String]),
54
+ __metadata("design:paramtypes", [Object, String, String]),
45
55
  __metadata("design:returntype", void 0)
46
56
  ], ConfigurationsController.prototype, "get", null);
47
57
  __decorate([
48
58
  Post(),
59
+ HttpCode(HttpStatus.CREATED),
60
+ ApiOperation({
61
+ summary: 'Set up a provider in this environment',
62
+ description: 'The integration key names an installed package; the auth type comes from it rather than from the request.',
63
+ }),
64
+ ApiCreatedResponse({ description: 'The created configuration.' }),
65
+ ApiConflictResponse({
66
+ description: 'That slug is taken in this environment.',
67
+ }),
49
68
  __param(0, Session()),
50
- __param(1, Body()),
69
+ __param(1, Param('environmentId')),
70
+ __param(2, Body()),
51
71
  __metadata("design:type", Function),
52
- __metadata("design:paramtypes", [Object, Object]),
72
+ __metadata("design:paramtypes", [Object, String, CreateConfigurationDto]),
53
73
  __metadata("design:returntype", void 0)
54
74
  ], ConfigurationsController.prototype, "create", null);
55
75
  __decorate([
56
76
  Patch(':id'),
77
+ ApiOperation({ summary: 'Update a configuration' }),
78
+ ApiOkResponse({ description: 'The updated configuration.' }),
57
79
  __param(0, Session()),
58
- __param(1, Param('id')),
59
- __param(2, Body()),
80
+ __param(1, Param('environmentId')),
81
+ __param(2, Param('id')),
82
+ __param(3, Body()),
60
83
  __metadata("design:type", Function),
61
- __metadata("design:paramtypes", [Object, String, Object]),
84
+ __metadata("design:paramtypes", [Object, String, String, UpdateConfigurationDto]),
62
85
  __metadata("design:returntype", void 0)
63
86
  ], ConfigurationsController.prototype, "update", null);
64
87
  __decorate([
65
88
  Delete(':id'),
89
+ ApiOperation({
90
+ summary: 'Delete a configuration',
91
+ description: 'Refused while connections still use it, since nothing in the database would stop those credentials being orphaned.',
92
+ }),
93
+ ApiOkResponse({ description: 'The deleted configuration id.' }),
94
+ ApiConflictResponse({
95
+ description: 'Connections still use this configuration.',
96
+ }),
66
97
  __param(0, Session()),
67
- __param(1, Param('id')),
98
+ __param(1, Param('environmentId')),
99
+ __param(2, Param('id')),
68
100
  __metadata("design:type", Function),
69
- __metadata("design:paramtypes", [Object, String]),
101
+ __metadata("design:paramtypes", [Object, String, String]),
70
102
  __metadata("design:returntype", Promise)
71
103
  ], ConfigurationsController.prototype, "remove", null);
72
104
  ConfigurationsController = __decorate([
73
- Controller('configurations'),
105
+ ApiTags('configurations'),
106
+ Controller('environments/:environmentId/configurations'),
74
107
  __metadata("design:paramtypes", [ConfigurationsService])
75
108
  ], ConfigurationsController);
76
109
  export { ConfigurationsController };
@@ -1 +1 @@
1
- {"version":3,"file":"configurations.module.d.ts","sourceRoot":"","sources":["../../src/configurations/configurations.module.ts"],"names":[],"mappings":"AAIA,qBAKa,oBAAoB;CAAG"}
1
+ {"version":3,"file":"configurations.module.d.ts","sourceRoot":"","sources":["../../src/configurations/configurations.module.ts"],"names":[],"mappings":"AAMA,qBAMa,oBAAoB;CAAG"}
@@ -1,13 +1,16 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { Module } from '@nestjs/common';
3
+ import { EnvironmentsModule } from '../environments/environments.module.js';
3
4
  import { ConfigurationsController } from './configurations.controller.js';
5
+ import { ConfigurationsRepository } from './configurations.repository.js';
4
6
  import { ConfigurationsService } from './configurations.service.js';
5
7
  let ConfigurationsModule = class ConfigurationsModule {
6
8
  };
7
9
  ConfigurationsModule = __decorate([
8
10
  Module({
11
+ imports: [EnvironmentsModule],
9
12
  controllers: [ConfigurationsController],
10
- providers: [ConfigurationsService],
13
+ providers: [ConfigurationsService, ConfigurationsRepository],
11
14
  exports: [ConfigurationsService],
12
15
  })
13
16
  ], ConfigurationsModule);
@@ -0,0 +1,43 @@
1
+ import type { Configuration, Prisma } from '../generated/prisma/client.js';
2
+ import { PrismaService } from '../prisma/prisma.service.js';
3
+ export interface ConfigurationRow {
4
+ environmentId: string;
5
+ integrationKey: string;
6
+ authType: string;
7
+ name: string;
8
+ slug: string;
9
+ credentials: string | null;
10
+ settings: Prisma.InputJsonValue | undefined;
11
+ }
12
+ /** A configuration as a client may see it: everything but the secrets. */
13
+ export type PublicConfiguration = Omit<Configuration, 'credentials'>;
14
+ export interface ConfigurationChanges {
15
+ name?: string;
16
+ /** Null clears the stored secrets; undefined leaves them alone. */
17
+ credentials?: string | null;
18
+ settings?: Prisma.InputJsonValue;
19
+ isEnabled?: boolean;
20
+ }
21
+ export declare class ConfigurationsRepository {
22
+ private readonly prisma;
23
+ constructor(prisma: PrismaService);
24
+ findManyByEnvironment(environmentId: string): Promise<PublicConfiguration[]>;
25
+ findById(environmentId: string, id: string): Promise<PublicConfiguration | null>;
26
+ /** How a caller's slug becomes the row the proxy and connect flows use. */
27
+ findBySlug(environmentId: string, slug: string): Promise<PublicConfiguration | null>;
28
+ /**
29
+ * The one read that keeps the secrets, for the connect and proxy paths.
30
+ * Never reachable from a controller.
31
+ */
32
+ findAnyById(id: string): Promise<Configuration | null>;
33
+ create(row: ConfigurationRow): Promise<PublicConfiguration>;
34
+ update(id: string, changes: ConfigurationChanges): Promise<PublicConfiguration>;
35
+ delete(id: string): Promise<void>;
36
+ /**
37
+ * Credentials pointing at this configuration. `account.providerId` holds the
38
+ * id as a plain string, so this count is what stands in for the foreign key
39
+ * the design gave up.
40
+ */
41
+ countCredentials(configurationId: string): Promise<number>;
42
+ }
43
+ //# sourceMappingURL=configurations.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurations.repository.d.ts","sourceRoot":"","sources":["../../src/configurations/configurations.repository.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC,cAAc,GAAG,SAAS,CAAC;CAC7C;AAED,0EAA0E;AAC1E,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAErE,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAWD,qBACa,wBAAwB;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAElD,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAQ5E,QAAQ,CACN,aAAa,EAAE,MAAM,EACrB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAOtC,2EAA2E;IAC3E,UAAU,CACR,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAOtC;;;OAGG;IACH,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAItD,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO3D,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC;IAQzB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC;;;;OAIG;IACH,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAK3D"}
@@ -0,0 +1,76 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { Injectable } from '@nestjs/common';
3
+ import { PrismaService } from '../prisma/prisma.service.js';
4
+ /**
5
+ * `credentials` is ciphertext by the time it reaches here, and stays ciphertext
6
+ * on the way out. Nothing in this file can read a secret.
7
+ *
8
+ * Every read that can reach a client leaves the column out entirely. Ciphertext
9
+ * is not plaintext, but there is no reason for a browser to hold it, and the
10
+ * one path that needs the secrets asks for them by name.
11
+ */
12
+ const WITHOUT_SECRETS = { credentials: true };
13
+ let ConfigurationsRepository = class ConfigurationsRepository {
14
+ prisma;
15
+ constructor(prisma) {
16
+ this.prisma = prisma;
17
+ }
18
+ findManyByEnvironment(environmentId) {
19
+ return this.prisma.configuration.findMany({
20
+ where: { environmentId },
21
+ omit: WITHOUT_SECRETS,
22
+ orderBy: { createdAt: 'desc' },
23
+ });
24
+ }
25
+ findById(environmentId, id) {
26
+ return this.prisma.configuration.findFirst({
27
+ where: { id, environmentId },
28
+ omit: WITHOUT_SECRETS,
29
+ });
30
+ }
31
+ /** How a caller's slug becomes the row the proxy and connect flows use. */
32
+ findBySlug(environmentId, slug) {
33
+ return this.prisma.configuration.findFirst({
34
+ where: { environmentId, slug },
35
+ omit: WITHOUT_SECRETS,
36
+ });
37
+ }
38
+ /**
39
+ * The one read that keeps the secrets, for the connect and proxy paths.
40
+ * Never reachable from a controller.
41
+ */
42
+ findAnyById(id) {
43
+ return this.prisma.configuration.findUnique({ where: { id } });
44
+ }
45
+ create(row) {
46
+ return this.prisma.configuration.create({
47
+ data: row,
48
+ omit: WITHOUT_SECRETS,
49
+ });
50
+ }
51
+ update(id, changes) {
52
+ return this.prisma.configuration.update({
53
+ where: { id },
54
+ data: changes,
55
+ omit: WITHOUT_SECRETS,
56
+ });
57
+ }
58
+ async delete(id) {
59
+ await this.prisma.configuration.delete({ where: { id } });
60
+ }
61
+ /**
62
+ * Credentials pointing at this configuration. `account.providerId` holds the
63
+ * id as a plain string, so this count is what stands in for the foreign key
64
+ * the design gave up.
65
+ */
66
+ countCredentials(configurationId) {
67
+ return this.prisma.account.count({
68
+ where: { providerId: configurationId },
69
+ });
70
+ }
71
+ };
72
+ ConfigurationsRepository = __decorate([
73
+ Injectable(),
74
+ __metadata("design:paramtypes", [PrismaService])
75
+ ], ConfigurationsRepository);
76
+ export { ConfigurationsRepository };
@@ -1,216 +1,60 @@
1
1
  import type { ResolvedKoshaConfig } from '../config/kosha-config.js';
2
2
  import { CryptoService } from '../crypto/crypto.service.js';
3
- import type { Prisma } from '../generated/prisma/client.js';
3
+ import { EnvironmentsService } from '../environments/environments.service.js';
4
+ import type { Configuration } from '../generated/prisma/client.js';
4
5
  import { IntegrationRegistry } from '../integrations/integration.registry.js';
5
- import { PrismaService } from '../prisma/prisma.service.js';
6
- export interface CreateConfigurationInput {
7
- /** Provider key, e.g. "github". */
8
- provider: string;
9
- name: string;
10
- slug?: string;
11
- clientId: string;
12
- clientSecret: string;
13
- scopes?: string[];
14
- environment?: 'SANDBOX' | 'LIVE';
15
- settings?: Record<string, unknown>;
16
- }
17
- export interface UpdateConfigurationInput {
18
- name?: string;
19
- scopes?: string[];
20
- clientId?: string;
21
- clientSecret?: string;
22
- isEnabled?: boolean;
23
- settings?: Record<string, unknown>;
6
+ import { ConfigurationsRepository } from './configurations.repository.js';
7
+ import type { CreateConfigurationDto } from './dto/create-configuration.dto.js';
8
+ import type { UpdateConfigurationDto } from './dto/update-configuration.dto.js';
9
+ /** A configuration with its secrets opened. Never leaves the server. */
10
+ export interface ConfigurationWithCredentials {
11
+ configuration: Configuration;
12
+ credentials: Record<string, unknown>;
24
13
  }
25
14
  export declare class ConfigurationsService {
26
- private readonly prisma;
15
+ private readonly configurations;
16
+ private readonly environments;
27
17
  private readonly crypto;
28
18
  private readonly registry;
29
19
  private readonly config;
30
- constructor(prisma: PrismaService, crypto: CryptoService, registry: IntegrationRegistry, config: ResolvedKoshaConfig);
20
+ constructor(configurations: ConfigurationsRepository, environments: EnvironmentsService, crypto: CryptoService, registry: IntegrationRegistry, config: ResolvedKoshaConfig);
31
21
  /**
32
22
  * The redirect URI the provider must be told about. Derived from
33
23
  * `server.publicUrl` so it is stable and inspectable in the admin, rather
34
24
  * than being reconstructed per request.
35
25
  */
36
- callbackUrlFor(providerKey: string): string;
37
- list(organizationId: string): Prisma.PrismaPromise<({
38
- provider: {
39
- name: string;
40
- key: string;
41
- id: string;
42
- createdAt: Date;
43
- updatedAt: Date;
44
- authType: import("../generated/prisma/enums.js").AuthType;
45
- authorizationUrl: string | null;
46
- tokenUrl: string | null;
47
- revokeUrl: string | null;
48
- apiBaseUrl: string | null;
49
- scopesAvailable: string[];
50
- docsUrl: string | null;
51
- logoUrl: string | null;
52
- isActive: boolean;
53
- };
54
- } & {
55
- name: string;
56
- id: string;
57
- createdAt: Date;
58
- updatedAt: Date;
59
- metadata: import("@prisma/client/runtime/client").JsonValue | null;
60
- scopes: string[];
61
- slug: string;
62
- organizationId: string;
63
- providerId: string;
64
- environment: import("../generated/prisma/enums.js").ConnectionEnvironment;
65
- authType: import("../generated/prisma/enums.js").AuthType;
66
- clientId: string | null;
67
- redirectUri: string | null;
68
- isEnabled: boolean;
69
- })[]>;
70
- get(organizationId: string, id: string): Promise<{
71
- provider: {
72
- name: string;
73
- key: string;
74
- id: string;
75
- createdAt: Date;
76
- updatedAt: Date;
77
- authType: import("../generated/prisma/enums.js").AuthType;
78
- authorizationUrl: string | null;
79
- tokenUrl: string | null;
80
- revokeUrl: string | null;
81
- apiBaseUrl: string | null;
82
- scopesAvailable: string[];
83
- docsUrl: string | null;
84
- logoUrl: string | null;
85
- isActive: boolean;
86
- };
87
- } & {
88
- name: string;
89
- id: string;
90
- createdAt: Date;
91
- updatedAt: Date;
92
- metadata: import("@prisma/client/runtime/client").JsonValue | null;
93
- scopes: string[];
94
- slug: string;
95
- organizationId: string;
96
- providerId: string;
97
- environment: import("../generated/prisma/enums.js").ConnectionEnvironment;
98
- authType: import("../generated/prisma/enums.js").AuthType;
99
- clientId: string | null;
100
- redirectUri: string | null;
101
- isEnabled: boolean;
102
- }>;
103
- create(organizationId: string, input: CreateConfigurationInput): Promise<{
104
- provider: {
105
- name: string;
106
- key: string;
107
- id: string;
108
- createdAt: Date;
109
- updatedAt: Date;
110
- authType: import("../generated/prisma/enums.js").AuthType;
111
- authorizationUrl: string | null;
112
- tokenUrl: string | null;
113
- revokeUrl: string | null;
114
- apiBaseUrl: string | null;
115
- scopesAvailable: string[];
116
- docsUrl: string | null;
117
- logoUrl: string | null;
118
- isActive: boolean;
119
- };
120
- } & {
121
- name: string;
122
- id: string;
123
- createdAt: Date;
124
- updatedAt: Date;
125
- metadata: import("@prisma/client/runtime/client").JsonValue | null;
126
- scopes: string[];
127
- slug: string;
128
- organizationId: string;
129
- providerId: string;
130
- environment: import("../generated/prisma/enums.js").ConnectionEnvironment;
131
- authType: import("../generated/prisma/enums.js").AuthType;
132
- clientId: string | null;
133
- redirectUri: string | null;
134
- isEnabled: boolean;
135
- }>;
136
- update(organizationId: string, id: string, input: UpdateConfigurationInput): Promise<{
137
- provider: {
138
- name: string;
139
- key: string;
140
- id: string;
141
- createdAt: Date;
142
- updatedAt: Date;
143
- authType: import("../generated/prisma/enums.js").AuthType;
144
- authorizationUrl: string | null;
145
- tokenUrl: string | null;
146
- revokeUrl: string | null;
147
- apiBaseUrl: string | null;
148
- scopesAvailable: string[];
149
- docsUrl: string | null;
150
- logoUrl: string | null;
151
- isActive: boolean;
152
- };
153
- } & {
154
- name: string;
155
- id: string;
156
- createdAt: Date;
157
- updatedAt: Date;
158
- metadata: import("@prisma/client/runtime/client").JsonValue | null;
159
- scopes: string[];
160
- slug: string;
161
- organizationId: string;
162
- providerId: string;
163
- environment: import("../generated/prisma/enums.js").ConnectionEnvironment;
164
- authType: import("../generated/prisma/enums.js").AuthType;
165
- clientId: string | null;
166
- redirectUri: string | null;
167
- isEnabled: boolean;
168
- }>;
169
- remove(organizationId: string, id: string): Promise<void>;
26
+ callbackUrlFor(integrationKey: string): string;
27
+ list(organizationId: string, userId: string, environmentId: string): Promise<import("./configurations.repository.js").PublicConfiguration[]>;
28
+ get(organizationId: string, userId: string, environmentId: string, id: string): Promise<import("./configurations.repository.js").PublicConfiguration>;
29
+ /** How a caller's slug resolves, once a key has named the environment. */
30
+ getBySlug(environmentId: string, slug: string): Promise<import("./configurations.repository.js").PublicConfiguration>;
31
+ create(organizationId: string, userId: string, environmentId: string, input: CreateConfigurationDto): Promise<import("./configurations.repository.js").PublicConfiguration>;
32
+ update(organizationId: string, userId: string, environmentId: string, id: string, input: UpdateConfigurationDto): Promise<import("./configurations.repository.js").PublicConfiguration>;
33
+ /**
34
+ * Refused while credentials still point at this row. `account.providerId` is
35
+ * a plain string, so nothing in the database would stop the delete from
36
+ * orphaning them.
37
+ */
38
+ remove(organizationId: string, userId: string, environmentId: string, id: string): Promise<void>;
170
39
  /**
171
- * Includes the decrypted client secret, for the connect flow only. Never
40
+ * Opens the secret half, for the connect and proxy paths only. Never
172
41
  * reachable from a controller.
173
42
  */
174
- getWithDecryptedSecret(configurationId: string): Promise<{
175
- clientSecret: string;
176
- provider: {
177
- name: string;
178
- key: string;
179
- id: string;
180
- createdAt: Date;
181
- updatedAt: Date;
182
- authType: import("../generated/prisma/enums.js").AuthType;
183
- authorizationUrl: string | null;
184
- tokenUrl: string | null;
185
- revokeUrl: string | null;
186
- apiBaseUrl: string | null;
187
- scopesAvailable: string[];
188
- docsUrl: string | null;
189
- logoUrl: string | null;
190
- isActive: boolean;
191
- };
192
- name: string;
193
- id: string;
194
- createdAt: Date;
195
- updatedAt: Date;
196
- metadata: import("@prisma/client/runtime/client").JsonValue | null;
197
- scopes: string[];
198
- slug: string;
199
- organizationId: string;
200
- providerId: string;
201
- environment: import("../generated/prisma/enums.js").ConnectionEnvironment;
202
- authType: import("../generated/prisma/enums.js").AuthType;
203
- clientId: string | null;
204
- encryptedClientSecret: string | null;
205
- redirectUri: string | null;
206
- isEnabled: boolean;
207
- }>;
208
- private validateScopes;
43
+ getWithCredentials(configurationId: string): Promise<ConfigurationWithCredentials>;
44
+ /**
45
+ * What the auth type needs, encrypted as one blob rather than a column per
46
+ * field — a GitHub App configuration holds an appId and a private key where
47
+ * an OAuth2 one holds a client id and secret, and neither should force a
48
+ * migration on the other.
49
+ */
50
+ private sealCredentials;
209
51
  /**
210
52
  * Checks per-organization settings against the integration's declared
211
- * `configFields`. Integrations describe their settings as data so the admin
212
- * can render a form; the same description is what validates here.
53
+ * `configFields`, and any scopes against what the provider actually offers.
54
+ * Integrations describe their settings as data so the admin can render a
55
+ * form; the same description is what validates here.
213
56
  */
214
57
  private validateSettings;
58
+ private validateScopes;
215
59
  }
216
60
  //# sourceMappingURL=configurations.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"configurations.service.d.ts","sourceRoot":"","sources":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