1 | import IdentitiesInterfaces = require("../interfaces/IdentitiesInterfaces");
|
2 | export interface AadGraphMember extends GraphMember {
|
3 | /**
|
4 | * The short, generally unique name for the user in the backing directory. For AAD users, this corresponds to the mail nickname, which is often but not necessarily similar to the part of the user's mail address before the @ sign. For GitHub users, this corresponds to the GitHub user handle.
|
5 | */
|
6 | directoryAlias?: string;
|
7 | /**
|
8 | * When true, the group has been deleted in the identity provider
|
9 | */
|
10 | isDeletedInOrigin?: boolean;
|
11 | metadataUpdateDate?: Date;
|
12 | /**
|
13 | * The meta type of the user in the origin, such as "member", "guest", etc. See UserMetaType for the set of possible values.
|
14 | */
|
15 | metaType?: string;
|
16 | }
|
17 | export interface GraphCachePolicies {
|
18 | /**
|
19 | * Size of the cache
|
20 | */
|
21 | cacheSize?: number;
|
22 | }
|
23 | /**
|
24 | * Subject descriptor of a Graph entity
|
25 | */
|
26 | export interface GraphDescriptorResult {
|
27 | /**
|
28 | * This field contains zero or more interesting links about the graph descriptor. These links may be invoked to obtain additional relationships or more detailed information about this graph descriptor.
|
29 | */
|
30 | _links?: any;
|
31 | value?: string;
|
32 | }
|
33 | /**
|
34 | * Represents a set of data used to communicate with a federated provider on behalf of a particular user.
|
35 | */
|
36 | export interface GraphFederatedProviderData {
|
37 | /**
|
38 | * The access token that can be used to communicated with the federated provider on behalf on the target identity, if we were able to successfully acquire one, otherwise <code>null</code>, if we were not.
|
39 | */
|
40 | accessToken?: string;
|
41 | /**
|
42 | * The name of the federated provider, e.g. "github.com".
|
43 | */
|
44 | providerName?: string;
|
45 | /**
|
46 | * The descriptor of the graph subject to which this federated provider data corresponds.
|
47 | */
|
48 | subjectDescriptor?: string;
|
49 | /**
|
50 | * The version number of this federated provider data, which corresponds to when it was last updated. Can be used to prevent returning stale provider data from the cache when the caller is aware of a newer version, such as to prevent local cache poisoning from a remote cache or store. This is the app layer equivalent of the data layer sequence ID.
|
51 | */
|
52 | version?: number;
|
53 | }
|
54 | export interface GraphGlobalExtendedPropertyBatch {
|
55 | propertyNameFilters?: string[];
|
56 | subjectDescriptors?: string[];
|
57 | }
|
58 | /**
|
59 | * Graph group entity
|
60 | */
|
61 | export interface GraphGroup extends GraphMember {
|
62 | /**
|
63 | * A short phrase to help human readers disambiguate groups with similar names
|
64 | */
|
65 | description?: string;
|
66 | isCrossProject?: boolean;
|
67 | isDeleted?: boolean;
|
68 | isGlobalScope?: boolean;
|
69 | isRestrictedVisible?: boolean;
|
70 | localScopeId?: string;
|
71 | scopeId?: string;
|
72 | scopeName?: string;
|
73 | scopeType?: string;
|
74 | securingHostId?: string;
|
75 | specialType?: string;
|
76 | }
|
77 | /**
|
78 | * Do not attempt to use this type to create a new group. This type does not contain sufficient fields to create a new group.
|
79 | */
|
80 | export interface GraphGroupCreationContext {
|
81 | /**
|
82 | * Optional: If provided, we will use this identifier for the storage key of the created group
|
83 | */
|
84 | storageKey?: string;
|
85 | }
|
86 | /**
|
87 | * Use this type to create a new group using the mail address as a reference to an existing group from an external AD or AAD backed provider. This is the subset of GraphGroup fields required for creation of a group for the AAD and AD use case.
|
88 | */
|
89 | export interface GraphGroupMailAddressCreationContext extends GraphGroupCreationContext {
|
90 | /**
|
91 | * This should be the mail address or the group in the source AD or AAD provider. Example: jamal@contoso.com Team Services will communicate with the source provider to fill all other fields on creation.
|
92 | */
|
93 | mailAddress: string;
|
94 | }
|
95 | /**
|
96 | * Use this type to create a new group using the OriginID as a reference to an existing group from an external AD or AAD backed provider. This is the subset of GraphGroup fields required for creation of a group for the AD and AAD use case.
|
97 | */
|
98 | export interface GraphGroupOriginIdCreationContext extends GraphGroupCreationContext {
|
99 | /**
|
100 | * This should be the object id or sid of the group from the source AD or AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Team Services will communicate with the source provider to fill all other fields on creation.
|
101 | */
|
102 | originId: string;
|
103 | }
|
104 | /**
|
105 | * Use this type to create a new Vsts group that is not backed by an external provider.
|
106 | */
|
107 | export interface GraphGroupVstsCreationContext extends GraphGroupCreationContext {
|
108 | /**
|
109 | * For internal use only in back compat scenarios.
|
110 | */
|
111 | crossProject?: boolean;
|
112 | /**
|
113 | * Used by VSTS groups; if set this will be the group description, otherwise ignored
|
114 | */
|
115 | description?: string;
|
116 | descriptor?: string;
|
117 | /**
|
118 | * Used by VSTS groups; if set this will be the group DisplayName, otherwise ignored
|
119 | */
|
120 | displayName: string;
|
121 | /**
|
122 | * For internal use only in back compat scenarios.
|
123 | */
|
124 | restrictedVisibility?: boolean;
|
125 | /**
|
126 | * For internal use only in back compat scenarios.
|
127 | */
|
128 | specialGroupType?: string;
|
129 | }
|
130 | export interface GraphMember extends GraphSubject {
|
131 | /**
|
132 | * This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc)
|
133 | */
|
134 | domain?: string;
|
135 | /**
|
136 | * The email address of record for a given graph member. This may be different than the principal name.
|
137 | */
|
138 | mailAddress?: string;
|
139 | /**
|
140 | * This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS.
|
141 | */
|
142 | principalName?: string;
|
143 | }
|
144 | /**
|
145 | * Relationship between a container and a member
|
146 | */
|
147 | export interface GraphMembership {
|
148 | /**
|
149 | * This field contains zero or more interesting links about the graph membership. These links may be invoked to obtain additional relationships or more detailed information about this graph membership.
|
150 | */
|
151 | _links?: any;
|
152 | containerDescriptor?: string;
|
153 | memberDescriptor?: string;
|
154 | }
|
155 | /**
|
156 | * Status of a Graph membership (active/inactive)
|
157 | */
|
158 | export interface GraphMembershipState {
|
159 | /**
|
160 | * This field contains zero or more interesting links about the graph membership state. These links may be invoked to obtain additional relationships or more detailed information about this graph membership state.
|
161 | */
|
162 | _links?: any;
|
163 | /**
|
164 | * When true, the membership is active
|
165 | */
|
166 | active?: boolean;
|
167 | }
|
168 | export interface GraphMembershipTraversal {
|
169 | /**
|
170 | * Reason why the subject could not be traversed completely
|
171 | */
|
172 | incompletenessReason?: string;
|
173 | /**
|
174 | * When true, the subject is traversed completely
|
175 | */
|
176 | isComplete?: boolean;
|
177 | /**
|
178 | * The traversed subject descriptor
|
179 | */
|
180 | subjectDescriptor?: string;
|
181 | /**
|
182 | * Subject descriptor ids of the traversed members
|
183 | */
|
184 | traversedSubjectIds?: string[];
|
185 | /**
|
186 | * Subject descriptors of the traversed members
|
187 | */
|
188 | traversedSubjects?: string[];
|
189 | }
|
190 | /**
|
191 | * Who is the provider for this user and what is the identifier and domain that is used to uniquely identify the user.
|
192 | */
|
193 | export interface GraphProviderInfo {
|
194 | /**
|
195 | * The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.
|
196 | */
|
197 | descriptor?: string;
|
198 | /**
|
199 | * This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AAD the tenantID of the directory.)
|
200 | */
|
201 | domain?: string;
|
202 | /**
|
203 | * The type of source provider for the origin identifier (ex: "aad", "msa")
|
204 | */
|
205 | origin?: string;
|
206 | /**
|
207 | * The unique identifier from the system of origin. (For MSA this is the PUID in hex notation, for AAD this is the object id.)
|
208 | */
|
209 | originId?: string;
|
210 | }
|
211 | /**
|
212 | * Container where a graph entity is defined (organization, project, team)
|
213 | */
|
214 | export interface GraphScope extends GraphSubject {
|
215 | /**
|
216 | * The subject descriptor that references the administrators group for this scope. Only members of this group can change the contents of this scope or assign other users permissions to access this scope.
|
217 | */
|
218 | administratorDescriptor?: string;
|
219 | /**
|
220 | * When true, this scope is also a securing host for one or more scopes.
|
221 | */
|
222 | isGlobal?: boolean;
|
223 | /**
|
224 | * The subject descriptor for the closest account or organization in the ancestor tree of this scope.
|
225 | */
|
226 | parentDescriptor?: string;
|
227 | /**
|
228 | * The type of this scope. Typically ServiceHost or TeamProject.
|
229 | */
|
230 | scopeType?: IdentitiesInterfaces.GroupScopeType;
|
231 | /**
|
232 | * The subject descriptor for the containing organization in the ancestor tree of this scope.
|
233 | */
|
234 | securingHostDescriptor?: string;
|
235 | }
|
236 | /**
|
237 | * This type is the subset of fields that can be provided by the user to create a Vsts scope. Scope creation is currently limited to internal back-compat scenarios. End users that attempt to create a scope with this API will fail.
|
238 | */
|
239 | export interface GraphScopeCreationContext {
|
240 | /**
|
241 | * Set this field to override the default description of this scope's admin group.
|
242 | */
|
243 | adminGroupDescription?: string;
|
244 | /**
|
245 | * All scopes have an Administrator Group that controls access to the contents of the scope. Set this field to use a non-default group name for that administrators group.
|
246 | */
|
247 | adminGroupName?: string;
|
248 | /**
|
249 | * Set this optional field if this scope is created on behalf of a user other than the user making the request. This should be the Id of the user that is not the requester.
|
250 | */
|
251 | creatorId?: string;
|
252 | /**
|
253 | * The scope must be provided with a unique name within the parent scope. This means the created scope can have a parent or child with the same name, but no siblings with the same name.
|
254 | */
|
255 | name?: string;
|
256 | /**
|
257 | * The type of scope being created.
|
258 | */
|
259 | scopeType?: IdentitiesInterfaces.GroupScopeType;
|
260 | /**
|
261 | * An optional ID that uniquely represents the scope within it's parent scope. If this parameter is not provided, Vsts will generate on automatically.
|
262 | */
|
263 | storageKey?: string;
|
264 | }
|
265 | export interface GraphServicePrincipal extends AadGraphMember {
|
266 | applicationId?: string;
|
267 | }
|
268 | /**
|
269 | * Do not attempt to use this type to create a new service principal. Use one of the subclasses instead. This type does not contain sufficient fields to create a new service principal.
|
270 | */
|
271 | export interface GraphServicePrincipalCreationContext {
|
272 | /**
|
273 | * Optional: If provided, we will use this identifier for the storage key of the created service principal
|
274 | */
|
275 | storageKey?: string;
|
276 | }
|
277 | /**
|
278 | * Use this type to create a new service principal using the OriginID as a reference to an existing service principal from an external AAD backed provider. This is the subset of GraphServicePrincipal fields required for creation of a GraphServicePrincipal for the AAD use case when looking up the service principal by its unique ID in the backing provider.
|
279 | */
|
280 | export interface GraphServicePrincipalOriginIdCreationContext extends GraphServicePrincipalCreationContext {
|
281 | /**
|
282 | * This should be the object id of the service principal from the AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Team Services will communicate with the source provider to fill all other fields on creation.
|
283 | */
|
284 | originId: string;
|
285 | }
|
286 | /**
|
287 | * Use this type to update an existing service principal using the OriginID as a reference to an existing service principal from an external AAD backed provider. This is the subset of GraphServicePrincipal fields required for creation of a GraphServicePrincipal for AAD use case when looking up the service principal by its unique ID in the backing provider.
|
288 | */
|
289 | export interface GraphServicePrincipalOriginIdUpdateContext extends GraphServicePrincipalUpdateContext {
|
290 | /**
|
291 | * This should be the object id or sid of the service principal from the source AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Azure Devops will communicate with the source provider to fill all other fields on creation.
|
292 | */
|
293 | originId: string;
|
294 | }
|
295 | /**
|
296 | * Do not attempt to use this type to update service principal. Use one of the subclasses instead. This type does not contain sufficient fields to create a new service principal.
|
297 | */
|
298 | export interface GraphServicePrincipalUpdateContext {
|
299 | /**
|
300 | * Storage key should not be specified in case of updating service principal
|
301 | */
|
302 | storageKey?: string;
|
303 | }
|
304 | /**
|
305 | * Storage key of a Graph entity
|
306 | */
|
307 | export interface GraphStorageKeyResult {
|
308 | /**
|
309 | * This field contains zero or more interesting links about the graph storage key. These links may be invoked to obtain additional relationships or more detailed information about this graph storage key.
|
310 | */
|
311 | _links?: any;
|
312 | value?: string;
|
313 | }
|
314 | /**
|
315 | * Top-level graph entity
|
316 | */
|
317 | export interface GraphSubject extends GraphSubjectBase {
|
318 | /**
|
319 | * [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor.
|
320 | */
|
321 | legacyDescriptor?: string;
|
322 | /**
|
323 | * The type of source provider for the origin identifier (ex:AD, AAD, MSA)
|
324 | */
|
325 | origin?: string;
|
326 | /**
|
327 | * The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.
|
328 | */
|
329 | originId?: string;
|
330 | /**
|
331 | * This field identifies the type of the graph subject (ex: Group, Scope, User).
|
332 | */
|
333 | subjectKind?: string;
|
334 | }
|
335 | export interface GraphSubjectBase {
|
336 | /**
|
337 | * This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.
|
338 | */
|
339 | _links?: any;
|
340 | /**
|
341 | * The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.
|
342 | */
|
343 | descriptor?: string;
|
344 | /**
|
345 | * This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.
|
346 | */
|
347 | displayName?: string;
|
348 | /**
|
349 | * This url is the full route to the source resource of this graph subject.
|
350 | */
|
351 | url?: string;
|
352 | }
|
353 | /**
|
354 | * Batching of subjects to lookup using the Graph API
|
355 | */
|
356 | export interface GraphSubjectLookup {
|
357 | lookupKeys?: GraphSubjectLookupKey[];
|
358 | }
|
359 | export interface GraphSubjectLookupKey {
|
360 | descriptor?: string;
|
361 | }
|
362 | /**
|
363 | * Subject to search using the Graph API
|
364 | */
|
365 | export interface GraphSubjectQuery {
|
366 | /**
|
367 | * Search term to search for Azure Devops users or/and groups
|
368 | */
|
369 | query?: string;
|
370 | /**
|
371 | * Optional parameter. Specify a non-default scope (collection, project) to search for users or groups within the scope.
|
372 | */
|
373 | scopeDescriptor?: string;
|
374 | /**
|
375 | * "User" or "Group" can be specified, both or either
|
376 | */
|
377 | subjectKind?: string[];
|
378 | }
|
379 | export interface GraphSystemSubject extends GraphSubject {
|
380 | }
|
381 | export declare enum GraphTraversalDirection {
|
382 | Unknown = 0,
|
383 | Down = 1,
|
384 | Up = 2
|
385 | }
|
386 | export interface GraphUser extends AadGraphMember {
|
387 | }
|
388 | /**
|
389 | * Do not attempt to use this type to create a new user. Use one of the subclasses instead. This type does not contain sufficient fields to create a new user.
|
390 | */
|
391 | export interface GraphUserCreationContext {
|
392 | /**
|
393 | * Optional: If provided, we will use this identifier for the storage key of the created user
|
394 | */
|
395 | storageKey?: string;
|
396 | }
|
397 | /**
|
398 | * Use this type to create a new user using the mail address as a reference to an existing user from an external AD or AAD backed provider. This is the subset of GraphUser fields required for creation of a GraphUser for the AD and AAD use case when looking up the user by its mail address in the backing provider.
|
399 | */
|
400 | export interface GraphUserMailAddressCreationContext extends GraphUserCreationContext {
|
401 | /**
|
402 | * This should be the mail address of the user in the source AD or AAD provider. Example: Jamal.Hartnett@contoso.com Team Services will communicate with the source provider to fill all other fields on creation.
|
403 | */
|
404 | mailAddress: string;
|
405 | }
|
406 | /**
|
407 | * Use this type to create a new user using the OriginID as a reference to an existing user from an external AD or AAD backed provider. This is the subset of GraphUser fields required for creation of a GraphUser for the AD and AAD use case when looking up the user by its unique ID in the backing provider.
|
408 | */
|
409 | export interface GraphUserOriginIdCreationContext extends GraphUserCreationContext {
|
410 | /**
|
411 | * This should be the name of the origin provider. Example: github.com
|
412 | */
|
413 | origin?: string;
|
414 | /**
|
415 | * This should be the object id or sid of the user from the source AD or AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Team Services will communicate with the source provider to fill all other fields on creation.
|
416 | */
|
417 | originId: string;
|
418 | }
|
419 | /**
|
420 | * Use this type to update an existing user using the OriginID as a reference to an existing user from an external AD or AAD backed provider. This is the subset of GraphUser fields required for creation of a GraphUser for the AD and AAD use case when looking up the user by its unique ID in the backing provider.
|
421 | */
|
422 | export interface GraphUserOriginIdUpdateContext extends GraphUserUpdateContext {
|
423 | /**
|
424 | * This should be the object id or sid of the user from the source AD or AAD provider. Example: d47d025a-ce2f-4a79-8618-e8862ade30dd Azure Devops will communicate with the source provider to fill all other fields on creation.
|
425 | */
|
426 | originId: string;
|
427 | }
|
428 | /**
|
429 | * Use this type to create a new user using the principal name as a reference to an existing user from an external AD or AAD backed provider. This is the subset of GraphUser fields required for creation of a GraphUser for the AD and AAD use case when looking up the user by its principal name in the backing provider.
|
430 | */
|
431 | export interface GraphUserPrincipalNameCreationContext extends GraphUserCreationContext {
|
432 | /**
|
433 | * This should be the principal name or upn of the user in the source AD or AAD provider. Example: jamal@contoso.com Team Services will communicate with the source provider to fill all other fields on creation.
|
434 | */
|
435 | principalName: string;
|
436 | }
|
437 | /**
|
438 | * Use this type for transfering identity rights, for instance after performing a Tenant switch.
|
439 | */
|
440 | export interface GraphUserPrincipalNameUpdateContext extends GraphUserUpdateContext {
|
441 | /**
|
442 | * This should be Principal Name (UPN) to which we want to transfer rights. Example: destination@email.com
|
443 | */
|
444 | principalName: string;
|
445 | }
|
446 | /**
|
447 | * Do not attempt to use this type to update user. Use one of the subclasses instead. This type does not contain sufficient fields to create a new user.
|
448 | */
|
449 | export interface GraphUserUpdateContext {
|
450 | /**
|
451 | * Storage key should not be specified in case of updating user
|
452 | */
|
453 | storageKey?: string;
|
454 | }
|
455 | export interface IdentityMapping {
|
456 | source?: UserPrincipalName;
|
457 | target?: UserPrincipalName;
|
458 | }
|
459 | export interface IdentityMappings {
|
460 | mappings?: IdentityMapping[];
|
461 | }
|
462 | export interface MappingResult {
|
463 | code?: string;
|
464 | errorMessage?: string;
|
465 | }
|
466 | export interface PagedGraphGroups {
|
467 | /**
|
468 | * This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request.
|
469 | */
|
470 | continuationToken?: string[];
|
471 | /**
|
472 | * The enumerable list of groups found within a page.
|
473 | */
|
474 | graphGroups?: GraphGroup[];
|
475 | }
|
476 | export interface PagedGraphMembers {
|
477 | /**
|
478 | * This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request.
|
479 | */
|
480 | continuationToken?: string[];
|
481 | /**
|
482 | * The enumerable list of members found within a page.
|
483 | */
|
484 | graphMembers?: GraphMember[];
|
485 | }
|
486 | export interface PagedGraphServicePrincipals {
|
487 | /**
|
488 | * This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request.
|
489 | */
|
490 | continuationToken?: string[];
|
491 | /**
|
492 | * The enumerable list of service principals found within a page.
|
493 | */
|
494 | graphServicePrincipals?: GraphServicePrincipal[];
|
495 | }
|
496 | export interface PagedGraphUsers {
|
497 | /**
|
498 | * This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request.
|
499 | */
|
500 | continuationToken?: string[];
|
501 | /**
|
502 | * The enumerable set of users found within a page.
|
503 | */
|
504 | graphUsers?: GraphUser[];
|
505 | }
|
506 | export interface RequestAccessPayLoad {
|
507 | message?: string;
|
508 | projectUri?: string;
|
509 | urlRequested?: string;
|
510 | }
|
511 | export interface ResolveDisconnectedUsersResponse {
|
512 | code?: string;
|
513 | errorMessage?: string;
|
514 | mappingResults?: MappingResult[];
|
515 | }
|
516 | export interface UserPrincipalName {
|
517 | principalName?: string;
|
518 | }
|
519 | export declare var TypeInfo: {
|
520 | AadGraphMember: any;
|
521 | GraphScope: any;
|
522 | GraphScopeCreationContext: any;
|
523 | GraphServicePrincipal: any;
|
524 | GraphTraversalDirection: {
|
525 | enumValues: {
|
526 | unknown: number;
|
527 | down: number;
|
528 | up: number;
|
529 | };
|
530 | };
|
531 | GraphUser: any;
|
532 | PagedGraphServicePrincipals: any;
|
533 | PagedGraphUsers: any;
|
534 | };
|