@jentic/arazzo-validator 1.0.0-alpha.10 → 1.0.0-alpha.12

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/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ # [1.0.0-alpha.12](https://github.com/jentic/jentic-arazzo-tools/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2026-02-11)
7
+
8
+ ### Features
9
+
10
+ - **validator:** export TextDocument, Diagnostics and other symbols ([#64](https://github.com/jentic/jentic-arazzo-tools/issues/64)) ([4b2bf84](https://github.com/jentic/jentic-arazzo-tools/commit/4b2bf84d97a21f15041bd4304305a8992403f724))
11
+
12
+ # [1.0.0-alpha.11](https://github.com/jentic/jentic-arazzo-tools/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2026-02-10)
13
+
14
+ ### Features
15
+
16
+ - add initial validator implementation ([#60](https://github.com/jentic/jentic-arazzo-tools/issues/60)) ([4e9a73d](https://github.com/jentic/jentic-arazzo-tools/commit/4e9a73dd5ca2b2b48ebc32de6b02c93524fabccf))
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @jentic/arazzo-validator
2
2
 
3
3
  `@jentic/arazzo-validator` is a validator and linter for [Arazzo Specification](https://spec.openapis.org/arazzo/latest.html) documents.
4
- It validates documents against JSON Schema and performs semantic validation using [SpecLynx ApiDOM Language Service](https://www.npmjs.com/package/@speclynx/apidom-ls).
4
+ It performs JSON Schema validation, semantic validation, and semantic linting using [SpecLynx ApiDOM Language Service](https://www.npmjs.com/package/@speclynx/apidom-ls).
5
5
 
6
6
  **Supported Arazzo versions:**
7
7
  - [Arazzo 1.0.0](https://spec.openapis.org/arazzo/v1.0.0)
@@ -30,12 +30,6 @@ npm install @jentic/arazzo-validator
30
30
  import { validateURI, DiagnosticSeverity } from '@jentic/arazzo-validator';
31
31
 
32
32
  const diagnostics = await validateURI('/path/to/arazzo.yaml');
33
-
34
- // Check for errors
35
- const errors = diagnostics.filter((d) => d.severity === DiagnosticSeverity.Error);
36
- if (errors.length > 0) {
37
- console.error('Validation errors:', errors);
38
- }
39
33
  ```
40
34
 
41
35
  ### From URL
@@ -48,10 +42,10 @@ const diagnostics = await validateURI('https://example.com/arazzo.yaml');
48
42
 
49
43
  ### From TextDocument
50
44
 
51
- When you already have document content in memory, use the lower-level `validate` function:
45
+ When you already have document content in memory, use the lower-level `validate` function with `createTextDocument`:
52
46
 
53
47
  ```js
54
- import { validate, TextDocument } from '@jentic/arazzo-validator';
48
+ import { validate, createTextDocument } from '@jentic/arazzo-validator';
55
49
 
56
50
  const content = `
57
51
  arazzo: '1.0.1'
@@ -69,12 +63,16 @@ workflows:
69
63
  operationId: myApi.getUsers
70
64
  `;
71
65
 
72
- const textDocument = TextDocument.create(
73
- 'file:///path/to/arazzo.yaml',
74
- 'arazzo',
75
- 1,
76
- content
77
- );
66
+ const textDocument = createTextDocument('file:///path/to/arazzo.yaml', content);
67
+ const diagnostics = await validate(textDocument);
68
+ ```
69
+
70
+ Alternatively, use `TextDocument.create()` directly for full control:
71
+
72
+ ```js
73
+ import { validate, TextDocument } from '@jentic/arazzo-validator';
74
+
75
+ const textDocument = TextDocument.create('file:///path/to/arazzo.yaml', 'apidom', 1, content);
78
76
  const diagnostics = await validate(textDocument);
79
77
  ```
80
78
 
@@ -144,38 +142,11 @@ import {
144
142
  defaultArazzoResolveOptions,
145
143
  defaultLanguageServiceContext,
146
144
  } from '@jentic/arazzo-validator';
147
-
148
- // Default resolve options (from @jentic/arazzo-parser)
149
- console.log(defaultArazzoResolveOptions);
150
- // {
151
- // resolvers: [MemoryResolver, FileResolver, HTTPResolverAxios],
152
- // resolverOpts: {},
153
- // }
154
-
155
- // Default language service context
156
- console.log(defaultLanguageServiceContext);
157
- // {
158
- // metadata: {...},
159
- // defaultContentLanguage: {
160
- // namespace: 'arazzo',
161
- // version: '1.0.1',
162
- // mediaType: 'application/vnd.oai.workflows;version=1.0.1',
163
- // },
164
- // validatorProviders: [Arazzo1JsonSchemaValidationProvider],
165
- // validationContext: {
166
- // jsonSchemaValidation: true,
167
- // semanticValidation: true,
168
- // referenceValidation: false,
169
- // semanticLinting: true,
170
- // betterAjvErrors: true,
171
- // },
172
- // parseContext: {
173
- // fileAllowList: ['*'],
174
- // arazzo: { sourceDescriptionsResolution: true },
175
- // },
176
- // }
177
145
  ```
178
146
 
147
+ - `defaultArazzoResolveOptions` - file and HTTP resolvers configuration
148
+ - `defaultLanguageServiceContext` - validation settings (JSON Schema, semantic validation, linting)
149
+
179
150
  ## Working with diagnostics
180
151
 
181
152
  Both validation functions return an array of [Diagnostic](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnostic) objects compatible with VS Code and the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/).
@@ -184,62 +155,7 @@ Both validation functions return an array of [Diagnostic](https://microsoft.gith
184
155
  import { validateURI, DiagnosticSeverity } from '@jentic/arazzo-validator';
185
156
 
186
157
  const diagnostics = await validateURI('/path/to/arazzo.yaml');
187
-
188
- for (const diagnostic of diagnostics) {
189
- // DiagnosticSeverity.Error = 1
190
- // DiagnosticSeverity.Warning = 2
191
- // DiagnosticSeverity.Information = 3
192
- // DiagnosticSeverity.Hint = 4
193
-
194
- // Position in the document
195
- const { start, end } = diagnostic.range;
196
-
197
- if (diagnostic.severity === DiagnosticSeverity.Error) {
198
- console.error(
199
- `Error at line ${start.line + 1}, column ${start.character + 1}: ${diagnostic.message}`
200
- );
201
- }
202
- }
203
- ```
204
-
205
- ### Filtering by severity
206
-
207
- ```js
208
- import { validateURI, DiagnosticSeverity } from '@jentic/arazzo-validator';
209
-
210
- const diagnostics = await validateURI('/path/to/arazzo.yaml');
211
-
212
- // Get only errors
213
158
  const errors = diagnostics.filter((d) => d.severity === DiagnosticSeverity.Error);
214
-
215
- // Get only warnings
216
159
  const warnings = diagnostics.filter((d) => d.severity === DiagnosticSeverity.Warning);
217
-
218
- // Check if document is valid
219
160
  const isValid = errors.length === 0;
220
- ```
221
-
222
- ## Validation types
223
-
224
- The validator performs several types of validation:
225
-
226
- ### JSON Schema validation
227
-
228
- Validates the document structure against the Arazzo JSON Schema. This catches structural issues like:
229
- - Missing required fields
230
- - Invalid field types
231
- - Unknown properties
232
-
233
- ### Semantic validation
234
-
235
- Validates Arazzo-specific semantics beyond JSON Schema, such as:
236
- - Valid workflow references
237
- - Correct step dependencies
238
- - Proper expression syntax
239
-
240
- ### Semantic linting
241
-
242
- Applies linting rules for best practices and potential issues:
243
- - Duplicate keys detection
244
- - Naming conventions
245
- - Potential logical errors
161
+ ```
@@ -7198,6 +7198,227 @@ function config() {
7198
7198
 
7199
7199
  /***/ },
7200
7200
 
7201
+ /***/ 48869
7202
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7203
+
7204
+ "use strict";
7205
+ __webpack_require__.r(__webpack_exports__);
7206
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7207
+ /* harmony export */ ARAZZO_LANGUAGE_ID: () => (/* binding */ ARAZZO_LANGUAGE_ID),
7208
+ /* harmony export */ DEFAULT_DOCUMENT_VERSION: () => (/* binding */ DEFAULT_DOCUMENT_VERSION),
7209
+ /* harmony export */ TextDocument: () => (/* reexport safe */ vscode_languageserver_textdocument__WEBPACK_IMPORTED_MODULE_0__.TextDocument),
7210
+ /* harmony export */ createTextDocument: () => (/* binding */ createTextDocument)
7211
+ /* harmony export */ });
7212
+ /* harmony import */ var vscode_languageserver_textdocument__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(58041);
7213
+
7214
+
7215
+
7216
+ /**
7217
+ * Language ID for Arazzo documents used with TextDocument.
7218
+ *
7219
+ * @public
7220
+ */
7221
+ const ARAZZO_LANGUAGE_ID = 'apidom';
7222
+
7223
+ /**
7224
+ * Default document version for TextDocument instances.
7225
+ *
7226
+ * @public
7227
+ */
7228
+ const DEFAULT_DOCUMENT_VERSION = 1;
7229
+
7230
+ /**
7231
+ * Creates a TextDocument for Arazzo validation.
7232
+ *
7233
+ * @param uri - The document URI
7234
+ * @param content - The document content
7235
+ * @returns A TextDocument instance
7236
+ * @public
7237
+ */
7238
+ function createTextDocument(uri, content) {
7239
+ return vscode_languageserver_textdocument__WEBPACK_IMPORTED_MODULE_0__.TextDocument.create(uri, ARAZZO_LANGUAGE_ID, DEFAULT_DOCUMENT_VERSION, content);
7240
+ }
7241
+
7242
+ /***/ },
7243
+
7244
+ /***/ 48411
7245
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7246
+
7247
+ "use strict";
7248
+ __webpack_require__.r(__webpack_exports__);
7249
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7250
+ /* harmony export */ defaultArazzoResolveOptions: () => (/* binding */ defaultArazzoResolveOptions),
7251
+ /* harmony export */ validateURI: () => (/* binding */ validateURI)
7252
+ /* harmony export */ });
7253
+ /* harmony import */ var _jentic_arazzo_parser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42859);
7254
+ /* harmony import */ var _speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(212);
7255
+ /* harmony import */ var _speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8841);
7256
+ /* harmony import */ var _document_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(48869);
7257
+ /* harmony import */ var _validate_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7500);
7258
+
7259
+
7260
+
7261
+
7262
+
7263
+ /**
7264
+ * Default resolve options for URI resolution in validateURI.
7265
+ *
7266
+ * These options control how files and URLs are fetched when validating
7267
+ * Arazzo documents from URIs.
7268
+ *
7269
+ * @public
7270
+ */
7271
+ const defaultArazzoResolveOptions = _jentic_arazzo_parser__WEBPACK_IMPORTED_MODULE_0__.defaultOptions.resolve;
7272
+
7273
+ /**
7274
+ * Validates an Arazzo Document from a URI (file path or HTTP(S) URL).
7275
+ *
7276
+ * This is the primary API for validation. It fetches the document from the
7277
+ * specified URI and performs JSON Schema validation, semantic validation,
7278
+ * and linting.
7279
+ *
7280
+ * @param uri - The file system path or HTTP(S) URL to the Arazzo Document
7281
+ * @param context - Optional language service context override (deep merged with defaults)
7282
+ * @param resolveOptions - Optional resolve options for fetching the URI
7283
+ * @returns Promise resolving to an array of Diagnostic objects
7284
+ *
7285
+ * @example
7286
+ * Validate from file
7287
+ * ```typescript
7288
+ * import { validateURI, DiagnosticSeverity } from '@jentic/arazzo-validator';
7289
+ *
7290
+ * const diagnostics = await validateURI('/path/to/arazzo.yaml');
7291
+ * const errors = diagnostics.filter((d) => d.severity === DiagnosticSeverity.Error);
7292
+ * ```
7293
+ *
7294
+ * @example
7295
+ * Validate from URL
7296
+ * ```typescript
7297
+ * const diagnostics = await validateURI('https://example.com/arazzo.yaml');
7298
+ * ```
7299
+ *
7300
+ * @example
7301
+ * Validate with custom context
7302
+ * ```typescript
7303
+ * const diagnostics = await validateURI('/path/to/arazzo.yaml', {
7304
+ * validationContext: { jsonSchemaValidation: false }
7305
+ * });
7306
+ * ```
7307
+ *
7308
+ * @example
7309
+ * Validate with custom resolve options
7310
+ * ```typescript
7311
+ * const diagnostics = await validateURI('/path/to/arazzo.yaml', {}, {
7312
+ * resolverOpts: { timeout: 10000 }
7313
+ * });
7314
+ * ```
7315
+ * @public
7316
+ */
7317
+ async function validateURI(uri, context = {}, resolveOptions = {}) {
7318
+ const mergedOptions = (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_2__.merge)(_jentic_arazzo_parser__WEBPACK_IMPORTED_MODULE_0__.defaultOptions, {
7319
+ resolve: resolveOptions
7320
+ });
7321
+ const buffer = await (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_1__.readFile)(uri, mergedOptions);
7322
+ const content = new TextDecoder().decode(buffer);
7323
+ const textDocument = (0,_document_ts__WEBPACK_IMPORTED_MODULE_3__.createTextDocument)(uri, content);
7324
+ return (0,_validate_ts__WEBPACK_IMPORTED_MODULE_4__.validate)(textDocument, context);
7325
+ }
7326
+
7327
+ /***/ },
7328
+
7329
+ /***/ 7500
7330
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7331
+
7332
+ "use strict";
7333
+ __webpack_require__.r(__webpack_exports__);
7334
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7335
+ /* harmony export */ defaultLanguageServiceContext: () => (/* binding */ defaultLanguageServiceContext),
7336
+ /* harmony export */ validate: () => (/* binding */ validate)
7337
+ /* harmony export */ });
7338
+ /* harmony import */ var _speclynx_apidom_ls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3238);
7339
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24454);
7340
+ /* harmony import */ var _config_config_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(19455);
7341
+
7342
+
7343
+
7344
+
7345
+ /**
7346
+ * Default language service context for validation.
7347
+ *
7348
+ * Controls validation behavior including JSON Schema validation,
7349
+ * semantic validation, and linting rules.
7350
+ *
7351
+ * @public
7352
+ */
7353
+ const defaultLanguageServiceContext = {
7354
+ metadata: (0,_config_config_ts__WEBPACK_IMPORTED_MODULE_2__.config)(),
7355
+ defaultContentLanguage: {
7356
+ namespace: 'arazzo',
7357
+ version: '1.0.1',
7358
+ mediaType: 'application/vnd.oai.workflows;version=1.0.1'
7359
+ },
7360
+ validatorProviders: [new _speclynx_apidom_ls__WEBPACK_IMPORTED_MODULE_0__.Arazzo1JsonSchemaValidationProvider()],
7361
+ validationContext: {
7362
+ jsonSchemaValidation: true,
7363
+ semanticValidation: true,
7364
+ referenceValidation: false,
7365
+ semanticLinting: true,
7366
+ betterAjvErrors: true
7367
+ },
7368
+ parseContext: {
7369
+ fileAllowList: ['*'],
7370
+ arazzo: {
7371
+ sourceDescriptionsResolution: true
7372
+ }
7373
+ }
7374
+ };
7375
+
7376
+ /**
7377
+ * Validates an Arazzo Document from a TextDocument.
7378
+ *
7379
+ * This is a lower-level API for advanced use cases such as IDE integrations
7380
+ * or when you already have document content in memory.
7381
+ *
7382
+ * @param textDocument - The TextDocument containing the Arazzo Document content
7383
+ * @param context - Optional language service context override (deep merged with defaults)
7384
+ * @returns Promise resolving to an array of Diagnostic objects
7385
+ *
7386
+ * @example
7387
+ * Basic usage
7388
+ * ```typescript
7389
+ * import { validate, TextDocument, DiagnosticSeverity, ARAZZO_LANGUAGE_ID, DEFAULT_DOCUMENT_VERSION } from '@jentic/arazzo-validator';
7390
+ *
7391
+ * const textDocument = TextDocument.create(
7392
+ * 'file:///path/to/arazzo.yaml',
7393
+ * ARAZZO_LANGUAGE_ID,
7394
+ * DEFAULT_DOCUMENT_VERSION,
7395
+ * content
7396
+ * );
7397
+ * const diagnostics = await validate(textDocument);
7398
+ * const errors = diagnostics.filter((d) => d.severity === DiagnosticSeverity.Error);
7399
+ * ```
7400
+ *
7401
+ * @example
7402
+ * Disable JSON Schema validation
7403
+ * ```typescript
7404
+ * const diagnostics = await validate(textDocument, {
7405
+ * validationContext: { jsonSchemaValidation: false }
7406
+ * });
7407
+ * ```
7408
+ * @public
7409
+ */
7410
+ async function validate(textDocument, context = {}) {
7411
+ const mergedContext = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(defaultLanguageServiceContext, context);
7412
+ const languageService = (0,_speclynx_apidom_ls__WEBPACK_IMPORTED_MODULE_0__.getLanguageService)(mergedContext);
7413
+ try {
7414
+ return await languageService.doValidation(textDocument);
7415
+ } finally {
7416
+ languageService.terminate();
7417
+ }
7418
+ }
7419
+
7420
+ /***/ },
7421
+
7201
7422
  /***/ 38792
7202
7423
  (module) {
7203
7424
 
@@ -94960,7 +95181,7 @@ async function Module2(moduleArg = {}) {
94960
95181
  var ENVIRONMENT_IS_NODE = typeof process == "object" && process.versions?.node && process.type != "renderer";
94961
95182
  if (ENVIRONMENT_IS_NODE) {
94962
95183
  const { createRequire } = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 29415, 19));
94963
- var require = createRequire("file:///home/char0n/Documents/GitHub/jentic/jentic-arazzo-tools/node_modules/@speclynx/apidom-parser-adapter-json/node_modules/web-tree-sitter/web-tree-sitter.js");
95184
+ var require = createRequire("file:///home/runner/work/jentic-arazzo-tools/jentic-arazzo-tools/node_modules/@speclynx/apidom-parser-adapter-json/node_modules/web-tree-sitter/web-tree-sitter.js");
94964
95185
  }
94965
95186
  Module.currentQueryProgressCallback = null;
94966
95187
  Module.currentProgressCallback = null;
@@ -94971,7 +95192,7 @@ async function Module2(moduleArg = {}) {
94971
95192
  var quit_ = /* @__PURE__ */ __name((status, toThrow) => {
94972
95193
  throw toThrow;
94973
95194
  }, "quit_");
94974
- var _scriptName = "file:///home/char0n/Documents/GitHub/jentic/jentic-arazzo-tools/node_modules/@speclynx/apidom-parser-adapter-json/node_modules/web-tree-sitter/web-tree-sitter.js";
95195
+ var _scriptName = "file:///home/runner/work/jentic-arazzo-tools/jentic-arazzo-tools/node_modules/@speclynx/apidom-parser-adapter-json/node_modules/web-tree-sitter/web-tree-sitter.js";
94975
95196
  var scriptDirectory = "";
94976
95197
  function locateFile(path) {
94977
95198
  if (Module["locateFile"]) {
@@ -99992,7 +100213,7 @@ async function Module2(moduleArg = {}) {
99992
100213
  var ENVIRONMENT_IS_NODE = typeof process == "object" && process.versions?.node && process.type != "renderer";
99993
100214
  if (ENVIRONMENT_IS_NODE) {
99994
100215
  const { createRequire } = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 35463, 19));
99995
- var require = createRequire("file:///home/char0n/Documents/GitHub/jentic/jentic-arazzo-tools/node_modules/@speclynx/apidom-parser-adapter-yaml-1-2/node_modules/web-tree-sitter/web-tree-sitter.js");
100216
+ var require = createRequire("file:///home/runner/work/jentic-arazzo-tools/jentic-arazzo-tools/node_modules/@speclynx/apidom-parser-adapter-yaml-1-2/node_modules/web-tree-sitter/web-tree-sitter.js");
99996
100217
  }
99997
100218
  Module.currentQueryProgressCallback = null;
99998
100219
  Module.currentProgressCallback = null;
@@ -100003,7 +100224,7 @@ async function Module2(moduleArg = {}) {
100003
100224
  var quit_ = /* @__PURE__ */ __name((status, toThrow) => {
100004
100225
  throw toThrow;
100005
100226
  }, "quit_");
100006
- var _scriptName = "file:///home/char0n/Documents/GitHub/jentic/jentic-arazzo-tools/node_modules/@speclynx/apidom-parser-adapter-yaml-1-2/node_modules/web-tree-sitter/web-tree-sitter.js";
100227
+ var _scriptName = "file:///home/runner/work/jentic-arazzo-tools/jentic-arazzo-tools/node_modules/@speclynx/apidom-parser-adapter-yaml-1-2/node_modules/web-tree-sitter/web-tree-sitter.js";
100007
100228
  var scriptDirectory = "";
100008
100229
  function locateFile(path) {
100009
100230
  if (Module["locateFile"]) {
@@ -153191,167 +153412,27 @@ var __webpack_exports__ = {};
153191
153412
  "use strict";
153192
153413
  __webpack_require__.r(__webpack_exports__);
153193
153414
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
153194
- /* harmony export */ DiagnosticSeverity: () => (/* reexport safe */ vscode_languageserver_types__WEBPACK_IMPORTED_MODULE_1__.DiagnosticSeverity),
153195
- /* harmony export */ TextDocument: () => (/* reexport safe */ vscode_languageserver_textdocument__WEBPACK_IMPORTED_MODULE_0__.TextDocument),
153196
- /* harmony export */ defaultArazzoResolveOptions: () => (/* binding */ defaultArazzoResolveOptions),
153197
- /* harmony export */ defaultLanguageServiceContext: () => (/* binding */ defaultLanguageServiceContext),
153198
- /* harmony export */ validate: () => (/* binding */ validate),
153199
- /* harmony export */ validateURI: () => (/* binding */ validateURI)
153415
+ /* harmony export */ ARAZZO_LANGUAGE_ID: () => (/* reexport safe */ _document_ts__WEBPACK_IMPORTED_MODULE_1__.ARAZZO_LANGUAGE_ID),
153416
+ /* harmony export */ DEFAULT_DOCUMENT_VERSION: () => (/* reexport safe */ _document_ts__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_DOCUMENT_VERSION),
153417
+ /* harmony export */ Diagnostic: () => (/* reexport safe */ vscode_languageserver_types__WEBPACK_IMPORTED_MODULE_0__.Diagnostic),
153418
+ /* harmony export */ DiagnosticSeverity: () => (/* reexport safe */ vscode_languageserver_types__WEBPACK_IMPORTED_MODULE_0__.DiagnosticSeverity),
153419
+ /* harmony export */ TextDocument: () => (/* reexport safe */ _document_ts__WEBPACK_IMPORTED_MODULE_2__.TextDocument),
153420
+ /* harmony export */ createTextDocument: () => (/* reexport safe */ _document_ts__WEBPACK_IMPORTED_MODULE_1__.createTextDocument),
153421
+ /* harmony export */ defaultArazzoResolveOptions: () => (/* reexport safe */ _validators_validate_uri_ts__WEBPACK_IMPORTED_MODULE_4__.defaultArazzoResolveOptions),
153422
+ /* harmony export */ defaultLanguageServiceContext: () => (/* reexport safe */ _validators_validate_ts__WEBPACK_IMPORTED_MODULE_3__.defaultLanguageServiceContext),
153423
+ /* harmony export */ validate: () => (/* reexport safe */ _validators_validate_ts__WEBPACK_IMPORTED_MODULE_3__.validate),
153424
+ /* harmony export */ validateURI: () => (/* reexport safe */ _validators_validate_uri_ts__WEBPACK_IMPORTED_MODULE_4__.validateURI)
153200
153425
  /* harmony export */ });
153201
- /* harmony import */ var vscode_languageserver_textdocument__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(58041);
153202
- /* harmony import */ var vscode_languageserver_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32852);
153203
- /* harmony import */ var _speclynx_apidom_ls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3238);
153204
- /* harmony import */ var _jentic_arazzo_parser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42859);
153205
- /* harmony import */ var _speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(212);
153206
- /* harmony import */ var _speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8841);
153207
- /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24454);
153208
- /* harmony import */ var _config_config_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(19455);
153209
-
153210
-
153211
-
153212
-
153213
-
153214
-
153426
+ /* harmony import */ var vscode_languageserver_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32852);
153427
+ /* harmony import */ var _document_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48869);
153428
+ /* harmony import */ var _document_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(58041);
153429
+ /* harmony import */ var _validators_validate_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7500);
153430
+ /* harmony import */ var _validators_validate_uri_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(48411);
153215
153431
 
153216
153432
 
153217
- /**
153218
- * Default resolve options for URI resolution in validateURI.
153219
- *
153220
- * These options control how files and URLs are fetched when validating
153221
- * Arazzo documents from URIs.
153222
- *
153223
- * @public
153224
- */
153225
- const defaultArazzoResolveOptions = _jentic_arazzo_parser__WEBPACK_IMPORTED_MODULE_3__.defaultOptions.resolve;
153226
153433
 
153227
- /**
153228
- * Default language service context for validation.
153229
- *
153230
- * Controls validation behavior including JSON Schema validation,
153231
- * semantic validation, and linting rules.
153232
- *
153233
- * @public
153234
- */
153235
- const defaultLanguageServiceContext = {
153236
- metadata: (0,_config_config_ts__WEBPACK_IMPORTED_MODULE_7__.config)(),
153237
- defaultContentLanguage: {
153238
- namespace: 'arazzo',
153239
- version: '1.0.1',
153240
- mediaType: 'application/vnd.oai.workflows;version=1.0.1'
153241
- },
153242
- validatorProviders: [new _speclynx_apidom_ls__WEBPACK_IMPORTED_MODULE_2__.Arazzo1JsonSchemaValidationProvider()],
153243
- validationContext: {
153244
- jsonSchemaValidation: true,
153245
- semanticValidation: true,
153246
- referenceValidation: false,
153247
- semanticLinting: true,
153248
- betterAjvErrors: true
153249
- },
153250
- parseContext: {
153251
- fileAllowList: ['*'],
153252
- arazzo: {
153253
- sourceDescriptionsResolution: true
153254
- }
153255
- }
153256
- };
153257
153434
 
153258
- /**
153259
- * Validates an Arazzo Document from a URI (file path or HTTP(S) URL).
153260
- *
153261
- * This is the primary API for validation. It fetches the document from the
153262
- * specified URI and performs JSON Schema validation, semantic validation,
153263
- * and linting.
153264
- *
153265
- * @param uri - The file system path or HTTP(S) URL to the Arazzo Document
153266
- * @param context - Optional language service context override (deep merged with defaults)
153267
- * @param resolveOptions - Optional resolve options for fetching the URI
153268
- * @returns Promise resolving to an array of Diagnostic objects
153269
- *
153270
- * @example
153271
- * Validate from file
153272
- * ```typescript
153273
- * import { validateURI, DiagnosticSeverity } from '@jentic/arazzo-validator';
153274
- *
153275
- * const diagnostics = await validateURI('/path/to/arazzo.yaml');
153276
- * const errors = diagnostics.filter((d) => d.severity === DiagnosticSeverity.Error);
153277
- * ```
153278
- *
153279
- * @example
153280
- * Validate from URL
153281
- * ```typescript
153282
- * const diagnostics = await validateURI('https://example.com/arazzo.yaml');
153283
- * ```
153284
- *
153285
- * @example
153286
- * Validate with custom context
153287
- * ```typescript
153288
- * const diagnostics = await validateURI('/path/to/arazzo.yaml', {
153289
- * validationContext: { jsonSchemaValidation: false }
153290
- * });
153291
- * ```
153292
- *
153293
- * @example
153294
- * Validate with custom resolve options
153295
- * ```typescript
153296
- * const diagnostics = await validateURI('/path/to/arazzo.yaml', {}, {
153297
- * resolverOpts: { timeout: 10000 }
153298
- * });
153299
- * ```
153300
- * @public
153301
- */
153302
- async function validateURI(uri, context = {}, resolveOptions = {}) {
153303
- const mergedOptions = (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_5__.merge)(_jentic_arazzo_parser__WEBPACK_IMPORTED_MODULE_3__.defaultOptions, {
153304
- resolve: resolveOptions
153305
- });
153306
- const buffer = await (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_4__.readFile)(uri, mergedOptions);
153307
- const content = new TextDecoder().decode(buffer);
153308
- const textDocument = vscode_languageserver_textdocument__WEBPACK_IMPORTED_MODULE_0__.TextDocument.create(uri, 'arazzo', 1, content);
153309
- return validate(textDocument, context);
153310
- }
153311
153435
 
153312
- /**
153313
- * Validates an Arazzo Document from a TextDocument.
153314
- *
153315
- * This is a lower-level API for advanced use cases such as IDE integrations
153316
- * or when you already have document content in memory.
153317
- *
153318
- * @param textDocument - The TextDocument containing the Arazzo Document content
153319
- * @param context - Optional language service context override (deep merged with defaults)
153320
- * @returns Promise resolving to an array of Diagnostic objects
153321
- *
153322
- * @example
153323
- * Basic usage
153324
- * ```typescript
153325
- * import { validate, TextDocument, DiagnosticSeverity } from '@jentic/arazzo-validator';
153326
- *
153327
- * const textDocument = TextDocument.create(
153328
- * 'file:///path/to/arazzo.yaml',
153329
- * 'arazzo',
153330
- * 1,
153331
- * content
153332
- * );
153333
- * const diagnostics = await validate(textDocument);
153334
- * const errors = diagnostics.filter((d) => d.severity === DiagnosticSeverity.Error);
153335
- * ```
153336
- *
153337
- * @example
153338
- * Disable JSON Schema validation
153339
- * ```typescript
153340
- * const diagnostics = await validate(textDocument, {
153341
- * validationContext: { jsonSchemaValidation: false }
153342
- * });
153343
- * ```
153344
- * @public
153345
- */
153346
- async function validate(textDocument, context = {}) {
153347
- const mergedContext = (0,ramda__WEBPACK_IMPORTED_MODULE_6__["default"])(defaultLanguageServiceContext, context);
153348
- const languageService = (0,_speclynx_apidom_ls__WEBPACK_IMPORTED_MODULE_2__.getLanguageService)(mergedContext);
153349
- try {
153350
- return await languageService.doValidation(textDocument);
153351
- } finally {
153352
- languageService.terminate();
153353
- }
153354
- }
153355
153436
  })();
153356
153437
 
153357
153438
  /******/ return __webpack_exports__;