@quranjs/api 3.4.0 → 3.5.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.
@@ -350,10 +350,87 @@ interface ChapterReciterResource {
350
350
  format?: string;
351
351
  filesSize?: number;
352
352
  }
353
- type ContentSyncResourceGroup = "articles" | "recitations" | "tafsirs" | "translations";
353
+ type ContentSyncResourceGroup = "articles" | "mushafs" | "recitations" | "tafsirs" | "translations" | "word_by_word_translations";
354
+ interface MushafMetadataSnapshotRecord extends Record<string, unknown> {
355
+ recordType: "mushaf";
356
+ id: number;
357
+ resourceContentId: number;
358
+ name: string;
359
+ description: string | null;
360
+ pagesCount: number;
361
+ linesPerPage: number;
362
+ defaultFontName: string;
363
+ mappingMode: string;
364
+ qirat: {
365
+ id: number;
366
+ name: string;
367
+ } | null;
368
+ }
369
+ interface MushafPageSnapshotRecord extends Record<string, unknown> {
370
+ recordType: "mushaf_page";
371
+ id: number;
372
+ mushafId: number;
373
+ pageNumber: number;
374
+ firstVerseId: number | null;
375
+ lastVerseId: number | null;
376
+ firstWordId: number | null;
377
+ lastWordId: number | null;
378
+ versesCount: number | null;
379
+ verseMapping: Record<string, unknown> | null;
380
+ updatedAt: string;
381
+ }
382
+ interface MushafFontAssetSnapshotRecord extends Record<string, unknown> {
383
+ recordType: "font_asset";
384
+ id: number;
385
+ assetKey: string;
386
+ mushafId: number;
387
+ pageNumber: number | null;
388
+ fontFamily: string;
389
+ format: string;
390
+ mimeType: string;
391
+ url: string;
392
+ sha256: string;
393
+ byteSize: number;
394
+ version: string;
395
+ provider: string;
396
+ licenseName: string;
397
+ licenseUrl: string | null;
398
+ attribution: string | null;
399
+ updatedAt: string;
400
+ }
401
+ interface MushafWordSnapshotRecord extends Record<string, unknown> {
402
+ recordType: "mushaf_word";
403
+ id: number;
404
+ mushafId: number;
405
+ wordId: number;
406
+ verseId: number;
407
+ sourceVerseId: number | null;
408
+ text: string | null;
409
+ charTypeId: number | null;
410
+ charTypeName: string | null;
411
+ pageNumber: number | null;
412
+ lineNumber: number | null;
413
+ positionInVerse: number | null;
414
+ positionInLine: number | null;
415
+ positionInPage: number | null;
416
+ cssClass: string | null;
417
+ cssStyle: string | null;
418
+ }
419
+ type MushafSnapshotRecord = MushafMetadataSnapshotRecord | MushafPageSnapshotRecord | MushafFontAssetSnapshotRecord | MushafWordSnapshotRecord;
420
+ interface WordByWordTranslationSnapshotRecord extends Record<string, unknown> {
421
+ id: number;
422
+ resourceContentId: number;
423
+ resourceId: number;
424
+ wordId: number;
425
+ languageId: number;
426
+ languageName: string | null;
427
+ text: string | null;
428
+ priority: number | null;
429
+ updatedAt: string;
430
+ }
354
431
  type ContentSyncMutationType = "RESOURCE_CREATE" | "RESOURCE_UPDATE" | "RESOURCE_DELETE" | "ROW_CREATE" | "ROW_UPDATE" | "ROW_DELETE" | "RESOURCE_INVALIDATE";
355
432
  interface ContentSyncOptions extends ApiParams {
356
- /** Resource filter, e.g. `articles:*;translations:1,6`. */
433
+ /** Resource filter, e.g. `articles:*;mushafs:1;translations:1,6;word_by_word_translations:85`. */
357
434
  resources?: string;
358
435
  /** Set to true for the initial sync. */
359
436
  bootstrap?: boolean;
@@ -856,7 +933,10 @@ declare class QuranResources {
856
933
  * Bootstrap or incrementally sync public content resources.
857
934
  * @param {ContentSyncOptions} options
858
935
  * @example
859
- * client.resources.sync({ bootstrap: true, resources: "translations:19" })
936
+ * client.resources.sync({
937
+ * bootstrap: true,
938
+ * resources: "mushafs:1;translations:19;word_by_word_translations:85"
939
+ * })
860
940
  */
861
941
  sync<TData extends Record<string, unknown> = Record<string, unknown>>(options?: ContentSyncOptions): Promise<ContentSyncResponse<TData>>;
862
942
  /**
@@ -865,7 +945,7 @@ declare class QuranResources {
865
945
  * @param {string | number} id
866
946
  * @param {ContentResourceSnapshotOptions} options
867
947
  * @example
868
- * client.resources.findSnapshot("translations", 19)
948
+ * client.resources.findSnapshot("mushafs", 1)
869
949
  */
870
950
  findSnapshot<TRecord extends Record<string, unknown> = Record<string, unknown>>(resourceGroup: ContentSyncResourceGroup, id: string | number, options?: ContentResourceSnapshotOptions): Promise<ContentResourceSnapshot<TRecord>>;
871
951
  }
@@ -973,4 +1053,4 @@ declare class QuranVerses {
973
1053
  findRandom(options?: GetVerseOptions): Promise<Verse>;
974
1054
  }
975
1055
 
976
- export { type VerseMediaResource as $, type Answer as A, type Translation as B, type ChapterId as C, type Transliteration as D, type Verse as E, CharType as F, type Juz as G, type HizbNumber as H, type Pagination as I, type JuzNumber as J, type RecitationResource as K, type RecitationInfoResource as L, type TranslationResource as M, type NormalizedVerseRecitation as N, type TranslationInfoResource as O, type PageNumber as P, QuranChapters as Q, type RubNumber as R, type SearchResponse as S, type TranslatedName as T, type TafsirResource as U, type VerseKey as V, type Word as W, type TafsirInfoResource as X, type RecitationStylesResource as Y, type LanguageResource as Z, type ChapterInfoResource as _, QuranAnswers as a, type ChapterReciterResource as a0, type ContentSyncResourceGroup as a1, type ContentSyncMutationType as a2, type ContentSyncOptions as a3, type ContentResourceSnapshotOptions as a4, type ContentSyncMutation as a5, type ContentSyncResponse as a6, type ContentResourceSnapshot as a7, SearchNavigationType as a8, type SearchResult as a9, QuranVerses as b, QuranJuzs as c, QuranAudio as d, QuranHadithReferences as e, QuranResources as f, QuranSearch as g, type AnswerQuestion as h, type AnswersByAyahResponse as i, type AnswerCount as j, type AnswerCountWithinRangeResponse as k, type ChapterRecitation as l, type VerseRecitation as m, type AudioResponse as n, type Chapter as o, type ChapterInfo as p, type ChapterInfoResponse as q, type HadithReference as r, type HadithReferencesByAyahResponse as s, type HadithGrade as t, type HadithContent as u, type Hadith as v, type HadithsByAyahResponse as w, type HadithCountWithinRangeResponse as x, type Segment as y, type Tafsir as z };
1056
+ export { type VerseMediaResource as $, type Answer as A, type Translation as B, type ChapterId as C, type Transliteration as D, type Verse as E, CharType as F, type Juz as G, type HizbNumber as H, type Pagination as I, type JuzNumber as J, type RecitationResource as K, type RecitationInfoResource as L, type TranslationResource as M, type NormalizedVerseRecitation as N, type TranslationInfoResource as O, type PageNumber as P, QuranChapters as Q, type RubNumber as R, type SearchResponse as S, type TranslatedName as T, type TafsirResource as U, type VerseKey as V, type Word as W, type TafsirInfoResource as X, type RecitationStylesResource as Y, type LanguageResource as Z, type ChapterInfoResource as _, QuranAnswers as a, type ChapterReciterResource as a0, type ContentSyncResourceGroup as a1, type MushafMetadataSnapshotRecord as a2, type MushafPageSnapshotRecord as a3, type MushafFontAssetSnapshotRecord as a4, type MushafWordSnapshotRecord as a5, type MushafSnapshotRecord as a6, type WordByWordTranslationSnapshotRecord as a7, type ContentSyncMutationType as a8, type ContentSyncOptions as a9, type ContentResourceSnapshotOptions as aa, type ContentSyncMutation as ab, type ContentSyncResponse as ac, type ContentResourceSnapshot as ad, SearchNavigationType as ae, type SearchResult as af, QuranVerses as b, QuranJuzs as c, QuranAudio as d, QuranHadithReferences as e, QuranResources as f, QuranSearch as g, type AnswerQuestion as h, type AnswersByAyahResponse as i, type AnswerCount as j, type AnswerCountWithinRangeResponse as k, type ChapterRecitation as l, type VerseRecitation as m, type AudioResponse as n, type Chapter as o, type ChapterInfo as p, type ChapterInfoResponse as q, type HadithReference as r, type HadithReferencesByAyahResponse as s, type HadithGrade as t, type HadithContent as u, type Hadith as v, type HadithsByAyahResponse as w, type HadithCountWithinRangeResponse as x, type Segment as y, type Tafsir as z };
@@ -350,10 +350,87 @@ interface ChapterReciterResource {
350
350
  format?: string;
351
351
  filesSize?: number;
352
352
  }
353
- type ContentSyncResourceGroup = "articles" | "recitations" | "tafsirs" | "translations";
353
+ type ContentSyncResourceGroup = "articles" | "mushafs" | "recitations" | "tafsirs" | "translations" | "word_by_word_translations";
354
+ interface MushafMetadataSnapshotRecord extends Record<string, unknown> {
355
+ recordType: "mushaf";
356
+ id: number;
357
+ resourceContentId: number;
358
+ name: string;
359
+ description: string | null;
360
+ pagesCount: number;
361
+ linesPerPage: number;
362
+ defaultFontName: string;
363
+ mappingMode: string;
364
+ qirat: {
365
+ id: number;
366
+ name: string;
367
+ } | null;
368
+ }
369
+ interface MushafPageSnapshotRecord extends Record<string, unknown> {
370
+ recordType: "mushaf_page";
371
+ id: number;
372
+ mushafId: number;
373
+ pageNumber: number;
374
+ firstVerseId: number | null;
375
+ lastVerseId: number | null;
376
+ firstWordId: number | null;
377
+ lastWordId: number | null;
378
+ versesCount: number | null;
379
+ verseMapping: Record<string, unknown> | null;
380
+ updatedAt: string;
381
+ }
382
+ interface MushafFontAssetSnapshotRecord extends Record<string, unknown> {
383
+ recordType: "font_asset";
384
+ id: number;
385
+ assetKey: string;
386
+ mushafId: number;
387
+ pageNumber: number | null;
388
+ fontFamily: string;
389
+ format: string;
390
+ mimeType: string;
391
+ url: string;
392
+ sha256: string;
393
+ byteSize: number;
394
+ version: string;
395
+ provider: string;
396
+ licenseName: string;
397
+ licenseUrl: string | null;
398
+ attribution: string | null;
399
+ updatedAt: string;
400
+ }
401
+ interface MushafWordSnapshotRecord extends Record<string, unknown> {
402
+ recordType: "mushaf_word";
403
+ id: number;
404
+ mushafId: number;
405
+ wordId: number;
406
+ verseId: number;
407
+ sourceVerseId: number | null;
408
+ text: string | null;
409
+ charTypeId: number | null;
410
+ charTypeName: string | null;
411
+ pageNumber: number | null;
412
+ lineNumber: number | null;
413
+ positionInVerse: number | null;
414
+ positionInLine: number | null;
415
+ positionInPage: number | null;
416
+ cssClass: string | null;
417
+ cssStyle: string | null;
418
+ }
419
+ type MushafSnapshotRecord = MushafMetadataSnapshotRecord | MushafPageSnapshotRecord | MushafFontAssetSnapshotRecord | MushafWordSnapshotRecord;
420
+ interface WordByWordTranslationSnapshotRecord extends Record<string, unknown> {
421
+ id: number;
422
+ resourceContentId: number;
423
+ resourceId: number;
424
+ wordId: number;
425
+ languageId: number;
426
+ languageName: string | null;
427
+ text: string | null;
428
+ priority: number | null;
429
+ updatedAt: string;
430
+ }
354
431
  type ContentSyncMutationType = "RESOURCE_CREATE" | "RESOURCE_UPDATE" | "RESOURCE_DELETE" | "ROW_CREATE" | "ROW_UPDATE" | "ROW_DELETE" | "RESOURCE_INVALIDATE";
355
432
  interface ContentSyncOptions extends ApiParams {
356
- /** Resource filter, e.g. `articles:*;translations:1,6`. */
433
+ /** Resource filter, e.g. `articles:*;mushafs:1;translations:1,6;word_by_word_translations:85`. */
357
434
  resources?: string;
358
435
  /** Set to true for the initial sync. */
359
436
  bootstrap?: boolean;
@@ -856,7 +933,10 @@ declare class QuranResources {
856
933
  * Bootstrap or incrementally sync public content resources.
857
934
  * @param {ContentSyncOptions} options
858
935
  * @example
859
- * client.resources.sync({ bootstrap: true, resources: "translations:19" })
936
+ * client.resources.sync({
937
+ * bootstrap: true,
938
+ * resources: "mushafs:1;translations:19;word_by_word_translations:85"
939
+ * })
860
940
  */
861
941
  sync<TData extends Record<string, unknown> = Record<string, unknown>>(options?: ContentSyncOptions): Promise<ContentSyncResponse<TData>>;
862
942
  /**
@@ -865,7 +945,7 @@ declare class QuranResources {
865
945
  * @param {string | number} id
866
946
  * @param {ContentResourceSnapshotOptions} options
867
947
  * @example
868
- * client.resources.findSnapshot("translations", 19)
948
+ * client.resources.findSnapshot("mushafs", 1)
869
949
  */
870
950
  findSnapshot<TRecord extends Record<string, unknown> = Record<string, unknown>>(resourceGroup: ContentSyncResourceGroup, id: string | number, options?: ContentResourceSnapshotOptions): Promise<ContentResourceSnapshot<TRecord>>;
871
951
  }
@@ -973,4 +1053,4 @@ declare class QuranVerses {
973
1053
  findRandom(options?: GetVerseOptions): Promise<Verse>;
974
1054
  }
975
1055
 
976
- export { type VerseMediaResource as $, type Answer as A, type Translation as B, type ChapterId as C, type Transliteration as D, type Verse as E, CharType as F, type Juz as G, type HizbNumber as H, type Pagination as I, type JuzNumber as J, type RecitationResource as K, type RecitationInfoResource as L, type TranslationResource as M, type NormalizedVerseRecitation as N, type TranslationInfoResource as O, type PageNumber as P, QuranChapters as Q, type RubNumber as R, type SearchResponse as S, type TranslatedName as T, type TafsirResource as U, type VerseKey as V, type Word as W, type TafsirInfoResource as X, type RecitationStylesResource as Y, type LanguageResource as Z, type ChapterInfoResource as _, QuranAnswers as a, type ChapterReciterResource as a0, type ContentSyncResourceGroup as a1, type ContentSyncMutationType as a2, type ContentSyncOptions as a3, type ContentResourceSnapshotOptions as a4, type ContentSyncMutation as a5, type ContentSyncResponse as a6, type ContentResourceSnapshot as a7, SearchNavigationType as a8, type SearchResult as a9, QuranVerses as b, QuranJuzs as c, QuranAudio as d, QuranHadithReferences as e, QuranResources as f, QuranSearch as g, type AnswerQuestion as h, type AnswersByAyahResponse as i, type AnswerCount as j, type AnswerCountWithinRangeResponse as k, type ChapterRecitation as l, type VerseRecitation as m, type AudioResponse as n, type Chapter as o, type ChapterInfo as p, type ChapterInfoResponse as q, type HadithReference as r, type HadithReferencesByAyahResponse as s, type HadithGrade as t, type HadithContent as u, type Hadith as v, type HadithsByAyahResponse as w, type HadithCountWithinRangeResponse as x, type Segment as y, type Tafsir as z };
1056
+ export { type VerseMediaResource as $, type Answer as A, type Translation as B, type ChapterId as C, type Transliteration as D, type Verse as E, CharType as F, type Juz as G, type HizbNumber as H, type Pagination as I, type JuzNumber as J, type RecitationResource as K, type RecitationInfoResource as L, type TranslationResource as M, type NormalizedVerseRecitation as N, type TranslationInfoResource as O, type PageNumber as P, QuranChapters as Q, type RubNumber as R, type SearchResponse as S, type TranslatedName as T, type TafsirResource as U, type VerseKey as V, type Word as W, type TafsirInfoResource as X, type RecitationStylesResource as Y, type LanguageResource as Z, type ChapterInfoResource as _, QuranAnswers as a, type ChapterReciterResource as a0, type ContentSyncResourceGroup as a1, type MushafMetadataSnapshotRecord as a2, type MushafPageSnapshotRecord as a3, type MushafFontAssetSnapshotRecord as a4, type MushafWordSnapshotRecord as a5, type MushafSnapshotRecord as a6, type WordByWordTranslationSnapshotRecord as a7, type ContentSyncMutationType as a8, type ContentSyncOptions as a9, type ContentResourceSnapshotOptions as aa, type ContentSyncMutation as ab, type ContentSyncResponse as ac, type ContentResourceSnapshot as ad, SearchNavigationType as ae, type SearchResult as af, QuranVerses as b, QuranJuzs as c, QuranAudio as d, QuranHadithReferences as e, QuranResources as f, QuranSearch as g, type AnswerQuestion as h, type AnswersByAyahResponse as i, type AnswerCount as j, type AnswerCountWithinRangeResponse as k, type ChapterRecitation as l, type VerseRecitation as m, type AudioResponse as n, type Chapter as o, type ChapterInfo as p, type ChapterInfoResponse as q, type HadithReference as r, type HadithReferencesByAyahResponse as s, type HadithGrade as t, type HadithContent as u, type Hadith as v, type HadithsByAyahResponse as w, type HadithCountWithinRangeResponse as x, type Segment as y, type Tafsir as z };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
14
- "version": "3.4.0",
14
+ "version": "3.5.0",
15
15
  "main": "dist/index.min.js",
16
16
  "module": "dist/index.min.mjs",
17
17
  "types": "dist/index.d.ts",