Skip to content

Commit

Permalink
Clarify types
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlisa committed Sep 6, 2024
1 parent 27a5b2a commit 49e456e
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions web/packages/teleport/src/services/integrations/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ import { Node } from '../nodes';
* into one list.
*
* Generics:
* T is resource type "integration" or "plugin"
* K is the kind of integration (eg: aws-oidc) or plugin (eg: okta)
* SP is the provider-specific spec of integration or plugin
* SD is the provider-specific status containing status details
* ResourceType is resource type "integration" or "plugin"
* Kind is the kind of integration (eg: aws-oidc) or plugin (eg: okta)
* Spec is the provider-specific spec of integration or plugin
* Status is the provider-specific status containing status details
* - currently only defined for plugin resource
*/
export type Integration<
T extends string = 'integration',
K extends string = IntegrationKind,
SP extends Record<string, any> = IntegrationSpecAwsOidc,
SD extends Record<string, any> = null,
ResourceType extends string = 'integration',
Kind extends string = IntegrationKind,
Spec extends Record<string, any> = IntegrationSpecAwsOidc,
Status extends Record<string, any> = null,
> = {
resourceType: T;
kind: K;
spec?: SP;
resourceType: ResourceType;
kind: Kind;
spec?: Spec;
name: string;
details?: string;
statusCode: IntegrationStatusCode;
status?: SD;
status?: Status;
};
// IntegrationKind string values should be in sync
// with the backend value for defining the integration
Expand Down Expand Up @@ -127,14 +127,14 @@ export type ExternalAuditStorageIntegration = Integration<
ExternalAuditStorage
>;

export type Plugin<SP = any, D = any> = Integration<
export type Plugin<Spec = any, Details = any> = Integration<
'plugin',
PluginKind,
SP,
PluginStatus<D>
Spec,
PluginStatus<Details>
>;

export type PluginStatus<D = any> = {
export type PluginStatus<Details = any> = {
/**
* the status code of the plugin
*/
Expand All @@ -150,7 +150,7 @@ export type PluginStatus<D = any> = {
/**
* contains provider-specific status information
*/
details?: D;
details?: Details;
};

export type PluginSpec =
Expand Down

0 comments on commit 49e456e

Please sign in to comment.