Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/linear

src/index.ts

46 lines · 1.2 KB · TypeScript
import {
	apiKeySetupUrl,
	oauthConnectUrl,
	DEFAULT_OAUTH_SCOPES,
	LINEAR_CALLBACK_URL,
	LINEAR_REQUIRED_HOST,
	LINEAR_SCOPES,
} from './setup.ts'

/**
 * Describe the Linear package, auth lanes, and export surface.
 * @example
 * import linear from 'kody:@kody/linear'
 * const overview = await linear()
 */
export default async function linearOverview() {
	return {
		name: 'Linear',
		auth: {
			oauth: {
				defaultIntegration: 'linear',
				connectUrl: oauthConnectUrl('linear'),
				callbackUrl: LINEAR_CALLBACK_URL,
				scopes: LINEAR_SCOPES,
				defaultScopes: [...DEFAULT_OAUTH_SCOPES],
				scopeSeparator: ',',
				requiredHost: LINEAR_REQUIRED_HOST,
			},
			apiKey: {
				defaultSecret: 'linearApiKey',
				setupUrl: apiKeySetupUrl('linearApiKey'),
				requiredHost: LINEAR_REQUIRED_HOST,
			},
		},
		safety: 'Mutating operations require confirm: true and support dryRun: true.',
		exports: {
			setup: ['accounts', 'smoke-test', 'viewer'],
			teams: ['list-teams', 'get-team'],
			projects: ['list-projects', 'get-project', 'create-project'],
			issues: ['list-issues', 'get-issue', 'create-issue', 'update-issue'],
			comments: ['list-comments', 'create-comment'],
			workflowStates: ['list-workflow-states'],
			advanced: ['request'],
		},
	}
}