(input: {
readonly scopeId: string;
readonly sourceId: string;
readonly pluginId: string;
readonly description: string;
readonly config: unknown;
readonly ownerForScope?: ScopeOwnerResolver;
})
| 844 | * sources are org-owned, but we derive owner from the scope generically (a local |
| 845 | * user-scoped source maps to owner=user). */ |
| 846 | export const planIntegrationRow = (input: { |
| 847 | readonly scopeId: string; |
| 848 | readonly sourceId: string; |
| 849 | readonly pluginId: string; |
| 850 | readonly description: string; |
| 851 | readonly config: unknown; |
| 852 | readonly ownerForScope?: ScopeOwnerResolver; |
| 853 | }): PlannedIntegrationRow | null => { |
| 854 | const keys = (input.ownerForScope ?? parseScope)(input.scopeId); |
| 855 | if (!keys) return null; // fail loud upstream — never silently mis-own |
| 856 | return { |
| 857 | tenant: keys.tenant, |
| 858 | owner: keys.owner, |
| 859 | subject: keys.subject, |
| 860 | slug: input.sourceId, |
| 861 | plugin_id: input.pluginId, |
| 862 | description: input.description, |
| 863 | config: input.config, |
| 864 | }; |
| 865 | }; |
| 866 | |
| 867 | export interface PlannedConnectionRow { |
| 868 | readonly tenant: string; |
no outgoing calls
no test coverage detected