diff --git a/front-end/studio/src/app/editor.module.ts b/front-end/studio/src/app/editor.module.ts index f3675cca3..6617651df 100644 --- a/front-end/studio/src/app/editor.module.ts +++ b/front-end/studio/src/app/editor.module.ts @@ -28,12 +28,15 @@ import {AddTagDialogComponent} from "./pages/apis/{apiId}/editor/_components/dia import {CloneDefinitionDialogComponent} from "./pages/apis/{apiId}/editor/_components/dialogs/clone-definition.component"; import {ClonePathDialogComponent} from "./pages/apis/{apiId}/editor/_components/dialogs/clone-path.component"; import {PropertyRowComponent} from "./pages/apis/{apiId}/editor/_components/forms/definition/property-row.component"; +import {OneOfRowComponent} from "./pages/apis/{apiId}/editor/_components/forms/definition/oneof-row.component"; import {ServersSectionComponent} from "./pages/apis/{apiId}/editor/_components/forms/shared/servers-section.component"; import {DefinitionItemComponent} from "./pages/apis/{apiId}/editor/_components/forms/definition-item.component"; import {DefinitionFormComponent} from "./pages/apis/{apiId}/editor/_components/forms/definition-form.component"; import {PathFormComponent} from "./pages/apis/{apiId}/editor/_components/forms/path-form.component"; import {ChannelFormComponent} from "./pages/apis/{apiId}/editor/_components/forms/channel-form.component"; import {MessageTraitFormComponent} from "./pages/apis/{apiId}/editor/_components/forms/messagetrait-form.component"; +import {MessageFormComponent} from "./pages/apis/{apiId}/editor/_components/forms/message-form.component"; +import {MessageItemComponent} from "./pages/apis/{apiId}/editor/_components/forms/message-item.component"; import {MessageTraitItemComponent} from "./pages/apis/{apiId}/editor/_components/forms/messagetrait-item.component"; import {OperationTraitFormComponent} from "./pages/apis/{apiId}/editor/_components/forms/operationtrait-form.component"; import {OperationTraitItemComponent} from "./pages/apis/{apiId}/editor/_components/forms/operationtrait-item.component"; @@ -156,6 +159,9 @@ import {HttpHeadersComponent} from "./pages/apis/{apiId}/editor/_components/form import {HeaderRowComponent} from "./pages/apis/{apiId}/editor/_components/forms/shared/header-row.component"; import {AddHeaderDialogComponent} from "./pages/apis/{apiId}/editor/_components/dialogs/add-header.component"; import {CloneChannelDialogComponent} from "./pages/apis/{apiId}/editor/_components/dialogs/clone-channel.component"; +import {MessageEditorComponent} from "./pages/apis/{apiId}/editor/_components/editors/message-editor.component"; +import {OneOfInMessageEditorComponent} from "./pages/apis/{apiId}/editor/_components/editors/oneof-in-message-editor.component"; +import {AddOneOfInMessageDialogComponent} from "./pages/apis/{apiId}/editor/_components/dialogs/add-message-reference.component"; @NgModule({ imports: [ @@ -167,11 +173,11 @@ import {CloneChannelDialogComponent} from "./pages/apis/{apiId}/editor/_componen ChannelOperationInfoSectionComponent, MessageSectionComponent, PayloadTabComponent, HeadersTabComponent, SetLicenseDialogComponent, ClonePathDialogComponent, CloneDefinitionDialogComponent, ScopesInputComponent, AddTagDialogComponent, UndoIconComponent, SchemaTypeEditorComponent, - NoOperationComponent, ContentComponent, HttpHeadersComponent, PropertyRowComponent, PathFormComponent, ChannelFormComponent, - MessageTraitFormComponent, MessageTraitItemComponent, OperationTraitFormComponent, OperationTraitItemComponent, + NoOperationComponent, ContentComponent, HttpHeadersComponent, PropertyRowComponent, OneOfRowComponent, PathFormComponent, ChannelFormComponent, + MessageTraitFormComponent, MessageFormComponent, MessageTraitItemComponent, MessageItemComponent, OperationTraitFormComponent, OperationTraitItemComponent, QueryParamRowComponent, SectionComponent, RequestBodySectionComponent, DefinitionItemComponent, DefinitionFormComponent, FormDataParamRowComponent, ResponseTab30Component, EditorMasterComponent, AsyncApiEditorMasterComponent, ApiEditorComponent, - AddPathDialogComponent, AddChannelDialogComponent, ParameterEditorComponent, AddResponseDialogComponent, + AddPathDialogComponent, AddChannelDialogComponent, AddOneOfInMessageDialogComponent, ParameterEditorComponent, AddResponseDialogComponent, CloneResponseDialogComponent, RedoIconComponent, PathInfoSectionComponent, OperationTraitEditorComponent, ChannelInfoSectionComponent, ResponseTabComponent, AddMediaTypeDialogComponent, AddHeaderDialogComponent, MainFormComponent, AsyncApiMainFormComponent, RenameEntityDialogComponent, AddExampleDialogComponent, EditExampleDialogComponent, AddExample20DialogComponent, @@ -187,7 +193,7 @@ import {CloneChannelDialogComponent} from "./pages/apis/{apiId}/editor/_componen InlineExampleEditorComponent, DefinitionExampleSectionComponent, PropertyEditorComponent, HeaderParamRowComponent, HeaderParamsSectionComponent, OperationsSectionComponent, ChannelOperationsSectionComponent, MediaTypeRowComponent, HeaderRowComponent, CollaboratorAggregateComponent, CollaboratorOverlayComponent, CookieParamsSectionComponent, CookieParamRowComponent, - ResponseEditorComponent, MessageTraitEditorComponent, ResponseFormComponent, CloneResponseDefinitionDialogComponent, + ResponseEditorComponent, MessageTraitEditorComponent, MessageEditorComponent, OneOfInMessageEditorComponent, ResponseFormComponent, CloneResponseDefinitionDialogComponent, AsyncApiEditorComponent, GraphQLEditorComponent, PropertiesSectionComponent, InheritanceSchemasSectionComponent, SchemaRowComponent, AddSchemaDialogComponent, CloneChannelDialogComponent ], diff --git a/front-end/studio/src/app/pages/apis/{apiId}/_components/import-components.wizard.ts b/front-end/studio/src/app/pages/apis/{apiId}/_components/import-components.wizard.ts index a0dd0965b..158eba0d1 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/_components/import-components.wizard.ts +++ b/front-end/studio/src/app/pages/apis/{apiId}/_components/import-components.wizard.ts @@ -24,11 +24,14 @@ import {ComponentType} from "../editor/_models/component-type.model"; import {DataTableColumn, DataTableRow} from "../../../../components/common/data-table.component"; import * as moment from "moment"; import { + AaiComponents, CombinedVisitorAdapter, + Components, Document, DocumentType, IDefinition, Library, + NodeCompat, TraverserDirection } from "apicurio-data-models"; @@ -416,6 +419,8 @@ class ComponentFinder extends CombinedVisitorAdapter { return "#/components/securitySchemes/"; case ComponentType.link: return "#/components/links/"; + case ComponentType.message: + return "#/components/messages/"; case ComponentType.messageTrait: return "#/components/messageTraits"; } @@ -433,6 +438,20 @@ class ComponentFinder extends CombinedVisitorAdapter { } } + visitComponents(node: Components): void { + if (this.type == ComponentType.message) { + let messages: Components = (node)?.messages; + + if(NodeCompat.isDefined(messages)){ + Object.keys(messages).forEach((messageName)=>{ + this.componentFound(messages[messageName]) + + }) + } + + } + } + visitMessageTraitDefinition(node: IDefinition): void { if (this.type == ComponentType.messageTrait) { this.componentFound(node); diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.css b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.css index b777da526..10415b2d9 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.css +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.css @@ -72,6 +72,43 @@ margin-right: 4px; } +.aai-editor .editor-master .editor-outline .api-message { + padding-left: 15px; + font-size: 14px; +} +.aai-editor .editor-master .editor-outline .api-message.hover { + cursor: pointer; + background-color: #d1eaf7; +} +.aai-editor .editor-master .editor-outline .api-message.selected { + background-color: #a5d6ef; + border-left: 2px solid #39a5dc; +} +.aai-editor .editor-master .editor-outline .api-message.contexted, +.aai-editor .editor-master .editor-outline .api-message.contexted:hover { + background-color: #FFCC87; + border-left: 2px dotted #E89F3D; +} +.aai-editor .editor-master .editor-outline .api-message.selected .label { + -webkit-transition: border-color 350ms, box-shadow 350ms; + -moz-transition: border-color 350ms, box-shadow 350ms; + -ms-transition: border-color 350ms, box-shadow 350ms; + -o-transition: border-color 350ms, box-shadow 350ms; + transition: border-color 350ms, box-shadow 350ms; +} +.aai-editor .editor-master .editor-outline .api-message.selected .label:hover { + box-shadow: 0 0 3px #646464; + border: 1px solid #666; +} +.aai-editor .editor-master .editor-outline .api-message.selected .label.selected { + border: 1px solid black; + box-shadow: 0 0 3px #141414; +} + +.api-message-item > * { + margin-right: 4px; +} + .editor-master .editor-outline .master-entity-list { border: 1px solid transparent; } diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.html b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.html index 396cf12b5..78a72bca0 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.html +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.html @@ -87,6 +87,25 @@ + + + + +
+ + + + +
+ + No messages have been created. + Add a message + + +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.ts index fc151f322..c90f1f408 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.ts +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/aaimaster.component.ts @@ -40,7 +40,7 @@ import { AaiMessageTraitDefinition, AaiOperationTraitDefinition, TraverserDirection, - VisitorUtil + VisitorUtil, AaiMessage } from "apicurio-data-models"; import {AddChannelDialogComponent} from "./dialogs/add-channel.component"; import {CloneDefinitionDialogComponent} from "./dialogs/clone-definition.component"; @@ -65,6 +65,8 @@ import { IOperationTraitEditorHandler, OperationTraitData, OperationTraitEditorC import { IMessageTraitEditorHandler, MessageTraitData, MessageTraitEditorComponent } from "./editors/messagetrait-editor.component"; import {CloneChannelDialogComponent} from "./dialogs/clone-channel.component"; import {ConfigService} from "../../../../../services/config.service"; +import {FindMessageDefinitionsVisitor} from "../_visitors/message-definitions.visitor"; +import {IMessageEditorHandler, MessageData, MessageEditorComponent} from "./editors/message-editor.component"; /** @@ -105,11 +107,14 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { @ViewChild("renameOperationTraitDialog") renameOperationTraitDialog: RenameEntityDialogComponent; @ViewChild("renameMessageTraitDialog", { static: true }) renameMessageTraitDialog: RenameEntityDialogComponent; + @ViewChild("renameMessageDialog", { static: true }) renameMessageDialog: RenameEntityDialogComponent; + filterCriteria: string = null; _channels: AaiChannelItem[]; _defs: Aai20SchemaDefinition[]; _opTraitsDefs: AaiOperationTraitDefinition[]; _msgTraitsDefs: AaiMessageTraitDefinition[]; + _msgsDefs: AaiMessage[]; /** * C'tor. @@ -139,6 +144,7 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { this._defs = null; this._opTraitsDefs = null; this._msgTraitsDefs = null; + this._msgsDefs = null; } public onChannelsKeypress(event: KeyboardEvent): void { @@ -203,6 +209,7 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { this._defs = null; this._opTraitsDefs = null; this._msgTraitsDefs = null; + this._msgsDefs = null; } /** @@ -299,6 +306,24 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { return this._msgTraitsDefs; } + /** + * Returns the array of message definitions, filtered by search criteria and sorted. + */ + public messages(): AaiMessage[]{ + if (!this._msgsDefs) { + if (this.document.components) { + let viz: FindMessageDefinitionsVisitor = new FindMessageDefinitionsVisitor(this.filterCriteria); + this.document.components.getMessagesList().forEach( msgDef => { + VisitorUtil.visitNode(msgDef, viz); + }) + this._msgsDefs = viz.getSortedMessageDefinitions(); + } else { + this._msgsDefs = []; + } + } + return this._msgsDefs; + } + /** * Returns true if the messageTraits have been initialized to non empty */ @@ -307,6 +332,14 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { return !!messageTraitList && messageTraitList.length > 0; } + /** + * Returns true if the messages have been initialized to non empty + */ + public hasMessages(): boolean { + let messageList = this.messages(); + return !!messageList && messageList.length > 0; + } + /** * Gets a definition by its name. * @param name @@ -581,7 +614,52 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { this.commandService.emit(command); this.closeContextMenu(); } - + + /** + * Called when the user fills out the Add Message page and clicks Add. + */ + public addMessage(mes: MessageData): void { + console.info("[AsyncAPIEditorMasterComponent] Adding a message: ", mes); + let command: ICommand = CommandFactory.createNewMessageDefinitionCommand(mes.name, mes.description); + this.commandService.emit(command); + this.deselectMessage(); + } + + /** + * Called when the user clicks "Rename Message" in the context-menu for a Message. + */ + public renameMessage(event?: RenameEntityEvent): void { + if (undefined === event || event === null) { + let message: AaiMessageTraitDefinition = this.contextMenuSelection.resolve(this.document); + let name: string = message.getName(); + let messageNames: string[] = []; + VisitorUtil.visitTree(this.document, new class extends CombinedVisitorAdapter { + public visitMessage(node: AaiMessage): void { + messageNames.push(node.getName()); + } + }, TraverserDirection.down); + this.renameMessageDialog.open(message, name, newName => { + return messageNames.indexOf(newName) !== -1; + }); + } else { + let message: AaiMessage = event.entity; + let oldName: string = message.getName(); + console.info("[AsyncApiEditorMasterComponent] Rename message to: %s", event.newName); + let command: ICommand = CommandFactory.createRenameMessageDefinitionCommand(oldName, event.newName); + this.commandService.emit(command); + } + } + + /** + * Called when the user clicks "Delete Message" in the context-menu for a trait. + */ + public deleteMessage(): void { + let definition: AaiMessage = this.contextMenuSelection.resolve(this.document) as AaiMessage; + let command: ICommand = CommandFactory.createDeleteMessageDefinitionCommand(definition.getName()); + this.commandService.emit(command); + this.closeContextMenu(); + } + /** * Converts a JSON formatted string example to an object. * @param from @@ -675,6 +753,14 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { this.__selectionService.selectNode(messageTraitDef); } + /** + * Called when the user selects a message definition from the master area. + * @param messageDef + */ + public selectMessage(messageDef: AaiMessage): void { + this.__selectionService.selectNode(messageDef); + } + /** * Deselects the currently selected message trait definition. */ @@ -682,6 +768,13 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { this.selectMain(); } + /** + * Deselects the currently selected message definition. + */ + public deselectMessage(): void { + this.selectMain(); + } + /** * Returns true if the given node is the currently selected item *or* is the parent * of the currently selected item. @@ -768,6 +861,20 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { this.contextMenuType = "messageTrait"; } + /** + * Called when the user right-clicks on a message definition. + * @param event + * @param msgDef + */ + public showMessageContextMenu(event: MouseEvent, msg: AaiMessage): void { + event.preventDefault(); + event.stopPropagation(); + this.contextMenuPos.left = event.clientX + "px"; + this.contextMenuPos.top = event.clientY + "px"; + this.contextMenuSelection = Library.createNodePath(msg); + this.contextMenuType = "message"; + } + /** * Called when the user clicks somewhere in the document. Used to close the context * menu if it is open. @@ -851,6 +958,15 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { return this.entityClasses(node); } + /** + * Returns the classes that should be applied to the message definition in the master view. + * @param node + * @return + */ + public messageClasses(node: Node): string { + return this.entityClasses(node); + } + /** * Opens the Add Definition Editor (full screen editor for adding a data type). */ @@ -893,6 +1009,20 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { dtEditor.open(handler, this.document); } + /** + * Opens the Add Message Editor (full screen editor for adding a data type). + */ + public openAddMessageEditor(): void { + let dtEditor: MessageEditorComponent = this.editors.getMessageEditor(); + let handler: IMessageEditorHandler = { + onSave: (event) => { + this.addMessage(event.data); + }, + onCancel: () => { /* Do nothing on cancel... */ } + }; + dtEditor.open(handler, this.document); + } + importsEnabled(): boolean { return this.features.getFeatures().componentImports; } @@ -904,6 +1034,10 @@ export class AsyncApiEditorMasterComponent extends AbstractBaseComponent { importMessageTraits(): void { this.onImportComponent.emit(ComponentType.messageTrait); } + + importMessages(): void { + this.onImportComponent.emit(ComponentType.message); + } } /** diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/dialogs/add-message-reference.component.html b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/dialogs/add-message-reference.component.html new file mode 100644 index 000000000..9d2c6eecf --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/dialogs/add-message-reference.component.html @@ -0,0 +1,33 @@ + + \ No newline at end of file diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/dialogs/add-message-reference.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/dialogs/add-message-reference.component.ts new file mode 100644 index 000000000..bd85839ec --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/dialogs/add-message-reference.component.ts @@ -0,0 +1,104 @@ +/** + * @license + * Copyright 2017 JBoss Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Component, ElementRef, EventEmitter, Input, Output, QueryList, ViewChildren} from "@angular/core"; +import {ModalDirective} from "ngx-bootstrap/modal"; +import {Aai20Schema, AaiDocument, AaiMessage} from "apicurio-data-models"; +import {ConfigService} from "../../../../../../services/config.service"; +import { + DIVIDER, + DropDownOption, + DropDownOptionValue as Value +} from "../../../../../../components/common/drop-down.component"; +import {ObjectUtils} from "apicurio-ts-core"; + + +@Component({ + selector: "add-oneof-in-message-dialog", + templateUrl: "add-message-reference.component.html" +}) +export class AddOneOfInMessageDialogComponent { + + @Input() messages: Aai20Schema[]; + @Output() onAdd: EventEmitter = new EventEmitter(); + + @ViewChildren("addReferenceModal") addReferenceModal: QueryList; + + private _isOpen: boolean = false; + + refSelected: string; + messagesFromDocument: string[] = []; + alreadyUsedReferences: string[] = []; + messagesFromDocExists: boolean = false; + private _referenceOptions: DropDownOption[] = []; + + constructor(configService: ConfigService){ + } + + /** + * Called to open the dialog. + * @param messages + */ + public open(messages: string[], referencesAlreadyAdded: string[]): void{ + this.messagesFromDocument = messages; + this.alreadyUsedReferences = referencesAlreadyAdded; + this.messagesFromDocExists = ObjectUtils.isNullOrUndefined(this.messagesFromDocument) || this.messagesFromDocument.length <= 0; + this._referenceOptions = messages.filter( f => !this.alreadyUsedReferences.includes(f) ).map(m => new Value(m,m)); + this._isOpen = true; + this.addReferenceModal.changes.subscribe(thing => { + if (this.addReferenceModal.first) { + this.addReferenceModal.first.show(); + } + }); + } + + referenceOptions(): DropDownOption[]{ + return this._referenceOptions; + } + + /** + * Called to close the dialog. + */ + close(): void{ + this._isOpen = false; + this.refSelected = null; + } + + /** + * Called when the user clicks "add". + */ + add(): void{ + this.onAdd.emit(this.refSelected); + this.cancel(); + } + + /** + * Called when the user clicks "cancel". + */ + cancel(): void{ + this.addReferenceModal.first.hide(); + } + + /** + * Returns true if the dialog is open. + * @return + */ + isOpen(): boolean{ + return this._isOpen; + } + +} diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/message-editor.component.css b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/message-editor.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/message-editor.component.html b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/message-editor.component.html new file mode 100644 index 000000000..1ff2b7660 --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/message-editor.component.html @@ -0,0 +1,35 @@ + + +
+
+

1. Enter Basic Information

+

+ + Enter a name and description for the new message. + +

+
+
+
+ +
+ + Name is required. + Enter a valid name (only alpha-numeric characters are allowed - no whitespace). +
Message named {{ model.name }} already exists.
+
+
+
+ +
+ +
+
+
+
+ +
diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/message-editor.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/message-editor.component.ts new file mode 100644 index 000000000..2d78fb7b4 --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/message-editor.component.ts @@ -0,0 +1,108 @@ +/** + * @license + * Copyright 2019 JBoss Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Component} from "@angular/core"; +import { + AaiMessage, + AaiDocument, + TraverserDirection, + VisitorUtil +} from "apicurio-data-models"; +import {EntityEditor, EntityEditorEvent, IEntityEditorHandler} from "./entity-editor.component"; +import {FindMessageDefinitionsVisitor} from "../../_visitors/message-definitions.visitor"; + + +export interface MessageData { + name: string; + description: string; +} + +export interface MessageEditorEvent extends EntityEditorEvent { + data: MessageData; +} + +export interface IMessageEditorHandler extends IEntityEditorHandler { + onSave(event: MessageEditorEvent): void; + onCancel(event: MessageEditorEvent): void; +} + + +@Component({ + selector: "message-editor", + templateUrl: "message-editor.component.html", + styleUrls: ["message-editor.component.css"] +}) +export class MessageEditorComponent extends EntityEditor { + + messages: string[] = []; + messageExists: boolean = false; + + public model: MessageData = { + name: "", + description: "" + }; + + public doAfterOpen(): void { + this.messages = []; + this.messageExists = false; + let mess: AaiMessage[] = this.getMessages( this.context.ownerDocument()); + this.messages = mess.map(definition => FindMessageDefinitionsVisitor.definitionName(definition)); + } + + /** + * Initializes the editor's data model from a provided entity (initialize the editor data model from an entity). + * @param entity + */ + public initializeModelFromEntity(entity: AaiMessage): void { + // Note: nothing to do here because data types aren't editable via the full screen editor. + } + + /** + * Initializes the editor's data model to an empty state. + */ + public initializeModel(): void { + this.model = { + name: "", + description: "" + }; + } + + /** + * Returns true if the data model is valid. + */ + public isValid(): boolean { + return this.model.name !== null && this.model.name.trim().length > 0 && !this.messageExists; + } + + /** + * Creates an entity event specific to this entity editor. + */ + public entityEvent(): MessageEditorEvent { + let event: MessageEditorEvent = { + entity: this.entity, + data: this.model + }; + return event; + } + + private getMessages(document: AaiDocument): AaiMessage[] { + let vizzy: FindMessageDefinitionsVisitor = new FindMessageDefinitionsVisitor(null); + VisitorUtil.visitTree(document, vizzy, TraverserDirection.down); + return vizzy.getSortedMessageDefinitions() + } + +} diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/oneof-in-message-editor.component.css b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/oneof-in-message-editor.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/oneof-in-message-editor.component.html b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/oneof-in-message-editor.component.html new file mode 100644 index 000000000..1ff2b7660 --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/oneof-in-message-editor.component.html @@ -0,0 +1,35 @@ + + +
+
+

1. Enter Basic Information

+

+ + Enter a name and description for the new message. + +

+
+
+
+ +
+ + Name is required. + Enter a valid name (only alpha-numeric characters are allowed - no whitespace). +
Message named {{ model.name }} already exists.
+
+
+
+ +
+ +
+
+
+
+ +
diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/oneof-in-message-editor.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/oneof-in-message-editor.component.ts new file mode 100644 index 000000000..dd6affbca --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/editors/oneof-in-message-editor.component.ts @@ -0,0 +1,111 @@ +/** + * @license + * Copyright 2019 JBoss Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author vvilerio + */ +import {Component} from "@angular/core"; +import { + AaiMessage, + AaiDocument, + TraverserDirection, + VisitorUtil +} from "apicurio-data-models"; +import {EntityEditor, EntityEditorEvent, IEntityEditorHandler} from "./entity-editor.component"; +import {FindMessageDefinitionsVisitor} from "../../_visitors/message-definitions.visitor"; + + +export interface MessageData { + name: string; + description: string; +} + +export interface OneOfInMessageEditorEvent extends EntityEditorEvent { + data: MessageData; +} + +export interface IOneOfInMessageEditorHandler extends IEntityEditorHandler { + onSave(event: OneOfInMessageEditorEvent): void; + onCancel(event: OneOfInMessageEditorEvent): void; +} + + +@Component({ + selector: "oneOfMessage-editor", + templateUrl: "oneof-in-message-editor.component.html", + styleUrls: ["oneof-in-message-editor.component.css"] +}) +export class OneOfInMessageEditorComponent extends EntityEditor { + + messages: string[] = []; + messageExists: boolean = false; + + public model: MessageData = { + name: "", + description: "" + }; + + public doAfterOpen(): void { + this.messages = []; + this.messageExists = false; + let mess: AaiMessage[] = this.getMessages( this.context.ownerDocument()); + this.messages = mess.map(definition => FindMessageDefinitionsVisitor.definitionName(definition)); + } + + /** + * Initializes the editor's data model from a provided entity (initialize the editor data model from an entity). + * @param entity + */ + public initializeModelFromEntity(entity: AaiMessage): void { + // Note: nothing to do here because data types aren't editable via the full screen editor. + } + + /** + * Initializes the editor's data model to an empty state. + */ + public initializeModel(): void { + this.model = { + name: "", + description: "" + }; + } + + /** + * Returns true if the data model is valid. + */ + public isValid(): boolean { + return this.model.name !== null && this.model.name.trim().length > 0 && !this.messageExists; + } + + /** + * Creates an entity event specific to this entity editor. + */ + public entityEvent(): OneOfInMessageEditorEvent { + let event: OneOfInMessageEditorEvent = { + entity: this.entity, + data: this.model + }; + return event; + } + + private getMessages(document: AaiDocument): AaiMessage[] { + let vizzy: FindMessageDefinitionsVisitor = new FindMessageDefinitionsVisitor(null); + VisitorUtil.visitTree(document, vizzy, TraverserDirection.down); + return vizzy.getSortedMessageDefinitions() + } + +} diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operation/message-section.component.html b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operation/message-section.component.html index 6c7ea0f71..f759613d3 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operation/message-section.component.html +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operation/message-section.component.html @@ -1,115 +1,127 @@
+ [validationModels]="[messageFromOperation()]" [validationProperties]="[ 'name', 'title', 'summary', 'description' ]"> +
- - No request body has been defined. + -
+
+ + +
+ Inheritance Type OneOf +

+ +
+ +
- + Name
-
- + Title
-
- + Summary
-
- + Description
-
-
+
- + Correlation ID
-
-
- +
+ Content Type
-
- + Schema Format
-
-
- +
+ Content
-
+ + diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operation/message-section.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operation/message-section.component.ts index 814814b9d..0ce48b235 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operation/message-section.component.ts +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operation/message-section.component.ts @@ -15,27 +15,33 @@ * limitations under the License. */ +import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, ViewEncapsulation} from "@angular/core"; import { - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - Input, - SimpleChanges, - ViewEncapsulation -} from "@angular/core"; -import { + AaiDocument, AaiMessage, AaiOperation, + CommandFactory, ICommand, - CommandFactory + Library, + NodePath, + ReferenceUtil } from "apicurio-data-models"; import {CommandService} from "../../../../_services/command.service"; import {AbstractBaseComponent} from "../../../common/base-component"; import {DocumentService} from "../../../../_services/document.service"; import {SelectionService} from "../../../../_services/selection.service"; import {ModelUtils} from "../../../../_util/model.util"; -import {DropDownOptionValue as Value} from "../../../../../../../../components/common/drop-down.component"; +import { + DropDownOption, + DropDownOptionValue as Value +} from "../../../../../../../../components/common/drop-down.component"; import {ObjectUtils} from "apicurio-ts-core"; +import {SchemaUtil} from "../../../../_util/schema.util"; +import {EditorsService} from "../../../../_services/editors.service"; + +const INHERITANCE_TYPES: DropDownOption[] = [ + new Value("OneOf", "oneOf") +]; @Component({ selector: "message-section", @@ -49,6 +55,7 @@ export class MessageSectionComponent extends AbstractBaseComponent { @Input() operation: AaiOperation; currentPart: string = 'payload'; + nodePathToDel: NodePath = undefined; /** * C'tor. @@ -56,15 +63,15 @@ export class MessageSectionComponent extends AbstractBaseComponent { * @param documentService * @param commandService * @param selectionService + * @param editors */ constructor(private changeDetectorRef: ChangeDetectorRef, private documentService: DocumentService, - private commandService: CommandService, private selectionService: SelectionService) { + private commandService: CommandService, private selectionService: SelectionService, private editors: EditorsService) { super(changeDetectorRef, documentService, selectionService); } ngOnInit(): void { console.log("operation.ownerDocument: " + this.operation.ownerDocument()); - console.log("operation.message: " + this.operation.message); if (this.operation.message != null) { console.log("operation.message.ownerDocument: " + this.operation.message.ownerDocument()); console.log("operation.message.name: " + this.operation.message.name); @@ -77,32 +84,72 @@ export class MessageSectionComponent extends AbstractBaseComponent { return ModelUtils.nodeToPath(this.operation) + "/message"; } - public addMessage(): void { - /* - let command: ICommand = CommandFactory.createNewRequestBodyCommand(this.operation.ownerDocument().getDocumentType(), this.operation); + /** + * Called when the user selects the main/default element from the master area. + */ + public selectMain(): void { + this.__selectionService.selectRoot(); + } + + /** + * Deselects the currently selected message definition. + */ + public deselectMessage(): void { + this.selectMain(); + } + + public addOneOf(newOneOf: string){ + let doc: AaiDocument = this.operation.ownerDocument() as AaiDocument; + let message: AaiMessage = doc.components.getMessage(newOneOf); + message.setReference(message.payload.$ref.replace("schemas","messages").replace(message.payload.$ref.split("/")[3],message.getName())); + message.name = null; + message.payload = null; + let command: ICommand = CommandFactory.createAddOneOfInMessageCommand(message,this.operation.message); + this.commandService.emit(command); + + let nodePath = Library.createNodePath(this.operation); + this.__selectionService.select(nodePath.toString()); + } + + public deleteMessageInOneOf(data: AaiMessage, idx: number): void { + let command: ICommand = CommandFactory.createDeleteOneOfMessageCommand(data, idx); this.commandService.emit(command); + let nodePath = Library.createNodePath(this.operation); - nodePath.appendSegment("requestBody", false); - this.selectionService.select(nodePath.toString()); - */ + this.__selectionService.select(nodePath.toString()); + } + + + public isMultiMessages(): boolean { + if (ObjectUtils.isNullOrUndefined((this.messageFromOperation()))) { + return false; + } + return !ObjectUtils.isNullOrUndefined((this.messageFromOperation().oneOf)) && this.messageFromOperation().oneOf.length > 0; } - public message(): AaiMessage { + //message from operation + public messageFromOperation(): AaiMessage { return this.operation.message; } + // Name Message list from document + public getMessagesFromDocument(): string[] { + let doc: AaiDocument = this.operation.ownerDocument() as AaiDocument; + return doc.components.getMessagesList().map( m => + m.getName() + ); + } + + public referenceAlreadyAdd(): string[] { + return this.operation.message.oneOf.map(m => m.getReference().split('/')[3]); + } + public hasMessage(): boolean { return !ObjectUtils.isNullOrUndefined((this.operation).message); } public schemaFormatOptions() { - return [ - new Value("application/vnd.aai.asyncapi;version=2.0.0", "application/vnd.aai.asyncapi;version=2.0.0"), - new Value("application/vnd.oai.openapi;version=3.0.0", "application/vnd.oai.openapi;version=3.0.0"), - new Value("application/application/schema+json;version=draft-07", "application/application/schema+json;version=draft-07"), - new Value("application/application/schema+yaml;version=draft-07", "application/application/schema+yaml;version=draft-07"), - new Value("application/vnd.apache.avro;version=1.9.0", "application/vnd.apache.avro;version=1.9.0") - ]; + return SchemaUtil.schemaFormatOptions; } public isPartActive(part: string): boolean { @@ -112,45 +159,55 @@ export class MessageSectionComponent extends AbstractBaseComponent { this.currentPart = part; } + public deref(message: AaiMessage){ + return ReferenceUtil.resolveFragmentFromJS(this.messageFromOperation().ownerDocument(), message.$ref); + } + public changeName(newName: string): void { - console.info("[MessageSectionComponent] Changing message name to: ", newName); - let command: ICommand = CommandFactory.createChangePropertyCommand(this.message(), + console.info("[MessageSectionComponent] Changing message name to: ", this.messageFromOperation()); + let command: ICommand = CommandFactory.createChangePropertyCommand(this.messageFromOperation(), "name", newName); this.commandService.emit(command); } public changeTitle(newTitle: string): void { console.info("[MessageSectionComponent] Changing message title to: ", newTitle); - let command: ICommand = CommandFactory.createChangePropertyCommand(this.message(), + let command: ICommand = CommandFactory.createChangePropertyCommand(this.messageFromOperation(), "title", newTitle); this.commandService.emit(command); } public changeSummary(newSummary: string): void { console.info("[MessageSectionComponent] Changing message summary to: ", newSummary); - let command: ICommand = CommandFactory.createChangePropertyCommand(this.message(), + let command: ICommand = CommandFactory.createChangePropertyCommand(this.messageFromOperation(), "summary", newSummary); this.commandService.emit(command); } public changeDescription(newDescription: string): void { console.info("[MessageSectionComponent] Changing message description to: ", newDescription); - let command: ICommand = CommandFactory.createChangePropertyCommand(this.message(), + let command: ICommand = CommandFactory.createChangePropertyCommand(this.messageFromOperation(), "description", newDescription); this.commandService.emit(command); } public changeContentType(newContentType: string): void { console.info("[MessageSectionComponent] Changing message contentType to: ", newContentType); - let command: ICommand = CommandFactory.createChangePropertyCommand(this.message(), + let command: ICommand = CommandFactory.createChangePropertyCommand(this.messageFromOperation(), "contentType", newContentType); this.commandService.emit(command); } public changeSchemaFormat(newSchemaFormat: boolean): void { console.info("[MessageSectionComponent] Changing message schemaFormat to: ", newSchemaFormat); - let command: ICommand = CommandFactory.createChangePropertyCommand(this.message(), + let command: ICommand = CommandFactory.createChangePropertyCommand(this.messageFromOperation(), "schemaFormat", newSchemaFormat); this.commandService.emit(command); } + + public inheritanceType(): string { + return "oneOf"; + } + + } \ No newline at end of file diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operations-section.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operations-section.component.ts index 83f53f954..901bbf0f3 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operations-section.component.ts +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/channel/operations-section.component.ts @@ -27,7 +27,6 @@ import { CommandFactory, ICommand, AaiChannelItem, - AaiDocument, AaiOperation } from "apicurio-data-models"; import {CommandService} from "../../../_services/command.service"; diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/definition/oneof-row.component.css b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/definition/oneof-row.component.css new file mode 100644 index 000000000..3ea0eae01 --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/definition/oneof-row.component.css @@ -0,0 +1,142 @@ +.oneof { + border: 1px solid transparent; + position: relative; +} + +.oneof.expanded { + border: 1px solid #bbb; + box-shadow: 0 2px 6px rgba(3, 3, 3, .2); + margin-bottom: 3px; +} + +.oneof-config-tabcontent { + margin-top: 8px; + padding-left: 10px; + padding-right: 10px; +} + +.oneof .header { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + padding: 8px; + padding-bottom: 3px; + border-bottom: 1px solid #f5f5f5; +} +.oneof .header:hover { + background-color: #edf8ff; +} +.oneof.expanded .header { + border-bottom: solid 1px #bbb; + background-color: #def3ff; +} + +.oneof .header .reference { + flex-basis: 20%; + overflow-x: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding-right: 5px; +} +.oneof .header .reference > span { + font-weight: 600; +} + +.oneof .header .name { + flex-basis: 40%; + overflow-x: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding-right: 5px; +} +.oneof .header .name > span { + font-weight: 600; +} +.oneof .header .oneof-value { + flex-basis: 40%; + overflow-x: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding-right: 5px; +} +.oneof .header .oneof-value:hover { + color: #0088ce; + cursor: pointer; +} + +.oneof .header .summary .oneof-sel { + font-weight: 600; + margin-right: 3px; +} +.oneof .header .summary .oneof-sel:hover { + filter: brightness(120%); +} + +.oneof .header .actions { + flex-basis: 2%; + text-align: center; +} + +.oneof .header > .selected { + margin-bottom: -4px; + border-bottom: 2px solid #0088ce; + color: #0088ce; +} + +.oneof .body { + position: relative; + padding: 15px; +} + +.oneof .body .close { + position: absolute; + right: 10px; + top: 5px; +} + +.oneof .body .oneof-description form { + width: 100%; +} + +.oneof .body .oneof-description .form-label { + font-weight: 600; +} + +.oneof .body span.strong { + font-weight: 600; +} + +.oneof .body .oneof-sel { + margin-bottom: 20px; +} +.oneof .body .oneof-type { + margin-bottom: 10px; +} + +.oneof .body .toggle-buttons{ + margin: 20px auto; +} + +.oneof .body .toggle-buttons button { + margin-left: 10px; +} + +.oneof .body .divider { + height: 1px; + width:100%; + display:block; + margin: 15px 0; + overflow: hidden; + background-color: #e5e5e5; +} + +.oneof .body .oneof-sel .dropdown { + display: inline-block; + margin-left: 3px; + margin-right: 3px; +} + +.oneof-label > label { + margin-bottom: 0px; + margin-top: 3px; +} diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/definition/oneof-row.component.html b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/definition/oneof-row.component.html new file mode 100644 index 000000000..486936689 --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/definition/oneof-row.component.html @@ -0,0 +1,44 @@ +
+
+
+ Reference +
+
+ {{oneOfName}} +
+
+ + {{item.oneOf}} + +
+
+ +
+
+
+
+
+
+
+
+ OneOf is + +
+
+
+
+
+
+
diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/definition/oneof-row.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/definition/oneof-row.component.ts new file mode 100644 index 000000000..a89caf702 --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/definition/oneof-row.component.ts @@ -0,0 +1,128 @@ +/** + * @license + * Copyright 2017 JBoss Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + EventEmitter, Input, + Output, + ViewEncapsulation +} from "@angular/core"; +import {DropDownOption, DropDownOptionValue as Value} from '../../../../../../../components/common/drop-down.component'; +import {CommandService} from "../../../_services/command.service"; +import {DocumentService} from "../../../_services/document.service"; +import {SelectionService} from "../../../_services/selection.service"; +import {AbstractRowComponent} from "../../common/item-row.abstract"; +import { + AaiDocument, + AaiMessage, + CommandFactory, DocumentType, + ICommand, + Oas20Schema, + Oas30Schema, ReferenceUtil, + SimplifiedParameterType, + SimplifiedPropertyType, SimplifiedType +} from "apicurio-data-models"; +import Oas20PropertySchema = Oas20Schema.Oas20PropertySchema; +import Oas30PropertySchema = Oas30Schema.Oas30PropertySchema; +import {newArray} from "@angular/compiler/src/util"; + +/** + * @author vvilerio + */ +@Component({ + selector: "oneof-row", + templateUrl: "oneof-row.component.html", + styleUrls: ["oneof-row.component.css"], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class OneOfRowComponent extends AbstractRowComponent { + + @Output() onDelete: EventEmitter = new EventEmitter(); + @Input() oneOfName: string; + + _ptab: string = null; + + /** + * C'tor. + * @param changeDetectorRef + * @param documentService + * @param commandService + * @param selectionService + */ + constructor(changeDetectorRef: ChangeDetectorRef, documentService: DocumentService, + private commandService: CommandService, selectionService: SelectionService) { + super(changeDetectorRef, documentService, selectionService); + } + + public isEditingOneOf(): boolean { + return this.isEditingTab("oneOf"); + } + + public isOneOf(): boolean { + return this.item._isOneOfMessage + } + + public oneOf(item): string { + return item.$ref; + } + + public oneOfOptions(item): DropDownOption[] { + var vals: Array = []; + var doc: AaiDocument = (this.item.ownerDocument()); + doc.components.getMessagesList().filter(f => f.getName() !== this.deref(item).getName()).forEach(mess => { + vals.push(new Value(mess.getName(), "#/component/messages/".concat(mess.getName()))); + }) + return vals; + } + + public toggleOneOf(): void { + this.toggleTab("oneOf"); + } + + public delete(): void { + this.onDelete.emit(); + } + + public deref(message: AaiMessage){ + return ReferenceUtil.resolveFragmentFromJS(this.item.parent().ownerDocument(), message.$ref); + } + + public displayOneOf(): string { + return "[".concat(this.item.$ref).concat("]"); + } + + public setNumValue(val: string, name: string): void { + let command: ICommand = CommandFactory.createChangePropertyCommand(this.item, name, Number(val)); + this.commandService.emit(command); + } + + public changeOneOf(newValue: string): void {//TODO + // this.model().required = newValue === "required"; + // let nt: SimplifiedPropertyType = SimplifiedPropertyType.fromPropertySchema(this.item); + // nt.required = this.model().required; + // let command: ICommand = CommandFactory.createChangePropertyTypeCommand(this.item, nt); + // this.commandService.emit(command); + } + + protected updateModel(): void { + // this._model = SimplifiedPropertyType.fromPropertySchema(this.item); + } + +} diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-form.component.css b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-form.component.css new file mode 100644 index 000000000..4c440a8cc --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-form.component.css @@ -0,0 +1,88 @@ +.half-section { + width: 50%; + display: inline-block; +} + +.half-section.right { + float: right; +} + +.parts-tabs { + display: flex; + width: 100%; + margin-top: 5px; +} + +.parts-tabs .tab { + position: relative; + padding: 5px 10px; + background-color: #efefef; + border: 1px solid transparent; + margin-right: 5px; +} + +.parts-tabs .tab:hover { + background-color: #e4e4e4; +} + +.parts-tabs .tab.active { + border-color: #ddd; + border-bottom: 1px solid transparent; + background-color: white; + margin-bottom: -1px; +} + +.parts-tabs .tab.active:hover {} + +.parts-tabs .tab:first-child { + border-left: 1px solid transparent; +} + +.parts-tabs .tab:first-child.active { + border-left: 1px solid #ddd; +} + +.parts-tabs .tab>a { + cursor: pointer; + text-decoration: none; + color: #666; +} + +.parts-tabs .tab.active>a { + cursor: default; +} + +.parts-tabs .tab.statusCode.success>a { + color: green; +} + +.parts-tabs .tab.statusCode.redirect>a { + color: blue; +} + +.parts-tabs .tab.statusCode.problem>a { + color: orange; +} + +.parts-tabs .tab.statusCode.error>a { + color: red; +} + +.parts-tabs .tab .validation-aggregate { + position: absolute; + right: -3px; + top: -7px; +} + +.parts-tabs .actions { + flex-grow: 1; + text-align: right; + padding-right: 10px; + margin-top: 5px; +} + +.parts-tab-content { + border: 1px solid #ddd; + background-color: white; + padding: 10px; +} \ No newline at end of file diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-form.component.html b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-form.component.html new file mode 100644 index 000000000..f7f2f55a5 --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-form.component.html @@ -0,0 +1,163 @@ +
+
+
+ +
+
+
+ +
+ + +
+ + + + +
+
+ +
+ + +
+ +
+
+
+ +
+ + +
+ + Name +
+
+ +
+ + +
+ + Title +
+
+ +
+ + +
+ + Summary +
+
+ +
+ + +
+ + Description +
+
+ +
+ +
+ +
+ +
+ + Correlation ID +
+
+ +
+ + +
+ + Content Type +
+
+ +
+ + +
+ + Schema Format +
+
+ +
+
+ +
+ + Content +
+ +
+ + +
+ + +
+
+
+
\ No newline at end of file diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-form.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-form.component.ts new file mode 100644 index 000000000..2f38c024f --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-form.component.ts @@ -0,0 +1,173 @@ +/** + * @license + * Copyright 2017 JBoss Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + Input, + ViewChild, + ViewEncapsulation +} from "@angular/core"; +import { + CombinedVisitorAdapter, + CommandFactory, + DocumentType, + ICommand, + Library, + AaiDocument, + AaiMessage, + ReferenceUtil, + SimplifiedType, + TraverserDirection, + VisitorUtil, AaiOperation +} from "apicurio-data-models"; + +import {SourceFormComponent} from "./source-form.base"; +import {SelectionService} from "../../_services/selection.service"; +import {CommandService} from "../../_services/command.service"; +import {DocumentService} from "../../_services/document.service"; +import {EditorsService} from "../../_services/editors.service"; +import {ApiCatalogService} from "../../_services/api-catalog.service"; +import {ObjectUtils} from "apicurio-ts-core"; +import {DropDownOptionValue as Value} from "../../../../../../components/common/drop-down.component"; + +import {SchemaUtil} from "../../_util/schema.util"; + +@Component({ + selector: "message-form", + templateUrl: "message-form.component.html", + styleUrls: ["message-form.component.css"], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class MessageFormComponent extends SourceFormComponent { + + protected _message: AaiMessage; + + currentPart: string = 'payload'; + + + @Input() + set message(message: AaiMessage) { + this._message = message; + this.sourceNode = message; + this.revertSource(); + } + get message(): AaiMessage { + return this._message; + } + + /** + * C'tor. + * @param changeDetectorRef + * @param selectionService + * @param commandService + * @param documentService + * @param editors + * @param catalog + */ + public constructor(protected changeDetectorRef: ChangeDetectorRef, + protected selectionService: SelectionService, + protected commandService: CommandService, + protected documentService: DocumentService, + private editors: EditorsService, + private catalog: ApiCatalogService) { + super(changeDetectorRef, selectionService, commandService, documentService); + } + + protected createEmptyNodeForSource(): AaiMessage { + throw new Error("Method not implemented."); + } + + protected createReplaceNodeCommand(node: AaiMessage): ICommand { + throw new Error("Method not implemented."); + } + + public schemaFormatOptions() { + return SchemaUtil.schemaFormatOptions; + } + + public isPartActive(part: string): boolean { + return this.currentPart === part; + } + + public setActivePart(part: string): void { + this.currentPart = part; + } + + + public changeName(newName: string): void { + console.info("[MessageSectionComponent] Changing message name to: ", newName); + let command: ICommand = CommandFactory.createChangePropertyCommand(this.message, + "name", newName); + this.commandService.emit(command); + } + + public changeTitle(newTitle: string): void { + console.info("[MessageSectionComponent] Changing message title to: ", newTitle); + let command: ICommand = CommandFactory.createChangePropertyCommand(this.message, + "title", newTitle); + this.commandService.emit(command); + } + + public changeSummary(newSummary: string): void { + console.info("[MessageSectionComponent] Changing message summary to: ", newSummary); + let command: ICommand = CommandFactory.createChangePropertyCommand(this.message, + "summary", newSummary); + this.commandService.emit(command); + } + + public changeDescription(newDescription: string): void { + console.info("[MessageSectionComponent] Changing message description to: ", newDescription); + let command: ICommand = CommandFactory.createChangePropertyCommand(this.message, + "description", newDescription); + this.commandService.emit(command); + } + + public changeContentType(newContentType: string): void { + console.info("[MessageSectionComponent] Changing message contentType to: ", newContentType); + let command: ICommand = CommandFactory.createChangePropertyCommand(this.message, + "contentType", newContentType); + this.commandService.emit(command); + } + + public changeSchemaFormat(newSchemaFormat: boolean): void { + console.info("[MessageSectionComponent] Changing message schemaFormat to: ", newSchemaFormat); + let command: ICommand = CommandFactory.createChangePropertyCommand(this.message, + "schemaFormat", newSchemaFormat); + this.commandService.emit(command); + } + + + public enableSourceMode(): void { + this.sourceNode = this.message; + super.enableSourceMode(); + } + + + public tagDefs(): ()=>string[] { + return ()=> { + if (this.message.ownerDocument().tags && this.message.ownerDocument().tags.length > 0) { + let tagDefs: string[] = this.message.ownerDocument().tags.map(tagDef => tagDef.name); + tagDefs.sort(); + return tagDefs; + } else { + return []; + } + } + } +} \ No newline at end of file diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-item.component.css b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-item.component.css new file mode 100644 index 000000000..c1ed1492e --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-item.component.css @@ -0,0 +1,22 @@ +span.icon { + line-height: 21px; +} +span.name { + flex-grow: 2; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +span.imported { + font-size: 11px; + border-radius: 2px; + margin-top: 2px; + margin-bottom: 2px; +} + +.validation-aggregate { +} + +.collaborator-aggregate { +} diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-item.component.html b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-item.component.html new file mode 100644 index 000000000..872d735b2 --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-item.component.html @@ -0,0 +1,5 @@ + +{{ messageName() }} +Imported + + \ No newline at end of file diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-item.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-item.component.ts new file mode 100644 index 000000000..ffda77a0e --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/message-item.component.ts @@ -0,0 +1,65 @@ +/** + * @license + * Copyright 2017 JBoss Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, ViewEncapsulation} from "@angular/core"; +import {AaiMessage} from "apicurio-data-models"; +import {AbstractBaseComponent} from "../common/base-component"; +import {DocumentService} from "../../_services/document.service"; +import {SelectionService} from "../../_services/selection.service"; +import {ModelUtils} from "../../_util/model.util"; + + +@Component({ + selector: "[message-item]", + templateUrl: "message-item.component.html", + styleUrls: [ "message-item.component.css" ], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class MessageItemComponent extends AbstractBaseComponent { + + @Input() message: AaiMessage; + + constructor(private changeDetectorRef: ChangeDetectorRef, private documentService: DocumentService, + private selectionService: SelectionService) { + super(changeDetectorRef, documentService, selectionService); + } + + /** + * Returns the name of the message . + */ + public messageName(): string { + return this.message.getName(); + } + + /** + * Gets the node path for the message . + */ + public asNodePath(): string { + return ModelUtils.nodeToPath(this.message); + } + + /** + * Returns true iff the message definition is "imported". A definition is imported if it has a $ref + * that refers to an external source (anything other than #/ references). + */ + isImported(): boolean { + let $ref: string = this.message.$ref; + return ($ref && $ref.indexOf("#") != 0); + } + +} diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_models/component-type.model.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_models/component-type.model.ts index 187fd16de..fff1b21fb 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/_models/component-type.model.ts +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_models/component-type.model.ts @@ -37,10 +37,13 @@ export function componentTypeToString(type: ComponentType): string { return "link"; case ComponentType.messageTrait: return "messageTrait"; + case ComponentType.message: + return "message"; } return "n/a"; } export enum ComponentType { - schema, response, parameter, header, requestBody, callback, example, securityScheme, link, messageTrait + schema, response, parameter, header, requestBody, callback, example, securityScheme, link, messageTrait, + message, } diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_services/editors.service.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_services/editors.service.ts index 3eeb6253c..5919d77b2 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/_services/editors.service.ts +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_services/editors.service.ts @@ -27,6 +27,8 @@ import {ResponseEditorComponent} from "../_components/editors/response-editor.co import {OperationTraitEditorComponent} from "../_components/editors/operationtrait-editor.component"; import {MessageTraitEditorComponent} from "../_components/editors/messagetrait-editor.component"; import {AaiServerEditorComponent} from "../_components/editors/aaiserver-editor.component"; +import {MessageEditorComponent} from "../_components/editors/message-editor.component"; +import {OneOfInMessageEditorComponent} from "../_components/editors/oneof-in-message-editor.component"; export interface IEditorsProvider { @@ -40,6 +42,8 @@ export interface IEditorsProvider { getPropertyEditor(): PropertyEditorComponent; getOperationTraitEditor(): OperationTraitEditorComponent; getMessageTraitEditor(): MessageTraitEditorComponent; + getMessageEditor(): MessageEditorComponent; + getOneOfInMessageEditor(): OneOfInMessageEditorComponent; } @@ -99,4 +103,13 @@ export class EditorsService implements IEditorsProvider { public getMessageTraitEditor(): MessageTraitEditorComponent { return this.provider.getMessageTraitEditor(); } + + public getMessageEditor(): MessageEditorComponent { + return this.provider.getMessageEditor(); + } + + public getOneOfInMessageEditor(): OneOfInMessageEditorComponent { + return this.provider.getOneOfInMessageEditor(); + } + } diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_util/schema.util.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_util/schema.util.ts new file mode 100644 index 000000000..2cab67613 --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_util/schema.util.ts @@ -0,0 +1,17 @@ +import {DropDownOptionValue as Value} from "../../../../../components/common/drop-down.component"; + +/** + * @author vvilerio + */ +export class SchemaUtil { + + + public static readonly schemaFormatOptions = [ + new Value("application/vnd.aai.asyncapi;version=2.0.0", "application/vnd.aai.asyncapi;version=2.0.0"), + new Value("application/vnd.oai.openapi;version=3.0.0", "application/vnd.oai.openapi;version=3.0.0"), + new Value("application/application/schema+json;version=draft-07", "application/application/schema+json;version=draft-07"), + new Value("application/application/schema+yaml;version=draft-07", "application/application/schema+yaml;version=draft-07"), + new Value("application/vnd.apache.avro;version=1.9.0", "application/vnd.apache.avro;version=1.9.0") + ]; + +} \ No newline at end of file diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_visitors/message-definitions.visitor.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_visitors/message-definitions.visitor.ts new file mode 100644 index 000000000..71b7dbefb --- /dev/null +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_visitors/message-definitions.visitor.ts @@ -0,0 +1,72 @@ +/** + * @license + * Copyright 2020 JBoss Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {CombinedVisitorAdapter, AaiMessage} from "apicurio-data-models"; + +/** + * Visitor used to find message definitions tions. + */ +export class FindMessageDefinitionsVisitor extends CombinedVisitorAdapter { + + public messageDefinitions: AaiMessage[] = []; + + /** + * C'tor. + * @param filterCriteria + */ + constructor(private filterCriteria: string) { + super(); + } + + /** + * Called when a message def is visited. + * @param node + */ + visitMessage(node: AaiMessage): void { + if (this.acceptThroughFilter(node.getName())) { + this.messageDefinitions.push(node); + } + } + + /** + * Sorts and returns the message defs. + */ + public getSortedMessageDefinitions(): AaiMessage[] { + return this.messageDefinitions.sort( (messageDefinition1, messageDefinition2) => { + return messageDefinition1.getName().localeCompare(messageDefinition2.getName()); + }); + } + + /** + * Figures out the definition name regardless of the version of the model. + * @param definition + */ + public static definitionName(definition: AaiMessage): string { + return definition.getName(); + } + + /** + * Returns true if the given name is accepted by the current filter criteria. + * @param name + * @return + */ + private acceptThroughFilter(name: string): boolean { + if (this.filterCriteria === null) { + return true; + } + return name.toLowerCase().indexOf(this.filterCriteria) != -1; + } +} \ No newline at end of file diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/aaieditor.component.html b/front-end/studio/src/app/pages/apis/{apiId}/editor/aaieditor.component.html index 3f15172b4..bffae191e 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/aaieditor.component.html +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/aaieditor.component.html @@ -20,6 +20,8 @@ *ngSwitchCase="'operationTrait_20'"> + @@ -28,6 +30,7 @@ + \ No newline at end of file diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/aaieditor.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/aaieditor.component.ts index 4f25b3407..02de0bd5c 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/aaieditor.component.ts +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/aaieditor.component.ts @@ -44,7 +44,7 @@ import { AaiMessageTraitDefinition, OtCommand, OtEngine, - ValidationProblem + ValidationProblem, AaiMessage } from "apicurio-data-models"; import {AsyncApiEditorMasterComponent} from "./_components/aaimaster.component"; import {VersionedAck} from "../../../../models/ack.model"; @@ -73,6 +73,8 @@ import {ImportedComponent} from "./_models/imported-component.model"; import {CodeEditorMode, CodeEditorTheme} from "../../../../components/common/code-editor.component"; import * as YAML from 'js-yaml'; import {AaiServerEditorComponent} from "./_components/editors/aaiserver-editor.component"; +import {MessageEditorComponent} from "./_components/editors/message-editor.component"; +import {OneOfInMessageEditorComponent} from "./_components/editors/oneof-in-message-editor.component"; @Component({ @@ -124,6 +126,8 @@ export class AsyncApiEditorComponent extends AbstractApiEditorComponent implemen @ViewChild("dataTypeEditor", { static: true }) dataTypeEditor: DataTypeEditorComponent; @ViewChild("operationTraitEditor", { static: true }) operationTraitEditor: OperationTraitEditorComponent; @ViewChild("messageTraitEditor", { static: true }) messageTraitEditor: MessageTraitEditorComponent; + @ViewChild("messageEditor", { static: true }) messageEditor: MessageEditorComponent; + @ViewChild("oneOfInMessageEditor", { static: true }) oneOfInMessageEditor: OneOfInMessageEditorComponent; @ViewChild("propertyEditor", { static: true }) propertyEditor: PropertyEditorComponent; @@ -509,6 +513,14 @@ export class AsyncApiEditorComponent extends AbstractApiEditorComponent implemen } } + public selectedMessage(): AaiMessage { + if (this.currentSelectionType === "message") { + return this.currentSelectionNode as AaiMessage; + } else { + return null; + } + } + public preDocumentChange(): void { // Before changing the document, let's clear/reset the current selection this.selectionService.clearAllSelections(); @@ -640,6 +652,14 @@ export class AsyncApiEditorComponent extends AbstractApiEditorComponent implemen return this.messageTraitEditor; } + public getMessageEditor(): MessageEditorComponent { + return this.messageEditor; + } + + public getOneOfInMessageEditor(): OneOfInMessageEditorComponent { + return this.oneOfInMessageEditor; + } + importComponent(type: ComponentType) { if (this.componentImporter) { this.componentImporter(type).then(imports => { @@ -654,6 +674,8 @@ export class AsyncApiEditorComponent extends AbstractApiEditorComponent implemen commands.push(CommandFactory.createAddSchemaDefinitionCommand(this.document().getDocumentType(), name, fromRef)); } else if (type === ComponentType.messageTrait) { //commands.push(CommandFactory.createAddResponseDefinitionCommand(this.document().getDocumentType(), name, fromRef)); + } else if (type === ComponentType.message) { + // commands.push(CommandFactory.createNewMessageDefinitionCommand(imp.name, fromRef)); } }); @@ -673,6 +695,7 @@ export class AsyncApiEditorComponent extends AbstractApiEditorComponent implemen }); } } + } /** @@ -718,4 +741,9 @@ export class FormSelectionVisitor extends CombinedVisitorAdapter { this._selectedNode = node; this._selectionType = "messageTrait"; } + + public visitMessage(node: AaiMessage): void { + this._selectedNode = node; + this._selectionType = "message"; + } } diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/editor.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/editor.component.ts index 2a49dcfe5..11c346ddb 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/editor.component.ts +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/editor.component.ts @@ -75,7 +75,9 @@ import {ComponentType} from "./_models/component-type.model"; import {ImportedComponent} from "./_models/imported-component.model"; import {OperationTraitEditorComponent} from "./_components/editors/operationtrait-editor.component"; import {MessageTraitEditorComponent} from "./_components/editors/messagetrait-editor.component"; +import {MessageEditorComponent} from "./_components/editors/message-editor.component"; import {AaiServerEditorComponent} from "./_components/editors/aaiserver-editor.component"; +import { OneOfInMessageEditorComponent } from "./_components/editors/oneof-in-message-editor.component"; @Component({ @@ -146,7 +148,7 @@ export class ApiEditorComponent extends AbstractApiEditorComponent implements On Library.addReferenceResolver(this); console.debug("[ApiEditorComponent] Subscribing to API Catalog changes."); - this._catalogSubscription = this.catalog.changes().subscribe( () => { + this._catalogSubscription = this.catalog.changes().subscribe(() => { console.debug("[ApiEditorComponent] Re-validating model due to API Catalog change."); // Re-validate whenever the contents of the API catalog change this.validateModel(); @@ -645,6 +647,15 @@ export class ApiEditorComponent extends AbstractApiEditorComponent implements On return null; } + public getMessageEditor(): MessageEditorComponent { + return null; + } + + + getOneOfInMessageEditor(): OneOfInMessageEditorComponent { + return null; + } + importComponent(type: ComponentType) { if (this.componentImporter) { this.componentImporter(type).then(imports => { diff --git a/front-end/studio/yarn.lock b/front-end/studio/yarn.lock index 190e270f4..8c071c862 100644 --- a/front-end/studio/yarn.lock +++ b/front-end/studio/yarn.lock @@ -1952,12 +1952,12 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -apicurio-data-models@1.1.16: - version "1.1.16" - resolved "https://registry.yarnpkg.com/apicurio-data-models/-/apicurio-data-models-1.1.16.tgz#e113e6406ce533845e88f13dd855b918411009ed" - integrity sha512-Q7Cs9hzGJDnJFsUp9LGvcUxd5AkbHg83UE6Co2VqX0TzID8uQBBW31t7+zL3WfAE6TL30/Au3D/YZu9QmFKAww== +apicurio-data-models@1.1.18: + version "1.1.18" + resolved "https://registry.yarnpkg.com/apicurio-data-models/-/apicurio-data-models-1.1.18.tgz#80bc2857d961b77cf834c3da3a3ffdb2545787fc" + integrity sha512-HNrVVfrQ7y26n1HMYY/rF+t+9rk29G70VOCF4VQCyuYvDnFxHGGcaR9CmBSlvHyre4wwpkqIZxqzlW5SkANlPw== dependencies: - core-js "3.18.0" + core-js "3.19.0" apicurio-ts-core@0.1.3: version "0.1.3" @@ -3072,10 +3072,10 @@ core-js@2.6.5: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A== -core-js@3.18.0: - version "3.18.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.0.tgz#9af3f4a6df9ba3428a3fb1b171f1503b3f40cc49" - integrity sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w== +core-js@3.19.0: + version "3.19.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.19.0.tgz#9e40098a9bc326c7e81b486abbd5e12b9d275176" + integrity sha512-L1TpFRWXZ76vH1yLM+z6KssLZrP8Z6GxxW4auoCj+XiViOzNPJCAuTIkn03BGdFe6Z5clX5t64wRIRypsZQrUg== core-js@3.8.3: version "3.8.3"