@kosha-ai/server 0.2.0 → 0.3.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 +24 -36
- package/dist/configurations/configurations.service.d.ts.map +1 -1
- package/dist/configurations/configurations.service.js +71 -151
- package/dist/configurations/dto/create-configuration.dto.d.ts +1 -2
- package/dist/configurations/dto/create-configuration.dto.d.ts.map +1 -1
- package/dist/configurations/dto/create-configuration.dto.js +2 -12
- package/dist/configurations/dto/update-configuration.dto.d.ts +0 -2
- package/dist/configurations/dto/update-configuration.dto.d.ts.map +1 -1
- package/dist/configurations/dto/update-configuration.dto.js +1 -17
- package/dist/connect/connect.controller.d.ts +1 -1
- package/dist/connect/connect.controller.d.ts.map +1 -1
- package/dist/connect/connect.controller.js +7 -6
- 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 +23 -23
- package/dist/connect/connect.repository.d.ts.map +1 -1
- package/dist/connect/connect.repository.js +37 -49
- package/dist/connect/connect.service.d.ts +7 -8
- package/dist/connect/connect.service.d.ts.map +1 -1
- package/dist/connect/connect.service.js +54 -51
- 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 +1 -0
- package/dist/connect/dto/create-test-session.dto.d.ts.map +1 -1
- package/dist/connect/dto/create-test-session.dto.js +10 -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 +8 -4
- package/dist/credentials/credentials.service.d.ts.map +1 -1
- package/dist/credentials/credentials.service.js +27 -16
- 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/integrations.controller.d.ts +2 -0
- package/dist/integrations/integrations.controller.d.ts.map +1 -1
- package/dist/integrations/integrations.controller.js +1 -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 +104 -0
- package/dist/integrations/provider-store.d.ts.map +1 -0
- package/dist/integrations/provider-store.js +234 -0
- package/dist/proxy/proxy.controller.d.ts +9 -5
- package/dist/proxy/proxy.controller.d.ts.map +1 -1
- package/dist/proxy/proxy.controller.js +18 -13
- 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 +34 -28
- 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
|
@@ -3,7 +3,7 @@ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
3
3
|
import { IsOptional, IsString, MaxLength, MinLength } from 'class-validator';
|
|
4
4
|
export class CreateConnectSessionDto {
|
|
5
5
|
externalUserId;
|
|
6
|
-
|
|
6
|
+
provider;
|
|
7
7
|
configurationSlug;
|
|
8
8
|
configurationId;
|
|
9
9
|
redirectUrl;
|
|
@@ -19,18 +19,17 @@ __decorate([
|
|
|
19
19
|
__metadata("design:type", String)
|
|
20
20
|
], CreateConnectSessionDto.prototype, "externalUserId", void 0);
|
|
21
21
|
__decorate([
|
|
22
|
-
|
|
23
|
-
example: '
|
|
24
|
-
description: '
|
|
22
|
+
ApiProperty({
|
|
23
|
+
example: 'github',
|
|
24
|
+
description: 'Which provider. Configurations live in per-provider tables, so a slug is only unique within one.',
|
|
25
25
|
}),
|
|
26
|
-
IsOptional(),
|
|
27
26
|
IsString(),
|
|
28
|
-
|
|
27
|
+
MinLength(1),
|
|
29
28
|
__metadata("design:type", String)
|
|
30
|
-
], CreateConnectSessionDto.prototype, "
|
|
29
|
+
], CreateConnectSessionDto.prototype, "provider", void 0);
|
|
31
30
|
__decorate([
|
|
32
31
|
ApiPropertyOptional({
|
|
33
|
-
example: 'github',
|
|
32
|
+
example: 'my-github',
|
|
34
33
|
description: 'Configuration slug, as named in this environment.',
|
|
35
34
|
}),
|
|
36
35
|
IsOptional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-test-session.dto.d.ts","sourceRoot":"","sources":["../../../src/connect/dto/create-test-session.dto.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,qBAAa,oBAAoB;IAI/B,IAAI,CAAC,EAAE,MAAM,CAAC;IAOd,eAAe,CAAC,EAAE,MAAM,CAAC;IAOzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
1
|
+
{"version":3,"file":"create-test-session.dto.d.ts","sourceRoot":"","sources":["../../../src/connect/dto/create-test-session.dto.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,qBAAa,oBAAoB;IAI/B,QAAQ,EAAG,MAAM,CAAC;IAKlB,IAAI,CAAC,EAAE,MAAM,CAAC;IAOd,eAAe,CAAC,EAAE,MAAM,CAAC;IAOzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
3
|
-
import { IsOptional, IsString } from 'class-validator';
|
|
2
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
3
|
+
import { IsOptional, IsString, MinLength } from 'class-validator';
|
|
4
4
|
/**
|
|
5
5
|
* The admin standing in for an end user, so an operator can verify a
|
|
6
6
|
* configuration without wiring up their backend first.
|
|
7
7
|
*/
|
|
8
8
|
export class CreateTestSessionDto {
|
|
9
|
+
provider;
|
|
9
10
|
slug;
|
|
10
11
|
configurationId;
|
|
11
12
|
redirectUrl;
|
|
12
13
|
}
|
|
13
14
|
__decorate([
|
|
14
|
-
|
|
15
|
+
ApiProperty({ example: 'github', description: 'Which provider.' }),
|
|
16
|
+
IsString(),
|
|
17
|
+
MinLength(1),
|
|
18
|
+
__metadata("design:type", String)
|
|
19
|
+
], CreateTestSessionDto.prototype, "provider", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
ApiPropertyOptional({ example: 'my-github' }),
|
|
15
22
|
IsOptional(),
|
|
16
23
|
IsString(),
|
|
17
24
|
__metadata("design:type", String)
|
|
@@ -8,10 +8,11 @@ import { ListConnectionsDto } from './dto/list-connections.dto.js';
|
|
|
8
8
|
export declare class ConnectionsController {
|
|
9
9
|
private readonly connections;
|
|
10
10
|
constructor(connections: ConnectionsService);
|
|
11
|
-
list(request: ApiKeyRequest, filters: ListConnectionsDto): Promise<import("./connections.
|
|
12
|
-
get(request: ApiKeyRequest, id: string): Promise<import("./connections.
|
|
13
|
-
revoke(request: ApiKeyRequest, id: string): Promise<{
|
|
11
|
+
list(request: ApiKeyRequest, filters: ListConnectionsDto): Promise<import("./connections.service.js").DescribedConnection[]>;
|
|
12
|
+
get(request: ApiKeyRequest, provider: string, id: string): Promise<import("./connections.service.js").DescribedConnection>;
|
|
13
|
+
revoke(request: ApiKeyRequest, provider: string, id: string): Promise<{
|
|
14
14
|
id: string;
|
|
15
|
+
provider: string;
|
|
15
16
|
revoked: true;
|
|
16
17
|
}>;
|
|
17
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connections.controller.d.ts","sourceRoot":"","sources":["../../src/connections/connections.controller.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;;GAGG;AACH,qBAKa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,kBAAkB;IAS5D,IAAI,CAAQ,OAAO,EAAE,aAAa,EAAW,OAAO,EAAE,kBAAkB;IAUxE,GAAG,
|
|
1
|
+
{"version":3,"file":"connections.controller.d.ts","sourceRoot":"","sources":["../../src/connections/connections.controller.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;;GAGG;AACH,qBAKa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,kBAAkB;IAS5D,IAAI,CAAQ,OAAO,EAAE,aAAa,EAAW,OAAO,EAAE,kBAAkB;IAUxE,GAAG,CACM,OAAO,EAAE,aAAa,EACV,QAAQ,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM;IAgBzB,MAAM,CACG,OAAO,EAAE,aAAa,EACV,QAAQ,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM;;;;;CAS1B"}
|
|
@@ -17,18 +17,18 @@ let ConnectionsController = class ConnectionsController {
|
|
|
17
17
|
list(request, filters) {
|
|
18
18
|
return this.connections.list(request.organizationId, environmentOf(request), filters);
|
|
19
19
|
}
|
|
20
|
-
get(request, id) {
|
|
21
|
-
return this.connections.get(request.organizationId, environmentOf(request), id);
|
|
20
|
+
get(request, provider, id) {
|
|
21
|
+
return this.connections.get(request.organizationId, environmentOf(request), provider, id);
|
|
22
22
|
}
|
|
23
|
-
revoke(request, id) {
|
|
24
|
-
return this.connections.revoke(request.organizationId, environmentOf(request), id);
|
|
23
|
+
revoke(request, provider, id) {
|
|
24
|
+
return this.connections.revoke(request.organizationId, environmentOf(request), provider, id);
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
__decorate([
|
|
28
28
|
Get(),
|
|
29
29
|
ApiOperation({
|
|
30
30
|
summary: 'List the connections in this environment',
|
|
31
|
-
description: '
|
|
31
|
+
description: 'Returns connections from every installed provider, newest first. Tokens and secrets are never included.',
|
|
32
32
|
}),
|
|
33
33
|
ApiOkResponse({ description: 'Connections. Never carries a credential.' }),
|
|
34
34
|
__param(0, Req()),
|
|
@@ -38,24 +38,26 @@ __decorate([
|
|
|
38
38
|
__metadata("design:returntype", void 0)
|
|
39
39
|
], ConnectionsController.prototype, "list", null);
|
|
40
40
|
__decorate([
|
|
41
|
-
Get(':id'),
|
|
41
|
+
Get(':provider/:id'),
|
|
42
42
|
ApiOperation({ summary: 'Get one connection' }),
|
|
43
43
|
__param(0, Req()),
|
|
44
|
-
__param(1, Param('
|
|
44
|
+
__param(1, Param('provider')),
|
|
45
|
+
__param(2, Param('id')),
|
|
45
46
|
__metadata("design:type", Function),
|
|
46
|
-
__metadata("design:paramtypes", [Object, String]),
|
|
47
|
+
__metadata("design:paramtypes", [Object, String, String]),
|
|
47
48
|
__metadata("design:returntype", void 0)
|
|
48
49
|
], ConnectionsController.prototype, "get", null);
|
|
49
50
|
__decorate([
|
|
50
|
-
Delete(':id'),
|
|
51
|
+
Delete(':provider/:id'),
|
|
51
52
|
ApiOperation({
|
|
52
53
|
summary: 'Revoke a connection',
|
|
53
54
|
description: 'Deletes the credential. The row is the credential, so keeping it would only leave ciphertext nobody can use.',
|
|
54
55
|
}),
|
|
55
56
|
__param(0, Req()),
|
|
56
|
-
__param(1, Param('
|
|
57
|
+
__param(1, Param('provider')),
|
|
58
|
+
__param(2, Param('id')),
|
|
57
59
|
__metadata("design:type", Function),
|
|
58
|
-
__metadata("design:paramtypes", [Object, String]),
|
|
60
|
+
__metadata("design:paramtypes", [Object, String, String]),
|
|
59
61
|
__metadata("design:returntype", void 0)
|
|
60
62
|
], ConnectionsController.prototype, "revoke", null);
|
|
61
63
|
ConnectionsController = __decorate([
|
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
import type { Account } from '../generated/prisma/client.js';
|
|
2
1
|
import { PrismaService } from '../prisma/prisma.service.js';
|
|
3
|
-
/**
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The fields of an `account` row that a connection listing needs. Tokens and
|
|
4
|
+
* passwords are never read.
|
|
5
|
+
*
|
|
6
|
+
* `accountId` is the person's id at the provider, `scope` is what they
|
|
7
|
+
* granted, and the two dates say when the tokens expire.
|
|
8
|
+
*/
|
|
9
|
+
export interface ConnectionAccount {
|
|
10
|
+
id: string;
|
|
11
|
+
accountId: string;
|
|
12
|
+
scope: string | null;
|
|
13
|
+
accessTokenExpiresAt: Date | null;
|
|
14
|
+
refreshTokenExpiresAt: Date | null;
|
|
5
15
|
user: {
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
}
|
|
16
|
+
email: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reads `account` and `user` rows for connections, and deletes `account` rows
|
|
21
|
+
* on revoke. Deleting an account also deletes its provider connection row, by
|
|
22
|
+
* cascade.
|
|
23
|
+
*/
|
|
9
24
|
export declare class ConnectionsRepository {
|
|
10
25
|
private readonly prisma;
|
|
11
26
|
constructor(prisma: PrismaService);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}): Promise<ListedConnection[]>;
|
|
16
|
-
findById(environmentId: string, id: string): Promise<ListedConnection | null>;
|
|
17
|
-
/**
|
|
18
|
-
* Revoking deletes the row. The row is the credential — there is no separate
|
|
19
|
-
* connection to keep — so marking it revoked would leave ciphertext behind
|
|
20
|
-
* for no one to use.
|
|
21
|
-
*/
|
|
22
|
-
delete(environmentId: string, id: string): Promise<void>;
|
|
27
|
+
findAccounts(ids: string[]): Promise<ConnectionAccount[]>;
|
|
28
|
+
findUserIdByEmail(email: string): Promise<string | null>;
|
|
29
|
+
deleteAccount(id: string): Promise<void>;
|
|
23
30
|
}
|
|
24
31
|
//# sourceMappingURL=connections.repository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connections.repository.d.ts","sourceRoot":"","sources":["../../src/connections/connections.repository.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"connections.repository.d.ts","sourceRoot":"","sources":["../../src/connections/connections.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oBAAoB,EAAE,IAAI,GAAG,IAAI,CAAC;IAClC,qBAAqB,EAAE,IAAI,GAAG,IAAI,CAAC;IACnC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACzB;AAED;;;;GAIG;AACH,qBACa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAElD,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAgBnD,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAQxD,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C"}
|
|
@@ -2,61 +2,39 @@ import { __decorate, __metadata } from "tslib";
|
|
|
2
2
|
import { Injectable } from '@nestjs/common';
|
|
3
3
|
import { PrismaService } from '../prisma/prisma.service.js';
|
|
4
4
|
/**
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
5
|
+
* Reads `account` and `user` rows for connections, and deletes `account` rows
|
|
6
|
+
* on revoke. Deleting an account also deletes its provider connection row, by
|
|
7
|
+
* cascade.
|
|
7
8
|
*/
|
|
8
|
-
const WITHOUT_SECRETS = {
|
|
9
|
-
accessToken: true,
|
|
10
|
-
refreshToken: true,
|
|
11
|
-
idToken: true,
|
|
12
|
-
password: true,
|
|
13
|
-
scope: true,
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* A Kosha login and a provider credential share this table. Naming an
|
|
17
|
-
* environment is what separates them: a login carries none, so filtering on a
|
|
18
|
-
* specific environment can never reach one. That is the predicate every read
|
|
19
|
-
* and delete here goes through, so nothing about connections can touch
|
|
20
|
-
* somebody's ability to sign in.
|
|
21
|
-
*/
|
|
22
|
-
function connectionsIn(environmentId) {
|
|
23
|
-
return { environmentId };
|
|
24
|
-
}
|
|
25
9
|
let ConnectionsRepository = class ConnectionsRepository {
|
|
26
10
|
prisma;
|
|
27
11
|
constructor(prisma) {
|
|
28
12
|
this.prisma = prisma;
|
|
29
13
|
}
|
|
30
|
-
|
|
14
|
+
findAccounts(ids) {
|
|
15
|
+
if (ids.length === 0)
|
|
16
|
+
return Promise.resolve([]);
|
|
31
17
|
return this.prisma.account.findMany({
|
|
32
|
-
where: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
where: { id: { in: ids } },
|
|
19
|
+
select: {
|
|
20
|
+
id: true,
|
|
21
|
+
accountId: true,
|
|
22
|
+
scope: true,
|
|
23
|
+
accessTokenExpiresAt: true,
|
|
24
|
+
refreshTokenExpiresAt: true,
|
|
25
|
+
user: { select: { email: true } },
|
|
38
26
|
},
|
|
39
|
-
omit: WITHOUT_SECRETS,
|
|
40
|
-
include: { user: { select: { externalId: true } } },
|
|
41
|
-
orderBy: [{ organizationExternalId: 'asc' }, { createdAt: 'desc' }],
|
|
42
27
|
});
|
|
43
28
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
where: {
|
|
47
|
-
|
|
48
|
-
include: { user: { select: { externalId: true } } },
|
|
29
|
+
async findUserIdByEmail(email) {
|
|
30
|
+
const user = await this.prisma.user.findUnique({
|
|
31
|
+
where: { email },
|
|
32
|
+
select: { id: true },
|
|
49
33
|
});
|
|
34
|
+
return user?.id ?? null;
|
|
50
35
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
* connection to keep — so marking it revoked would leave ciphertext behind
|
|
54
|
-
* for no one to use.
|
|
55
|
-
*/
|
|
56
|
-
async delete(environmentId, id) {
|
|
57
|
-
await this.prisma.account.deleteMany({
|
|
58
|
-
where: { id, ...connectionsIn(environmentId) },
|
|
59
|
-
});
|
|
36
|
+
async deleteAccount(id) {
|
|
37
|
+
await this.prisma.account.deleteMany({ where: { id } });
|
|
60
38
|
}
|
|
61
39
|
};
|
|
62
40
|
ConnectionsRepository = __decorate([
|
|
@@ -1,31 +1,66 @@
|
|
|
1
1
|
import { EnvironmentsService } from '../environments/environments.service.js';
|
|
2
|
-
import {
|
|
2
|
+
import { IntegrationRegistry } from '../integrations/integration.registry.js';
|
|
3
|
+
import { ProviderStore } from '../integrations/provider-store.js';
|
|
4
|
+
import { ConnectionsRepository } from './connections.repository.js';
|
|
3
5
|
export interface ListConnectionsFilters {
|
|
4
|
-
|
|
6
|
+
provider?: string;
|
|
5
7
|
configurationId?: string;
|
|
8
|
+
configurationSlug?: string;
|
|
9
|
+
externalUserId?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A connection as a client sees it. Never carries a credential.
|
|
13
|
+
*
|
|
14
|
+
* `id` is the `account` row, which the provider's connection row is keyed on.
|
|
15
|
+
* `accountId` is the person's id at the provider. `scopes` is what the person
|
|
16
|
+
* granted, and is empty when the provider reported nothing.
|
|
17
|
+
*/
|
|
18
|
+
export interface DescribedConnection {
|
|
19
|
+
id: string;
|
|
20
|
+
provider: string;
|
|
21
|
+
configurationId: string;
|
|
22
|
+
configurationSlug: string;
|
|
23
|
+
externalUserId: string;
|
|
24
|
+
accountId: string;
|
|
25
|
+
scopes: string[];
|
|
26
|
+
metadata: unknown;
|
|
27
|
+
accessTokenExpiresAt: Date | null;
|
|
28
|
+
refreshTokenExpiresAt: Date | null;
|
|
29
|
+
createdAt: Date;
|
|
30
|
+
updatedAt: Date;
|
|
6
31
|
}
|
|
7
32
|
export declare class ConnectionsService {
|
|
8
33
|
private readonly connections;
|
|
34
|
+
private readonly store;
|
|
35
|
+
private readonly registry;
|
|
9
36
|
private readonly environments;
|
|
10
|
-
constructor(connections: ConnectionsRepository, environments: EnvironmentsService);
|
|
11
|
-
list(organizationId: string, environmentId: string, filters?: ListConnectionsFilters): Promise<
|
|
12
|
-
get(organizationId: string, environmentId: string, id: string): Promise<
|
|
13
|
-
|
|
14
|
-
* Deletes the credential. The row is the credential, so there is no history
|
|
15
|
-
* to preserve by keeping it — only ciphertext nobody can use.
|
|
16
|
-
*/
|
|
17
|
-
revoke(organizationId: string, environmentId: string, id: string): Promise<{
|
|
37
|
+
constructor(connections: ConnectionsRepository, store: ProviderStore, registry: IntegrationRegistry, environments: EnvironmentsService);
|
|
38
|
+
list(organizationId: string, environmentId: string, filters?: ListConnectionsFilters): Promise<DescribedConnection[]>;
|
|
39
|
+
get(organizationId: string, environmentId: string, provider: string, id: string): Promise<DescribedConnection>;
|
|
40
|
+
revoke(organizationId: string, environmentId: string, provider: string, id: string): Promise<{
|
|
18
41
|
id: string;
|
|
42
|
+
provider: string;
|
|
19
43
|
revoked: true;
|
|
20
44
|
}>;
|
|
21
|
-
listForMember(organizationId: string, userId: string, environmentId: string, filters?: ListConnectionsFilters): Promise<
|
|
22
|
-
getForMember(organizationId: string, userId: string, environmentId: string, id: string): Promise<
|
|
23
|
-
revokeForMember(organizationId: string, userId: string, environmentId: string, id: string): Promise<{
|
|
45
|
+
listForMember(organizationId: string, userId: string, environmentId: string, filters?: ListConnectionsFilters): Promise<DescribedConnection[]>;
|
|
46
|
+
getForMember(organizationId: string, userId: string, environmentId: string, provider: string, id: string): Promise<DescribedConnection>;
|
|
47
|
+
revokeForMember(organizationId: string, userId: string, environmentId: string, provider: string, id: string): Promise<{
|
|
24
48
|
id: string;
|
|
49
|
+
provider: string;
|
|
25
50
|
revoked: true;
|
|
26
51
|
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Every connection in an environment, across every installed provider.
|
|
54
|
+
*
|
|
55
|
+
* Kosha owns no table that lists them, so this asks each provider in turn
|
|
56
|
+
* and merges newest first. A provider filter asks only that one.
|
|
57
|
+
*/
|
|
27
58
|
private listIn;
|
|
28
59
|
private getIn;
|
|
60
|
+
/**
|
|
61
|
+
* Deletes the credential. The row is the credential, so there is no history
|
|
62
|
+
* to preserve by keeping it — only ciphertext nobody can use.
|
|
63
|
+
*/
|
|
29
64
|
private revokeIn;
|
|
30
65
|
}
|
|
31
66
|
//# sourceMappingURL=connections.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connections.service.d.ts","sourceRoot":"","sources":["../../src/connections/connections.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connections.service.d.ts","sourceRoot":"","sources":["../../src/connections/connections.service.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EACL,aAAa,EAGd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,qBAAqB,EAEtB,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,oBAAoB,EAAE,IAAI,GAAG,IAAI,CAAC;IAClC,qBAAqB,EAAE,IAAI,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,qBACa,kBAAkB;IAE3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAHZ,WAAW,EAAE,qBAAqB,EAClC,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,mBAAmB,EAC7B,YAAY,EAAE,mBAAmB;IAgB9C,IAAI,CACR,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAQ3B,GAAG,CACP,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,mBAAmB,CAAC;IAQzB,MAAM,CACV,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM;;;;;IASN,aAAa,CACjB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAS3B,YAAY,CAChB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,mBAAmB,CAAC;IASzB,eAAe,CACnB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM;;;;;IAUZ;;;;;OAKG;YACW,MAAM;YAwEN,KAAK;IAmCnB;;;OAGG;YACW,QAAQ;CASvB"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { Injectable, NotFoundException } from '@nestjs/common';
|
|
3
|
+
import { derivedEmail, externalUserIdOf, } from '../connect/connect.repository.js';
|
|
3
4
|
import { EnvironmentsService } from '../environments/environments.service.js';
|
|
5
|
+
import { IntegrationRegistry } from '../integrations/integration.registry.js';
|
|
6
|
+
import { ProviderStore, } from '../integrations/provider-store.js';
|
|
4
7
|
import { ConnectionsRepository, } from './connections.repository.js';
|
|
5
8
|
let ConnectionsService = class ConnectionsService {
|
|
6
9
|
connections;
|
|
10
|
+
store;
|
|
11
|
+
registry;
|
|
7
12
|
environments;
|
|
8
|
-
constructor(connections, environments) {
|
|
13
|
+
constructor(connections, store, registry, environments) {
|
|
9
14
|
this.connections = connections;
|
|
15
|
+
this.store = store;
|
|
16
|
+
this.registry = registry;
|
|
10
17
|
this.environments = environments;
|
|
11
18
|
}
|
|
12
19
|
/*
|
|
@@ -22,53 +29,125 @@ let ConnectionsService = class ConnectionsService {
|
|
|
22
29
|
* argument happened to be passed.
|
|
23
30
|
*/
|
|
24
31
|
async list(organizationId, environmentId, filters = {}) {
|
|
25
|
-
await this.environments.get(organizationId, environmentId);
|
|
26
|
-
return this.listIn(
|
|
32
|
+
const environment = await this.environments.get(organizationId, environmentId);
|
|
33
|
+
return this.listIn(environment, filters);
|
|
27
34
|
}
|
|
28
|
-
async get(organizationId, environmentId, id) {
|
|
29
|
-
await this.environments.get(organizationId, environmentId);
|
|
30
|
-
return this.getIn(
|
|
35
|
+
async get(organizationId, environmentId, provider, id) {
|
|
36
|
+
const environment = await this.environments.get(organizationId, environmentId);
|
|
37
|
+
return this.getIn(environment, provider, id);
|
|
31
38
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*/
|
|
36
|
-
async revoke(organizationId, environmentId, id) {
|
|
37
|
-
await this.get(organizationId, environmentId, id);
|
|
38
|
-
return this.revokeIn(environmentId, id);
|
|
39
|
+
async revoke(organizationId, environmentId, provider, id) {
|
|
40
|
+
const environment = await this.environments.get(organizationId, environmentId);
|
|
41
|
+
return this.revokeIn(environment, provider, id);
|
|
39
42
|
}
|
|
40
43
|
async listForMember(organizationId, userId, environmentId, filters = {}) {
|
|
41
|
-
await this.environments.getForMember(organizationId, userId, environmentId);
|
|
42
|
-
return this.listIn(
|
|
44
|
+
const environment = await this.environments.getForMember(organizationId, userId, environmentId);
|
|
45
|
+
return this.listIn(environment, filters);
|
|
43
46
|
}
|
|
44
|
-
async getForMember(organizationId, userId, environmentId, id) {
|
|
45
|
-
await this.environments.getForMember(organizationId, userId, environmentId);
|
|
46
|
-
return this.getIn(
|
|
47
|
+
async getForMember(organizationId, userId, environmentId, provider, id) {
|
|
48
|
+
const environment = await this.environments.getForMember(organizationId, userId, environmentId);
|
|
49
|
+
return this.getIn(environment, provider, id);
|
|
47
50
|
}
|
|
48
|
-
async revokeForMember(organizationId, userId, environmentId, id) {
|
|
49
|
-
await this.getForMember(organizationId, userId, environmentId
|
|
50
|
-
return this.revokeIn(
|
|
51
|
+
async revokeForMember(organizationId, userId, environmentId, provider, id) {
|
|
52
|
+
const environment = await this.environments.getForMember(organizationId, userId, environmentId);
|
|
53
|
+
return this.revokeIn(environment, provider, id);
|
|
51
54
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Every connection in an environment, across every installed provider.
|
|
57
|
+
*
|
|
58
|
+
* Kosha owns no table that lists them, so this asks each provider in turn
|
|
59
|
+
* and merges newest first. A provider filter asks only that one.
|
|
60
|
+
*/
|
|
61
|
+
async listIn(environment, filters) {
|
|
62
|
+
let userId;
|
|
63
|
+
if (filters.externalUserId) {
|
|
64
|
+
const found = await this.connections.findUserIdByEmail(derivedEmail(environment.slug, filters.externalUserId));
|
|
65
|
+
if (!found)
|
|
66
|
+
return [];
|
|
67
|
+
userId = found;
|
|
68
|
+
}
|
|
69
|
+
const integrations = filters.provider
|
|
70
|
+
? [this.registry.get(filters.provider)]
|
|
71
|
+
: this.registry.list();
|
|
72
|
+
const perProvider = await Promise.all(integrations.map(async (integration) => {
|
|
73
|
+
const configurations = await this.store.listConfigurations(integration, environment.id);
|
|
74
|
+
// A slug that names nothing is an empty listing, not a 404: the caller
|
|
75
|
+
// asked which connections exist for it, and the answer is none.
|
|
76
|
+
let configurationId = filters.configurationId;
|
|
77
|
+
if (!configurationId && filters.configurationSlug) {
|
|
78
|
+
configurationId = configurations.find((configuration) => configuration.slug === filters.configurationSlug)?.id;
|
|
79
|
+
if (!configurationId)
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
const rows = await this.store.listConnections(integration, environment.id, { configurationId, userId });
|
|
83
|
+
return rows.map((connection) => ({
|
|
84
|
+
integration,
|
|
85
|
+
connection,
|
|
86
|
+
configuration: configurations.find((candidate) => candidate.id === connection.configurationId),
|
|
87
|
+
}));
|
|
88
|
+
}));
|
|
89
|
+
const found = perProvider.flat();
|
|
90
|
+
const accounts = await this.connections.findAccounts(found.map(({ connection }) => connection.accountId));
|
|
91
|
+
return found
|
|
92
|
+
.flatMap(({ integration, connection, configuration }) => {
|
|
93
|
+
const account = accounts.find((row) => row.id === connection.accountId);
|
|
94
|
+
return account && configuration
|
|
95
|
+
? [
|
|
96
|
+
describe(environment, integration, connection, configuration, account),
|
|
97
|
+
]
|
|
98
|
+
: [];
|
|
99
|
+
})
|
|
100
|
+
.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
|
|
57
101
|
}
|
|
58
|
-
async getIn(
|
|
59
|
-
const
|
|
102
|
+
async getIn(environment, provider, id) {
|
|
103
|
+
const integration = this.registry.get(provider);
|
|
104
|
+
const connection = await this.store.findConnectionByAccount(integration, environment.id, id);
|
|
60
105
|
if (!connection)
|
|
61
106
|
throw new NotFoundException('Connection not found');
|
|
62
|
-
|
|
107
|
+
const [configuration, [account]] = await Promise.all([
|
|
108
|
+
this.store.findConfigurationById(integration, environment.id, connection.configurationId),
|
|
109
|
+
this.connections.findAccounts([id]),
|
|
110
|
+
]);
|
|
111
|
+
if (!configuration || !account) {
|
|
112
|
+
throw new NotFoundException('Connection not found');
|
|
113
|
+
}
|
|
114
|
+
return describe(environment, integration, connection, configuration, account);
|
|
63
115
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Deletes the credential. The row is the credential, so there is no history
|
|
118
|
+
* to preserve by keeping it — only ciphertext nobody can use.
|
|
119
|
+
*/
|
|
120
|
+
async revokeIn(environment, provider, id) {
|
|
121
|
+
await this.getIn(environment, provider, id);
|
|
122
|
+
await this.connections.deleteAccount(id);
|
|
123
|
+
return { id, provider, revoked: true };
|
|
67
124
|
}
|
|
68
125
|
};
|
|
69
126
|
ConnectionsService = __decorate([
|
|
70
127
|
Injectable(),
|
|
71
128
|
__metadata("design:paramtypes", [ConnectionsRepository,
|
|
129
|
+
ProviderStore,
|
|
130
|
+
IntegrationRegistry,
|
|
72
131
|
EnvironmentsService])
|
|
73
132
|
], ConnectionsService);
|
|
74
133
|
export { ConnectionsService };
|
|
134
|
+
function describe(environment, integration, connection, configuration, account) {
|
|
135
|
+
return {
|
|
136
|
+
id: connection.accountId,
|
|
137
|
+
provider: integration.key,
|
|
138
|
+
configurationId: configuration.id,
|
|
139
|
+
configurationSlug: configuration.slug,
|
|
140
|
+
externalUserId: externalUserIdOf(environment.slug, account.user.email),
|
|
141
|
+
accountId: account.accountId,
|
|
142
|
+
scopes: scopesOf(account.scope),
|
|
143
|
+
metadata: connection.metadata,
|
|
144
|
+
accessTokenExpiresAt: account.accessTokenExpiresAt,
|
|
145
|
+
refreshTokenExpiresAt: account.refreshTokenExpiresAt,
|
|
146
|
+
createdAt: connection.createdAt,
|
|
147
|
+
updatedAt: connection.updatedAt,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/** Providers separate granted scopes with commas or spaces. */
|
|
151
|
+
function scopesOf(scope) {
|
|
152
|
+
return scope ? scope.split(/[\s,]+/).filter(Boolean) : [];
|
|
153
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-connections.dto.d.ts","sourceRoot":"","sources":["../../../src/connections/dto/list-connections.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"list-connections.dto.d.ts","sourceRoot":"","sources":["../../../src/connections/dto/list-connections.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,kBAAkB;IAS7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAOlB,eAAe,CAAC,EAAE,MAAM,CAAC;IAUzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAU3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -2,19 +2,21 @@ import { __decorate, __metadata } from "tslib";
|
|
|
2
2
|
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
3
3
|
import { IsOptional, IsString, MaxLength } from 'class-validator';
|
|
4
4
|
export class ListConnectionsDto {
|
|
5
|
-
|
|
5
|
+
provider;
|
|
6
6
|
configurationId;
|
|
7
|
+
configurationSlug;
|
|
8
|
+
externalUserId;
|
|
7
9
|
}
|
|
8
10
|
__decorate([
|
|
9
11
|
ApiPropertyOptional({
|
|
10
|
-
example: '
|
|
11
|
-
description: 'Only connections
|
|
12
|
+
example: 'github',
|
|
13
|
+
description: 'Only connections to the given provider. Reads that one provider rather than every installed one.',
|
|
12
14
|
}),
|
|
13
15
|
IsOptional(),
|
|
14
16
|
IsString(),
|
|
15
17
|
MaxLength(255),
|
|
16
18
|
__metadata("design:type", String)
|
|
17
|
-
], ListConnectionsDto.prototype, "
|
|
19
|
+
], ListConnectionsDto.prototype, "provider", void 0);
|
|
18
20
|
__decorate([
|
|
19
21
|
ApiPropertyOptional({
|
|
20
22
|
description: 'Only connections to this configuration.',
|
|
@@ -23,3 +25,23 @@ __decorate([
|
|
|
23
25
|
IsString(),
|
|
24
26
|
__metadata("design:type", String)
|
|
25
27
|
], ListConnectionsDto.prototype, "configurationId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
ApiPropertyOptional({
|
|
30
|
+
example: 'github',
|
|
31
|
+
description: 'The same thing by slug, which is what a consuming app already has — it names the slug when it connects and again on every proxy call. Ignored when configurationId is given.',
|
|
32
|
+
}),
|
|
33
|
+
IsOptional(),
|
|
34
|
+
IsString(),
|
|
35
|
+
MaxLength(255),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], ListConnectionsDto.prototype, "configurationSlug", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
ApiPropertyOptional({
|
|
40
|
+
example: 'user_9',
|
|
41
|
+
description: 'Only connections belonging to this person, by the id the consuming app sent. Without it a caller reads every connection in the environment to find one.',
|
|
42
|
+
}),
|
|
43
|
+
IsOptional(),
|
|
44
|
+
IsString(),
|
|
45
|
+
MaxLength(255),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], ListConnectionsDto.prototype, "externalUserId", void 0);
|