@swagger-api/apidom-ns-openapi-3-1 1.0.0-alpha.0 → 1.0.0-alpha.10
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 +51 -0
- package/cjs/index.cjs +2 -2
- package/cjs/refractor/plugins/normalize-header-examples/NormalizeStorage.cjs +38 -0
- package/cjs/refractor/plugins/{normalize-header-examples.cjs → normalize-header-examples/index.cjs} +32 -6
- package/cjs/refractor/plugins/normalize-operation-ids.cjs +30 -12
- package/cjs/refractor/plugins/normalize-parameter-examples.cjs +32 -6
- package/cjs/refractor/plugins/normalize-parameters.cjs +29 -4
- package/cjs/refractor/plugins/normalize-security-requirements.cjs +21 -3
- package/cjs/refractor/plugins/normalize-servers.cjs +43 -16
- package/cjs/refractor/toolbox.cjs +23 -0
- package/dist/apidom-ns-openapi-3-1.browser.js +605 -212
- package/dist/apidom-ns-openapi-3-1.browser.min.js +1 -1
- package/es/index.mjs +1 -1
- package/es/refractor/plugins/normalize-header-examples/NormalizeStorage.mjs +34 -0
- package/es/refractor/plugins/{normalize-header-examples.mjs → normalize-header-examples/index.mjs} +30 -7
- package/es/refractor/plugins/normalize-operation-ids.mjs +29 -12
- package/es/refractor/plugins/normalize-parameter-examples.mjs +30 -7
- package/es/refractor/plugins/normalize-parameters.mjs +27 -4
- package/es/refractor/plugins/normalize-security-requirements.mjs +20 -4
- package/es/refractor/plugins/normalize-servers.mjs +42 -17
- package/es/refractor/toolbox.mjs +24 -1
- package/package.json +6 -5
- package/types/dist.d.ts +73 -36
package/types/dist.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="@swagger-api/apidom-core/types/minim" />
|
|
2
|
-
import * as _swagger_api_apidom_core from '@swagger-api/apidom-core';
|
|
3
1
|
import { MediaTypes, NamespacePluginOptions, ObjectElement, Meta, Attributes, StringElement, ArrayElement, Element, NumberElement, BooleanElement, ElementPredicate, isElement, isStringElement, isArrayElement, isObjectElement, isMemberElement, includesClasses, hasElementSourceMap, Namespace } from '@swagger-api/apidom-core';
|
|
4
2
|
export { isArrayElement, isBooleanElement, isElement, isLinkElement as isLinkPrimitiveElement, isMemberElement, isNullElement, isNumberElement, isObjectElement, isRefElement, isStringElement } from '@swagger-api/apidom-core';
|
|
5
3
|
import * as minim from 'minim';
|
|
@@ -438,10 +436,21 @@ type Predicates = typeof openApi3_1Predicates & {
|
|
|
438
436
|
includesClasses: typeof includesClasses;
|
|
439
437
|
hasElementSourceMap: typeof hasElementSourceMap;
|
|
440
438
|
};
|
|
441
|
-
|
|
439
|
+
interface Toolbox {
|
|
442
440
|
predicates: Predicates;
|
|
443
|
-
|
|
444
|
-
|
|
441
|
+
ancestorLineageToJSONPointer: typeof ancestorLineageToJSONPointer;
|
|
442
|
+
namespace: Namespace;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Translates visitor ancestor lineage to a JSON Pointer tokens.
|
|
446
|
+
* Ancestor lineage is constructed of following visitor method arguments:
|
|
447
|
+
*
|
|
448
|
+
* - ancestors
|
|
449
|
+
* - parent
|
|
450
|
+
* - element
|
|
451
|
+
*/
|
|
452
|
+
declare const ancestorLineageToJSONPointer: <T extends (Element | Element[])[]>(elementPath: T) => string;
|
|
453
|
+
declare const createToolbox: () => Toolbox;
|
|
445
454
|
|
|
446
455
|
declare const plugin$6: () => ({ predicates }: {
|
|
447
456
|
predicates: Predicates;
|
|
@@ -459,17 +468,24 @@ declare const plugin$6: () => ({ predicates }: {
|
|
|
459
468
|
* A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item,
|
|
460
469
|
* the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters.
|
|
461
470
|
* A unique parameter is defined by a combination of a name and location.
|
|
471
|
+
*
|
|
472
|
+
* NOTE: this plugin is idempotent
|
|
462
473
|
*/
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
474
|
+
interface PluginOptions$5 {
|
|
475
|
+
storageField?: string;
|
|
476
|
+
}
|
|
477
|
+
declare const plugin$5: ({ storageField }?: PluginOptions$5) => (toolbox: Toolbox) => {
|
|
466
478
|
visitor: {
|
|
479
|
+
OpenApi3_1Element: {
|
|
480
|
+
enter(element: OpenApi3_1): void;
|
|
481
|
+
leave(): void;
|
|
482
|
+
};
|
|
467
483
|
PathItemElement: {
|
|
468
|
-
enter(pathItemElement: PathItem, key:
|
|
484
|
+
enter(pathItemElement: PathItem, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]]): void;
|
|
469
485
|
leave(): void;
|
|
470
486
|
};
|
|
471
487
|
OperationElement: {
|
|
472
|
-
leave(operationElement: Operation): void;
|
|
488
|
+
leave(operationElement: Operation, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]]): void;
|
|
473
489
|
};
|
|
474
490
|
};
|
|
475
491
|
};
|
|
@@ -483,17 +499,20 @@ declare const plugin$5: () => ({ predicates }: {
|
|
|
483
499
|
* To remove a top-level security declaration, an empty array can be used.
|
|
484
500
|
* When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object,
|
|
485
501
|
* only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request.
|
|
502
|
+
*
|
|
503
|
+
* NOTE: this plugin is idempotent
|
|
486
504
|
*/
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
505
|
+
interface PluginOptions$4 {
|
|
506
|
+
storageField?: string;
|
|
507
|
+
}
|
|
508
|
+
declare const plugin$4: ({ storageField }?: PluginOptions$4) => (toolbox: Toolbox) => {
|
|
490
509
|
visitor: {
|
|
491
510
|
OpenApi3_1Element: {
|
|
492
511
|
enter(openapiElement: OpenApi3_1): void;
|
|
493
512
|
leave(): void;
|
|
494
513
|
};
|
|
495
514
|
OperationElement: {
|
|
496
|
-
leave(operationElement: Operation, key:
|
|
515
|
+
leave(operationElement: Operation, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]]): void;
|
|
497
516
|
};
|
|
498
517
|
};
|
|
499
518
|
};
|
|
@@ -510,14 +529,17 @@ declare const plugin$4: () => ({ predicates }: {
|
|
|
510
529
|
* If an alternative server object is specified at the Path Item Object level, it will override OpenAPI.servers.
|
|
511
530
|
* If an alternative server object is specified at the Operation Object level, it will override PathItem.servers and OpenAPI.servers respectively.
|
|
512
531
|
*/
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}) => {
|
|
532
|
+
interface PluginOptions$3 {
|
|
533
|
+
storageField?: string;
|
|
534
|
+
}
|
|
535
|
+
declare const plugin$3: ({ storageField }?: PluginOptions$3) => (toolbox: Toolbox) => {
|
|
517
536
|
visitor: {
|
|
518
|
-
OpenApi3_1Element
|
|
519
|
-
|
|
520
|
-
|
|
537
|
+
OpenApi3_1Element: {
|
|
538
|
+
enter(openapiElement: OpenApi3_1): void;
|
|
539
|
+
leave(): void;
|
|
540
|
+
};
|
|
541
|
+
PathItemElement(pathItemElement: PathItem, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]]): void;
|
|
542
|
+
OperationElement(operationElement: Operation, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]]): void;
|
|
521
543
|
};
|
|
522
544
|
};
|
|
523
545
|
|
|
@@ -535,15 +557,16 @@ declare const plugin$3: () => ({ predicates, namespace }: {
|
|
|
535
557
|
* This plugin also guarantees the uniqueness of all defined Operation.operationId fields,
|
|
536
558
|
* and make sure Link.operationId fields are pointing to correct and normalized Operation.operationId fields.
|
|
537
559
|
*
|
|
560
|
+
* NOTE: this plugin is idempotent
|
|
538
561
|
*/
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
}) => {
|
|
562
|
+
interface PluginOptions$2 {
|
|
563
|
+
storageField?: string;
|
|
564
|
+
operationIdNormalizer?: (operationId: string, path: string, method: string) => string;
|
|
565
|
+
}
|
|
566
|
+
declare const plugin$2: ({ storageField, operationIdNormalizer, }?: PluginOptions$2) => (toolbox: Toolbox) => {
|
|
545
567
|
visitor: {
|
|
546
568
|
OpenApi3_1Element: {
|
|
569
|
+
enter(element: OpenApi3_1): void;
|
|
547
570
|
leave(): void;
|
|
548
571
|
};
|
|
549
572
|
PathItemElement: {
|
|
@@ -551,7 +574,7 @@ declare const plugin$2: ({ operationIdNormalizer }?: {
|
|
|
551
574
|
leave(): void;
|
|
552
575
|
};
|
|
553
576
|
OperationElement: {
|
|
554
|
-
enter(operationElement: Operation): void;
|
|
577
|
+
enter(operationElement: Operation, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]]): void;
|
|
555
578
|
};
|
|
556
579
|
LinkElement: {
|
|
557
580
|
leave(linkElement: Link): void;
|
|
@@ -570,13 +593,20 @@ declare const plugin$2: ({ operationIdNormalizer }?: {
|
|
|
570
593
|
*
|
|
571
594
|
* The example value SHALL override the example provided by the schema.
|
|
572
595
|
* Furthermore, if referencing a schema that contains an example, the examples value SHALL override the example provided by the schema.
|
|
596
|
+
*
|
|
597
|
+
* NOTE: this plugin is idempotent
|
|
573
598
|
*/
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
}
|
|
599
|
+
interface PluginOptions$1 {
|
|
600
|
+
storageField?: string;
|
|
601
|
+
}
|
|
602
|
+
declare const plugin$1: ({ storageField }?: PluginOptions$1) => (toolbox: Toolbox) => {
|
|
577
603
|
visitor: {
|
|
604
|
+
OpenApi3_1Element: {
|
|
605
|
+
enter(element: OpenApi3_1): void;
|
|
606
|
+
leave(): void;
|
|
607
|
+
};
|
|
578
608
|
ParameterElement: {
|
|
579
|
-
leave(parameterElement: Parameter, key:
|
|
609
|
+
leave(parameterElement: Parameter, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]]): void;
|
|
580
610
|
};
|
|
581
611
|
};
|
|
582
612
|
};
|
|
@@ -592,13 +622,20 @@ declare const plugin$1: () => ({ predicates }: {
|
|
|
592
622
|
*
|
|
593
623
|
* The example value SHALL override the example provided by the schema.
|
|
594
624
|
* Furthermore, if referencing a schema that contains an example, the examples value SHALL override the example provided by the schema.
|
|
625
|
+
*
|
|
626
|
+
* NOTE: this plugin is idempotent
|
|
595
627
|
*/
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
}
|
|
628
|
+
interface PluginOptions {
|
|
629
|
+
storageField?: string;
|
|
630
|
+
}
|
|
631
|
+
declare const plugin: ({ storageField }?: PluginOptions) => (toolbox: Toolbox) => {
|
|
599
632
|
visitor: {
|
|
633
|
+
OpenApi3_1Element: {
|
|
634
|
+
enter(element: OpenApi3_1): void;
|
|
635
|
+
leave(): void;
|
|
636
|
+
};
|
|
600
637
|
HeaderElement: {
|
|
601
|
-
leave(headerElement: Header, key:
|
|
638
|
+
leave(headerElement: Header, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]]): void;
|
|
602
639
|
};
|
|
603
640
|
};
|
|
604
641
|
};
|