Skip to content

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

Package listing

@kody/asana

src/index.ts

45 lines · 1.2 KB · TypeScript
import {
	patSetupUrl,
	oauthConnectUrl,
	DEFAULT_OAUTH_SCOPES,
	ASANA_CALLBACK_URL,
	ASANA_REQUIRED_HOST,
	ASANA_SCOPES,
} from './setup.ts'

/**
 * Describe the Asana package, auth lanes, and export surface.
 * @example
 * import asana from 'kody:@kody/asana'
 * const overview = await asana()
 */
export default async function asanaOverview() {
	return {
		name: 'Asana',
		auth: {
			oauth: {
				defaultIntegration: 'asana',
				connectUrl: oauthConnectUrl('asana'),
				callbackUrl: ASANA_CALLBACK_URL,
				scopes: ASANA_SCOPES,
				defaultScopes: [...DEFAULT_OAUTH_SCOPES],
				scopeSeparator: ' ',
				requiredHost: ASANA_REQUIRED_HOST,
			},
			pat: {
				defaultSecret: 'asanaPat',
				setupUrl: patSetupUrl('asanaPat'),
				requiredHost: ASANA_REQUIRED_HOST,
			},
		},
		safety: 'Mutating operations require confirm: true and support dryRun: true.',
		exports: {
			setup: ['accounts', 'smoke-test', 'viewer'],
			workspaces: ['list-workspaces', 'get-workspace'],
			projects: ['list-projects', 'get-project', 'create-project'],
			tasks: ['list-tasks', 'get-task', 'create-task', 'update-task'],
			stories: ['list-stories', 'create-story'],
			advanced: ['request'],
		},
	}
}