@quranjs/api 1.1.3 → 1.3.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.
Files changed (55) hide show
  1. package/README.md +7 -0
  2. package/dist/api.cjs.development.js +2723 -0
  3. package/dist/api.cjs.development.js.map +1 -0
  4. package/dist/api.cjs.production.min.js +2 -0
  5. package/dist/api.cjs.production.min.js.map +1 -0
  6. package/dist/api.esm.js +2715 -0
  7. package/dist/api.esm.js.map +1 -0
  8. package/dist/index.d.ts +2 -0
  9. package/dist/index.js +8 -0
  10. package/dist/sdk/index.d.ts +183 -0
  11. package/dist/sdk/utils.d.ts +125 -0
  12. package/dist/sdk/v4/_fetcher.d.ts +3 -0
  13. package/dist/sdk/v4/audio.d.ts +52 -0
  14. package/dist/sdk/v4/chapters.d.ts +13 -0
  15. package/dist/sdk/v4/index.d.ts +173 -0
  16. package/dist/sdk/v4/juzs.d.ts +5 -0
  17. package/dist/sdk/v4/resources.d.ts +26 -0
  18. package/dist/sdk/v4/search.d.ts +22 -0
  19. package/dist/sdk/v4/verses.d.ts +64 -0
  20. package/dist/types/ChapterId.d.ts +1 -0
  21. package/dist/types/HizbNumber.d.ts +1 -0
  22. package/dist/types/JuzNumber.d.ts +1 -0
  23. package/dist/types/PageNumber.d.ts +1 -0
  24. package/dist/types/RubNumber.d.ts +1 -0
  25. package/dist/types/VerseKey.d.ts +1 -0
  26. package/dist/types/api/ApiResponses.d.ts +18 -0
  27. package/dist/types/api/AudioData.d.ts +17 -0
  28. package/dist/types/api/AudioResponse.d.ts +8 -0
  29. package/dist/types/api/Chapter.d.ts +14 -0
  30. package/dist/types/api/ChapterInfo.d.ts +8 -0
  31. package/dist/types/api/Footnote.d.ts +6 -0
  32. package/dist/types/api/Juz.d.ts +8 -0
  33. package/dist/types/api/Pagination.d.ts +7 -0
  34. package/dist/types/api/Reciter.d.ts +21 -0
  35. package/dist/types/api/Resources.d.ts +70 -0
  36. package/dist/types/api/Segment.d.ts +4 -0
  37. package/dist/types/api/Tafsir.d.ts +7 -0
  38. package/dist/types/api/TafsirInfo.d.ts +9 -0
  39. package/dist/types/api/TranslatedName.d.ts +4 -0
  40. package/dist/types/api/Translation.d.ts +17 -0
  41. package/dist/types/api/Transliteration.d.ts +4 -0
  42. package/dist/types/api/Verse.d.ts +32 -0
  43. package/dist/types/api/Word.d.ts +28 -0
  44. package/dist/types/api/index.d.ts +18 -0
  45. package/dist/types/index.d.ts +88 -0
  46. package/dist/utils/misc.d.ts +1 -0
  47. package/dist/utils/qs-stringify.d.ts +21 -0
  48. package/package.json +1 -3
  49. package/src/sdk/v4/_fetcher.ts +2 -2
  50. package/src/sdk/v4/audio.ts +1 -1
  51. package/src/sdk/v4/chapters.ts +1 -1
  52. package/src/sdk/v4/juzs.ts +1 -1
  53. package/src/sdk/v4/resources.ts +1 -1
  54. package/src/sdk/v4/search.ts +1 -1
  55. package/src/sdk/v4/verses.ts +1 -1
@@ -0,0 +1,88 @@
1
+ export declare enum Language {
2
+ ARABIC = "ar",
3
+ ENGLISH = "en",
4
+ URDU = "ur",
5
+ BENGALI = "bn",
6
+ TURKISH = "tr",
7
+ SPANISH = "es",
8
+ GERMAN = "de",
9
+ BOSNIAN = "bs",
10
+ RUSSIAN = "ru",
11
+ ALBANIAN_AL = "al",
12
+ FRENCH = "fr",
13
+ DUTCH = "nl",
14
+ TAMIL = "ta",
15
+ TAJIK = "tg",
16
+ INDONESIAN = "id",
17
+ UZBEK = "uz",
18
+ VIETNAMESE = "vi",
19
+ CHINESE = "zh",
20
+ ITALIAN = "it",
21
+ JAPANESE = "ja",
22
+ MALAYALAM = "ml",
23
+ AMHARIC = "am",
24
+ KAZAKH = "kk",
25
+ PORTUGUESE = "pt",
26
+ TAGALOG = "tl",
27
+ THAI = "th",
28
+ KOREAN = "ko",
29
+ HINDI = "hi",
30
+ KURDISH = "ku",
31
+ HAUSA = "ha",
32
+ AZERI = "az",
33
+ SWAHILI = "sw",
34
+ PERSIAN = "fa",
35
+ SERBIAN = "sr",
36
+ MARANAO = "mrn",
37
+ AMAZIGH = "zgh",
38
+ ASSAMESE = "as",
39
+ BULGARIAN = "bg",
40
+ CHECHEN = "ce",
41
+ CZECH = "cs",
42
+ DIVEHI = "dv",
43
+ DHIVEHI = "dv",
44
+ MALDIVIAN = "dv",
45
+ FINNISH = "fi",
46
+ GUJAARATI = "gu",
47
+ HEBREW = "he",
48
+ GEORGIAN = "ka",
49
+ CENTRAL_KHMER = "km",
50
+ GANDA = "lg",
51
+ MARATHI = "mr",
52
+ YORUBA = "yo",
53
+ MALAY = "ms",
54
+ NEPALI = "ne",
55
+ SWEDISH = "sv",
56
+ TELUGU = "te",
57
+ TATAR = "tt",
58
+ UIGHUR = "ug",
59
+ UYGHUR = "ug",
60
+ UKRAINIAN = "uk",
61
+ NORWEGIAN = "no",
62
+ OROMO = "om",
63
+ POLISH = "pl",
64
+ PASHTO = "ps",
65
+ ROMANIAN = "ro",
66
+ SINDHI = "sd",
67
+ NORTHERN_SAMI = "se",
68
+ SINHALA = "si",
69
+ SINHALESE = "si",
70
+ SOMALI = "so",
71
+ ALBANIAN_SQ = "sq"
72
+ }
73
+ export declare enum QuranFont {
74
+ MadaniV1 = "code_v1",
75
+ MadaniV2 = "code_v2",
76
+ Uthmani = "text_uthmani"
77
+ }
78
+ export declare type VerseField = 'chapterId' | 'textUthmani' | 'textUthmaniSimple' | 'textImlaei' | 'textImlaeiSimple' | 'textIndopak' | 'textUthmaniTajweed' | 'imageUrl' | 'imageWidth' | 'codeV1' | 'codeV2' | 'v1Page' | 'v2Page';
79
+ export declare type WordField = 'v1Page' | 'v2Page' | 'textUthmani' | 'textImlaei' | 'textIndopak' | 'verseKey' | 'location' | 'codeV1' | 'codeV2';
80
+ export declare type TranslationField = 'resourceName' | 'verseId' | 'languageId' | 'languageName' | 'verseKey' | 'chapterId' | 'verseNumber' | 'juzNumber' | 'hizbNumber' | 'rubNumber' | 'pageNumber';
81
+ export declare type VerseRecitationField = 'id' | 'chapterId' | 'segments' | 'format';
82
+ export * from './VerseKey';
83
+ export * from './ChapterId';
84
+ export * from './HizbNumber';
85
+ export * from './JuzNumber';
86
+ export * from './PageNumber';
87
+ export * from './RubNumber';
88
+ export * from './api';
@@ -0,0 +1 @@
1
+ export declare const removeBeginningSlash: (url: string) => string;
@@ -0,0 +1,21 @@
1
+ declare type QueryObject = Record<string, any>;
2
+ export declare type StringifyFunction = (key: string, value: any) => any;
3
+ declare type Config = {
4
+ eq?: string;
5
+ sep?: string;
6
+ fn?: StringifyFunction;
7
+ prefix?: string;
8
+ };
9
+ /**
10
+ * Given a query object, return the query string
11
+ * See qs-stringify.test.ts for examples
12
+ *
13
+ * @param {QueryObject} obj a query object to be converted to a query string
14
+ * @param {Config} config optional configuration
15
+ * @returns {string} query string
16
+ *
17
+ * @example
18
+ * stringify({a: 1, b: 2}) // returns 'a=1&b=s'
19
+ */
20
+ declare function stringify(obj: QueryObject, config?: Config): string;
21
+ export default stringify;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "version": "1.1.3",
8
+ "version": "1.3.0",
9
9
  "license": "MIT",
10
10
  "main": "dist/index.js",
11
11
  "typings": "dist/index.d.ts",
@@ -25,8 +25,6 @@
25
25
  "analyze": "size-limit --why"
26
26
  },
27
27
  "devDependencies": {
28
- "@rollup/plugin-alias": "^3.1.9",
29
- "@rollup/plugin-node-resolve": "^13.1.3",
30
28
  "@size-limit/preset-small-lib": "^7.0.8",
31
29
  "@types/humps": "^2.0.1",
32
30
  "dts-cli": "^1.4.0",
@@ -1,7 +1,7 @@
1
1
  import fetch from 'cross-fetch';
2
2
  import { camelizeKeys, decamelizeKeys } from 'humps';
3
- import stringify from '@/utils/qs-stringify';
4
- import { removeBeginningSlash } from '@/utils/misc';
3
+ import stringify from '../../utils/qs-stringify';
4
+ import { removeBeginningSlash } from '../../utils/misc';
5
5
 
6
6
  export const API_BASE_URL = 'https://api.quran.com/api/v4/';
7
7
 
@@ -10,7 +10,7 @@ import {
10
10
  RubNumber,
11
11
  VerseKey,
12
12
  VerseRecitationField,
13
- } from '@/types';
13
+ } from '../../types';
14
14
  import { decamelize } from 'humps';
15
15
  import Utils from '../utils';
16
16
  import { fetcher } from './_fetcher';
@@ -1,4 +1,4 @@
1
- import { Chapter, ChapterId, ChapterInfo, Language } from '@/types';
1
+ import { Chapter, ChapterId, ChapterInfo, Language } from '../../types';
2
2
  import { fetcher } from './_fetcher';
3
3
  import Utils from '../utils';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Juz } from '@/types';
1
+ import { Juz } from '../../types';
2
2
  import { fetcher } from './_fetcher';
3
3
 
4
4
  /**
@@ -11,7 +11,7 @@ import {
11
11
  // TranslationInfoResource,
12
12
  TranslationResource,
13
13
  VerseMediaResource,
14
- } from '@/types';
14
+ } from '../../types';
15
15
  import { fetcher } from './_fetcher';
16
16
 
17
17
  type GetResourcesOptions = Partial<{
@@ -1,4 +1,4 @@
1
- import { Language, SearchResponse } from '@/types';
1
+ import { Language, SearchResponse } from '../../types';
2
2
  import { fetcher } from './_fetcher';
3
3
 
4
4
  type SearchOptions = Partial<{
@@ -10,7 +10,7 @@ import {
10
10
  VerseField,
11
11
  VerseKey,
12
12
  WordField,
13
- } from '@/types';
13
+ } from '../../types';
14
14
  import { decamelize } from 'humps';
15
15
  import Utils from '../utils';
16
16
  import { fetcher } from './_fetcher';