File tree 5 files changed +18
-4
lines changed 5 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import * as google from "./oauth/google";
4
4
import * as twitter from "./oauth/twitter" ;
5
5
import * as dropbox from "./oauth/dropbox" ;
6
6
7
+ // Update the service name here for testing different providers
7
8
const serviceName = "twitter" ;
8
9
9
10
export default function Command ( ) {
@@ -44,11 +45,11 @@ export default function Command() {
44
45
function getService ( serviceName : string ) : Service {
45
46
switch ( serviceName ) {
46
47
case "google" :
47
- return google as unknown as Service ;
48
+ return google as Service ;
48
49
case "twitter" :
49
- return twitter as unknown as Service ;
50
+ return twitter as Service ;
50
51
case "dropbox" :
51
- return dropbox as unknown as Service ;
52
+ return dropbox as Service ;
52
53
default :
53
54
throw new Error ( "Unsupported service: " + serviceName ) ;
54
55
}
@@ -57,5 +58,4 @@ function getService(serviceName: string): Service {
57
58
interface Service {
58
59
authorize ( ) : Promise < void > ;
59
60
fetchItems ( ) : Promise < { id : string ; title : string } [ ] > ;
60
- logout ( ) : void ;
61
61
}
Original file line number Diff line number Diff line change 1
1
import { OAuth } from "@raycast/api" ;
2
2
import fetch from "node-fetch" ;
3
3
4
+ // Create an OAuth app via https://www.dropbox.com/developers/apps
5
+ // As redirect URL add: https://raycast.com/redirect?packageName=Extension
6
+ // Make sure to select and save the permissions that you add via the scope request parameter
4
7
const clientId = "YourClientId" ;
8
+
5
9
const client = new OAuth . PKCEClient ( {
6
10
redirectMethod : OAuth . RedirectMethod . Web ,
7
11
providerName : "Dropbox" ,
Original file line number Diff line number Diff line change 1
1
import { OAuth } from "@raycast/api" ;
2
2
import fetch from "node-fetch" ;
3
3
4
+ // Create an OAuth client ID via https://console.developers.google.com/apis/credentials
5
+ // As application type choose "iOS" (required for PKCE)
6
+ // As Bundle ID enter: com.raycast
4
7
const clientId = "YourClientId" ;
8
+
5
9
const client = new OAuth . PKCEClient ( {
6
10
redirectMethod : OAuth . RedirectMethod . AppURI ,
7
11
providerName : "Google" ,
Original file line number Diff line number Diff line change 1
1
import { OAuth } from "@raycast/api" ;
2
2
import fetch from "node-fetch" ;
3
3
4
+ // Register a new OAuth app via https://developer.twitter.com/en/portal/dashboard
5
+ // Select OAuth 2.0
6
+ // As type of app choose: Native App
7
+ // For the redirect URL enter: https://raycast.com/redirect
8
+ // For the website URL enter: https://raycast.com
4
9
const clientId = "YourClientId" ;
10
+
5
11
const client = new OAuth . PKCEClient ( {
6
12
redirectMethod : OAuth . RedirectMethod . Web ,
7
13
providerName : "Twitter" ,
You can’t perform that action at this time.
0 commit comments