diff --git a/.env.template b/.env.template index 786145a..a86058d 100644 --- a/.env.template +++ b/.env.template @@ -1,10 +1,10 @@ # Airtable: https://support.airtable.com/docs/creating-and-using-api-keys-and-access-tokens AIRTABLE_PERSONAL_ACCESS_TOKEN= AIRTABLE_BASE_ID=appnNmNoNMB6crg6I -AIRTABLE_INSTALLATIONS_TABLE_ID=tbllthJ2YSPDsKWCt -AIRTABLE_MEETINGS_TABLE_ID=tblzo9A4hjnxs8ezd -AIRTABLE_MEETING_FEEDBACKS_TABLE_ID=tblS9TLx7ybXozveU -AIRTABLE_GLOBAL_SETTINGS_TABLE_ID=tbldUWzEoJoTG4d45 +AIRTABLE_INSTALLATION_TABLE_ID=tbllthJ2YSPDsKWCt +AIRTABLE_MEETING_TABLE_ID=tblzo9A4hjnxs8ezd +AIRTABLE_MEETING_FEEDBACK_TABLE_ID=tblS9TLx7ybXozveU +AIRTABLE_GLOBAL_SETTING_TABLE_ID=tbldUWzEoJoTG4d45 # Slack # local: https://api.slack.com/apps/A04PEDW8K3R/ diff --git a/.env.test b/.env.test index e68c7b0..254d424 100644 --- a/.env.test +++ b/.env.test @@ -1,10 +1,10 @@ # Airtable: https://support.airtable.com/docs/creating-and-using-api-keys-and-access-tokens AIRTABLE_PERSONAL_ACCESS_TOKEN=FAKE_TOKEN AIRTABLE_BASE_ID=appnNmNoNMB6crg6I -AIRTABLE_INSTALLATIONS_TABLE_ID=tbllthJ2YSPDsKWCt -AIRTABLE_MEETINGS_TABLE_ID=tblzo9A4hjnxs8ezd -AIRTABLE_MEETING_FEEDBACKS_TABLE_ID=tblS9TLx7ybXozveU -AIRTABLE_GLOBAL_SETTINGS_TABLE_ID=tbldUWzEoJoTG4d45 +AIRTABLE_INSTALLATION_TABLE_ID=tbllthJ2YSPDsKWCt +AIRTABLE_MEETING_TABLE_ID=tblzo9A4hjnxs8ezd +AIRTABLE_MEETING_FEEDBACK_TABLE_ID=tblS9TLx7ybXozveU +AIRTABLE_GLOBAL_SETTING_TABLE_ID=tbldUWzEoJoTG4d45 # Slack # local: https://api.slack.com/apps/A04PEDW8K3R/ diff --git a/src/lib/api/db/tables.ts b/src/lib/api/db/tables.ts index dd2cb02..3df4efe 100644 --- a/src/lib/api/db/tables.ts +++ b/src/lib/api/db/tables.ts @@ -40,7 +40,7 @@ export interface Installation extends Item { export const installationsTable: Table = { name: 'installation', baseId: env.AIRTABLE_BASE_ID, - tableId: env.AIRTABLE_INSTALLATIONS_TABLE_ID, + tableId: env.AIRTABLE_INSTALLATION_TABLE_ID, schema: { name: 'string', slackTeamId: 'string', @@ -53,6 +53,18 @@ export const installationsTable: Table = { participantsDimensionFieldNamesJson: 'string', introMessage: 'string', }, + mappings: { + name: 'Name', + slackTeamId: 'Slack team ID', + slackInstallationJson: 'Slack installation JSON', + participantsBaseId: 'Participants base ID', + participantsTableId: 'Participants table ID', + participantsViewId: 'Participants view ID', + participantsSlackEmailFieldName: 'Participants Slack email field name', + participantsBiographyFieldName: 'Participants biography field name', + participantsDimensionFieldNamesJson: 'Participants dimension field names JSON', + introMessage: 'Intro message', + } }; export interface Meeting extends Item { @@ -68,7 +80,7 @@ export interface Meeting extends Item { export const meetingsTable: Table = { name: 'meeting', baseId: env.AIRTABLE_BASE_ID, - tableId: env.AIRTABLE_MEETINGS_TABLE_ID, + tableId: env.AIRTABLE_MEETING_TABLE_ID, schema: { slackMpim: 'string', installationId: 'string', @@ -78,6 +90,15 @@ export const meetingsTable: Table = { state: 'string', participantLinks: 'string', }, + mappings: { + slackMpim: 'Slack MPIM', + installationId: 'Installation ID', + participantIdsJson: 'Participant IDs JSON', + createdAt: 'Created at', + lastModifiedAt: 'Last modified at', + state: 'State', + participantLinks: 'Participant links', + } }; export interface MeetingFeedback extends Item { @@ -91,7 +112,7 @@ export interface MeetingFeedback extends Item { export const meetingFeedbacksTable: Table = { name: 'meetingFeedback', baseId: env.AIRTABLE_BASE_ID, - tableId: env.AIRTABLE_MEETING_FEEDBACKS_TABLE_ID, + tableId: env.AIRTABLE_MEETING_FEEDBACK_TABLE_ID, schema: { participantId: 'string', meetingId: 'string', @@ -99,6 +120,13 @@ export const meetingFeedbacksTable: Table = { createdAt: 'number', participantLinks: 'string', }, + mappings: { + participantId: 'Participant ID', + meetingId: 'Meeting ID', + value: 'Value', + createdAt: 'Created at', + participantLinks: 'Participant links', + } }; export interface GlobalSetting extends Item { @@ -109,9 +137,13 @@ export interface GlobalSetting extends Item { export const globalSettingsTable: Table = { name: 'globalSetting', baseId: env.AIRTABLE_BASE_ID, - tableId: env.AIRTABLE_GLOBAL_SETTINGS_TABLE_ID, + tableId: env.AIRTABLE_GLOBAL_SETTING_TABLE_ID, schema: { name: 'string', value: 'string', }, + mappings: { + name: 'Name', + value: 'Value', + } }; diff --git a/src/lib/api/env.ts b/src/lib/api/env.ts index 498913f..7dc2f22 100644 --- a/src/lib/api/env.ts +++ b/src/lib/api/env.ts @@ -2,10 +2,10 @@ import { validateEnv } from '../validateEnv'; const envVars = [ 'AIRTABLE_BASE_ID', - 'AIRTABLE_INSTALLATIONS_TABLE_ID', - 'AIRTABLE_MEETINGS_TABLE_ID', - 'AIRTABLE_MEETING_FEEDBACKS_TABLE_ID', - 'AIRTABLE_GLOBAL_SETTINGS_TABLE_ID', + 'AIRTABLE_INSTALLATION_TABLE_ID', + 'AIRTABLE_MEETING_TABLE_ID', + 'AIRTABLE_MEETING_FEEDBACK_TABLE_ID', + 'AIRTABLE_GLOBAL_SETTING_TABLE_ID', 'AIRTABLE_PERSONAL_ACCESS_TOKEN', 'SLACK_CLIENT_ID',