-
Notifications
You must be signed in to change notification settings - Fork 8
/
types.d.ts
698 lines (677 loc) · 25.2 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
/**
* Create request options compatible with the console swagger definition
* @param apiKey - apiKey to access console api
* @param options - optional data used for building the request options
* @param [options.parameters] - parameters to set to the request, specific to each endpoint
* @param [options.body] - request body for the request
* @returns [{ swaggerParameters }, { requestBody }]
*/
declare function createRequestOptions(apiKey: string, options: {
parameters?: any;
body?: any;
}): any[];
/**
* Build a swagger request interceptor for the console sdk
* @param coreConsoleAPIInstance - console core api instance
* @param apihost - console api url host
* @returns a request interceptor
*/
declare function requestInterceptorBuilder(coreConsoleAPIInstance: any, apihost: string): (...params: any[]) => any;
/**
* A swagger response interceptor for the console sdk
* @param res - the response object
* @returns the response object
*/
declare function responseInterceptor(res: any): any;
/**
* @property url - requested url
* @property ok - response ok indicator
* @property status - response status code
* @property statusText - response status text
* @property headers - response headers
* @property body - response body object
* @property obj - response body object
* @property data - response body string
* @property text - response body string
*/
declare type Response = {
url: string;
ok: boolean;
status: number;
statusText: number;
headers: any;
body: any;
obj: any;
data: any;
text: any;
};
/**
* @property name - Name
* @property title - Title
* @property [who_created] - Creator name
* @property [description] - Description
* @property type - Type (default or jaeger)
*/
declare type ProjectDetails = {
name: string;
title: string;
who_created?: string;
description?: string;
type: string;
};
/**
* @property name - Name
* @property [title] - Title
* @property [who_created] - Creator name
* @property [description] - Description
* @property [type] - Type
* @property [quotaRule] - quotaRule
*/
declare type WorkspaceDetails = {
name: string;
title?: string;
who_created?: string;
description?: string;
type?: string;
quotaRule?: string;
};
/**
* @property name - Name
* @property description - Description
* @property platform - Platform
* @property [urlScheme] - url scheme
* @property [redirectUriList] - List of redirect URIs
* @property [defaultRedirectUri] - Default redirect URI
* @property [domain] - domain
* @property [approvalInfo] - approvalInfo
* @property [templateId] - templateId
* @property [services] - services
*/
declare type AdobeIdIntegrationDetails = {
name: string;
description: string;
platform: string;
urlScheme?: string;
redirectUriList?: any;
defaultRedirectUri?: string;
domain?: string;
approvalInfo?: any;
templateId?: string;
services?: SubscribeToServices[];
};
/**
* @property id - Id
*/
declare type ExtensionIcon = {
id: string;
};
/**
* @property id - Id
* @property type - Type
* @property order - order
*/
declare type ExtensionMedia = {
id: string;
type: string;
order: string;
};
/**
* @property name - Name
* @property title - Title
* @property description - Description
* @property version - Version
* @property icon - Icon
* @property media - array of Media Objects
*/
declare type ExtensionDetails = {
name: string;
title: string;
description: string;
version: string;
icon: ExtensionIcon;
media: ExtensionMedia[];
};
/**
* @property appType - app type
* @property id - Id
* @property notes - Notes
*/
declare type ExtensionSubmissionDetails = {
appType: string;
id: string;
notes: string;
};
/**
* @property additionalProp1 - additional property 1
* @property additionalProp2 - additional property 2
*/
declare type ExtensionWorkspaceEndpoints = {
additionalProp1: any;
additionalProp2: any;
};
/**
* @property code - Code
* @property name - Name
* @property licenseGroupIds - License group Ids
*/
declare type ExtensionWorkspaceServices = {
code: string;
name: string;
licenseGroupIds: string[];
};
/**
* @property id - Id
* @property name - Name
* @property endpoints - Description
* @property services - Services
* @property icon - Icon
* @property releaseNotes - Release Notes
* @property technicalUserId - Technical user Id
* @property appId - App Id
* @property publisherId - Publisher Id
*/
declare type ExtensionWorkspaceDetails = {
id: string;
name: string;
endpoints: ExtensionWorkspaceEndpoints;
services: ExtensionWorkspaceServices;
icon: ExtensionIcon;
releaseNotes: string;
technicalUserId: string;
appId: string;
publisherId: string;
};
/**
* @property sdkCode - the sdk code
* @property roles - the roles
* @property licenseConfigs - the license configs
*/
declare type ServiceInfo = {
sdkCode: string;
roles: Role[];
licenseConfigs: LicenseConfig[];
};
/**
* @property sdkCode - the sdk code
* @property atlasPlanCode - the atlas plan code
* @property roles - the roles
* @property licenseConfigs - the license configs
*/
declare type SubscribeToServices = {
sdkCode: string;
atlasPlanCode: string;
roles: Role[];
licenseConfigs: LicenseConfig[];
};
/**
* @property op - the operation (e.g. 'add')
* @property id - the license id
* @property productId - the product id
*/
declare type LicenseConfig = {
op: string;
id: string;
productId: string;
};
/**
* @property id - the role id
* @property code - the role code
* @property name - the role name
*/
declare type Role = {
id: number;
code: string;
name: string;
};
/**
* @property name - Name
* @property description - Description
* @property [templateId] - templateId
* @property [services] - services
*/
declare type OauthS2SIntegrationDetails = {
name: string;
description: string;
templateId?: string;
services?: SubscribeToServices[];
};
/**
* Returns a Promise that resolves with a new CoreConsoleAPI object
* @param accessToken - the access token corresponding to an integration or user token
* @param apiKey - api key to access the Developer Console
* @param env - The name of the environment. `prod` and `stage`
* are the only values supported. `prod` is default and any value
* other than `prod` or `stage` it is assumed to be the default
* value of `prod`. If not set, it will get the global cli env value. See https://github.com/adobe/aio-lib-env
* (which defaults to `prod` as well if not set)
* @returns a Promise with a CoreConsoleAPI object
*/
declare function init(accessToken: string, apiKey: string, env: string): Promise<CoreConsoleAPI>;
/**
* This class provides methods to call your CoreConsoleAPI APIs.
* Before calling any method, initialize the instance by calling the `init` method on it
* with valid values for apiKey and accessToken
*/
declare class CoreConsoleAPI {
/**
* Initializes a CoreConsoleAPI object and returns it
* @param accessToken - the access token corresponding to an integration or user token
* @param apiKey - api key to access the Developer Console
* @param env - The name of the environment. `prod` and `stage`
* are the only values supported. `prod` is default and any value
* other than `prod` or `stage` it is assumed to be the default
* value of `prod`. If not set, it will get the global cli env value. See https://github.com/adobe/aio-lib-env
* (which defaults to `prod` as well if not set)
* @returns a CoreConsoleAPI object
*/
init(accessToken: string, apiKey: string, env: string): Promise<CoreConsoleAPI>;
/**
* Get all Projects in an Organization
* @param organizationId - Organization AMS ID
* @returns the response
*/
getProjectsForOrg(organizationId: string): Promise<Response>;
/**
* Create a new App Builder Project (from template) in an Organization
* @param organizationId - Organization AMS ID
* @param projectDetails - Project details including name, title, who_created, description and type
* @returns the response
*/
createFireflyProject(organizationId: string, projectDetails: ProjectDetails): Promise<Response>;
/**
* Create a new Project in an Organization
* @param organizationId - Organization AMS ID
* @param projectDetails - Project details including name, title, who_created, description and type
* @returns the response
*/
createProject(organizationId: string, projectDetails: ProjectDetails): Promise<Response>;
/**
* Get all Workspaces for a Project
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @returns the response
*/
getWorkspacesForProject(organizationId: string, projectId: string): Promise<Response>;
/**
* Delete a Project
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @returns the response
*/
deleteProject(organizationId: string, projectId: string): Promise<Response>;
/**
* Edit a Project
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param projectDetails - Project details including name, title, who_created, description and type
* @returns the response
*/
editProject(organizationId: string, projectId: string, projectDetails: ProjectDetails): Promise<Response>;
/**
* Get a Project by ID
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @returns the response
*/
getProject(organizationId: string, projectId: string): Promise<Response>;
/**
* Download the Workspace Configuration File (json)
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @returns the response
*/
downloadWorkspaceJson(organizationId: string, projectId: string, workspaceId: string): Promise<Response>;
/**
* Create a new Workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceDetails - Workspace details including name, title, who_created, description, type and quotaRule
* @returns the response
*/
createWorkspace(organizationId: string, projectId: string, workspaceDetails: WorkspaceDetails): Promise<Response>;
/**
* Edit a Workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @param workspaceDetails - Workspace details including name, title, who_created, description, type and quotaRule
* @returns the response
*/
editWorkspace(organizationId: string, projectId: string, workspaceId: string, workspaceDetails: WorkspaceDetails): Promise<Response>;
/**
* Get a Workspace by ID
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @returns the response
*/
getWorkspace(organizationId: string, projectId: string, workspaceId: string): Promise<Response>;
/**
* Delete a Workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @returns the response
*/
deleteWorkspace(organizationId: string, projectId: string, workspaceId: string): Promise<Response>;
/**
* Get all credentials for a Workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @returns the response
*/
getCredentials(organizationId: string, projectId: string, workspaceId: string): Promise<Response>;
/**
* Create a new OAuth Server-to-Server Credential for a Workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @param name - Credential name
* @param description - Credential description
* @returns the response
*/
createOAuthServerToServerCredential(organizationId: string, projectId: string, workspaceId: string, name: string, description: string): Promise<Response>;
/**
* Get the install config for an Adobe Developer Console project
* @param projectId - Project ID
* @returns the response
*/
getProjectInstallConfig(projectId: string): Promise<Response>;
/**
* Create a new Enterprise Credential for a Workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @param certificate - A Readable stream with certificate content. eg: fs.createReadStream()
* @param name - Credential name
* @param description - Credential description
* @returns the response
*/
createEnterpriseCredential(organizationId: string, projectId: string, workspaceId: string, certificate: any, name: string, description: string): Promise<Response>;
/**
* Create a new AdobeID Credential for a Workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @param credentialDetails - Credential details
* @returns the response
*/
createAdobeIdCredential(organizationId: string, projectId: string, workspaceId: string, credentialDetails: AdobeIdIntegrationDetails): Promise<Response>;
/**
* Create a new Analytics Credential for a Workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @param credentialDetails - Credential details
* @returns the response
*/
createAnalyticsCredential(organizationId: string, projectId: string, workspaceId: string, credentialDetails: AdobeIdIntegrationDetails): Promise<Response>;
/**
* Subscribe a Workspace Credential to Services
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @param credentialType - Credential type (adobeid, analytics or entp)
* @param credentialId - Credential ID
* @param serviceInfo - Information about the services like SDK Codes, licenseConfig and roles
* @returns the response
*/
subscribeCredentialToServices(organizationId: string, projectId: string, workspaceId: string, credentialType: string, credentialId: string, serviceInfo: ServiceInfo[]): Promise<Response>;
/**
* Get the Workspace from a Credential ID
* @param organizationId - Organization AMS ID
* @param credentialId - Credential ID
* @returns the response
*/
getWorkspaceForCredential(organizationId: string, credentialId: string): Promise<Response>;
/**
* Get the Project of a Workspace
* @param organizationId - Organization AMS ID
* @param workspaceId - Workspace ID
* @returns the response
*/
getProjectForWorkspace(organizationId: string, workspaceId: string): Promise<Response>;
/**
* Delete a Workspace Credential
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @param credentialType - Credential type (adobeid, analytics or entp). Unused.
* @param credentialId - Credential ID
* @returns the response
*/
deleteCredential(organizationId: string, projectId: string, workspaceId: string, credentialType: string, credentialId: string): Promise<Response>;
/**
* Delete a Workspace Credential by credential id.
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @param credentialId - Credential ID
* @returns the response
*/
deleteCredentialById(organizationId: string, projectId: string, workspaceId: string, credentialId: string): Promise<Response>;
/**
* Get all Organizations
* @returns the response
*/
getOrganizations(): Promise<Response>;
/**
* Get all Services available to an Organization
* @param organizationId - Organization AMS ID
* @param sdkCodes - comma separated list of sdk codes
* @returns the response
*/
getServicesForOrg(organizationId: string, sdkCodes: string): Promise<Response>;
/**
* Get org services v2. Can be used for getting services for a user in an org irrespective of the user's role in the org.
* They should just be a member. Also includes the information needed for requesting access to services that support it.
* @param imsOrgId - IMS org id in format abc@AdobeOrg
* @param sdkCodes - comma separated list of sdk codes
* @returns the response
*/
getServicesForOrgV2(imsOrgId: string, sdkCodes: string): Promise<Response>;
/**
* Check developer terms acceptance
* @param organizationId - Organization AMS ID
* @returns the response
*/
checkOrgDevTerms(organizationId: string): Promise<Response>;
/**
* Accept developer terms
* @param organizationId - Organization AMS ID
* @returns the response
*/
acceptOrgDevTerms(organizationId: string): Promise<Response>;
/**
* Get developer terms
* @returns the response
*/
getDevTerms(): Promise<Response>;
/**
* Create an Adobe I/O Runtime namespace in the given workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @returns the response
*/
createRuntimeNamespace(organizationId: string, projectId: string, workspaceId: string): Promise<Response>;
/**
* Get plugins for workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @returns the response
*/
getPluginsForWorkspace(organizationId: string, projectId: string, workspaceId: string): Promise<Response>;
/**
* Get Integrations for an Organization
* @param organizationId - Organization AMS ID
* @returns the response
*/
getIntegrationsForOrg(organizationId: string): Promise<Response>;
/**
* Create a new Enterprise Integration for an Organization
* @param organizationId - Organization AMS ID
* @param certificate - A Readable stream with certificate content. eg: fs.createReadStream()
* @param name - Integration name
* @param description - Integration description
* @returns the response
*/
createEnterpriseIntegration(organizationId: string, certificate: any, name: string, description: string): Promise<Response>;
/**
* Create a new AdobeID Integration for an Organization
* @param organizationId - Organization AMS ID
* @param integrationDetails - Integration details
* @returns the response
*/
createAdobeIdIntegration(organizationId: string, integrationDetails: AdobeIdIntegrationDetails): Promise<Response>;
/**
* Update an AdobeID Integration for an Organization
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID to update
* @param integrationDetails - Integration details
* @returns the response
*/
updateAdobeIdIntegration(organizationId: string, integrationId: string, integrationDetails: AdobeIdIntegrationDetails): Promise<Response>;
/**
* Subscribe Organization AdobeId Integration to Services
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID
* @param serviceInfo - Information about the services like SDK Codes, licenseConfig and roles
* @returns the response
*/
subscribeAdobeIdIntegrationToServices(organizationId: string, integrationId: string, serviceInfo: any): Promise<Response>;
/**
* Subscribe Organization Enterprise Integration to Services
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID
* @param serviceInfo - Information about the services like SDK Codes, licenseConfig and roles
* @returns the response
*/
subscribeEnterpriseIntegrationToServices(organizationId: string, integrationId: string, serviceInfo: any): Promise<Response>;
/**
* Subscribe Organization OAuth Server-to-Server Integration to Services
* @param organizationId - Organization AMS ID
* @param credentialId - Credential ID
* @param serviceInfo - Information about the services like SDK Codes, licenseConfig and roles
* @returns the response
*/
subscribeOAuthServerToServerIntegrationToServices(organizationId: string, credentialId: string, serviceInfo: any): Promise<Response>;
/**
* List certification bindings for an Integration
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID
* @returns the response
*/
getBindingsForIntegration(organizationId: string, integrationId: string): Promise<Response>;
/**
* Upload and bind a certificate to an Organization Integration
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID
* @param certificate - A Readable stream with certificate content. eg: fs.createReadStream()
* @returns the response
*/
uploadAndBindCertificate(organizationId: string, integrationId: string, certificate: any): Promise<Response>;
/**
* Delete a certificate binding for an Integration
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID
* @param bindingId - Binding ID
* @returns the response
*/
deleteBinding(organizationId: string, integrationId: string, bindingId: string): Promise<Response>;
/**
* Get Integration details
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID
* @returns the response
*/
getIntegration(organizationId: string, integrationId: string): Promise<Response>;
/**
* Get Integration secrets
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID
* @returns the response
*/
getIntegrationSecrets(organizationId: string, integrationId: string): Promise<Response>;
/**
* Delete an Integration
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID
* @returns the response
*/
deleteIntegration(organizationId: string, integrationId: string): Promise<Response>;
/**
* Create an IMS Org
* @returns the response
*/
createIMSOrg(): Promise<Response>;
/**
* Get Application Atlas Policy for an Integration
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID
* @returns the response
*/
getAtlasApplicationPolicy(organizationId: string, integrationId: string): Promise<Response>;
/**
* Get Atlas quota usage for an Integration
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID
* @returns the response
*/
getAtlasQuotaUsage(organizationId: string, integrationId: string): Promise<Response>;
/**
* Get all available extension points
* @param organizationId - Organization AMS ID
* @param [xpId = firefly] - xp ID, default 'firefly'
* @param [options] - Get options
* @param [options.offset] - Offset
* @param [options.pageSize] - page size
* @returns the response
*/
getAllExtensionPoints(organizationId: string, xpId?: string, options?: {
offset?: number;
pageSize?: number;
}): Promise<Response>;
/**
* Get Extensions for an App Builder application
* @param organizationId - Organization AMS ID
* @param applicationId - App Builder Application ID
* @returns the response
*/
getApplicationExtensions(organizationId: string, applicationId: string): Promise<Response>;
/**
* Get endpoints in a workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @returns the response
*/
getEndPointsInWorkspace(organizationId: string, projectId: string, workspaceId: string): Promise<Response>;
/**
* Update endpoints in a workspace
* @param organizationId - Organization AMS ID
* @param projectId - Project ID
* @param workspaceId - Workspace ID
* @param endpointDetails - endpoint details
* @returns the response
*/
updateEndPointsInWorkspace(organizationId: string, projectId: string, workspaceId: string, endpointDetails: any): Promise<Response>;
/**
* Get details about a service (SDK) subscribed to an integration
* @param organizationId - Organization AMS ID
* @param integrationId - Integration ID
* @param sdkCode - the service sdkCode to query (e.g. AdobeAnalyticsSDK)
* @returns the response
*/
getSDKProperties(organizationId: string, integrationId: string, sdkCode: string): Promise<Response>;
/**
* Create a new oauth server to server credential for an Organization
* @param organizationId - Organization AMS ID
* @param integrationDetails - Integration details
* @returns the response
*/
createOauthS2SCredentialIntegration(organizationId: string, integrationDetails: OauthS2SIntegrationDetails): Promise<Response>;
}