Skip to content
← Public packages

@kody/canva

Create, organize, collaborate on, import, and export Canva content through the Connect API.

src/index.ts

37 lines · 1.4 KB · TypeScript
import { canvaOperationNames, canvaOperations } from './operations.ts'

/**
 * Package overview for the Canva Connect API wrapper: coverage, safety gates, and reconnect URL.
 * Use `./api` to invoke an operation and `./operations` for the slug catalog.
 *
 * @returns `{ integration, apiBaseUrl, reconnectUrl, exports, coverage, safety, notes }`.
 *
 * @example
 * import canvaOverview from 'kody:@kody/canva'
 * const overview = await canvaOverview()
 * // => { integration: 'canva', coverage: { operationCount: … }, safety: { mutationsRequireConfirmation: true, … } }
 */
export default async function canvaOverview() {
	const tags = new Set(canvaOperationNames.map((name) => canvaOperations[name].tag))
	return {
		integration: 'canva',
		apiBaseUrl: 'https://api.canva.com/rest',
		reconnectUrl: 'https://kody.codes/connect/oauth?provider=canva',
		exports: ['api', 'operations', 'smoke-test'],
		coverage: {
			operationCount: canvaOperationNames.length,
			domains: [...tags].sort(),
			operations: canvaOperationNames,
		},
		safety: {
			mutationsRequireConfirmation: true,
			dryRunAvailable: true,
			authorizationHeaderOverridesBlocked: true,
		},
		notes: [
			'Preview APIs can change without notice and are marked in the operations catalog.',
			'Resize and some brand-template endpoints require eligible Canva plans.',
			'Use smoke-test to verify OAuth without returning profile data.',
		],
	}
}