(
integration: string,
name: string,
opts?: {
readonly owner?: Owner;
readonly oauthClient?: string | null;
readonly oauthClientOwner?: Owner | null;
},
)
| 27 | |
| 28 | // A connection optionally minted by an app (its `oauthClient` slug). |
| 29 | const connection = ( |
| 30 | integration: string, |
| 31 | name: string, |
| 32 | opts?: { |
| 33 | readonly owner?: Owner; |
| 34 | readonly oauthClient?: string | null; |
| 35 | readonly oauthClientOwner?: Owner | null; |
| 36 | }, |
| 37 | ): Connection => ({ |
| 38 | owner: opts?.owner ?? "user", |
| 39 | name: ConnectionName.make(name), |
| 40 | integration: IntegrationSlug.make(integration), |
| 41 | template: AuthTemplateSlug.make("oauth"), |
| 42 | provider: ProviderKey.make("default"), |
| 43 | address: ConnectionAddress.make(`tools.${integration}.user.${name}`), |
| 44 | identityLabel: null, |
| 45 | expiresAt: null, |
| 46 | oauthClient: |
| 47 | opts?.oauthClient === undefined |
| 48 | ? null |
| 49 | : opts.oauthClient === null |
| 50 | ? null |
| 51 | : OAuthClientSlug.make(opts.oauthClient), |
| 52 | oauthClientOwner: opts?.oauthClientOwner ?? null, |
| 53 | }); |
| 54 | |
| 55 | describe("buildUsageMap / connectionsUsingClient", () => { |
| 56 | it("maps connections to the app slug that minted them", () => { |
no outgoing calls
no test coverage detected