UNPKG

@apistudio/apim-cli

Version:

CLI for API Management Products

1,044 lines 30.6 kB
export default { "rules": { "invalid-kind-value-combined": { "description": "Kind must be one of 'API' | 'Scope' | 'Project' | 'StagedPolicySequence' | 'InvokeAWSLambda' | 'ValidateAPISpecification' | 'CORS' | 'Quota' | 'Plan' | 'Product' | 'URISchemes' | 'properties' | 'Telemetry' | 'Properties' | 'LoadBalancer' | 'SetAuthorization' | 'Invoke' | 'GlobalPolicy' | 'InboundBulkHead' | 'SetMediaType' | 'InboundMessaging' | 'IAM' | 'AuthorizeUser' | 'SetContextVariable' | 'WebMethodsISService' | 'Log' | 'MonitorTraffic' | 'CacheServiceResult' | 'OutboundAlias' | 'OutboundAnonymous' | 'HTTPInvoke' | 'InvokeMessagingExtension' | 'DataMasking' | 'TransformRequest' | 'TransformResponse' | 'Route' | 'MessageConfig' | 'HTTPEndpoint' | 'MockEndpoint' | 'MockResponse' | 'ErrorProcessing' | 'Set' | 'RateLimitDef' | 'RateLimit' | 'Redact' | 'Remove' | 'Transform' | 'DataPowerAssembly' | 'Switch' | 'If' | 'OperationSwitch' | 'Try' | 'IBMCloudLogin' | 'WatsonXAIInvoke' | 'OpenAIInvoke' | 'FreeFlowPolicySequence' | 'Block' | 'TokenMediation' | 'EnforceCircuitBreaker' | 'JavaScript' | 'LuaScript' | 'Cache' | 'Antivirus' | 'SQLInjectionFilter' | 'CountLimit' | 'CountLimitDef' | 'Return' | 'Retry' | 'Throw' | 'HandlebarsTemplate' | 'ExtractIdentity' | 'Authorize' | 'Authenticate' | 'Parse'", "severity": "error", "given": "$", "then": { "field": "kind", "function": "schema", "functionOptions": { "schema": { "type": "string", "enum": [ "API", "Scope", "Project", "StagedPolicySequence", "InvokeAWSLambda", "ValidateAPISpecification", "CORS", "Quota", "Plan", "Product", "URISchemes", "properties", "Telemetry", "Properties", "LoadBalancer", "SetAuthorization", "Invoke", "GlobalPolicy", "InboundBulkHead", "SetMediaType", "InboundMessaging", "IAM", "AuthorizeUser", "SetContextVariable", "WebMethodsISService", "Log", "MonitorTraffic", "CacheServiceResult", "OutboundAlias", "OutboundAnonymous", "HTTPInvoke", "InvokeMessagingExtension", "DataMasking", "TransformRequest", "TransformResponse", "Route", "MessageConfig", "HTTPEndpoint", "MockEndpoint", "MockResponse", "ErrorProcessing", "Set", "RateLimitDef", "RateLimit", "Redact", "Remove", "Transform", "DataPowerAssembly", "Switch", "If", "OperationSwitch", "Try", "IBMCloudLogin", "WatsonXAIInvoke", "OpenAIInvoke", "FreeFlowPolicySequence", "Block", "TokenMediation", "EnforceCircuitBreaker", "JavaScript", "LuaScript", "Cache", "Antivirus", "SQLInjectionFilter", "CountLimit", "CountLimitDef", "Return", "Retry", "Throw", "HandlebarsTemplate", "ExtractIdentity", "Authorize", "Authenticate", "Parse" ] } } } }, "kind-not-exist": { "description": "Kind does not exist.", "severity": "error", "given": "$", "resolved": false, "then": { "field": "kind", "function": "truthy" } }, "invalid-kind-value": { "description": "Kind must be 'InvokeAWSLambda'", "severity": "error", "given": "$", "then": { "field": "kind", "function": "schema", "functionOptions": { "schema": { "type": "string", "enum": [ "InvokeAWSLambda" ] } } } }, "invalid-kind-spl-character": { "description": "kind should not be having empty or special characters", "severity": "error", "given": "$", "resolved": false, "then": { "field": "kind", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "invalid-api-version": { "description": "apiVersion must be one of the valid values 'api.ibm.com/v1'", "severity": "error", "given": "$", "resolved": false, "then": { "field": "apiVersion", "function": "schema", "functionOptions": { "schema": { "type": "string", "enum": [ "api.ibm.com/v1" ] } } } }, "api-version-not-exist": { "description": "apiVersion does not exist.", "severity": "error", "given": "$", "resolved": false, "then": { "field": "apiVersion", "function": "truthy" } }, "metadata-not-exist": { "description": "Metadata does not exist.", "severity": "error", "given": "$", "resolved": false, "then": { "field": "metadata", "function": "truthy" } }, "metadata-whitelist-check": { "description": "Metadata should not be having empty or special characters", "severity": "error", "given": "$", "resolved": false, "then": { "field": "metadata", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "metadata-name-not-exist": { "description": "Metadata name does not exist", "severity": "error", "given": "$.metadata", "resolved": false, "then": { "field": "name", "function": "truthy" } }, "metadata-name-whitelist-check": { "description": "Metadata name should not be having empty or special characters", "severity": "error", "given": "$.metadata", "resolved": false, "then": { "field": "name", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "metadata-version-not-exist": { "description": "Metadata version does not exist", "severity": "error", "given": "$.metadata", "resolved": false, "then": { "field": "version", "function": "truthy" } }, "metadata-version-whitelist-check": { "description": "Metadata version should not be having empty or special characters", "severity": "error", "given": "$.metadata", "resolved": false, "then": { "field": "version", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "metadata-namespace-not-exist": { "description": "Metadata namespace does not exist", "severity": "warn", "given": "$.metadata", "resolved": false, "then": { "field": "namespace", "function": "truthy" } }, "metadata-namespace-whitelist-check": { "description": "Metadata namespace should not be having empty or special characters", "severity": "warn", "given": "$.metadata", "resolved": false, "then": { "field": "namespace", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "spec-details-not-exist": { "description": "Spec details does not exist", "severity": "error", "given": "$", "resolved": false, "then": { "field": "spec", "function": "truthy" } }, "spec-details-whitelist-check": { "description": "Spec should not be having empty or special characters", "severity": "error", "given": "$", "resolved": false, "then": { "field": "spec", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "tags-not-exist": { "description": "Tag does not exist", "severity": "warn", "given": "$.metadata", "resolved": false, "then": { "field": "tags", "function": "truthy" } }, "invalid-tag-type": { "description": "Invalid Tag Type", "severity": "error", "given": "$.metadata.tags", "resolved": false, "then": { "function": "schema", "functionOptions": { "schema": { "type": "array" } } } }, "$-metadata-description-type": { "description": "The description field must be of type string", "severity": "error", "given": "$.metadata.description", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-name-required": { "description": "The name field is required in the $.metadata", "severity": "error", "given": "$.metadata", "then": { "field": "name", "function": "defined" } }, "$-metadata-name-type": { "description": "The name field must be of type string", "severity": "error", "given": "$.metadata.name", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-namespace-type": { "description": "The namespace field must be of type string", "severity": "error", "given": "$.metadata.namespace", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-tags-type": { "description": "The tags field must be of type array", "severity": "error", "given": "$.metadata.tags", "then": { "function": "schema", "functionOptions": { "schema": { "type": "array" } } } }, "$-metadata-tags-items-type": { "description": "Items in the tags array must be of type string", "severity": "error", "given": "$.metadata.tags[*]", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-type-type": { "description": "The type field must be of type string", "severity": "error", "given": "$.metadata.type", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-type-enum": { "description": "The type field must be one of: REST, SWAGGER, SOAP, GRAPHQL, ODATA", "severity": "error", "given": "$.metadata.type", "then": { "function": "schema", "functionOptions": { "schema": { "enum": [ "REST", "SWAGGER", "SOAP", "GRAPHQL", "ODATA" ] } } } }, "$-metadata-version-required": { "description": "The version field is required in the $.metadata", "severity": "error", "given": "$.metadata", "then": { "field": "version", "function": "defined" } }, "$-metadata-version-type": { "description": "The version field must be of type string", "severity": "error", "given": "$.metadata.version", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-labels-type": { "description": "The labels field must be of type object", "severity": "error", "given": "$.metadata.labels", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-metadata-labels-gatewayTypes-type": { "description": "The gatewayTypes field must be of type array", "severity": "error", "given": "$.metadata.labels.gatewayTypes", "then": { "function": "schema", "functionOptions": { "schema": { "type": "array" } } } }, "$-metadata-labels-gatewayTypes-items-type": { "description": "Items in the gatewayTypes array must be of type string", "severity": "error", "given": "$.metadata.labels.gatewayTypes[*]", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-functionName-type": { "description": "The functionName field must be of type string", "severity": "error", "given": "$.spec.functionName", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-qualifier-type": { "description": "The qualifier field must be of type string", "severity": "error", "given": "$.spec.qualifier", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-invocationType-type": { "description": "The invocationType field must be of type string", "severity": "error", "given": "$.spec.invocationType", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-invocationType-enum": { "description": "The invocationType field must be one of: request-response, event", "severity": "error", "given": "$.spec.invocationType", "then": { "function": "schema", "functionOptions": { "schema": { "enum": [ "request-response", "event" ] } } } }, "$-spec-region-type": { "description": "The region field must be of type string", "severity": "error", "given": "$.spec.region", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-awsAuthType-type": { "description": "The awsAuthType field must be of type object", "severity": "error", "given": "$.spec.awsAuthType", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-awsAuthType-accessSecret-required": { "description": "The accessSecret field is required in the $.spec.awsAuthType", "severity": "error", "given": "$.spec.awsAuthType", "then": { "field": "accessSecret", "function": "defined" } }, "$-spec-awsAuthType-accessSecret-type": { "description": "The accessSecret field must be of type string", "severity": "error", "given": "$.spec.awsAuthType.accessSecret", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-awsAuthType-no-additional-properties": { "description": "The awsAuthType object should only contain the defined properties: accessSecret", "severity": "error", "given": "$.spec.awsAuthType", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "accessSecret": {} } } } } }, "$-spec-tlsConnectionProfile-type": { "description": "The tlsConnectionProfile field must be of type string", "severity": "error", "given": "$.spec.tlsConnectionProfile", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-input-type": { "description": "The input field must be of type string", "severity": "error", "given": "$.spec.input", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-output-type": { "description": "The output field must be of type string", "severity": "error", "given": "$.spec.output", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-clientConfig-type": { "description": "The clientConfig field must be of type object", "severity": "error", "given": "$.spec.clientConfig", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-clientConfig-socketTimeout-type": { "description": "The socketTimeout field must be of type integer", "severity": "error", "given": "$.spec.clientConfig.socketTimeout", "then": { "function": "schema", "functionOptions": { "schema": { "type": "integer" } } } }, "$-spec-clientConfig-connectionTimeout-type": { "description": "The connectionTimeout field must be of type integer", "severity": "error", "given": "$.spec.clientConfig.connectionTimeout", "then": { "function": "schema", "functionOptions": { "schema": { "type": "integer" } } } }, "$-spec-clientConfig-requestTimeout-type": { "description": "The requestTimeout field must be of type integer", "severity": "error", "given": "$.spec.clientConfig.requestTimeout", "then": { "function": "schema", "functionOptions": { "schema": { "type": "integer" } } } }, "$-spec-clientConfig-clientExecutionTimeout-type": { "description": "The clientExecutionTimeout field must be of type integer", "severity": "error", "given": "$.spec.clientConfig.clientExecutionTimeout", "then": { "function": "schema", "functionOptions": { "schema": { "type": "integer" } } } }, "$-spec-clientConfig-clientRetryCount-type": { "description": "The clientRetryCount field must be of type integer", "severity": "error", "given": "$.spec.clientConfig.clientRetryCount", "then": { "function": "schema", "functionOptions": { "schema": { "type": "integer" } } } }, "$-spec-clientConfig-connectionExpirationTimeout-type": { "description": "The connectionExpirationTimeout field must be of type integer", "severity": "error", "given": "$.spec.clientConfig.connectionExpirationTimeout", "then": { "function": "schema", "functionOptions": { "schema": { "type": "integer" } } } }, "$-spec-clientConfig-enableExpectContinue-type": { "description": "The enableExpectContinue field must be of type boolean", "severity": "error", "given": "$.spec.clientConfig.enableExpectContinue", "then": { "function": "schema", "functionOptions": { "schema": { "type": "boolean" } } } }, "$-spec-clientConfig-enableGzip-type": { "description": "The enableGzip field must be of type boolean", "severity": "error", "given": "$.spec.clientConfig.enableGzip", "then": { "function": "schema", "functionOptions": { "schema": { "type": "boolean" } } } }, "$-spec-clientConfig-enableHostPrefixInjection-type": { "description": "The enableHostPrefixInjection field must be of type boolean", "severity": "error", "given": "$.spec.clientConfig.enableHostPrefixInjection", "then": { "function": "schema", "functionOptions": { "schema": { "type": "boolean" } } } }, "$-spec-clientConfig-maxConnectionIdleTime-type": { "description": "The maxConnectionIdleTime field must be of type integer", "severity": "error", "given": "$.spec.clientConfig.maxConnectionIdleTime", "then": { "function": "schema", "functionOptions": { "schema": { "type": "integer" } } } }, "$-spec-clientConfig-responseMetadataCacheSize-type": { "description": "The responseMetadataCacheSize field must be of type boolean", "severity": "error", "given": "$.spec.clientConfig.responseMetadataCacheSize", "then": { "function": "schema", "functionOptions": { "schema": { "type": "boolean" } } } }, "$-spec-clientConfig-enableThrottledRetries-type": { "description": "The enableThrottledRetries field must be of type boolean", "severity": "error", "given": "$.spec.clientConfig.enableThrottledRetries", "then": { "function": "schema", "functionOptions": { "schema": { "type": "boolean" } } } }, "$-spec-clientConfig-enableKeepAlive-type": { "description": "The enableKeepAlive field must be of type boolean", "severity": "error", "given": "$.spec.clientConfig.enableKeepAlive", "then": { "function": "schema", "functionOptions": { "schema": { "type": "boolean" } } } }, "$-spec-clientConfig-enableResponseMetadataCache-type": { "description": "The enableResponseMetadataCache field must be of type boolean", "severity": "error", "given": "$.spec.clientConfig.enableResponseMetadataCache", "then": { "function": "schema", "functionOptions": { "schema": { "type": "boolean" } } } }, "$-spec-clientConfig-signatureAlgorithm-type": { "description": "The signatureAlgorithm field must be of type string", "severity": "error", "given": "$.spec.clientConfig.signatureAlgorithm", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-clientConfig-tcpSendBufferSizeHint-type": { "description": "The tcpSendBufferSizeHint field must be of type integer", "severity": "error", "given": "$.spec.clientConfig.tcpSendBufferSizeHint", "then": { "function": "schema", "functionOptions": { "schema": { "type": "integer" } } } }, "$-spec-clientConfig-tcpReceiveBufferSizeHint-type": { "description": "The tcpReceiveBufferSizeHint field must be of type integer", "severity": "error", "given": "$.spec.clientConfig.tcpReceiveBufferSizeHint", "then": { "function": "schema", "functionOptions": { "schema": { "type": "integer" } } } }, "$-spec-clientConfig-no-additional-properties": { "description": "The clientConfig object should only contain the defined properties: socketTimeout, connectionTimeout, requestTimeout, clientExecutionTimeout, clientRetryCount, connectionExpirationTimeout, enableExpectContinue, enableGzip, enableHostPrefixInjection, maxConnectionIdleTime, responseMetadataCacheSize, enableThrottledRetries, enableKeepAlive, enableResponseMetadataCache, signatureAlgorithm, tcpSendBufferSizeHint, tcpReceiveBufferSizeHint", "severity": "error", "given": "$.spec.clientConfig", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "socketTimeout": {}, "connectionTimeout": {}, "requestTimeout": {}, "clientExecutionTimeout": {}, "clientRetryCount": {}, "connectionExpirationTimeout": {}, "enableExpectContinue": {}, "enableGzip": {}, "enableHostPrefixInjection": {}, "maxConnectionIdleTime": {}, "responseMetadataCacheSize": {}, "enableThrottledRetries": {}, "enableKeepAlive": {}, "enableResponseMetadataCache": {}, "signatureAlgorithm": {}, "tcpSendBufferSizeHint": {}, "tcpReceiveBufferSizeHint": {} } } } } }, "$-spec-extensions-type": { "description": "The extensions field must be of type object", "severity": "error", "given": "$.spec.extensions", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-dp-nano-gateway-type": { "description": "The dp-nano-gateway field must be of type object", "severity": "error", "given": "$.spec.extensions.dp-nano-gateway", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-dp-nano-gateway-apiVersion-type": { "description": "The apiVersion field must be of type string", "severity": "error", "given": "$.spec.extensions.dp-nano-gateway.apiVersion", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-extensions-dp-nano-gateway-spec-type": { "description": "The spec field must be of type object", "severity": "error", "given": "$.spec.extensions.dp-nano-gateway.spec", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-dp-nano-gateway-spec-clientConfig-type": { "description": "The clientConfig field must be of type object", "severity": "error", "given": "$.spec.extensions.dp-nano-gateway.spec.clientConfig", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-dp-nano-gateway-spec-clientConfig-serverRetryCount-type": { "description": "The serverRetryCount field must be of type integer", "severity": "error", "given": "$.spec.extensions.dp-nano-gateway.spec.clientConfig.serverRetryCount", "then": { "function": "schema", "functionOptions": { "schema": { "type": "integer" } } } }, "$-spec-extensions-dp-nano-gateway-spec-clientConfig-no-additional-properties": { "description": "The clientConfig object should only contain the defined properties: serverRetryCount", "severity": "error", "given": "$.spec.extensions.dp-nano-gateway.spec.clientConfig", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "serverRetryCount": {} } } } } }, "$-spec-extensions-dp-nano-gateway-spec-no-additional-properties": { "description": "The spec object should only contain the defined properties: clientConfig", "severity": "error", "given": "$.spec.extensions.dp-nano-gateway.spec", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "clientConfig": {} } } } } }, "$-spec-extensions-dp-nano-gateway-no-additional-properties": { "description": "The dp-nano-gateway object should only contain the defined properties: apiVersion, spec", "severity": "error", "given": "$.spec.extensions.dp-nano-gateway", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "apiVersion": {}, "spec": {} } } } } }, "spec-no-additional-properties": { "description": "The spec object should only contain the defined properties: functionName, qualifier, invocationType, region, awsAuthType, tlsConnectionProfile, input, output, clientConfig, extensions", "severity": "error", "given": "$.spec", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "functionName": {}, "qualifier": {}, "invocationType": {}, "region": {}, "awsAuthType": {}, "tlsConnectionProfile": {}, "input": {}, "output": {}, "clientConfig": {}, "extensions": {} } } } } } } };