refactor: inline auth, data, triggers and actions in apps

This commit is contained in:
Ali BARIN
2022-10-28 15:48:39 +02:00
parent 179fe512af
commit 9a973c8257
47 changed files with 233 additions and 167 deletions

View File

@@ -7,7 +7,7 @@ export default {
{
key: 'oAuthRedirectUrl',
label: 'OAuth Redirect URL',
type: 'string',
type: 'string' as const,
required: true,
readOnly: true,
value: '{WEB_APP_URL}/app/flickr/connections/add',
@@ -19,7 +19,7 @@ export default {
{
key: 'consumerKey',
label: 'Consumer Key',
type: 'string',
type: 'string' as const,
required: true,
readOnly: false,
value: null,
@@ -31,7 +31,7 @@ export default {
{
key: 'consumerSecret',
label: 'Consumer Secret',
type: 'string',
type: 'string' as const,
required: true,
readOnly: false,
value: null,
@@ -44,7 +44,7 @@ export default {
authenticationSteps: [
{
step: 1,
type: 'mutation',
type: 'mutation' as const,
name: 'createConnection',
arguments: [
{
@@ -69,7 +69,7 @@ export default {
},
{
step: 2,
type: 'mutation',
type: 'mutation' as const,
name: 'createAuthData',
arguments: [
{
@@ -80,7 +80,7 @@ export default {
},
{
step: 3,
type: 'openWithPopup',
type: 'openWithPopup' as const,
name: 'openAuthPopup',
arguments: [
{
@@ -91,7 +91,7 @@ export default {
},
{
step: 4,
type: 'mutation',
type: 'mutation' as const,
name: 'updateConnection',
arguments: [
{
@@ -112,7 +112,7 @@ export default {
},
{
step: 5,
type: 'mutation',
type: 'mutation' as const,
name: 'verifyConnection',
arguments: [
{
@@ -125,7 +125,7 @@ export default {
reconnectionSteps: [
{
step: 1,
type: 'mutation',
type: 'mutation' as const,
name: 'resetConnection',
arguments: [
{
@@ -136,7 +136,7 @@ export default {
},
{
step: 2,
type: 'mutation',
type: 'mutation' as const,
name: 'updateConnection',
arguments: [
{
@@ -161,7 +161,7 @@ export default {
},
{
step: 3,
type: 'mutation',
type: 'mutation' as const,
name: 'createAuthData',
arguments: [
{
@@ -172,7 +172,7 @@ export default {
},
{
step: 4,
type: 'openWithPopup',
type: 'openWithPopup' as const,
name: 'openAuthPopup',
arguments: [
{
@@ -183,7 +183,7 @@ export default {
},
{
step: 5,
type: 'mutation',
type: 'mutation' as const,
name: 'updateConnection',
arguments: [
{
@@ -204,7 +204,7 @@ export default {
},
{
step: 6,
type: 'mutation',
type: 'mutation' as const,
name: 'verifyConnection',
arguments: [
{

View File

@@ -0,0 +1,3 @@
import listAlbums from './list-albums';
export default [listAlbums];

View File

@@ -1,5 +1,8 @@
import defineApp from '../../helpers/define-app';
import addAuthHeader from './common/add-auth-header';
import auth from './auth';
import triggers from './triggers';
import data from './data';
export default defineApp({
name: 'Flickr',
@@ -12,4 +15,7 @@ export default defineApp({
baseUrl: 'https://www.flickr.com/',
apiBaseUrl: 'https://www.flickr.com/services',
beforeRequest: [addAuthHeader],
auth,
triggers,
data,
});

View File

@@ -0,0 +1,11 @@
import newAlbums from './new-albums';
import newFavoritePhotos from './new-favorite-photos';
import newPhotos from './new-photos';
import newPhotosInAlbums from './new-photos-in-album';
export default [
newAlbums,
newFavoritePhotos,
newPhotos,
newPhotosInAlbums,
];

View File

@@ -18,7 +18,7 @@ export default defineTrigger({
{
label: 'Album',
key: 'album',
type: 'dropdown',
type: 'dropdown' as const,
required: true,
variables: false,
source: {