@superfan-app/spotify-auth 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -10
- package/plugin/build/index.d.ts +4 -4
- package/plugin/build/index.js +8 -3
- package/plugin/build/ios/withSpotifyQueryScheme.d.ts +2 -2
- package/plugin/build/ios/withSpotifyURLScheme.d.ts +3 -3
- package/plugin/build/types.d.ts +1 -1
- package/plugin/build/withSpotifyConfig.d.ts +3 -3
- package/plugin/build/withSpotifyConfig.js +11 -8
- package/plugin/src/index.ts +8 -6
- package/plugin/src/ios/withSpotifyQueryScheme.ts +2 -2
- package/plugin/src/ios/withSpotifyURLScheme.ts +3 -3
- package/plugin/src/types.ts +1 -1
- package/plugin/src/withSpotifyConfig.ts +14 -13
- package/plugin/tsconfig.json +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superfan-app/spotify-auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Spotify OAuth module for Expo",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"module": "build/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
],
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
|
-
"url": "https://github.com/Superfan-App/spotify-auth"
|
|
33
|
+
"url": "git+https://github.com/Superfan-App/spotify-auth.git"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
@@ -41,13 +41,11 @@
|
|
|
41
41
|
"author": "Superfan <support@superfan.app>",
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"homepage": "https://github.com/Superfan-App/spotify-auth#readme",
|
|
44
|
-
"dependencies": {
|
|
45
|
-
"@expo/config-plugins": "^9.0.11"
|
|
46
|
-
},
|
|
47
44
|
"devDependencies": {
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"expo
|
|
45
|
+
"expo-module-scripts": "^4.0.2"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"expo": "*",
|
|
49
|
+
"react-native": "*"
|
|
52
50
|
}
|
|
53
|
-
}
|
|
51
|
+
}
|
package/plugin/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
import {
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
1
|
+
import { type ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
import { SpotifyConfig } from './types';
|
|
3
|
+
declare const _default: ConfigPlugin<SpotifyConfig>;
|
|
4
|
+
export default _default;
|
package/plugin/build/index.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
3
7
|
const withSpotifyQueryScheme_1 = require("./ios/withSpotifyQueryScheme");
|
|
4
8
|
const withSpotifyURLScheme_1 = require("./ios/withSpotifyURLScheme");
|
|
5
9
|
const withSpotifyConfig_1 = require("./withSpotifyConfig");
|
|
6
|
-
const
|
|
7
|
-
|
|
10
|
+
const package_json_1 = __importDefault(require("../../package.json"));
|
|
11
|
+
const withSpotifyAuth = (config, props) => {
|
|
12
|
+
config = (0, withSpotifyConfig_1.withSpotifyOAuthConfig)(config, props);
|
|
8
13
|
// iOS specific
|
|
9
14
|
config = (0, withSpotifyQueryScheme_1.withSpotifyQueryScheme)(config, props);
|
|
10
15
|
config = (0, withSpotifyURLScheme_1.withSpotifyURLScheme)(config, props);
|
|
11
16
|
return config;
|
|
12
17
|
};
|
|
13
|
-
exports.default =
|
|
18
|
+
exports.default = (0, config_plugins_1.createRunOncePlugin)(withSpotifyAuth, package_json_1.default.name, package_json_1.default.version);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ConfigPlugin } from "expo/config-plugins";
|
|
2
|
-
import {
|
|
3
|
-
export declare const withSpotifyQueryScheme: ConfigPlugin<
|
|
2
|
+
import { SpotifyConfig } from "../types";
|
|
3
|
+
export declare const withSpotifyQueryScheme: ConfigPlugin<SpotifyConfig>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ConfigPlugin } from "expo/config-plugins";
|
|
2
|
-
import {
|
|
3
|
-
export declare const withSpotifyURLScheme: ConfigPlugin<
|
|
1
|
+
import { type ConfigPlugin } from "expo/config-plugins";
|
|
2
|
+
import { SpotifyConfig } from "../types";
|
|
3
|
+
export declare const withSpotifyURLScheme: ConfigPlugin<SpotifyConfig>;
|
package/plugin/build/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type SpotifyScopes = 'app-remote-control' | 'playlist-modify-private' | 'playlist-modify-public' | 'playlist-read-collaborative' | 'playlist-read-private' | 'streaming' | 'user-follow-modify' | 'user-follow-read' | 'user-library-modify' | 'user-library-read' | 'user-modify-playback-state' | 'user-read-currently-playing' | 'user-read-email' | 'user-read-playback-position' | 'user-read-playback-state' | 'user-read-private' | 'user-read-recently-played' | 'user-top-read';
|
|
2
|
-
export interface
|
|
2
|
+
export interface SpotifyConfig {
|
|
3
3
|
clientID: string;
|
|
4
4
|
tokenRefreshURL: string;
|
|
5
5
|
tokenSwapURL: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ConfigPlugin } from 'expo/config-plugins';
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
1
|
+
import { type ConfigPlugin } from 'expo/config-plugins';
|
|
2
|
+
import { SpotifyConfig } from './types';
|
|
3
|
+
export declare const withSpotifyOAuthConfig: ConfigPlugin<SpotifyConfig>;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.withSpotifyOAuthConfig = void 0;
|
|
4
4
|
const config_plugins_1 = require("expo/config-plugins");
|
|
5
|
-
const
|
|
5
|
+
const withSpotifyOAuthConfigIOS = (config, spotifyConfig) => {
|
|
6
6
|
return (0, config_plugins_1.withInfoPlist)(config, (config) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
config.modResults.SpotifyClientID = spotifyConfig.clientID;
|
|
8
|
+
config.modResults.SpotifyScheme = spotifyConfig.scheme;
|
|
9
|
+
config.modResults.SpotifyCallback = spotifyConfig.callback;
|
|
10
|
+
config.modResults.SpotifyScopes = spotifyConfig.scopes;
|
|
11
|
+
config.modResults.tokenRefreshURL = spotifyConfig.tokenRefreshURL;
|
|
12
|
+
config.modResults.tokenSwapURL = spotifyConfig.tokenSwapURL;
|
|
10
13
|
return config;
|
|
11
14
|
});
|
|
12
15
|
};
|
|
13
|
-
const
|
|
14
|
-
config =
|
|
16
|
+
const withSpotifyOAuthConfig = (config, spotifyConfig) => {
|
|
17
|
+
config = withSpotifyOAuthConfigIOS(config, spotifyConfig);
|
|
15
18
|
return config;
|
|
16
19
|
};
|
|
17
|
-
exports.
|
|
20
|
+
exports.withSpotifyOAuthConfig = withSpotifyOAuthConfig;
|
package/plugin/src/index.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { ConfigPlugin } from '@expo/config-plugins'
|
|
1
|
+
import { type ConfigPlugin, createRunOncePlugin } from '@expo/config-plugins'
|
|
2
2
|
|
|
3
3
|
import { withSpotifyQueryScheme } from './ios/withSpotifyQueryScheme'
|
|
4
4
|
import { withSpotifyURLScheme } from './ios/withSpotifyURLScheme'
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { SpotifyConfig } from './types'
|
|
6
|
+
import { withSpotifyOAuthConfig } from './withSpotifyConfig'
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import pkg from '../../package.json'
|
|
9
|
+
|
|
10
|
+
const withSpotifyAuth: ConfigPlugin<SpotifyConfig> = (config, props) => {
|
|
11
|
+
config = withSpotifyOAuthConfig(config, props)
|
|
10
12
|
|
|
11
13
|
// iOS specific
|
|
12
14
|
config = withSpotifyQueryScheme(config, props)
|
|
@@ -15,4 +17,4 @@ const withSpotifyRemote: ConfigPlugin<ISpotifyConfig> = (config, props) => {
|
|
|
15
17
|
return config
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
export default
|
|
20
|
+
export default createRunOncePlugin(withSpotifyAuth, pkg.name, pkg.version);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ConfigPlugin, withInfoPlist } from "expo/config-plugins";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { SpotifyConfig } from "../types";
|
|
4
4
|
|
|
5
5
|
const spotifyScheme = "spotify";
|
|
6
6
|
|
|
7
|
-
export const withSpotifyQueryScheme: ConfigPlugin<
|
|
7
|
+
export const withSpotifyQueryScheme: ConfigPlugin<SpotifyConfig> = (config) =>
|
|
8
8
|
withInfoPlist(config, (config) => {
|
|
9
9
|
if (!config.modResults.LSApplicationQueriesSchemes) {
|
|
10
10
|
config.modResults.LSApplicationQueriesSchemes = [];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ConfigPlugin, withInfoPlist } from "expo/config-plugins";
|
|
1
|
+
import { type ConfigPlugin, withInfoPlist } from "expo/config-plugins";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { SpotifyConfig } from "../types";
|
|
4
4
|
|
|
5
|
-
export const withSpotifyURLScheme: ConfigPlugin<
|
|
5
|
+
export const withSpotifyURLScheme: ConfigPlugin<SpotifyConfig> = (
|
|
6
6
|
config,
|
|
7
7
|
{ scheme }
|
|
8
8
|
) => {
|
package/plugin/src/types.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { ConfigPlugin, withInfoPlist } from 'expo/config-plugins'
|
|
1
|
+
import { type ConfigPlugin, withInfoPlist } from 'expo/config-plugins'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { SpotifyConfig } from './types'
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const withSpotifyOAuthConfigIOS: ConfigPlugin<SpotifyConfig> = (config, spotifyConfig) => {
|
|
6
6
|
return withInfoPlist(config, (config) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
config = withSpotifyConfigIOS(config, spotifyConfig)
|
|
7
|
+
config.modResults.SpotifyClientID = spotifyConfig.clientID;
|
|
8
|
+
config.modResults.SpotifyScheme = spotifyConfig.scheme;
|
|
9
|
+
config.modResults.SpotifyCallback = spotifyConfig.callback;
|
|
10
|
+
config.modResults.SpotifyScopes = spotifyConfig.scopes;
|
|
11
|
+
config.modResults.tokenRefreshURL = spotifyConfig.tokenRefreshURL;
|
|
12
|
+
config.modResults.tokenSwapURL = spotifyConfig.tokenSwapURL;
|
|
13
|
+
return config;
|
|
14
|
+
});
|
|
15
|
+
};
|
|
17
16
|
|
|
17
|
+
export const withSpotifyOAuthConfig: ConfigPlugin<SpotifyConfig> = (config, spotifyConfig) => {
|
|
18
|
+
config = withSpotifyOAuthConfigIOS(config, spotifyConfig)
|
|
18
19
|
return config
|
|
19
20
|
}
|
package/plugin/tsconfig.json
CHANGED