Skip to content
Merged
Show file tree
Hide file tree
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 Oct 19, 2025
f4da8c8
feat: async v3 refractor specification
lukaszzazulak Oct 20, 2025
35a3a8b
feat(ls): async v3 refractor specification
lukaszzazulak Oct 20, 2025
e058a6f
feat: async v3 refractor specification
lukaszzazulak Oct 20, 2025
03d731d
feat: async v3 binding elements
lukaszzazulak Oct 21, 2025
410875d
feat: async v3 binding elements
lukaszzazulak Oct 21, 2025
33995da
feat: async v3 binding elements
lukaszzazulak Oct 21, 2025
baa0c78
feat: async v3 binding elements
lukaszzazulak Oct 21, 2025
9540dad
feat: async v3 binding elements
lukaszzazulak Oct 21, 2025
7eb7bf1
feat: async v3 binding elements
lukaszzazulak Oct 21, 2025
71cc9fa
feat: async v3 binding elements
lukaszzazulak Oct 21, 2025
c28df59
feat: async v3 binding elements
lukaszzazulak Oct 21, 2025
a262c01
feat: async v3 binding elements
lukaszzazulak Oct 21, 2025
395cae6
feat: async v3 license, contact visitor
lukaszzazulak Oct 21, 2025
ced8787
feat: async v3 Servers hint
lukaszzazulak Oct 21, 2025
dbf0d83
feat: add visitors
ShikhaSaboo Oct 27, 2025
2f9420b
feat: add missing visitors for async-api-3
ShikhaSaboo Oct 28, 2025
1488b4a
Merge branch 'main' into feat/OSS-247-namespace-for-apidom-ns-async-a…
ShikhaSaboo Oct 29, 2025
909e34e
feat: add specification
ShikhaSaboo Oct 29, 2025
6b6a72e
feat: add missing refractor files
ShikhaSaboo Nov 3, 2025
172a537
feat: update namespace and public tags
ShikhaSaboo Nov 4, 2025
7a81ba0
feat: fix lint issues
ShikhaSaboo Nov 4, 2025
b072f5f
feat: fix eslint issue
ShikhaSaboo Nov 4, 2025
d2854f8
chore: resolve review comments
ShikhaSaboo Nov 6, 2025
62d11cf
chore: update ts type
ShikhaSaboo Nov 7, 2025
19980fd
test(ns-asyncapi-3): add tests for AsyncAPI 3 namespace (#5039)
glowcloud Nov 7, 2025
ec9471c
Merge branch 'main' into feat/OSS-247-namespace-for-apidom-ns-async-a…
ShikhaSaboo Nov 10, 2025
b66b50a
chore: update dependency version
ShikhaSaboo Nov 10, 2025
33a7028
chore: fix lint issue
ShikhaSaboo Nov 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/apidom-ns-asyncapi-3/.gitignore
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
5 changes: 5 additions & 0 deletions packages/apidom-ns-asyncapi-3/README.md
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`.
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 packages/apidom-ns-asyncapi-3/config/webpack/browser.config.js
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 packages/apidom-ns-asyncapi-3/config/webpack/traits.config.js
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,
},
},
}),
],
},
};
54 changes: 54 additions & 0 deletions packages/apidom-ns-asyncapi-3/package.json
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"
]
}
49 changes: 49 additions & 0 deletions packages/apidom-ns-asyncapi-3/src/elements/AsyncApi3.ts
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.',
);
}

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 {
return this.get('operations');
}

set operations(val) {
this.set('operations', val);
}
}

export default AsyncApi3;
8 changes: 8 additions & 0 deletions packages/apidom-ns-asyncapi-3/src/elements/AsyncApiVersion.ts
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;
95 changes: 95 additions & 0 deletions packages/apidom-ns-asyncapi-3/src/elements/Channel.ts
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 packages/apidom-ns-asyncapi-3/src/elements/ChannelBindings.ts
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;
31 changes: 31 additions & 0 deletions packages/apidom-ns-asyncapi-3/src/elements/Channels.ts
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 {
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;
Loading
Loading