@berry-cloud/ngx-unsplash
Version:
Lightweight Angular wrapper for the Unsplash API.
1 lines • 47.7 kB
Source Map (JSON)
{"version":3,"file":"berry-cloud-ngx-unsplash.mjs","sources":["../../../projects/ngx-unsplash/src/lib/pipes/blurhash.pipe.ts","../../../projects/ngx-unsplash/src/lib/unsplash.module.ts","../../../projects/ngx-unsplash/src/lib/unsplash.service.ts","../../../projects/ngx-unsplash/src/public-api.ts","../../../projects/ngx-unsplash/src/berry-cloud-ngx-unsplash.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { decode } from 'blurhash';\nimport { Observable } from 'rxjs';\nimport { Photo } from '../model/photo';\n\n@Pipe({\n name: 'blurhash',\n})\nexport class BlurHashPipe implements PipeTransform {\n /**\n * [BlurHash placeholder](https://unsplash.com/documentation#blurhash-placeholders).\n *\n * Returns a URL of the BlurHash preview and then the URL of photo once the\n * photo been downloaded by the browser.\n *\n * @param photo to download\n * @param size to be returned, the default is thumb\n * @returns Observable of URL\n */\n transform(\n photo: Photo,\n size: 'raw' | 'full' | 'regular' | 'small' | 'thumb' = 'thumb'\n ): Observable<string> {\n return new Observable<string>((observer) => {\n // Send URL of blur hash image\n observer.next(this.getImageFromBlurHash(photo).toDataURL());\n\n const img = new Image();\n img.src = photo.urls[size];\n img.onload = () => {\n // Send URL of loaded image\n observer.next(img.src);\n observer.complete();\n };\n\n img.onerror = (err) => observer.error(err);\n });\n }\n\n private getImageFromBlurHash(photo: Photo): HTMLCanvasElement {\n const canvas = document.createElement('canvas');\n\n let width = photo.width || 240;\n let r = width / 240;\n canvas.width = width / r;\n canvas.height = (photo.height || 180) / r;\n\n try {\n if (photo.blur_hash) {\n const pixels = decode(photo.blur_hash, canvas.width, canvas.height);\n const ctx = canvas.getContext('2d');\n const imageData = ctx!.createImageData(canvas.width, canvas.height);\n imageData.data.set(pixels);\n ctx!.putImageData(imageData, 0, 0);\n }\n } catch { }\n return canvas;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { BlurHashPipe } from './pipes/blurhash.pipe';\n\n@NgModule({\n declarations: [BlurHashPipe],\n imports: [],\n exports: [BlurHashPipe],\n})\nexport class NgxUnsplashModule {}\n","import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';\nimport { Inject, Injectable, InjectionToken } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { map, mergeMap, tap } from 'rxjs/operators';\nimport { Collection } from './model/collection';\nimport { Download } from './model/download';\nimport { Photo } from './model/photo';\nimport { SearchResult } from './model/search-result';\nimport { UserStatistics } from './model/statistics';\nimport { Topic } from './model/topic';\nimport {\n UnsplashColor,\n UnsplashContentFilter,\n UnsplashFeaturedOrderBy,\n UnsplashOrderBy,\n UnsplashOrientation,\n UnsplashResolution,\n UnsplashSearchOrderBy,\n} from './model/types';\nimport { User } from './model/user';\n\nexport interface UnsplashConfig {\n url: string;\n authorization: string;\n}\n\nexport const UNSPLASH_CONFIG = new InjectionToken<\n UnsplashConfig | Observable<UnsplashConfig>\n>('unsplash.config');\n\n// prettier-ignore\nexport type Count =\n | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10\n | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20\n | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30;\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UnsplashService {\n private readonly searchUrl = 'search/photos';\n private readonly photosUrl = 'photos';\n private readonly randomUrl = 'photos/random';\n private readonly collectionsUrl = 'collections';\n private readonly topicsUrl = 'topics';\n private readonly usersUrl = 'users';\n\n private config$: Observable<UnsplashConfig>;\n\n constructor(\n private http: HttpClient,\n @Inject(UNSPLASH_CONFIG)\n config: UnsplashConfig | Observable<UnsplashConfig>\n ) {\n const config$ = config instanceof Observable ? config : of(config);\n\n this.config$ = config$.pipe(\n tap((config) => {\n if (!config) {\n throw new Error('Unsplash configuration undefined');\n }\n\n if (!config.url) {\n throw new Error('Unsplash configuration url undefined');\n }\n\n if (!config.authorization) {\n throw new Error('Unsplash configuration authorization undefined');\n }\n })\n );\n }\n\n /**\n * [List photos](https://unsplash.com/documentation#list-photos).\n *\n * Get a single page from the list of all photos.\n *\n * @param options to be used when getting list of photos\n *\n * @returns Observable containing a {@link Photo} array\n */\n photos(options?: {\n page?: number;\n perPage?: number;\n orderBy?: UnsplashOrderBy;\n }): Observable<Photo[]> {\n return this.config$.pipe(\n mergeMap((config) => {\n let params = new HttpParams();\n\n if (options?.page) {\n params = params.set('page', options.page.toString());\n }\n\n if (options?.perPage) {\n params = params.set('per_page', options.perPage.toString());\n }\n\n if (options?.orderBy) {\n params = params.set('order_by', options.orderBy);\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(this.photosUrl, config);\n\n return this.http.get<Photo[]>(url, { params, headers });\n })\n );\n }\n\n /**\n * [List photos](https://unsplash.com/documentation#list-photos).\n *\n * Get a single page from the list of all photos.\n *\n * @param options to be used when getting list of photos\n *\n * @returns Observable containing a {@link Photo} array\n *\n * @deprecated Use {@link photos} instead\n */\n list(options?: {\n page?: number;\n perPage?: number;\n orderBy?: UnsplashOrderBy;\n }): Observable<Photo[]> {\n return this.photos(options);\n }\n\n /**\n * [Get a photo](https://unsplash.com/documentation#get-a-photo).\n *\n * Retrieve a single photo.\n *\n * @param id of the photo\n *\n * @returns Observable containing the {@link Photo}\n */\n photo(id: string): Observable<Photo> {\n return this.config$.pipe(\n mergeMap((config) => {\n const headers = this.unsplashHeaders(config);\n const url = this.unsplashUrl(`${this.photosUrl}/${id}`, config);\n\n return this.http.get<Photo>(url, { headers });\n })\n );\n }\n\n /**\n * [Get a photo](https://unsplash.com/documentation#get-a-photo).\n *\n * Retrieve a single photo.\n *\n * @param id of the photo\n *\n * @returns Observable containing the {@link Photo}\n *\n * @deprecated Use {@link photo} instead\n */\n get(id: string): Observable<Photo> {\n return this.photo(id);\n }\n\n /**\n * [Get random photos](https://unsplash.com/documentation#get-a-random-photo).\n *\n * Retrieve random photos.\n *\n * @param options to be used when getting random photos\n *\n * @returns Observable containing a {@link Photo} array\n */\n randomPhoto(options?: {\n collections?: string;\n topics?: string;\n username?: string;\n query?: string;\n orientation?: UnsplashOrientation;\n contentFilter?: UnsplashContentFilter;\n count?: Count;\n }): Observable<Photo[]> {\n return this.config$.pipe(\n mergeMap((config) => {\n let params = new HttpParams();\n\n if (options?.collections) {\n params = params.set('collections', options?.collections);\n }\n\n if (options?.topics) {\n params = params.set('topics', options?.topics);\n }\n\n if (options?.username) {\n params = params.set('username', options?.username);\n }\n\n if (options?.query) {\n params = params.set('query', options?.query);\n }\n\n if (options?.orientation) {\n params = params.set('orientation', options?.orientation);\n }\n\n if (options?.contentFilter) {\n params = params.set('content_filter', options?.contentFilter);\n }\n\n if (options?.count) {\n params = params.set('count', options?.count);\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(this.randomUrl, config);\n\n return this.http.get<Photo[]>(url, { params, headers });\n })\n );\n }\n\n /**\n * [Get random photos](https://unsplash.com/documentation#get-a-random-photo).\n *\n * Retrieve random photos.\n *\n * @param options to be used when getting random photos\n *\n * @returns Observable containing a {@link Photo} array\n *\n * @deprecated Use {@link randomPhoto} instead\n */\n random(options?: {\n collections?: string;\n topics?: string;\n username?: string;\n query?: string;\n orientation?: UnsplashOrientation;\n contentFilter?: UnsplashContentFilter;\n count?: Count;\n }): Observable<Photo[]> {\n return this.randomPhoto(options);\n }\n\n /**\n * [Search photos](https://unsplash.com/documentation#search-photos).\n *\n * Get a single page of photo results for a query.\n *\n * @param query to search for\n * @param options to be used when searching photos\n *\n * @returns Observable containing a {@link SearchResult}\n */\n searchPhotos(\n query: string,\n options?: {\n page?: number;\n perPage?: number;\n orderBy?: UnsplashSearchOrderBy;\n collections?: string;\n contentFilter?: UnsplashContentFilter;\n color?: UnsplashColor;\n orientation?: UnsplashOrientation;\n }\n ): Observable<SearchResult> {\n return this.config$.pipe(\n mergeMap((config) => {\n let params = new HttpParams().set('query', query);\n\n if (options?.page) {\n params = params.set('page', options?.page);\n }\n\n if (options?.perPage) {\n params = params.set('per_page', options?.perPage);\n }\n\n if (options?.orderBy) {\n params = params.set('order_by', options?.orderBy);\n }\n\n if (options?.collections) {\n params = params.set('collections', options?.collections);\n }\n\n if (options?.contentFilter) {\n params = params.set('content_filter', options?.contentFilter);\n }\n\n if (options?.color) {\n params = params.set('color', options?.color);\n }\n\n if (options?.orientation) {\n params = params.set('orientation', options?.orientation);\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(this.searchUrl, config);\n\n return this.http.get<SearchResult>(url, { headers, params });\n })\n );\n }\n\n /**\n * [Search photos](https://unsplash.com/documentation#search-photos).\n *\n * Get a single page of photo results for a query.\n *\n * @param query to search for\n * @param options to be used when searching photos\n *\n * @returns Observable containing a {@link SearchResult}\n *\n * @deprecated Use {@link searchPhotos} instead\n */\n search(\n query: string,\n options?: {\n page?: number;\n perPage?: number;\n orderBy?: UnsplashSearchOrderBy;\n collections?: string;\n contentFilter?: UnsplashContentFilter;\n color?: UnsplashColor;\n orientation?: UnsplashOrientation;\n }\n ): Observable<SearchResult> {\n return this.searchPhotos(query, options);\n }\n\n /**\n * [Trigger a download](https://help.unsplash.com/en/articles/2511258-guideline-triggering-a-download)\n * of a photo.\n *\n * @param photo to download\n *\n * @returns Observable containing the {@link Download}\n */\n downloadPhoto(photo: Photo): Observable<Download> {\n return this.config$.pipe(\n mergeMap((config) => {\n const headers = this.unsplashHeaders(config);\n\n const photoUrl = new URL(photo.links.download_location);\n\n // Remove the leading slash from the pathname and add the search\n const url = this.unsplashUrl(\n photoUrl.pathname.substring(1) + photoUrl.search,\n config\n );\n\n return this.http.get<Download>(url, { headers });\n })\n );\n }\n\n /**\n * [Trigger a download](https://help.unsplash.com/en/articles/2511258-guideline-triggering-a-download)\n * of a photo.\n *\n * @param photo to download\n *\n * @returns Observable containing the {@link Download}\n *\n * @deprecated Use {@link downloadPhoto} instead\n */\n download(photo: Photo): Observable<Download> {\n return this.downloadPhoto(photo);\n }\n\n /**\n * [List collections](https://unsplash.com/documentation#list-collections).\n * Retrieve a list of collections.\n *\n * @param options to be used when getting collections\n *\n * @returns Observable containing a {@link Collection} array\n *\n * @throws Error if the Unsplash configuration is not provided\n */\n collections(options?: {\n page?: number;\n perPage?: number;\n }): Observable<Collection[]> {\n return this.config$.pipe(\n mergeMap((config) => {\n let params = new HttpParams();\n\n if (options?.page) {\n params = params.set('page', options?.page);\n }\n\n if (options?.perPage) {\n params = params.set('per_page', options?.perPage);\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(this.collectionsUrl, config);\n\n return this.http.get<Collection[]>(url, { headers, params });\n })\n );\n }\n\n /**\n * [Get a collection](https://unsplash.com/documentation#get-a-collection).\n * Retrieve a single collection.\n *\n * @param id of the collection to retrieve\n *\n * @returns Observable containing a {@link Collection}\n *\n * @throws Error if the collection id is not provided\n * @throws Error if the Unsplash configuration is not provided\n */\n collection(id: string): Observable<Collection> {\n return this.config$.pipe(\n mergeMap((config) => {\n if (!id) {\n throw new Error('Collection id undefined');\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(`${this.collectionsUrl}/${id}`, config);\n\n return this.http.get<Collection>(url, { headers });\n })\n );\n }\n\n /**\n * [Get a collection's photos](https://unsplash.com/documentation#get-a-collections-photos).\n * Retrieve a list of photos in a collection.\n *\n * @param id of the collection to retrieve photos from\n * @param options to be used when getting photos from a collection\n *\n * @returns Observable containing a {@link Photo} array\n *\n * @throws Error if the collection id is not provided\n * @throws Error if the Unsplash configuration is not provided\n */\n collectionPhotos(\n id: string,\n options?: {\n page?: number;\n perPage?: number;\n orientation?: UnsplashOrientation;\n }\n ): Observable<Photo[]> {\n return this.config$.pipe(\n mergeMap((config) => {\n if (!id) {\n throw new Error('Collection id undefined');\n }\n\n let params = new HttpParams();\n\n if (options?.page) {\n params = params.set('page', options?.page);\n }\n\n if (options?.perPage) {\n params = params.set('per_page', options?.perPage);\n }\n\n if (options?.orientation) {\n params = params.set('orientation', options?.orientation);\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(\n `${this.collectionsUrl}/${id}/photos`,\n config\n );\n\n return this.http.get<Photo[]>(url, { headers, params });\n })\n );\n }\n\n /**\n * [List related collections](https://unsplash.com/documentation#list-a-collections-related-collections).\n * Retrieve a list of collections related to a particular one.\n *\n * @param id of the collection to retrieve related collections from\n *\n * @returns Observable containing a {@link Collection} array\n *\n * @throws Error if the collection id is not provided\n * @throws Error if the Unsplash configuration is not provided\n */\n relatedCollections(id: string): Observable<Collection[]> {\n return this.config$.pipe(\n mergeMap((config) => {\n if (!id) {\n throw new Error('Collection id undefined');\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(\n `${this.collectionsUrl}/${id}/related`,\n config\n );\n\n return this.http.get<Collection[]>(url, { headers });\n })\n );\n }\n\n /**\n * [List topics](https://unsplash.com/documentation#list-topics).\n * Retrieve a list of topics.\n *\n * @param options to be used when getting topics\n *\n * @returns Observable containing a {@link Topic} array\n */\n topics(options?: {\n ids?: string[];\n page?: number;\n perPage?: number;\n orderBy?: UnsplashFeaturedOrderBy;\n }): Observable<Topic[]> {\n return this.config$.pipe(\n mergeMap((config) => {\n let params = new HttpParams();\n\n if (options?.ids) {\n params = params.set('ids', options?.ids.join(','));\n }\n\n if (options?.page) {\n params = params.set('page', options?.page);\n }\n\n if (options?.perPage) {\n params = params.set('per_page', options?.perPage);\n }\n\n if (options?.orderBy) {\n params = params.set('order_by', options?.orderBy);\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(this.topicsUrl, config);\n\n return this.http.get<Topic[]>(url, { headers, params });\n })\n );\n }\n\n /**\n * [Get a topic](https://unsplash.com/documentation#get-a-topic).\n * Retrieve a single topic.\n *\n * @param id of the topic to retrieve\n *\n * @returns Observable containing a {@link Topic}\n *\n * @throws Error if the topic id is not provided\n * @throws Error if the Unsplash configuration is not provided\n */\n topic(id: string): Observable<Topic> {\n return this.config$.pipe(\n mergeMap((config) => {\n if (!id) {\n throw new Error('Topic id undefined');\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(`${this.topicsUrl}/${id}`, config);\n\n return this.http.get<Topic>(url, { headers });\n })\n );\n }\n\n /**\n * [Get a topic's photos](https://unsplash.com/documentation#get-a-topics-photos).\n * Retrieve a list of photos in a topic.\n *\n * @param id of the topic to retrieve photos from\n * @param options to be used when getting photos from a topic\n *\n * @returns Observable containing a {@link Photo} array\n *\n * @throws Error if the topic id is not provided\n * @throws Error if the Unsplash configuration is not provided\n */\n topicPhotos(\n id: string,\n options?: {\n page?: number;\n perPage?: number;\n orientation?: UnsplashOrientation;\n orderBy?: UnsplashOrderBy;\n }\n ): Observable<Photo[]> {\n return this.config$.pipe(\n mergeMap((config) => {\n if (!id) {\n throw new Error('Topic id undefined');\n }\n\n let params = new HttpParams();\n\n if (options?.page) {\n params = params.set('page', options?.page);\n }\n\n if (options?.perPage) {\n params = params.set('per_page', options?.perPage);\n }\n\n if (options?.orientation) {\n params = params.set('orientation', options?.orientation);\n }\n\n if (options?.orderBy) {\n params = params.set('order_by', options?.orderBy);\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(`${this.topicsUrl}/${id}/photos`, config);\n\n return this.http.get<Photo[]>(url, { headers, params });\n })\n );\n }\n\n /**\n * [Get a user](https://unsplash.com/documentation#get-a-user).\n * Retrieve public details on a given user.\n *\n * @param username of the user to retrieve\n *\n * @returns Observable containing a {@link User}\n *\n * @throws Error if the user username is not provided\n * @throws Error if the Unsplash configuration is not provided\n */\n user(username: string): Observable<User> {\n return this.config$.pipe(\n mergeMap((config) => {\n if (!username) {\n throw new Error('User username undefined');\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(`${this.usersUrl}/${username}`, config);\n\n return this.http.get<User>(url, { headers });\n })\n );\n }\n\n /**\n * [Get a user's portfolio link](https://unsplash.com/documentation#get-a-users-portfolio-link).\n * Retrieve a single user’s portfolio link.\n *\n * @param username of the user to retrieve portfolio link from\n *\n * @returns Observable containing a {@link User}\n *\n * @throws Error if the user username is not provided\n * @throws Error if the Unsplash configuration is not provided\n */\n userPortfolio(username: string): Observable<string | undefined> {\n return this.config$.pipe(\n mergeMap((config) => {\n if (!username) {\n throw new Error('User username undefined');\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(\n `${this.usersUrl}/${username}/portfolio`,\n config\n );\n\n return this.http.get<{ url: string }>(url, { headers });\n }),\n map((response) => response.url)\n );\n }\n\n /**\n * [List a user’s photos](https://unsplash.com/documentation#list-a-users-photos).\n * Retrieve a list of photos uploaded by a user.\n *\n * @param username of the user to retrieve photos from\n * @param options to be used when getting photos from a user\n *\n * @returns Observable containing a {@link Photo} array\n *\n * @throws Error if the user username is not provided\n * @throws Error if the Unsplash configuration is not provided\n */\n userPhotos(\n username: string,\n options?: {\n page?: number;\n perPage?: number;\n orderBy?: UnsplashOrderBy;\n stats?: boolean;\n resolution?: UnsplashResolution;\n quantity?: number;\n orientation?: UnsplashOrientation;\n }\n ): Observable<Photo[]> {\n return this.config$.pipe(\n mergeMap((config) => {\n if (!username) {\n throw new Error('User username undefined');\n }\n\n let params = new HttpParams();\n\n if (options?.page) {\n params = params.set('page', options?.page);\n }\n\n if (options?.perPage) {\n params = params.set('per_page', options?.perPage);\n }\n\n if (options?.orderBy) {\n params = params.set('order_by', options?.orderBy);\n }\n\n if (options?.stats) {\n params = params.set('stats', options?.stats);\n }\n\n if (options?.resolution) {\n params = params.set('resolution', options?.resolution);\n }\n\n if (options?.quantity) {\n params = params.set('quantity', options?.quantity);\n }\n\n if (options?.orientation) {\n params = params.set('orientation', options?.orientation);\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(\n `${this.usersUrl}/${username}/photos`,\n config\n );\n\n return this.http.get<Photo[]>(url, { headers, params });\n })\n );\n }\n\n /**\n * [List a user’s liked photos](https://unsplash.com/documentation#list-a-users-liked-photos).\n * Retrieve a list of photos liked by a user.\n *\n * @param username of the user to retrieve liked photos from\n * @param options to be used when getting liked photos from a user\n *\n * @returns Observable containing a {@link Photo} array\n *\n * @throws Error if the user username is not provided\n * @throws Error if the Unsplash configuration is not provided\n */\n userLikes(\n username: string,\n options?: {\n page?: number;\n perPage?: number;\n orderBy?: UnsplashOrderBy;\n }\n ): Observable<Photo[]> {\n return this.config$.pipe(\n mergeMap((config) => {\n if (!username) {\n throw new Error('User username undefined');\n }\n\n let params = new HttpParams();\n\n if (options?.page) {\n params = params.set('page', options?.page);\n }\n\n if (options?.perPage) {\n params = params.set('per_page', options?.perPage);\n }\n\n if (options?.orderBy) {\n params = params.set('order_by', options?.orderBy);\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(\n `${this.usersUrl}/${username}/likes`,\n config\n );\n\n return this.http.get<Photo[]>(url, { headers, params });\n })\n );\n }\n\n /**\n * [List a user’s collections](https://unsplash.com/documentation#list-a-users-collections).\n * Retrieve a list of collections created by the user.\n *\n * @param username of the user to retrieve collections from\n * @param options to be used when getting collections from a user\n *\n * @returns Observable containing a {@link Collection} array\n *\n * @throws Error if the user username is not provided\n * @throws Error if the Unsplash configuration is not provided\n */\n userCollections(\n username: string,\n options?: {\n page?: number;\n perPage?: number;\n orderBy?: UnsplashOrderBy;\n }\n ): Observable<Collection[]> {\n return this.config$.pipe(\n mergeMap((config) => {\n if (!username) {\n throw new Error('User username undefined');\n }\n\n let params = new HttpParams();\n\n if (options?.page) {\n params = params.set('page', options?.page);\n }\n\n if (options?.perPage) {\n params = params.set('per_page', options?.perPage);\n }\n\n if (options?.orderBy) {\n params = params.set('order_by', options?.orderBy);\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(\n `${this.usersUrl}/${username}/collections`,\n config\n );\n\n return this.http.get<Collection[]>(url, { headers, params });\n })\n );\n }\n\n /**\n * [Get a user’s statistics](https://unsplash.com/documentation#get-a-users-statistics).\n * Retrieve total number of downloads, views and likes of all user’s photos, as well as the historical breakdown and average of these stats in a specific time frame (default is 30 days).\n *\n * @param username of the user to retrieve statistics from\n * @param options to be used when getting statistics from a user\n *\n * @returns Observable containing a {@link UserStatistics} object\n *\n * @throws Error if the user username is not provided\n * @throws Error if the Unsplash configuration is not provided\n */\n userStatistics(\n username: string,\n options?: {\n resolution?: UnsplashResolution;\n quantity?: number;\n }\n ): Observable<UserStatistics> {\n return this.config$.pipe(\n mergeMap((config) => {\n if (!username) {\n throw new Error('User username undefined');\n }\n\n let params = new HttpParams();\n\n if (options?.resolution) {\n params = params.set('resolution', options?.resolution);\n }\n\n if (options?.quantity) {\n params = params.set('quantity', options?.quantity);\n }\n\n const headers = this.unsplashHeaders(config);\n\n const url = this.unsplashUrl(\n `${this.usersUrl}/${username}/statistics`,\n config\n );\n\n return this.http.get<UserStatistics>(url, { headers, params });\n })\n );\n }\n\n private unsplashUrl(url: string, config: UnsplashConfig): string {\n return new URL(\n url,\n config.url.endsWith('/') ? config.url : config.url + '/'\n ).toString();\n }\n\n private unsplashHeaders(config: UnsplashConfig): HttpHeaders {\n return new HttpHeaders().set('authorization', config.authorization);\n }\n}\n","/*\n * Public API Surface of ngx-unsplash\n */\n\nexport * from './lib/model/collection';\nexport * from './lib/model/download';\nexport * from './lib/model/photo';\nexport * from './lib/model/search-result';\nexport * from './lib/model/statistics';\nexport * from './lib/model/topic';\nexport * from './lib/model/types';\nexport * from './lib/model/user';\nexport * from './lib/pipes/blurhash.pipe';\nexport * from './lib/unsplash.module';\nexport * from './lib/unsplash.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAKA,MAGa,YAAY,CAAA;AACvB;;;;;;;;;AASG;AACH,IAAA,SAAS,CACP,KAAY,EACZ,IAAA,GAAuD,OAAO,EAAA;AAE9D,QAAA,OAAO,IAAI,UAAU,CAAS,CAAC,QAAQ,KAAI;;AAEzC,YAAA,QAAQ,C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