Skip to content

Commit

Permalink
feat: Adding discord integration
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Nov 14, 2023
1 parent 6b37e9e commit 2c21afe
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 13 deletions.
6 changes: 4 additions & 2 deletions apps/app-config/integrations/integrations.def.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {default as integrationAirtable} from '@usevenice/integration-airtable/de
import {default as integrationBeancount} from '@usevenice/integration-beancount/def'
import {default as integrationBrex} from '@usevenice/integration-brex/def'
import {default as integrationDebug} from '@usevenice/integration-debug/def'
import {default as integrationDiscord} from '@usevenice/integration-discord/def'
import {default as integrationFirebase} from '@usevenice/integration-firebase/def'
import {default as integrationForeceipt} from '@usevenice/integration-foreceipt/def'
import {default as integrationFs} from '@usevenice/integration-fs/def'
Expand All @@ -27,14 +28,15 @@ import {default as integrationVenmo} from '@usevenice/integration-venmo/def'
import {default as integrationWebhook} from '@usevenice/integration-webhook/def'
import {default as integrationWise} from '@usevenice/integration-wise/def'
import {default as integrationYodlee} from '@usevenice/integration-yodlee/def'
import type {NonEmptyArray} from '@usevenice/util';
import { z} from '@usevenice/util'
import type {NonEmptyArray} from '@usevenice/util'
import {z} from '@usevenice/util'

export const defIntegrations = {
airtable: integrationAirtable,
beancount: integrationBeancount,
brex: integrationBrex,
debug: integrationDebug,
discord: integrationDiscord,
firebase: integrationFirebase,
foreceipt: integrationForeceipt,
fs: integrationFs,
Expand Down
8 changes: 8 additions & 0 deletions apps/app-config/integrations/integrations.merged.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {default as integrationBrex_def} from '@usevenice/integration-brex/def'
import {default as integrationBrex_server} from '@usevenice/integration-brex/server'
import {default as integrationDebug_def} from '@usevenice/integration-debug/def'
import {default as integrationDebug_server} from '@usevenice/integration-debug/server'
import {default as integrationDiscord_def} from '@usevenice/integration-discord/def'
import {default as integrationDiscord_server} from '@usevenice/integration-discord/server'
import {default as integrationFirebase_def} from '@usevenice/integration-firebase/def'
import {default as integrationFirebase_server} from '@usevenice/integration-firebase/server'
import {default as integrationForeceipt_def} from '@usevenice/integration-foreceipt/def'
Expand Down Expand Up @@ -74,6 +76,11 @@ const integrationDebug = {
...integrationDebug_server,
}

const integrationDiscord = {
...integrationDiscord_def,
...integrationDiscord_server,
}

const integrationFirebase = {
...integrationFirebase_def,
...integrationFirebase_server,
Expand Down Expand Up @@ -197,6 +204,7 @@ export const mergedIntegrations = {
beancount: integrationBeancount,
brex: integrationBrex,
debug: integrationDebug,
discord: integrationDiscord,
firebase: integrationFirebase,
foreceipt: integrationForeceipt,
fs: integrationFs,
Expand Down
2 changes: 2 additions & 0 deletions apps/app-config/integrations/integrations.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {default as integrationAirtable} from '@usevenice/integration-airtable/se
import {default as integrationBeancount} from '@usevenice/integration-beancount/server'
import {default as integrationBrex} from '@usevenice/integration-brex/server'
import {default as integrationDebug} from '@usevenice/integration-debug/server'
import {default as integrationDiscord} from '@usevenice/integration-discord/server'
import {default as integrationFirebase} from '@usevenice/integration-firebase/server'
import {default as integrationForeceipt} from '@usevenice/integration-foreceipt/server'
import {default as integrationFs} from '@usevenice/integration-fs/server'
Expand Down Expand Up @@ -31,6 +32,7 @@ export const serverIntegrations = {
beancount: integrationBeancount,
brex: integrationBrex,
debug: integrationDebug,
discord: integrationDiscord,
firebase: integrationFirebase,
foreceipt: integrationForeceipt,
fs: integrationFs,
Expand Down
11 changes: 10 additions & 1 deletion apps/app-config/integrations/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = [
server: '@usevenice/integration-brex/server',
},
},
{dirName: 'integration-copilot', varName: 'integrationCopilot', imports: {}},
{
name: 'debug',
dirName: 'integration-debug',
Expand All @@ -42,6 +43,15 @@ module.exports = [
server: '@usevenice/integration-debug/server',
},
},
{
name: 'discord',
dirName: 'integration-discord',
varName: 'integrationDiscord',
imports: {
def: '@usevenice/integration-discord/def',
server: '@usevenice/integration-discord/server',
},
},
{
dirName: 'integration-expensify',
varName: 'integrationExpensify',
Expand Down Expand Up @@ -173,7 +183,6 @@ module.exports = [
server: '@usevenice/integration-ramp/server',
},
},
{dirName: 'integration-redis', varName: 'integrationRedis', imports: {}},
{
name: 'saltedge',
dirName: 'integration-saltedge',
Expand Down
1 change: 1 addition & 0 deletions apps/app-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@usevenice/integration-beancount": "workspace:*",
"@usevenice/integration-brex": "workspace:*",
"@usevenice/integration-debug": "workspace:*",
"@usevenice/integration-discord": "workspace:*",
"@usevenice/integration-expensify": "workspace:*",
"@usevenice/integration-firebase": "workspace:*",
"@usevenice/integration-foreceipt": "workspace:*",
Expand Down
25 changes: 25 additions & 0 deletions integrations/integration-discord/def.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type {IntegrationDef, IntegrationSchemas} from '@usevenice/cdk'
import {intHelpers, oauthBaseSchema} from '@usevenice/cdk'
import {z} from '@usevenice/util'

export const discordSchemas = {
name: z.literal('discord'),
integrationConfig: oauthBaseSchema.integrationConfig,
resourceSettings: oauthBaseSchema.resourceSettings,
connectOutput: oauthBaseSchema.connectOutput,
} satisfies IntegrationSchemas

export const discordHelpers = intHelpers(discordSchemas)

export const discordDef = {
name: 'discord',
schemas: discordSchemas,
metadata: {
displayName: 'Discord',
stage: 'beta',
logoUrl: '/_assets/logo-discord.svg',
nangoProvider: 'discord',
},
} satisfies IntegrationDef<typeof discordSchemas>

export default discordDef
4 changes: 4 additions & 0 deletions integrations/integration-discord/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// codegen:start {preset: barrel, include: "./{*.{ts,tsx},*/index.{ts,tsx}}", exclude: "./**/*.{d,spec,test,fixture,gen,node}.{ts,tsx}"}
export * from './def'
export * from './server'
// codegen:end
11 changes: 11 additions & 0 deletions integrations/integration-discord/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@usevenice/integration-discord",
"version": "0.0.0",
"private": true,
"module": "./index.ts",
"dependencies": {
"@usevenice/cdk": "workspace:*",
"@usevenice/util": "workspace:*"
},
"devDependencies": {}
}
9 changes: 9 additions & 0 deletions integrations/integration-discord/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {IntegrationServer} from '@usevenice/cdk'

import type {discordSchemas} from './def'

export const discordServer = {} satisfies IntegrationServer<
typeof discordSchemas
>

export default discordServer
7 changes: 1 addition & 6 deletions integrations/integration-qbo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
"name": "@usevenice/integration-qbo",
"version": "0.0.0",
"private": true,
"sideEffects": [
"register.node.ts"
],
"module": "./index.ts",
"dependencies": {
"@usevenice/cdk": "workspace:*",
"@usevenice/util": "workspace:*"
},
"devDependencies": {
"@types/react": "*"
}
"devDependencies": {}
}
16 changes: 12 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit 2c21afe

@vercel
Copy link

@vercel vercel bot commented on 2c21afe Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

venice – ./

usevenice.vercel.app
venice-venice.vercel.app
venice-git-production-venice.vercel.app
app.venice.is

Please sign in to comment.