@kosha-ai/server 0.2.0 → 0.4.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.
- package/dist/auth/auth.factory.d.ts.map +1 -1
- package/dist/auth/auth.factory.js +0 -5
- package/dist/configurations/configurations.controller.d.ts +6 -5
- package/dist/configurations/configurations.controller.d.ts.map +1 -1
- package/dist/configurations/configurations.controller.js +22 -18
- package/dist/configurations/configurations.module.d.ts.map +1 -1
- package/dist/configurations/configurations.module.js +1 -2
- package/dist/configurations/configurations.service.d.ts +29 -35
- package/dist/configurations/configurations.service.d.ts.map +1 -1
- package/dist/configurations/configurations.service.js +126 -149
- package/dist/configurations/dto/create-configuration.dto.d.ts +2 -2
- package/dist/configurations/dto/create-configuration.dto.d.ts.map +1 -1
- package/dist/configurations/dto/create-configuration.dto.js +6 -6
- package/dist/configurations/dto/update-configuration.dto.d.ts +1 -2
- package/dist/configurations/dto/update-configuration.dto.d.ts.map +1 -1
- package/dist/configurations/dto/update-configuration.dto.js +7 -13
- package/dist/connect/connect.controller.d.ts +12 -2
- package/dist/connect/connect.controller.d.ts.map +1 -1
- package/dist/connect/connect.controller.js +108 -18
- package/dist/connect/connect.module.d.ts.map +1 -1
- package/dist/connect/connect.module.js +1 -2
- package/dist/connect/connect.repository.d.ts +34 -25
- package/dist/connect/connect.repository.d.ts.map +1 -1
- package/dist/connect/connect.repository.js +45 -52
- package/dist/connect/connect.service.d.ts +54 -8
- package/dist/connect/connect.service.d.ts.map +1 -1
- package/dist/connect/connect.service.js +312 -68
- package/dist/connect/dto/connect-credential.dto.d.ts +8 -0
- package/dist/connect/dto/connect-credential.dto.d.ts.map +1 -0
- package/dist/connect/dto/connect-credential.dto.js +54 -0
- package/dist/connect/dto/create-connect-session.dto.d.ts +1 -1
- package/dist/connect/dto/create-connect-session.dto.d.ts.map +1 -1
- package/dist/connect/dto/create-connect-session.dto.js +7 -8
- package/dist/connect/dto/create-test-session.dto.d.ts +8 -0
- package/dist/connect/dto/create-test-session.dto.d.ts.map +1 -1
- package/dist/connect/dto/create-test-session.dto.js +45 -3
- package/dist/connections/connections.controller.d.ts +4 -3
- package/dist/connections/connections.controller.d.ts.map +1 -1
- package/dist/connections/connections.controller.js +13 -11
- package/dist/connections/connections.repository.d.ts +24 -17
- package/dist/connections/connections.repository.d.ts.map +1 -1
- package/dist/connections/connections.repository.js +21 -43
- package/dist/connections/connections.service.d.ts +48 -13
- package/dist/connections/connections.service.d.ts.map +1 -1
- package/dist/connections/connections.service.js +111 -32
- package/dist/connections/dto/list-connections.dto.d.ts +3 -1
- package/dist/connections/dto/list-connections.dto.d.ts.map +1 -1
- package/dist/connections/dto/list-connections.dto.js +26 -4
- package/dist/connections/environment-connections.controller.d.ts +4 -3
- package/dist/connections/environment-connections.controller.d.ts.map +1 -1
- package/dist/connections/environment-connections.controller.js +14 -12
- package/dist/credentials/credentials.module.d.ts.map +1 -1
- package/dist/credentials/credentials.module.js +0 -2
- package/dist/credentials/credentials.repository.d.ts +5 -2
- package/dist/credentials/credentials.repository.d.ts.map +1 -1
- package/dist/credentials/credentials.repository.js +10 -3
- package/dist/credentials/credentials.service.d.ts +14 -4
- package/dist/credentials/credentials.service.d.ts.map +1 -1
- package/dist/credentials/credentials.service.js +106 -30
- package/dist/crypto/credential-envelope.d.ts +27 -1
- package/dist/crypto/credential-envelope.d.ts.map +1 -1
- package/dist/crypto/credential-envelope.js +43 -0
- package/dist/egress/egress.listener.d.ts +1 -3
- package/dist/egress/egress.listener.d.ts.map +1 -1
- package/dist/egress/egress.listener.js +3 -7
- package/dist/egress/egress.repository.d.ts +13 -6
- package/dist/egress/egress.repository.d.ts.map +1 -1
- package/dist/egress/egress.repository.js +31 -44
- package/dist/generated/prisma/browser.d.ts +0 -5
- package/dist/generated/prisma/browser.d.ts.map +1 -1
- package/dist/generated/prisma/client.d.ts +0 -5
- package/dist/generated/prisma/client.d.ts.map +1 -1
- package/dist/generated/prisma/commonInputTypes.d.ts +0 -55
- package/dist/generated/prisma/commonInputTypes.d.ts.map +1 -1
- package/dist/generated/prisma/internal/class.d.ts +0 -11
- package/dist/generated/prisma/internal/class.d.ts.map +1 -1
- package/dist/generated/prisma/internal/class.js +4 -4
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +1 -114
- package/dist/generated/prisma/internal/prismaNamespace.d.ts.map +1 -1
- package/dist/generated/prisma/internal/prismaNamespace.js +2 -29
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +0 -30
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts.map +1 -1
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +2 -29
- package/dist/generated/prisma/models/Account.d.ts +26 -344
- package/dist/generated/prisma/models/Account.d.ts.map +1 -1
- package/dist/generated/prisma/models/Environment.d.ts +0 -258
- package/dist/generated/prisma/models/Environment.d.ts.map +1 -1
- package/dist/generated/prisma/models/User.d.ts +2 -60
- package/dist/generated/prisma/models/User.d.ts.map +1 -1
- package/dist/generated/prisma/models.d.ts +0 -1
- package/dist/generated/prisma/models.d.ts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/integrations/client-context.d.ts +20 -0
- package/dist/integrations/client-context.d.ts.map +1 -0
- package/dist/integrations/client-context.js +23 -0
- package/dist/integrations/integrations.controller.d.ts +6 -0
- package/dist/integrations/integrations.controller.d.ts.map +1 -1
- package/dist/integrations/integrations.controller.js +3 -0
- package/dist/integrations/integrations.module.d.ts.map +1 -1
- package/dist/integrations/integrations.module.js +3 -1
- package/dist/integrations/provider-store.d.ts +110 -0
- package/dist/integrations/provider-store.d.ts.map +1 -0
- package/dist/integrations/provider-store.js +302 -0
- package/dist/proxy/proxy.controller.d.ts +17 -5
- package/dist/proxy/proxy.controller.d.ts.map +1 -1
- package/dist/proxy/proxy.controller.js +46 -17
- package/dist/proxy/proxy.module.d.ts.map +1 -1
- package/dist/proxy/proxy.module.js +1 -2
- package/dist/proxy/proxy.repository.d.ts +11 -14
- package/dist/proxy/proxy.repository.d.ts.map +1 -1
- package/dist/proxy/proxy.repository.js +17 -27
- package/dist/proxy/proxy.service.d.ts +6 -8
- package/dist/proxy/proxy.service.d.ts.map +1 -1
- package/dist/proxy/proxy.service.js +72 -31
- package/package.json +4 -4
- package/prisma/migrations/{20260929101936_init → 20261008090000_init}/migration.sql +5 -58
- package/prisma/schema.prisma +2 -43
- package/dist/configurations/configurations.repository.d.ts +0 -43
- package/dist/configurations/configurations.repository.d.ts.map +0 -1
- package/dist/configurations/configurations.repository.js +0 -76
- package/dist/generated/prisma/models/Configuration.d.ts +0 -1385
- package/dist/generated/prisma/models/Configuration.d.ts.map +0 -1
- package/dist/generated/prisma/models/Configuration.js +0 -1
- package/prisma/migrations/20260930102529_connection_config/migration.sql +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.factory.d.ts","sourceRoot":"","sources":["../../src/auth/auth.factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAIpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,YAAY,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE;YAAE,GAAG,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAAG,OAAO,CAAC;QACtD,KAAK,EAAE,OAAO,CAAC;QACf,GAAG,CAAC,EAAE;YACJ,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAC5B,mEAAmE;YACnE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;SAC3C,GAAG,IAAI,CAAC;QACT,KAAK,CAAC,EAAE,O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emailAndPassword: {
|
|
42
42
|
enabled: config.auth.emailAndPassword?.enabled ?? true,
|
|
43
43
|
},
|
|
44
|
-
user: {
|
|
45
|
-
additionalFields: {
|
|
46
|
-
externalId: { type: 'string', required: false, input: false },
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
44
|
trustedOrigins: config.auth.trustedOrigins ?? [],
|
|
50
45
|
advanced: { defaultCookieAttributes: crossSiteCookieAttributes(config) },
|
|
51
46
|
hooks: {
|
|
@@ -10,11 +10,12 @@ import { UpdateConfigurationDto } from './dto/update-configuration.dto.js';
|
|
|
10
10
|
export declare class ConfigurationsController {
|
|
11
11
|
private readonly configurations;
|
|
12
12
|
constructor(configurations: ConfigurationsService);
|
|
13
|
-
list(session: UserSession, environmentId: string): Promise<import("./configurations.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
list(session: UserSession, environmentId: string): Promise<import("./configurations.service.js").DescribedConfiguration[]>;
|
|
14
|
+
/** The provider names the table the id lives in, so it is part of the path. */
|
|
15
|
+
get(session: UserSession, environmentId: string, provider: string, id: string): Promise<import("./configurations.service.js").DescribedConfiguration>;
|
|
16
|
+
create(session: UserSession, environmentId: string, body: CreateConfigurationDto): Promise<import("./configurations.service.js").DescribedConfiguration>;
|
|
17
|
+
update(session: UserSession, environmentId: string, provider: string, id: string, body: UpdateConfigurationDto): Promise<import("./configurations.service.js").DescribedConfiguration>;
|
|
18
|
+
remove(session: UserSession, environmentId: string, provider: string, id: string): Promise<{
|
|
18
19
|
id: string;
|
|
19
20
|
deleted: boolean;
|
|
20
21
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurations.controller.d.ts","sourceRoot":"","sources":["../../src/configurations/configurations.controller.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E;;;;GAIG;AACH,qBAEa,wBAAwB;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,qBAAqB;IAKlE,IAAI,CACS,OAAO,EAAE,WAAW,EACP,aAAa,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"configurations.controller.d.ts","sourceRoot":"","sources":["../../src/configurations/configurations.controller.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E;;;;GAIG;AACH,qBAEa,wBAAwB;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,qBAAqB;IAKlE,IAAI,CACS,OAAO,EAAE,WAAW,EACP,aAAa,EAAE,MAAM;IAS/C,+EAA+E;IAI/E,GAAG,CACU,OAAO,EAAE,WAAW,EACP,aAAa,EAAE,MAAM,EAC1B,QAAQ,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM;IAsBzB,MAAM,CACO,OAAO,EAAE,WAAW,EACP,aAAa,EAAE,MAAM,EACrC,IAAI,EAAE,sBAAsB;IAatC,MAAM,CACO,OAAO,EAAE,WAAW,EACP,aAAa,EAAE,MAAM,EAC1B,QAAQ,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM,EACf,IAAI,EAAE,sBAAsB;IAsBhC,MAAM,CACC,OAAO,EAAE,WAAW,EACP,aAAa,EAAE,MAAM,EAC1B,QAAQ,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM;;;;CAW1B"}
|
|
@@ -19,17 +19,18 @@ let ConfigurationsController = class ConfigurationsController {
|
|
|
19
19
|
list(session, environmentId) {
|
|
20
20
|
return this.configurations.list(getActiveOrganizationId(session), session.user.id, environmentId);
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/** The provider names the table the id lives in, so it is part of the path. */
|
|
23
|
+
get(session, environmentId, provider, id) {
|
|
24
|
+
return this.configurations.get(getActiveOrganizationId(session), session.user.id, environmentId, provider, id);
|
|
24
25
|
}
|
|
25
26
|
create(session, environmentId, body) {
|
|
26
27
|
return this.configurations.create(getActiveOrganizationId(session), session.user.id, environmentId, body);
|
|
27
28
|
}
|
|
28
|
-
update(session, environmentId, id, body) {
|
|
29
|
-
return this.configurations.update(getActiveOrganizationId(session), session.user.id, environmentId, id, body);
|
|
29
|
+
update(session, environmentId, provider, id, body) {
|
|
30
|
+
return this.configurations.update(getActiveOrganizationId(session), session.user.id, environmentId, provider, id, body);
|
|
30
31
|
}
|
|
31
|
-
async remove(session, environmentId, id) {
|
|
32
|
-
await this.configurations.remove(getActiveOrganizationId(session), session.user.id, environmentId, id);
|
|
32
|
+
async remove(session, environmentId, provider, id) {
|
|
33
|
+
await this.configurations.remove(getActiveOrganizationId(session), session.user.id, environmentId, provider, id);
|
|
33
34
|
return { id, deleted: true };
|
|
34
35
|
}
|
|
35
36
|
};
|
|
@@ -44,14 +45,15 @@ __decorate([
|
|
|
44
45
|
__metadata("design:returntype", void 0)
|
|
45
46
|
], ConfigurationsController.prototype, "list", null);
|
|
46
47
|
__decorate([
|
|
47
|
-
Get(':id'),
|
|
48
|
+
Get(':provider/:id'),
|
|
48
49
|
ApiOperation({ summary: 'Get one configuration' }),
|
|
49
50
|
ApiNotFoundResponse({ description: 'No such configuration here.' }),
|
|
50
51
|
__param(0, Session()),
|
|
51
52
|
__param(1, Param('environmentId')),
|
|
52
|
-
__param(2, Param('
|
|
53
|
+
__param(2, Param('provider')),
|
|
54
|
+
__param(3, Param('id')),
|
|
53
55
|
__metadata("design:type", Function),
|
|
54
|
-
__metadata("design:paramtypes", [Object, String, String]),
|
|
56
|
+
__metadata("design:paramtypes", [Object, String, String, String]),
|
|
55
57
|
__metadata("design:returntype", void 0)
|
|
56
58
|
], ConfigurationsController.prototype, "get", null);
|
|
57
59
|
__decorate([
|
|
@@ -59,7 +61,7 @@ __decorate([
|
|
|
59
61
|
HttpCode(HttpStatus.CREATED),
|
|
60
62
|
ApiOperation({
|
|
61
63
|
summary: 'Set up a provider in this environment',
|
|
62
|
-
description: 'The
|
|
64
|
+
description: 'The provider names an installed package, and its tables are where the configuration is written.',
|
|
63
65
|
}),
|
|
64
66
|
ApiCreatedResponse({ description: 'The created configuration.' }),
|
|
65
67
|
ApiConflictResponse({
|
|
@@ -73,22 +75,23 @@ __decorate([
|
|
|
73
75
|
__metadata("design:returntype", void 0)
|
|
74
76
|
], ConfigurationsController.prototype, "create", null);
|
|
75
77
|
__decorate([
|
|
76
|
-
Patch(':id'),
|
|
78
|
+
Patch(':provider/:id'),
|
|
77
79
|
ApiOperation({ summary: 'Update a configuration' }),
|
|
78
80
|
ApiOkResponse({ description: 'The updated configuration.' }),
|
|
79
81
|
__param(0, Session()),
|
|
80
82
|
__param(1, Param('environmentId')),
|
|
81
|
-
__param(2, Param('
|
|
82
|
-
__param(3,
|
|
83
|
+
__param(2, Param('provider')),
|
|
84
|
+
__param(3, Param('id')),
|
|
85
|
+
__param(4, Body()),
|
|
83
86
|
__metadata("design:type", Function),
|
|
84
|
-
__metadata("design:paramtypes", [Object, String, String, UpdateConfigurationDto]),
|
|
87
|
+
__metadata("design:paramtypes", [Object, String, String, String, UpdateConfigurationDto]),
|
|
85
88
|
__metadata("design:returntype", void 0)
|
|
86
89
|
], ConfigurationsController.prototype, "update", null);
|
|
87
90
|
__decorate([
|
|
88
|
-
Delete(':id'),
|
|
91
|
+
Delete(':provider/:id'),
|
|
89
92
|
ApiOperation({
|
|
90
93
|
summary: 'Delete a configuration',
|
|
91
|
-
description: 'Refused while connections still use it
|
|
94
|
+
description: 'Refused while connections still use it — the foreign key would refuse it anyway, and this reports which.',
|
|
92
95
|
}),
|
|
93
96
|
ApiOkResponse({ description: 'The deleted configuration id.' }),
|
|
94
97
|
ApiConflictResponse({
|
|
@@ -96,9 +99,10 @@ __decorate([
|
|
|
96
99
|
}),
|
|
97
100
|
__param(0, Session()),
|
|
98
101
|
__param(1, Param('environmentId')),
|
|
99
|
-
__param(2, Param('
|
|
102
|
+
__param(2, Param('provider')),
|
|
103
|
+
__param(3, Param('id')),
|
|
100
104
|
__metadata("design:type", Function),
|
|
101
|
-
__metadata("design:paramtypes", [Object, String, String]),
|
|
105
|
+
__metadata("design:paramtypes", [Object, String, String, String]),
|
|
102
106
|
__metadata("design:returntype", Promise)
|
|
103
107
|
], ConfigurationsController.prototype, "remove", null);
|
|
104
108
|
ConfigurationsController = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurations.module.d.ts","sourceRoot":"","sources":["../../src/configurations/configurations.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configurations.module.d.ts","sourceRoot":"","sources":["../../src/configurations/configurations.module.ts"],"names":[],"mappings":"AAKA,qBAMa,oBAAoB;CAAG"}
|
|
@@ -2,7 +2,6 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { Module } from '@nestjs/common';
|
|
3
3
|
import { EnvironmentsModule } from '../environments/environments.module.js';
|
|
4
4
|
import { ConfigurationsController } from './configurations.controller.js';
|
|
5
|
-
import { ConfigurationsRepository } from './configurations.repository.js';
|
|
6
5
|
import { ConfigurationsService } from './configurations.service.js';
|
|
7
6
|
let ConfigurationsModule = class ConfigurationsModule {
|
|
8
7
|
};
|
|
@@ -10,7 +9,7 @@ ConfigurationsModule = __decorate([
|
|
|
10
9
|
Module({
|
|
11
10
|
imports: [EnvironmentsModule],
|
|
12
11
|
controllers: [ConfigurationsController],
|
|
13
|
-
providers: [ConfigurationsService
|
|
12
|
+
providers: [ConfigurationsService],
|
|
14
13
|
exports: [ConfigurationsService],
|
|
15
14
|
})
|
|
16
15
|
], ConfigurationsModule);
|
|
@@ -1,60 +1,54 @@
|
|
|
1
|
-
import type { ResolvedKoshaConfig } from '../config/kosha-config.js';
|
|
2
1
|
import { CryptoService } from '../crypto/crypto.service.js';
|
|
3
2
|
import { EnvironmentsService } from '../environments/environments.service.js';
|
|
4
|
-
import type { Configuration } from '../generated/prisma/client.js';
|
|
5
3
|
import { IntegrationRegistry } from '../integrations/integration.registry.js';
|
|
6
|
-
import {
|
|
4
|
+
import { ProviderStore, type ProviderConfiguration, type PublicProviderConfiguration } from '../integrations/provider-store.js';
|
|
7
5
|
import type { CreateConfigurationDto } from './dto/create-configuration.dto.js';
|
|
8
6
|
import type { UpdateConfigurationDto } from './dto/update-configuration.dto.js';
|
|
7
|
+
/** A configuration with the provider it belongs to named, as a client sees it. */
|
|
8
|
+
export type DescribedConfiguration = PublicProviderConfiguration & {
|
|
9
|
+
provider: string;
|
|
10
|
+
authType: string;
|
|
11
|
+
};
|
|
9
12
|
/** A configuration with its secrets opened. Never leaves the server. */
|
|
10
13
|
export interface ConfigurationWithCredentials {
|
|
11
|
-
configuration:
|
|
14
|
+
configuration: ProviderConfiguration;
|
|
12
15
|
credentials: Record<string, unknown>;
|
|
13
16
|
}
|
|
14
17
|
export declare class ConfigurationsService {
|
|
15
|
-
private readonly
|
|
18
|
+
private readonly store;
|
|
16
19
|
private readonly environments;
|
|
17
20
|
private readonly crypto;
|
|
18
21
|
private readonly registry;
|
|
19
|
-
|
|
20
|
-
constructor(configurations: ConfigurationsRepository, environments: EnvironmentsService, crypto: CryptoService, registry: IntegrationRegistry, config: ResolvedKoshaConfig);
|
|
22
|
+
constructor(store: ProviderStore, environments: EnvironmentsService, crypto: CryptoService, registry: IntegrationRegistry);
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* Every configuration in an environment, across every installed provider.
|
|
25
|
+
*
|
|
26
|
+
* Kosha owns no table that lists them, so this asks each provider in turn.
|
|
27
|
+
* An environment holds a handful, and each read is an index lookup.
|
|
25
28
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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>;
|
|
29
|
+
list(organizationId: string, userId: string, environmentId: string): Promise<DescribedConfiguration[]>;
|
|
30
|
+
get(organizationId: string, userId: string, environmentId: string, provider: string, id: string): Promise<DescribedConfiguration>;
|
|
31
|
+
create(organizationId: string, userId: string, environmentId: string, input: CreateConfigurationDto): Promise<DescribedConfiguration>;
|
|
32
|
+
update(organizationId: string, userId: string, environmentId: string, provider: string, id: string, input: UpdateConfigurationDto): Promise<DescribedConfiguration>;
|
|
33
|
+
/** Refused while connections still point at this row. */
|
|
34
|
+
remove(organizationId: string, userId: string, environmentId: string, provider: string, id: string): Promise<void>;
|
|
39
35
|
/**
|
|
40
36
|
* Opens the secret half, for the connect and proxy paths only. Never
|
|
41
37
|
* reachable from a controller.
|
|
42
38
|
*/
|
|
43
|
-
getWithCredentials(configurationId: string): Promise<ConfigurationWithCredentials>;
|
|
39
|
+
getWithCredentials(provider: string, configurationId: string): Promise<ConfigurationWithCredentials>;
|
|
44
40
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* migration on the other.
|
|
41
|
+
* Refuses a URL the server would later be made to fetch from inside its own
|
|
42
|
+
* network. Checked when saved so an operator sees why, and again on every
|
|
43
|
+
* proxied call, since what a hostname resolves to can change.
|
|
49
44
|
*/
|
|
50
|
-
private
|
|
45
|
+
private checkedFields;
|
|
51
46
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
47
|
+
* Seals the whole credential set as one blob, so the shape is the auth
|
|
48
|
+
* type's business rather than the schema's: an OAuth2 provider stores a
|
|
49
|
+
* client id and secret, and a provider whose end users bring their own key
|
|
50
|
+
* stores nothing at all.
|
|
56
51
|
*/
|
|
57
|
-
private
|
|
58
|
-
private validateScopes;
|
|
52
|
+
private sealCredentials;
|
|
59
53
|
}
|
|
60
54
|
//# sourceMappingURL=configurations.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurations.service.d.ts","sourceRoot":"","sources":["../../src/configurations/configurations.service.ts"],"names":[],"mappings":"AAQA,OAAO,
|
|
1
|
+
{"version":3,"file":"configurations.service.d.ts","sourceRoot":"","sources":["../../src/configurations/configurations.service.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EACL,aAAa,EACb,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EACjC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEhF,kFAAkF;AAClF,MAAM,MAAM,sBAAsB,GAAG,2BAA2B,GAAG;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wEAAwE;AACxE,MAAM,WAAW,4BAA4B;IAC3C,aAAa,EAAE,qBAAqB,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,qBACa,qBAAqB;I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