@mintlify/common 1.0.313 → 1.0.314
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.
- package/dist/asyncapi/getAsyncApiDocumentFromUrl.d.ts +2 -2
- package/dist/asyncapi/getAsyncApiDocumentFromUrl.js +20 -14
- package/dist/asyncapi/validateAsyncApi.d.ts +7 -0
- package/dist/asyncapi/{asyncApiCheck.js → validateAsyncApi.js} +19 -8
- package/dist/asyncapi.d.ts +1 -2
- package/dist/asyncapi.js +1 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/asyncapi.d.ts +14 -4
- package/package.json +2 -2
- package/dist/asyncapi/asyncApiCheck.d.ts +0 -2
- package/dist/asyncapi/validate.d.ts +0 -7
- package/dist/asyncapi/validate.js +0 -20
package/dist/types/asyncapi.d.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type
|
|
3
|
-
export type { AsyncAPIDocumentInterface, AsyncAPISchema };
|
|
1
|
+
import { AsyncAPIDocumentInterface, Input, ChannelInterface } from '@asyncapi/parser';
|
|
2
|
+
export type { AsyncAPIDocumentInterface };
|
|
4
3
|
export type AsyncAPIParserInput = Input;
|
|
5
4
|
export type AsyncAPIFile = {
|
|
6
5
|
filename: string;
|
|
6
|
+
spec: AsyncAPIDocumentInterface;
|
|
7
7
|
originalFileLocation: string;
|
|
8
|
-
spec: AsyncAPIDocument;
|
|
9
8
|
};
|
|
9
|
+
export interface AsyncAPIChannel extends ChannelInterface {
|
|
10
|
+
tags(): {
|
|
11
|
+
all(): Array<{
|
|
12
|
+
name(): string;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
title(): string | undefined;
|
|
16
|
+
description(): string | undefined;
|
|
17
|
+
summary(): string | undefined;
|
|
18
|
+
id(): string;
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.314",
|
|
4
4
|
"description": "Commonly shared code within Mintlify",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"typescript": "^5.5.3",
|
|
85
85
|
"vitest": "^2.0.4"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "5f1fad60cd8625ceeaeb5e06fcd5aae5c65b2573"
|
|
88
88
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AsyncAPIDocumentInterface } from '../types/asyncapi.js';
|
|
2
|
-
export type ValidateResult = {
|
|
3
|
-
valid: boolean;
|
|
4
|
-
errorMessage?: string;
|
|
5
|
-
schema?: AsyncAPIDocumentInterface;
|
|
6
|
-
};
|
|
7
|
-
export declare const validateAsyncApi: (document: unknown) => Promise<ValidateResult>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { Parser } from '@asyncapi/parser';
|
|
11
|
-
export const validateAsyncApi = (document) => __awaiter(void 0, void 0, void 0, function* () {
|
|
12
|
-
const documentAsInput = typeof document === 'string' ? document : JSON.stringify(document);
|
|
13
|
-
const parser = new Parser();
|
|
14
|
-
const { document: schema, diagnostics } = yield parser.parse(documentAsInput);
|
|
15
|
-
if (diagnostics.length > 0) {
|
|
16
|
-
const errorMessages = diagnostics.map((diagnostic) => diagnostic.message).join('\n');
|
|
17
|
-
return { valid: false, errorMessage: errorMessages, schema: undefined };
|
|
18
|
-
}
|
|
19
|
-
return { valid: true, errorMessage: undefined, schema };
|
|
20
|
-
});
|