Skip to content

Commit

Permalink
Merge pull request #447 from mastra-ai/regen-spotify
Browse files Browse the repository at this point in the history
regen spotify
  • Loading branch information
adeniyii authored Oct 4, 2024
2 parents 50690c0 + 65908aa commit ad756ee
Show file tree
Hide file tree
Showing 18 changed files with 11,281 additions and 28,032 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ dist/
**/tsconfig.tsbuildinfo

.turbo

openapi-ts-error*
17 changes: 17 additions & 0 deletions examples/email-client/mastra.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SpotifyIntegration } from '@mastra/spotify'
import { AsanaIntegration } from '@mastra/asana';
import { AttioIntegration } from '@mastra/attio';
import { Config } from '@mastra/core';
Expand All @@ -10,6 +11,22 @@ export const config: Config = {
name: 'email-client',
//logConfig: {}, // TODO: Add this
integrations: [
new SpotifyIntegration({
config: {
CLIENT_ID: process.env.SPOTIFY_CLIENT_ID!,
CLIENT_SECRET: process.env.SPOTIFY_CLIENT_SECRET!,
SCOPES: [
"user-library-read",
"app-remote-control",
"playlist-read-private",
"user-top-read",
"user-read-recently-played",
"user-read-currently-playing",
"streaming"
]
},
}),

new SlackIntegration({
config: {
CLIENT_ID: process.env.SLACK_CLIENT_ID!,
Expand Down
1 change: 1 addition & 0 deletions integration-generator/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export type IntegrationCategories =
| 'communications'
| 'spreadsheet'
| 'marketing'
| 'music'
| 'productivity';

export interface Source {
Expand Down
86 changes: 42 additions & 44 deletions integration-generator/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,26 +183,26 @@ export const sources: Source[] = [
// apiKeys: ['API_KEY'],
// logoDomain: 'coda.io',
// },
{
name: 'apollo',
logoDomain: 'apollo.io',
authType: 'API_KEY',
apiKeys: ['API_KEY'],
authorization: {
type: 'Custom_Header',
headers: [
{
key: 'X-Api-Key',
value: 'API_KEY',
},
],
},
serverUrl: 'https://app.apollo.io/api',
openapiSpec: 'https://raw.githubusercontent.com/tonyxiao/openSDKs/main/sdks/sdk-apollo/apollo.oas.json',
categories: ['communications', 'marketing', 'ats', 'hiring'],
description:
'Apollo is a sales engagement platform that helps sales teams generate more meetings, manage their pipeline, and close more deals.',
},
// {
// name: 'apollo',
// logoDomain: 'apollo.io',
// authType: 'API_KEY',
// apiKeys: ['API_KEY'],
// authorization: {
// type: 'Custom_Header',
// headers: [
// {
// key: 'X-Api-Key',
// value: 'API_KEY',
// },
// ],
// },
// serverUrl: 'https://app.apollo.io/api',
// openapiSpec: 'https://raw.githubusercontent.com/tonyxiao/openSDKs/main/sdks/sdk-apollo/apollo.oas.json',
// categories: ['communications', 'marketing', 'ats', 'hiring'],
// description:
// 'Apollo is a sales engagement platform that helps sales teams generate more meetings, manage their pipeline, and close more deals.',
// },
// {
// name: 'figma',
// logoDomain: 'figma.com',
Expand Down Expand Up @@ -657,19 +657,19 @@ export const sources: Source[] = [
// Category: 'marketing',
// 'OpenAPI integration': 'https://raw.githubusercontent.com/klaviyo/openapi/blob/main/openapi/stable.json',
// },
{
name: 'mailchimp',
authType: 'OAUTH',
tokenUrl: 'https://login.mailchimp.com/oauth2/token',
authorizationUrl: 'https://login.mailchimp.com/oauth2/authorize',
openapiSpec:
'https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/mailchimp.com/3.0.55/openapi.yaml',
serverUrl: 'https://server.api.mailchimp.com/3.0',
logoDomain: 'mailchimp.com',
categories: ['marketing', 'communications', 'crm'],
description:
'Mailchimp is an all-in-one marketing platform that helps you manage and talk to your clients, customers, and other interested parties.',
},
// {
// name: 'mailchimp',
// authType: 'OAUTH',
// tokenUrl: 'https://login.mailchimp.com/oauth2/token',
// authorizationUrl: 'https://login.mailchimp.com/oauth2/authorize',
// openapiSpec:
// 'https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/mailchimp.com/3.0.55/openapi.yaml',
// serverUrl: 'https://server.api.mailchimp.com/3.0',
// logoDomain: 'mailchimp.com',
// categories: ['marketing', 'communications', 'crm'],
// description:
// 'Mailchimp is an all-in-one marketing platform that helps you manage and talk to your clients, customers, and other interested parties.',
// },
// {
// 'name': 'Netlify',
// 'Docs URL': '',
Expand Down Expand Up @@ -798,18 +798,16 @@ export const sources: Source[] = [
// 'OpenAPI integration':
// 'https://developer.sage.com/accounting/files/v3.0-swagger/Sage%20One%20Core%20API%20-%20ES.swagger.json',
// },

// {
// 'name': 'spotify',
// 'Docs URL': 'https://docs.nango.dev/integrations/all/spotify',
// 'Auth Mode': 'OAUTH2',
// Status: 'Backlog',
// 'Token URL': 'https://accounts.spotify.com/api/token',
// 'Proxy URL': 'https://api.spotify.com',
// 'Authorization URL': 'https://accounts.spotify.com/authorize',
// Category: 'other',
// 'OpenAPI integration':
// 'https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/spotify.com/1.0.0/openapi.yaml',
// name: 'spotify',
// authType: 'OAUTH',
// tokenUrl: 'https://accounts.spotify.com/api/token',
// serverUrl: 'https://api.spotify.com/v1',
// categories: ['music'],
// authorizationUrl: 'https://accounts.spotify.com/authorize',
// logoDomain: 'spotify.com',
// description: 'Spotify is a digital music service that gives you access to millions of songs.',
// openapiSpec: 'https://developer.spotify.com/reference/web-api/open-api-schema.yaml',
// },
// {
// 'name': 'squareup',
Expand Down
187 changes: 82 additions & 105 deletions packages/admin/src/domains/integrations/generated/integrations.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions packages/spotify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"lint": "dts lint",
"size": "size-limit",
"start": "dts watch",
"test": "jest"
"test": "jest",
"clean": "rm -rf dist && rm -rf node_modules",
"gen:zod:schema": "pnpx ts-to-zod src/client/types.gen.ts src/client/zodSchema.ts"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -56,8 +58,9 @@
"author": "",
"license": "ISC",
"dependencies": {
"@hey-api/client-fetch": "^0.3.3",
"@mastra/core": "workspace:*",
"fets": "*",
"zod": "^3.23.8"
"zod": "^3.23.8",
"ts-to-zod": "^3.13.0"
}
}
4 changes: 4 additions & 0 deletions packages/spotify/src/client/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This file is auto-generated by @hey-api/openapi-ts
export * from './schemas.gen';
export * from './services.gen';
export * from './types.gen';
Loading

0 comments on commit ad756ee

Please sign in to comment.