Skip to content

Commit 93d4a77

Browse files
committed
Initial code drop
1 parent 2c32fc6 commit 93d4a77

File tree

167 files changed

+520196
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+520196
-1
lines changed

.eslintrc.json

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"root": true,
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended"
6+
],
7+
"env": {
8+
"es6": true,
9+
"browser": true
10+
},
11+
"rules": {
12+
"no-control-regex": "off",
13+
"camelcase": "off",
14+
"eol-last": [
15+
"error",
16+
"always"
17+
],
18+
"eqeqeq": [
19+
"error",
20+
"always"
21+
],
22+
"no-confusing-arrow": "error",
23+
"no-useless-rename": "error",
24+
"no-unexpected-multiline": "off",
25+
"operator-linebreak": "error",
26+
"prefer-arrow-callback": "error",
27+
"prefer-const": "error",
28+
"prefer-numeric-literals": "error",
29+
"prefer-rest-params": "error",
30+
"prefer-spread": "error",
31+
"prefer-template": "error",
32+
"prefer-destructuring": "off",
33+
"@typescript-eslint/no-explicit-any": "off",
34+
"@typescript-eslint/member-delimiter-style": "off",
35+
"@typescript-eslint/no-unused-vars": "off",
36+
"@typescript-eslint/no-loss-of-precision": "off",
37+
"@typescript-eslint/ban-ts-comment": "off",
38+
"@typescript-eslint/semi": [
39+
"error",
40+
"never"
41+
],
42+
"@typescript-eslint/explicit-member-accessibility": "off",
43+
"@typescript-eslint/explicit-function-return-type": "off",
44+
"@typescript-eslint/no-non-null-assertion": "off",
45+
"@typescript-eslint/no-inferrable-types": "off",
46+
"yoda": "error"
47+
},
48+
"parserOptions": {
49+
"jsx": true,
50+
"ecmaVersion": 6,
51+
"sourceType": "module"
52+
},
53+
"overrides": [
54+
{
55+
"files": [
56+
"**/src/**/*.ts(x)"
57+
],
58+
"parserOptions": {
59+
"parser": "@typescript-eslint/parser",
60+
"project": "./tsconfig.json"
61+
},
62+
"plugins": [
63+
"@typescript-eslint"
64+
],
65+
"globals": {
66+
"browser": true
67+
},
68+
"env": {
69+
"browser": true
70+
},
71+
"rules": {
72+
"indent": "off",
73+
"@typescript-eslint/indent": [
74+
"error",
75+
2,
76+
{
77+
"FunctionExpression": {
78+
"parameters": "first"
79+
},
80+
"SwitchCase": 1,
81+
"ignoredNodes": [
82+
"Decorator"
83+
]
84+
}
85+
],
86+
"@typescript-eslint/array-type": "error"
87+
}
88+
},
89+
{
90+
"files": [
91+
"index.ts"
92+
]
93+
}
94+
],
95+
"ignorePatterns": [
96+
"*.d.ts",
97+
".eslintrc.json",
98+
"package.json",
99+
"tsconfig.json"
100+
]
101+
}

.gitattributes

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*.js text eol=lf
2+
*.ts text eol=lf
3+
*.md text eol=lf
4+
*.yaml text eol=lf
5+
*.html text eol=lf
6+
*.json text eol=lf
7+
*.sh text eol=lf
8+
*.svg text eol=lf
9+
*.cjs text eol=lf
10+
.browserslistrc text eol=lf
11+
*.mp4 binary
12+
*.png binary
13+
*.jpg binary
14+
*.gif binary
15+
*.vsdx binary
16+
*.ttf binary
17+
*.eot binary
18+
*.woff binary
19+
*.woff2 binary
20+
.gitignore text eol=lf
21+
.npmignore text eol=lf
22+
.gitattributes text eol=lf
23+
LICENSE eol=lf
24+
NOTICE eol=lf

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# IDEs
2+
/.idea
3+
!/.idea/icon.png
4+
/.vscode
5+
*.iml
6+
7+
# dependencies
8+
node_modules/
9+
10+
# build
11+
dist/
12+
13+
# logs
14+
*.log*

CODE-OF-CONDUCT.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Code of Conduct
2+
3+
This repository is governed by following code of conduct guidelines.
4+
5+
We put collaboration, trust, respect and transparency as core values for our community.
6+
Our community welcomes participants from all over the world with different experience,
7+
opinion and ideas to share.
8+
9+
We have adopted this code of conduct and require all contributors to agree with that to build a healthy,
10+
safe and productive community for all.
11+
12+
The guideline is aimed to support a community where all people should feel safe to participate,
13+
introduce new ideas and inspire others, regardless of:
14+
15+
* Age
16+
* Gender
17+
* Gender identity or expression
18+
* Family status
19+
* Marital status
20+
* Ability
21+
* Ethnicity
22+
* Race
23+
* Sex characteristics
24+
* Sexual identity and orientation
25+
* Education
26+
* Native language
27+
* Background
28+
* Caste
29+
* Religion
30+
* Geographic location
31+
* Socioeconomic status
32+
* Personal appearance
33+
* Any other dimension of diversity
34+
35+
## Our Standards
36+
37+
We are welcoming the following behavior:
38+
39+
* Be respectful for different ideas, opinions and points of view
40+
* Be constructive and professional
41+
* Use inclusive language
42+
* Be collaborative and show the empathy
43+
* Focus on the best results for the community
44+
45+
The following behavior is unacceptable:
46+
47+
* Violence, threats of violence, or inciting others to commit self-harm
48+
* Personal attacks, trolling, intentionally spreading misinformation, insulting/derogatory comments
49+
* Public or private harassment
50+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
51+
* Derogatory language
52+
* Encouraging unacceptable behavior
53+
* Other conduct which could reasonably be considered inappropriate in a professional community
54+
55+
## Our Responsibilities
56+
57+
Project maintainers are responsible for clarifying the standards of the Code of Conduct
58+
and are expected to take appropriate actions in response to any instances of unacceptable behavior.
59+
60+
Project maintainers have the right and responsibility to remove, edit, or reject comments,
61+
commits, code, wiki edits, issues, and other contributions that are not aligned
62+
to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
63+
that they deem inappropriate, threatening, offensive, or harmful.
64+
65+
## Reporting
66+
67+
If you believe you’re experiencing unacceptable behavior that will not be tolerated as outlined above,
68+
please report to `[email protected]`. All complaints will be reviewed and investigated and will result in a response
69+
that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality
70+
with regard to the reporter of an incident.
71+
72+
Please also report if you observe a potentially dangerous situation, someone in distress, or violations of these guidelines,
73+
even if the situation is not happening to you.

CONTRIBUTING copy.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contribution Guide
2+
3+
We'd love to accept patches and contributions to this project.
4+
Please, follow these guidelines to make the contribution process easy and effective for everyone involved.
5+
6+
## Contributor License Agreement
7+
8+
You must sign the [Contributor License Agreement](https://pages.netcracker.com/cla-main.html) in order to contribute.
9+
10+
## Code of Conduct
11+
12+
Please make sure to read and follow the [Code of Conduct](CODE-OF-CONDUCT.md).
13+

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Notice, that overridden functions have `apihub` prefix

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
Apache License
23
Version 2.0, January 2004
34
http://www.apache.org/licenses/

NOTICE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
qubership-apihub-api-diff
2+
Copyright 2024-2025 NetCracker Technology Corporation
3+
4+
This product includes software developed by https://github.com/udamir
5+
https://github.com/udamir/api-smart-diff
6+
MIT License
7+
Copyright (c) 2024 Damir Yusipov

README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,56 @@
1-
# qubership-apihub-api-diff
1+
# qubership-apihub-api-diff
2+
3+
This package provides utils to compute the diff between two Json based API documents.
4+
5+
## Modifications
6+
Modified version of [udamir/api-smart-diff](https://github.com/udamir/api-smart-diff)
7+
8+
- changed concept from effective to declarative changes calculation
9+
- performance improvements
10+
- introduced scopes instead of classification rules inversion
11+
- all unification code extracted to API Unifier
12+
- cycled JSO supported as input
13+
- input specification is automatically unified
14+
- diff storing for arrays unified with all other types
15+
- support diffs for changing of combiners to non-combiners and vice versa
16+
- diffs caused by default values when type is changed no longer reported
17+
- added number of tests
18+
- introduced testing against compatibility suit
19+
- fixed a number of bugs in OpenAPI diffs classification
20+
- correct handling of sparse arrays that could arise when processing incorrect specification
21+
- supported de-normalization to remove excessive diffs for default values
22+
- debug tooling for cycled JSO extended with diffs support
23+
- supported new graphapi structure
24+
25+
## Purpose
26+
- Generate API changelog
27+
- Identify breaking changes
28+
- Ensure API versioning consistency
29+
30+
## Supported API specifications
31+
32+
- [OpenApi 3.0](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md)
33+
- [AsyncApi 2.x](https://v2.asyncapi.com/docs/reference)
34+
- [JsonSchema](https://json-schema.org/draft/2020-12/json-schema-core.html)
35+
- GraphQL via GraphApi
36+
- ~~Swagger 2.0~~
37+
- ~~[AsyncApi 3.x](https://www.asyncapi.com/docs/specifications/)~~ (Roadmap)
38+
- ~~gRPC~~ (Roadmap)
39+
40+
## Features
41+
- Generate diff for supported specifications
42+
- Generate merged document with changes in metadata
43+
- Classify all changes as breaking, non-breaking, deprecated and annotation
44+
- Human-readable change description
45+
- Supports custom classification rules
46+
- Supports custom comparison or match rules
47+
- Supports custom transformations
48+
- Supports custom human-readable changes annotation
49+
- Resolves all $ref pointers, including circular
50+
- Typescript syntax support out of the box
51+
- Can be used in nodejs or browser
52+
53+
## Contributing
54+
When contributing, keep in mind that it is an objective of `api-smart-diff` to have no additional package dependencies. This may change in the future, but for now, no new dependencies.
55+
56+
Please run the unit tests before submitting your PR: `yarn test`. Hopefully your PR includes additional unit tests to illustrate your change/modification!

SECURITY.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Security Reporting Process
2+
3+
Please, report any security issue to `[email protected]` where the issue will be triaged appropriately.
4+
5+
If you know of a publicly disclosed security vulnerability please IMMEDIATELY email `[email protected]`
6+
to inform the team about the vulnerability, so we may start the patch, release, and communication process.
7+
8+
# Security Release Process
9+
10+
If the vulnerability is found in the latest stable release, then it would be fixed in patch version for that release.
11+
E.g., issue is found in 2.5.0 release, then 2.5.1 version with a fix will be released.
12+
By default, older versions will not have security releases.
13+
14+
If the issue doesn't affect any existing public releases, the fix for medium and high issues is performed
15+
in a main branch before releasing a new version. For low priority issues the fix can be planned for future releases.
16+

0 commit comments

Comments
 (0)