forked from launchdarkly/integration-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.schema.d.ts
822 lines (820 loc) · 22 KB
/
manifest.schema.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
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
/**
* Your integration's name.
*/
export type IntegrationName = string;
/**
* A semantic version of the integration. See https://semver.org for more info.
*/
export type Version = string;
/**
* A short-one liner describing your integration
*/
export type ShortDescription = string;
/**
* A longer description of your integration
*/
export type LongDescription = string;
/**
* Details about your integration and next steps if the installation happens outside of LaunchDarkly
*/
export type LearnMoreDetails = string;
/**
* Name of the author or organization responsible for the integration
*/
export type Author = string;
/**
* Email address for your integration's support
*/
export type SupportEmail = string;
/**
* URL to your website
*/
export type Website = string;
/**
* URL to the LaunchDarkly documentation for this integration
*/
export type LaunchDarklyDocumentation = string;
/**
* URL to your organization's privacy policy
*/
export type PrivacyPolicy = string;
/**
* URL to your integration's support website
*/
export type SupportWebsite = string;
/**
* Categories that describe your integration
*/
export type Categories =
| [
| "analytics"
| "approval"
| "authentication"
| "automation"
| "code-references"
| "customer-support"
| "data"
| "developer-tools"
| "infrastructure"
| "issue-tracking"
| "log-management"
| "messaging"
| "monitoring"
| "notifications"
]
| [
(
| "analytics"
| "approval"
| "authentication"
| "automation"
| "code-references"
| "customer-support"
| "data"
| "developer-tools"
| "infrastructure"
| "issue-tracking"
| "log-management"
| "messaging"
| "monitoring"
| "notifications"
),
(
| "analytics"
| "approval"
| "authentication"
| "automation"
| "code-references"
| "customer-support"
| "data"
| "developer-tools"
| "infrastructure"
| "issue-tracking"
| "log-management"
| "messaging"
| "monitoring"
| "notifications"
)
]
| [
(
| "analytics"
| "approval"
| "authentication"
| "automation"
| "code-references"
| "customer-support"
| "data"
| "developer-tools"
| "infrastructure"
| "issue-tracking"
| "log-management"
| "messaging"
| "monitoring"
| "notifications"
),
(
| "analytics"
| "approval"
| "authentication"
| "automation"
| "code-references"
| "customer-support"
| "data"
| "developer-tools"
| "infrastructure"
| "issue-tracking"
| "log-management"
| "messaging"
| "monitoring"
| "notifications"
),
(
| "analytics"
| "approval"
| "authentication"
| "automation"
| "code-references"
| "customer-support"
| "data"
| "developer-tools"
| "infrastructure"
| "issue-tracking"
| "log-management"
| "messaging"
| "monitoring"
| "notifications"
)
];
/**
* A square version of your integration's logo in SVG format
*/
export type SquareLogo = string;
/**
* A horizontal version of your integration's logo in SVG format
*/
export type HorizontalLogo = string;
/**
* Kind of legacy integration
*/
export type Kind = "codeRefs" | "datadog" | "dataExport" | "slackWebhooks" | "webhooks";
/**
* Capabilities not configured by manifests
*/
export type OtherCapabilities = [
"codeRefs" | "dataExport" | "external" | "ide" | "sso" | "webhooks",
...("codeRefs" | "dataExport" | "external" | "ide" | "sso" | "webhooks")[]
];
/**
* Whether the integration authenticates using OAuth
*/
export type RequiresOAuth = boolean;
/**
* A key will be used as the token name when the variable is substituted
*/
export type Key = string;
/**
* A descriptive name that will be used as the form label on the UI
*/
export type Name = string;
/**
* The type of the variable
*/
export type Type = "string" | "boolean" | "uri" | "enum" | "oauth" | "dynamicEnum";
/**
* Describes the variable in the UI. Markdown links allowed.
*/
export type Description = string;
/**
* Placeholder value to use in the form element if applicable
*/
export type Description1 = string;
/**
* Secret variables will be masked in the UI
*/
export type IsThisVariableASecret = boolean;
/**
* Variables marked as optional won't be required on the UI
*/
export type IsThisVariableOptional = boolean;
/**
* Default value for variable. Can be overridden by the user in the UI
*/
export type DefaultValue = boolean | string;
/**
* Allowed string values for enum-type formVariables
*/
export type AllowedValues = string[];
/**
* URL to send the request to. You can use {{template markup}} to inject a formVariable into the url.
*/
export type URL = string;
/**
* HTTP method to use when LaunchDarkly makes the request to your endpoint
*/
export type HTTPMethod = "POST" | "PUT" | "PATCH" | "GET" | "DELETE";
/**
* Name of the header
*/
export type Name1 = string;
/**
* Value of the header. Form variables can be substituted in using {{variableName}}
*/
export type Value = string;
/**
* Headers to send with the webhook request
*/
export type HTTPHeaders = HeaderItems[];
/**
* JSON path to the array containing options for parsing
*/
export type OptionsArrayPath = string;
/**
* Relative JSON path to values for each item in the options array to be used as UI dropdown labels
*/
export type Label = string;
/**
* Relative JSON path to values for each item in the options array to be used as dropdown values
*/
export type Value1 = string;
/**
* Form variables will be rendered on the integration configuration page. These are variables you need an admin to supply when they enable the integration. Examples of a form variable include `apiToken` or `url`.
*/
export type FormVariables = FormVariable[];
/**
* Template to use for flag events
*/
export type FlagTemplate = string;
/**
* Template to use for project events
*/
export type ProjectTemplate = string;
/**
* Template to use for environment events
*/
export type EnvironmentTemplate = string;
/**
* Template to use if the event does not have a corresponding named template
*/
export type DefaultTemplate = string;
/**
* Template to use when sending test events with the 'validate connection' button
*/
export type ValidationTemplate = string;
/**
* Template to use for member events
*/
export type MemberTemplate = string;
/**
* LaunchDarkly policy that allows you to filter events sent to your webhook. See https://docs.launchdarkly.com/home/members/role-policies for more information.
*/
export type DefaultPolicy = [Policy, ...Policy[]];
/**
* A list of action specifiers defining the actions to which the statement applies. See https://docs.launchdarkly.com/home/members/role-actions for more information.
*/
export type Actions = string[];
/**
* This attribute defines whether the statement allows or denies access to the named resources and actions.
*/
export type Effect = "allow" | "deny";
/**
* A list of action specifiers defining the actions to which the statement does not apply. See https://docs.launchdarkly.com/home/members/role-actions for more information.
*/
export type NotActions = string[];
/**
* A list of resource specifiers defining the resources to which the statement does not apply. See https://docs.launchdarkly.com/home/members/role-resources for more information.
*/
export type NotResources = string[];
/**
* A list of resource specifiers defining the resources to which the statement applies. See https://docs.launchdarkly.com/home/members/role-resources for more information.
*/
export type Resources = string[];
/**
* Whether errors received from your endpoint should be displayed in the error log in LaunchDarkly UI
*/
export type IncludeErrorResponseBody = boolean;
/**
* The reserved custom property's display name.
*/
export type Name2 = string;
/**
* The custom property's API response key.
*/
export type Key1 = string;
/**
* The custom property's description.
*/
export type Description2 = string;
/**
* This capability will reserve integration-specific custom property options in the global flag setting configuration. These custom properties will only be presented to users after they have have configured an integration subscription. Read https://docs.launchdarkly.com/home/connecting/custom-properties for more information on custom properties
*/
export type ReservedCustomProperties = {
name: Name2;
key: Key1;
description?: Description2;
[k: string]: unknown;
}[];
/**
* URL to documentation describing how to configure the integration.
*/
export type DocumentationLink = string;
/**
* Authentication type - currently the only option is sharedSecret.
*/
export type Authentication = "sharedSecret";
/**
* The default event name string used in the audit log if an eventName cannot be parsed in the trigger request body.
*/
export type DefaultEventName = string;
/**
* The expected eventName of the integration partner's test events
*/
export type TestEventNameRegex = string;
/**
* JSON pointer to an event name
*/
export type EventNamePointer = string;
/**
* JSON pointer to a metric value
*/
export type ValuePointer = string;
/**
* JSON pointer to the external alert URL
*/
export type URLPointer = string;
/**
* Template string used to render the JSON request body
*/
export type JSONBody = string;
/**
* JSON path to the array containing integration member details
*/
export type MemberArrayPath = string;
/**
* Relative JSON path to the email field in each member item in the array
*/
export type Email = string;
/**
* Relative JSON path to the integration member ID field in each member item in the array
*/
export type MemberID = string;
/**
* Environment-specific form variables that render on the environment approval settings modal
*/
export type EnvironmentFormVariables = FormVariable[];
/**
* Flag-specific form variables that render on the approval request creation modal
*/
export type FlagFormVariables = FormVariable[];
/**
* Externally-created approval entity ID
*/
export type ApprovalIDPointer = string;
/**
* JSON pointer to a status value
*/
export type StatusValuePointer = string;
/**
* JSON pointer to a human-readable status
*/
export type StatusValueDisplayPointer = string;
/**
* regex pattern used to determine if the approval should be considered 'approved'
*/
export type ApprovalMatcher = string;
/**
* regex pattern used to determine if the approval should be considered 'rejected'
*/
export type RejectionMatcher = string;
/**
* expected format for the external creation request URL. Values can be substituted in using {{value}}
*/
export type URLTemplate = string;
/**
* Provider specific configuration that LaunchDarkly needs in order to write feature flag data to the provider's data store
*/
export type ProviderFormVariables = FormVariable[];
export type SuccessPointer = string;
export type ErrorsPointer = string;
/**
* Sentence-cased title to show for all links for this integration
*/
export type LinkGroupHeader = string;
/**
* Title of the message
*/
export type Title = string;
/**
* Text or markup content describing how links can be created for this integration
*/
export type LeadText = string;
/**
* Data type for the metadata attribute
*/
export type Type1 = "string" | "uri";
/**
* Url of the image. Handlebars template notation can be used to reference metadata fields.
*/
export type SourceUrl = string;
/**
* Indicates whether the image should be rendered as an icon
*/
export type IsIcon = boolean;
/**
* Indicates whether the image should be rendered as an avatar
*/
export type IsAvatar = boolean;
/**
* Template string used to render a visual block in LaunchDarkly UI to display a name
*/
export type Name3 = string;
/**
* Text to be displayed for the element. The text can contain template variables
*/
export type Text = string;
/**
* Indicates whether the element should be bolded
*/
export type IsBold = boolean;
/**
* Indicates whether the element should be rendered as a timestamp
*/
export type IsTimestamp = boolean;
/**
* URL to be set for the element which also indicates the element should be rendered as a hyperlink
*/
export type Url = string;
/**
* An array of elements to be combined to create a title block
*/
export type Elements = UIBlockElement[];
/**
* Indicates whether the title should be displayed as a hyperlink in LaunchDarkly UI
*/
export type LinkToReference = boolean;
/**
* Markdown string used to render a visual block in LaunchDarkly UI to display a link description
*/
export type Description3 = string;
/**
* An array of elements to be combined to create a context block
*/
export type Elements1 = UIBlockElement[];
/**
* Describes the capabilities and intent of a LaunchDarkly integration
*/
export interface LaunchDarklyIntegrationsManifest {
name: IntegrationName;
version: Version;
overview: ShortDescription;
description: LongDescription;
details?: LearnMoreDetails;
author: Author;
supportEmail: SupportEmail;
links: Links;
categories: Categories;
icons: Icons;
legacy?: Legacy;
otherCapabilities?: OtherCapabilities;
requiresOAuth?: RequiresOAuth;
formVariables?: FormVariables;
capabilities?: Capabilities;
[k: string]: unknown;
}
/**
* A set of reference links supporting your integration
*/
export interface Links {
site: Website;
launchdarklyDocs?: LaunchDarklyDocumentation;
privacyPolicy: PrivacyPolicy;
supportWebsite?: SupportWebsite;
[k: string]: unknown;
}
/**
* Logos describing your integration in SVG format
*/
export interface Icons {
square: SquareLogo;
horizontal: HorizontalLogo;
[k: string]: unknown;
}
/**
* Legacy integration
*/
export interface Legacy {
kind: Kind;
[k: string]: unknown;
}
/**
* A form variable describes an object property that the LaunchDarkly admin will be prompted for when they configure an integration.
*/
export interface FormVariable {
key: Key;
name: Name;
type: Type;
description: Description;
placeholder?: Description1;
isSecret?: IsThisVariableASecret;
isOptional?: IsThisVariableOptional;
defaultValue?: DefaultValue;
allowedValues?: AllowedValues;
dynamicOptions?: DynamicOptions;
[k: string]: unknown;
}
/**
* Parser and endpoint for handling dynamicEnum
*/
export interface DynamicOptions {
endpoint: Endpoint;
parser: DynamicOptionsParser;
[k: string]: unknown;
}
/**
* Properties that describe an HTTP request to an external endpoint
*/
export interface Endpoint {
url: URL;
method: HTTPMethod;
headers?: HTTPHeaders;
[k: string]: unknown;
}
/**
* A name and value pair to send as headers with the hook request
*/
export interface HeaderItems {
name: Name1;
value: Value;
[k: string]: unknown;
}
/**
* Mapping of property names to location in JSON response
*/
export interface DynamicOptionsParser {
optionsPath: OptionsArrayPath;
optionsItems: OptionsArray;
[k: string]: unknown;
}
export interface OptionsArray {
label: Label;
value: Value1;
[k: string]: unknown;
}
/**
* Specify which capabilities you'd like your integration to have
*/
export interface Capabilities {
auditLogEventsHook?: AuditLogEventsHook;
reservedCustomProperties?: ReservedCustomProperties;
trigger?: Trigger;
approval?: Approval;
featureStore?: FeatureStore;
flagLink?: FlagLink;
[k: string]: unknown;
}
/**
* This capability will enable LaunchDarkly to send audit log event webhooks to your endpoint.
*/
export interface AuditLogEventsHook {
endpoint: Endpoint;
templates: WebhookBodyTemplate;
defaultPolicy?: DefaultPolicy;
includeErrorResponseBody?: IncludeErrorResponseBody;
[k: string]: unknown;
}
/**
* Templates to use for body of the webhook request
*/
export interface WebhookBodyTemplate {
flag?: FlagTemplate;
project?: ProjectTemplate;
environment?: EnvironmentTemplate;
default?: DefaultTemplate;
validation?: ValidationTemplate;
member?: MemberTemplate;
[k: string]: unknown;
}
/**
* A LaunchDarkly policy. See https://docs.launchdarkly.com/home/members/role-policies for more information.
*/
export interface Policy {
actions?: Actions;
effect?: Effect;
notActions?: NotActions;
notResources?: NotResources;
resources?: Resources;
[k: string]: unknown;
}
/**
* This capability is used to manage inbound webhook entry points that trigger feature flag changes in LaunchDarkly
*/
export interface Trigger {
documentation: DocumentationLink;
auth?: Authentication;
defaultEventName?: DefaultEventName;
testEventNameRegexp?: TestEventNameRegex;
parser?: TriggerParser;
[k: string]: unknown;
}
/**
* Describes a mapping of property name to a location in the JSON response payload specified by a JSON pointer
*/
export interface TriggerParser {
eventName?: EventNamePointer;
value?: ValuePointer;
url?: URLPointer;
[k: string]: unknown;
}
/**
* This capability enables integration-driven flag change approvals
*/
export interface Approval {
memberListRequest: MemberListRequest;
environmentFormVariables?: EnvironmentFormVariables;
flagFormVariables?: FlagFormVariables;
creationRequest: CreationRequest;
statusRequest: StatusRequest;
postApplyRequest: PostApplyRequest;
deletionRequest: DeletionRequest;
[k: string]: unknown;
}
/**
* Describes the HTTP request to get integration users for mapping to Launchdarkly users
*/
export interface MemberListRequest {
endpoint: Endpoint;
jsonBody?: JSONBody;
parser: MemberListParser;
[k: string]: unknown;
}
/**
* Describes a mapping of integration member information to a location in the JSON response payload specified by a JSON pointer
*/
export interface MemberListParser {
memberArrayPath: MemberArrayPath;
memberItems: MemberItemsArray;
[k: string]: unknown;
}
export interface MemberItemsArray {
email: Email;
memberId: MemberID;
[k: string]: unknown;
}
/**
* Describes the approval creation HTTP request and the parser used to process the JSON response
*/
export interface CreationRequest {
endpoint: Endpoint;
jsonBody?: JSONBody;
parser?: ApprovalParser;
[k: string]: unknown;
}
/**
* Describes a mapping of property names to a location in the JSON response payload specified by a JSON pointer
*/
export interface ApprovalParser {
approvalId?: ApprovalIDPointer;
statusValue: StatusValuePointer;
statusDisplay?: StatusValueDisplayPointer;
approvalMatcher: ApprovalMatcher;
rejectionMatcher?: RejectionMatcher;
urlTemplate?: URLTemplate;
[k: string]: unknown;
}
/**
* Describes the approval status check HTTP request and the parser used to determine if the approval should be consider approved or rejected
*/
export interface StatusRequest {
endpoint: Endpoint;
jsonBody?: JSONBody;
parser: ApprovalParser;
[k: string]: unknown;
}
/**
* Describes the HTTP request to make after the changes have been applied in LaunchDarkly
*/
export interface PostApplyRequest {
endpoint: Endpoint;
jsonBody?: JSONBody;
parser: ApprovalParser;
[k: string]: unknown;
}
/**
* Describes the HTTP request for the deletion of the external approval entity
*/
export interface DeletionRequest {
endpoint: Endpoint;
jsonBody?: JSONBody;
parser: ApprovalParser;
[k: string]: unknown;
}
/**
* This capability allows LaunchDarkly to write feature flag data to a given provider
*/
export interface FeatureStore {
formVariables: ProviderFormVariables;
validationRequest?: ValidationRequest;
featureStoreRequest: FeatureStoreRequest;
[k: string]: unknown;
}
/**
* Details needed to make a request to test that the provided form variables are valid
*/
export interface ValidationRequest {
endpoint: Endpoint;
parser: FeatureStoreValidationParser;
[k: string]: unknown;
}
/**
* Mapping to success/errors value(s) in a JSON response body
*/
export interface FeatureStoreValidationParser {
success: SuccessPointer;
errors?: ErrorsPointer;
[k: string]: unknown;
}
/**
* Details needed to make a request to deliver the flag payload to the feature store
*/
export interface FeatureStoreRequest {
endpoint: Endpoint;
[k: string]: unknown;
}
/**
* This capability is used to manage inbound flag links
*/
export interface FlagLink {
header: LinkGroupHeader;
emptyState: EmptyState;
metadata?: FlagLinkMetadata;
uiBlocks: UIBlocks;
[k: string]: unknown;
}
/**
* Content to display when there are no links to display for this integration
*/
export interface EmptyState {
title?: Title;
leadText?: LeadText;
[k: string]: unknown;
}
/**
* Key/value pairs describing attributes for the flag link's payload metadata property. The key is the name of the metadata field and the value is the configuration object for the field.
*/
export interface FlagLinkMetadata {
[k: string]: {
type: Type1;
[k: string]: unknown;
};
}
/**
* UI blocks are visual components that represents a section of the view layout for a flag link displayed in LaunchDarkly
*/
export interface UIBlocks {
image?: Image;
name?: Name3;
title?: Title1;
description?: Description3;
context?: FlagLinkContext;
[k: string]: unknown;
}
/**
* A visual block used to render an image in LaunchDarkly UI
*/
export interface Image {
sourceUrl: SourceUrl;
isIcon?: IsIcon;
isAvatar?: IsAvatar;
[k: string]: unknown;
}
/**
* Object with visual elements used to display a link title in LaunchDarkly UI
*/
export interface Title1 {
elements: Elements;
linkToReference?: LinkToReference;
[k: string]: unknown;
}
/**
* A sub component of a UI block that can be combined with other elements to form a UI block
*/
export interface UIBlockElement {
text: Text;
isBold?: IsBold;
isTimestamp?: IsTimestamp;
url?: Url;
[k: string]: unknown;
}
/**
* Object with visual elements used to display context information for a link in LaunchDarkly UI
*/
export interface FlagLinkContext {
elements: Elements1;
[k: string]: unknown;
}