-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move collections out of the v2 directory because they are always the …
…same implementation
- Loading branch information
Showing
43 changed files
with
214 additions
and
273 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { ChannelParameterInterface } from './channel-parameter'; | ||
|
||
export type ChannelParametersInterface = Collection<ChannelParameterInterface> | ||
export type ChannelParametersInterface = Collection<ChannelParameterInterface>; | ||
|
||
export class ChannelParameters extends Collection<ChannelParameterInterface> implements ChannelParametersInterface { | ||
override get(id: string): ChannelParameterInterface | undefined { | ||
return this.collections.find(parameter => parameter.id() === id); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,7 +1,21 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { ChannelInterface } from './channel'; | ||
|
||
export interface ChannelsInterface extends Collection<ChannelInterface> { | ||
filterBySend(): ChannelInterface[]; | ||
filterByReceive(): ChannelInterface[]; | ||
} | ||
} | ||
|
||
export class Channels extends Collection<ChannelInterface> implements ChannelsInterface { | ||
override get(id: string): ChannelInterface | undefined { | ||
return this.collections.find(channel => channel.id() === id); | ||
} | ||
|
||
filterBySend(): ChannelInterface[] { | ||
return this.filterBy(channel => channel.operations().filterBySend().length > 0); | ||
} | ||
|
||
filterByReceive(): ChannelInterface[] { | ||
return this.filterBy(channel => channel.operations().filterByReceive().length > 0); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { CorrelationIdInterface } from './correlation-id'; | ||
|
||
export type CorrelationIdsInterface = Collection<CorrelationIdInterface> | ||
export type CorrelationIdsInterface = Collection<CorrelationIdInterface> | ||
|
||
export class CorrelationIds extends Collection<CorrelationIdInterface> implements CorrelationIdsInterface { | ||
override get(id: string): CorrelationIdInterface | undefined { | ||
return this.collections.find(correlationId => correlationId.meta('id' as any) === id); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,4 +1,11 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { ExtensionInterface } from './extension'; | ||
|
||
export type ExtensionsInterface = Collection<ExtensionInterface> | ||
export type ExtensionsInterface = Collection<ExtensionInterface> | ||
|
||
export class Extensions extends Collection<ExtensionInterface> implements ExtensionsInterface { | ||
override get<T = any>(id: string): ExtensionInterface<T> | undefined { | ||
id = id.startsWith('x-') ? id : `x-${id}`; | ||
return this.collections.find(ext => ext.id() === id); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { MessageExampleInterface } from './message-example'; | ||
|
||
export type MessageExamplesInterface = Collection<MessageExampleInterface> | ||
|
||
export class MessageExamples extends Collection<MessageExampleInterface> implements MessageExamplesInterface { | ||
override get(name: string): MessageExampleInterface | undefined { | ||
return this.collections.find(example => example.name() === name); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { MessageTraitInterface } from './message-trait'; | ||
|
||
export type MessageTraitsInterface = Collection<MessageTraitInterface> | ||
export type MessageTraitsInterface = Collection<MessageTraitInterface> | ||
|
||
export class MessageTraits extends Collection<MessageTraitInterface> implements MessageTraitsInterface { | ||
override get(id: string): MessageTraitInterface | undefined { | ||
return this.collections.find(trait => trait.id() === id); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,7 +1,21 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { MessageInterface } from './message'; | ||
|
||
export interface MessagesInterface extends Collection<MessageInterface> { | ||
filterBySend(): MessageInterface[]; | ||
filterByReceive(): MessageInterface[]; | ||
} | ||
} | ||
|
||
export class Messages extends Collection<MessageInterface> implements MessagesInterface { | ||
override get(name: string): MessageInterface | undefined { | ||
return this.collections.find(message => message.id() === name); | ||
} | ||
|
||
filterBySend(): MessageInterface[] { | ||
return this.filterBy(message => message.operations().filterBySend().length > 0); | ||
} | ||
|
||
filterByReceive(): MessageInterface[] { | ||
return this.filterBy(message => message.operations().filterByReceive().length > 0); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { OperationTraitInterface } from './operation-trait'; | ||
|
||
export type OperationTraitsInterface = Collection<OperationTraitInterface> | ||
export type OperationTraitsInterface = Collection<OperationTraitInterface> | ||
|
||
export class OperationTraits extends Collection<OperationTraitInterface> implements OperationTraitsInterface { | ||
override get(id: string): OperationTraitInterface | undefined { | ||
return this.collections.find(trait => trait.id() === id); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,7 +1,22 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
|
||
import type { OperationInterface } from './operation'; | ||
|
||
export interface OperationsInterface extends Collection<OperationInterface> { | ||
filterBySend(): OperationInterface[]; | ||
filterByReceive(): OperationInterface[]; | ||
} | ||
|
||
export class Operations extends Collection<OperationInterface> implements OperationsInterface { | ||
override get(id: string): OperationInterface | undefined { | ||
return this.collections.find(operation => operation.id() === id); | ||
} | ||
|
||
filterBySend(): OperationInterface[] { | ||
return this.filterBy(operation => operation.isSend()); | ||
} | ||
|
||
filterByReceive(): OperationInterface[] { | ||
return this.filterBy(operation => operation.isReceive()); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { SchemaInterface } from './schema'; | ||
|
||
export type SchemasInterface = Collection<SchemaInterface> | ||
|
||
export class Schemas extends Collection<SchemaInterface> implements SchemasInterface { | ||
override get(id: string): SchemaInterface | undefined { | ||
return this.collections.find(schema => schema.uid() === id); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import type { Collection} from './collection'; | ||
import { Collection} from './collection'; | ||
import type { SecurityRequirementInterface } from './security-requirement'; | ||
|
||
export type SecurityRequirementsInterface = Collection<SecurityRequirementInterface> | ||
export type SecurityRequirementsInterface = Collection<SecurityRequirementInterface> | ||
|
||
export class SecurityRequirements extends Collection<SecurityRequirementInterface> implements SecurityRequirementsInterface { | ||
override get(id: string): SecurityRequirementInterface | undefined { | ||
return this.collections.find(securityRequirement => securityRequirement.meta('id' as any) === id); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import type { Collection} from './collection'; | ||
import { Collection} from './collection'; | ||
import type { SecuritySchemeInterface } from './security-scheme'; | ||
|
||
export type SecuritySchemesInterface = Collection<SecuritySchemeInterface> | ||
|
||
export class SecuritySchemes extends Collection<SecuritySchemeInterface> implements SecuritySchemesInterface { | ||
override get(id: string): SecuritySchemeInterface | undefined { | ||
return this.collections.find(securityScheme => securityScheme.id() === id); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { ServerVariableInterface } from './server-variable'; | ||
|
||
export type ServerVariablesInterface = Collection<ServerVariableInterface> | ||
export type ServerVariablesInterface = Collection<ServerVariableInterface>; | ||
|
||
export class ServerVariables extends Collection<ServerVariableInterface> implements ServerVariablesInterface { | ||
override get(id: string): ServerVariableInterface | undefined { | ||
return this.collections.find(variable => variable.id() === id); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,7 +1,21 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { ServerInterface } from './server'; | ||
|
||
export interface ServersInterface extends Collection<ServerInterface> { | ||
filterBySend(): ServerInterface[]; | ||
filterByReceive(): ServerInterface[]; | ||
} | ||
|
||
export class Servers extends Collection<ServerInterface> implements ServersInterface { | ||
override get(id: string): ServerInterface | undefined { | ||
return this.collections.find(server => server.id() === id); | ||
} | ||
|
||
filterBySend(): ServerInterface[] { | ||
return this.filterBy(server => server.operations().filterBySend().length > 0); | ||
} | ||
|
||
filterByReceive(): ServerInterface[] { | ||
return this.filterBy(server => server.operations().filterByReceive().length > 0); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import type { Collection } from './collection'; | ||
import { Collection } from './collection'; | ||
import type { TagInterface } from './tag'; | ||
|
||
export type TagsInterface = Collection<TagInterface> | ||
export type TagsInterface = Collection<TagInterface> | ||
|
||
export class Tags extends Collection<TagInterface> implements TagsInterface { | ||
override get(name: string): TagInterface | undefined { | ||
return this.collections.find(tag => tag.name() === name); | ||
} | ||
} |
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.