@mugwork/mug 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 +251 -0
- package/dist/explorer.js +3 -0
- package/dist/packages/email-template/src/email-template.d.ts +18 -0
- package/dist/packages/email-template/src/email-template.js +74 -0
- package/dist/packages/email-template/src/index.d.ts +1 -0
- package/dist/packages/email-template/src/index.js +1 -0
- package/dist/packages/surface-renderer/src/form-renderer.d.ts +117 -0
- package/dist/packages/surface-renderer/src/form-renderer.js +719 -0
- package/dist/packages/surface-renderer/src/index.d.ts +4 -0
- package/dist/packages/surface-renderer/src/index.js +2 -0
- package/dist/packages/surface-renderer/src/portal-renderer.d.ts +177 -0
- package/dist/packages/surface-renderer/src/portal-renderer.js +1089 -0
- package/dist/packages/surface-renderer/src/workspace-home.d.ts +46 -0
- package/dist/packages/surface-renderer/src/workspace-home.js +345 -0
- package/dist/runtime/agent-types.d.ts +48 -0
- package/dist/runtime/agent-types.js +3 -0
- package/dist/runtime/ai-router.d.ts +32 -0
- package/dist/runtime/ai-router.js +112 -0
- package/dist/runtime/app.d.ts +6 -0
- package/dist/runtime/app.js +399 -0
- package/dist/runtime/chunker.d.ts +6 -0
- package/dist/runtime/chunker.js +30 -0
- package/dist/runtime/context.d.ts +115 -0
- package/dist/runtime/context.js +440 -0
- package/dist/runtime/do/workspace-database.d.ts +10 -0
- package/dist/runtime/do/workspace-database.js +199 -0
- package/dist/runtime/form-types.d.ts +143 -0
- package/dist/runtime/form-types.js +1 -0
- package/dist/runtime/runtime.d.ts +9 -0
- package/dist/runtime/runtime.js +7 -0
- package/dist/runtime/source-types.d.ts +15 -0
- package/dist/runtime/source-types.js +1 -0
- package/dist/runtime/source.d.ts +70 -0
- package/dist/runtime/source.js +21 -0
- package/dist/runtime/sync-runtime.d.ts +10 -0
- package/dist/runtime/sync-runtime.js +185 -0
- package/dist/runtime/types.d.ts +21 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/workflow-entrypoint.d.ts +31 -0
- package/dist/runtime/workflow-entrypoint.js +1297 -0
- package/dist/runtime/workflow.d.ts +285 -0
- package/dist/runtime/workflow.js +1008 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +44116 -0
- package/dist/src/commands/ai-gateway-route.d.ts +24 -0
- package/dist/src/commands/ai-gateway-route.js +192 -0
- package/dist/src/commands/auth.d.ts +1 -0
- package/dist/src/commands/auth.js +42 -0
- package/dist/src/commands/billing.d.ts +6 -0
- package/dist/src/commands/billing.js +76 -0
- package/dist/src/commands/brain.d.ts +1 -0
- package/dist/src/commands/brain.js +194 -0
- package/dist/src/commands/demo.d.ts +12 -0
- package/dist/src/commands/demo.js +147 -0
- package/dist/src/commands/deploy.d.ts +1 -0
- package/dist/src/commands/deploy.js +1052 -0
- package/dist/src/commands/dev.d.ts +14 -0
- package/dist/src/commands/dev.js +2818 -0
- package/dist/src/commands/form.d.ts +8 -0
- package/dist/src/commands/form.js +396 -0
- package/dist/src/commands/init.d.ts +1 -0
- package/dist/src/commands/init.js +139 -0
- package/dist/src/commands/issue.d.ts +7 -0
- package/dist/src/commands/issue.js +191 -0
- package/dist/src/commands/login.d.ts +9 -0
- package/dist/src/commands/login.js +163 -0
- package/dist/src/commands/logs.d.ts +8 -0
- package/dist/src/commands/logs.js +113 -0
- package/dist/src/commands/portal.d.ts +2 -0
- package/dist/src/commands/portal.js +111 -0
- package/dist/src/commands/pull.d.ts +3 -0
- package/dist/src/commands/pull.js +184 -0
- package/dist/src/commands/push.d.ts +4 -0
- package/dist/src/commands/push.js +183 -0
- package/dist/src/commands/run.d.ts +6 -0
- package/dist/src/commands/run.js +91 -0
- package/dist/src/commands/secret.d.ts +7 -0
- package/dist/src/commands/secret.js +105 -0
- package/dist/src/commands/shutdown.d.ts +1 -0
- package/dist/src/commands/shutdown.js +46 -0
- package/dist/src/commands/sql.d.ts +8 -0
- package/dist/src/commands/sql.js +142 -0
- package/dist/src/commands/status.d.ts +5 -0
- package/dist/src/commands/status.js +39 -0
- package/dist/src/commands/sync.d.ts +7 -0
- package/dist/src/commands/sync.js +991 -0
- package/dist/src/commands/usage.d.ts +6 -0
- package/dist/src/commands/usage.js +78 -0
- package/dist/src/commands/webhooks.d.ts +1 -0
- package/dist/src/commands/webhooks.js +102 -0
- package/dist/src/commands/workspace.d.ts +23 -0
- package/dist/src/commands/workspace.js +590 -0
- package/dist/src/connector-migration.d.ts +20 -0
- package/dist/src/connector-migration.js +43 -0
- package/dist/src/connector-parser.d.ts +14 -0
- package/dist/src/connector-parser.js +94 -0
- package/dist/src/connector-service/discover.d.ts +37 -0
- package/dist/src/connector-service/discover.js +79 -0
- package/dist/src/connector-service/gather.d.ts +22 -0
- package/dist/src/connector-service/gather.js +89 -0
- package/dist/src/connector-service/init.d.ts +14 -0
- package/dist/src/connector-service/init.js +109 -0
- package/dist/src/connector-service/scaffold.d.ts +17 -0
- package/dist/src/connector-service/scaffold.js +194 -0
- package/dist/src/connector-service/spec-storage.d.ts +8 -0
- package/dist/src/connector-service/spec-storage.js +48 -0
- package/dist/src/connector-service/types.d.ts +57 -0
- package/dist/src/connector-service/types.js +2 -0
- package/dist/src/connector-service/verify.d.ts +24 -0
- package/dist/src/connector-service/verify.js +575 -0
- package/dist/src/email-template.d.ts +2 -0
- package/dist/src/email-template.js +1 -0
- package/dist/src/manifest.d.ts +31 -0
- package/dist/src/manifest.js +25 -0
- package/dist/src/mug-icon.d.ts +1 -0
- package/dist/src/mug-icon.js +12 -0
- package/dist/src/slack-manifest.d.ts +119 -0
- package/dist/src/slack-manifest.js +163 -0
- package/dist/src/source-migration.d.ts +20 -0
- package/dist/src/source-migration.js +43 -0
- package/dist/src/surface-renderer.d.ts +5 -0
- package/dist/src/surface-renderer.js +3 -0
- package/dist/src/templates.d.ts +3 -0
- package/dist/src/templates.js +48 -0
- package/dist/src/version-check.d.ts +1 -0
- package/dist/src/version-check.js +28 -0
- package/dist/src/workflow-parser.d.ts +95 -0
- package/dist/src/workflow-parser.js +526 -0
- package/dist/worker/src/agent-types.d.ts +27 -0
- package/dist/worker/src/agent-types.js +3 -0
- package/dist/worker/src/source-types.d.ts +14 -0
- package/dist/worker/src/source-types.js +1 -0
- package/package.json +90 -0
- package/src/data/model-capabilities.json +171 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export interface SlackJsonConfig {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
name?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
botName?: string;
|
|
7
|
+
homeTab?: {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
sections?: unknown[];
|
|
10
|
+
};
|
|
11
|
+
messagesTab?: boolean;
|
|
12
|
+
shortcuts?: {
|
|
13
|
+
name: string;
|
|
14
|
+
callbackId: string;
|
|
15
|
+
description: string;
|
|
16
|
+
type: "global" | "message";
|
|
17
|
+
workflow?: string;
|
|
18
|
+
}[];
|
|
19
|
+
unfurlDomains?: string[];
|
|
20
|
+
agentView?: {
|
|
21
|
+
description: string;
|
|
22
|
+
suggestedPrompts?: {
|
|
23
|
+
title: string;
|
|
24
|
+
message: string;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
scopes?: string[];
|
|
28
|
+
commands?: Record<string, {
|
|
29
|
+
description: string;
|
|
30
|
+
usage_hint?: string;
|
|
31
|
+
}>;
|
|
32
|
+
events?: string[];
|
|
33
|
+
}
|
|
34
|
+
export interface SlackConfigLegacy {
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
name?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
color?: string;
|
|
39
|
+
scopes?: string[];
|
|
40
|
+
commands?: Record<string, {
|
|
41
|
+
description: string;
|
|
42
|
+
usage_hint?: string;
|
|
43
|
+
}>;
|
|
44
|
+
events?: string[];
|
|
45
|
+
}
|
|
46
|
+
export interface SlackTrigger {
|
|
47
|
+
type: "slack_command" | "slack_event" | "slack_shortcut";
|
|
48
|
+
command?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
usage_hint?: string;
|
|
51
|
+
event?: string;
|
|
52
|
+
name?: string;
|
|
53
|
+
callback_id?: string;
|
|
54
|
+
}
|
|
55
|
+
interface SlackManifest {
|
|
56
|
+
_metadata: {
|
|
57
|
+
major_version: number;
|
|
58
|
+
minor_version: number;
|
|
59
|
+
};
|
|
60
|
+
display_information: {
|
|
61
|
+
name: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
background_color?: string;
|
|
64
|
+
};
|
|
65
|
+
features: {
|
|
66
|
+
app_home?: {
|
|
67
|
+
home_tab_enabled?: boolean;
|
|
68
|
+
messages_tab_enabled?: boolean;
|
|
69
|
+
messages_tab_read_only_enabled?: boolean;
|
|
70
|
+
};
|
|
71
|
+
bot_user: {
|
|
72
|
+
display_name: string;
|
|
73
|
+
always_online: boolean;
|
|
74
|
+
};
|
|
75
|
+
slash_commands?: {
|
|
76
|
+
command: string;
|
|
77
|
+
description: string;
|
|
78
|
+
usage_hint?: string;
|
|
79
|
+
url: string;
|
|
80
|
+
}[];
|
|
81
|
+
shortcuts?: {
|
|
82
|
+
name: string;
|
|
83
|
+
callback_id: string;
|
|
84
|
+
description: string;
|
|
85
|
+
type: "global" | "message";
|
|
86
|
+
}[];
|
|
87
|
+
unfurl_domains?: string[];
|
|
88
|
+
agent_view?: {
|
|
89
|
+
agent_description: string;
|
|
90
|
+
suggested_prompts?: {
|
|
91
|
+
title: string;
|
|
92
|
+
message: string;
|
|
93
|
+
}[];
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
oauth_config: {
|
|
97
|
+
scopes: {
|
|
98
|
+
bot: string[];
|
|
99
|
+
};
|
|
100
|
+
redirect_urls: string[];
|
|
101
|
+
};
|
|
102
|
+
settings: {
|
|
103
|
+
event_subscriptions?: {
|
|
104
|
+
request_url: string;
|
|
105
|
+
bot_events: string[];
|
|
106
|
+
};
|
|
107
|
+
interactivity?: {
|
|
108
|
+
is_enabled: boolean;
|
|
109
|
+
request_url: string;
|
|
110
|
+
};
|
|
111
|
+
org_deploy_enabled: boolean;
|
|
112
|
+
socket_mode_enabled: boolean;
|
|
113
|
+
token_rotation_enabled: boolean;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export declare function generateSlackManifest(workspaceName: string, slack: SlackJsonConfig, inbound?: Record<string, string>, workflowTriggers?: Record<string, SlackTrigger>): SlackManifest;
|
|
117
|
+
export declare function legacyToSlackJson(legacy: SlackConfigLegacy): SlackJsonConfig;
|
|
118
|
+
export declare function generateManifestUrl(manifest: SlackManifest): string;
|
|
119
|
+
export {};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
export function generateSlackManifest(workspaceName, slack, inbound, workflowTriggers) {
|
|
2
|
+
const appName = slack.name ?? titleCase(workspaceName);
|
|
3
|
+
const botName = slack.botName ?? appName;
|
|
4
|
+
const baseUrl = `https://api.mug.work`;
|
|
5
|
+
const interactivityUrl = `${baseUrl}/inbound/slack/${workspaceName}`;
|
|
6
|
+
const eventsUrl = `${baseUrl}/inbound/slack/${workspaceName}`;
|
|
7
|
+
const scopes = new Set(slack.scopes ?? []);
|
|
8
|
+
scopes.add("chat:write");
|
|
9
|
+
// Scope inference from explicit commands
|
|
10
|
+
if (slack.commands && Object.keys(slack.commands).length > 0) {
|
|
11
|
+
scopes.add("commands");
|
|
12
|
+
}
|
|
13
|
+
if (slack.events?.some((e) => e.startsWith("message"))) {
|
|
14
|
+
scopes.add("channels:history");
|
|
15
|
+
scopes.add("groups:history");
|
|
16
|
+
}
|
|
17
|
+
if (inbound?.slack) {
|
|
18
|
+
scopes.add("commands");
|
|
19
|
+
}
|
|
20
|
+
// Scope inference from slack.json features
|
|
21
|
+
if (slack.homeTab?.enabled) {
|
|
22
|
+
scopes.add("users:read");
|
|
23
|
+
scopes.add("users:read.email");
|
|
24
|
+
}
|
|
25
|
+
if (slack.shortcuts && slack.shortcuts.length > 0) {
|
|
26
|
+
scopes.add("commands");
|
|
27
|
+
}
|
|
28
|
+
if (slack.messagesTab) {
|
|
29
|
+
scopes.add("im:history");
|
|
30
|
+
}
|
|
31
|
+
if (slack.unfurlDomains && slack.unfurlDomains.length > 0) {
|
|
32
|
+
scopes.add("links:read");
|
|
33
|
+
scopes.add("links:write");
|
|
34
|
+
}
|
|
35
|
+
if (slack.agentView) {
|
|
36
|
+
scopes.add("assistant:write");
|
|
37
|
+
}
|
|
38
|
+
// Merge explicit commands with workflow-derived commands
|
|
39
|
+
const allCommands = [];
|
|
40
|
+
if (slack.commands) {
|
|
41
|
+
for (const [cmd, cfg] of Object.entries(slack.commands)) {
|
|
42
|
+
allCommands.push({
|
|
43
|
+
command: cmd.startsWith("/") ? cmd : `/${cmd}`,
|
|
44
|
+
description: cfg.description,
|
|
45
|
+
usage_hint: cfg.usage_hint,
|
|
46
|
+
url: interactivityUrl,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const allEvents = new Set(slack.events ?? []);
|
|
51
|
+
// Auto-add events from features
|
|
52
|
+
if (slack.homeTab?.enabled) {
|
|
53
|
+
allEvents.add("app_home_opened");
|
|
54
|
+
}
|
|
55
|
+
if (slack.messagesTab) {
|
|
56
|
+
allEvents.add("message.im");
|
|
57
|
+
}
|
|
58
|
+
if (workflowTriggers) {
|
|
59
|
+
for (const [, trigger] of Object.entries(workflowTriggers)) {
|
|
60
|
+
if (trigger.type === "slack_command" && trigger.command) {
|
|
61
|
+
const cmd = trigger.command.startsWith("/") ? trigger.command : `/${trigger.command}`;
|
|
62
|
+
if (!allCommands.some((c) => c.command === cmd)) {
|
|
63
|
+
allCommands.push({
|
|
64
|
+
command: cmd,
|
|
65
|
+
description: trigger.description ?? "Run workflow",
|
|
66
|
+
usage_hint: trigger.usage_hint,
|
|
67
|
+
url: interactivityUrl,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
scopes.add("commands");
|
|
71
|
+
}
|
|
72
|
+
else if (trigger.type === "slack_event" && trigger.event) {
|
|
73
|
+
allEvents.add(trigger.event);
|
|
74
|
+
if (trigger.event.startsWith("message")) {
|
|
75
|
+
scopes.add("channels:history");
|
|
76
|
+
scopes.add("groups:history");
|
|
77
|
+
}
|
|
78
|
+
if (trigger.event === "app_home_opened") {
|
|
79
|
+
scopes.add("users:read");
|
|
80
|
+
scopes.add("users:read.email");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (trigger.type === "slack_shortcut") {
|
|
84
|
+
scopes.add("commands");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const slashCommands = allCommands.length > 0 ? allCommands : undefined;
|
|
89
|
+
// Build features.app_home
|
|
90
|
+
const appHome = (slack.homeTab?.enabled || slack.messagesTab) ? {
|
|
91
|
+
...(slack.homeTab?.enabled ? { home_tab_enabled: true } : {}),
|
|
92
|
+
...(slack.messagesTab ? { messages_tab_enabled: true } : {}),
|
|
93
|
+
} : undefined;
|
|
94
|
+
// Build features.shortcuts from slack.json
|
|
95
|
+
const shortcuts = slack.shortcuts && slack.shortcuts.length > 0
|
|
96
|
+
? slack.shortcuts.map((s) => ({
|
|
97
|
+
name: s.name,
|
|
98
|
+
callback_id: s.callbackId,
|
|
99
|
+
description: s.description,
|
|
100
|
+
type: s.type,
|
|
101
|
+
}))
|
|
102
|
+
: undefined;
|
|
103
|
+
// Build features.unfurl_domains
|
|
104
|
+
const unfurlDomains = slack.unfurlDomains && slack.unfurlDomains.length > 0
|
|
105
|
+
? slack.unfurlDomains.slice(0, 5)
|
|
106
|
+
: undefined;
|
|
107
|
+
if (unfurlDomains) {
|
|
108
|
+
allEvents.add("link_shared");
|
|
109
|
+
}
|
|
110
|
+
// Build features.agent_view
|
|
111
|
+
const agentView = slack.agentView ? {
|
|
112
|
+
agent_description: slack.agentView.description,
|
|
113
|
+
...(slack.agentView.suggestedPrompts ? { suggested_prompts: slack.agentView.suggestedPrompts } : {}),
|
|
114
|
+
} : undefined;
|
|
115
|
+
const manifest = {
|
|
116
|
+
_metadata: { major_version: 2, minor_version: 0 },
|
|
117
|
+
display_information: {
|
|
118
|
+
name: appName,
|
|
119
|
+
...(slack.description ? { description: slack.description } : {}),
|
|
120
|
+
...(slack.color ? { background_color: slack.color } : {}),
|
|
121
|
+
},
|
|
122
|
+
features: {
|
|
123
|
+
...(appHome ? { app_home: appHome } : {}),
|
|
124
|
+
bot_user: { display_name: botName, always_online: true },
|
|
125
|
+
...(slashCommands && slashCommands.length > 0 ? { slash_commands: slashCommands } : {}),
|
|
126
|
+
...(shortcuts ? { shortcuts } : {}),
|
|
127
|
+
...(unfurlDomains ? { unfurl_domains: unfurlDomains } : {}),
|
|
128
|
+
...(agentView ? { agent_view: agentView } : {}),
|
|
129
|
+
},
|
|
130
|
+
oauth_config: {
|
|
131
|
+
scopes: { bot: [...scopes].sort() },
|
|
132
|
+
redirect_urls: [`${baseUrl}/slack/callback`],
|
|
133
|
+
},
|
|
134
|
+
settings: {
|
|
135
|
+
...(allEvents.size > 0
|
|
136
|
+
? { event_subscriptions: { request_url: eventsUrl, bot_events: [...allEvents].sort() } }
|
|
137
|
+
: {}),
|
|
138
|
+
interactivity: { is_enabled: true, request_url: interactivityUrl },
|
|
139
|
+
org_deploy_enabled: false,
|
|
140
|
+
socket_mode_enabled: false,
|
|
141
|
+
token_rotation_enabled: false,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
return manifest;
|
|
145
|
+
}
|
|
146
|
+
export function legacyToSlackJson(legacy) {
|
|
147
|
+
return {
|
|
148
|
+
enabled: legacy.enabled,
|
|
149
|
+
name: legacy.name,
|
|
150
|
+
description: legacy.description,
|
|
151
|
+
color: legacy.color,
|
|
152
|
+
scopes: legacy.scopes,
|
|
153
|
+
commands: legacy.commands,
|
|
154
|
+
events: legacy.events,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
export function generateManifestUrl(manifest) {
|
|
158
|
+
const encoded = encodeURIComponent(JSON.stringify(manifest));
|
|
159
|
+
return `https://api.slack.com/apps?new_app=1&manifest_json=${encoded}`;
|
|
160
|
+
}
|
|
161
|
+
function titleCase(slug) {
|
|
162
|
+
return slug.split("-").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
|
|
163
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SourcesConfig, SourceAuth } from "../worker/src/source-types.js";
|
|
2
|
+
interface OldConnection {
|
|
3
|
+
auth?: SourceAuth;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
}
|
|
6
|
+
interface OldConnector {
|
|
7
|
+
connection?: string;
|
|
8
|
+
database?: string;
|
|
9
|
+
schedule?: string;
|
|
10
|
+
syncSchedule?: string;
|
|
11
|
+
}
|
|
12
|
+
interface MugConfig {
|
|
13
|
+
sources?: SourcesConfig;
|
|
14
|
+
connections?: Record<string, OldConnection>;
|
|
15
|
+
connectors?: Record<string, OldConnector>;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare function migrateConfig(config: MugConfig): SourcesConfig;
|
|
19
|
+
export declare function configNeedsMigration(config: MugConfig): boolean;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export function migrateConfig(config) {
|
|
2
|
+
if (config.sources && !config.connections && !config.connectors) {
|
|
3
|
+
return config.sources;
|
|
4
|
+
}
|
|
5
|
+
if (!config.connections && !config.connectors) {
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
const connections = config.connections ?? {};
|
|
9
|
+
const connectors = config.connectors ?? {};
|
|
10
|
+
const sources = {};
|
|
11
|
+
for (const [name, conn] of Object.entries(connections)) {
|
|
12
|
+
sources[name] = {
|
|
13
|
+
...(conn.auth ? { auth: conn.auth } : {}),
|
|
14
|
+
...(conn.baseUrl ? { baseUrl: conn.baseUrl } : {}),
|
|
15
|
+
syncs: {},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
for (const [connectorName, connector] of Object.entries(connectors)) {
|
|
19
|
+
const schedule = connector.schedule ?? connector.syncSchedule;
|
|
20
|
+
const sync = {
|
|
21
|
+
database: connector.database ?? connectorName,
|
|
22
|
+
...(schedule ? { schedule } : {}),
|
|
23
|
+
};
|
|
24
|
+
let sourceName;
|
|
25
|
+
if (connector.connection && sources[connector.connection]) {
|
|
26
|
+
sourceName = connector.connection;
|
|
27
|
+
}
|
|
28
|
+
else if (sources[connectorName]) {
|
|
29
|
+
sourceName = connectorName;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
sourceName = connector.connection ?? connectorName;
|
|
33
|
+
if (!sources[sourceName]) {
|
|
34
|
+
sources[sourceName] = { syncs: {} };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
sources[sourceName].syncs[connectorName] = sync;
|
|
38
|
+
}
|
|
39
|
+
return sources;
|
|
40
|
+
}
|
|
41
|
+
export function configNeedsMigration(config) {
|
|
42
|
+
return !!(config.connections || config.connectors) && !config.sources;
|
|
43
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { renderForm, esc } from "../packages/surface-renderer/src/form-renderer.js";
|
|
2
|
+
export type { Breadcrumb, BrandingConfig, Condition, FormAccess, SessionData } from "../packages/surface-renderer/src/form-renderer.js";
|
|
3
|
+
export { renderPortal, renderPortalDetail, renderDevBanner, bindUserParam, paginateQuery, detailQuery, collectSectionQueries, findTableSection, renderSection } from "../packages/surface-renderer/src/portal-renderer.js";
|
|
4
|
+
export type { PortalConfig, PortalColumn, PortalField, PortalAction, PortalLink, PortalTab, PortalSection, TableSection, StatsSection, ProgressSection, TextSection, ChartSection, GallerySection, AccordionSection } from "../packages/surface-renderer/src/portal-renderer.js";
|
|
5
|
+
export { renderWorkspaceAuth, renderWorkspaceHome } from "../packages/surface-renderer/src/workspace-home.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { renderForm, esc } from "../packages/surface-renderer/src/form-renderer.js";
|
|
2
|
+
export { renderPortal, renderPortalDetail, renderDevBanner, bindUserParam, paginateQuery, detailQuery, collectSectionQueries, findTableSection, renderSection } from "../packages/surface-renderer/src/portal-renderer.js";
|
|
3
|
+
export { renderWorkspaceAuth, renderWorkspaceHome } from "../packages/surface-renderer/src/workspace-home.js";
|