@youversion/platform-core 1.20.1 → 1.21.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.
@@ -1,69 +0,0 @@
1
- import { vi } from 'vitest';
2
-
3
- /**
4
- * Creates a mock OAuth token response for testing
5
- * @param overrides Optional properties to override the default values
6
- */
7
- export const createMockTokenResponse = (
8
- overrides: Record<string, unknown> = {},
9
- ): Record<string, unknown> => ({
10
- access_token: 'access-token-123',
11
- expires_in: 3600,
12
- id_token:
13
- 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJlbWFpbCI6ImpvaG5AZXhhbXBsZS5jb20iLCJwcm9maWxlX3BpY3R1cmUiOiJodHRwczovL2V4YW1wbGUuY29tL2F2YXRhci5qcGcifQ.invalid-signature',
14
- refresh_token: 'refresh-token-456',
15
- scope: 'bibles highlights openid',
16
- token_type: 'Bearer',
17
- ...overrides,
18
- });
19
-
20
- /**
21
- * Creates a mock fetch response for testing
22
- * @param data The response data
23
- * @param options Optional properties to override the default response
24
- */
25
- export const createMockFetchResponse = (
26
- data: unknown,
27
- options: Record<string, unknown> = {},
28
- ): Record<string, unknown> => ({
29
- ok: true,
30
- status: 200,
31
- statusText: 'OK',
32
- json: vi.fn().mockResolvedValue(data),
33
- text: vi.fn().mockResolvedValue(JSON.stringify(data)),
34
- clone: vi.fn(() => ({
35
- text: vi.fn().mockResolvedValue(JSON.stringify(data)),
36
- })),
37
- ...options,
38
- });
39
-
40
- /**
41
- * Creates a mock error fetch response for testing
42
- * @param status The HTTP status code
43
- * @param statusText The HTTP status text
44
- */
45
- export const createMockErrorFetchResponse = (
46
- status: number,
47
- statusText: string,
48
- ): Record<string, unknown> => ({
49
- ok: false,
50
- status,
51
- statusText,
52
- json: vi.fn().mockRejectedValue(new Error('Response not JSON')),
53
- text: vi.fn().mockResolvedValue(''),
54
- });
55
-
56
- /**
57
- * Creates a mock refresh token response for testing
58
- * @param overrides Optional properties to override the default values
59
- */
60
- export const createMockRefreshTokenResponse = (
61
- overrides: Record<string, unknown> = {},
62
- ): Record<string, unknown> => ({
63
- access_token: 'new-access-token',
64
- expires_in: 3600,
65
- refresh_token: 'new-refresh-token',
66
- scope: 'bibles highlights openid',
67
- token_type: 'Bearer',
68
- ...overrides,
69
- });
package/src/highlight.ts DELETED
@@ -1,16 +0,0 @@
1
- import type { HighlightColor } from './types';
2
-
3
- export const HIGHLIGHT_COLORS: HighlightColor[] = [
4
- { id: 0, color: '#fffe00', label: 'Yellow' },
5
- { id: 1, color: '#5dff79', label: 'Green' },
6
- { id: 2, color: '#00d6ff', label: 'Blue' },
7
- { id: 3, color: '#ffc66f', label: 'Orange' },
8
- { id: 4, color: '#ff95ef', label: 'Pink' },
9
- ] as const;
10
-
11
- export function hexToRgba(hex: string, alpha: number): string {
12
- const r = parseInt(hex.slice(1, 3), 16);
13
- const g = parseInt(hex.slice(3, 5), 16);
14
- const b = parseInt(hex.slice(5, 7), 16);
15
- return `rgba(${r}, ${g}, ${b}, ${alpha})`;
16
- }
@@ -1,7 +0,0 @@
1
- export interface ApiConfig {
2
- apiHost?: string;
3
- appKey: string;
4
- timeout?: number;
5
- installationId?: string;
6
- redirectUri?: string;
7
- }
package/src/types/auth.ts DELETED
@@ -1,18 +0,0 @@
1
- import type {
2
- SignInWithYouVersionPermission,
3
- SignInWithYouVersionResult,
4
- } from '../SignInWithYouVersionResult';
5
-
6
- export type SignInWithYouVersionPermissionValues =
7
- (typeof SignInWithYouVersionPermission)[keyof typeof SignInWithYouVersionPermission];
8
-
9
- export interface AuthenticationState {
10
- readonly isAuthenticated: boolean;
11
- readonly isLoading: boolean;
12
- readonly accessToken: string | null;
13
- readonly idToken: string | null;
14
- readonly result: SignInWithYouVersionResult | null;
15
- readonly error: Error | null;
16
- }
17
-
18
- export type AuthenticationScopes = 'profile' | 'email';
@@ -1,9 +0,0 @@
1
- /**
2
- * Legacy type for highlight colors (constants only)
3
- * Not an API response, so no schema needed
4
- */
5
- export interface HighlightColor {
6
- id: number;
7
- color: string;
8
- label: string;
9
- }