Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

[FE-1417] feat: notion fdw (#33988)

Alaister Youngd7a948294639
diff --git a/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts b/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
index 4d6e25bdfe6..bc75d70b2d1 100644
--- a/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
+++ b/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
@@ -18,6 +18,7 @@ export const WRAPPER_HANDLERS = {
CAL: 'wasm_fdw_handler',
CALENDLY: 'wasm_fdw_handler',
CLERK: 'wasm_fdw_handler',
+ NOTION: 'wasm_fdw_handler',
}
export const WRAPPERS: WrapperMeta[] = [
@@ -2537,8 +2538,8 @@ export const WRAPPERS: WrapperMeta[] = [
handlerName: WRAPPER_HANDLERS.CLERK,
validatorName: 'wasm_fdw_validator',
icon: `${BASE_PATH}/img/icons/clerk-icon.svg`,
- label: 'Clerk',
extensionName: 'clerkFdw',
+ label: 'Clerk',
docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/clerk',
minimumExtensionVersion: '0.4.0',
server: {
@@ -2871,4 +2872,157 @@ export const WRAPPERS: WrapperMeta[] = [
},
],
},
+ {
+ name: 'notion_wrapper',
+ description: 'Notion provides a versatile, ready-to-use solution for managing your data.',
+ handlerName: WRAPPER_HANDLERS.NOTION,
+ validatorName: 'wasm_fdw_validator',
+ icon: `${BASE_PATH}/img/icons/notion-icon.svg`,
+ extensionName: 'NotionFdw',
+ label: 'Notion',
+ docsUrl: 'https://fdw.dev/catalog/notion/',
+ minimumExtensionVersion: '0.4.0',
+ server: {
+ options: [
+ {
+ name: 'fdw_package_url',
+ label: 'FDW Package URL',
+ required: true,
+ encrypted: false,
+ secureEntry: false,
+ defaultValue:
+ 'https://github.com/supabase/wrappers/releases/download/wasm_notion_fdw_v0.1.1/notion_fdw.wasm',
+ hidden: true,
+ },
+ {
+ name: 'fdw_package_name',
+ label: 'FDW Package Name',
+ required: true,
+ encrypted: false,
+ secureEntry: false,
+ defaultValue: 'supabase:notion-fdw',
+ hidden: true,
+ },
+ {
+ name: 'fdw_package_version',
+ label: 'FDW Package Version',
+ required: true,
+ encrypted: false,
+ secureEntry: false,
+ defaultValue: '0.1.1',
+ hidden: true,
+ },
+ {
+ name: 'fdw_package_checksum',
+ label: 'FDW Package Checksum',
+ required: true,
+ encrypted: false,
+ secureEntry: false,
+ defaultValue: '6dea3014f462aafd0c051c37d163fe326e7650c26a7eb5d8017a30634b5a46de',
+ hidden: true,
+ },
+ {
+ name: 'api_url',
+ label: 'API URL',
+ required: false,
+ encrypted: false,
+ secureEntry: false,
+ defaultValue: 'https://api.notion.com/v1',
+ },
+ {
+ name: 'api_key_id',
+ label: 'Notion API Key',
+ required: true,
+ encrypted: true,
+ secureEntry: true,
+ },
+ ],
+ },
+ tables: [
+ {
+ label: 'Blocks',
+ description: 'Notion Block content',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'page_id', type: 'text' },
+ { name: 'type', type: 'text' },
+ { name: 'created_time', type: 'timestamp' },
+ { name: 'last_edited_time', type: 'timestamp' },
+ { name: 'archived', type: 'boolean' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'block',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'Pages',
+ description: 'Notion Pages',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'url', type: 'text' },
+ { name: 'created_time', type: 'timestamp' },
+ { name: 'last_edited_time', type: 'timestamp' },
+ { name: 'archived', type: 'boolean' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'page',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'Databases',
+ description: 'Notion Databases',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'url', type: 'text' },
+ { name: 'created_time', type: 'timestamp' },
+ { name: 'last_edited_time', type: 'timestamp' },
+ { name: 'archived', type: 'boolean' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'database',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ {
+ label: 'Users',
+ description: 'Notion Users',
+ availableColumns: [
+ { name: 'id', type: 'text' },
+ { name: 'name', type: 'text' },
+ { name: 'type', type: 'text' },
+ { name: 'avatar_url', type: 'text' },
+ { name: 'attrs', type: 'jsonb' },
+ ],
+ options: [
+ {
+ name: 'object',
+ defaultValue: 'user',
+ editable: false,
+ required: true,
+ type: 'text',
+ },
+ ],
+ },
+ ],
+ },
]
diff --git a/apps/studio/public/img/icons/notion-icon.svg b/apps/studio/public/img/icons/notion-icon.svg
index 38303fc72fd..c763bb55c74 100644
--- a/apps/studio/public/img/icons/notion-icon.svg
+++ b/apps/studio/public/img/icons/notion-icon.svg
@@ -1 +1 @@
-<svg fill="gray" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="512px" height="512px"><path d="M 15.46875 1.5 L 2.9804688 2 A 0.50038132 0.50038132 0 0 0 2.9511719 2.0019531 A 1.0001 1.0001 0 0 0 2.9296875 2.0039062 A 1.0001 1.0001 0 0 0 2 3 L 2 16.894531 C 2 17.487 2.1760213 18.066018 2.5039062 18.558594 L 5.1679688 22.554688 A 1.0001 1.0001 0 0 0 6.0625 22.998047 L 22.0625 21.998047 A 1.0001 1.0001 0 0 0 23 21 L 23 5.5 A 1.0001 1.0001 0 0 0 22.736328 4.8242188 A 0.50037856 0.50037856 0 0 0 22.587891 4.6933594 A 0.50037856 0.50037856 0 0 0 22.585938 4.6914062 A 1.0001 1.0001 0 0 0 22.398438 4.5839844 L 18.296875 2.2441406 L 18.330078 2.265625 C 17.492273 1.6962298 16.485312 1.4260957 15.474609 1.5 L 15.46875 1.5 z M 15.525391 2.4980469 A 0.50005 0.50005 0 0 0 15.542969 2.4980469 C 16.330286 2.4394359 17.115017 2.6483002 17.767578 3.0917969 A 0.50005 0.50005 0 0 0 17.800781 3.1132812 L 20.324219 4.5527344 L 6.8554688 4.9882812 L 4.46875 2.9414062 L 15.525391 2.4980469 z M 21 6.5332031 L 21 20.060547 L 7 20.935547 L 7 6.984375 L 21 6.5332031 z M 19.441406 8.5019531 C 18.427406 8.5619531 17.407625 8.6115 16.390625 8.6875 C 16.056625 8.7125 15.808578 9.0013594 15.767578 9.3183594 C 15.748578 9.4663594 15.789031 9.5426875 15.957031 9.5546875 C 16.265031 9.5776875 16.570625 9.6212031 16.890625 9.6582031 L 16.890625 15.527344 C 16.796625 15.392344 16.745266 15.321047 16.697266 15.248047 C 15.387266 13.269047 14.071438 11.293641 12.773438 9.3066406 C 12.577437 9.0066406 12.393953 8.86225 12.001953 8.90625 C 11.084953 9.00725 10.160234 9.0373281 9.2402344 9.1113281 C 8.7302344 9.1523281 8.4274531 9.5989844 8.5644531 10.083984 C 8.9094531 10.113984 9.2572813 10.144781 9.6132812 10.175781 L 9.6132812 18.607422 C 9.3792813 18.673422 9.1461563 18.747688 8.9101562 18.804688 C 8.6701563 18.862688 8.5577187 19.024094 8.5117188 19.246094 C 8.4747187 19.424094 8.5183281 19.514047 8.7363281 19.498047 C 9.4853281 19.445047 10.238281 19.412188 10.988281 19.367188 C 11.298281 19.349188 11.609063 19.342969 11.914062 19.292969 C 12.330062 19.223969 12.556563 18.970453 12.601562 18.564453 C 12.231563 18.482453 11.859375 18.392312 11.484375 18.320312 C 11.317375 18.288312 11.260719 18.219875 11.261719 18.046875 C 11.267719 16.090875 11.266578 14.133734 11.267578 12.177734 C 11.267578 12.113734 11.280969 12.048406 11.292969 11.941406 C 11.350969 12.018406 11.374484 12.049984 11.396484 12.083984 C 12.408484 13.654984 13.417547 15.229875 14.435547 16.796875 C 14.873547 17.470875 15.322203 18.137875 15.783203 18.796875 C 16.117203 19.274875 16.607063 19.426547 17.164062 19.310547 C 17.512062 19.237547 17.8465 19.098234 18.1875 18.990234 C 18.3775 18.930234 18.432641 18.807422 18.431641 18.607422 C 18.424641 15.733422 18.427734 12.860328 18.427734 9.9863281 C 18.427734 9.4513281 18.426031 9.4517969 18.957031 9.3417969 C 19.445031 9.2407969 19.588406 9.0019531 19.441406 8.5019531 z"/></svg>
\ No newline at end of file
+<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="512px" height="512px"><path d="M 15.46875 1.5 L 2.9804688 2 A 0.50038132 0.50038132 0 0 0 2.9511719 2.0019531 A 1.0001 1.0001 0 0 0 2.9296875 2.0039062 A 1.0001 1.0001 0 0 0 2 3 L 2 16.894531 C 2 17.487 2.1760213 18.066018 2.5039062 18.558594 L 5.1679688 22.554688 A 1.0001 1.0001 0 0 0 6.0625 22.998047 L 22.0625 21.998047 A 1.0001 1.0001 0 0 0 23 21 L 23 5.5 A 1.0001 1.0001 0 0 0 22.736328 4.8242188 A 0.50037856 0.50037856 0 0 0 22.587891 4.6933594 A 0.50037856 0.50037856 0 0 0 22.585938 4.6914062 A 1.0001 1.0001 0 0 0 22.398438 4.5839844 L 18.296875 2.2441406 L 18.330078 2.265625 C 17.492273 1.6962298 16.485312 1.4260957 15.474609 1.5 L 15.46875 1.5 z M 15.525391 2.4980469 A 0.50005 0.50005 0 0 0 15.542969 2.4980469 C 16.330286 2.4394359 17.115017 2.6483002 17.767578 3.0917969 A 0.50005 0.50005 0 0 0 17.800781 3.1132812 L 20.324219 4.5527344 L 6.8554688 4.9882812 L 4.46875 2.9414062 L 15.525391 2.4980469 z M 21 6.5332031 L 21 20.060547 L 7 20.935547 L 7 6.984375 L 21 6.5332031 z M 19.441406 8.5019531 C 18.427406 8.5619531 17.407625 8.6115 16.390625 8.6875 C 16.056625 8.7125 15.808578 9.0013594 15.767578 9.3183594 C 15.748578 9.4663594 15.789031 9.5426875 15.957031 9.5546875 C 16.265031 9.5776875 16.570625 9.6212031 16.890625 9.6582031 L 16.890625 15.527344 C 16.796625 15.392344 16.745266 15.321047 16.697266 15.248047 C 15.387266 13.269047 14.071438 11.293641 12.773438 9.3066406 C 12.577437 9.0066406 12.393953 8.86225 12.001953 8.90625 C 11.084953 9.00725 10.160234 9.0373281 9.2402344 9.1113281 C 8.7302344 9.1523281 8.4274531 9.5989844 8.5644531 10.083984 C 8.9094531 10.113984 9.2572813 10.144781 9.6132812 10.175781 L 9.6132812 18.607422 C 9.3792813 18.673422 9.1461563 18.747688 8.9101562 18.804688 C 8.6701563 18.862688 8.5577187 19.024094 8.5117188 19.246094 C 8.4747187 19.424094 8.5183281 19.514047 8.7363281 19.498047 C 9.4853281 19.445047 10.238281 19.412188 10.988281 19.367188 C 11.298281 19.349188 11.609063 19.342969 11.914062 19.292969 C 12.330062 19.223969 12.556563 18.970453 12.601562 18.564453 C 12.231563 18.482453 11.859375 18.392312 11.484375 18.320312 C 11.317375 18.288312 11.260719 18.219875 11.261719 18.046875 C 11.267719 16.090875 11.266578 14.133734 11.267578 12.177734 C 11.267578 12.113734 11.280969 12.048406 11.292969 11.941406 C 11.350969 12.018406 11.374484 12.049984 11.396484 12.083984 C 12.408484 13.654984 13.417547 15.229875 14.435547 16.796875 C 14.873547 17.470875 15.322203 18.137875 15.783203 18.796875 C 16.117203 19.274875 16.607063 19.426547 17.164062 19.310547 C 17.512062 19.237547 17.8465 19.098234 18.1875 18.990234 C 18.3775 18.930234 18.432641 18.807422 18.431641 18.607422 C 18.424641 15.733422 18.427734 12.860328 18.427734 9.9863281 C 18.427734 9.4513281 18.426031 9.4517969 18.957031 9.3417969 C 19.445031 9.2407969 19.588406 9.0019531 19.441406 8.5019531 z"/></svg>
\ No newline at end of file