@igoruehara/canvas-flow 0.1.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/LICENSE +21 -0
- package/README.md +152 -0
- package/bin/canvas-flow.js +1132 -0
- package/package.json +68 -0
- package/public/assets/index-PCQkqMUe.css +1 -0
- package/public/assets/index-qV8twxcq.js +767 -0
- package/public/index.html +13 -0
- package/server/api-key/api-key-connect-provider.d.ts +104 -0
- package/server/api-key/api-key-connect-provider.js +14 -0
- package/server/api-key/api-key-connect-provider.js.map +1 -0
- package/server/api-key/api-key-constants-model.d.ts +2 -0
- package/server/api-key/api-key-constants-model.js +6 -0
- package/server/api-key/api-key-constants-model.js.map +1 -0
- package/server/api-key/api-key-controller.d.ts +12 -0
- package/server/api-key/api-key-controller.js +86 -0
- package/server/api-key/api-key-controller.js.map +1 -0
- package/server/api-key/api-key-module.d.ts +2 -0
- package/server/api-key/api-key-module.js +27 -0
- package/server/api-key/api-key-module.js.map +1 -0
- package/server/api-key/api-key-schema.d.ts +72 -0
- package/server/api-key/api-key-schema.js +98 -0
- package/server/api-key/api-key-schema.js.map +1 -0
- package/server/api-key/api-key-service.d.ts +45 -0
- package/server/api-key/api-key-service.js +151 -0
- package/server/api-key/api-key-service.js.map +1 -0
- package/server/api-key/dto/create-api-key.dto.d.ts +8 -0
- package/server/api-key/dto/create-api-key.dto.js +7 -0
- package/server/api-key/dto/create-api-key.dto.js.map +1 -0
- package/server/app.module.d.ts +2 -0
- package/server/app.module.js +53 -0
- package/server/app.module.js.map +1 -0
- package/server/auth/auth-connect-provider.d.ts +140 -0
- package/server/auth/auth-connect-provider.js +20 -0
- package/server/auth/auth-connect-provider.js.map +1 -0
- package/server/auth/auth-constants-model.d.ts +4 -0
- package/server/auth/auth-constants-model.js +8 -0
- package/server/auth/auth-constants-model.js.map +1 -0
- package/server/auth/auth-controller.d.ts +25 -0
- package/server/auth/auth-controller.js +96 -0
- package/server/auth/auth-controller.js.map +1 -0
- package/server/auth/auth-module.d.ts +2 -0
- package/server/auth/auth-module.js +26 -0
- package/server/auth/auth-module.js.map +1 -0
- package/server/auth/auth-organization-schema.d.ts +44 -0
- package/server/auth/auth-organization-schema.js +62 -0
- package/server/auth/auth-organization-schema.js.map +1 -0
- package/server/auth/auth-schema.d.ts +56 -0
- package/server/auth/auth-schema.js +77 -0
- package/server/auth/auth-schema.js.map +1 -0
- package/server/auth/auth-service.d.ts +64 -0
- package/server/auth/auth-service.js +343 -0
- package/server/auth/auth-service.js.map +1 -0
- package/server/canvas-flow/canvas-flow-connect-provider.d.ts +278 -0
- package/server/canvas-flow/canvas-flow-connect-provider.js +24 -0
- package/server/canvas-flow/canvas-flow-connect-provider.js.map +1 -0
- package/server/canvas-flow/canvas-flow-constants-model.d.ts +6 -0
- package/server/canvas-flow/canvas-flow-constants-model.js +10 -0
- package/server/canvas-flow/canvas-flow-constants-model.js.map +1 -0
- package/server/canvas-flow/canvas-flow-controller.d.ts +98 -0
- package/server/canvas-flow/canvas-flow-controller.js +423 -0
- package/server/canvas-flow/canvas-flow-controller.js.map +1 -0
- package/server/canvas-flow/canvas-flow-module.d.ts +2 -0
- package/server/canvas-flow/canvas-flow-module.js +27 -0
- package/server/canvas-flow/canvas-flow-module.js.map +1 -0
- package/server/canvas-flow/canvas-flow-schema.d.ts +192 -0
- package/server/canvas-flow/canvas-flow-schema.js +239 -0
- package/server/canvas-flow/canvas-flow-schema.js.map +1 -0
- package/server/canvas-flow/canvas-flow-service.d.ts +250 -0
- package/server/canvas-flow/canvas-flow-service.js +1681 -0
- package/server/canvas-flow/canvas-flow-service.js.map +1 -0
- package/server/canvas-flow/dto/create-canvas-flow.dto.d.ts +11 -0
- package/server/canvas-flow/dto/create-canvas-flow.dto.js +61 -0
- package/server/canvas-flow/dto/create-canvas-flow.dto.js.map +1 -0
- package/server/canvas-flow/dto/update-canvas-flow.dto.d.ts +10 -0
- package/server/canvas-flow/dto/update-canvas-flow.dto.js +56 -0
- package/server/canvas-flow/dto/update-canvas-flow.dto.js.map +1 -0
- package/server/constants-global.d.ts +1 -0
- package/server/constants-global.js +5 -0
- package/server/constants-global.js.map +1 -0
- package/server/database/database.module.d.ts +2 -0
- package/server/database/database.module.js +23 -0
- package/server/database/database.module.js.map +1 -0
- package/server/database/database.providers.d.ts +7 -0
- package/server/database/database.providers.js +26 -0
- package/server/database/database.providers.js.map +1 -0
- package/server/documents/documents-connect-provider.d.ts +140 -0
- package/server/documents/documents-connect-provider.js +14 -0
- package/server/documents/documents-connect-provider.js.map +1 -0
- package/server/documents/documents-constants-model.d.ts +2 -0
- package/server/documents/documents-constants-model.js +6 -0
- package/server/documents/documents-constants-model.js.map +1 -0
- package/server/documents/documents-controller.d.ts +16 -0
- package/server/documents/documents-controller.js +117 -0
- package/server/documents/documents-controller.js.map +1 -0
- package/server/documents/documents-module.d.ts +2 -0
- package/server/documents/documents-module.js +27 -0
- package/server/documents/documents-module.js.map +1 -0
- package/server/documents/documents-schema.d.ts +96 -0
- package/server/documents/documents-schema.js +38 -0
- package/server/documents/documents-schema.js.map +1 -0
- package/server/documents/documents-service.d.ts +164 -0
- package/server/documents/documents-service.js +1417 -0
- package/server/documents/documents-service.js.map +1 -0
- package/server/flow-tag/flow-tag-connect-provider.d.ts +146 -0
- package/server/flow-tag/flow-tag-connect-provider.js +14 -0
- package/server/flow-tag/flow-tag-connect-provider.js.map +1 -0
- package/server/flow-tag/flow-tag-constants-model.d.ts +2 -0
- package/server/flow-tag/flow-tag-constants-model.js +6 -0
- package/server/flow-tag/flow-tag-constants-model.js.map +1 -0
- package/server/flow-tag/flow-tag-module.d.ts +2 -0
- package/server/flow-tag/flow-tag-module.js +24 -0
- package/server/flow-tag/flow-tag-module.js.map +1 -0
- package/server/flow-tag/flow-tag-schema.d.ts +100 -0
- package/server/flow-tag/flow-tag-schema.js +131 -0
- package/server/flow-tag/flow-tag-schema.js.map +1 -0
- package/server/flow-tag/flow-tag-service.d.ts +77 -0
- package/server/flow-tag/flow-tag-service.js +156 -0
- package/server/flow-tag/flow-tag-service.js.map +1 -0
- package/server/health.controller.d.ts +7 -0
- package/server/health.controller.js +33 -0
- package/server/health.controller.js.map +1 -0
- package/server/http-batch/http-batch-controller.d.ts +345 -0
- package/server/http-batch/http-batch-controller.js +40 -0
- package/server/http-batch/http-batch-controller.js.map +1 -0
- package/server/http-batch/http-batch-module.d.ts +2 -0
- package/server/http-batch/http-batch-module.js +25 -0
- package/server/http-batch/http-batch-module.js.map +1 -0
- package/server/http-batch/http-batch-service.d.ts +381 -0
- package/server/http-batch/http-batch-service.js +268 -0
- package/server/http-batch/http-batch-service.js.map +1 -0
- package/server/lambda.d.ts +2 -0
- package/server/lambda.js +115 -0
- package/server/lambda.js.map +1 -0
- package/server/llm/openai-provider.d.ts +8 -0
- package/server/llm/openai-provider.js +256 -0
- package/server/llm/openai-provider.js.map +1 -0
- package/server/main.d.ts +1 -0
- package/server/main.js +80 -0
- package/server/main.js.map +1 -0
- package/server/mcp-oauth/mcp-oauth-connect-provider.d.ts +164 -0
- package/server/mcp-oauth/mcp-oauth-connect-provider.js +14 -0
- package/server/mcp-oauth/mcp-oauth-connect-provider.js.map +1 -0
- package/server/mcp-oauth/mcp-oauth-constants-model.d.ts +2 -0
- package/server/mcp-oauth/mcp-oauth-constants-model.js +6 -0
- package/server/mcp-oauth/mcp-oauth-constants-model.js.map +1 -0
- package/server/mcp-oauth/mcp-oauth-controller.d.ts +66 -0
- package/server/mcp-oauth/mcp-oauth-controller.js +166 -0
- package/server/mcp-oauth/mcp-oauth-controller.js.map +1 -0
- package/server/mcp-oauth/mcp-oauth-module.d.ts +2 -0
- package/server/mcp-oauth/mcp-oauth-module.js +27 -0
- package/server/mcp-oauth/mcp-oauth-module.js.map +1 -0
- package/server/mcp-oauth/mcp-oauth-schema.d.ts +112 -0
- package/server/mcp-oauth/mcp-oauth-schema.js +148 -0
- package/server/mcp-oauth/mcp-oauth-schema.js.map +1 -0
- package/server/mcp-oauth/mcp-oauth-service.d.ts +189 -0
- package/server/mcp-oauth/mcp-oauth-service.js +545 -0
- package/server/mcp-oauth/mcp-oauth-service.js.map +1 -0
- package/server/memory/memory-connect-provider.d.ts +200 -0
- package/server/memory/memory-connect-provider.js +26 -0
- package/server/memory/memory-connect-provider.js.map +1 -0
- package/server/memory/memory-constants-model.d.ts +6 -0
- package/server/memory/memory-constants-model.js +10 -0
- package/server/memory/memory-constants-model.js.map +1 -0
- package/server/memory/memory-controller.d.ts +15 -0
- package/server/memory/memory-controller.js +53 -0
- package/server/memory/memory-controller.js.map +1 -0
- package/server/memory/memory-history-schema.d.ts +48 -0
- package/server/memory/memory-history-schema.js +62 -0
- package/server/memory/memory-history-schema.js.map +1 -0
- package/server/memory/memory-module.d.ts +2 -0
- package/server/memory/memory-module.js +26 -0
- package/server/memory/memory-module.js.map +1 -0
- package/server/memory/memory-schema.d.ts +48 -0
- package/server/memory/memory-schema.js +62 -0
- package/server/memory/memory-schema.js.map +1 -0
- package/server/memory/memory-service.d.ts +134 -0
- package/server/memory/memory-service.js +317 -0
- package/server/memory/memory-service.js.map +1 -0
- package/server/memory/memory-trace-history-schema.d.ts +48 -0
- package/server/memory/memory-trace-history-schema.js +62 -0
- package/server/memory/memory-trace-history-schema.js.map +1 -0
- package/server/observability/observability.d.ts +3 -0
- package/server/observability/observability.js +62 -0
- package/server/observability/observability.js.map +1 -0
- package/server/production-guard.d.ts +9 -0
- package/server/production-guard.js +105 -0
- package/server/production-guard.js.map +1 -0
- package/server/provider-config/provider-config-connect-provider.d.ts +44 -0
- package/server/provider-config/provider-config-connect-provider.js +14 -0
- package/server/provider-config/provider-config-connect-provider.js.map +1 -0
- package/server/provider-config/provider-config-constants-model.d.ts +3 -0
- package/server/provider-config/provider-config-constants-model.js +7 -0
- package/server/provider-config/provider-config-constants-model.js.map +1 -0
- package/server/provider-config/provider-config-controller.d.ts +23 -0
- package/server/provider-config/provider-config-controller.js +80 -0
- package/server/provider-config/provider-config-controller.js.map +1 -0
- package/server/provider-config/provider-config-module.d.ts +2 -0
- package/server/provider-config/provider-config-module.js +27 -0
- package/server/provider-config/provider-config-module.js.map +1 -0
- package/server/provider-config/provider-config-schema.d.ts +32 -0
- package/server/provider-config/provider-config-schema.js +46 -0
- package/server/provider-config/provider-config-schema.js.map +1 -0
- package/server/provider-config/provider-config-service.d.ts +178 -0
- package/server/provider-config/provider-config-service.js +689 -0
- package/server/provider-config/provider-config-service.js.map +1 -0
- package/server/queue/queue-job-connect-provider.d.ts +128 -0
- package/server/queue/queue-job-connect-provider.js +14 -0
- package/server/queue/queue-job-connect-provider.js.map +1 -0
- package/server/queue/queue-job-constants-model.d.ts +2 -0
- package/server/queue/queue-job-constants-model.js +6 -0
- package/server/queue/queue-job-constants-model.js.map +1 -0
- package/server/queue/queue-job-schema.d.ts +88 -0
- package/server/queue/queue-job-schema.js +119 -0
- package/server/queue/queue-job-schema.js.map +1 -0
- package/server/queue/queue-lock-connect-provider.d.ts +44 -0
- package/server/queue/queue-lock-connect-provider.js +14 -0
- package/server/queue/queue-lock-connect-provider.js.map +1 -0
- package/server/queue/queue-lock-constants-model.d.ts +2 -0
- package/server/queue/queue-lock-constants-model.js +6 -0
- package/server/queue/queue-lock-constants-model.js.map +1 -0
- package/server/queue/queue-lock-schema.d.ts +32 -0
- package/server/queue/queue-lock-schema.js +47 -0
- package/server/queue/queue-lock-schema.js.map +1 -0
- package/server/queue/queue-message-dedupe-connect-provider.d.ts +116 -0
- package/server/queue/queue-message-dedupe-connect-provider.js +14 -0
- package/server/queue/queue-message-dedupe-connect-provider.js.map +1 -0
- package/server/queue/queue-message-dedupe-constants-model.d.ts +2 -0
- package/server/queue/queue-message-dedupe-constants-model.js +6 -0
- package/server/queue/queue-message-dedupe-constants-model.js.map +1 -0
- package/server/queue/queue-message-dedupe-schema.d.ts +80 -0
- package/server/queue/queue-message-dedupe-schema.js +108 -0
- package/server/queue/queue-message-dedupe-schema.js.map +1 -0
- package/server/queue/queue-module.d.ts +2 -0
- package/server/queue/queue-module.js +33 -0
- package/server/queue/queue-module.js.map +1 -0
- package/server/queue/queue-rate-limit-connect-provider.d.ts +56 -0
- package/server/queue/queue-rate-limit-connect-provider.js +14 -0
- package/server/queue/queue-rate-limit-connect-provider.js.map +1 -0
- package/server/queue/queue-rate-limit-constants-model.d.ts +2 -0
- package/server/queue/queue-rate-limit-constants-model.js +6 -0
- package/server/queue/queue-rate-limit-constants-model.js.map +1 -0
- package/server/queue/queue-rate-limit-schema.d.ts +40 -0
- package/server/queue/queue-rate-limit-schema.js +57 -0
- package/server/queue/queue-rate-limit-schema.js.map +1 -0
- package/server/queue/sqs-transition-service.d.ts +123 -0
- package/server/queue/sqs-transition-service.js +442 -0
- package/server/queue/sqs-transition-service.js.map +1 -0
- package/server/rag/rag-controller.d.ts +167 -0
- package/server/rag/rag-controller.js +232 -0
- package/server/rag/rag-controller.js.map +1 -0
- package/server/rag/rag-module.d.ts +2 -0
- package/server/rag/rag-module.js +30 -0
- package/server/rag/rag-module.js.map +1 -0
- package/server/rag/rag-service.d.ts +361 -0
- package/server/rag/rag-service.js +2864 -0
- package/server/rag/rag-service.js.map +1 -0
- package/server/runner/flow-templates.d.ts +55 -0
- package/server/runner/flow-templates.js +388 -0
- package/server/runner/flow-templates.js.map +1 -0
- package/server/runner/langgraph-runtime.service.d.ts +77 -0
- package/server/runner/langgraph-runtime.service.js +221 -0
- package/server/runner/langgraph-runtime.service.js.map +1 -0
- package/server/runner/runner-controller.d.ts +1044 -0
- package/server/runner/runner-controller.js +751 -0
- package/server/runner/runner-controller.js.map +1 -0
- package/server/runner/runner-module.d.ts +2 -0
- package/server/runner/runner-module.js +37 -0
- package/server/runner/runner-module.js.map +1 -0
- package/server/runner/runner-queue-processor.d.ts +29 -0
- package/server/runner/runner-queue-processor.js +259 -0
- package/server/runner/runner-queue-processor.js.map +1 -0
- package/server/runner/runner-service.d.ts +1761 -0
- package/server/runner/runner-service.js +14256 -0
- package/server/runner/runner-service.js.map +1 -0
- package/server/scripts/migrate-canvas-flow-versions.d.ts +1 -0
- package/server/scripts/migrate-canvas-flow-versions.js +72 -0
- package/server/scripts/migrate-canvas-flow-versions.js.map +1 -0
- package/server/scripts/migrate-mcp-oauth-user-scope.d.ts +1 -0
- package/server/scripts/migrate-mcp-oauth-user-scope.js +95 -0
- package/server/scripts/migrate-mcp-oauth-user-scope.js.map +1 -0
- package/templates/config.example.json +204 -0
- package/templates/config.production.example.json +206 -0
- package/templates/docker-compose.yml +60 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { Connection } from 'mongoose';
|
|
2
|
+
export declare const connectProviders: {
|
|
3
|
+
provide: string;
|
|
4
|
+
useFactory: (connection: Connection) => import("mongoose").Model<{
|
|
5
|
+
key: string;
|
|
6
|
+
status: "error" | "connected" | "pending";
|
|
7
|
+
connectionScope: "user" | "agent";
|
|
8
|
+
serverUrl: string;
|
|
9
|
+
serverUrlHash: string;
|
|
10
|
+
organizationId?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
createdBy?: string;
|
|
13
|
+
agentId?: string;
|
|
14
|
+
updatedBy?: string;
|
|
15
|
+
label?: string;
|
|
16
|
+
state?: string;
|
|
17
|
+
expiresAt?: NativeDate;
|
|
18
|
+
scope?: string;
|
|
19
|
+
redirectUrl?: string;
|
|
20
|
+
authorizationUrl?: string;
|
|
21
|
+
clientInformation?: string;
|
|
22
|
+
tokens?: string;
|
|
23
|
+
codeVerifier?: string;
|
|
24
|
+
discoveryState?: string;
|
|
25
|
+
authenticatedAt?: NativeDate;
|
|
26
|
+
oauthUserId?: string;
|
|
27
|
+
clientMetadata?: any;
|
|
28
|
+
} & import("mongoose").DefaultTimestampProps, {}, {}, {}, import("mongoose").Document<unknown, {}, {
|
|
29
|
+
key: string;
|
|
30
|
+
status: "error" | "connected" | "pending";
|
|
31
|
+
connectionScope: "user" | "agent";
|
|
32
|
+
serverUrl: string;
|
|
33
|
+
serverUrlHash: string;
|
|
34
|
+
organizationId?: string;
|
|
35
|
+
error?: string;
|
|
36
|
+
createdBy?: string;
|
|
37
|
+
agentId?: string;
|
|
38
|
+
updatedBy?: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
state?: string;
|
|
41
|
+
expiresAt?: NativeDate;
|
|
42
|
+
scope?: string;
|
|
43
|
+
redirectUrl?: string;
|
|
44
|
+
authorizationUrl?: string;
|
|
45
|
+
clientInformation?: string;
|
|
46
|
+
tokens?: string;
|
|
47
|
+
codeVerifier?: string;
|
|
48
|
+
discoveryState?: string;
|
|
49
|
+
authenticatedAt?: NativeDate;
|
|
50
|
+
oauthUserId?: string;
|
|
51
|
+
clientMetadata?: any;
|
|
52
|
+
} & import("mongoose").DefaultTimestampProps, {}, {}> & {
|
|
53
|
+
key: string;
|
|
54
|
+
status: "error" | "connected" | "pending";
|
|
55
|
+
connectionScope: "user" | "agent";
|
|
56
|
+
serverUrl: string;
|
|
57
|
+
serverUrlHash: string;
|
|
58
|
+
organizationId?: string;
|
|
59
|
+
error?: string;
|
|
60
|
+
createdBy?: string;
|
|
61
|
+
agentId?: string;
|
|
62
|
+
updatedBy?: string;
|
|
63
|
+
label?: string;
|
|
64
|
+
state?: string;
|
|
65
|
+
expiresAt?: NativeDate;
|
|
66
|
+
scope?: string;
|
|
67
|
+
redirectUrl?: string;
|
|
68
|
+
authorizationUrl?: string;
|
|
69
|
+
clientInformation?: string;
|
|
70
|
+
tokens?: string;
|
|
71
|
+
codeVerifier?: string;
|
|
72
|
+
discoveryState?: string;
|
|
73
|
+
authenticatedAt?: NativeDate;
|
|
74
|
+
oauthUserId?: string;
|
|
75
|
+
clientMetadata?: any;
|
|
76
|
+
} & import("mongoose").DefaultTimestampProps & {
|
|
77
|
+
_id: import("mongoose").Types.ObjectId;
|
|
78
|
+
} & {
|
|
79
|
+
__v: number;
|
|
80
|
+
}, import("mongoose").Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
81
|
+
collection: string;
|
|
82
|
+
timestamps: true;
|
|
83
|
+
}, {
|
|
84
|
+
key: string;
|
|
85
|
+
status: "error" | "connected" | "pending";
|
|
86
|
+
connectionScope: "user" | "agent";
|
|
87
|
+
serverUrl: string;
|
|
88
|
+
serverUrlHash: string;
|
|
89
|
+
organizationId?: string;
|
|
90
|
+
error?: string;
|
|
91
|
+
createdBy?: string;
|
|
92
|
+
agentId?: string;
|
|
93
|
+
updatedBy?: string;
|
|
94
|
+
label?: string;
|
|
95
|
+
state?: string;
|
|
96
|
+
expiresAt?: NativeDate;
|
|
97
|
+
scope?: string;
|
|
98
|
+
redirectUrl?: string;
|
|
99
|
+
authorizationUrl?: string;
|
|
100
|
+
clientInformation?: string;
|
|
101
|
+
tokens?: string;
|
|
102
|
+
codeVerifier?: string;
|
|
103
|
+
discoveryState?: string;
|
|
104
|
+
authenticatedAt?: NativeDate;
|
|
105
|
+
oauthUserId?: string;
|
|
106
|
+
clientMetadata?: any;
|
|
107
|
+
} & import("mongoose").DefaultTimestampProps, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
108
|
+
key: string;
|
|
109
|
+
status: "error" | "connected" | "pending";
|
|
110
|
+
connectionScope: "user" | "agent";
|
|
111
|
+
serverUrl: string;
|
|
112
|
+
serverUrlHash: string;
|
|
113
|
+
organizationId?: string;
|
|
114
|
+
error?: string;
|
|
115
|
+
createdBy?: string;
|
|
116
|
+
agentId?: string;
|
|
117
|
+
updatedBy?: string;
|
|
118
|
+
label?: string;
|
|
119
|
+
state?: string;
|
|
120
|
+
expiresAt?: NativeDate;
|
|
121
|
+
scope?: string;
|
|
122
|
+
redirectUrl?: string;
|
|
123
|
+
authorizationUrl?: string;
|
|
124
|
+
clientInformation?: string;
|
|
125
|
+
tokens?: string;
|
|
126
|
+
codeVerifier?: string;
|
|
127
|
+
discoveryState?: string;
|
|
128
|
+
authenticatedAt?: NativeDate;
|
|
129
|
+
oauthUserId?: string;
|
|
130
|
+
clientMetadata?: any;
|
|
131
|
+
} & import("mongoose").DefaultTimestampProps>, {}, import("mongoose").MergeType<import("mongoose").DefaultSchemaOptions, {
|
|
132
|
+
collection: string;
|
|
133
|
+
timestamps: true;
|
|
134
|
+
}>> & import("mongoose").FlatRecord<{
|
|
135
|
+
key: string;
|
|
136
|
+
status: "error" | "connected" | "pending";
|
|
137
|
+
connectionScope: "user" | "agent";
|
|
138
|
+
serverUrl: string;
|
|
139
|
+
serverUrlHash: string;
|
|
140
|
+
organizationId?: string;
|
|
141
|
+
error?: string;
|
|
142
|
+
createdBy?: string;
|
|
143
|
+
agentId?: string;
|
|
144
|
+
updatedBy?: string;
|
|
145
|
+
label?: string;
|
|
146
|
+
state?: string;
|
|
147
|
+
expiresAt?: NativeDate;
|
|
148
|
+
scope?: string;
|
|
149
|
+
redirectUrl?: string;
|
|
150
|
+
authorizationUrl?: string;
|
|
151
|
+
clientInformation?: string;
|
|
152
|
+
tokens?: string;
|
|
153
|
+
codeVerifier?: string;
|
|
154
|
+
discoveryState?: string;
|
|
155
|
+
authenticatedAt?: NativeDate;
|
|
156
|
+
oauthUserId?: string;
|
|
157
|
+
clientMetadata?: any;
|
|
158
|
+
} & import("mongoose").DefaultTimestampProps> & {
|
|
159
|
+
_id: import("mongoose").Types.ObjectId;
|
|
160
|
+
} & {
|
|
161
|
+
__v: number;
|
|
162
|
+
}>>;
|
|
163
|
+
inject: string[];
|
|
164
|
+
}[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.connectProviders = void 0;
|
|
4
|
+
const constants_global_1 = require("./../constants-global");
|
|
5
|
+
const mcp_oauth_constants_model_1 = require("./mcp-oauth-constants-model");
|
|
6
|
+
const mcp_oauth_schema_1 = require("./mcp-oauth-schema");
|
|
7
|
+
exports.connectProviders = [
|
|
8
|
+
{
|
|
9
|
+
provide: mcp_oauth_constants_model_1.MODEL_NAME,
|
|
10
|
+
useFactory: (connection) => connection.model(mcp_oauth_constants_model_1.COLLECTION_NAME, mcp_oauth_schema_1.EntitySchema),
|
|
11
|
+
inject: [constants_global_1.STRING_URL_DATABASE_CONNECTION],
|
|
12
|
+
},
|
|
13
|
+
];
|
|
14
|
+
//# sourceMappingURL=mcp-oauth-connect-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-oauth-connect-provider.js","sourceRoot":"","sources":["../../src/mcp-oauth/mcp-oauth-connect-provider.ts"],"names":[],"mappings":";;;AACA,4DAAuE;AACvE,2EAA0E;AAC1E,yDAAkD;AAErC,QAAA,gBAAgB,GAAG;IAC9B;QACE,OAAO,EAAE,sCAAU;QACnB,UAAU,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,2CAAe,EAAE,+BAAY,CAAC;QACvF,MAAM,EAAE,CAAC,iDAA8B,CAAC;KACzC;CACF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COLLECTION_NAME = exports.MODEL_NAME = void 0;
|
|
4
|
+
exports.MODEL_NAME = 'CANVAS_MCP_OAUTH_CONNECTION_MODEL';
|
|
5
|
+
exports.COLLECTION_NAME = 'canvas_mcp_oauth_connections';
|
|
6
|
+
//# sourceMappingURL=mcp-oauth-constants-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-oauth-constants-model.js","sourceRoot":"","sources":["../../src/mcp-oauth/mcp-oauth-constants-model.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,mCAAmC,CAAC;AACjD,QAAA,eAAe,GAAG,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { AuthService } from '../auth/auth-service';
|
|
2
|
+
import { McpOAuthService } from './mcp-oauth-service';
|
|
3
|
+
export declare class McpOAuthController {
|
|
4
|
+
private readonly service;
|
|
5
|
+
private readonly authService;
|
|
6
|
+
constructor(service: McpOAuthService, authService: AuthService);
|
|
7
|
+
private assertAuth;
|
|
8
|
+
private requestBaseUrl;
|
|
9
|
+
private html;
|
|
10
|
+
start(body: any, req: any, authorization?: string, headerToken?: string, xApiKey?: string): Promise<{
|
|
11
|
+
connected: boolean;
|
|
12
|
+
status: "error" | "connected" | "pending";
|
|
13
|
+
serverUrl: any;
|
|
14
|
+
agentId: any;
|
|
15
|
+
organizationId: any;
|
|
16
|
+
connectionScope: import("./mcp-oauth-service").McpOAuthConnectionScope;
|
|
17
|
+
label: any;
|
|
18
|
+
scope: any;
|
|
19
|
+
authorizationUrl: any;
|
|
20
|
+
expiresAt: string;
|
|
21
|
+
authenticatedAt: string;
|
|
22
|
+
updatedAt: string;
|
|
23
|
+
error: any;
|
|
24
|
+
}>;
|
|
25
|
+
status(serverUrl: string, agentId?: string, connectionScope?: 'agent' | 'user', authorization?: string, headerToken?: string, xApiKey?: string): Promise<{
|
|
26
|
+
connected: boolean;
|
|
27
|
+
status: "error" | "connected" | "pending";
|
|
28
|
+
serverUrl: any;
|
|
29
|
+
agentId: any;
|
|
30
|
+
organizationId: any;
|
|
31
|
+
connectionScope: import("./mcp-oauth-service").McpOAuthConnectionScope;
|
|
32
|
+
label: any;
|
|
33
|
+
scope: any;
|
|
34
|
+
authorizationUrl: any;
|
|
35
|
+
expiresAt: string;
|
|
36
|
+
authenticatedAt: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
error: any;
|
|
39
|
+
} | {
|
|
40
|
+
connected: boolean;
|
|
41
|
+
status: string;
|
|
42
|
+
error: string;
|
|
43
|
+
serverUrl?: undefined;
|
|
44
|
+
agentId?: undefined;
|
|
45
|
+
organizationId?: undefined;
|
|
46
|
+
connectionScope?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
connected: false;
|
|
49
|
+
status: "pending";
|
|
50
|
+
serverUrl: string;
|
|
51
|
+
agentId: string;
|
|
52
|
+
organizationId: string;
|
|
53
|
+
connectionScope: import("./mcp-oauth-service").McpOAuthConnectionScope;
|
|
54
|
+
error: string;
|
|
55
|
+
}>;
|
|
56
|
+
disconnect(serverUrl: string, agentId?: string, connectionScope?: 'agent' | 'user', authorization?: string, headerToken?: string, xApiKey?: string): Promise<{
|
|
57
|
+
connected: boolean;
|
|
58
|
+
status: string;
|
|
59
|
+
serverUrl: string;
|
|
60
|
+
agentId: string;
|
|
61
|
+
organizationId: string;
|
|
62
|
+
connectionScope: import("./mcp-oauth-service").McpOAuthConnectionScope;
|
|
63
|
+
error: string;
|
|
64
|
+
}>;
|
|
65
|
+
callback(state: string, code: string, error: string, res: any): Promise<void>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.McpOAuthController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const auth_service_1 = require("../auth/auth-service");
|
|
19
|
+
const mcp_oauth_service_1 = require("./mcp-oauth-service");
|
|
20
|
+
let McpOAuthController = class McpOAuthController {
|
|
21
|
+
constructor(service, authService) {
|
|
22
|
+
this.service = service;
|
|
23
|
+
this.authService = authService;
|
|
24
|
+
}
|
|
25
|
+
async assertAuth(authorization, headerToken, xApiKey) {
|
|
26
|
+
return await this.authService.assertUiAuth(authorization, headerToken, xApiKey);
|
|
27
|
+
}
|
|
28
|
+
requestBaseUrl(req) {
|
|
29
|
+
const forwardedProto = String(req.headers?.['x-forwarded-proto'] || '').split(',')[0].trim();
|
|
30
|
+
const forwardedHost = String(req.headers?.['x-forwarded-host'] || '').split(',')[0].trim();
|
|
31
|
+
const proto = forwardedProto || req.protocol || 'http';
|
|
32
|
+
const host = forwardedHost || req.get?.('host') || req.headers?.host || '';
|
|
33
|
+
return host ? `${proto}://${host}` : '';
|
|
34
|
+
}
|
|
35
|
+
html(status, message) {
|
|
36
|
+
const safeMessage = String(message || '')
|
|
37
|
+
.replace(/&/g, '&')
|
|
38
|
+
.replace(/</g, '<')
|
|
39
|
+
.replace(/>/g, '>');
|
|
40
|
+
const title = status === 'ok' ? 'OAuth MCP conectado' : 'Falha no OAuth MCP';
|
|
41
|
+
return `<!doctype html>
|
|
42
|
+
<html>
|
|
43
|
+
<head>
|
|
44
|
+
<meta charset="utf-8" />
|
|
45
|
+
<title>${title}</title>
|
|
46
|
+
<style>
|
|
47
|
+
body { font-family: Arial, sans-serif; margin: 32px; color: #0f172a; }
|
|
48
|
+
main { max-width: 560px; margin: 0 auto; border: 1px solid #dbeafe; border-radius: 8px; padding: 20px; }
|
|
49
|
+
h1 { font-size: 20px; margin: 0 0 10px; }
|
|
50
|
+
p { color: #475569; line-height: 1.5; }
|
|
51
|
+
</style>
|
|
52
|
+
</head>
|
|
53
|
+
<body>
|
|
54
|
+
<main>
|
|
55
|
+
<h1>${title}</h1>
|
|
56
|
+
<p>${safeMessage}</p>
|
|
57
|
+
<p>Voce ja pode voltar ao Canvas Flow.</p>
|
|
58
|
+
</main>
|
|
59
|
+
<script>
|
|
60
|
+
if (window.opener) {
|
|
61
|
+
window.opener.postMessage({ type: "canvas-flow-mcp-oauth", status: "${status}" }, "*");
|
|
62
|
+
setTimeout(function () { window.close(); }, 900);
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
65
|
+
</body>
|
|
66
|
+
</html>`;
|
|
67
|
+
}
|
|
68
|
+
async start(body, req, authorization, headerToken, xApiKey) {
|
|
69
|
+
const user = await this.assertAuth(authorization, headerToken, xApiKey);
|
|
70
|
+
return await this.service.startAuthorization({
|
|
71
|
+
serverUrl: body?.serverUrl,
|
|
72
|
+
agentId: body?.agentId,
|
|
73
|
+
organizationId: user?.organizationId || body?.organizationId,
|
|
74
|
+
userId: user?.id,
|
|
75
|
+
connectionScope: body?.connectionScope,
|
|
76
|
+
oauthUserId: user?.id,
|
|
77
|
+
label: body?.label,
|
|
78
|
+
scope: body?.scope,
|
|
79
|
+
clientName: body?.clientName,
|
|
80
|
+
baseUrl: this.requestBaseUrl(req),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
async status(serverUrl, agentId, connectionScope, authorization, headerToken, xApiKey) {
|
|
84
|
+
const user = await this.assertAuth(authorization, headerToken, xApiKey);
|
|
85
|
+
return await this.service.getStatus({
|
|
86
|
+
serverUrl,
|
|
87
|
+
agentId,
|
|
88
|
+
organizationId: user?.organizationId,
|
|
89
|
+
connectionScope,
|
|
90
|
+
oauthUserId: user?.id,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async disconnect(serverUrl, agentId, connectionScope, authorization, headerToken, xApiKey) {
|
|
94
|
+
const user = await this.assertAuth(authorization, headerToken, xApiKey);
|
|
95
|
+
return await this.service.disconnect({
|
|
96
|
+
serverUrl,
|
|
97
|
+
agentId,
|
|
98
|
+
organizationId: user?.organizationId,
|
|
99
|
+
connectionScope,
|
|
100
|
+
oauthUserId: user?.id,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
async callback(state, code, error, res) {
|
|
104
|
+
try {
|
|
105
|
+
await this.service.finishAuthorization({ state, code, error });
|
|
106
|
+
res.status(200).type('html').send(this.html('ok', 'Autorizacao concluida com sucesso.'));
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
const message = err instanceof Error ? err.message : 'Falha ao concluir OAuth.';
|
|
110
|
+
res.status(400).type('html').send(this.html('error', message));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
exports.McpOAuthController = McpOAuthController;
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, common_1.Post)('start'),
|
|
117
|
+
__param(0, (0, common_1.Body)()),
|
|
118
|
+
__param(1, (0, common_1.Req)()),
|
|
119
|
+
__param(2, (0, common_1.Headers)('authorization')),
|
|
120
|
+
__param(3, (0, common_1.Headers)('x-canvas-flow-token')),
|
|
121
|
+
__param(4, (0, common_1.Headers)('x-api-key')),
|
|
122
|
+
__metadata("design:type", Function),
|
|
123
|
+
__metadata("design:paramtypes", [Object, Object, String, String, String]),
|
|
124
|
+
__metadata("design:returntype", Promise)
|
|
125
|
+
], McpOAuthController.prototype, "start", null);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, common_1.Get)('status'),
|
|
128
|
+
__param(0, (0, common_1.Query)('serverUrl')),
|
|
129
|
+
__param(1, (0, common_1.Query)('agentId')),
|
|
130
|
+
__param(2, (0, common_1.Query)('connectionScope')),
|
|
131
|
+
__param(3, (0, common_1.Headers)('authorization')),
|
|
132
|
+
__param(4, (0, common_1.Headers)('x-canvas-flow-token')),
|
|
133
|
+
__param(5, (0, common_1.Headers)('x-api-key')),
|
|
134
|
+
__metadata("design:type", Function),
|
|
135
|
+
__metadata("design:paramtypes", [String, String, String, String, String, String]),
|
|
136
|
+
__metadata("design:returntype", Promise)
|
|
137
|
+
], McpOAuthController.prototype, "status", null);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, common_1.Delete)(),
|
|
140
|
+
__param(0, (0, common_1.Query)('serverUrl')),
|
|
141
|
+
__param(1, (0, common_1.Query)('agentId')),
|
|
142
|
+
__param(2, (0, common_1.Query)('connectionScope')),
|
|
143
|
+
__param(3, (0, common_1.Headers)('authorization')),
|
|
144
|
+
__param(4, (0, common_1.Headers)('x-canvas-flow-token')),
|
|
145
|
+
__param(5, (0, common_1.Headers)('x-api-key')),
|
|
146
|
+
__metadata("design:type", Function),
|
|
147
|
+
__metadata("design:paramtypes", [String, String, String, String, String, String]),
|
|
148
|
+
__metadata("design:returntype", Promise)
|
|
149
|
+
], McpOAuthController.prototype, "disconnect", null);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, common_1.Get)('callback'),
|
|
152
|
+
__param(0, (0, common_1.Query)('state')),
|
|
153
|
+
__param(1, (0, common_1.Query)('code')),
|
|
154
|
+
__param(2, (0, common_1.Query)('error')),
|
|
155
|
+
__param(3, (0, common_1.Res)()),
|
|
156
|
+
__metadata("design:type", Function),
|
|
157
|
+
__metadata("design:paramtypes", [String, String, String, Object]),
|
|
158
|
+
__metadata("design:returntype", Promise)
|
|
159
|
+
], McpOAuthController.prototype, "callback", null);
|
|
160
|
+
exports.McpOAuthController = McpOAuthController = __decorate([
|
|
161
|
+
(0, swagger_1.ApiTags)('mcp-oauth'),
|
|
162
|
+
(0, common_1.Controller)('api/mcp-oauth'),
|
|
163
|
+
__metadata("design:paramtypes", [mcp_oauth_service_1.McpOAuthService,
|
|
164
|
+
auth_service_1.AuthService])
|
|
165
|
+
], McpOAuthController);
|
|
166
|
+
//# sourceMappingURL=mcp-oauth-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-oauth-controller.js","sourceRoot":"","sources":["../../src/mcp-oauth/mcp-oauth-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+F;AAC/F,6CAA0C;AAC1C,uDAAmD;AACnD,2DAAsD;AAI/C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACmB,OAAwB,EACxB,WAAwB;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
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.McpOAuthModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const auth_module_1 = require("../auth/auth-module");
|
|
12
|
+
const database_module_1 = require("../database/database.module");
|
|
13
|
+
const mcp_oauth_connect_provider_1 = require("./mcp-oauth-connect-provider");
|
|
14
|
+
const mcp_oauth_controller_1 = require("./mcp-oauth-controller");
|
|
15
|
+
const mcp_oauth_service_1 = require("./mcp-oauth-service");
|
|
16
|
+
let McpOAuthModule = class McpOAuthModule {
|
|
17
|
+
};
|
|
18
|
+
exports.McpOAuthModule = McpOAuthModule;
|
|
19
|
+
exports.McpOAuthModule = McpOAuthModule = __decorate([
|
|
20
|
+
(0, common_1.Module)({
|
|
21
|
+
imports: [database_module_1.DatabaseModule, auth_module_1.AuthModule],
|
|
22
|
+
controllers: [mcp_oauth_controller_1.McpOAuthController],
|
|
23
|
+
providers: [mcp_oauth_service_1.McpOAuthService, ...mcp_oauth_connect_provider_1.connectProviders],
|
|
24
|
+
exports: [mcp_oauth_service_1.McpOAuthService],
|
|
25
|
+
})
|
|
26
|
+
], McpOAuthModule);
|
|
27
|
+
//# sourceMappingURL=mcp-oauth-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-oauth-module.js","sourceRoot":"","sources":["../../src/mcp-oauth/mcp-oauth-module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,iEAA6D;AAC7D,6EAAgE;AAChE,iEAA4D;AAC5D,2DAAsD;AAQ/C,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAN1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,gCAAc,EAAE,wBAAU,CAAC;QACrC,WAAW,EAAE,CAAC,yCAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,mCAAe,EAAE,GAAG,6CAAgB,CAAC;QACjD,OAAO,EAAE,CAAC,mCAAe,CAAC;KAC3B,CAAC;GACW,cAAc,CAAG"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import * as mongoose from 'mongoose';
|
|
2
|
+
import { Document } from 'mongoose';
|
|
3
|
+
export declare const EntitySchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
4
|
+
collection: string;
|
|
5
|
+
timestamps: true;
|
|
6
|
+
}, {
|
|
7
|
+
key: string;
|
|
8
|
+
status: "error" | "connected" | "pending";
|
|
9
|
+
connectionScope: "user" | "agent";
|
|
10
|
+
serverUrl: string;
|
|
11
|
+
serverUrlHash: string;
|
|
12
|
+
organizationId?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
createdBy?: string;
|
|
15
|
+
agentId?: string;
|
|
16
|
+
updatedBy?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
state?: string;
|
|
19
|
+
expiresAt?: NativeDate;
|
|
20
|
+
scope?: string;
|
|
21
|
+
redirectUrl?: string;
|
|
22
|
+
authorizationUrl?: string;
|
|
23
|
+
clientInformation?: string;
|
|
24
|
+
tokens?: string;
|
|
25
|
+
codeVerifier?: string;
|
|
26
|
+
discoveryState?: string;
|
|
27
|
+
authenticatedAt?: NativeDate;
|
|
28
|
+
oauthUserId?: string;
|
|
29
|
+
clientMetadata?: any;
|
|
30
|
+
} & mongoose.DefaultTimestampProps, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
31
|
+
key: string;
|
|
32
|
+
status: "error" | "connected" | "pending";
|
|
33
|
+
connectionScope: "user" | "agent";
|
|
34
|
+
serverUrl: string;
|
|
35
|
+
serverUrlHash: string;
|
|
36
|
+
organizationId?: string;
|
|
37
|
+
error?: string;
|
|
38
|
+
createdBy?: string;
|
|
39
|
+
agentId?: string;
|
|
40
|
+
updatedBy?: string;
|
|
41
|
+
label?: string;
|
|
42
|
+
state?: string;
|
|
43
|
+
expiresAt?: NativeDate;
|
|
44
|
+
scope?: string;
|
|
45
|
+
redirectUrl?: string;
|
|
46
|
+
authorizationUrl?: string;
|
|
47
|
+
clientInformation?: string;
|
|
48
|
+
tokens?: string;
|
|
49
|
+
codeVerifier?: string;
|
|
50
|
+
discoveryState?: string;
|
|
51
|
+
authenticatedAt?: NativeDate;
|
|
52
|
+
oauthUserId?: string;
|
|
53
|
+
clientMetadata?: any;
|
|
54
|
+
} & mongoose.DefaultTimestampProps>, {}, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
|
|
55
|
+
collection: string;
|
|
56
|
+
timestamps: true;
|
|
57
|
+
}>> & mongoose.FlatRecord<{
|
|
58
|
+
key: string;
|
|
59
|
+
status: "error" | "connected" | "pending";
|
|
60
|
+
connectionScope: "user" | "agent";
|
|
61
|
+
serverUrl: string;
|
|
62
|
+
serverUrlHash: string;
|
|
63
|
+
organizationId?: string;
|
|
64
|
+
error?: string;
|
|
65
|
+
createdBy?: string;
|
|
66
|
+
agentId?: string;
|
|
67
|
+
updatedBy?: string;
|
|
68
|
+
label?: string;
|
|
69
|
+
state?: string;
|
|
70
|
+
expiresAt?: NativeDate;
|
|
71
|
+
scope?: string;
|
|
72
|
+
redirectUrl?: string;
|
|
73
|
+
authorizationUrl?: string;
|
|
74
|
+
clientInformation?: string;
|
|
75
|
+
tokens?: string;
|
|
76
|
+
codeVerifier?: string;
|
|
77
|
+
discoveryState?: string;
|
|
78
|
+
authenticatedAt?: NativeDate;
|
|
79
|
+
oauthUserId?: string;
|
|
80
|
+
clientMetadata?: any;
|
|
81
|
+
} & mongoose.DefaultTimestampProps> & {
|
|
82
|
+
_id: mongoose.Types.ObjectId;
|
|
83
|
+
} & {
|
|
84
|
+
__v: number;
|
|
85
|
+
}>;
|
|
86
|
+
export declare class CanvasMcpOAuthConnectionEntity extends Document {
|
|
87
|
+
key: string;
|
|
88
|
+
organizationId?: string;
|
|
89
|
+
agentId?: string;
|
|
90
|
+
connectionScope?: 'agent' | 'user';
|
|
91
|
+
oauthUserId?: string;
|
|
92
|
+
serverUrl: string;
|
|
93
|
+
serverUrlHash: string;
|
|
94
|
+
label?: string;
|
|
95
|
+
scope?: string;
|
|
96
|
+
redirectUrl?: string;
|
|
97
|
+
state?: string;
|
|
98
|
+
authorizationUrl?: string;
|
|
99
|
+
status: 'pending' | 'connected' | 'error';
|
|
100
|
+
error?: string;
|
|
101
|
+
clientMetadata?: Record<string, any>;
|
|
102
|
+
clientInformation?: string;
|
|
103
|
+
tokens?: string;
|
|
104
|
+
codeVerifier?: string;
|
|
105
|
+
discoveryState?: string;
|
|
106
|
+
expiresAt?: Date;
|
|
107
|
+
authenticatedAt?: Date;
|
|
108
|
+
createdBy?: string;
|
|
109
|
+
updatedBy?: string;
|
|
110
|
+
createdAt: Date;
|
|
111
|
+
updatedAt: Date;
|
|
112
|
+
}
|