UNPKG

5.9 kBTypeScriptView Raw
1import basem = require('./ClientApiBases');
2import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
3import ProfileInterfaces = require("./interfaces/ProfileInterfaces");
4import VSSInterfaces = require("./interfaces/common/VSSInterfaces");
5export interface IProfileApi extends basem.ClientApiBase {
6 deleteProfileAttribute(id: string, descriptor: string): Promise<void>;
7 getProfileAttribute(id: string, descriptor: string): Promise<ProfileInterfaces.ProfileAttribute>;
8 getProfileAttributes(id: string, partition: string, modifiedSince?: string, modifiedAfterRevision?: string, withCoreAttributes?: boolean, coreAttributes?: string): Promise<ProfileInterfaces.ProfileAttribute[]>;
9 setProfileAttribute(container: any, id: string, descriptor: string): Promise<void>;
10 setProfileAttributes(attributesCollection: VSSInterfaces.VssJsonCollectionWrapperV<ProfileInterfaces.ProfileAttributeBase<any>[]>, id: string): Promise<void>;
11 getAvatar(id: string, size?: string, format?: string): Promise<ProfileInterfaces.Avatar>;
12 getAvatarPreview(container: any, id: string, size?: string, format?: string, displayName?: string): Promise<ProfileInterfaces.Avatar>;
13 resetAvatar(id: string): Promise<void>;
14 setAvatar(container: any, id: string): Promise<void>;
15 getGeoRegion(ipaddress: string): Promise<ProfileInterfaces.GeoRegion>;
16 createProfile(createProfileContext: ProfileInterfaces.CreateProfileContext, autoCreate?: boolean): Promise<ProfileInterfaces.Profile>;
17 getProfile(id: string, details?: boolean, withAttributes?: boolean, partition?: string, coreAttributes?: string, forceRefresh?: boolean): Promise<ProfileInterfaces.Profile>;
18 updateProfile(profile: ProfileInterfaces.Profile, id: string): Promise<void>;
19 getRegions(): Promise<ProfileInterfaces.ProfileRegions>;
20 getSupportedLcids(): Promise<string[]>;
21 getUserDefaults(includeAvatar?: boolean): Promise<ProfileInterfaces.Profile>;
22 refreshUserDefaults(id: string): Promise<ProfileInterfaces.Profile>;
23}
24export declare class ProfileApi extends basem.ClientApiBase implements IProfileApi {
25 constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], options?: VsoBaseInterfaces.IRequestOptions);
26 /**
27 * @param {string} id
28 * @param {string} descriptor
29 */
30 deleteProfileAttribute(id: string, descriptor: string): Promise<void>;
31 /**
32 * @param {string} id
33 * @param {string} descriptor
34 */
35 getProfileAttribute(id: string, descriptor: string): Promise<ProfileInterfaces.ProfileAttribute>;
36 /**
37 * @param {string} id
38 * @param {string} partition
39 * @param {string} modifiedSince
40 * @param {string} modifiedAfterRevision
41 * @param {boolean} withCoreAttributes
42 * @param {string} coreAttributes
43 */
44 getProfileAttributes(id: string, partition: string, modifiedSince?: string, modifiedAfterRevision?: string, withCoreAttributes?: boolean, coreAttributes?: string): Promise<ProfileInterfaces.ProfileAttribute[]>;
45 /**
46 * @param {any} container
47 * @param {string} id
48 * @param {string} descriptor
49 */
50 setProfileAttribute(container: any, id: string, descriptor: string): Promise<void>;
51 /**
52 * @param {VSSInterfaces.VssJsonCollectionWrapperV<ProfileInterfaces.ProfileAttributeBase<any>[]>} attributesCollection
53 * @param {string} id
54 */
55 setProfileAttributes(attributesCollection: VSSInterfaces.VssJsonCollectionWrapperV<ProfileInterfaces.ProfileAttributeBase<any>[]>, id: string): Promise<void>;
56 /**
57 * @param {string} id
58 * @param {string} size
59 * @param {string} format
60 */
61 getAvatar(id: string, size?: string, format?: string): Promise<ProfileInterfaces.Avatar>;
62 /**
63 * @param {any} container
64 * @param {string} id
65 * @param {string} size
66 * @param {string} format
67 * @param {string} displayName
68 */
69 getAvatarPreview(container: any, id: string, size?: string, format?: string, displayName?: string): Promise<ProfileInterfaces.Avatar>;
70 /**
71 * @param {string} id
72 */
73 resetAvatar(id: string): Promise<void>;
74 /**
75 * @param {any} container
76 * @param {string} id
77 */
78 setAvatar(container: any, id: string): Promise<void>;
79 /**
80 * Lookup up country/region based on provided IPv4, null if using the remote IPv4 address.
81 *
82 * @param {string} ipaddress - IPv4 address to be used for reverse lookup, null if using RemoteIPAddress in request context
83 */
84 getGeoRegion(ipaddress: string): Promise<ProfileInterfaces.GeoRegion>;
85 /**
86 * Create profile
87 *
88 * @param {ProfileInterfaces.CreateProfileContext} createProfileContext - Context for profile creation
89 * @param {boolean} autoCreate - Create profile automatically
90 */
91 createProfile(createProfileContext: ProfileInterfaces.CreateProfileContext, autoCreate?: boolean): Promise<ProfileInterfaces.Profile>;
92 /**
93 * @param {string} id
94 * @param {boolean} details
95 * @param {boolean} withAttributes
96 * @param {string} partition
97 * @param {string} coreAttributes
98 * @param {boolean} forceRefresh
99 */
100 getProfile(id: string, details?: boolean, withAttributes?: boolean, partition?: string, coreAttributes?: string, forceRefresh?: boolean): Promise<ProfileInterfaces.Profile>;
101 /**
102 * Update profile
103 *
104 * @param {ProfileInterfaces.Profile} profile - Update profile
105 * @param {string} id - Profile ID
106 */
107 updateProfile(profile: ProfileInterfaces.Profile, id: string): Promise<void>;
108 /**
109 */
110 getRegions(): Promise<ProfileInterfaces.ProfileRegions>;
111 /**
112 */
113 getSupportedLcids(): Promise<string[]>;
114 /**
115 * @param {boolean} includeAvatar
116 */
117 getUserDefaults(includeAvatar?: boolean): Promise<ProfileInterfaces.Profile>;
118 /**
119 * @param {string} id
120 */
121 refreshUserDefaults(id: string): Promise<ProfileInterfaces.Profile>;
122}