import { Observable } from 'rxjs'; import { HttpClient } from '@angular/common/http'; import { Review } from './app.models'; /** * @module * @ignore */ export declare class ApiConnectionService { private http; private apiHeaders; private version; private person_url; private person_recover_token_url; private person_recover_verify_url; private person_auth_url; private personNewsUrl; private personNewsSeenUrl; private favorites_url; private fav_del_url; private check_favorite_url; private purchases_url; private consumeUrl; private reviews_url; private wasstore_url; private bluesnapTokenUrl; private bluesnapShopperUrl; private bluesnapWalletUrl; private adVideoStartUrl; private adVideoEndUrl; private highscoreUrl; private leaderboardUrl; constructor(http: HttpClient); cookie_read(name: string): any; cookie_write(name: string, value: string, days?: number): void; cookie_remove(name: string): void; handleHeaders(password?: string): void; private handleError; private extractData; private extractVerifyData; b64EncodeUnicode(str: string): string; encode_query_string(_obj: any): string; createPerson(apiobject: any): Observable; /** * Return a list of newsfeed items. * * @param _params {"user_id": string} */ getNewsfeed(_params: any): Observable; /** * Add an action to another user e.g. show an alert to the other person. * * @param user_id * @param to_username * @param news_ids * @param [global_news_ids] */ setNewsfeed(user_id: string, to_username: string, action: string): Observable; /** * Sets news items as seen. * * @param user_id * @param news_ids * @param [global_news_ids] */ seenNewsfeed(user_id: string, news_ids: string[], global_news_ids?: number[]): Observable; /** * Return a list of favorite apps. * * @param [_params] {"user_id": string} * @returns Success or failure status code and message. {favorites:[{app},...]} */ checkFavorite(_params?: any): Observable; /** * Return a list of favorite apps. * * @param [_params] {"user_id": string} * @returns Success or failure status code and message. {favorites:[{app},...]} */ getFavorites(_params?: any): Observable; /** * Add an app to list of favorite apps. * * @param user_id The user id. * @param [storeapp_id] This is only sent in from WickeyAppStore (on actual app sites it uses the hostname). * @returns Success or failure status code and message. {favorites:[{app},...]} */ setFavorite(user_id: string, storeapp_id?: number): Observable; /** * Remove an app from the list of favorite apps. * * @param user_id The user id. * @param [storeapp_id] This is only sent in from WickeyAppStore (on actual app sites it uses the hostname). * @returns Success or failure status code and message. {favorites:[{app},...]} */ deleteFavorite(user_id: string, storeapp_id?: number): Observable; tokenPerson(email: string, user_id: string): Observable; verifyPerson(email: string, user_id: string, verification_token: string, version?: number, password?: string): Observable; /** * Set or change a password of a user. * * @param user_id string: The user id. * @param password string: The raw password. * @param new_password string: OPTIONAL The new password on password changes. * @returns Success or failure status code and message. */ authPerson(user_id: string, password: string, new_password?: string): Observable; /** * Returns a list of reviews for a store app. * * @example * this.apiConnectionService.getReviews({'storeapp_id': this.selected_app.id}).subscribe((_reviews: any) => { }); * @param _params {"storeapp_id": number}: OPTIONAL storeapp_id (id of the storeapp) * @returns List of reviews [{"id":number,"title":string,"text":string,"rating":number,"last_modified":number},..] */ getReviews(_params?: any): Observable<[Review]>; /** * Creates a new review or edits an existing one. * * @example * this.apiConnectionService.setReview({'user_id':string,'title':string,'text':string,'rating':number}).subscribe((_data: any) => { }); * @param _review {'user_id':string,'title':string,'text':string,'rating':number} */ setReview(_params: any): Observable; /** * Returns a list of inapps for the app. * * @example * this.apiConnectionService.getInapps().subscribe((_inapps: any) => { }); * @param [_params] {user_id: }. * @returns List of inapps */ getInapps(_params?: any): Observable; /** * Creates a new purchase. * * @example * this.apiConnectionService.setPurchase( * {'user_id':string,'purchase_id':string,'receipt':string,'pay_amount':number,'email':string,'first_name':string, * 'last_name':string,'zip_code':string,'apple_wallet_token'?:string} * ).subscribe((_data: any) => { }); * @param _params {*}: The parameters listed in the example. * @returns Returns a standard user object (same as createPerson) */ setPurchase(_params: any): Observable; /** * Consumes coins recieved from purchases or videos. * * @example * this.apiConnectionService.consumeCoins({'user_id':string,'coins':number,'reason'?:string}).subscribe((_data: any) => { }); * @param _params {user_id: string, coins: number, reason?: string} * @returns Returns a standard user object (same as createPerson) */ consumeCoins(_params: { user_id: string; coins: number; reason?: string; }): Observable; /** * Returns a BlueSnap hosted field token */ getBluesnapToken(): Observable<{ token: string; }>; /** * Returns an encrypted shopper token in `token`, post to to BlueSnap via `enc=this_returned_token` */ getBluesnapShopper(_shopper_id: number): Observable<{ token: string; }>; /** * Returns a BlueSnap Wallet token. (Used with ApplePay) * https://developers.bluesnap.com/v8976-Basics/docs/apple-pay#section-step-4-verify-your-domain * * @param _validation_url The `event.validationURL` from the BlueSnap onvalidatemerchant callback * @returns the auth token, an object. */ getBluesnapWallet(_validation_url: string): Observable<{ token: string; }>; /** * Notifies the server that a video ad has started by this user and video id. */ adVideoStart(user_id: string, video_id: string): Observable; /** * Notifies the server that a video ad has ended by this user and video id. */ adVideoEnd(user_id: string, video_id: string): Observable; /** * Gets a value(s) for requested key(s). * * @example * this.apiConnectionService.getWASStore( * {'user_id':string,'keys':string} * ).subscribe((_data: any) => { }); * @param _params string: user_id, string: keys where keys is a single key or a comma separated string of keys (keys='key1,') * @returns Returns a standard user object with was_data. */ getWASStore(_params: { user_id: string; keys: string; }): Observable<{}>; /** * Stores/Updates all values to respective key in passed in json was_data. * * @example * this.apiConnectionService.setWASStore( * {'user_id':string,'was_data':{key:value,...}} * ).subscribe((_data: any) => { }); * @param _params string: user_id, json: was_data where was_data is format {key:value,...} * @returns Returns a standard user object with was_data. */ setWASStore(_params: { user_id: string; was_data: {}; }): Observable; /** * Deletes a value(s) for the requested key(s). * * @example * this.apiConnectionService.deleteWASStore( * {'user_id':string,'keys':string} * ).subscribe((_data: any) => { }); * @param _params string: user_id, string: keys where keys is a single key or a comma separated string of keys (keys='key1,') * @returns Returns a standard user object. */ deleteWASStore(_params: { user_id: string; keys: string; }): Observable; /** * Get the leaderboard for app. Optional pass in username to return rank of user. * * @example * this.apiConnectionService.getLeaderboard().subscribe((_data: any) => { }); * @param _params string: username, * @returns Returns a leaderboard list (optional: and score and rank of passed in username). */ getLeaderboard(_params: { username?: string; }): Observable<{ leaderboard: [any]; rank?: number; score?: number; name?: string; icon?: string; }>; /** * Stores/Updates the highscore of user. * * @example * this.apiConnectionService.setHighscore( * {'user_id':string,'highscore':number} * ).subscribe((_data: any) => { }); * @param _params string: user_id, json: was_data where was_data is format {key:value,...} * @returns Returns rank of user. */ setHighscore(_params: { user_id: string; highscore: number; }): Observable<{ status: number; rank?: number; }>; } //# sourceMappingURL=api-connection.service.d.ts.map