@mulmoclaude/spotify-plugin 0.1.0
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/dist/Preview.vue.d.ts +15 -0
- package/dist/View.vue.d.ts +3 -0
- package/dist/client.d.ts +49 -0
- package/dist/definition-CfBmxEFr.js +4388 -0
- package/dist/definition-CfBmxEFr.js.map +1 -0
- package/dist/definition.d.ts +76 -0
- package/dist/index.d.ts +141 -0
- package/dist/index.js +1364 -0
- package/dist/index.js.map +1 -0
- package/dist/lang/en.d.ts +55 -0
- package/dist/lang/index.d.ts +107 -0
- package/dist/lang/ja.d.ts +55 -0
- package/dist/listening.d.ts +29 -0
- package/dist/normalize.d.ts +18 -0
- package/dist/oauth.d.ts +36 -0
- package/dist/playback.d.ts +30 -0
- package/dist/profile.d.ts +32 -0
- package/dist/schemas.d.ts +135 -0
- package/dist/search.d.ts +19 -0
- package/dist/searchSummary.d.ts +20 -0
- package/dist/style.css +367 -0
- package/dist/time.d.ts +2 -0
- package/dist/tokens.d.ts +19 -0
- package/dist/types.d.ts +170 -0
- package/dist/vue.d.ts +80 -0
- package/dist/vue.js +867 -0
- package/dist/vue.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NormalisedPlaylist, NormalisedTrack, RecentlyPlayedItem, SearchResult } from './types';
|
|
2
|
+
export interface Props {
|
|
3
|
+
selectedResult: {
|
|
4
|
+
ok?: boolean;
|
|
5
|
+
data?: NormalisedTrack[] | NormalisedPlaylist[] | RecentlyPlayedItem[] | NormalisedTrack | SearchResult | null | {
|
|
6
|
+
connected?: boolean;
|
|
7
|
+
clientIdConfigured?: boolean;
|
|
8
|
+
};
|
|
9
|
+
error?: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { PluginRuntime } from 'gui-chat-protocol';
|
|
2
|
+
import { SpotifyTokens } from './types';
|
|
3
|
+
/** Reasons the client returns instead of throwing. The dispatch
|
|
4
|
+
* layer (`index.ts`) maps these to the user-facing `instructions`
|
|
5
|
+
* field of the SpotifyError union.
|
|
6
|
+
*
|
|
7
|
+
* `auth_expired` means the credential is unusable — refresh token
|
|
8
|
+
* was rejected by Spotify, or the protocol response was malformed
|
|
9
|
+
* in a way that's indistinguishable from rejection. The user has to
|
|
10
|
+
* reconnect.
|
|
11
|
+
*
|
|
12
|
+
* `transient_error` means the refresh path failed in a way that
|
|
13
|
+
* doesn't imply the credential is bad — network timeout, 5xx from
|
|
14
|
+
* Spotify, JSON parse failure (likely proxy / middleware). Caller
|
|
15
|
+
* should retry later, NOT prompt the user to reconnect. */
|
|
16
|
+
export type SpotifyClientError = {
|
|
17
|
+
kind: "not_connected";
|
|
18
|
+
} | {
|
|
19
|
+
kind: "auth_expired";
|
|
20
|
+
detail: string;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "transient_error";
|
|
23
|
+
detail: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: "rate_limited";
|
|
26
|
+
retryAfterSec: number;
|
|
27
|
+
} | {
|
|
28
|
+
kind: "spotify_api_error";
|
|
29
|
+
status: number;
|
|
30
|
+
body: string;
|
|
31
|
+
};
|
|
32
|
+
export type SpotifyClientResult<T> = {
|
|
33
|
+
ok: true;
|
|
34
|
+
data: T;
|
|
35
|
+
} | {
|
|
36
|
+
ok: false;
|
|
37
|
+
error: SpotifyClientError;
|
|
38
|
+
};
|
|
39
|
+
/** Make an authenticated Spotify API call. Path is relative to
|
|
40
|
+
* `https://api.spotify.com` (e.g. `/v1/me/player/recently-played`). */
|
|
41
|
+
export declare function spotifyApi<T = unknown>(runtime: PluginRuntime, clientId: string, initialTokens: SpotifyTokens, method: "GET" | "POST" | "PUT" | "DELETE", apiPath: string, init?: {
|
|
42
|
+
body?: unknown;
|
|
43
|
+
}, now?: () => Date): Promise<SpotifyClientResult<T>>;
|
|
44
|
+
/** Parse a `Retry-After` header. Spotify normally returns delta-
|
|
45
|
+
* seconds (an integer) but the RFC also allows HTTP-date format.
|
|
46
|
+
* Anything non-finite or non-positive collapses to a safe 60s
|
|
47
|
+
* fallback so callers never propagate `NaN` (Codex review on
|
|
48
|
+
* PR #1164 caught this). */
|
|
49
|
+
export declare function parseRetryAfterSec(headerValue: string | null): number;
|