-
Notifications
You must be signed in to change notification settings - Fork 21
feat: add package for apidom-ns-async-api-3 #5032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cka121
merged 29 commits into
main
from
feat/OSS-247-namespace-for-apidom-ns-async-api-3
Nov 10, 2025
Merged
Changes from 16 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
ca0487f
feat: add package for apidom-ns-async-api-3
ShikhaSaboo f4da8c8
feat: async v3 refractor specification
lukaszzazulak 35a3a8b
feat(ls): async v3 refractor specification
lukaszzazulak e058a6f
feat: async v3 refractor specification
lukaszzazulak 03d731d
feat: async v3 binding elements
lukaszzazulak 410875d
feat: async v3 binding elements
lukaszzazulak 33995da
feat: async v3 binding elements
lukaszzazulak baa0c78
feat: async v3 binding elements
lukaszzazulak 9540dad
feat: async v3 binding elements
lukaszzazulak 7eb7bf1
feat: async v3 binding elements
lukaszzazulak 71cc9fa
feat: async v3 binding elements
lukaszzazulak c28df59
feat: async v3 binding elements
lukaszzazulak a262c01
feat: async v3 binding elements
lukaszzazulak 395cae6
feat: async v3 license, contact visitor
lukaszzazulak ced8787
feat: async v3 Servers hint
lukaszzazulak dbf0d83
feat: add visitors
ShikhaSaboo 2f9420b
feat: add missing visitors for async-api-3
ShikhaSaboo 1488b4a
Merge branch 'main' into feat/OSS-247-namespace-for-apidom-ns-async-a…
ShikhaSaboo 909e34e
feat: add specification
ShikhaSaboo 6b6a72e
feat: add missing refractor files
ShikhaSaboo 172a537
feat: update namespace and public tags
ShikhaSaboo 7a81ba0
feat: fix lint issues
ShikhaSaboo b072f5f
feat: fix eslint issue
ShikhaSaboo d2854f8
chore: resolve review comments
ShikhaSaboo 62d11cf
chore: update ts type
ShikhaSaboo 19980fd
test(ns-asyncapi-3): add tests for AsyncAPI 3 namespace (#5039)
glowcloud ec9471c
Merge branch 'main' into feat/OSS-247-namespace-for-apidom-ns-async-a…
ShikhaSaboo b66b50a
chore: update dependency version
ShikhaSaboo 33a7028
chore: fix lint issue
ShikhaSaboo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /src/**/*.mjs | ||
| /src/**/*.cjs | ||
| /test/**/*.mjs | ||
| /dist | ||
| /types | ||
| /NOTICE | ||
| /swagger-api-apidom-ns-asyncapi-3-*.tgz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # apidom-ns-asyncapi-3 | ||
|
|
||
| AsyncAPI 3.x.y namespace for ApiDOM. | ||
|
|
||
| This is a starter scaffold. Implement element classes, predicates and refractor visitors following the pattern from `apidom-ns-asyncapi-2`. |
4 changes: 4 additions & 0 deletions
4
packages/apidom-ns-asyncapi-3/config/api-extractor/api-extractor.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "extends": "../../../../api-extractor.json" | ||
| } |
74 changes: 74 additions & 0 deletions
74
packages/apidom-ns-asyncapi-3/config/webpack/browser.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import path from 'node:path'; | ||
| import { nonMinimizeTrait, minimizeTrait } from './traits.config.js'; | ||
|
|
||
| const browser = { | ||
| mode: 'production', | ||
| entry: ['./src/index.ts'], | ||
| target: 'web', | ||
| performance: { | ||
| maxEntrypointSize: 2200000, | ||
| maxAssetSize: 2200000, | ||
| }, | ||
| output: { | ||
| path: path.resolve('./dist'), | ||
| filename: 'apidom-ns-asyncapi-3.browser.js', | ||
| libraryTarget: 'umd', | ||
| library: 'apidomNsAsyncApi3', | ||
| }, | ||
| resolve: { | ||
| extensions: ['.ts', '.mjs', '.js', '.json'], | ||
| }, | ||
| module: { | ||
| rules: [ | ||
| { | ||
| test: /\.(ts|js)?$/, | ||
| exclude: /node_modules/, | ||
| use: { | ||
| loader: 'babel-loader', | ||
| options: { | ||
| babelrc: true, | ||
| rootMode: 'upward', | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| }, | ||
| ...nonMinimizeTrait, | ||
| }; | ||
|
|
||
| const browserMin = { | ||
| mode: 'production', | ||
| entry: ['./src/index.ts'], | ||
| target: 'web', | ||
| performance: { | ||
| maxEntrypointSize: 310000, | ||
| maxAssetSize: 310000, | ||
| }, | ||
| output: { | ||
| path: path.resolve('./dist'), | ||
| filename: 'apidom-ns-asyncapi-3.browser.min.js', | ||
| libraryTarget: 'umd', | ||
| library: 'apidomNsAsyncApi3', | ||
| }, | ||
| resolve: { | ||
| extensions: ['.ts', '.mjs', '.js', '.json'], | ||
| }, | ||
| module: { | ||
| rules: [ | ||
| { | ||
| test: /\.(ts|js)?$/, | ||
| exclude: /node_modules/, | ||
| use: { | ||
| loader: 'babel-loader', | ||
| options: { | ||
| babelrc: true, | ||
| rootMode: 'upward', | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| }, | ||
| ...minimizeTrait, | ||
| }; | ||
|
|
||
| export default [browser, browserMin]; |
32 changes: 32 additions & 0 deletions
32
packages/apidom-ns-asyncapi-3/config/webpack/traits.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import webpack from 'webpack'; | ||
| import TerserPlugin from 'terser-webpack-plugin'; | ||
|
|
||
| export const nonMinimizeTrait = { | ||
| optimization: { | ||
| minimize: false, | ||
| usedExports: false, | ||
| concatenateModules: false, | ||
| }, | ||
| }; | ||
|
|
||
| export const minimizeTrait = { | ||
| plugins: [ | ||
| new webpack.LoaderOptionsPlugin({ | ||
| minimize: true, | ||
| }), | ||
| ], | ||
| optimization: { | ||
| minimizer: [ | ||
| new TerserPlugin({ | ||
| terserOptions: { | ||
| compress: { | ||
| warnings: false, | ||
| }, | ||
| output: { | ||
| comments: false, | ||
| }, | ||
| }, | ||
| }), | ||
| ], | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| { | ||
| "name": "@swagger-api/apidom-ns-asyncapi-3", | ||
| "version": "1.0.0-beta.0", | ||
| "description": "AsyncAPI 3.x.y namespace for ApiDOM.", | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "registry": "https://registry.npmjs.org" | ||
| }, | ||
| "type": "module", | ||
| "sideEffects": [], | ||
| "main": "./src/index.cjs", | ||
| "exports": { | ||
| "types": "./types/apidom-ns-asyncapi-3.d.ts", | ||
| "import": "./src/index.mjs", | ||
| "require": "./src/index.cjs" | ||
| }, | ||
| "types": "./types/apidom-ns-asyncapi-3.d.ts", | ||
| "scripts": { | ||
| "build": "npm run clean && run-p --max-parallel ${CPU_CORES:-2} typescript:declaration build:es build:cjs build:umd:browser", | ||
| "build:es": "cross-env BABEL_ENV=es babel src --out-dir src --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward'", | ||
| "build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir src --extensions '.ts' --out-file-extension '.cjs' --root-mode 'upward'", | ||
| "build:umd:browser": "cross-env BABEL_ENV=browser webpack --config config/webpack/browser.config.js --progress", | ||
| "lint": "eslint ./", | ||
| "lint:fix": "eslint ./ --fix", | ||
| "clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' ./dist ./types", | ||
| "test": "NODE_ENV=test ts-mocha --project tsconfig.json --exit \"test/**/*.ts\"", | ||
| "typescript:declaration": "tsc -p tsconfig.declaration.json && api-extractor run -l -c ./config/api-extractor/api-extractor.json 2>&1 | shx grep -v 'Visitor_base'" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/swagger-api/apidom.git" | ||
| }, | ||
| "author": "apidom team", | ||
| "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@babel/runtime-corejs3": "^7.26.10", | ||
| "@swagger-api/apidom-core": "^1.0.0-beta.51", | ||
| "@swagger-api/apidom-ns-asyncapi-2": "workspace:^1.0.0-beta.51", | ||
| "@types/ramda": "~0.30.0", | ||
| "ramda": "~0.30.0", | ||
| "ramda-adjunct": "^5.0.0", | ||
| "ts-mixer": "^6.0.3" | ||
| }, | ||
| "files": [ | ||
| "src/**/*.mjs", | ||
| "src/**/*.cjs", | ||
| "dist/", | ||
| "types/apidom-ns-asyncapi-3.d.ts", | ||
| "LICENSES", | ||
| "NOTICE", | ||
| "README.md", | ||
| "CHANGELOG.md" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { Attributes, Meta } from '@swagger-api/apidom-core'; | ||
| import { UnsupportedOperationError } from '@swagger-api/apidom-error'; | ||
| import { ExternalDocumentationElement, AsyncApi2Element, TagsElement } from '@swagger-api/apidom-ns-asyncapi-2'; | ||
| import OperationElement from './Operation.ts'; | ||
|
|
||
| /** | ||
| * @public | ||
| */ | ||
| class AsyncApi3 extends AsyncApi2Element { | ||
| constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) { | ||
| super(content, meta, attributes); | ||
| this.element = 'asyncApi3'; | ||
| this.classes.push('api'); | ||
| } | ||
|
|
||
| get tags(): TagsElement | undefined { | ||
| throw new UnsupportedOperationError( | ||
| 'TagsElement keyword from Core vocabulary has been moved to Info.', | ||
cka121 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ); | ||
| } | ||
|
|
||
| set tags(tags: TagsElement | undefined) { | ||
| throw new UnsupportedOperationError( | ||
| 'TagsElement keyword from Core vocabulary has been moved to Info.', | ||
| ); | ||
| } | ||
|
|
||
| get externalDocs(): ExternalDocumentationElement | undefined { | ||
| throw new UnsupportedOperationError( | ||
| 'ExternalDocsElement keyword from Core vocabulary has been moved to Info.', | ||
| ); | ||
| } | ||
|
|
||
| set externalDocs(externalDocs: ExternalDocumentationElement | undefined) { | ||
| throw new UnsupportedOperationError( | ||
| 'ExternalDocsElement keyword from Core vocabulary has been moved to Info.', | ||
| ); | ||
| } | ||
|
|
||
| get operations(): OperationElement { | ||
cka121 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return this.get('operations'); | ||
| } | ||
|
|
||
| set operations(val) { | ||
cka121 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| this.set('operations', val); | ||
| } | ||
| } | ||
|
|
||
| export default AsyncApi3; | ||
8 changes: 8 additions & 0 deletions
8
packages/apidom-ns-asyncapi-3/src/elements/AsyncApiVersion.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { AsyncApiVersionElement } from '@swagger-api/apidom-ns-asyncapi-2'; | ||
|
|
||
| /** | ||
| * @public | ||
| */ | ||
| class AsyncApiVersion extends AsyncApiVersionElement {} | ||
|
|
||
| export default AsyncApiVersion; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| import { ObjectElement, Attributes, Meta, StringElement } from '@swagger-api/apidom-core'; | ||
| import MessagesElement from './Messages.ts'; | ||
| import type { ArrayElement } from '@swagger-api/apidom-core'; | ||
| import ParametersElement from './Parameters.ts'; | ||
| import TagsElement from './Tags.ts'; | ||
| import ExternalDocumentationElement from './ExternalDocumentation.ts'; | ||
| import ReferenceElement from './Reference.ts'; | ||
| import ChannelBindingsElement from './ChannelBindings.ts'; | ||
|
|
||
| /** | ||
| * @public | ||
| */ | ||
| class Channel extends ObjectElement { | ||
| constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) { | ||
| super(content, meta, attributes); | ||
| this.element = 'channel'; | ||
| } | ||
|
|
||
| get address(): StringElement | null { | ||
| return this.get('address'); | ||
| } | ||
|
|
||
| set address(address: StringElement | null) { | ||
| this.set('address', address); | ||
| } | ||
|
|
||
| get messages(): MessagesElement | undefined { | ||
| return this.get('messages'); | ||
| } | ||
|
|
||
| set messages(messages: MessagesElement | undefined) { | ||
| this.set('messages', messages); | ||
| } | ||
|
|
||
| get title(): StringElement | undefined { | ||
| return this.get('title'); | ||
| } | ||
| set title(title: StringElement | undefined) { | ||
| this.set('title', title); | ||
| } | ||
|
|
||
| get description(): StringElement | undefined { | ||
| return this.get('description'); | ||
| } | ||
| set description(description: StringElement | undefined) { | ||
| this.set('description', description); | ||
| } | ||
|
|
||
| get summary(): StringElement | undefined { | ||
| return this.get('summary'); | ||
| } | ||
| set summary(summary: StringElement | undefined) { | ||
| this.set('summary', summary); | ||
| } | ||
|
|
||
| get servers(): ArrayElement | undefined { | ||
| return this.get('servers'); | ||
| } | ||
|
|
||
| set servers(servers: import('@swagger-api/apidom-core').ArrayElement | undefined) { | ||
| this.set('servers', servers); | ||
| } | ||
|
|
||
| get parameters(): ParametersElement | undefined { | ||
| return this.get('parameters'); | ||
| } | ||
| set parameters(parameters: ParametersElement | undefined) { | ||
| this.set('parameters', parameters); | ||
| } | ||
|
|
||
| get tags(): TagsElement | undefined { | ||
| return this.get('tags'); | ||
| } | ||
| set tags(tags: TagsElement | undefined) { | ||
| this.set('tags', tags); | ||
| } | ||
|
|
||
| get externalDocs(): ExternalDocumentationElement | ReferenceElement | undefined { | ||
| return this.get('externalDocs'); | ||
| } | ||
| set externalDocs(externalDocs: ExternalDocumentationElement | ReferenceElement | undefined) { | ||
| this.set('externalDocs', externalDocs); | ||
| } | ||
|
|
||
| get bindings(): ChannelBindingsElement | undefined { | ||
| return this.get('bindings'); | ||
| } | ||
|
|
||
| set bindings(bindings: ChannelBindingsElement | undefined) { | ||
| this.set('bindings', bindings); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| export default Channel; |
8 changes: 8 additions & 0 deletions
8
packages/apidom-ns-asyncapi-3/src/elements/ChannelBindings.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { ChannelBindingsElement } from "@swagger-api/apidom-ns-asyncapi-2"; | ||
|
|
||
| /** | ||
| * @public | ||
| */ | ||
| class ChannelBindings extends ChannelBindingsElement {} | ||
|
|
||
| export default ChannelBindings; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { Attributes, Meta, StringElement } from '@swagger-api/apidom-core'; | ||
| import {ChannelsElement } from '@swagger-api/apidom-ns-asyncapi-2'; | ||
| import ChannelElement from './Channel.ts'; | ||
|
|
||
| /** | ||
| * @public | ||
| */ | ||
| class Channels extends ChannelsElement { | ||
cka121 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) { | ||
| super(content, meta, attributes); | ||
| this.element = 'channels'; | ||
| } | ||
|
|
||
| get channel(): ChannelElement | undefined { | ||
| return this.get('channel'); | ||
| } | ||
|
|
||
| set channel(channel: ChannelElement | undefined) { | ||
| this.set('channel', channel); | ||
| } | ||
|
|
||
| get $ref(): StringElement | undefined { | ||
| return this.get('$ref'); | ||
| } | ||
|
|
||
| set $ref($ref: StringElement | undefined) { | ||
| this.set('$ref', $ref); | ||
| } | ||
| } | ||
|
|
||
| export default Channels; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.