Skip to content

Commit

Permalink
feat: added new topic configuration properties
Browse files Browse the repository at this point in the history
  • Loading branch information
gokerakc committed Feb 20, 2024
1 parent 287ed28 commit ef3aa1f
Show file tree
Hide file tree
Showing 26 changed files with 2,403 additions and 238 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
111 changes: 111 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
env:
node: true
es6: true
mocha: true
browser: true

plugins:
- sonarjs

extends:
- eslint:recommended
- plugin:sonarjs/recommended

parserOptions:
ecmaVersion: 2018
requireConfigFile: false

rules:
# Ignore Rules
strict: 0
no-underscore-dangle: 0
no-mixed-requires: 0
no-process-exit: 0
no-warning-comments: 0
no-use-before-define: 0
curly: 0
no-multi-spaces: 0
no-alert: 0
consistent-return: 0
consistent-this: [0, self]
func-style: 0
max-nested-callbacks: 0
camelcase: 0
no-dupe-class-members: 0
security/detect-object-injection: 0
sonarjs/no-small-switch: 0
sonarjs/no-nested-template-literals: 0

# Warnings
no-debugger: 1
no-empty: 1
no-invalid-regexp: 1
no-unused-expressions: 1
no-native-reassign: 1
no-fallthrough: 1
sonarjs/cognitive-complexity: 1

# Errors
eqeqeq: 2
no-undef: 2
no-dupe-keys: 2
no-empty-character-class: 2
no-self-compare: 2
valid-typeof: 2
handle-callback-err: 2
no-shadow-restricted-names: 2
no-new-require: 2
no-mixed-spaces-and-tabs: 2
block-scoped-var: 2
no-else-return: 2
no-throw-literal: 2
no-void: 2
radix: 2
wrap-iife: [2, outside]
no-shadow: 0
no-path-concat: 2
valid-jsdoc: [0, {requireReturn: false, requireParamDescription: false, requireReturnDescription: false}]

# stylistic errors
no-spaced-func: 2
semi-spacing: 2
quotes: [2, 'single']
key-spacing: [2, { beforeColon: false, afterColon: true }]
indent: [2, 2]
no-lonely-if: 2
no-floating-decimal: 2
brace-style: [2, 1tbs, { allowSingleLine: true }]
comma-style: [2, last]
no-multiple-empty-lines: [2, {max: 1}]
no-nested-ternary: 2
operator-assignment: [2, always]
padded-blocks: [2, never]
quote-props: [2, as-needed]
keyword-spacing: [2, {'before': true, 'after': true, 'overrides': {}}]
space-before-blocks: [2, always]
array-bracket-spacing: [2, never]
computed-property-spacing: [2, never]
space-in-parens: [2, never]
space-unary-ops: [2, {words: true, nonwords: false}]
wrap-regex: 2
linebreak-style: 0
semi: [2, always]
arrow-spacing: [2, {before: true, after: true}]
no-class-assign: 2
no-const-assign: 2
no-this-before-super: 2
no-var: 2
object-shorthand: [2, always]
prefer-arrow-callback: 2
prefer-const: 2
prefer-spread: 2
prefer-template: 2

overrides:
- files:
- "test/**"
rules:
prefer-arrow-callback: 0
sonarjs/no-duplicate-string: 0
security/detect-object-injection: 0
security/detect-non-literal-fs-filename: 0
4 changes: 2 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file.

* @fmvilas @derberg @dalelane @smoya @char0n @asyncapi-bot-eve
* @fmvilas @derberg @dalelane @smoya @char0n @asyncapi-bot-eve @GreenRover

/bindings/anypointmq/ @mboss37 @GeraldLoeffler
/bindings/ibmmq/ @rcoppen
Expand All @@ -18,4 +18,4 @@
/bindings/sns/ @dpwdec @iancooper
/bindings/sqs/ @dpwdec @iancooper

/bindings/*.json @KhudaDad414
/bindings/*.json @KhudaDad414
46 changes: 46 additions & 0 deletions bindings/http/0.3.0/message.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/http/0.3.0/message.json",
"title": "HTTP message bindings object",
"description": "This object contains information about the message representation in HTTP.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
"headers": {
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json",
"description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key."
},
"statusCode": {
"type": "number",
"description": "The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). `statusCode` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored."
},
"bindingVersion": {
"type": "string",
"enum": [
"0.3.0"
],
"description": "The version of this binding. If omitted, \"latest\" MUST be assumed."
}
},
"examples": [
{
"headers": {
"type": "object",
"properties": {
"Content-Type": {
"type": "string",
"enum": [
"application/json"
]
}
}
},
"bindingVersion": "0.3.0"
}
]
}
82 changes: 82 additions & 0 deletions bindings/http/0.3.0/operation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/http/0.3.0/operation.json",
"title": "HTTP operation bindings object",
"description": "This object contains information about the operation representation in HTTP.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
"method": {
"type": "string",
"enum": [
"GET",
"PUT",
"POST",
"PATCH",
"DELETE",
"HEAD",
"OPTIONS",
"CONNECT",
"TRACE"
],
"description": "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'."
},
"query": {
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json",
"description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key."
},
"bindingVersion": {
"type": "string",
"enum": [
"0.3.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}
},
"examples": [
{
"query": {
"type": "object",
"required": [
"companyId"
],
"properties": {
"companyId": {
"type": "number",
"minimum": 1,
"description": "The Id of the company."
}
},
"additionalProperties": false
},
"bindingVersion": "0.3.0"
},
{
"method": "GET",
"query": {
"type": "object",
"required": [
"companyId"
],
"properties": {
"companyId": {
"type": "number",
"minimum": 1,
"description": "The Id of the company."
}
},
"additionalProperties": false
},
"bindingVersion": "0.3.0"
}
]
}




96 changes: 96 additions & 0 deletions bindings/kafka/0.5.0/channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/kafka/0.5.0/channel.json",
"title": "Channel Schema",
"description": "This object contains information about the channel representation in Kafka.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
"topic": {
"type": "string",
"description": "Kafka topic name if different from channel name."
},
"partitions": {
"type": "integer",
"minimum": 1,
"description": "Number of partitions configured on this topic."
},
"replicas": {
"type": "integer",
"minimum": 1,
"description": "Number of replicas configured on this topic."
},
"topicConfiguration" : {
"description": "Topic configuration properties that are relevant for the API.",
"type": "object",
"additionalProperties": true,
"properties": {
"cleanup.policy": {
"description": "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.",
"type": "array",
"items":{
"type": "string",
"enum": ["compact", "delete"]
}
},
"retention.ms": {
"description": "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.",
"type": "integer",
"minimum": -1
},
"retention.bytes": {
"description": "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.",
"type": "integer",
"minimum": -1
},
"delete.retention.ms": {
"description": "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.",
"type": "integer",
"minimum": 0
},
"max.message.bytes": {
"description": "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.",
"type": "integer",
"minimum": 0
},
"confluent.key.schema.validation": {
"description": "It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)",
"type": "boolean"
},
"confluent.key.subject.name.strategy": {
"description": "The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)",
"type": "string"
},
"confluent.value.schema.validation": {
"description": "It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)",
"type": "boolean"
},
"confluent.value.subject.name.strategy": {
"description": "The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)",
"type": "string"
}
}
},
"bindingVersion": {
"type": "string",
"enum": [
"0.5.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}

},
"examples": [
{
"topic": "my-specific-topic",
"partitions": 20,
"replicas": 3,
"bindingVersion": "0.5.0"
}
]
}
Loading

0 comments on commit ef3aa1f

Please sign in to comment.