@quranjs/api 3.2.0 → 3.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/generated/specs/public-operation-catalog.json","../src/generated/public-contracts.ts","../src/lib/http-utils.ts","../src/generated/contracts.ts","../src/lib/runtime-utils.ts","../src/lib/url.ts","../src/lib/service-config.ts","../src/sdk/public-fetcher.ts","../src/runtime/create-public-client.ts","../src/public.ts"],"names":["public_operation_catalog_default","publicOperationCatalog","prepareBody","request","headers","toUserSession","token","currentSession","expiresIn","accessToken","idToken","refreshToken","tokenType","scope","expiresAt","resolveCatalogOperation","section","operationName","operation","HTTP_METHOD_TO_MUTATION_NAME","toCamelCase","value","parts","part","index","lower","toPascalCase","camel","isPathParam","segment","getResourceSegments","path","segments","pickGeneratedMethodName","resourceSegments","lastSegment","literalSegments","lastLiteral","groupLiteral","createRawClient","fetcher","rawOperations","resolvedOperation","createGeneratedGroups","groups","literals","groupName","suggestedName","currentGroup","methodName","decamelize","humps","ensureLeadingSlash","removeTrailingSlash","replacePathParams","params","_match","rawKey","normalizePathTemplate","fieldsKey","fieldsKeySet","key","preservedKeys","paramsToString","options","paramsString","rawValue","fields","fieldKey","DEFAULT_BASE_URLS","DIRECT_PATH_PREFIX","GATEWAY_PATH_PREFIX","LEGACY_PREFIXES","camelizeKeys","PublicQuranFetcher","config","doFetch","storedSession","session","service","query","baseUrl","usesGateway","servicePath","effectiveAuth","url","body","response","json","auth","services","directBaseUrl","normalizedPath","legacyPrefix","prefix","SERVER_ONLY_MESSAGE","LEGACY_BOOKMARK_GET_MESSAGE","createUserServiceRequest","method","createAuthFacade","raw","generatedGroups","collectionId","bookmarkId","id","noteId","verseKey","createQuranReflectFacade","createOAuth2Facade","exchangeToken","requestRefreshToken","createServerOnlyGuard","fail","proxy","_target","property","createPublicRuntimeClient","authV1","quranReflectV1","oauth2V1","serverOnlyGuard","createPublicClient"],"mappings":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AS,CAEjB,IAAM6E,CAAAA,CAASlB,CAAAA,CAAiB3D,CAAO,CAAA,CACjC8E,CAAAA,CAAiBX,EAAyBnE,CAAO,CAAA,CACjD+E,EAAWX,CAAAA,CAAmBpE,CAAAA,CAASmC,CAAM,CAAA,CAC7C6C,CAAAA,CAAkBT,CAAAA,GAElBX,CAAAA,CAAM,CACV,KAAM,CACJ,EAAA,CAAIiB,EAAO,GACb,CAAA,CACA,QAAS,CACP,EAAA,CAAIG,CACN,CAAA,CACA,MAAA,CAAQ,CACN,EAAA,CAAID,CAAAA,CAAS,GACf,CAAA,CACA,YAAA,CAAc,CACZ,EAAA,CAAID,CAAAA,CAAe,GACrB,EACA,MAAA,CAAQ,CACN,GAAIE,CACN,CACF,EAEA,OAAO,CACL,KAAA,CAAOA,CAAAA,CACP,IAAA,CAAM,CACJ,GAAGH,CAAAA,CACH,EAAA,CAAIA,CACN,CAAA,CACA,QAAA,CAAUG,EACV,iBAAA,CAAmB,IAAMhF,CAAAA,CAAQ,iBAAA,EAAkB,CACnD,OAAA,CAASgF,EACT,cAAA,CAAgB,IAAMhF,EAAQ,cAAA,EAAe,CAC7C,iBAAkBgF,CAAAA,CAClB,IAAA,CAAMA,EACN,MAAA,CAAQ,CACN,GAAGD,CAAAA,CACH,EAAA,CAAIA,CACN,CAAA,CACA,YAAA,CAAc,CACZ,GAAGD,CAAAA,CACH,EAAA,CAAIA,CACN,CAAA,CACA,GAAA,CAAAlB,EACA,SAAA,CAAWoB,CAAAA,CACX,OAAQA,CAAAA,CACR,MAAA,CAAQA,CACV,CACF,CAAA,CClXO,IAAMC,EAAAA,CAAsB9C,CAAAA,EAA+B,CAChE,GAAKA,CAAAA,CAA0D,YAAA,CAC7D,MAAM,IAAI,KAAA,CAAM,wDAAwD,CAAA,CAG1E,OAAOyC,CAAAA,CAA0BzC,CAAM,CACzC","file":"public.min.js","sourcesContent":["{\n \"auth\": {\n \"v1\": {\n \"operations\": {\n \"getV1Collections\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/collections\"\n },\n \"postV1Collections\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/collections\"\n },\n \"postV1CollectionsByCollectionIdBookmarks\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/collections/{collectionId}/bookmarks\"\n },\n \"deleteV1CollectionsByCollectionIdBookmarks\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/collections/{collectionId}/bookmarks\"\n },\n \"getV1CollectionsByCollectionId\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/collections/{collectionId}\"\n },\n \"postV1CollectionsByCollectionId\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/collections/{collectionId}\"\n },\n \"deleteV1CollectionsByCollectionId\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/collections/{collectionId}\"\n },\n \"deleteV1CollectionsByCollectionIdBookmarksByBookmarkId\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/collections/{collectionId}/bookmarks/{bookmarkId}\"\n },\n \"getV1CollectionsAll\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/collections/all\"\n },\n \"getV1Bookmarks\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/bookmarks\"\n },\n \"postV1Bookmarks\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/bookmarks\"\n },\n \"deleteV1BookmarksByBookmarkId\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/bookmarks/{bookmarkId}\"\n },\n \"getV1BookmarksAyahsRange\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/bookmarks/ayahs-range\"\n },\n \"getV1BookmarksBookmark\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/bookmarks/bookmark\"\n },\n \"getV1BookmarksCollections\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/bookmarks/collections\"\n },\n \"getV1Preferences\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/preferences\"\n },\n \"postV1Preferences\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/preferences\"\n },\n \"postV1PreferencesBulk\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/preferences/bulk\"\n },\n \"getV1ReadingSessions\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/reading-sessions\"\n },\n \"postV1ReadingSessions\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/reading-sessions\"\n },\n \"getV1GoalsGetTodaysPlan\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/goals/get-todays-plan\"\n },\n \"putV1GoalsById\": {\n \"auth\": \"user\",\n \"method\": \"put\",\n \"path\": \"/v1/goals/{id}\"\n },\n \"deleteV1GoalsById\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/goals/{id}\"\n },\n \"postV1Goals\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/goals\"\n },\n \"getV1GoalsEstimate\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/goals/estimate\"\n },\n \"getV1Streaks\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/streaks\"\n },\n \"getV1StreaksCurrentStreakDays\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/streaks/current-streak-days\"\n },\n \"getV1ActivityDays\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/activity-days\"\n },\n \"postV1ActivityDays\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/activity-days\"\n },\n \"getV1ActivityDaysEstimateReadingTime\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/activity-days/estimate-reading-time\"\n },\n \"getV1Notes\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes\"\n },\n \"postV1Notes\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/notes\"\n },\n \"getV1NotesByVerseByVerseKey\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes/by-verse/{verseKey}\"\n },\n \"getV1NotesByAttachedEntity\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes/by-attached-entity\"\n },\n \"getV1NotesCountWithinRange\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes/count-within-range\"\n },\n \"getV1NotesByRange\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes/by-range\"\n },\n \"getV1NotesByNoteId\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes/{noteId}\"\n },\n \"patchV1NotesByNoteId\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/notes/{noteId}\"\n },\n \"deleteV1NotesByNoteId\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/notes/{noteId}\"\n },\n \"postV1NotesByNoteIdPublish\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/notes/{noteId}/publish\"\n }\n },\n \"service\": \"auth\",\n \"version\": \"v1\"\n }\n },\n \"oauth2\": {\n \"v1\": {\n \"operations\": {\n \"oauth2TokenExchange\": {\n \"auth\": \"none\",\n \"method\": \"post\",\n \"path\": \"/oauth2/token\"\n },\n \"introspectOauth2Token\": {\n \"auth\": \"none\",\n \"method\": \"post\",\n \"path\": \"/oauth2/introspect\"\n },\n \"oAuth2Authorize\": {\n \"auth\": \"none\",\n \"method\": \"get\",\n \"path\": \"/oauth2/auth\"\n },\n \"getOidcUserInfo\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/userinfo\"\n },\n \"revokeOidcSession\": {\n \"auth\": \"none\",\n \"method\": \"get\",\n \"path\": \"/oauth2/sessions/logout\"\n }\n },\n \"service\": \"oauth2\",\n \"version\": \"v1\"\n }\n },\n \"quranReflect\": {\n \"v1\": {\n \"operations\": {\n \"usersControllerProfile\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/profile\"\n },\n \"usersControllerUpdateProfile\": {\n \"auth\": \"user\",\n \"method\": \"put\",\n \"path\": \"/v1/users/profile\"\n },\n \"usersControllerEditProfile\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/users/profile\"\n },\n \"usersControllerRooms\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/my-rooms\"\n },\n \"usersControllerSearch\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/search\"\n },\n \"usersControllerToggleFollow\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/users/{followeeId}/toggle-follow\"\n },\n \"usersControllerRemoveFollower\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/users/{followerId}/remove-follower\"\n },\n \"usersControllerGetUserProfile\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/{id}\"\n },\n \"usersControllerGetUserProfile2\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/{username}/profile\"\n },\n \"usersControllerGetUserFollowers\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/{id}/followers\"\n },\n \"usersControllerGetUserFollowing\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/{id}/following\"\n },\n \"roomsControllerAdminsAccess\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/admins-access\"\n },\n \"roomsControllerCreateNewGroup\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/groups\"\n },\n \"roomsControllerUpdateGroup\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/rooms/groups\"\n },\n \"roomsControllerCreateNewPage\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/pages\"\n },\n \"roomsControllerUpdatePage\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/rooms/pages\"\n },\n \"roomsControllerGetRoomMembers\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/{id}/members\"\n },\n \"roomsControllerInviteUserToRoom\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/{id}/invite\"\n },\n \"roomsControllerAcceptInvite\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/{id}/accept-invite\"\n },\n \"roomsControllerRejectInvite\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/{id}/reject-invite\"\n },\n \"roomsControllerRemoveMember\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/rooms/{id}/members/{userId}\"\n },\n \"roomsControllerGetRooms\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/joined-rooms\"\n },\n \"roomsControllerGetRooms2\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/managed-rooms\"\n },\n \"roomsControllerSearchRooms\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/search\"\n },\n \"roomsControllerGetRoomProfile\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/group/{url}\"\n },\n \"roomsControllerGetRoomProfile2\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/page/{subdomain}\"\n },\n \"roomsControllerAcceptByPrivateToken\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/group/{url}/accept/{token}\"\n },\n \"roomsControllerAcceptByPrivateToken2\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/page/{subdomain}/accept/{token}\"\n },\n \"roomsControllerGetRoomProfileById\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/{id}\"\n },\n \"roomsControllerGetRoomPosts\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/{id}/posts\"\n },\n \"roomsControllerJoinRoom\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/{groupId}/join\"\n },\n \"roomsControllerLeaveGroup\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/{groupId}/leave\"\n },\n \"roomsControllerFollowPage\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/{pageId}/follow\"\n },\n \"roomsControllerUnfollowPage\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/{pageId}/unfollow\"\n },\n \"roomsControllerUpdatePostPrivacy\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/rooms/{roomId}/posts/{postId}/privacy\"\n },\n \"postsControllerFeed\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/feed\"\n },\n \"postsControllerGetRelatedPosts\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/{postId}/related\"\n },\n \"postsControllerGetLoggedinUserPosts\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/my-posts\"\n },\n \"postsControllerGetLikedState\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/{id}/liked\"\n },\n \"postsControllerFindOne\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/{id}\"\n },\n \"postsControllerEdit\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/posts/{id}\"\n },\n \"postsControllerDelete\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/posts/{id}\"\n },\n \"postsControllerViewTracking\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/viewed/{id}\"\n },\n \"postsControllerCreate\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/posts\"\n },\n \"postsControllerReportAbuse\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/posts/{id}/report\"\n },\n \"postsControllerGetUserPost\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/user-posts/{id}\"\n },\n \"postsControllerToggleLike\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/posts/{id}/toggle-like\"\n },\n \"postsControllerToggleSave\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/posts/{id}/toggle-save\"\n },\n \"postsControllerGetComments\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/{id}/comments\"\n },\n \"postsControllerGetAllComment\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/{id}/all-comments\"\n },\n \"postsControllerExportMultiplePosts\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/posts/export/pdf\"\n },\n \"postsControllerGetMyPostsCountWithinRange\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/count-within-range\"\n },\n \"postsControllerGetMyPostsByVerse\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/by-verse/{verseKey}\"\n },\n \"tagsControllerFind\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/tags\"\n },\n \"commentsControllerCreate\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/comments\"\n },\n \"commentsControllerDeleteComment\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/comments/{id}/delete\"\n },\n \"commentsControllerToggleLike\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/comments/{id}/toggle-like\"\n },\n \"commentsControllerGet\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/comments/{id}/replies\"\n }\n },\n \"service\": \"quranReflect\",\n \"version\": \"v1\"\n }\n }\n}\n","import type {\n CatalogOperationDefinition as BaseCatalogOperationDefinition,\n OperationDefinition as BaseOperationDefinition,\n ServiceOperationCatalog as BaseServiceOperationCatalog,\n HttpMethod,\n OperationAuthMode,\n} from \"./contracts\";\nimport publicOperationCatalogJson from \"./specs/public-operation-catalog.json\";\n\nexport type AuthService = \"auth\" | \"quranReflect\";\n\nexport type PublicApiService = AuthService | \"oauth2\";\n\nexport interface OperationDefinition\n extends Omit<BaseOperationDefinition, \"service\"> {\n service: PublicApiService;\n}\n\nexport interface CatalogOperationDefinition\n extends Omit<BaseCatalogOperationDefinition, \"service\"> {\n service?: PublicApiService;\n}\n\nexport interface ServiceOperationCatalog\n extends Omit<BaseServiceOperationCatalog, \"operations\" | \"service\"> {\n operations: Record<string, CatalogOperationDefinition>;\n service: PublicApiService;\n}\n\ninterface PublicOperationCatalog {\n auth: { v1: ServiceOperationCatalog };\n oauth2: { v1: ServiceOperationCatalog };\n quranReflect: { v1: ServiceOperationCatalog };\n}\n\nexport const publicOperationCatalog =\n publicOperationCatalogJson as PublicOperationCatalog;\n\nexport type { HttpMethod, OperationAuthMode };\n","import type { OperationRequest, TokenResponse, UserSession } from \"@/types\";\n\nexport const encodeBasicAuth = (username: string, password: string): string => {\n const raw = `${username}:${password}`;\n\n if (typeof Buffer !== \"undefined\") {\n return Buffer.from(raw).toString(\"base64\");\n }\n\n if (typeof globalThis.btoa === \"function\") {\n return globalThis.btoa(raw);\n }\n\n throw new Error(\"No base64 encoder available for HTTP basic auth.\");\n};\n\nexport const prepareBody = (\n request: OperationRequest,\n headers: Headers,\n): string | URLSearchParams | undefined => {\n if (request.body === undefined || request.body === null) {\n return undefined;\n }\n\n if (\n typeof request.body === \"string\" ||\n request.body instanceof URLSearchParams\n ) {\n if (request.contentType) {\n headers.set(\"Content-Type\", request.contentType);\n }\n\n return request.body;\n }\n\n headers.set(\"Content-Type\", request.contentType ?? \"application/json\");\n return JSON.stringify(request.body);\n};\n\nexport const toUserSession = (\n token: TokenResponse & {\n accessToken?: string;\n expiresIn?: number;\n idToken?: string;\n refreshToken?: string;\n tokenType?: string;\n },\n currentSession?: Partial<UserSession> | null,\n): UserSession => {\n const expiresIn = token.expiresIn ?? token.expires_in;\n const accessToken = token.accessToken ?? token.access_token;\n const idToken = token.idToken ?? token.id_token ?? currentSession?.idToken;\n const refreshToken =\n token.refreshToken ?? token.refresh_token ?? currentSession?.refreshToken;\n const tokenType =\n token.tokenType ?? token.token_type ?? currentSession?.tokenType;\n const scope = token.scope ?? currentSession?.scope;\n const expiresAt = expiresIn\n ? Date.now() + expiresIn * 1000\n : currentSession?.expiresAt;\n\n return {\n accessToken,\n expiresAt,\n idToken,\n refreshToken,\n scope,\n tokenType,\n };\n};\n","import type { ApiService } from \"@/types\";\n\nimport operationCatalogJson from \"./specs/operation-catalog.json\";\n\nexport type HttpMethod = \"get\" | \"post\" | \"put\" | \"patch\" | \"delete\";\nexport type OperationAuthMode = \"none\" | \"app\" | \"user\";\n\nexport interface OperationDefinition {\n auth: OperationAuthMode;\n method: HttpMethod;\n operationId?: string;\n operationName: string;\n path: string;\n serverUrl?: string;\n service: ApiService;\n tags: string[];\n version: string;\n}\n\nexport type CatalogOperationDefinition = Omit<\n OperationDefinition,\n \"operationName\" | \"service\" | \"tags\" | \"version\"\n> &\n Partial<\n Pick<OperationDefinition, \"operationName\" | \"service\" | \"tags\" | \"version\">\n >;\n\nexport interface ServiceOperationCatalog {\n operations: Record<string, CatalogOperationDefinition>;\n service: ApiService;\n version: string;\n}\n\ninterface OperationCatalog {\n auth: { v1: ServiceOperationCatalog };\n content: { v4: ServiceOperationCatalog };\n oauth2: { v1: ServiceOperationCatalog };\n quranReflect: { v1: ServiceOperationCatalog };\n search: { v1: ServiceOperationCatalog };\n}\n\nexport const operationCatalog = operationCatalogJson as OperationCatalog;\n\nexport const resolveCatalogOperation = (\n section: ServiceOperationCatalog,\n operationName: string,\n operation: CatalogOperationDefinition,\n): OperationDefinition => {\n return {\n ...operation,\n operationName: operation.operationName ?? operationName,\n service: operation.service ?? section.service,\n tags: operation.tags ?? [],\n version: operation.version ?? section.version,\n };\n};\n\nexport const getOperationByName = (\n service: ApiService,\n version: string,\n operationName: string,\n): OperationDefinition | undefined => {\n const serviceCatalog = operationCatalog[service] as\n | Record<string, ServiceOperationCatalog | undefined>\n | undefined;\n if (!serviceCatalog) {\n return undefined;\n }\n\n const versionCatalog = serviceCatalog[version];\n const operation = versionCatalog?.operations[operationName];\n if (!versionCatalog || !operation) {\n return undefined;\n }\n\n return resolveCatalogOperation(versionCatalog, operationName, operation);\n};\n","import type {\n HttpMethod,\n OperationDefinition,\n ServiceOperationCatalog,\n} from \"@/generated/contracts\";\nimport { resolveCatalogOperation } from \"@/generated/contracts\";\n\nexport const HTTP_METHOD_TO_MUTATION_NAME: Record<HttpMethod, string> = {\n delete: \"remove\",\n get: \"list\",\n patch: \"update\",\n post: \"create\",\n put: \"update\",\n};\n\nexport const toCamelCase = (value: string): string => {\n const parts = value\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .replace(/[^A-Za-z0-9]+/g, \" \")\n .trim()\n .split(/\\s+/)\n .filter(Boolean);\n\n if (parts.length === 0) {\n return \"misc\";\n }\n\n return parts\n .map((part, index) => {\n const lower = part.toLowerCase();\n if (index === 0) {\n return lower;\n }\n\n return lower.charAt(0).toUpperCase() + lower.slice(1);\n })\n .join(\"\");\n};\n\nexport const toPascalCase = (value: string): string => {\n const camel = toCamelCase(value);\n return camel.charAt(0).toUpperCase() + camel.slice(1);\n};\n\nexport const isPathParam = (segment: string): boolean =>\n segment.startsWith(\"{\") && segment.endsWith(\"}\");\n\nexport const getResourceSegments = (path: string): string[] => {\n const segments = path.split(\"/\").filter(Boolean);\n if (segments[0]?.match(/^v\\d+$/)) {\n return segments.slice(1);\n }\n\n return segments;\n};\n\nexport const pickGeneratedMethodName = (\n operation: OperationDefinition,\n): string => {\n const resourceSegments = getResourceSegments(operation.path);\n const lastSegment = resourceSegments.at(-1);\n const literalSegments = resourceSegments.filter(\n (segment) => !isPathParam(segment),\n );\n const lastLiteral = literalSegments.at(-1);\n const groupLiteral = literalSegments[0];\n\n if (resourceSegments.length === 1) {\n return HTTP_METHOD_TO_MUTATION_NAME[operation.method];\n }\n\n if (\n resourceSegments.length === 2 &&\n lastSegment &&\n isPathParam(lastSegment)\n ) {\n if (operation.method === \"get\") {\n return \"get\";\n }\n\n if (operation.method === \"delete\") {\n return \"remove\";\n }\n\n return \"update\";\n }\n\n if (lastSegment && !isPathParam(lastSegment) && lastLiteral) {\n if (lastLiteral === groupLiteral) {\n return `${HTTP_METHOD_TO_MUTATION_NAME[operation.method]}ById`;\n }\n\n return toCamelCase(lastLiteral);\n }\n\n return toCamelCase(operation.operationName);\n};\n\nexport type RawOperation = (request?: unknown) => Promise<unknown>;\nexport type GeneratedGroup = Record<string, RawOperation>;\nexport type GeneratedGroups = Record<string, GeneratedGroup>;\n\nexport interface FetcherLike {\n request<T = unknown>(\n service: string,\n path: string,\n query?: unknown,\n request?: unknown,\n ): Promise<T>;\n requestOperation<T = unknown>(\n operation: OperationDefinition,\n request?: unknown,\n ): Promise<T>;\n getUserSession(): Promise<unknown>;\n setUserSession(session: unknown): Promise<void>;\n buildServiceUrl(service: string, path: string, query?: unknown): string;\n}\n\nexport const createRawClient = (\n fetcher: FetcherLike,\n section: ServiceOperationCatalog,\n): Record<string, RawOperation> => {\n const rawOperations: Record<string, RawOperation> = {};\n\n for (const [operationName, operation] of Object.entries(section.operations)) {\n const resolvedOperation = resolveCatalogOperation(\n section,\n operationName,\n operation,\n );\n\n rawOperations[operationName] = (request?: unknown) =>\n fetcher.requestOperation(resolvedOperation, request);\n }\n\n return rawOperations;\n};\n\nexport const createGeneratedGroups = (\n section: ServiceOperationCatalog,\n rawOperations: Record<string, RawOperation>,\n): GeneratedGroups => {\n const groups: GeneratedGroups = {};\n\n for (const [operationName, operation] of Object.entries(section.operations)) {\n const resolvedOperation = resolveCatalogOperation(\n section,\n operationName,\n operation,\n );\n const literals = getResourceSegments(resolvedOperation.path).filter(\n (segment) => !isPathParam(segment),\n );\n const groupName = toCamelCase(literals[0] ?? \"misc\");\n const suggestedName = pickGeneratedMethodName(resolvedOperation);\n const currentGroup = groups[groupName] ?? {};\n let methodName = suggestedName;\n\n if (currentGroup[methodName]) {\n methodName = `${suggestedName}${toPascalCase(operationName)}`;\n }\n\n currentGroup[methodName] = rawOperations[operationName]!;\n groups[groupName] = currentGroup;\n }\n\n return groups;\n};\n","import type { ApiParams } from \"@/types\";\nimport humps from \"humps\";\n\nconst { decamelize } = humps;\n\nexport const ensureLeadingSlash = (value: string): string =>\n value.startsWith(\"/\") ? value : `/${value}`;\n\nexport const removeTrailingSlash = (value: string): string =>\n value.endsWith(\"/\") ? value.slice(0, -1) : value;\n\nexport const removeBeginningSlash = (url: string) => {\n return url.startsWith(\"/\") ? url.slice(1) : url;\n};\n\nexport const replacePathParams = (\n path: string,\n params?: Record<string, string | number>,\n): string => {\n return path.replace(/\\{([^}]+)\\}/g, (_match: string, rawKey: string) => {\n const value = params?.[rawKey];\n if (value === undefined) {\n throw new Error(`Missing path parameter: ${rawKey}`);\n }\n\n return encodeURIComponent(String(value));\n });\n};\n\nexport const normalizePathTemplate = (path: string): string =>\n path.replace(/(^|\\/):([A-Za-z0-9_]+)/g, \"$1{$2}\");\n\ninterface ParamsToStringOptions {\n preserveCase?: boolean;\n}\n\nconst fieldsKey = [\"wordFields\", \"translationFields\", \"fields\"] as const;\nconst fieldsKeySet = new Set<string>([\n ...fieldsKey,\n ...fieldsKey.map((key) => decamelize(key)),\n]);\nconst preservedKeys = new Set([\n \"navigationalResultsNumber\",\n \"versesResultsNumber\",\n]);\n\nexport const paramsToString = (\n params?: ApiParams,\n options: ParamsToStringOptions = {},\n): string => {\n if (!params) return \"\";\n\n const paramsString = new URLSearchParams();\n\n for (const [rawKey, rawValue] of Object.entries(params)) {\n if (rawValue === undefined) continue;\n\n const key =\n options.preserveCase || preservedKeys.has(rawKey)\n ? rawKey\n : decamelize(rawKey);\n\n // fields is a special case, it's an object with boolean values\n if (fieldsKeySet.has(rawKey) || fieldsKeySet.has(key)) {\n const fields = Object.entries(rawValue as Record<string, boolean>)\n .filter(([, value]) => value)\n .map(([fieldKey]) => decamelize(fieldKey));\n if (fields.length > 0) {\n paramsString.set(key, fields.join(\",\"));\n }\n continue;\n }\n\n if (typeof rawValue === \"string\") {\n paramsString.set(key, rawValue);\n } else if (typeof rawValue === \"number\") {\n paramsString.set(key, rawValue.toString());\n } else if (typeof rawValue === \"boolean\") {\n paramsString.set(key, rawValue.toString());\n } else if (Array.isArray(rawValue)) {\n paramsString.set(key, rawValue.join(\",\"));\n }\n }\n\n if (paramsString.size === 0) return \"\";\n return `?${paramsString.toString()}`;\n};\n","export const API_BASE_URL = \"https://apis.quran.foundation\";\n\nexport const DEFAULT_BASE_URLS = {\n auth: \"https://apis.quran.foundation/auth\",\n content: \"https://apis.quran.foundation/content\",\n oauth2: \"https://oauth2.quran.foundation\",\n quranReflect: \"https://apis.quran.foundation/quran-reflect\",\n search: \"https://apis.quran.foundation/search\",\n} as const;\n\nexport const DIRECT_PATH_PREFIX = {\n auth: \"/v1\",\n content: \"/api/v4\",\n oauth2: \"\",\n quranReflect: \"/v1\",\n search: \"/v1\",\n} as const;\n\nexport const GATEWAY_PATH_PREFIX = {\n auth: \"/auth/v1\",\n content: \"/content/api/v4\",\n oauth2: \"\",\n quranReflect: \"/quran-reflect/v1\",\n search: \"/search/v1\",\n} as const;\n\nexport const LEGACY_PREFIXES = {\n auth: [\"/auth/v1\", \"/v1\"] as const,\n content: [\"/content/api/v4\", \"/api/v4\"] as const,\n oauth2: [] as const,\n quranReflect: [\"/quran-reflect/v1\", \"/v1\"] as const,\n search: [\"/search/v1\", \"/v1\"] as const,\n} as const;\n","import type {\n OperationDefinition,\n PublicApiService,\n} from \"@/generated/public-contracts\";\nimport type {\n ApiParams,\n CustomFetcher,\n OperationRequest,\n PublicClientConfig,\n UserSession,\n} from \"@/types\";\nimport { prepareBody } from \"@/lib/http-utils\";\nimport {\n DEFAULT_BASE_URLS,\n DIRECT_PATH_PREFIX,\n GATEWAY_PATH_PREFIX,\n LEGACY_PREFIXES,\n} from \"@/lib/service-config\";\nimport {\n ensureLeadingSlash,\n normalizePathTemplate,\n paramsToString,\n removeTrailingSlash,\n replacePathParams,\n} from \"@/lib/url\";\nimport humps from \"humps\";\n\nconst { camelizeKeys } = humps;\n\nexport class PublicQuranFetcher {\n private userSession: UserSession | null | undefined;\n\n constructor(private readonly config: PublicClientConfig) {\n this.userSession = config.userSession;\n }\n\n public clearCachedTokens(): void {\n return;\n }\n\n public getFetch(): CustomFetcher {\n const doFetch = this.config.fetch ?? globalThis.fetch;\n\n if (typeof doFetch !== \"function\") {\n throw new Error(\n \"No fetch function available. Please provide a fetch implementation or ensure global fetch is available.\",\n );\n }\n\n return doFetch;\n }\n\n public async getUserSession(): Promise<UserSession | null> {\n const storedSession = await this.config.storage?.getSession?.();\n if (storedSession !== undefined) {\n return storedSession;\n }\n\n return this.userSession ?? null;\n }\n\n public async setUserSession(session: UserSession | null): Promise<void> {\n if (!this.config.storage) {\n this.userSession = session;\n return;\n }\n\n if (!session) {\n if (this.config.storage.clearSession) {\n await this.config.storage.clearSession();\n this.userSession = null;\n return;\n }\n\n await this.config.storage.setSession?.(null);\n this.userSession = null;\n return;\n }\n\n await this.config.storage.setSession?.(session);\n this.userSession = session;\n }\n\n public buildServiceUrl(\n service: PublicApiService,\n path: string,\n query?: ApiParams,\n ): string {\n const { baseUrl, usesGateway } = this.resolveServiceBaseUrl(service);\n const servicePath = this.normalizeServicePath(service, path, usesGateway);\n const preserveQueryParamCase =\n service === \"auth\" || service === \"quranReflect\";\n\n return `${baseUrl}${servicePath}${paramsToString(query, {\n preserveCase: preserveQueryParamCase,\n })}`;\n }\n\n public async requestOperation<T = unknown>(\n operation: OperationDefinition,\n request?: OperationRequest,\n ): Promise<T> {\n return this.request<T>(\n operation.service,\n replacePathParams(operation.path, request?.path),\n request?.query,\n {\n ...request,\n auth:\n request?.auth === \"auto\" || !request?.auth\n ? operation.auth\n : request.auth,\n method:\n request?.method ??\n (operation.method.toUpperCase() as OperationRequest[\"method\"]),\n path: undefined,\n },\n );\n }\n\n public async request<T = unknown>(\n service: PublicApiService,\n path: string,\n query?: ApiParams,\n request: OperationRequest = {},\n ): Promise<T> {\n if (request.basicAuth) {\n throw new Error(\"client_secret is server-only. Use @quranjs/api/server.\");\n }\n\n const effectiveAuth = this.resolveAuthMode(service, request.auth);\n const url = this.buildServiceUrl(service, path, query);\n const headers = new Headers(request.headers);\n const body = prepareBody(request, headers);\n\n if (service !== \"oauth2\") {\n headers.set(\"x-client-id\", this.config.clientId);\n }\n\n await this.applyAuthenticationHeaders(\n service,\n effectiveAuth,\n headers,\n request,\n );\n\n const response = await this.getFetch()(url, {\n body,\n headers,\n method: request.method ?? \"GET\",\n });\n\n if (!response.ok) {\n throw new Error(`${response.status} ${response.statusText}`);\n }\n\n if (response.status === 204) {\n return undefined as T;\n }\n\n const contentType = response.headers.get(\"content-type\") ?? \"\";\n if (!contentType.includes(\"application/json\")) {\n return (await response.text()) as T;\n }\n\n const json = await response.json();\n return camelizeKeys(json as object) as T;\n }\n\n private resolveAuthMode(\n service: PublicApiService,\n auth: OperationRequest[\"auth\"] = \"auto\",\n ): \"none\" | \"user\" {\n if (auth !== \"auto\") {\n if (auth === \"app\") {\n throw new Error(\n \"This API requires @quranjs/api/server or a backend. Content and search are server-side for confidential clients.\",\n );\n }\n\n return auth;\n }\n\n if (service === \"auth\" || service === \"quranReflect\") {\n return \"user\";\n }\n\n return \"none\";\n }\n\n private async applyAuthenticationHeaders(\n service: PublicApiService,\n auth: \"none\" | \"user\",\n headers: Headers,\n request: OperationRequest,\n ): Promise<void> {\n if (request.accessToken) {\n this.setTokenHeaders(service, headers, request.accessToken);\n return;\n }\n\n if (auth === \"none\") {\n return;\n }\n\n const session = await this.getUserSession();\n if (!session?.accessToken) {\n throw new Error(\n \"This operation requires a user session. Sign in first or use @quranjs/api/server.\",\n );\n }\n\n this.setTokenHeaders(service, headers, session.accessToken);\n }\n\n private setTokenHeaders(\n service: PublicApiService,\n headers: Headers,\n accessToken: string,\n ): void {\n if (service === \"oauth2\") {\n headers.set(\"Authorization\", `Bearer ${accessToken}`);\n return;\n }\n\n headers.set(\"x-auth-token\", accessToken);\n }\n\n private resolveServiceBaseUrl(service: PublicApiService): {\n baseUrl: string;\n usesGateway: boolean;\n } {\n const { services } = this.config;\n const directBaseUrl =\n service === \"auth\"\n ? services?.authBaseUrl\n : service === \"quranReflect\"\n ? services?.quranReflectBaseUrl\n : (services?.oauth2BaseUrl ?? services?.tokenHost);\n\n if (directBaseUrl) {\n return {\n baseUrl: removeTrailingSlash(directBaseUrl),\n usesGateway: false,\n };\n }\n\n if (services?.gatewayUrl && service !== \"oauth2\") {\n return {\n baseUrl: removeTrailingSlash(services.gatewayUrl),\n usesGateway: true,\n };\n }\n\n return {\n baseUrl: DEFAULT_BASE_URLS[service],\n usesGateway: false,\n };\n }\n\n private normalizeServicePath(\n service: PublicApiService,\n path: string,\n usesGateway: boolean,\n ): string {\n let normalizedPath = ensureLeadingSlash(normalizePathTemplate(path));\n for (const legacyPrefix of LEGACY_PREFIXES[service]) {\n if (normalizedPath.startsWith(legacyPrefix)) {\n normalizedPath = ensureLeadingSlash(\n normalizedPath.slice(legacyPrefix.length),\n );\n break;\n }\n }\n\n const prefix = usesGateway\n ? GATEWAY_PATH_PREFIX[service]\n : DIRECT_PATH_PREFIX[service];\n\n if (normalizedPath.startsWith(prefix) || prefix.length === 0) {\n return normalizedPath;\n }\n\n return `${prefix}${normalizedPath}`;\n }\n}\n","import type { AuthService } from \"@/generated/public-contracts\";\nimport type {\n ApiParams,\n HTTPMethod,\n OperationRequest,\n PublicClientConfig,\n TokenResponse,\n} from \"@/types\";\nimport { publicOperationCatalog } from \"@/generated/public-contracts\";\nimport { toUserSession } from \"@/lib/http-utils\";\nimport { createGeneratedGroups, createRawClient } from \"@/lib/runtime-utils\";\nimport { replacePathParams } from \"@/lib/url\";\nimport { PublicQuranFetcher } from \"@/sdk/public-fetcher\";\n\ntype RawOperation = (request?: OperationRequest) => Promise<unknown>;\ntype GeneratedGroup = Record<string, RawOperation>;\ntype QuranReflectFacade = {\n comments: GeneratedGroup;\n posts: GeneratedGroup;\n raw: Record<string, RawOperation>;\n rooms: GeneratedGroup;\n tags: GeneratedGroup;\n users: GeneratedGroup;\n};\n\nconst SERVER_ONLY_MESSAGE =\n \"This API requires @quranjs/api/server or a backend. Content and search are server-side for confidential clients.\";\nconst LEGACY_BOOKMARK_GET_MESSAGE =\n \"auth.bookmarks.get(bookmarkId) is not supported because /v1/bookmarks/bookmark expects bookmark detail query parameters. Pass a query object such as { mushafId, key, type, verseNumber } or { mushafId, isReading: true }.\";\n\nconst createUserServiceRequest =\n (fetcher: PublicQuranFetcher, service: AuthService) =>\n (method: HTTPMethod, path: string, request?: OperationRequest) => {\n return fetcher.request<unknown>(\n service,\n replacePathParams(path, request?.path),\n request?.query,\n {\n ...request,\n auth: \"user\",\n method,\n path: undefined,\n query: undefined,\n },\n );\n };\n\nconst createAuthFacade = (fetcher: PublicQuranFetcher) => {\n const raw = createRawClient(fetcher, publicOperationCatalog.auth.v1);\n const generatedGroups = createGeneratedGroups(\n publicOperationCatalog.auth.v1,\n raw,\n );\n const request = createUserServiceRequest(fetcher, \"auth\");\n\n return {\n ...generatedGroups,\n collections: {\n ...generatedGroups.collections,\n addBookmark: (collectionId: string, body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/collections/{collectionId}/bookmarks\", {\n body,\n path: { collectionId },\n }),\n create: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/collections\", { body }),\n get: (collectionId: string, query?: ApiParams) =>\n request(\"GET\", \"/v1/collections/{collectionId}\", {\n path: { collectionId },\n query,\n }),\n list: (query?: ApiParams) => request(\"GET\", \"/v1/collections\", { query }),\n listAll: (query?: ApiParams) =>\n request(\"GET\", \"/v1/collections/all\", { query }),\n remove: (collectionId: string) =>\n request(\"DELETE\", \"/v1/collections/{collectionId}\", {\n path: { collectionId },\n }),\n removeBookmark: (collectionId: string, bookmarkId: string) =>\n request(\n \"DELETE\",\n \"/v1/collections/{collectionId}/bookmarks/{bookmarkId}\",\n {\n path: { bookmarkId, collectionId },\n },\n ),\n update: (collectionId: string, body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/collections/{collectionId}\", {\n body,\n path: { collectionId },\n }),\n },\n bookmarks: {\n ...generatedGroups.bookmarks,\n create: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/bookmarks\", { body }),\n get: async (query?: ApiParams | string) => {\n if (typeof query === \"string\") {\n throw new Error(LEGACY_BOOKMARK_GET_MESSAGE);\n }\n\n return request(\"GET\", \"/v1/bookmarks/bookmark\", {\n query,\n });\n },\n list: (query?: ApiParams) => request(\"GET\", \"/v1/bookmarks\", { query }),\n listCollections: (query?: ApiParams) =>\n request(\"GET\", \"/v1/bookmarks/collections\", { query }),\n listRange: (query?: ApiParams) =>\n request(\"GET\", \"/v1/bookmarks/ayahs-range\", { query }),\n remove: (bookmarkId: string) =>\n request(\"DELETE\", \"/v1/bookmarks/{bookmarkId}\", {\n path: { bookmarkId },\n }),\n },\n goals: {\n ...generatedGroups.goals,\n create: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/goals\", { body }),\n estimate: (query?: ApiParams) =>\n request(\"GET\", \"/v1/goals/estimate\", { query }),\n getTodaysPlan: (query?: ApiParams) =>\n request(\"GET\", \"/v1/goals/get-todays-plan\", { query }),\n remove: (id: string) =>\n request(\"DELETE\", \"/v1/goals/{id}\", { path: { id } }),\n update: (id: string, body: Record<string, unknown>) =>\n request(\"PUT\", \"/v1/goals/{id}\", {\n body,\n path: { id },\n }),\n },\n notes: {\n ...generatedGroups.notes,\n create: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/notes\", { body }),\n get: (noteId: string) =>\n request(\"GET\", \"/v1/notes/{noteId}\", { path: { noteId } }),\n list: (query?: ApiParams) => request(\"GET\", \"/v1/notes\", { query }),\n listByAttachedEntity: (query?: ApiParams) =>\n request(\"GET\", \"/v1/notes/by-attached-entity\", { query }),\n listByRange: (query?: ApiParams) =>\n request(\"GET\", \"/v1/notes/by-range\", { query }),\n listByVerseKey: (verseKey: string, query?: ApiParams) =>\n request(\"GET\", \"/v1/notes/by-verse/{verseKey}\", {\n path: { verseKey },\n query,\n }),\n publish: (noteId: string, body?: Record<string, unknown>) =>\n request(\"POST\", \"/v1/notes/{noteId}/publish\", {\n body,\n path: { noteId },\n }),\n remove: (noteId: string) =>\n request(\"DELETE\", \"/v1/notes/{noteId}\", { path: { noteId } }),\n update: (noteId: string, body: Record<string, unknown>) =>\n request(\"PATCH\", \"/v1/notes/{noteId}\", {\n body,\n path: { noteId },\n }),\n },\n preferences: {\n ...generatedGroups.preferences,\n bulkUpdate: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/preferences/bulk\", { body }),\n get: (query?: ApiParams) => request(\"GET\", \"/v1/preferences\", { query }),\n update: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/preferences\", { body }),\n },\n raw,\n readingSessions: {\n ...generatedGroups.readingSessions,\n create: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/reading-sessions\", { body }),\n list: (query?: ApiParams) =>\n request(\"GET\", \"/v1/reading-sessions\", { query }),\n },\n };\n};\n\nconst createQuranReflectFacade = (\n fetcher: PublicQuranFetcher,\n): QuranReflectFacade => {\n const raw = createRawClient(fetcher, publicOperationCatalog.quranReflect.v1);\n const generatedGroups = createGeneratedGroups(\n publicOperationCatalog.quranReflect.v1,\n raw,\n );\n\n return {\n comments: generatedGroups.comments ?? {},\n posts: generatedGroups.posts ?? {},\n raw,\n rooms: generatedGroups.rooms ?? {},\n tags: generatedGroups.tags ?? {},\n users: generatedGroups.users ?? {},\n };\n};\n\nconst createOAuth2Facade = (\n fetcher: PublicQuranFetcher,\n config: PublicClientConfig,\n) => {\n const raw = createRawClient(fetcher, publicOperationCatalog.oauth2.v1);\n\n const exchangeToken = async (\n body: URLSearchParams,\n options: { requiresRefreshToken?: boolean } = {},\n ) => {\n if (config.clientType !== \"public\") {\n throw new Error(\n \"This OAuth2 exchange requires a backend because your client is confidential.\",\n );\n }\n\n if (options.requiresRefreshToken && !body.get(\"refresh_token\")) {\n throw new Error(\"Missing refresh token.\");\n }\n\n body.set(\"client_id\", config.clientId);\n\n const requestRefreshToken = body.get(\"refresh_token\") ?? undefined;\n const storedSession = options.requiresRefreshToken\n ? await fetcher.getUserSession()\n : null;\n const currentSession =\n options.requiresRefreshToken && requestRefreshToken\n ? { ...(storedSession ?? {}), refreshToken: requestRefreshToken }\n : storedSession;\n\n const token = await fetcher.request<TokenResponse>(\n \"oauth2\",\n \"/oauth2/token\",\n undefined,\n {\n auth: \"none\",\n body,\n contentType: \"application/x-www-form-urlencoded\",\n method: \"POST\",\n },\n );\n\n await fetcher.setUserSession(toUserSession(token, currentSession));\n return token;\n };\n\n return {\n authorizeUrl: (query: Record<string, string | number | undefined>) =>\n fetcher.buildServiceUrl(\"oauth2\", \"/oauth2/auth\", query as ApiParams),\n exchangeCode: (params: {\n code: string;\n codeVerifier?: string;\n redirectUri: string;\n scope?: string;\n }) => {\n const body = new URLSearchParams({\n code: params.code,\n grant_type: \"authorization_code\",\n redirect_uri: params.redirectUri,\n });\n\n if (params.codeVerifier) {\n body.set(\"code_verifier\", params.codeVerifier);\n }\n\n if (params.scope) {\n body.set(\"scope\", params.scope);\n }\n\n return exchangeToken(body);\n },\n getUserInfo: (accessToken?: string) =>\n fetcher.request(\"oauth2\", \"/userinfo\", undefined, {\n accessToken,\n auth: \"user\",\n method: \"GET\",\n }),\n introspect: () => {\n throw new Error(\n \"Token introspection requires @quranjs/api/server or a backend.\",\n );\n },\n logout: (query?: ApiParams) =>\n fetcher.request(\"oauth2\", \"/oauth2/sessions/logout\", query, {\n auth: \"none\",\n method: \"GET\",\n }),\n raw,\n refresh: async (refreshToken?: string) => {\n const currentSession = await fetcher.getUserSession();\n const body = new URLSearchParams({\n grant_type: \"refresh_token\",\n refresh_token: refreshToken ?? currentSession?.refreshToken ?? \"\",\n });\n\n return exchangeToken(body, { requiresRefreshToken: true });\n },\n };\n};\n\ntype ServerOnlyGuard = ((...args: unknown[]) => Promise<never>) & {\n [key: string]: ServerOnlyGuard | undefined;\n};\n\nconst createServerOnlyGuard = (): ServerOnlyGuard => {\n const fail = (() =>\n Promise.reject(new Error(SERVER_ONLY_MESSAGE))) as ServerOnlyGuard;\n const proxy = new Proxy(fail, {\n apply() {\n return Promise.reject(new Error(SERVER_ONLY_MESSAGE));\n },\n get(_target, property) {\n if (property === \"then\") {\n return undefined;\n }\n\n return proxy;\n },\n });\n\n return proxy;\n};\n\nexport const createPublicRuntimeClient = (config: PublicClientConfig) => {\n const fetcher = new PublicQuranFetcher(config);\n fetcher.getFetch();\n\n const authV1 = createAuthFacade(fetcher);\n const quranReflectV1 = createQuranReflectFacade(fetcher);\n const oauth2V1 = createOAuth2Facade(fetcher, config);\n const serverOnlyGuard = createServerOnlyGuard();\n\n const raw = {\n auth: {\n v1: authV1.raw,\n },\n content: {\n v4: serverOnlyGuard,\n },\n oauth2: {\n v1: oauth2V1.raw,\n },\n quranReflect: {\n v1: quranReflectV1.raw,\n },\n search: {\n v1: serverOnlyGuard,\n },\n };\n\n return {\n audio: serverOnlyGuard,\n auth: {\n ...authV1,\n v1: authV1,\n },\n chapters: serverOnlyGuard,\n clearCachedTokens: () => fetcher.clearCachedTokens(),\n content: serverOnlyGuard,\n getUserSession: () => fetcher.getUserSession(),\n hadithReferences: serverOnlyGuard,\n juzs: serverOnlyGuard,\n oauth2: {\n ...oauth2V1,\n v1: oauth2V1,\n },\n quranReflect: {\n ...quranReflectV1,\n v1: quranReflectV1,\n },\n raw,\n resources: serverOnlyGuard,\n search: serverOnlyGuard,\n verses: serverOnlyGuard,\n };\n};\n","import type { PublicClientConfig } from \"@/types\";\n\nimport { createPublicRuntimeClient } from \"./runtime/create-public-client\";\n\nexport const createPublicClient = (config: PublicClientConfig) => {\n if ((config as PublicClientConfig & { clientSecret?: string }).clientSecret) {\n throw new Error(\"client_secret is server-only. Use @quranjs/api/server.\");\n }\n\n return createPublicRuntimeClient(config);\n};\n\nexport type PublicClient = ReturnType<typeof createPublicClient>;\n"]}
1
+ {"version":3,"sources":["../src/generated/specs/public-operation-catalog.json","../src/generated/public-contracts.ts","../src/lib/http-utils.ts","../src/generated/contracts.ts","../src/lib/runtime-utils.ts","../src/lib/url.ts","../src/lib/service-config.ts","../src/sdk/public-fetcher.ts","../src/runtime/create-public-client.ts","../src/public.ts"],"names":["public_operation_catalog_default","publicOperationCatalog","prepareBody","request","headers","toUserSession","token","currentSession","expiresIn","accessToken","idToken","refreshToken","tokenType","scope","expiresAt","resolveCatalogOperation","section","operationName","operation","HTTP_METHOD_TO_MUTATION_NAME","toCamelCase","value","parts","part","index","lower","toPascalCase","camel","isPathParam","segment","getResourceSegments","path","segments","pickGeneratedMethodName","resourceSegments","lastSegment","literalSegments","lastLiteral","groupLiteral","createRawClient","fetcher","rawOperations","resolvedOperation","createGeneratedGroups","groups","literals","groupName","suggestedName","currentGroup","methodName","decamelize","humps","ensureLeadingSlash","removeTrailingSlash","replacePathParams","params","_match","rawKey","normalizePathTemplate","fieldsKey","fieldsKeySet","key","preservedKeys","paramsToString","options","paramsString","rawValue","fields","fieldKey","DEFAULT_BASE_URLS","DIRECT_PATH_PREFIX","GATEWAY_PATH_PREFIX","LEGACY_PREFIXES","camelizeKeys","PublicQuranFetcher","config","doFetch","storedSession","session","service","query","baseUrl","usesGateway","servicePath","effectiveAuth","url","body","response","json","auth","services","directBaseUrl","normalizedPath","legacyPrefix","prefix","SERVER_ONLY_MESSAGE","LEGACY_BOOKMARK_GET_MESSAGE","createUserServiceRequest","method","createAuthFacade","raw","generatedGroups","collectionId","bookmarkId","id","noteId","verseKey","createQuranReflectFacade","createOAuth2Facade","exchangeToken","requestRefreshToken","createServerOnlyGuard","fail","proxy","_target","property","createPublicRuntimeClient","authV1","quranReflectV1","oauth2V1","serverOnlyGuard","createPublicClient"],"mappings":"oJAAA,IAAAA,CAAAA,CAAA,CACE,IAAA,CAAQ,CACN,GAAM,CACJ,UAAA,CAAc,CACZ,gBAAA,CAAoB,CAClB,KAAQ,MAAA,CACR,MAAA,CAAU,MACV,IAAA,CAAQ,iBACV,EACA,iBAAA,CAAqB,CACnB,IAAA,CAAQ,MAAA,CACR,MAAA,CAAU,MAAA,CACV,KAAQ,iBACV,CAAA,CACA,yCAA4C,CAC1C,IAAA,CAAQ,OACR,MAAA,CAAU,MAAA,CACV,KAAQ,0CACV,CAAA,CACA,2CAA8C,CAC5C,IAAA,CAAQ,OACR,MAAA,CAAU,QAAA,CACV,KAAQ,0CACV,CAAA,CACA,8BAAA,CAAkC,CAChC,IAAA,CAAQ,MAAA,CACR,OAAU,KAAA,CACV,IAAA,CAAQ,gCACV,CAAA,CACA,+BAAA,CAAmC,CACjC,IAAA,CAAQ,MAAA,CACR,OAAU,MAAA,CACV,IAAA,CAAQ,gCACV,CAAA,CACA,iCAAA,CAAqC,CACnC,IAAA,CAAQ,MAAA,CACR,OAAU,QAAA,CACV,IAAA,CAAQ,gCACV,CAAA,CACA,sDAAA,CAA0D,CACxD,KAAQ,MAAA,CACR,MAAA,CAAU,SACV,IAAA,CAAQ,uDACV,EACA,mBAAA,CAAuB,CACrB,IAAA,CAAQ,MAAA,CACR,MAAA,CAAU,KAAA,CACV,KAAQ,qBACV,CAAA,CACA,eAAkB,CAChB,IAAA,CAAQ,OACR,MAAA,CA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QA,CACV,CACF,CAAA,CCjXO,IAAMC,EAAAA,CAAsB9C,CAAAA,EAA+B,CAChE,GAAKA,CAAAA,CAA0D,YAAA,CAC7D,MAAM,IAAI,KAAA,CAAM,wDAAwD,CAAA,CAG1E,OAAOyC,CAAAA,CAA0BzC,CAAM,CACzC","file":"public.min.js","sourcesContent":["{\n \"auth\": {\n \"v1\": {\n \"operations\": {\n \"getV1Collections\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/collections\"\n },\n \"postV1Collections\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/collections\"\n },\n \"postV1CollectionsByCollectionIdBookmarks\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/collections/{collectionId}/bookmarks\"\n },\n \"deleteV1CollectionsByCollectionIdBookmarks\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/collections/{collectionId}/bookmarks\"\n },\n \"getV1CollectionsByCollectionId\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/collections/{collectionId}\"\n },\n \"postV1CollectionsByCollectionId\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/collections/{collectionId}\"\n },\n \"deleteV1CollectionsByCollectionId\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/collections/{collectionId}\"\n },\n \"deleteV1CollectionsByCollectionIdBookmarksByBookmarkId\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/collections/{collectionId}/bookmarks/{bookmarkId}\"\n },\n \"getV1CollectionsAll\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/collections/all\"\n },\n \"getV1Bookmarks\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/bookmarks\"\n },\n \"postV1Bookmarks\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/bookmarks\"\n },\n \"deleteV1BookmarksByBookmarkId\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/bookmarks/{bookmarkId}\"\n },\n \"getV1BookmarksAyahsRange\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/bookmarks/ayahs-range\"\n },\n \"getV1BookmarksBookmark\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/bookmarks/bookmark\"\n },\n \"getV1BookmarksCollections\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/bookmarks/collections\"\n },\n \"getV1Preferences\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/preferences\"\n },\n \"postV1Preferences\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/preferences\"\n },\n \"postV1PreferencesBulk\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/preferences/bulk\"\n },\n \"getV1ReadingSessions\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/reading-sessions\"\n },\n \"postV1ReadingSessions\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/reading-sessions\"\n },\n \"getV1GoalsGetTodaysPlan\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/goals/get-todays-plan\"\n },\n \"putV1GoalsById\": {\n \"auth\": \"user\",\n \"method\": \"put\",\n \"path\": \"/v1/goals/{id}\"\n },\n \"deleteV1GoalsById\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/goals/{id}\"\n },\n \"postV1Goals\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/goals\"\n },\n \"getV1GoalsEstimate\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/goals/estimate\"\n },\n \"getV1Streaks\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/streaks\"\n },\n \"getV1StreaksCurrentStreakDays\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/streaks/current-streak-days\"\n },\n \"getV1ActivityDays\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/activity-days\"\n },\n \"postV1ActivityDays\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/activity-days\"\n },\n \"getV1ActivityDaysEstimateReadingTime\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/activity-days/estimate-reading-time\"\n },\n \"getV1Notes\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes\"\n },\n \"postV1Notes\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/notes\"\n },\n \"getV1NotesByVerseByVerseKey\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes/by-verse/{verseKey}\"\n },\n \"getV1NotesByAttachedEntity\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes/by-attached-entity\"\n },\n \"getV1NotesCountWithinRange\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes/count-within-range\"\n },\n \"getV1NotesByRange\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes/by-range\"\n },\n \"getV1NotesByNoteId\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/notes/{noteId}\"\n },\n \"patchV1NotesByNoteId\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/notes/{noteId}\"\n },\n \"deleteV1NotesByNoteId\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/notes/{noteId}\"\n },\n \"postV1NotesByNoteIdPublish\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/notes/{noteId}/publish\"\n }\n },\n \"service\": \"auth\",\n \"version\": \"v1\"\n }\n },\n \"oauth2\": {\n \"v1\": {\n \"operations\": {\n \"oauth2TokenExchange\": {\n \"auth\": \"none\",\n \"method\": \"post\",\n \"path\": \"/oauth2/token\"\n },\n \"introspectOauth2Token\": {\n \"auth\": \"none\",\n \"method\": \"post\",\n \"path\": \"/oauth2/introspect\"\n },\n \"oAuth2Authorize\": {\n \"auth\": \"none\",\n \"method\": \"get\",\n \"path\": \"/oauth2/auth\"\n },\n \"getOidcUserInfo\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/userinfo\"\n },\n \"revokeOidcSession\": {\n \"auth\": \"none\",\n \"method\": \"get\",\n \"path\": \"/oauth2/sessions/logout\"\n }\n },\n \"service\": \"oauth2\",\n \"version\": \"v1\"\n }\n },\n \"quranReflect\": {\n \"v1\": {\n \"operations\": {\n \"usersControllerProfile\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/profile\"\n },\n \"usersControllerUpdateProfile\": {\n \"auth\": \"user\",\n \"method\": \"put\",\n \"path\": \"/v1/users/profile\"\n },\n \"usersControllerEditProfile\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/users/profile\"\n },\n \"usersControllerRooms\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/my-rooms\"\n },\n \"usersControllerSearch\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/search\"\n },\n \"usersControllerToggleFollow\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/users/{followeeId}/toggle-follow\"\n },\n \"usersControllerRemoveFollower\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/users/{followerId}/remove-follower\"\n },\n \"usersControllerGetUserProfile\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/{id}\"\n },\n \"usersControllerGetUserProfile2\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/{username}/profile\"\n },\n \"usersControllerGetUserFollowers\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/{id}/followers\"\n },\n \"usersControllerGetUserFollowing\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/users/{id}/following\"\n },\n \"roomsControllerAdminsAccess\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/admins-access\"\n },\n \"roomsControllerCreateNewGroup\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/groups\"\n },\n \"roomsControllerUpdateGroup\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/rooms/groups\"\n },\n \"roomsControllerCreateNewPage\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/pages\"\n },\n \"roomsControllerUpdatePage\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/rooms/pages\"\n },\n \"roomsControllerGetRoomMembers\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/{id}/members\"\n },\n \"roomsControllerInviteUserToRoom\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/{id}/invite\"\n },\n \"roomsControllerAcceptInvite\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/{id}/accept-invite\"\n },\n \"roomsControllerRejectInvite\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/{id}/reject-invite\"\n },\n \"roomsControllerRemoveMember\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/rooms/{id}/members/{userId}\"\n },\n \"roomsControllerGetRooms\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/joined-rooms\"\n },\n \"roomsControllerGetRooms2\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/managed-rooms\"\n },\n \"roomsControllerSearchRooms\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/search\"\n },\n \"roomsControllerGetRoomProfile\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/group/{url}\"\n },\n \"roomsControllerGetRoomProfile2\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/page/{subdomain}\"\n },\n \"roomsControllerAcceptByPrivateToken\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/group/{url}/accept/{token}\"\n },\n \"roomsControllerAcceptByPrivateToken2\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/page/{subdomain}/accept/{token}\"\n },\n \"roomsControllerGetRoomProfileById\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/{id}\"\n },\n \"roomsControllerGetRoomPosts\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/rooms/{id}/posts\"\n },\n \"roomsControllerJoinRoom\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/{groupId}/join\"\n },\n \"roomsControllerLeaveGroup\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/{groupId}/leave\"\n },\n \"roomsControllerFollowPage\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/{pageId}/follow\"\n },\n \"roomsControllerUnfollowPage\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/rooms/{pageId}/unfollow\"\n },\n \"roomsControllerUpdatePostPrivacy\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/rooms/{roomId}/posts/{postId}/privacy\"\n },\n \"postsControllerFeed\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/feed\"\n },\n \"postsControllerGetRelatedPosts\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/{postId}/related\"\n },\n \"postsControllerGetLoggedinUserPosts\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/my-posts\"\n },\n \"postsControllerGetLikedState\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/{id}/liked\"\n },\n \"postsControllerFindOne\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/{id}\"\n },\n \"postsControllerEdit\": {\n \"auth\": \"user\",\n \"method\": \"patch\",\n \"path\": \"/v1/posts/{id}\"\n },\n \"postsControllerDelete\": {\n \"auth\": \"user\",\n \"method\": \"delete\",\n \"path\": \"/v1/posts/{id}\"\n },\n \"postsControllerViewTracking\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/viewed/{id}\"\n },\n \"postsControllerCreate\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/posts\"\n },\n \"postsControllerReportAbuse\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/posts/{id}/report\"\n },\n \"postsControllerGetUserPost\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/user-posts/{id}\"\n },\n \"postsControllerToggleLike\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/posts/{id}/toggle-like\"\n },\n \"postsControllerToggleSave\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/posts/{id}/toggle-save\"\n },\n \"postsControllerGetComments\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/{id}/comments\"\n },\n \"postsControllerGetAllComment\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/{id}/all-comments\"\n },\n \"postsControllerExportMultiplePosts\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/posts/export/pdf\"\n },\n \"postsControllerGetMyPostsCountWithinRange\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/count-within-range\"\n },\n \"postsControllerGetMyPostsByVerse\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/posts/by-verse/{verseKey}\"\n },\n \"tagsControllerFind\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/tags\"\n },\n \"commentsControllerCreate\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/comments\"\n },\n \"commentsControllerDeleteComment\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/comments/{id}/delete\"\n },\n \"commentsControllerToggleLike\": {\n \"auth\": \"user\",\n \"method\": \"post\",\n \"path\": \"/v1/comments/{id}/toggle-like\"\n },\n \"commentsControllerGet\": {\n \"auth\": \"user\",\n \"method\": \"get\",\n \"path\": \"/v1/comments/{id}/replies\"\n }\n },\n \"service\": \"quranReflect\",\n \"version\": \"v1\"\n }\n }\n}\n","import type {\n CatalogOperationDefinition as BaseCatalogOperationDefinition,\n OperationDefinition as BaseOperationDefinition,\n ServiceOperationCatalog as BaseServiceOperationCatalog,\n HttpMethod,\n OperationAuthMode,\n} from \"./contracts\";\nimport publicOperationCatalogJson from \"./specs/public-operation-catalog.json\";\n\nexport type AuthService = \"auth\" | \"quranReflect\";\n\nexport type PublicApiService = AuthService | \"oauth2\";\n\nexport interface OperationDefinition\n extends Omit<BaseOperationDefinition, \"service\"> {\n service: PublicApiService;\n}\n\nexport interface CatalogOperationDefinition\n extends Omit<BaseCatalogOperationDefinition, \"service\"> {\n service?: PublicApiService;\n}\n\nexport interface ServiceOperationCatalog\n extends Omit<BaseServiceOperationCatalog, \"operations\" | \"service\"> {\n operations: Record<string, CatalogOperationDefinition>;\n service: PublicApiService;\n}\n\ninterface PublicOperationCatalog {\n auth: { v1: ServiceOperationCatalog };\n oauth2: { v1: ServiceOperationCatalog };\n quranReflect: { v1: ServiceOperationCatalog };\n}\n\nexport const publicOperationCatalog =\n publicOperationCatalogJson as PublicOperationCatalog;\n\nexport type { HttpMethod, OperationAuthMode };\n","import type { OperationRequest, TokenResponse, UserSession } from \"@/types\";\n\nexport const encodeBasicAuth = (username: string, password: string): string => {\n const raw = `${username}:${password}`;\n\n if (typeof Buffer !== \"undefined\") {\n return Buffer.from(raw).toString(\"base64\");\n }\n\n if (typeof globalThis.btoa === \"function\") {\n return globalThis.btoa(raw);\n }\n\n throw new Error(\"No base64 encoder available for HTTP basic auth.\");\n};\n\nexport const prepareBody = (\n request: OperationRequest,\n headers: Headers,\n): string | URLSearchParams | undefined => {\n if (request.body === undefined || request.body === null) {\n return undefined;\n }\n\n if (\n typeof request.body === \"string\" ||\n request.body instanceof URLSearchParams\n ) {\n if (request.contentType) {\n headers.set(\"Content-Type\", request.contentType);\n }\n\n return request.body;\n }\n\n headers.set(\"Content-Type\", request.contentType ?? \"application/json\");\n return JSON.stringify(request.body);\n};\n\nexport const toUserSession = (\n token: TokenResponse & {\n accessToken?: string;\n expiresIn?: number;\n idToken?: string;\n refreshToken?: string;\n tokenType?: string;\n },\n currentSession?: Partial<UserSession> | null,\n): UserSession => {\n const expiresIn = token.expiresIn ?? token.expires_in;\n const accessToken = token.accessToken ?? token.access_token;\n const idToken = token.idToken ?? token.id_token ?? currentSession?.idToken;\n const refreshToken =\n token.refreshToken ?? token.refresh_token ?? currentSession?.refreshToken;\n const tokenType =\n token.tokenType ?? token.token_type ?? currentSession?.tokenType;\n const scope = token.scope ?? currentSession?.scope;\n const expiresAt = expiresIn\n ? Date.now() + expiresIn * 1000\n : currentSession?.expiresAt;\n\n return {\n accessToken,\n expiresAt,\n idToken,\n refreshToken,\n scope,\n tokenType,\n };\n};\n","import type { ApiService } from \"@/types\";\n\nimport operationCatalogJson from \"./specs/operation-catalog.json\";\n\nexport type HttpMethod = \"get\" | \"post\" | \"put\" | \"patch\" | \"delete\";\nexport type OperationAuthMode = \"none\" | \"app\" | \"user\";\n\nexport interface OperationDefinition {\n auth: OperationAuthMode;\n method: HttpMethod;\n operationId?: string;\n operationName: string;\n path: string;\n serverUrl?: string;\n service: ApiService;\n tags: string[];\n version: string;\n}\n\nexport type CatalogOperationDefinition = Omit<\n OperationDefinition,\n \"operationName\" | \"service\" | \"tags\" | \"version\"\n> &\n Partial<\n Pick<OperationDefinition, \"operationName\" | \"service\" | \"tags\" | \"version\">\n >;\n\nexport interface ServiceOperationCatalog {\n operations: Record<string, CatalogOperationDefinition>;\n service: ApiService;\n version: string;\n}\n\ninterface OperationCatalog {\n auth: { v1: ServiceOperationCatalog };\n content: { v4: ServiceOperationCatalog };\n oauth2: { v1: ServiceOperationCatalog };\n quranReflect: { v1: ServiceOperationCatalog };\n search: { v1: ServiceOperationCatalog };\n}\n\nexport const operationCatalog = operationCatalogJson as OperationCatalog;\n\nexport const resolveCatalogOperation = (\n section: ServiceOperationCatalog,\n operationName: string,\n operation: CatalogOperationDefinition,\n): OperationDefinition => {\n return {\n ...operation,\n operationName: operation.operationName ?? operationName,\n service: operation.service ?? section.service,\n tags: operation.tags ?? [],\n version: operation.version ?? section.version,\n };\n};\n\nexport const getOperationByName = (\n service: ApiService,\n version: string,\n operationName: string,\n): OperationDefinition | undefined => {\n const serviceCatalog = operationCatalog[service] as\n | Record<string, ServiceOperationCatalog | undefined>\n | undefined;\n if (!serviceCatalog) {\n return undefined;\n }\n\n const versionCatalog = serviceCatalog[version];\n const operation = versionCatalog?.operations[operationName];\n if (!versionCatalog || !operation) {\n return undefined;\n }\n\n return resolveCatalogOperation(versionCatalog, operationName, operation);\n};\n","import type {\n HttpMethod,\n OperationDefinition,\n ServiceOperationCatalog,\n} from \"@/generated/contracts\";\nimport { resolveCatalogOperation } from \"@/generated/contracts\";\n\nexport const HTTP_METHOD_TO_MUTATION_NAME: Record<HttpMethod, string> = {\n delete: \"remove\",\n get: \"list\",\n patch: \"update\",\n post: \"create\",\n put: \"update\",\n};\n\nexport const toCamelCase = (value: string): string => {\n const parts = value\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .replace(/[^A-Za-z0-9]+/g, \" \")\n .trim()\n .split(/\\s+/)\n .filter(Boolean);\n\n if (parts.length === 0) {\n return \"misc\";\n }\n\n return parts\n .map((part, index) => {\n const lower = part.toLowerCase();\n if (index === 0) {\n return lower;\n }\n\n return lower.charAt(0).toUpperCase() + lower.slice(1);\n })\n .join(\"\");\n};\n\nexport const toPascalCase = (value: string): string => {\n const camel = toCamelCase(value);\n return camel.charAt(0).toUpperCase() + camel.slice(1);\n};\n\nexport const isPathParam = (segment: string): boolean =>\n segment.startsWith(\"{\") && segment.endsWith(\"}\");\n\nexport const getResourceSegments = (path: string): string[] => {\n const segments = path.split(\"/\").filter(Boolean);\n if (segments[0]?.match(/^v\\d+$/)) {\n return segments.slice(1);\n }\n\n return segments;\n};\n\nexport const pickGeneratedMethodName = (\n operation: OperationDefinition,\n): string => {\n const resourceSegments = getResourceSegments(operation.path);\n const lastSegment = resourceSegments.at(-1);\n const literalSegments = resourceSegments.filter(\n (segment) => !isPathParam(segment),\n );\n const lastLiteral = literalSegments.at(-1);\n const groupLiteral = literalSegments[0];\n\n if (resourceSegments.length === 1) {\n return HTTP_METHOD_TO_MUTATION_NAME[operation.method];\n }\n\n if (\n resourceSegments.length === 2 &&\n lastSegment &&\n isPathParam(lastSegment)\n ) {\n if (operation.method === \"get\") {\n return \"get\";\n }\n\n if (operation.method === \"delete\") {\n return \"remove\";\n }\n\n return \"update\";\n }\n\n if (lastSegment && !isPathParam(lastSegment) && lastLiteral) {\n if (lastLiteral === groupLiteral) {\n return `${HTTP_METHOD_TO_MUTATION_NAME[operation.method]}ById`;\n }\n\n return toCamelCase(lastLiteral);\n }\n\n return toCamelCase(operation.operationName);\n};\n\nexport type RawOperation = (request?: unknown) => Promise<unknown>;\nexport type GeneratedGroup = Record<string, RawOperation>;\nexport type GeneratedGroups = Record<string, GeneratedGroup>;\n\nexport interface FetcherLike {\n request<T = unknown>(\n service: string,\n path: string,\n query?: unknown,\n request?: unknown,\n ): Promise<T>;\n requestOperation<T = unknown>(\n operation: OperationDefinition,\n request?: unknown,\n ): Promise<T>;\n getUserSession(): Promise<unknown>;\n setUserSession(session: unknown): Promise<void>;\n buildServiceUrl(service: string, path: string, query?: unknown): string;\n}\n\nexport const createRawClient = (\n fetcher: FetcherLike,\n section: ServiceOperationCatalog,\n): Record<string, RawOperation> => {\n const rawOperations: Record<string, RawOperation> = {};\n\n for (const [operationName, operation] of Object.entries(section.operations)) {\n const resolvedOperation = resolveCatalogOperation(\n section,\n operationName,\n operation,\n );\n\n rawOperations[operationName] = (request?: unknown) =>\n fetcher.requestOperation(resolvedOperation, request);\n }\n\n return rawOperations;\n};\n\nexport const createGeneratedGroups = (\n section: ServiceOperationCatalog,\n rawOperations: Record<string, RawOperation>,\n): GeneratedGroups => {\n const groups: GeneratedGroups = {};\n\n for (const [operationName, operation] of Object.entries(section.operations)) {\n const resolvedOperation = resolveCatalogOperation(\n section,\n operationName,\n operation,\n );\n const literals = getResourceSegments(resolvedOperation.path).filter(\n (segment) => !isPathParam(segment),\n );\n const groupName = toCamelCase(literals[0] ?? \"misc\");\n const suggestedName = pickGeneratedMethodName(resolvedOperation);\n const currentGroup = groups[groupName] ?? {};\n let methodName = suggestedName;\n\n if (currentGroup[methodName]) {\n methodName = `${suggestedName}${toPascalCase(operationName)}`;\n }\n\n currentGroup[methodName] = rawOperations[operationName]!;\n groups[groupName] = currentGroup;\n }\n\n return groups;\n};\n","import type { ApiParams } from \"@/types\";\nimport humps from \"humps\";\n\nconst { decamelize } = humps;\n\nexport const ensureLeadingSlash = (value: string): string =>\n value.startsWith(\"/\") ? value : `/${value}`;\n\nexport const removeTrailingSlash = (value: string): string =>\n value.endsWith(\"/\") ? value.slice(0, -1) : value;\n\nexport const removeBeginningSlash = (url: string) => {\n return url.startsWith(\"/\") ? url.slice(1) : url;\n};\n\nexport const replacePathParams = (\n path: string,\n params?: Record<string, string | number>,\n): string => {\n return path.replace(/\\{([^}]+)\\}/g, (_match: string, rawKey: string) => {\n const value = params?.[rawKey];\n if (value === undefined) {\n throw new Error(`Missing path parameter: ${rawKey}`);\n }\n\n return encodeURIComponent(String(value));\n });\n};\n\nexport const normalizePathTemplate = (path: string): string =>\n path.replace(/(^|\\/):([A-Za-z0-9_]+)/g, \"$1{$2}\");\n\ninterface ParamsToStringOptions {\n preserveCase?: boolean;\n}\n\nconst fieldsKey = [\"wordFields\", \"translationFields\", \"fields\"] as const;\nconst fieldsKeySet = new Set<string>([\n ...fieldsKey,\n ...fieldsKey.map((key) => decamelize(key)),\n]);\nconst preservedKeys = new Set([\n \"navigationalResultsNumber\",\n \"pageSize\",\n \"versesResultsNumber\",\n]);\n\nexport const paramsToString = (\n params?: ApiParams,\n options: ParamsToStringOptions = {},\n): string => {\n if (!params) return \"\";\n\n const paramsString = new URLSearchParams();\n\n for (const [rawKey, rawValue] of Object.entries(params)) {\n if (rawValue === undefined) continue;\n\n const key =\n options.preserveCase || preservedKeys.has(rawKey)\n ? rawKey\n : decamelize(rawKey);\n\n // fields is a special case, it's an object with boolean values\n if (fieldsKeySet.has(rawKey) || fieldsKeySet.has(key)) {\n const fields = Object.entries(rawValue as Record<string, boolean>)\n .filter(([, value]) => value)\n .map(([fieldKey]) => decamelize(fieldKey));\n if (fields.length > 0) {\n paramsString.set(key, fields.join(\",\"));\n }\n continue;\n }\n\n if (typeof rawValue === \"string\") {\n paramsString.set(key, rawValue);\n } else if (typeof rawValue === \"number\") {\n paramsString.set(key, rawValue.toString());\n } else if (typeof rawValue === \"boolean\") {\n paramsString.set(key, rawValue.toString());\n } else if (Array.isArray(rawValue)) {\n paramsString.set(key, rawValue.join(\",\"));\n }\n }\n\n if (paramsString.size === 0) return \"\";\n return `?${paramsString.toString()}`;\n};\n","export const API_BASE_URL = \"https://apis.quran.foundation\";\n\nexport const DEFAULT_BASE_URLS = {\n auth: \"https://apis.quran.foundation/auth\",\n content: \"https://apis.quran.foundation/content\",\n oauth2: \"https://oauth2.quran.foundation\",\n quranReflect: \"https://apis.quran.foundation/quran-reflect\",\n search: \"https://apis.quran.foundation/search\",\n} as const;\n\nexport const DIRECT_PATH_PREFIX = {\n auth: \"/v1\",\n content: \"/api/v4\",\n oauth2: \"\",\n quranReflect: \"/v1\",\n search: \"/v1\",\n} as const;\n\nexport const GATEWAY_PATH_PREFIX = {\n auth: \"/auth/v1\",\n content: \"/content/api/v4\",\n oauth2: \"\",\n quranReflect: \"/quran-reflect/v1\",\n search: \"/search/v1\",\n} as const;\n\nexport const LEGACY_PREFIXES = {\n auth: [\"/auth/v1\", \"/v1\"] as const,\n content: [\"/content/api/v4\", \"/api/v4\"] as const,\n oauth2: [] as const,\n quranReflect: [\"/quran-reflect/v1\", \"/v1\"] as const,\n search: [\"/search/v1\", \"/v1\"] as const,\n} as const;\n","import type {\n OperationDefinition,\n PublicApiService,\n} from \"@/generated/public-contracts\";\nimport type {\n ApiParams,\n CustomFetcher,\n OperationRequest,\n PublicClientConfig,\n UserSession,\n} from \"@/types\";\nimport { prepareBody } from \"@/lib/http-utils\";\nimport {\n DEFAULT_BASE_URLS,\n DIRECT_PATH_PREFIX,\n GATEWAY_PATH_PREFIX,\n LEGACY_PREFIXES,\n} from \"@/lib/service-config\";\nimport {\n ensureLeadingSlash,\n normalizePathTemplate,\n paramsToString,\n removeTrailingSlash,\n replacePathParams,\n} from \"@/lib/url\";\nimport humps from \"humps\";\n\nconst { camelizeKeys } = humps;\n\nexport class PublicQuranFetcher {\n private userSession: UserSession | null | undefined;\n\n constructor(private readonly config: PublicClientConfig) {\n this.userSession = config.userSession;\n }\n\n public clearCachedTokens(): void {\n return;\n }\n\n public getFetch(): CustomFetcher {\n const doFetch = this.config.fetch ?? globalThis.fetch;\n\n if (typeof doFetch !== \"function\") {\n throw new Error(\n \"No fetch function available. Please provide a fetch implementation or ensure global fetch is available.\",\n );\n }\n\n return doFetch;\n }\n\n public async getUserSession(): Promise<UserSession | null> {\n const storedSession = await this.config.storage?.getSession?.();\n if (storedSession !== undefined) {\n return storedSession;\n }\n\n return this.userSession ?? null;\n }\n\n public async setUserSession(session: UserSession | null): Promise<void> {\n if (!this.config.storage) {\n this.userSession = session;\n return;\n }\n\n if (!session) {\n if (this.config.storage.clearSession) {\n await this.config.storage.clearSession();\n this.userSession = null;\n return;\n }\n\n await this.config.storage.setSession?.(null);\n this.userSession = null;\n return;\n }\n\n await this.config.storage.setSession?.(session);\n this.userSession = session;\n }\n\n public buildServiceUrl(\n service: PublicApiService,\n path: string,\n query?: ApiParams,\n ): string {\n const { baseUrl, usesGateway } = this.resolveServiceBaseUrl(service);\n const servicePath = this.normalizeServicePath(service, path, usesGateway);\n const preserveQueryParamCase =\n service === \"auth\" || service === \"quranReflect\";\n\n return `${baseUrl}${servicePath}${paramsToString(query, {\n preserveCase: preserveQueryParamCase,\n })}`;\n }\n\n public async requestOperation<T = unknown>(\n operation: OperationDefinition,\n request?: OperationRequest,\n ): Promise<T> {\n return this.request<T>(\n operation.service,\n replacePathParams(operation.path, request?.path),\n request?.query,\n {\n ...request,\n auth:\n request?.auth === \"auto\" || !request?.auth\n ? operation.auth\n : request.auth,\n method:\n request?.method ??\n (operation.method.toUpperCase() as OperationRequest[\"method\"]),\n path: undefined,\n },\n );\n }\n\n public async request<T = unknown>(\n service: PublicApiService,\n path: string,\n query?: ApiParams,\n request: OperationRequest = {},\n ): Promise<T> {\n if (request.basicAuth) {\n throw new Error(\"client_secret is server-only. Use @quranjs/api/server.\");\n }\n\n const effectiveAuth = this.resolveAuthMode(service, request.auth);\n const url = this.buildServiceUrl(service, path, query);\n const headers = new Headers(request.headers);\n const body = prepareBody(request, headers);\n\n if (service !== \"oauth2\") {\n headers.set(\"x-client-id\", this.config.clientId);\n }\n\n await this.applyAuthenticationHeaders(\n service,\n effectiveAuth,\n headers,\n request,\n );\n\n const response = await this.getFetch()(url, {\n body,\n headers,\n method: request.method ?? \"GET\",\n });\n\n if (!response.ok) {\n throw new Error(`${response.status} ${response.statusText}`);\n }\n\n if (response.status === 204) {\n return undefined as T;\n }\n\n const contentType = response.headers.get(\"content-type\") ?? \"\";\n if (!contentType.includes(\"application/json\")) {\n return (await response.text()) as T;\n }\n\n const json = await response.json();\n return camelizeKeys(json as object) as T;\n }\n\n private resolveAuthMode(\n service: PublicApiService,\n auth: OperationRequest[\"auth\"] = \"auto\",\n ): \"none\" | \"user\" {\n if (auth !== \"auto\") {\n if (auth === \"app\") {\n throw new Error(\n \"This API requires @quranjs/api/server or a backend. Content and search are server-side for confidential clients.\",\n );\n }\n\n return auth;\n }\n\n if (service === \"auth\" || service === \"quranReflect\") {\n return \"user\";\n }\n\n return \"none\";\n }\n\n private async applyAuthenticationHeaders(\n service: PublicApiService,\n auth: \"none\" | \"user\",\n headers: Headers,\n request: OperationRequest,\n ): Promise<void> {\n if (request.accessToken) {\n this.setTokenHeaders(service, headers, request.accessToken);\n return;\n }\n\n if (auth === \"none\") {\n return;\n }\n\n const session = await this.getUserSession();\n if (!session?.accessToken) {\n throw new Error(\n \"This operation requires a user session. Sign in first or use @quranjs/api/server.\",\n );\n }\n\n this.setTokenHeaders(service, headers, session.accessToken);\n }\n\n private setTokenHeaders(\n service: PublicApiService,\n headers: Headers,\n accessToken: string,\n ): void {\n if (service === \"oauth2\") {\n headers.set(\"Authorization\", `Bearer ${accessToken}`);\n return;\n }\n\n headers.set(\"x-auth-token\", accessToken);\n }\n\n private resolveServiceBaseUrl(service: PublicApiService): {\n baseUrl: string;\n usesGateway: boolean;\n } {\n const { services } = this.config;\n const directBaseUrl =\n service === \"auth\"\n ? services?.authBaseUrl\n : service === \"quranReflect\"\n ? services?.quranReflectBaseUrl\n : (services?.oauth2BaseUrl ?? services?.tokenHost);\n\n if (directBaseUrl) {\n return {\n baseUrl: removeTrailingSlash(directBaseUrl),\n usesGateway: false,\n };\n }\n\n if (services?.gatewayUrl && service !== \"oauth2\") {\n return {\n baseUrl: removeTrailingSlash(services.gatewayUrl),\n usesGateway: true,\n };\n }\n\n return {\n baseUrl: DEFAULT_BASE_URLS[service],\n usesGateway: false,\n };\n }\n\n private normalizeServicePath(\n service: PublicApiService,\n path: string,\n usesGateway: boolean,\n ): string {\n let normalizedPath = ensureLeadingSlash(normalizePathTemplate(path));\n for (const legacyPrefix of LEGACY_PREFIXES[service]) {\n if (normalizedPath.startsWith(legacyPrefix)) {\n normalizedPath = ensureLeadingSlash(\n normalizedPath.slice(legacyPrefix.length),\n );\n break;\n }\n }\n\n const prefix = usesGateway\n ? GATEWAY_PATH_PREFIX[service]\n : DIRECT_PATH_PREFIX[service];\n\n if (normalizedPath.startsWith(prefix) || prefix.length === 0) {\n return normalizedPath;\n }\n\n return `${prefix}${normalizedPath}`;\n }\n}\n","import type { AuthService } from \"@/generated/public-contracts\";\nimport type {\n ApiParams,\n HTTPMethod,\n OperationRequest,\n PublicClientConfig,\n TokenResponse,\n} from \"@/types\";\nimport { publicOperationCatalog } from \"@/generated/public-contracts\";\nimport { toUserSession } from \"@/lib/http-utils\";\nimport { createGeneratedGroups, createRawClient } from \"@/lib/runtime-utils\";\nimport { replacePathParams } from \"@/lib/url\";\nimport { PublicQuranFetcher } from \"@/sdk/public-fetcher\";\n\ntype RawOperation = (request?: OperationRequest) => Promise<unknown>;\ntype GeneratedGroup = Record<string, RawOperation>;\ntype QuranReflectFacade = {\n comments: GeneratedGroup;\n posts: GeneratedGroup;\n raw: Record<string, RawOperation>;\n rooms: GeneratedGroup;\n tags: GeneratedGroup;\n users: GeneratedGroup;\n};\n\nconst SERVER_ONLY_MESSAGE =\n \"This API requires @quranjs/api/server or a backend. Content and search are server-side for confidential clients.\";\nconst LEGACY_BOOKMARK_GET_MESSAGE =\n \"auth.bookmarks.get(bookmarkId) is not supported because /v1/bookmarks/bookmark expects bookmark detail query parameters. Pass a query object such as { mushafId, key, type, verseNumber } or { mushafId, isReading: true }.\";\n\nconst createUserServiceRequest =\n (fetcher: PublicQuranFetcher, service: AuthService) =>\n (method: HTTPMethod, path: string, request?: OperationRequest) => {\n return fetcher.request<unknown>(\n service,\n replacePathParams(path, request?.path),\n request?.query,\n {\n ...request,\n auth: \"user\",\n method,\n path: undefined,\n query: undefined,\n },\n );\n };\n\nconst createAuthFacade = (fetcher: PublicQuranFetcher) => {\n const raw = createRawClient(fetcher, publicOperationCatalog.auth.v1);\n const generatedGroups = createGeneratedGroups(\n publicOperationCatalog.auth.v1,\n raw,\n );\n const request = createUserServiceRequest(fetcher, \"auth\");\n\n return {\n ...generatedGroups,\n collections: {\n ...generatedGroups.collections,\n addBookmark: (collectionId: string, body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/collections/{collectionId}/bookmarks\", {\n body,\n path: { collectionId },\n }),\n create: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/collections\", { body }),\n get: (collectionId: string, query?: ApiParams) =>\n request(\"GET\", \"/v1/collections/{collectionId}\", {\n path: { collectionId },\n query,\n }),\n list: (query?: ApiParams) => request(\"GET\", \"/v1/collections\", { query }),\n listAll: (query?: ApiParams) =>\n request(\"GET\", \"/v1/collections/all\", { query }),\n remove: (collectionId: string) =>\n request(\"DELETE\", \"/v1/collections/{collectionId}\", {\n path: { collectionId },\n }),\n removeBookmark: (collectionId: string, bookmarkId: string) =>\n request(\n \"DELETE\",\n \"/v1/collections/{collectionId}/bookmarks/{bookmarkId}\",\n {\n path: { bookmarkId, collectionId },\n },\n ),\n update: (collectionId: string, body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/collections/{collectionId}\", {\n body,\n path: { collectionId },\n }),\n },\n bookmarks: {\n ...generatedGroups.bookmarks,\n create: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/bookmarks\", { body }),\n get: async (query?: ApiParams | string) => {\n if (typeof query === \"string\") {\n throw new Error(LEGACY_BOOKMARK_GET_MESSAGE);\n }\n\n return request(\"GET\", \"/v1/bookmarks/bookmark\", {\n query,\n });\n },\n list: (query?: ApiParams) => request(\"GET\", \"/v1/bookmarks\", { query }),\n listCollections: (query?: ApiParams) =>\n request(\"GET\", \"/v1/bookmarks/collections\", { query }),\n listRange: (query?: ApiParams) =>\n request(\"GET\", \"/v1/bookmarks/ayahs-range\", { query }),\n remove: (bookmarkId: string) =>\n request(\"DELETE\", \"/v1/bookmarks/{bookmarkId}\", {\n path: { bookmarkId },\n }),\n },\n goals: {\n ...generatedGroups.goals,\n create: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/goals\", { body }),\n estimate: (query?: ApiParams) =>\n request(\"GET\", \"/v1/goals/estimate\", { query }),\n getTodaysPlan: (query?: ApiParams) =>\n request(\"GET\", \"/v1/goals/get-todays-plan\", { query }),\n remove: (id: string) =>\n request(\"DELETE\", \"/v1/goals/{id}\", { path: { id } }),\n update: (id: string, body: Record<string, unknown>) =>\n request(\"PUT\", \"/v1/goals/{id}\", {\n body,\n path: { id },\n }),\n },\n notes: {\n ...generatedGroups.notes,\n create: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/notes\", { body }),\n get: (noteId: string) =>\n request(\"GET\", \"/v1/notes/{noteId}\", { path: { noteId } }),\n list: (query?: ApiParams) => request(\"GET\", \"/v1/notes\", { query }),\n listByAttachedEntity: (query?: ApiParams) =>\n request(\"GET\", \"/v1/notes/by-attached-entity\", { query }),\n listByRange: (query?: ApiParams) =>\n request(\"GET\", \"/v1/notes/by-range\", { query }),\n listByVerseKey: (verseKey: string, query?: ApiParams) =>\n request(\"GET\", \"/v1/notes/by-verse/{verseKey}\", {\n path: { verseKey },\n query,\n }),\n publish: (noteId: string, body?: Record<string, unknown>) =>\n request(\"POST\", \"/v1/notes/{noteId}/publish\", {\n body,\n path: { noteId },\n }),\n remove: (noteId: string) =>\n request(\"DELETE\", \"/v1/notes/{noteId}\", { path: { noteId } }),\n update: (noteId: string, body: Record<string, unknown>) =>\n request(\"PATCH\", \"/v1/notes/{noteId}\", {\n body,\n path: { noteId },\n }),\n },\n preferences: {\n ...generatedGroups.preferences,\n bulkUpdate: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/preferences/bulk\", { body }),\n get: (query?: ApiParams) => request(\"GET\", \"/v1/preferences\", { query }),\n update: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/preferences\", { body }),\n },\n raw,\n readingSessions: {\n ...generatedGroups.readingSessions,\n create: (body: Record<string, unknown>) =>\n request(\"POST\", \"/v1/reading-sessions\", { body }),\n list: (query?: ApiParams) =>\n request(\"GET\", \"/v1/reading-sessions\", { query }),\n },\n };\n};\n\nconst createQuranReflectFacade = (\n fetcher: PublicQuranFetcher,\n): QuranReflectFacade => {\n const raw = createRawClient(fetcher, publicOperationCatalog.quranReflect.v1);\n const generatedGroups = createGeneratedGroups(\n publicOperationCatalog.quranReflect.v1,\n raw,\n );\n\n return {\n comments: generatedGroups.comments ?? {},\n posts: generatedGroups.posts ?? {},\n raw,\n rooms: generatedGroups.rooms ?? {},\n tags: generatedGroups.tags ?? {},\n users: generatedGroups.users ?? {},\n };\n};\n\nconst createOAuth2Facade = (\n fetcher: PublicQuranFetcher,\n config: PublicClientConfig,\n) => {\n const raw = createRawClient(fetcher, publicOperationCatalog.oauth2.v1);\n\n const exchangeToken = async (\n body: URLSearchParams,\n options: { requiresRefreshToken?: boolean } = {},\n ) => {\n if (config.clientType !== \"public\") {\n throw new Error(\n \"This OAuth2 exchange requires a backend because your client is confidential.\",\n );\n }\n\n if (options.requiresRefreshToken && !body.get(\"refresh_token\")) {\n throw new Error(\"Missing refresh token.\");\n }\n\n body.set(\"client_id\", config.clientId);\n\n const requestRefreshToken = body.get(\"refresh_token\") ?? undefined;\n const storedSession = options.requiresRefreshToken\n ? await fetcher.getUserSession()\n : null;\n const currentSession =\n options.requiresRefreshToken && requestRefreshToken\n ? { ...(storedSession ?? {}), refreshToken: requestRefreshToken }\n : storedSession;\n\n const token = await fetcher.request<TokenResponse>(\n \"oauth2\",\n \"/oauth2/token\",\n undefined,\n {\n auth: \"none\",\n body,\n contentType: \"application/x-www-form-urlencoded\",\n method: \"POST\",\n },\n );\n\n await fetcher.setUserSession(toUserSession(token, currentSession));\n return token;\n };\n\n return {\n authorizeUrl: (query: Record<string, string | number | undefined>) =>\n fetcher.buildServiceUrl(\"oauth2\", \"/oauth2/auth\", query as ApiParams),\n exchangeCode: (params: {\n code: string;\n codeVerifier?: string;\n redirectUri: string;\n scope?: string;\n }) => {\n const body = new URLSearchParams({\n code: params.code,\n grant_type: \"authorization_code\",\n redirect_uri: params.redirectUri,\n });\n\n if (params.codeVerifier) {\n body.set(\"code_verifier\", params.codeVerifier);\n }\n\n if (params.scope) {\n body.set(\"scope\", params.scope);\n }\n\n return exchangeToken(body);\n },\n getUserInfo: (accessToken?: string) =>\n fetcher.request(\"oauth2\", \"/userinfo\", undefined, {\n accessToken,\n auth: \"user\",\n method: \"GET\",\n }),\n introspect: () => {\n throw new Error(\n \"Token introspection requires @quranjs/api/server or a backend.\",\n );\n },\n logout: (query?: ApiParams) =>\n fetcher.request(\"oauth2\", \"/oauth2/sessions/logout\", query, {\n auth: \"none\",\n method: \"GET\",\n }),\n raw,\n refresh: async (refreshToken?: string) => {\n const currentSession = await fetcher.getUserSession();\n const body = new URLSearchParams({\n grant_type: \"refresh_token\",\n refresh_token: refreshToken ?? currentSession?.refreshToken ?? \"\",\n });\n\n return exchangeToken(body, { requiresRefreshToken: true });\n },\n };\n};\n\ntype ServerOnlyGuard = ((...args: unknown[]) => Promise<never>) & {\n [key: string]: ServerOnlyGuard | undefined;\n};\n\nconst createServerOnlyGuard = (): ServerOnlyGuard => {\n const fail = (() =>\n Promise.reject(new Error(SERVER_ONLY_MESSAGE))) as ServerOnlyGuard;\n const proxy = new Proxy(fail, {\n apply() {\n return Promise.reject(new Error(SERVER_ONLY_MESSAGE));\n },\n get(_target, property) {\n if (property === \"then\") {\n return undefined;\n }\n\n return proxy;\n },\n });\n\n return proxy;\n};\n\nexport const createPublicRuntimeClient = (config: PublicClientConfig) => {\n const fetcher = new PublicQuranFetcher(config);\n fetcher.getFetch();\n\n const authV1 = createAuthFacade(fetcher);\n const quranReflectV1 = createQuranReflectFacade(fetcher);\n const oauth2V1 = createOAuth2Facade(fetcher, config);\n const serverOnlyGuard = createServerOnlyGuard();\n\n const raw = {\n auth: {\n v1: authV1.raw,\n },\n content: {\n v4: serverOnlyGuard,\n },\n oauth2: {\n v1: oauth2V1.raw,\n },\n quranReflect: {\n v1: quranReflectV1.raw,\n },\n search: {\n v1: serverOnlyGuard,\n },\n };\n\n return {\n answers: serverOnlyGuard,\n audio: serverOnlyGuard,\n auth: {\n ...authV1,\n v1: authV1,\n },\n chapters: serverOnlyGuard,\n clearCachedTokens: () => fetcher.clearCachedTokens(),\n content: serverOnlyGuard,\n getUserSession: () => fetcher.getUserSession(),\n hadithReferences: serverOnlyGuard,\n juzs: serverOnlyGuard,\n oauth2: {\n ...oauth2V1,\n v1: oauth2V1,\n },\n quranReflect: {\n ...quranReflectV1,\n v1: quranReflectV1,\n },\n raw,\n resources: serverOnlyGuard,\n search: serverOnlyGuard,\n verses: serverOnlyGuard,\n };\n};\n","import type { PublicClientConfig } from \"@/types\";\n\nimport { createPublicRuntimeClient } from \"./runtime/create-public-client\";\n\nexport type { TokenStorage, UserSession } from \"@/types\";\n\nexport const createPublicClient = (config: PublicClientConfig) => {\n if ((config as PublicClientConfig & { clientSecret?: string }).clientSecret) {\n throw new Error(\"client_secret is server-only. Use @quranjs/api/server.\");\n }\n\n return createPublicRuntimeClient(config);\n};\n\nexport type PublicClient = ReturnType<typeof createPublicClient>;\n"]}
@@ -1,3 +1,3 @@
1
- import L from'humps';var b={auth:{v1:{operations:{getV1Collections:{auth:"user",method:"get",path:"/v1/collections"},postV1Collections:{auth:"user",method:"post",path:"/v1/collections"},postV1CollectionsByCollectionIdBookmarks:{auth:"user",method:"post",path:"/v1/collections/{collectionId}/bookmarks"},deleteV1CollectionsByCollectionIdBookmarks:{auth:"user",method:"delete",path:"/v1/collections/{collectionId}/bookmarks"},getV1CollectionsByCollectionId:{auth:"user",method:"get",path:"/v1/collections/{collectionId}"},postV1CollectionsByCollectionId:{auth:"user",method:"post",path:"/v1/collections/{collectionId}"},deleteV1CollectionsByCollectionId:{auth:"user",method:"delete",path:"/v1/collections/{collectionId}"},deleteV1CollectionsByCollectionIdBookmarksByBookmarkId:{auth:"user",method:"delete",path:"/v1/collections/{collectionId}/bookmarks/{bookmarkId}"},getV1CollectionsAll:{auth:"user",method:"get",path:"/v1/collections/all"},getV1Bookmarks:{auth:"user",method:"get",path:"/v1/bookmarks"},postV1Bookmarks:{auth:"user",method:"post",path:"/v1/bookmarks"},deleteV1BookmarksByBookmarkId:{auth:"user",method:"delete",path:"/v1/bookmarks/{bookmarkId}"},getV1BookmarksAyahsRange:{auth:"user",method:"get",path:"/v1/bookmarks/ayahs-range"},getV1BookmarksBookmark:{auth:"user",method:"get",path:"/v1/bookmarks/bookmark"},getV1BookmarksCollections:{auth:"user",method:"get",path:"/v1/bookmarks/collections"},getV1Preferences:{auth:"user",method:"get",path:"/v1/preferences"},postV1Preferences:{auth:"user",method:"post",path:"/v1/preferences"},postV1PreferencesBulk:{auth:"user",method:"post",path:"/v1/preferences/bulk"},getV1ReadingSessions:{auth:"user",method:"get",path:"/v1/reading-sessions"},postV1ReadingSessions:{auth:"user",method:"post",path:"/v1/reading-sessions"},getV1GoalsGetTodaysPlan:{auth:"user",method:"get",path:"/v1/goals/get-todays-plan"},putV1GoalsById:{auth:"user",method:"put",path:"/v1/goals/{id}"},deleteV1GoalsById:{auth:"user",method:"delete",path:"/v1/goals/{id}"},postV1Goals:{auth:"user",method:"post",path:"/v1/goals"},getV1GoalsEstimate:{auth:"user",method:"get",path:"/v1/goals/estimate"},getV1Streaks:{auth:"user",method:"get",path:"/v1/streaks"},getV1StreaksCurrentStreakDays:{auth:"user",method:"get",path:"/v1/streaks/current-streak-days"},getV1ActivityDays:{auth:"user",method:"get",path:"/v1/activity-days"},postV1ActivityDays:{auth:"user",method:"post",path:"/v1/activity-days"},getV1ActivityDaysEstimateReadingTime:{auth:"user",method:"get",path:"/v1/activity-days/estimate-reading-time"},getV1Notes:{auth:"user",method:"get",path:"/v1/notes"},postV1Notes:{auth:"user",method:"post",path:"/v1/notes"},getV1NotesByVerseByVerseKey:{auth:"user",method:"get",path:"/v1/notes/by-verse/{verseKey}"},getV1NotesByAttachedEntity:{auth:"user",method:"get",path:"/v1/notes/by-attached-entity"},getV1NotesCountWithinRange:{auth:"user",method:"get",path:"/v1/notes/count-within-range"},getV1NotesByRange:{auth:"user",method:"get",path:"/v1/notes/by-range"},getV1NotesByNoteId:{auth:"user",method:"get",path:"/v1/notes/{noteId}"},patchV1NotesByNoteId:{auth:"user",method:"patch",path:"/v1/notes/{noteId}"},deleteV1NotesByNoteId:{auth:"user",method:"delete",path:"/v1/notes/{noteId}"},postV1NotesByNoteIdPublish:{auth:"user",method:"post",path:"/v1/notes/{noteId}/publish"}},service:"auth",version:"v1"}},oauth2:{v1:{operations:{oauth2TokenExchange:{auth:"none",method:"post",path:"/oauth2/token"},introspectOauth2Token:{auth:"none",method:"post",path:"/oauth2/introspect"},oAuth2Authorize:{auth:"none",method:"get",path:"/oauth2/auth"},getOidcUserInfo:{auth:"user",method:"get",path:"/userinfo"},revokeOidcSession:{auth:"none",method:"get",path:"/oauth2/sessions/logout"}},service:"oauth2",version:"v1"}},quranReflect:{v1:{operations:{usersControllerProfile:{auth:"user",method:"get",path:"/v1/users/profile"},usersControllerUpdateProfile:{auth:"user",method:"put",path:"/v1/users/profile"},usersControllerEditProfile:{auth:"user",method:"patch",path:"/v1/users/profile"},usersControllerRooms:{auth:"user",method:"get",path:"/v1/users/my-rooms"},usersControllerSearch:{auth:"user",method:"get",path:"/v1/users/search"},usersControllerToggleFollow:{auth:"user",method:"post",path:"/v1/users/{followeeId}/toggle-follow"},usersControllerRemoveFollower:{auth:"user",method:"post",path:"/v1/users/{followerId}/remove-follower"},usersControllerGetUserProfile:{auth:"user",method:"get",path:"/v1/users/{id}"},usersControllerGetUserProfile2:{auth:"user",method:"get",path:"/v1/users/{username}/profile"},usersControllerGetUserFollowers:{auth:"user",method:"get",path:"/v1/users/{id}/followers"},usersControllerGetUserFollowing:{auth:"user",method:"get",path:"/v1/users/{id}/following"},roomsControllerAdminsAccess:{auth:"user",method:"post",path:"/v1/rooms/admins-access"},roomsControllerCreateNewGroup:{auth:"user",method:"post",path:"/v1/rooms/groups"},roomsControllerUpdateGroup:{auth:"user",method:"patch",path:"/v1/rooms/groups"},roomsControllerCreateNewPage:{auth:"user",method:"post",path:"/v1/rooms/pages"},roomsControllerUpdatePage:{auth:"user",method:"patch",path:"/v1/rooms/pages"},roomsControllerGetRoomMembers:{auth:"user",method:"get",path:"/v1/rooms/{id}/members"},roomsControllerInviteUserToRoom:{auth:"user",method:"post",path:"/v1/rooms/{id}/invite"},roomsControllerAcceptInvite:{auth:"user",method:"get",path:"/v1/rooms/{id}/accept-invite"},roomsControllerRejectInvite:{auth:"user",method:"get",path:"/v1/rooms/{id}/reject-invite"},roomsControllerRemoveMember:{auth:"user",method:"delete",path:"/v1/rooms/{id}/members/{userId}"},roomsControllerGetRooms:{auth:"user",method:"get",path:"/v1/rooms/joined-rooms"},roomsControllerGetRooms2:{auth:"user",method:"get",path:"/v1/rooms/managed-rooms"},roomsControllerSearchRooms:{auth:"user",method:"get",path:"/v1/rooms/search"},roomsControllerGetRoomProfile:{auth:"user",method:"get",path:"/v1/rooms/group/{url}"},roomsControllerGetRoomProfile2:{auth:"user",method:"get",path:"/v1/rooms/page/{subdomain}"},roomsControllerAcceptByPrivateToken:{auth:"user",method:"get",path:"/v1/rooms/group/{url}/accept/{token}"},roomsControllerAcceptByPrivateToken2:{auth:"user",method:"get",path:"/v1/rooms/page/{subdomain}/accept/{token}"},roomsControllerGetRoomProfileById:{auth:"user",method:"get",path:"/v1/rooms/{id}"},roomsControllerGetRoomPosts:{auth:"user",method:"get",path:"/v1/rooms/{id}/posts"},roomsControllerJoinRoom:{auth:"user",method:"post",path:"/v1/rooms/{groupId}/join"},roomsControllerLeaveGroup:{auth:"user",method:"post",path:"/v1/rooms/{groupId}/leave"},roomsControllerFollowPage:{auth:"user",method:"post",path:"/v1/rooms/{pageId}/follow"},roomsControllerUnfollowPage:{auth:"user",method:"post",path:"/v1/rooms/{pageId}/unfollow"},roomsControllerUpdatePostPrivacy:{auth:"user",method:"patch",path:"/v1/rooms/{roomId}/posts/{postId}/privacy"},postsControllerFeed:{auth:"user",method:"get",path:"/v1/posts/feed"},postsControllerGetRelatedPosts:{auth:"user",method:"get",path:"/v1/posts/{postId}/related"},postsControllerGetLoggedinUserPosts:{auth:"user",method:"get",path:"/v1/posts/my-posts"},postsControllerGetLikedState:{auth:"user",method:"get",path:"/v1/posts/{id}/liked"},postsControllerFindOne:{auth:"user",method:"get",path:"/v1/posts/{id}"},postsControllerEdit:{auth:"user",method:"patch",path:"/v1/posts/{id}"},postsControllerDelete:{auth:"user",method:"delete",path:"/v1/posts/{id}"},postsControllerViewTracking:{auth:"user",method:"get",path:"/v1/posts/viewed/{id}"},postsControllerCreate:{auth:"user",method:"post",path:"/v1/posts"},postsControllerReportAbuse:{auth:"user",method:"post",path:"/v1/posts/{id}/report"},postsControllerGetUserPost:{auth:"user",method:"get",path:"/v1/posts/user-posts/{id}"},postsControllerToggleLike:{auth:"user",method:"post",path:"/v1/posts/{id}/toggle-like"},postsControllerToggleSave:{auth:"user",method:"post",path:"/v1/posts/{id}/toggle-save"},postsControllerGetComments:{auth:"user",method:"get",path:"/v1/posts/{id}/comments"},postsControllerGetAllComment:{auth:"user",method:"get",path:"/v1/posts/{id}/all-comments"},postsControllerExportMultiplePosts:{auth:"user",method:"post",path:"/v1/posts/export/pdf"},postsControllerGetMyPostsCountWithinRange:{auth:"user",method:"get",path:"/v1/posts/count-within-range"},postsControllerGetMyPostsByVerse:{auth:"user",method:"get",path:"/v1/posts/by-verse/{verseKey}"},tagsControllerFind:{auth:"user",method:"get",path:"/v1/tags"},commentsControllerCreate:{auth:"user",method:"post",path:"/v1/comments"},commentsControllerDeleteComment:{auth:"user",method:"get",path:"/v1/comments/{id}/delete"},commentsControllerToggleLike:{auth:"user",method:"post",path:"/v1/comments/{id}/toggle-like"},commentsControllerGet:{auth:"user",method:"get",path:"/v1/comments/{id}/replies"}},service:"quranReflect",version:"v1"}}};var c=b;var T=(o,t)=>{if(!(o.body===void 0||o.body===null))return typeof o.body=="string"||o.body instanceof URLSearchParams?(o.contentType&&t.set("Content-Type",o.contentType),o.body):(t.set("Content-Type",o.contentType??"application/json"),JSON.stringify(o.body))},R=(o,t)=>{let r=o.expiresIn??o.expires_in,s=o.accessToken??o.access_token,e=o.idToken??o.id_token??t?.idToken,n=o.refreshToken??o.refresh_token??t?.refreshToken,a=o.tokenType??o.token_type??t?.tokenType,i=o.scope??t?.scope,p=r?Date.now()+r*1e3:t?.expiresAt;return {accessToken:s,expiresAt:p,idToken:e,refreshToken:n,scope:i,tokenType:a}};var k=(o,t,r)=>({...r,operationName:r.operationName??t,service:r.service??o.service,tags:r.tags??[],version:r.version??o.version});var w={delete:"remove",get:"list",patch:"update",post:"create",put:"update"},d=o=>{let t=o.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9]+/g," ").trim().split(/\s+/).filter(Boolean);return t.length===0?"misc":t.map((r,s)=>{let e=r.toLowerCase();return s===0?e:e.charAt(0).toUpperCase()+e.slice(1)}).join("")},N=o=>{let t=d(o);return t.charAt(0).toUpperCase()+t.slice(1)},h=o=>o.startsWith("{")&&o.endsWith("}"),O=o=>{let t=o.split("/").filter(Boolean);return t[0]?.match(/^v\d+$/)?t.slice(1):t},F=o=>{let t=O(o.path),r=t.at(-1),s=t.filter(a=>!h(a)),e=s.at(-1),n=s[0];return t.length===1?w[o.method]:t.length===2&&r&&h(r)?o.method==="get"?"get":o.method==="delete"?"remove":"update":r&&!h(r)&&e?e===n?`${w[o.method]}ById`:d(e):d(o.operationName)},m=(o,t)=>{let r={};for(let[s,e]of Object.entries(t.operations)){let n=k(t,s,e);r[s]=a=>o.requestOperation(n,a);}return r},y=(o,t)=>{let r={};for(let[s,e]of Object.entries(o.operations)){let n=k(o,s,e),a=O(n.path).filter(f=>!h(f)),i=d(a[0]??"misc"),p=F(n),u=r[i]??{},l=p;u[l]&&(l=`${p}${N(s)}`),u[l]=t[s],r[i]=u;}return r};var{decamelize:C}=L,P=o=>o.startsWith("/")?o:`/${o}`,S=o=>o.endsWith("/")?o.slice(0,-1):o;var g=(o,t)=>o.replace(/\{([^}]+)\}/g,(r,s)=>{let e=t?.[s];if(e===void 0)throw new Error(`Missing path parameter: ${s}`);return encodeURIComponent(String(e))}),E=o=>o.replace(/(^|\/):([A-Za-z0-9_]+)/g,"$1{$2}"),A=["wordFields","translationFields","fields"],G=new Set([...A,...A.map(o=>C(o))]),M=new Set(["navigationalResultsNumber","versesResultsNumber"]),I=(o,t={})=>{if(!o)return "";let r=new URLSearchParams;for(let[s,e]of Object.entries(o)){if(e===void 0)continue;let n=t.preserveCase||M.has(s)?s:C(s);if(G.has(s)||G.has(n)){let a=Object.entries(e).filter(([,i])=>i).map(([i])=>C(i));a.length>0&&r.set(n,a.join(","));continue}typeof e=="string"?r.set(n,e):typeof e=="number"||typeof e=="boolean"?r.set(n,e.toString()):Array.isArray(e)&&r.set(n,e.join(","));}return r.size===0?"":`?${r.toString()}`};var U={auth:"https://apis.quran.foundation/auth",content:"https://apis.quran.foundation/content",oauth2:"https://oauth2.quran.foundation",quranReflect:"https://apis.quran.foundation/quran-reflect",search:"https://apis.quran.foundation/search"},x={auth:"/v1",content:"/api/v4",oauth2:"",quranReflect:"/v1",search:"/v1"},B={auth:"/auth/v1",content:"/content/api/v4",oauth2:"",quranReflect:"/quran-reflect/v1",search:"/search/v1"},q={auth:["/auth/v1","/v1"],content:["/content/api/v4","/api/v4"],oauth2:[],quranReflect:["/quran-reflect/v1","/v1"],search:["/search/v1","/v1"]};var{camelizeKeys:H}=L,v=class{constructor(t){this.config=t;this.userSession=t.userSession;}userSession;clearCachedTokens(){}getFetch(){let t=this.config.fetch??globalThis.fetch;if(typeof t!="function")throw new Error("No fetch function available. Please provide a fetch implementation or ensure global fetch is available.");return t}async getUserSession(){let t=await this.config.storage?.getSession?.();return t!==void 0?t:this.userSession??null}async setUserSession(t){if(!this.config.storage){this.userSession=t;return}if(!t){if(this.config.storage.clearSession){await this.config.storage.clearSession(),this.userSession=null;return}await this.config.storage.setSession?.(null),this.userSession=null;return}await this.config.storage.setSession?.(t),this.userSession=t;}buildServiceUrl(t,r,s){let{baseUrl:e,usesGateway:n}=this.resolveServiceBaseUrl(t),a=this.normalizeServicePath(t,r,n);return `${e}${a}${I(s,{preserveCase:t==="auth"||t==="quranReflect"})}`}async requestOperation(t,r){return this.request(t.service,g(t.path,r?.path),r?.query,{...r,auth:r?.auth==="auto"||!r?.auth?t.auth:r.auth,method:r?.method??t.method.toUpperCase(),path:void 0})}async request(t,r,s,e={}){if(e.basicAuth)throw new Error("client_secret is server-only. Use @quranjs/api/server.");let n=this.resolveAuthMode(t,e.auth),a=this.buildServiceUrl(t,r,s),i=new Headers(e.headers),p=T(e,i);t!=="oauth2"&&i.set("x-client-id",this.config.clientId),await this.applyAuthenticationHeaders(t,n,i,e);let u=await this.getFetch()(a,{body:p,headers:i,method:e.method??"GET"});if(!u.ok)throw new Error(`${u.status} ${u.statusText}`);if(u.status===204)return;if(!(u.headers.get("content-type")??"").includes("application/json"))return await u.text();let f=await u.json();return H(f)}resolveAuthMode(t,r="auto"){if(r!=="auto"){if(r==="app")throw new Error("This API requires @quranjs/api/server or a backend. Content and search are server-side for confidential clients.");return r}return t==="auth"||t==="quranReflect"?"user":"none"}async applyAuthenticationHeaders(t,r,s,e){if(e.accessToken){this.setTokenHeaders(t,s,e.accessToken);return}if(r==="none")return;let n=await this.getUserSession();if(!n?.accessToken)throw new Error("This operation requires a user session. Sign in first or use @quranjs/api/server.");this.setTokenHeaders(t,s,n.accessToken);}setTokenHeaders(t,r,s){if(t==="oauth2"){r.set("Authorization",`Bearer ${s}`);return}r.set("x-auth-token",s);}resolveServiceBaseUrl(t){let{services:r}=this.config,s=t==="auth"?r?.authBaseUrl:t==="quranReflect"?r?.quranReflectBaseUrl:r?.oauth2BaseUrl??r?.tokenHost;return s?{baseUrl:S(s),usesGateway:false}:r?.gatewayUrl&&t!=="oauth2"?{baseUrl:S(r.gatewayUrl),usesGateway:true}:{baseUrl:U[t],usesGateway:false}}normalizeServicePath(t,r,s){let e=P(E(r));for(let a of q[t])if(e.startsWith(a)){e=P(e.slice(a.length));break}let n=s?B[t]:x[t];return e.startsWith(n)||n.length===0?e:`${n}${e}`}};var V="This API requires @quranjs/api/server or a backend. Content and search are server-side for confidential clients.",$="auth.bookmarks.get(bookmarkId) is not supported because /v1/bookmarks/bookmark expects bookmark detail query parameters. Pass a query object such as { mushafId, key, type, verseNumber } or { mushafId, isReading: true }.",z=(o,t)=>(r,s,e)=>o.request(t,g(s,e?.path),e?.query,{...e,auth:"user",method:r,path:void 0,query:void 0}),K=o=>{let t=m(o,c.auth.v1),r=y(c.auth.v1,t),s=z(o,"auth");return {...r,collections:{...r.collections,addBookmark:(e,n)=>s("POST","/v1/collections/{collectionId}/bookmarks",{body:n,path:{collectionId:e}}),create:e=>s("POST","/v1/collections",{body:e}),get:(e,n)=>s("GET","/v1/collections/{collectionId}",{path:{collectionId:e},query:n}),list:e=>s("GET","/v1/collections",{query:e}),listAll:e=>s("GET","/v1/collections/all",{query:e}),remove:e=>s("DELETE","/v1/collections/{collectionId}",{path:{collectionId:e}}),removeBookmark:(e,n)=>s("DELETE","/v1/collections/{collectionId}/bookmarks/{bookmarkId}",{path:{bookmarkId:n,collectionId:e}}),update:(e,n)=>s("POST","/v1/collections/{collectionId}",{body:n,path:{collectionId:e}})},bookmarks:{...r.bookmarks,create:e=>s("POST","/v1/bookmarks",{body:e}),get:async e=>{if(typeof e=="string")throw new Error($);return s("GET","/v1/bookmarks/bookmark",{query:e})},list:e=>s("GET","/v1/bookmarks",{query:e}),listCollections:e=>s("GET","/v1/bookmarks/collections",{query:e}),listRange:e=>s("GET","/v1/bookmarks/ayahs-range",{query:e}),remove:e=>s("DELETE","/v1/bookmarks/{bookmarkId}",{path:{bookmarkId:e}})},goals:{...r.goals,create:e=>s("POST","/v1/goals",{body:e}),estimate:e=>s("GET","/v1/goals/estimate",{query:e}),getTodaysPlan:e=>s("GET","/v1/goals/get-todays-plan",{query:e}),remove:e=>s("DELETE","/v1/goals/{id}",{path:{id:e}}),update:(e,n)=>s("PUT","/v1/goals/{id}",{body:n,path:{id:e}})},notes:{...r.notes,create:e=>s("POST","/v1/notes",{body:e}),get:e=>s("GET","/v1/notes/{noteId}",{path:{noteId:e}}),list:e=>s("GET","/v1/notes",{query:e}),listByAttachedEntity:e=>s("GET","/v1/notes/by-attached-entity",{query:e}),listByRange:e=>s("GET","/v1/notes/by-range",{query:e}),listByVerseKey:(e,n)=>s("GET","/v1/notes/by-verse/{verseKey}",{path:{verseKey:e},query:n}),publish:(e,n)=>s("POST","/v1/notes/{noteId}/publish",{body:n,path:{noteId:e}}),remove:e=>s("DELETE","/v1/notes/{noteId}",{path:{noteId:e}}),update:(e,n)=>s("PATCH","/v1/notes/{noteId}",{body:n,path:{noteId:e}})},preferences:{...r.preferences,bulkUpdate:e=>s("POST","/v1/preferences/bulk",{body:e}),get:e=>s("GET","/v1/preferences",{query:e}),update:e=>s("POST","/v1/preferences",{body:e})},raw:t,readingSessions:{...r.readingSessions,create:e=>s("POST","/v1/reading-sessions",{body:e}),list:e=>s("GET","/v1/reading-sessions",{query:e})}}},W=o=>{let t=m(o,c.quranReflect.v1),r=y(c.quranReflect.v1,t);return {comments:r.comments??{},posts:r.posts??{},raw:t,rooms:r.rooms??{},tags:r.tags??{},users:r.users??{}}},Q=(o,t)=>{let r=m(o,c.oauth2.v1),s=async(e,n={})=>{if(t.clientType!=="public")throw new Error("This OAuth2 exchange requires a backend because your client is confidential.");if(n.requiresRefreshToken&&!e.get("refresh_token"))throw new Error("Missing refresh token.");e.set("client_id",t.clientId);let a=e.get("refresh_token")??void 0,i=n.requiresRefreshToken?await o.getUserSession():null,p=n.requiresRefreshToken&&a?{...i??{},refreshToken:a}:i,u=await o.request("oauth2","/oauth2/token",void 0,{auth:"none",body:e,contentType:"application/x-www-form-urlencoded",method:"POST"});return await o.setUserSession(R(u,p)),u};return {authorizeUrl:e=>o.buildServiceUrl("oauth2","/oauth2/auth",e),exchangeCode:e=>{let n=new URLSearchParams({code:e.code,grant_type:"authorization_code",redirect_uri:e.redirectUri});return e.codeVerifier&&n.set("code_verifier",e.codeVerifier),e.scope&&n.set("scope",e.scope),s(n)},getUserInfo:e=>o.request("oauth2","/userinfo",void 0,{accessToken:e,auth:"user",method:"GET"}),introspect:()=>{throw new Error("Token introspection requires @quranjs/api/server or a backend.")},logout:e=>o.request("oauth2","/oauth2/sessions/logout",e,{auth:"none",method:"GET"}),raw:r,refresh:async e=>{let n=await o.getUserSession(),a=new URLSearchParams({grant_type:"refresh_token",refresh_token:e??n?.refreshToken??""});return s(a,{requiresRefreshToken:true})}}},X=()=>{let o=()=>Promise.reject(new Error(V)),t=new Proxy(o,{apply(){return Promise.reject(new Error(V))},get(r,s){if(s!=="then")return t}});return t},_=o=>{let t=new v(o);t.getFetch();let r=K(t),s=W(t),e=Q(t,o),n=X(),a={auth:{v1:r.raw},content:{v4:n},oauth2:{v1:e.raw},quranReflect:{v1:s.raw},search:{v1:n}};return {audio:n,auth:{...r,v1:r},chapters:n,clearCachedTokens:()=>t.clearCachedTokens(),content:n,getUserSession:()=>t.getUserSession(),hadithReferences:n,juzs:n,oauth2:{...e,v1:e},quranReflect:{...s,v1:s},raw:a,resources:n,search:n,verses:n}};var ye=o=>{if(o.clientSecret)throw new Error("client_secret is server-only. Use @quranjs/api/server.");return _(o)};
1
+ import L from'humps';var b={auth:{v1:{operations:{getV1Collections:{auth:"user",method:"get",path:"/v1/collections"},postV1Collections:{auth:"user",method:"post",path:"/v1/collections"},postV1CollectionsByCollectionIdBookmarks:{auth:"user",method:"post",path:"/v1/collections/{collectionId}/bookmarks"},deleteV1CollectionsByCollectionIdBookmarks:{auth:"user",method:"delete",path:"/v1/collections/{collectionId}/bookmarks"},getV1CollectionsByCollectionId:{auth:"user",method:"get",path:"/v1/collections/{collectionId}"},postV1CollectionsByCollectionId:{auth:"user",method:"post",path:"/v1/collections/{collectionId}"},deleteV1CollectionsByCollectionId:{auth:"user",method:"delete",path:"/v1/collections/{collectionId}"},deleteV1CollectionsByCollectionIdBookmarksByBookmarkId:{auth:"user",method:"delete",path:"/v1/collections/{collectionId}/bookmarks/{bookmarkId}"},getV1CollectionsAll:{auth:"user",method:"get",path:"/v1/collections/all"},getV1Bookmarks:{auth:"user",method:"get",path:"/v1/bookmarks"},postV1Bookmarks:{auth:"user",method:"post",path:"/v1/bookmarks"},deleteV1BookmarksByBookmarkId:{auth:"user",method:"delete",path:"/v1/bookmarks/{bookmarkId}"},getV1BookmarksAyahsRange:{auth:"user",method:"get",path:"/v1/bookmarks/ayahs-range"},getV1BookmarksBookmark:{auth:"user",method:"get",path:"/v1/bookmarks/bookmark"},getV1BookmarksCollections:{auth:"user",method:"get",path:"/v1/bookmarks/collections"},getV1Preferences:{auth:"user",method:"get",path:"/v1/preferences"},postV1Preferences:{auth:"user",method:"post",path:"/v1/preferences"},postV1PreferencesBulk:{auth:"user",method:"post",path:"/v1/preferences/bulk"},getV1ReadingSessions:{auth:"user",method:"get",path:"/v1/reading-sessions"},postV1ReadingSessions:{auth:"user",method:"post",path:"/v1/reading-sessions"},getV1GoalsGetTodaysPlan:{auth:"user",method:"get",path:"/v1/goals/get-todays-plan"},putV1GoalsById:{auth:"user",method:"put",path:"/v1/goals/{id}"},deleteV1GoalsById:{auth:"user",method:"delete",path:"/v1/goals/{id}"},postV1Goals:{auth:"user",method:"post",path:"/v1/goals"},getV1GoalsEstimate:{auth:"user",method:"get",path:"/v1/goals/estimate"},getV1Streaks:{auth:"user",method:"get",path:"/v1/streaks"},getV1StreaksCurrentStreakDays:{auth:"user",method:"get",path:"/v1/streaks/current-streak-days"},getV1ActivityDays:{auth:"user",method:"get",path:"/v1/activity-days"},postV1ActivityDays:{auth:"user",method:"post",path:"/v1/activity-days"},getV1ActivityDaysEstimateReadingTime:{auth:"user",method:"get",path:"/v1/activity-days/estimate-reading-time"},getV1Notes:{auth:"user",method:"get",path:"/v1/notes"},postV1Notes:{auth:"user",method:"post",path:"/v1/notes"},getV1NotesByVerseByVerseKey:{auth:"user",method:"get",path:"/v1/notes/by-verse/{verseKey}"},getV1NotesByAttachedEntity:{auth:"user",method:"get",path:"/v1/notes/by-attached-entity"},getV1NotesCountWithinRange:{auth:"user",method:"get",path:"/v1/notes/count-within-range"},getV1NotesByRange:{auth:"user",method:"get",path:"/v1/notes/by-range"},getV1NotesByNoteId:{auth:"user",method:"get",path:"/v1/notes/{noteId}"},patchV1NotesByNoteId:{auth:"user",method:"patch",path:"/v1/notes/{noteId}"},deleteV1NotesByNoteId:{auth:"user",method:"delete",path:"/v1/notes/{noteId}"},postV1NotesByNoteIdPublish:{auth:"user",method:"post",path:"/v1/notes/{noteId}/publish"}},service:"auth",version:"v1"}},oauth2:{v1:{operations:{oauth2TokenExchange:{auth:"none",method:"post",path:"/oauth2/token"},introspectOauth2Token:{auth:"none",method:"post",path:"/oauth2/introspect"},oAuth2Authorize:{auth:"none",method:"get",path:"/oauth2/auth"},getOidcUserInfo:{auth:"user",method:"get",path:"/userinfo"},revokeOidcSession:{auth:"none",method:"get",path:"/oauth2/sessions/logout"}},service:"oauth2",version:"v1"}},quranReflect:{v1:{operations:{usersControllerProfile:{auth:"user",method:"get",path:"/v1/users/profile"},usersControllerUpdateProfile:{auth:"user",method:"put",path:"/v1/users/profile"},usersControllerEditProfile:{auth:"user",method:"patch",path:"/v1/users/profile"},usersControllerRooms:{auth:"user",method:"get",path:"/v1/users/my-rooms"},usersControllerSearch:{auth:"user",method:"get",path:"/v1/users/search"},usersControllerToggleFollow:{auth:"user",method:"post",path:"/v1/users/{followeeId}/toggle-follow"},usersControllerRemoveFollower:{auth:"user",method:"post",path:"/v1/users/{followerId}/remove-follower"},usersControllerGetUserProfile:{auth:"user",method:"get",path:"/v1/users/{id}"},usersControllerGetUserProfile2:{auth:"user",method:"get",path:"/v1/users/{username}/profile"},usersControllerGetUserFollowers:{auth:"user",method:"get",path:"/v1/users/{id}/followers"},usersControllerGetUserFollowing:{auth:"user",method:"get",path:"/v1/users/{id}/following"},roomsControllerAdminsAccess:{auth:"user",method:"post",path:"/v1/rooms/admins-access"},roomsControllerCreateNewGroup:{auth:"user",method:"post",path:"/v1/rooms/groups"},roomsControllerUpdateGroup:{auth:"user",method:"patch",path:"/v1/rooms/groups"},roomsControllerCreateNewPage:{auth:"user",method:"post",path:"/v1/rooms/pages"},roomsControllerUpdatePage:{auth:"user",method:"patch",path:"/v1/rooms/pages"},roomsControllerGetRoomMembers:{auth:"user",method:"get",path:"/v1/rooms/{id}/members"},roomsControllerInviteUserToRoom:{auth:"user",method:"post",path:"/v1/rooms/{id}/invite"},roomsControllerAcceptInvite:{auth:"user",method:"get",path:"/v1/rooms/{id}/accept-invite"},roomsControllerRejectInvite:{auth:"user",method:"get",path:"/v1/rooms/{id}/reject-invite"},roomsControllerRemoveMember:{auth:"user",method:"delete",path:"/v1/rooms/{id}/members/{userId}"},roomsControllerGetRooms:{auth:"user",method:"get",path:"/v1/rooms/joined-rooms"},roomsControllerGetRooms2:{auth:"user",method:"get",path:"/v1/rooms/managed-rooms"},roomsControllerSearchRooms:{auth:"user",method:"get",path:"/v1/rooms/search"},roomsControllerGetRoomProfile:{auth:"user",method:"get",path:"/v1/rooms/group/{url}"},roomsControllerGetRoomProfile2:{auth:"user",method:"get",path:"/v1/rooms/page/{subdomain}"},roomsControllerAcceptByPrivateToken:{auth:"user",method:"get",path:"/v1/rooms/group/{url}/accept/{token}"},roomsControllerAcceptByPrivateToken2:{auth:"user",method:"get",path:"/v1/rooms/page/{subdomain}/accept/{token}"},roomsControllerGetRoomProfileById:{auth:"user",method:"get",path:"/v1/rooms/{id}"},roomsControllerGetRoomPosts:{auth:"user",method:"get",path:"/v1/rooms/{id}/posts"},roomsControllerJoinRoom:{auth:"user",method:"post",path:"/v1/rooms/{groupId}/join"},roomsControllerLeaveGroup:{auth:"user",method:"post",path:"/v1/rooms/{groupId}/leave"},roomsControllerFollowPage:{auth:"user",method:"post",path:"/v1/rooms/{pageId}/follow"},roomsControllerUnfollowPage:{auth:"user",method:"post",path:"/v1/rooms/{pageId}/unfollow"},roomsControllerUpdatePostPrivacy:{auth:"user",method:"patch",path:"/v1/rooms/{roomId}/posts/{postId}/privacy"},postsControllerFeed:{auth:"user",method:"get",path:"/v1/posts/feed"},postsControllerGetRelatedPosts:{auth:"user",method:"get",path:"/v1/posts/{postId}/related"},postsControllerGetLoggedinUserPosts:{auth:"user",method:"get",path:"/v1/posts/my-posts"},postsControllerGetLikedState:{auth:"user",method:"get",path:"/v1/posts/{id}/liked"},postsControllerFindOne:{auth:"user",method:"get",path:"/v1/posts/{id}"},postsControllerEdit:{auth:"user",method:"patch",path:"/v1/posts/{id}"},postsControllerDelete:{auth:"user",method:"delete",path:"/v1/posts/{id}"},postsControllerViewTracking:{auth:"user",method:"get",path:"/v1/posts/viewed/{id}"},postsControllerCreate:{auth:"user",method:"post",path:"/v1/posts"},postsControllerReportAbuse:{auth:"user",method:"post",path:"/v1/posts/{id}/report"},postsControllerGetUserPost:{auth:"user",method:"get",path:"/v1/posts/user-posts/{id}"},postsControllerToggleLike:{auth:"user",method:"post",path:"/v1/posts/{id}/toggle-like"},postsControllerToggleSave:{auth:"user",method:"post",path:"/v1/posts/{id}/toggle-save"},postsControllerGetComments:{auth:"user",method:"get",path:"/v1/posts/{id}/comments"},postsControllerGetAllComment:{auth:"user",method:"get",path:"/v1/posts/{id}/all-comments"},postsControllerExportMultiplePosts:{auth:"user",method:"post",path:"/v1/posts/export/pdf"},postsControllerGetMyPostsCountWithinRange:{auth:"user",method:"get",path:"/v1/posts/count-within-range"},postsControllerGetMyPostsByVerse:{auth:"user",method:"get",path:"/v1/posts/by-verse/{verseKey}"},tagsControllerFind:{auth:"user",method:"get",path:"/v1/tags"},commentsControllerCreate:{auth:"user",method:"post",path:"/v1/comments"},commentsControllerDeleteComment:{auth:"user",method:"get",path:"/v1/comments/{id}/delete"},commentsControllerToggleLike:{auth:"user",method:"post",path:"/v1/comments/{id}/toggle-like"},commentsControllerGet:{auth:"user",method:"get",path:"/v1/comments/{id}/replies"}},service:"quranReflect",version:"v1"}}};var c=b;var T=(o,t)=>{if(!(o.body===void 0||o.body===null))return typeof o.body=="string"||o.body instanceof URLSearchParams?(o.contentType&&t.set("Content-Type",o.contentType),o.body):(t.set("Content-Type",o.contentType??"application/json"),JSON.stringify(o.body))},R=(o,t)=>{let r=o.expiresIn??o.expires_in,s=o.accessToken??o.access_token,e=o.idToken??o.id_token??t?.idToken,n=o.refreshToken??o.refresh_token??t?.refreshToken,a=o.tokenType??o.token_type??t?.tokenType,i=o.scope??t?.scope,p=r?Date.now()+r*1e3:t?.expiresAt;return {accessToken:s,expiresAt:p,idToken:e,refreshToken:n,scope:i,tokenType:a}};var k=(o,t,r)=>({...r,operationName:r.operationName??t,service:r.service??o.service,tags:r.tags??[],version:r.version??o.version});var w={delete:"remove",get:"list",patch:"update",post:"create",put:"update"},d=o=>{let t=o.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9]+/g," ").trim().split(/\s+/).filter(Boolean);return t.length===0?"misc":t.map((r,s)=>{let e=r.toLowerCase();return s===0?e:e.charAt(0).toUpperCase()+e.slice(1)}).join("")},N=o=>{let t=d(o);return t.charAt(0).toUpperCase()+t.slice(1)},h=o=>o.startsWith("{")&&o.endsWith("}"),O=o=>{let t=o.split("/").filter(Boolean);return t[0]?.match(/^v\d+$/)?t.slice(1):t},F=o=>{let t=O(o.path),r=t.at(-1),s=t.filter(a=>!h(a)),e=s.at(-1),n=s[0];return t.length===1?w[o.method]:t.length===2&&r&&h(r)?o.method==="get"?"get":o.method==="delete"?"remove":"update":r&&!h(r)&&e?e===n?`${w[o.method]}ById`:d(e):d(o.operationName)},m=(o,t)=>{let r={};for(let[s,e]of Object.entries(t.operations)){let n=k(t,s,e);r[s]=a=>o.requestOperation(n,a);}return r},y=(o,t)=>{let r={};for(let[s,e]of Object.entries(o.operations)){let n=k(o,s,e),a=O(n.path).filter(f=>!h(f)),i=d(a[0]??"misc"),p=F(n),u=r[i]??{},l=p;u[l]&&(l=`${p}${N(s)}`),u[l]=t[s],r[i]=u;}return r};var{decamelize:C}=L,P=o=>o.startsWith("/")?o:`/${o}`,S=o=>o.endsWith("/")?o.slice(0,-1):o;var g=(o,t)=>o.replace(/\{([^}]+)\}/g,(r,s)=>{let e=t?.[s];if(e===void 0)throw new Error(`Missing path parameter: ${s}`);return encodeURIComponent(String(e))}),E=o=>o.replace(/(^|\/):([A-Za-z0-9_]+)/g,"$1{$2}"),A=["wordFields","translationFields","fields"],G=new Set([...A,...A.map(o=>C(o))]),M=new Set(["navigationalResultsNumber","pageSize","versesResultsNumber"]),I=(o,t={})=>{if(!o)return "";let r=new URLSearchParams;for(let[s,e]of Object.entries(o)){if(e===void 0)continue;let n=t.preserveCase||M.has(s)?s:C(s);if(G.has(s)||G.has(n)){let a=Object.entries(e).filter(([,i])=>i).map(([i])=>C(i));a.length>0&&r.set(n,a.join(","));continue}typeof e=="string"?r.set(n,e):typeof e=="number"||typeof e=="boolean"?r.set(n,e.toString()):Array.isArray(e)&&r.set(n,e.join(","));}return r.size===0?"":`?${r.toString()}`};var U={auth:"https://apis.quran.foundation/auth",content:"https://apis.quran.foundation/content",oauth2:"https://oauth2.quran.foundation",quranReflect:"https://apis.quran.foundation/quran-reflect",search:"https://apis.quran.foundation/search"},x={auth:"/v1",content:"/api/v4",oauth2:"",quranReflect:"/v1",search:"/v1"},B={auth:"/auth/v1",content:"/content/api/v4",oauth2:"",quranReflect:"/quran-reflect/v1",search:"/search/v1"},q={auth:["/auth/v1","/v1"],content:["/content/api/v4","/api/v4"],oauth2:[],quranReflect:["/quran-reflect/v1","/v1"],search:["/search/v1","/v1"]};var{camelizeKeys:H}=L,v=class{constructor(t){this.config=t;this.userSession=t.userSession;}userSession;clearCachedTokens(){}getFetch(){let t=this.config.fetch??globalThis.fetch;if(typeof t!="function")throw new Error("No fetch function available. Please provide a fetch implementation or ensure global fetch is available.");return t}async getUserSession(){let t=await this.config.storage?.getSession?.();return t!==void 0?t:this.userSession??null}async setUserSession(t){if(!this.config.storage){this.userSession=t;return}if(!t){if(this.config.storage.clearSession){await this.config.storage.clearSession(),this.userSession=null;return}await this.config.storage.setSession?.(null),this.userSession=null;return}await this.config.storage.setSession?.(t),this.userSession=t;}buildServiceUrl(t,r,s){let{baseUrl:e,usesGateway:n}=this.resolveServiceBaseUrl(t),a=this.normalizeServicePath(t,r,n);return `${e}${a}${I(s,{preserveCase:t==="auth"||t==="quranReflect"})}`}async requestOperation(t,r){return this.request(t.service,g(t.path,r?.path),r?.query,{...r,auth:r?.auth==="auto"||!r?.auth?t.auth:r.auth,method:r?.method??t.method.toUpperCase(),path:void 0})}async request(t,r,s,e={}){if(e.basicAuth)throw new Error("client_secret is server-only. Use @quranjs/api/server.");let n=this.resolveAuthMode(t,e.auth),a=this.buildServiceUrl(t,r,s),i=new Headers(e.headers),p=T(e,i);t!=="oauth2"&&i.set("x-client-id",this.config.clientId),await this.applyAuthenticationHeaders(t,n,i,e);let u=await this.getFetch()(a,{body:p,headers:i,method:e.method??"GET"});if(!u.ok)throw new Error(`${u.status} ${u.statusText}`);if(u.status===204)return;if(!(u.headers.get("content-type")??"").includes("application/json"))return await u.text();let f=await u.json();return H(f)}resolveAuthMode(t,r="auto"){if(r!=="auto"){if(r==="app")throw new Error("This API requires @quranjs/api/server or a backend. Content and search are server-side for confidential clients.");return r}return t==="auth"||t==="quranReflect"?"user":"none"}async applyAuthenticationHeaders(t,r,s,e){if(e.accessToken){this.setTokenHeaders(t,s,e.accessToken);return}if(r==="none")return;let n=await this.getUserSession();if(!n?.accessToken)throw new Error("This operation requires a user session. Sign in first or use @quranjs/api/server.");this.setTokenHeaders(t,s,n.accessToken);}setTokenHeaders(t,r,s){if(t==="oauth2"){r.set("Authorization",`Bearer ${s}`);return}r.set("x-auth-token",s);}resolveServiceBaseUrl(t){let{services:r}=this.config,s=t==="auth"?r?.authBaseUrl:t==="quranReflect"?r?.quranReflectBaseUrl:r?.oauth2BaseUrl??r?.tokenHost;return s?{baseUrl:S(s),usesGateway:false}:r?.gatewayUrl&&t!=="oauth2"?{baseUrl:S(r.gatewayUrl),usesGateway:true}:{baseUrl:U[t],usesGateway:false}}normalizeServicePath(t,r,s){let e=P(E(r));for(let a of q[t])if(e.startsWith(a)){e=P(e.slice(a.length));break}let n=s?B[t]:x[t];return e.startsWith(n)||n.length===0?e:`${n}${e}`}};var V="This API requires @quranjs/api/server or a backend. Content and search are server-side for confidential clients.",$="auth.bookmarks.get(bookmarkId) is not supported because /v1/bookmarks/bookmark expects bookmark detail query parameters. Pass a query object such as { mushafId, key, type, verseNumber } or { mushafId, isReading: true }.",z=(o,t)=>(r,s,e)=>o.request(t,g(s,e?.path),e?.query,{...e,auth:"user",method:r,path:void 0,query:void 0}),K=o=>{let t=m(o,c.auth.v1),r=y(c.auth.v1,t),s=z(o,"auth");return {...r,collections:{...r.collections,addBookmark:(e,n)=>s("POST","/v1/collections/{collectionId}/bookmarks",{body:n,path:{collectionId:e}}),create:e=>s("POST","/v1/collections",{body:e}),get:(e,n)=>s("GET","/v1/collections/{collectionId}",{path:{collectionId:e},query:n}),list:e=>s("GET","/v1/collections",{query:e}),listAll:e=>s("GET","/v1/collections/all",{query:e}),remove:e=>s("DELETE","/v1/collections/{collectionId}",{path:{collectionId:e}}),removeBookmark:(e,n)=>s("DELETE","/v1/collections/{collectionId}/bookmarks/{bookmarkId}",{path:{bookmarkId:n,collectionId:e}}),update:(e,n)=>s("POST","/v1/collections/{collectionId}",{body:n,path:{collectionId:e}})},bookmarks:{...r.bookmarks,create:e=>s("POST","/v1/bookmarks",{body:e}),get:async e=>{if(typeof e=="string")throw new Error($);return s("GET","/v1/bookmarks/bookmark",{query:e})},list:e=>s("GET","/v1/bookmarks",{query:e}),listCollections:e=>s("GET","/v1/bookmarks/collections",{query:e}),listRange:e=>s("GET","/v1/bookmarks/ayahs-range",{query:e}),remove:e=>s("DELETE","/v1/bookmarks/{bookmarkId}",{path:{bookmarkId:e}})},goals:{...r.goals,create:e=>s("POST","/v1/goals",{body:e}),estimate:e=>s("GET","/v1/goals/estimate",{query:e}),getTodaysPlan:e=>s("GET","/v1/goals/get-todays-plan",{query:e}),remove:e=>s("DELETE","/v1/goals/{id}",{path:{id:e}}),update:(e,n)=>s("PUT","/v1/goals/{id}",{body:n,path:{id:e}})},notes:{...r.notes,create:e=>s("POST","/v1/notes",{body:e}),get:e=>s("GET","/v1/notes/{noteId}",{path:{noteId:e}}),list:e=>s("GET","/v1/notes",{query:e}),listByAttachedEntity:e=>s("GET","/v1/notes/by-attached-entity",{query:e}),listByRange:e=>s("GET","/v1/notes/by-range",{query:e}),listByVerseKey:(e,n)=>s("GET","/v1/notes/by-verse/{verseKey}",{path:{verseKey:e},query:n}),publish:(e,n)=>s("POST","/v1/notes/{noteId}/publish",{body:n,path:{noteId:e}}),remove:e=>s("DELETE","/v1/notes/{noteId}",{path:{noteId:e}}),update:(e,n)=>s("PATCH","/v1/notes/{noteId}",{body:n,path:{noteId:e}})},preferences:{...r.preferences,bulkUpdate:e=>s("POST","/v1/preferences/bulk",{body:e}),get:e=>s("GET","/v1/preferences",{query:e}),update:e=>s("POST","/v1/preferences",{body:e})},raw:t,readingSessions:{...r.readingSessions,create:e=>s("POST","/v1/reading-sessions",{body:e}),list:e=>s("GET","/v1/reading-sessions",{query:e})}}},W=o=>{let t=m(o,c.quranReflect.v1),r=y(c.quranReflect.v1,t);return {comments:r.comments??{},posts:r.posts??{},raw:t,rooms:r.rooms??{},tags:r.tags??{},users:r.users??{}}},Q=(o,t)=>{let r=m(o,c.oauth2.v1),s=async(e,n={})=>{if(t.clientType!=="public")throw new Error("This OAuth2 exchange requires a backend because your client is confidential.");if(n.requiresRefreshToken&&!e.get("refresh_token"))throw new Error("Missing refresh token.");e.set("client_id",t.clientId);let a=e.get("refresh_token")??void 0,i=n.requiresRefreshToken?await o.getUserSession():null,p=n.requiresRefreshToken&&a?{...i??{},refreshToken:a}:i,u=await o.request("oauth2","/oauth2/token",void 0,{auth:"none",body:e,contentType:"application/x-www-form-urlencoded",method:"POST"});return await o.setUserSession(R(u,p)),u};return {authorizeUrl:e=>o.buildServiceUrl("oauth2","/oauth2/auth",e),exchangeCode:e=>{let n=new URLSearchParams({code:e.code,grant_type:"authorization_code",redirect_uri:e.redirectUri});return e.codeVerifier&&n.set("code_verifier",e.codeVerifier),e.scope&&n.set("scope",e.scope),s(n)},getUserInfo:e=>o.request("oauth2","/userinfo",void 0,{accessToken:e,auth:"user",method:"GET"}),introspect:()=>{throw new Error("Token introspection requires @quranjs/api/server or a backend.")},logout:e=>o.request("oauth2","/oauth2/sessions/logout",e,{auth:"none",method:"GET"}),raw:r,refresh:async e=>{let n=await o.getUserSession(),a=new URLSearchParams({grant_type:"refresh_token",refresh_token:e??n?.refreshToken??""});return s(a,{requiresRefreshToken:true})}}},X=()=>{let o=()=>Promise.reject(new Error(V)),t=new Proxy(o,{apply(){return Promise.reject(new Error(V))},get(r,s){if(s!=="then")return t}});return t},_=o=>{let t=new v(o);t.getFetch();let r=K(t),s=W(t),e=Q(t,o),n=X(),a={auth:{v1:r.raw},content:{v4:n},oauth2:{v1:e.raw},quranReflect:{v1:s.raw},search:{v1:n}};return {answers:n,audio:n,auth:{...r,v1:r},chapters:n,clearCachedTokens:()=>t.clearCachedTokens(),content:n,getUserSession:()=>t.getUserSession(),hadithReferences:n,juzs:n,oauth2:{...e,v1:e},quranReflect:{...s,v1:s},raw:a,resources:n,search:n,verses:n}};var ye=o=>{if(o.clientSecret)throw new Error("client_secret is server-only. Use @quranjs/api/server.");return _(o)};
2
2
  export{ye as createPublicClient};//# sourceMappingURL=public.min.mjs.map
3
3
  //# sourceMappingURL=public.min.mjs.map