@redocly/asyncapi-docs 1.2.0-next.1 → 1.2.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,11 @@
1
+ import type { ENTITY_RELATION_TYPES } from '@redocly/theme';
1
2
  import type { Node } from '@markdoc/markdoc';
2
3
  import type { ResolvedNavItem, REDOCLY_TEAMS_RBAC } from '@redocly/config';
3
4
  import type { JSONSchema7 } from 'json-schema';
4
5
  import type { ApiItemData } from './apiItem';
6
+ export type Referenced<T> = T | {
7
+ $ref: string;
8
+ };
5
9
  export interface AsyncApiDefinition {
6
10
  asyncapi: string;
7
11
  id?: string;
@@ -17,6 +21,21 @@ export interface AsyncApiDefinition {
17
21
  [REDOCLY_TEAMS_RBAC]?: Record<string, string>;
18
22
  }[];
19
23
  }
24
+ export interface AsyncApiDefinitionReferenced {
25
+ asyncapi: string;
26
+ id?: string;
27
+ info: AsyncApiInfo;
28
+ servers?: Record<string, AsyncApiServer>;
29
+ defaultContentType?: string;
30
+ channels?: AsyncApiChannels;
31
+ operations?: AsyncApiOperationsReferenced;
32
+ components?: AsyncApiComponentsReferenced;
33
+ 'x-tagGroups'?: {
34
+ name: string;
35
+ tags: string[];
36
+ [REDOCLY_TEAMS_RBAC]?: Record<string, string>;
37
+ }[];
38
+ }
20
39
  export interface AsyncApiInfo {
21
40
  title: string;
22
41
  version: string;
@@ -135,8 +154,22 @@ export interface AsyncApiParameter {
135
154
  location?: string;
136
155
  }
137
156
  export interface AsyncApiMessage {
138
- headers?: JSONSchema7 | MultiFormatSchemaObject;
139
- payload?: JSONSchema7 | MultiFormatSchemaObject;
157
+ headers?: AsyncAPISchema;
158
+ payload?: AsyncAPISchema;
159
+ correlationId?: AsyncApiCorrelationId;
160
+ contentType?: string;
161
+ name?: string;
162
+ title?: string;
163
+ summary?: string;
164
+ description?: string;
165
+ tags?: AsyncApiTag[];
166
+ externalDocs?: AsyncApiExternalDocs;
167
+ bindings?: AsyncApiMessageBinding;
168
+ examples?: AsyncApiMessageExample[];
169
+ }
170
+ export interface AsyncApiMessageReferenced {
171
+ headers?: AsyncAPISchema;
172
+ payload?: Referenced<AsyncAPISchema>;
140
173
  correlationId?: AsyncApiCorrelationId;
141
174
  contentType?: string;
142
175
  name?: string;
@@ -174,6 +207,9 @@ export interface MultiFormatSchemaObject {
174
207
  export interface AsyncApiOperations {
175
208
  [name: string]: AsyncApiOperation;
176
209
  }
210
+ export interface AsyncApiOperationsReferenced {
211
+ [name: string]: AsyncApiOperationReferenced;
212
+ }
177
213
  export interface AsyncApiOperation {
178
214
  action: 'send' | 'receive';
179
215
  channel: AsyncApiChannel;
@@ -187,7 +223,29 @@ export interface AsyncApiOperation {
187
223
  messages?: AsyncApiMessage[];
188
224
  reply?: AsyncApiOperationReply;
189
225
  'x-badges'?: AsyncApiXBadges[];
190
- 'x-owner-key'?: string;
226
+ 'x-catalog-relations'?: {
227
+ type: (typeof ENTITY_RELATION_TYPES)[number];
228
+ key: string;
229
+ }[];
230
+ [REDOCLY_TEAMS_RBAC]?: Record<string, string>;
231
+ }
232
+ export interface AsyncApiOperationReferenced {
233
+ action: 'send' | 'receive';
234
+ channel: AsyncApiChannel;
235
+ title?: string;
236
+ summary?: string;
237
+ description?: string;
238
+ tags?: AsyncApiTag[];
239
+ externalDocs?: AsyncApiExternalDocs;
240
+ bindings?: AsyncApiOperationBinding;
241
+ traits?: AsyncApiOperationTraits[];
242
+ messages?: Referenced<AsyncApiMessage>[];
243
+ reply?: AsyncApiOperationReply;
244
+ 'x-badges'?: AsyncApiXBadges[];
245
+ 'x-catalog-relations'?: {
246
+ type: (typeof ENTITY_RELATION_TYPES)[number];
247
+ key: string;
248
+ }[];
191
249
  [REDOCLY_TEAMS_RBAC]?: Record<string, string>;
192
250
  }
193
251
  export interface AsyncApiOperationReply {
@@ -222,6 +280,12 @@ export interface AsyncApiOperationKafkaBinding {
222
280
  }
223
281
  export interface AsyncApiComponents {
224
282
  messages: Record<string, AsyncApiMessage>;
283
+ schemas: Record<string, AsyncAPISchema>;
284
+ tags: Record<string, AsyncApiTag>;
285
+ }
286
+ export interface AsyncApiComponentsReferenced {
287
+ messages: Record<string, AsyncApiMessageReferenced>;
288
+ schemas: Record<string, AsyncAPISchema>;
225
289
  tags: Record<string, AsyncApiTag>;
226
290
  }
227
291
  export interface AvroSchema {
@@ -251,3 +315,4 @@ export type DownloadUrls = {
251
315
  export type ChannelWithKey = AsyncApiChannel & {
252
316
  key: string;
253
317
  };
318
+ export type AsyncAPISchema = JSONSchema7 | MultiFormatSchemaObject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/asyncapi-docs",
3
- "version": "1.2.0-next.1",
3
+ "version": "1.2.0-next.3",
4
4
  "description": "Async API docs for Redocly Realm",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.js",
@@ -40,8 +40,8 @@
40
40
  "styled-components": "5.3.11",
41
41
  "web-vitals": "3.3.1",
42
42
  "@redocly/config": "0.28.0",
43
- "@redocly/openapi-docs": "3.13.0-next.1",
44
- "@redocly/theme": "0.57.0-next.1"
43
+ "@redocly/openapi-docs": "3.13.0-next.3",
44
+ "@redocly/theme": "0.57.0-next.2"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": "^19.1.0"