Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DoyleBrendan committed Jul 18, 2024
1 parent 49ff4dc commit fc1bded
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
11 changes: 7 additions & 4 deletions src/resources/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ export class Api {

if (this.config.enhancedMetrics) {
merge(endpointResource.Properties, {
EnhancedMetricsConfig: {
"DataSourceLevelMetricsBehavior" : this.config.enhancedMetrics.DataSourceLevelMetricsBehavior,
"OperationLevelMetricsConfig" : this.config.enhancedMetrics.OperationLevelMetricsConfig,
"ResolverLevelMetricsBehavior": "PER_RESOLVER_METRICS" }
EnhancedMetricsConfig: {
DataSourceLevelMetricsBehavior:
this.config.enhancedMetrics.DataSourceLevelMetricsBehavior,
OperationLevelMetricsConfig:
this.config.enhancedMetrics.OperationLevelMetricsConfig,
ResolverLevelMetricsBehavior: 'PER_RESOLVER_METRICS',
},
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/resources/Resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class Resolver {
ApiId: this.api.getApiId(),
TypeName: this.config.type,
FieldName: this.config.field,
MetricsConfig: 'DISABLED'
MetricsConfig: 'DISABLED',
};

const isVTLResolver = 'request' in this.config || 'response' in this.config;
Expand Down
2 changes: 1 addition & 1 deletion src/types/cloudFormation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export type CfnResolver = {
};
};
MaxBatchSize?: number;
MetricsConfig? : 'ENABLED' | 'DISABLED';
MetricsConfig?: 'ENABLED' | 'DISABLED';
};
};

Expand Down
10 changes: 7 additions & 3 deletions src/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,13 @@ export type SyncConfig = {
export type Substitutions = Record<string, string | IntrinsicFunction>;
export type EnvironmentVariables = Record<string, string | IntrinsicFunction>;
export type EnhancedMetricsConfig = {
"DataSourceLevelMetricsBehavior" : 'FULL_REQUEST_DATA_SOURCE_METRICS'| 'PER_DATA_SOURCE_METRICS';
"OperationLevelMetricsConfig" : 'ENABLED' | ' DISABLED';
"ResolverLevelMetricsBehavior" : 'FULL_REQUEST_RESOLVER_METRICS' | 'PER_RESOLVER_METRICS' ;
DataSourceLevelMetricsBehavior:
| 'FULL_REQUEST_DATA_SOURCE_METRICS'
| 'PER_DATA_SOURCE_METRICS';
OperationLevelMetricsConfig: 'ENABLED' | ' DISABLED';
ResolverLevelMetricsBehavior:
| 'FULL_REQUEST_RESOLVER_METRICS'
| 'PER_RESOLVER_METRICS';
};

export type DsDynamoDBConfig = {
Expand Down
2 changes: 1 addition & 1 deletion src/types/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
DsNone,
Substitutions,
EnvironmentVariables,
EnhancedMetricsConfig
EnhancedMetricsConfig,
} from './common';
export * from './common';

Expand Down
5 changes: 3 additions & 2 deletions src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,14 +816,15 @@ export const appSyncSchema = {
DataSourceLevelMetricsBehavior: {
type: 'string',
enum: ['FULL_REQUEST_DATA_SOURCE_METRICS', 'PER_DATA_SOURCE_METRICS'],
errorMessage: "must be 'FULL_REQUEST_DATA_SOURCE_METRICS' or 'PER_DATA_SOURCE_METRICS'",
errorMessage:
"must be 'FULL_REQUEST_DATA_SOURCE_METRICS' or 'PER_DATA_SOURCE_METRICS'",
},
OperationLevelMetricsConfig: {
type: 'string',
enum: ['ENABLED', ' DISABLED'],
errorMessage: "must be 'ENABLED' or ' DISABLED'",
},
}
},
},
dataSources: {
oneOf: [
Expand Down

0 comments on commit fc1bded

Please sign in to comment.