@quranjs/api 2.1.0 → 3.0.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/README.md +30 -10
- package/dist/index-BZgqOfA4.d.mts +228 -0
- package/dist/index-BZgqOfA4.d.ts +228 -0
- package/dist/index.d.mts +9 -921
- package/dist/index.d.ts +9 -921
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +2 -2
- package/dist/index.min.mjs.map +1 -1
- package/dist/public.d.mts +212 -0
- package/dist/public.d.ts +212 -0
- package/dist/public.min.js +3 -0
- package/dist/public.min.js.map +1 -0
- package/dist/public.min.mjs +3 -0
- package/dist/public.min.mjs.map +1 -0
- package/dist/runtime-utils-CxjOQDsB.d.mts +3 -0
- package/dist/runtime-utils-CxjOQDsB.d.ts +3 -0
- package/dist/server.d.mts +337 -0
- package/dist/server.d.ts +337 -0
- package/dist/server.min.js +3 -0
- package/dist/server.min.js.map +1 -0
- package/dist/server.min.mjs +3 -0
- package/dist/server.min.mjs.map +1 -0
- package/dist/verses-DnPcyHIi.d.ts +739 -0
- package/dist/verses-qzAdux2V.d.mts +739 -0
- package/package.json +25 -3
package/README.md
CHANGED
|
@@ -9,7 +9,10 @@ A JavaScript/TypeScript library for fetching **authentic, scholarly verified Qur
|
|
|
9
9
|
|
|
10
10
|
Unlike other sources, this SDK connects you directly to the **[Quran Foundation](https://quran.foundation)**—ensuring a **trusted, highly scrutinized source** of reliable content, including properly licensed translations, tafsir, and supplementary materials.
|
|
11
11
|
|
|
12
|
-
Works
|
|
12
|
+
Works in both server and browser environments through separate runtime entrypoints:
|
|
13
|
+
|
|
14
|
+
- `@quranjs/api/server`
|
|
15
|
+
- `@quranjs/api/public`
|
|
13
16
|
|
|
14
17
|
**Built by the [Quran Foundation](https://quran.foundation) — the team behind [Quran.com](https://quran.com)**
|
|
15
18
|
|
|
@@ -29,21 +32,38 @@ pnpm add @quranjs/api
|
|
|
29
32
|
## Quick Start
|
|
30
33
|
|
|
31
34
|
```typescript
|
|
32
|
-
import {
|
|
35
|
+
import { SearchMode } from "@quranjs/api";
|
|
36
|
+
import { createServerClient } from "@quranjs/api/server";
|
|
37
|
+
|
|
38
|
+
const client = createServerClient({
|
|
39
|
+
clientId: process.env.CLIENT_ID!,
|
|
40
|
+
clientSecret: process.env.CLIENT_SECRET!,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const chapters = await client.content.v4.chapters.list();
|
|
44
|
+
const results = await client.search.v1.query({
|
|
45
|
+
query: "mercy",
|
|
46
|
+
mode: SearchMode.Quick,
|
|
47
|
+
});
|
|
48
|
+
```
|
|
33
49
|
|
|
34
|
-
|
|
35
|
-
const chapters = await quran.v4.chapters.findAll();
|
|
50
|
+
For browser or mobile apps, use `@quranjs/api/public`. Public usage docs live in the API docs portal.
|
|
36
51
|
|
|
37
|
-
|
|
38
|
-
const surah = await quran.v4.chapters.findById(1);
|
|
52
|
+
Existing `QuranClient` imports from `@quranjs/api` remain supported for backwards compatibility:
|
|
39
53
|
|
|
40
|
-
|
|
41
|
-
|
|
54
|
+
```typescript
|
|
55
|
+
import { QuranClient } from "@quranjs/api";
|
|
42
56
|
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
const client = new QuranClient({
|
|
58
|
+
clientId: process.env.CLIENT_ID!,
|
|
59
|
+
clientSecret: process.env.CLIENT_SECRET!,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const chapters = await client.chapters.findAll();
|
|
45
63
|
```
|
|
46
64
|
|
|
65
|
+
For new apps, prefer the runtime-specific `@quranjs/api/server` and `@quranjs/api/public` entrypoints.
|
|
66
|
+
|
|
47
67
|
## Documentation
|
|
48
68
|
|
|
49
69
|
For complete documentation, guides, and API reference, visit:
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
type ApiParams = Record<string, string | number | boolean | unknown[] | undefined | Record<string, boolean>>;
|
|
2
|
+
/**
|
|
3
|
+
* Base parameters that are common across most API endpoints
|
|
4
|
+
*/
|
|
5
|
+
interface BaseApiParams extends ApiParams {
|
|
6
|
+
/** Language for the response */
|
|
7
|
+
language?: Language;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Pagination parameters
|
|
11
|
+
*/
|
|
12
|
+
interface PaginationParams extends ApiParams {
|
|
13
|
+
/** Page number for pagination */
|
|
14
|
+
page?: number;
|
|
15
|
+
/** Number of items per page */
|
|
16
|
+
perPage?: number;
|
|
17
|
+
}
|
|
18
|
+
type BinaryString = "0" | "1";
|
|
19
|
+
declare enum SearchMode {
|
|
20
|
+
Advanced = "advanced",
|
|
21
|
+
Quick = "quick"
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Search parameters
|
|
25
|
+
*/
|
|
26
|
+
interface SearchParams extends BaseApiParams {
|
|
27
|
+
/** Search mode */
|
|
28
|
+
mode: SearchMode;
|
|
29
|
+
/** Search query */
|
|
30
|
+
query: string;
|
|
31
|
+
/** Filter translations */
|
|
32
|
+
filterTranslations?: string | string[];
|
|
33
|
+
/** For advanced search, limit to exact matches */
|
|
34
|
+
exactMatchesOnly?: BinaryString;
|
|
35
|
+
/** Include text in the response */
|
|
36
|
+
getText?: BinaryString;
|
|
37
|
+
/** Include highlighted text */
|
|
38
|
+
highlight?: BinaryString;
|
|
39
|
+
/** Quick search navigational results count */
|
|
40
|
+
navigationalResultsNumber?: number;
|
|
41
|
+
/** Quick search verse results count */
|
|
42
|
+
versesResultsNumber?: number;
|
|
43
|
+
/** Comma-separated list of indexes */
|
|
44
|
+
indexes?: string | string[];
|
|
45
|
+
/** Page number for pagination */
|
|
46
|
+
page?: number;
|
|
47
|
+
/** Number of results to return */
|
|
48
|
+
size?: number;
|
|
49
|
+
/** Translation IDs to use for language detection */
|
|
50
|
+
translationIds?: string | number | Array<string | number>;
|
|
51
|
+
/** Quran fields to include in verse filters */
|
|
52
|
+
fields?: Partial<Record<VerseField, boolean>>;
|
|
53
|
+
/** Translation fields to include in verse filters */
|
|
54
|
+
translationFields?: Partial<Record<TranslationField, boolean>>;
|
|
55
|
+
/** Word fields to include in verse filters */
|
|
56
|
+
wordFields?: Partial<Record<WordField, boolean>>;
|
|
57
|
+
/** Include word data in verse filters */
|
|
58
|
+
words?: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
type AuthService = "auth" | "quranReflect";
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Custom fetcher function type that matches the native fetch API
|
|
65
|
+
*/
|
|
66
|
+
type CustomFetcher = typeof fetch;
|
|
67
|
+
type RuntimeMode = "server" | "public";
|
|
68
|
+
type HTTPMethod = "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
|
|
69
|
+
interface QuranFetchClient {
|
|
70
|
+
fetch<T = unknown>(url: string, params?: ApiParams): Promise<T>;
|
|
71
|
+
}
|
|
72
|
+
type ApiService = "content" | "search" | AuthService | "oauth2";
|
|
73
|
+
interface ServiceEnvironmentConfig {
|
|
74
|
+
gatewayUrl?: string;
|
|
75
|
+
tokenHost?: string;
|
|
76
|
+
oauth2BaseUrl?: string;
|
|
77
|
+
contentBaseUrl?: string;
|
|
78
|
+
searchBaseUrl?: string;
|
|
79
|
+
authBaseUrl?: string;
|
|
80
|
+
quranReflectBaseUrl?: string;
|
|
81
|
+
}
|
|
82
|
+
interface QuranClientConfig {
|
|
83
|
+
/** Client ID for authentication */
|
|
84
|
+
clientId: string;
|
|
85
|
+
/** Client secret for authentication */
|
|
86
|
+
clientSecret: string;
|
|
87
|
+
/** Legacy gateway base URL for content/search APIs */
|
|
88
|
+
contentBaseUrl?: string;
|
|
89
|
+
/** Legacy OAuth2 token host URL */
|
|
90
|
+
authBaseUrl?: string;
|
|
91
|
+
/** Custom fetch implementation */
|
|
92
|
+
fetch?: CustomFetcher;
|
|
93
|
+
/** Default parameters for all API calls */
|
|
94
|
+
defaults?: Partial<BaseApiParams>;
|
|
95
|
+
}
|
|
96
|
+
interface UserSession {
|
|
97
|
+
accessToken: string;
|
|
98
|
+
refreshToken?: string;
|
|
99
|
+
idToken?: string;
|
|
100
|
+
scope?: string;
|
|
101
|
+
tokenType?: string;
|
|
102
|
+
expiresAt?: number;
|
|
103
|
+
}
|
|
104
|
+
interface TokenStorage {
|
|
105
|
+
getSession?: () => UserSession | null | undefined | Promise<UserSession | null | undefined>;
|
|
106
|
+
setSession?: (session: UserSession | null) => void | Promise<void>;
|
|
107
|
+
clearSession?: () => void | Promise<void>;
|
|
108
|
+
}
|
|
109
|
+
interface BaseRuntimeClientConfig {
|
|
110
|
+
clientId: string;
|
|
111
|
+
fetch?: CustomFetcher;
|
|
112
|
+
defaults?: Partial<BaseApiParams>;
|
|
113
|
+
services?: ServiceEnvironmentConfig;
|
|
114
|
+
userSession?: UserSession;
|
|
115
|
+
storage?: TokenStorage;
|
|
116
|
+
}
|
|
117
|
+
interface ServerClientConfig extends BaseRuntimeClientConfig {
|
|
118
|
+
clientSecret: string;
|
|
119
|
+
}
|
|
120
|
+
interface PublicClientConfig extends BaseRuntimeClientConfig {
|
|
121
|
+
clientType: "public" | "confidential-proxy";
|
|
122
|
+
}
|
|
123
|
+
interface CachedToken {
|
|
124
|
+
value: string;
|
|
125
|
+
expiresAt: number;
|
|
126
|
+
}
|
|
127
|
+
interface TokenResponse {
|
|
128
|
+
access_token: string;
|
|
129
|
+
token_type?: string;
|
|
130
|
+
expires_in: number;
|
|
131
|
+
refresh_token?: string;
|
|
132
|
+
id_token?: string;
|
|
133
|
+
scope?: string;
|
|
134
|
+
}
|
|
135
|
+
interface OperationRequest {
|
|
136
|
+
path?: Record<string, string | number>;
|
|
137
|
+
query?: ApiParams;
|
|
138
|
+
body?: string | URLSearchParams | Record<string, unknown> | null;
|
|
139
|
+
headers?: Record<string, string>;
|
|
140
|
+
method?: HTTPMethod;
|
|
141
|
+
auth?: "auto" | "none" | "app" | "user";
|
|
142
|
+
accessToken?: string;
|
|
143
|
+
basicAuth?: {
|
|
144
|
+
username: string;
|
|
145
|
+
password: string;
|
|
146
|
+
};
|
|
147
|
+
contentType?: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare enum Language {
|
|
151
|
+
ARABIC = "ar",
|
|
152
|
+
ENGLISH = "en",
|
|
153
|
+
URDU = "ur",
|
|
154
|
+
BENGALI = "bn",
|
|
155
|
+
TURKISH = "tr",
|
|
156
|
+
SPANISH = "es",
|
|
157
|
+
GERMAN = "de",
|
|
158
|
+
BOSNIAN = "bs",
|
|
159
|
+
RUSSIAN = "ru",
|
|
160
|
+
ALBANIAN_AL = "al",
|
|
161
|
+
FRENCH = "fr",
|
|
162
|
+
DUTCH = "nl",
|
|
163
|
+
TAMIL = "ta",
|
|
164
|
+
TAJIK = "tg",
|
|
165
|
+
INDONESIAN = "id",
|
|
166
|
+
UZBEK = "uz",
|
|
167
|
+
VIETNAMESE = "vi",
|
|
168
|
+
CHINESE = "zh",
|
|
169
|
+
ITALIAN = "it",
|
|
170
|
+
JAPANESE = "ja",
|
|
171
|
+
MALAYALAM = "ml",
|
|
172
|
+
AMHARIC = "am",
|
|
173
|
+
KAZAKH = "kk",
|
|
174
|
+
PORTUGUESE = "pt",
|
|
175
|
+
TAGALOG = "tl",
|
|
176
|
+
THAI = "th",
|
|
177
|
+
KOREAN = "ko",
|
|
178
|
+
HINDI = "hi",
|
|
179
|
+
KURDISH = "ku",
|
|
180
|
+
HAUSA = "ha",
|
|
181
|
+
AZERI = "az",
|
|
182
|
+
SWAHILI = "sw",
|
|
183
|
+
PERSIAN = "fa",
|
|
184
|
+
SERBIAN = "sr",
|
|
185
|
+
MARANAO = "mrn",
|
|
186
|
+
AMAZIGH = "zgh",
|
|
187
|
+
ASSAMESE = "as",
|
|
188
|
+
BULGARIAN = "bg",
|
|
189
|
+
CHECHEN = "ce",
|
|
190
|
+
CZECH = "cs",
|
|
191
|
+
DIVEHI = "dv",
|
|
192
|
+
FINNISH = "fi",
|
|
193
|
+
GUJAARATI = "gu",
|
|
194
|
+
HEBREW = "he",
|
|
195
|
+
GEORGIAN = "ka",
|
|
196
|
+
CENTRAL_KHMER = "km",
|
|
197
|
+
GANDA = "lg",
|
|
198
|
+
MARATHI = "mr",
|
|
199
|
+
YORUBA = "yo",
|
|
200
|
+
MALAY = "ms",
|
|
201
|
+
NEPALI = "ne",
|
|
202
|
+
SWEDISH = "sv",
|
|
203
|
+
TELUGU = "te",
|
|
204
|
+
TATAR = "tt",
|
|
205
|
+
UYGHUR = "ug",
|
|
206
|
+
UKRAINIAN = "uk",
|
|
207
|
+
NORWEGIAN = "no",
|
|
208
|
+
OROMO = "om",
|
|
209
|
+
POLISH = "pl",
|
|
210
|
+
PASHTO = "ps",
|
|
211
|
+
ROMANIAN = "ro",
|
|
212
|
+
SINDHI = "sd",
|
|
213
|
+
NORTHERN_SAMI = "se",
|
|
214
|
+
SINHALA = "si",
|
|
215
|
+
SOMALI = "so",
|
|
216
|
+
ALBANIAN_SQ = "sq"
|
|
217
|
+
}
|
|
218
|
+
declare enum QuranFont {
|
|
219
|
+
MadaniV1 = "code_v1",
|
|
220
|
+
MadaniV2 = "code_v2",
|
|
221
|
+
Uthmani = "text_uthmani"
|
|
222
|
+
}
|
|
223
|
+
type VerseField = "chapterId" | "textUthmani" | "textUthmaniSimple" | "textImlaei" | "textImlaeiSimple" | "textIndopak" | "textIndopakNastaleeq" | "textUthmaniTajweed" | "imageUrl" | "imageWidth" | "codeV1" | "codeV2" | "v1Page" | "v2Page";
|
|
224
|
+
type WordField = "v1Page" | "v2Page" | "textUthmani" | "textImlaei" | "textIndopak" | "verseKey" | "location" | "codeV1" | "codeV2";
|
|
225
|
+
type TranslationField = "resourceName" | "verseId" | "languageId" | "languageName" | "verseKey" | "chapterId" | "verseNumber" | "juzNumber" | "hizbNumber" | "rubNumber" | "pageNumber";
|
|
226
|
+
type VerseRecitationField = "id" | "chapterId" | "segments" | "format";
|
|
227
|
+
|
|
228
|
+
export { type ApiParams as A, type BaseApiParams as B, type CustomFetcher as C, type HTTPMethod as H, Language as L, type OperationRequest as O, type PaginationParams as P, type QuranClientConfig as Q, type RuntimeMode as R, SearchMode as S, type TranslationField as T, type UserSession as U, type VerseField as V, type WordField as W, QuranFont as a, type VerseRecitationField as b, type BinaryString as c, type SearchParams as d, type QuranFetchClient as e, type ApiService as f, type ServiceEnvironmentConfig as g, type TokenStorage as h, type ServerClientConfig as i, type PublicClientConfig as j, type CachedToken as k, type TokenResponse as l };
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
type ApiParams = Record<string, string | number | boolean | unknown[] | undefined | Record<string, boolean>>;
|
|
2
|
+
/**
|
|
3
|
+
* Base parameters that are common across most API endpoints
|
|
4
|
+
*/
|
|
5
|
+
interface BaseApiParams extends ApiParams {
|
|
6
|
+
/** Language for the response */
|
|
7
|
+
language?: Language;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Pagination parameters
|
|
11
|
+
*/
|
|
12
|
+
interface PaginationParams extends ApiParams {
|
|
13
|
+
/** Page number for pagination */
|
|
14
|
+
page?: number;
|
|
15
|
+
/** Number of items per page */
|
|
16
|
+
perPage?: number;
|
|
17
|
+
}
|
|
18
|
+
type BinaryString = "0" | "1";
|
|
19
|
+
declare enum SearchMode {
|
|
20
|
+
Advanced = "advanced",
|
|
21
|
+
Quick = "quick"
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Search parameters
|
|
25
|
+
*/
|
|
26
|
+
interface SearchParams extends BaseApiParams {
|
|
27
|
+
/** Search mode */
|
|
28
|
+
mode: SearchMode;
|
|
29
|
+
/** Search query */
|
|
30
|
+
query: string;
|
|
31
|
+
/** Filter translations */
|
|
32
|
+
filterTranslations?: string | string[];
|
|
33
|
+
/** For advanced search, limit to exact matches */
|
|
34
|
+
exactMatchesOnly?: BinaryString;
|
|
35
|
+
/** Include text in the response */
|
|
36
|
+
getText?: BinaryString;
|
|
37
|
+
/** Include highlighted text */
|
|
38
|
+
highlight?: BinaryString;
|
|
39
|
+
/** Quick search navigational results count */
|
|
40
|
+
navigationalResultsNumber?: number;
|
|
41
|
+
/** Quick search verse results count */
|
|
42
|
+
versesResultsNumber?: number;
|
|
43
|
+
/** Comma-separated list of indexes */
|
|
44
|
+
indexes?: string | string[];
|
|
45
|
+
/** Page number for pagination */
|
|
46
|
+
page?: number;
|
|
47
|
+
/** Number of results to return */
|
|
48
|
+
size?: number;
|
|
49
|
+
/** Translation IDs to use for language detection */
|
|
50
|
+
translationIds?: string | number | Array<string | number>;
|
|
51
|
+
/** Quran fields to include in verse filters */
|
|
52
|
+
fields?: Partial<Record<VerseField, boolean>>;
|
|
53
|
+
/** Translation fields to include in verse filters */
|
|
54
|
+
translationFields?: Partial<Record<TranslationField, boolean>>;
|
|
55
|
+
/** Word fields to include in verse filters */
|
|
56
|
+
wordFields?: Partial<Record<WordField, boolean>>;
|
|
57
|
+
/** Include word data in verse filters */
|
|
58
|
+
words?: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
type AuthService = "auth" | "quranReflect";
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Custom fetcher function type that matches the native fetch API
|
|
65
|
+
*/
|
|
66
|
+
type CustomFetcher = typeof fetch;
|
|
67
|
+
type RuntimeMode = "server" | "public";
|
|
68
|
+
type HTTPMethod = "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
|
|
69
|
+
interface QuranFetchClient {
|
|
70
|
+
fetch<T = unknown>(url: string, params?: ApiParams): Promise<T>;
|
|
71
|
+
}
|
|
72
|
+
type ApiService = "content" | "search" | AuthService | "oauth2";
|
|
73
|
+
interface ServiceEnvironmentConfig {
|
|
74
|
+
gatewayUrl?: string;
|
|
75
|
+
tokenHost?: string;
|
|
76
|
+
oauth2BaseUrl?: string;
|
|
77
|
+
contentBaseUrl?: string;
|
|
78
|
+
searchBaseUrl?: string;
|
|
79
|
+
authBaseUrl?: string;
|
|
80
|
+
quranReflectBaseUrl?: string;
|
|
81
|
+
}
|
|
82
|
+
interface QuranClientConfig {
|
|
83
|
+
/** Client ID for authentication */
|
|
84
|
+
clientId: string;
|
|
85
|
+
/** Client secret for authentication */
|
|
86
|
+
clientSecret: string;
|
|
87
|
+
/** Legacy gateway base URL for content/search APIs */
|
|
88
|
+
contentBaseUrl?: string;
|
|
89
|
+
/** Legacy OAuth2 token host URL */
|
|
90
|
+
authBaseUrl?: string;
|
|
91
|
+
/** Custom fetch implementation */
|
|
92
|
+
fetch?: CustomFetcher;
|
|
93
|
+
/** Default parameters for all API calls */
|
|
94
|
+
defaults?: Partial<BaseApiParams>;
|
|
95
|
+
}
|
|
96
|
+
interface UserSession {
|
|
97
|
+
accessToken: string;
|
|
98
|
+
refreshToken?: string;
|
|
99
|
+
idToken?: string;
|
|
100
|
+
scope?: string;
|
|
101
|
+
tokenType?: string;
|
|
102
|
+
expiresAt?: number;
|
|
103
|
+
}
|
|
104
|
+
interface TokenStorage {
|
|
105
|
+
getSession?: () => UserSession | null | undefined | Promise<UserSession | null | undefined>;
|
|
106
|
+
setSession?: (session: UserSession | null) => void | Promise<void>;
|
|
107
|
+
clearSession?: () => void | Promise<void>;
|
|
108
|
+
}
|
|
109
|
+
interface BaseRuntimeClientConfig {
|
|
110
|
+
clientId: string;
|
|
111
|
+
fetch?: CustomFetcher;
|
|
112
|
+
defaults?: Partial<BaseApiParams>;
|
|
113
|
+
services?: ServiceEnvironmentConfig;
|
|
114
|
+
userSession?: UserSession;
|
|
115
|
+
storage?: TokenStorage;
|
|
116
|
+
}
|
|
117
|
+
interface ServerClientConfig extends BaseRuntimeClientConfig {
|
|
118
|
+
clientSecret: string;
|
|
119
|
+
}
|
|
120
|
+
interface PublicClientConfig extends BaseRuntimeClientConfig {
|
|
121
|
+
clientType: "public" | "confidential-proxy";
|
|
122
|
+
}
|
|
123
|
+
interface CachedToken {
|
|
124
|
+
value: string;
|
|
125
|
+
expiresAt: number;
|
|
126
|
+
}
|
|
127
|
+
interface TokenResponse {
|
|
128
|
+
access_token: string;
|
|
129
|
+
token_type?: string;
|
|
130
|
+
expires_in: number;
|
|
131
|
+
refresh_token?: string;
|
|
132
|
+
id_token?: string;
|
|
133
|
+
scope?: string;
|
|
134
|
+
}
|
|
135
|
+
interface OperationRequest {
|
|
136
|
+
path?: Record<string, string | number>;
|
|
137
|
+
query?: ApiParams;
|
|
138
|
+
body?: string | URLSearchParams | Record<string, unknown> | null;
|
|
139
|
+
headers?: Record<string, string>;
|
|
140
|
+
method?: HTTPMethod;
|
|
141
|
+
auth?: "auto" | "none" | "app" | "user";
|
|
142
|
+
accessToken?: string;
|
|
143
|
+
basicAuth?: {
|
|
144
|
+
username: string;
|
|
145
|
+
password: string;
|
|
146
|
+
};
|
|
147
|
+
contentType?: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare enum Language {
|
|
151
|
+
ARABIC = "ar",
|
|
152
|
+
ENGLISH = "en",
|
|
153
|
+
URDU = "ur",
|
|
154
|
+
BENGALI = "bn",
|
|
155
|
+
TURKISH = "tr",
|
|
156
|
+
SPANISH = "es",
|
|
157
|
+
GERMAN = "de",
|
|
158
|
+
BOSNIAN = "bs",
|
|
159
|
+
RUSSIAN = "ru",
|
|
160
|
+
ALBANIAN_AL = "al",
|
|
161
|
+
FRENCH = "fr",
|
|
162
|
+
DUTCH = "nl",
|
|
163
|
+
TAMIL = "ta",
|
|
164
|
+
TAJIK = "tg",
|
|
165
|
+
INDONESIAN = "id",
|
|
166
|
+
UZBEK = "uz",
|
|
167
|
+
VIETNAMESE = "vi",
|
|
168
|
+
CHINESE = "zh",
|
|
169
|
+
ITALIAN = "it",
|
|
170
|
+
JAPANESE = "ja",
|
|
171
|
+
MALAYALAM = "ml",
|
|
172
|
+
AMHARIC = "am",
|
|
173
|
+
KAZAKH = "kk",
|
|
174
|
+
PORTUGUESE = "pt",
|
|
175
|
+
TAGALOG = "tl",
|
|
176
|
+
THAI = "th",
|
|
177
|
+
KOREAN = "ko",
|
|
178
|
+
HINDI = "hi",
|
|
179
|
+
KURDISH = "ku",
|
|
180
|
+
HAUSA = "ha",
|
|
181
|
+
AZERI = "az",
|
|
182
|
+
SWAHILI = "sw",
|
|
183
|
+
PERSIAN = "fa",
|
|
184
|
+
SERBIAN = "sr",
|
|
185
|
+
MARANAO = "mrn",
|
|
186
|
+
AMAZIGH = "zgh",
|
|
187
|
+
ASSAMESE = "as",
|
|
188
|
+
BULGARIAN = "bg",
|
|
189
|
+
CHECHEN = "ce",
|
|
190
|
+
CZECH = "cs",
|
|
191
|
+
DIVEHI = "dv",
|
|
192
|
+
FINNISH = "fi",
|
|
193
|
+
GUJAARATI = "gu",
|
|
194
|
+
HEBREW = "he",
|
|
195
|
+
GEORGIAN = "ka",
|
|
196
|
+
CENTRAL_KHMER = "km",
|
|
197
|
+
GANDA = "lg",
|
|
198
|
+
MARATHI = "mr",
|
|
199
|
+
YORUBA = "yo",
|
|
200
|
+
MALAY = "ms",
|
|
201
|
+
NEPALI = "ne",
|
|
202
|
+
SWEDISH = "sv",
|
|
203
|
+
TELUGU = "te",
|
|
204
|
+
TATAR = "tt",
|
|
205
|
+
UYGHUR = "ug",
|
|
206
|
+
UKRAINIAN = "uk",
|
|
207
|
+
NORWEGIAN = "no",
|
|
208
|
+
OROMO = "om",
|
|
209
|
+
POLISH = "pl",
|
|
210
|
+
PASHTO = "ps",
|
|
211
|
+
ROMANIAN = "ro",
|
|
212
|
+
SINDHI = "sd",
|
|
213
|
+
NORTHERN_SAMI = "se",
|
|
214
|
+
SINHALA = "si",
|
|
215
|
+
SOMALI = "so",
|
|
216
|
+
ALBANIAN_SQ = "sq"
|
|
217
|
+
}
|
|
218
|
+
declare enum QuranFont {
|
|
219
|
+
MadaniV1 = "code_v1",
|
|
220
|
+
MadaniV2 = "code_v2",
|
|
221
|
+
Uthmani = "text_uthmani"
|
|
222
|
+
}
|
|
223
|
+
type VerseField = "chapterId" | "textUthmani" | "textUthmaniSimple" | "textImlaei" | "textImlaeiSimple" | "textIndopak" | "textIndopakNastaleeq" | "textUthmaniTajweed" | "imageUrl" | "imageWidth" | "codeV1" | "codeV2" | "v1Page" | "v2Page";
|
|
224
|
+
type WordField = "v1Page" | "v2Page" | "textUthmani" | "textImlaei" | "textIndopak" | "verseKey" | "location" | "codeV1" | "codeV2";
|
|
225
|
+
type TranslationField = "resourceName" | "verseId" | "languageId" | "languageName" | "verseKey" | "chapterId" | "verseNumber" | "juzNumber" | "hizbNumber" | "rubNumber" | "pageNumber";
|
|
226
|
+
type VerseRecitationField = "id" | "chapterId" | "segments" | "format";
|
|
227
|
+
|
|
228
|
+
export { type ApiParams as A, type BaseApiParams as B, type CustomFetcher as C, type HTTPMethod as H, Language as L, type OperationRequest as O, type PaginationParams as P, type QuranClientConfig as Q, type RuntimeMode as R, SearchMode as S, type TranslationField as T, type UserSession as U, type VerseField as V, type WordField as W, QuranFont as a, type VerseRecitationField as b, type BinaryString as c, type SearchParams as d, type QuranFetchClient as e, type ApiService as f, type ServiceEnvironmentConfig as g, type TokenStorage as h, type ServerClientConfig as i, type PublicClientConfig as j, type CachedToken as k, type TokenResponse as l };
|