@rxap/workspace-open-api 19.0.3-dev.0 → 19.0.3-dev.1

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.
Files changed (104) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/package.json +5 -5
  3. package/src/lib/create-directive.d.ts +31 -0
  4. package/src/lib/create-directive.js +39 -0
  5. package/src/lib/create-directive.js.map +1 -1
  6. package/src/lib/generate-components.d.ts +9 -0
  7. package/src/lib/generate-components.js +32 -0
  8. package/src/lib/generate-components.js.map +1 -1
  9. package/src/lib/generate-data-source.d.ts +21 -0
  10. package/src/lib/generate-data-source.js +21 -0
  11. package/src/lib/generate-data-source.js.map +1 -1
  12. package/src/lib/generate-directives.d.ts +23 -0
  13. package/src/lib/generate-directives.js +23 -0
  14. package/src/lib/generate-directives.js.map +1 -1
  15. package/src/lib/generate-index-exports.d.ts +15 -0
  16. package/src/lib/generate-index-exports.js +15 -0
  17. package/src/lib/generate-index-exports.js.map +1 -1
  18. package/src/lib/generate-interfaces.d.ts +17 -0
  19. package/src/lib/generate-interfaces.js +17 -0
  20. package/src/lib/generate-interfaces.js.map +1 -1
  21. package/src/lib/generate-operation-command.d.ts +29 -0
  22. package/src/lib/generate-operation-command.js +29 -0
  23. package/src/lib/generate-operation-command.js.map +1 -1
  24. package/src/lib/generate-operation.d.ts +20 -0
  25. package/src/lib/generate-operation.js +41 -0
  26. package/src/lib/generate-operation.js.map +1 -1
  27. package/src/lib/generate-parameters.d.ts +27 -0
  28. package/src/lib/generate-parameters.js +27 -0
  29. package/src/lib/generate-parameters.js.map +1 -1
  30. package/src/lib/generate-remote-method.d.ts +25 -0
  31. package/src/lib/generate-remote-method.js +25 -0
  32. package/src/lib/generate-remote-method.js.map +1 -1
  33. package/src/lib/generate-request-body.d.ts +16 -0
  34. package/src/lib/generate-request-body.js +16 -0
  35. package/src/lib/generate-request-body.js.map +1 -1
  36. package/src/lib/generate-response.d.ts +23 -0
  37. package/src/lib/generate-response.js +23 -0
  38. package/src/lib/generate-response.js.map +1 -1
  39. package/src/lib/load-open-api-config.d.ts +17 -0
  40. package/src/lib/load-open-api-config.js +17 -0
  41. package/src/lib/load-open-api-config.js.map +1 -1
  42. package/src/lib/resolve-ref.d.ts +10 -0
  43. package/src/lib/resolve-ref.js +10 -0
  44. package/src/lib/resolve-ref.js.map +1 -1
  45. package/src/lib/types.d.ts +40 -0
  46. package/src/lib/types.js +40 -0
  47. package/src/lib/types.js.map +1 -1
  48. package/src/lib/utilities/any-schema-object.d.ts +9 -0
  49. package/src/lib/utilities/any-schema-object.js +9 -0
  50. package/src/lib/utilities/any-schema-object.js.map +1 -1
  51. package/src/lib/utilities/create-component-type-alias-source-file.d.ts +19 -0
  52. package/src/lib/utilities/create-component-type-alias-source-file.js +19 -0
  53. package/src/lib/utilities/create-component-type-alias-source-file.js.map +1 -1
  54. package/src/lib/utilities/get-parameter-type.d.ts +10 -0
  55. package/src/lib/utilities/get-parameter-type.js +10 -0
  56. package/src/lib/utilities/get-parameter-type.js.map +1 -1
  57. package/src/lib/utilities/get-reqeust-body.d.ts +12 -0
  58. package/src/lib/utilities/get-reqeust-body.js +12 -0
  59. package/src/lib/utilities/get-reqeust-body.js.map +1 -1
  60. package/src/lib/utilities/get-request-body-type.d.ts +19 -0
  61. package/src/lib/utilities/get-request-body-type.js +19 -0
  62. package/src/lib/utilities/get-request-body-type.js.map +1 -1
  63. package/src/lib/utilities/get-response-type.d.ts +15 -0
  64. package/src/lib/utilities/get-response-type.js +15 -0
  65. package/src/lib/utilities/get-response-type.js.map +1 -1
  66. package/src/lib/utilities/get-response.d.ts +13 -0
  67. package/src/lib/utilities/get-response.js +13 -0
  68. package/src/lib/utilities/get-response.js.map +1 -1
  69. package/src/lib/utilities/get-type-parameters.d.ts +14 -0
  70. package/src/lib/utilities/get-type-parameters.js +14 -0
  71. package/src/lib/utilities/get-type-parameters.js.map +1 -1
  72. package/src/lib/utilities/has-operation-paramters.d.ts +10 -0
  73. package/src/lib/utilities/has-operation-paramters.js +10 -0
  74. package/src/lib/utilities/has-operation-paramters.js.map +1 -1
  75. package/src/lib/utilities/has-operation-request-body.d.ts +10 -0
  76. package/src/lib/utilities/has-operation-request-body.js +10 -0
  77. package/src/lib/utilities/has-operation-request-body.js.map +1 -1
  78. package/src/lib/utilities/http-request.d.ts +30 -0
  79. package/src/lib/utilities/http-request.js +30 -0
  80. package/src/lib/utilities/http-request.js.map +1 -1
  81. package/src/lib/utilities/ignore-operation.d.ts +11 -0
  82. package/src/lib/utilities/ignore-operation.js +11 -0
  83. package/src/lib/utilities/ignore-operation.js.map +1 -1
  84. package/src/lib/utilities/is-collection-response.d.ts +13 -0
  85. package/src/lib/utilities/is-collection-response.js +13 -0
  86. package/src/lib/utilities/is-collection-response.js.map +1 -1
  87. package/src/lib/utilities/is-http-method.d.ts +14 -0
  88. package/src/lib/utilities/is-http-method.js +14 -0
  89. package/src/lib/utilities/is-http-method.js.map +1 -1
  90. package/src/lib/utilities/is-open-api-schema-from-path.d.ts +11 -0
  91. package/src/lib/utilities/is-open-api-schema-from-path.js +11 -0
  92. package/src/lib/utilities/is-open-api-schema-from-path.js.map +1 -1
  93. package/src/lib/utilities/is-operation-object.d.ts +16 -0
  94. package/src/lib/utilities/is-operation-object.js +16 -0
  95. package/src/lib/utilities/is-operation-object.js.map +1 -1
  96. package/src/lib/utilities/is-reference-object.d.ts +22 -0
  97. package/src/lib/utilities/is-reference-object.js +22 -0
  98. package/src/lib/utilities/is-reference-object.js.map +1 -1
  99. package/src/lib/utilities/is-without-parameters.d.ts +10 -0
  100. package/src/lib/utilities/is-without-parameters.js +10 -0
  101. package/src/lib/utilities/is-without-parameters.js.map +1 -1
  102. package/src/lib/utilities/ref-schema-object.d.ts +26 -0
  103. package/src/lib/utilities/ref-schema-object.js +26 -0
  104. package/src/lib/utilities/ref-schema-object.js.map +1 -1
@@ -1 +1,15 @@
1
+ /**
2
+ * Checks if the provided method string is a valid HTTP method.
3
+ *
4
+ * This function determines if the given string corresponds to one of the common HTTP methods
5
+ * used in web development. It specifically checks for 'get', 'put', 'post', 'delete', or 'patch'.
6
+ *
7
+ * @param method - The method string to check.
8
+ * @returns True if the method is one of the specified HTTP methods, false otherwise.
9
+ *
10
+ * @example
11
+ * IsHttpMethod('get'); // returns true
12
+ * IsHttpMethod('post'); // returns true
13
+ * IsHttpMethod('connect'); // returns false
14
+ */
1
15
  export declare function IsHttpMethod(method: string): method is 'get' | 'put' | 'post' | 'delete' | 'patch';
@@ -1,6 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IsHttpMethod = void 0;
4
+ /**
5
+ * Checks if the provided method string is a valid HTTP method.
6
+ *
7
+ * This function determines if the given string corresponds to one of the common HTTP methods
8
+ * used in web development. It specifically checks for 'get', 'put', 'post', 'delete', or 'patch'.
9
+ *
10
+ * @param method - The method string to check.
11
+ * @returns True if the method is one of the specified HTTP methods, false otherwise.
12
+ *
13
+ * @example
14
+ * IsHttpMethod('get'); // returns true
15
+ * IsHttpMethod('post'); // returns true
16
+ * IsHttpMethod('connect'); // returns false
17
+ */
4
18
  function IsHttpMethod(method) {
5
19
  return ['get', 'put', 'post', 'delete', 'patch'].includes(method);
6
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"is-http-method.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/is-http-method.ts"],"names":[],"mappings":";;;AAAA,SAAgB,YAAY,CAAC,MAAc;IACzC,OAAO,CAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC;AAFD,oCAEC"}
1
+ {"version":3,"file":"is-http-method.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/is-http-method.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;GAaG;AACH,SAAgB,YAAY,CAAC,MAAc;IACzC,OAAO,CAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC;AAFD,oCAEC"}
@@ -1,2 +1,13 @@
1
1
  import { OpenApiSchema, OpenApiSchemaFromPath } from '../types';
2
+ /**
3
+ * Determines if the provided `options` object conforms to the `OpenApiSchemaFromPath` interface.
4
+ *
5
+ * This function checks if the `options` object:
6
+ * 1. Exists and is not null.
7
+ * 2. Contains an index signature, ensuring it can hold properties dynamically.
8
+ * 3. Includes a 'path' property, which is essential for identifying it as an instance of `OpenApiSchemaFromPath`.
9
+ *
10
+ * @param options - The object to be tested against the `OpenApiSchemaFromPath` interface.
11
+ * @returns `true` if `options` matches the `OpenApiSchemaFromPath` interface, otherwise `false`.
12
+ */
2
13
  export declare function IsOpenApiSchemaFromPath(options: OpenApiSchema): options is OpenApiSchemaFromPath;
@@ -2,6 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IsOpenApiSchemaFromPath = void 0;
4
4
  const utilities_1 = require("@rxap/utilities");
5
+ /**
6
+ * Determines if the provided `options` object conforms to the `OpenApiSchemaFromPath` interface.
7
+ *
8
+ * This function checks if the `options` object:
9
+ * 1. Exists and is not null.
10
+ * 2. Contains an index signature, ensuring it can hold properties dynamically.
11
+ * 3. Includes a 'path' property, which is essential for identifying it as an instance of `OpenApiSchemaFromPath`.
12
+ *
13
+ * @param options - The object to be tested against the `OpenApiSchemaFromPath` interface.
14
+ * @returns `true` if `options` matches the `OpenApiSchemaFromPath` interface, otherwise `false`.
15
+ */
5
16
  function IsOpenApiSchemaFromPath(options) {
6
17
  return !!options && (0, utilities_1.hasIndexSignature)(options) && !!options['path'];
7
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"is-open-api-schema-from-path.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/is-open-api-schema-from-path.ts"],"names":[],"mappings":";;;AAAA,+CAAoD;AAMpD,SAAgB,uBAAuB,CAAC,OAAsB;IAC5D,OAAO,CAAC,CAAC,OAAO,IAAI,IAAA,6BAAiB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC;AAFD,0DAEC"}
1
+ {"version":3,"file":"is-open-api-schema-from-path.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/is-open-api-schema-from-path.ts"],"names":[],"mappings":";;;AAAA,+CAAoD;AAMpD;;;;;;;;;;GAUG;AACH,SAAgB,uBAAuB,CAAC,OAAsB;IAC5D,OAAO,CAAC,CAAC,OAAO,IAAI,IAAA,6BAAiB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC;AAFD,0DAEC"}
@@ -1,2 +1,18 @@
1
1
  import { OpenAPIV3 } from 'openapi-types';
2
+ /**
3
+ * Checks if a given object is a valid OpenAPIV3 OperationObject based on the presence of an `operationId` property.
4
+ *
5
+ * An OpenAPI OperationObject typically represents a single API operation on a path and must have an `operationId` which is a unique string used to identify the operation.
6
+ *
7
+ * @param obj - The object to be checked.
8
+ * @returns `true` if the object has a property `operationId` indicating it's likely an OpenAPIV3 OperationObject, otherwise `false`.
9
+ * @example
10
+ *
11
+ * const apiOperation = {
12
+ * operationId: 'getUser',
13
+ * summary: 'Gets a user by ID'
14
+ * };
15
+ * console.log(IsOperationObject(apiOperation)); // Output: true
16
+ * ```
17
+ */
2
18
  export declare function IsOperationObject(obj: any): obj is OpenAPIV3.OperationObject;
@@ -1,6 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IsOperationObject = void 0;
4
+ /**
5
+ * Checks if a given object is a valid OpenAPIV3 OperationObject based on the presence of an `operationId` property.
6
+ *
7
+ * An OpenAPI OperationObject typically represents a single API operation on a path and must have an `operationId` which is a unique string used to identify the operation.
8
+ *
9
+ * @param obj - The object to be checked.
10
+ * @returns `true` if the object has a property `operationId` indicating it's likely an OpenAPIV3 OperationObject, otherwise `false`.
11
+ * @example
12
+ *
13
+ * const apiOperation = {
14
+ * operationId: 'getUser',
15
+ * summary: 'Gets a user by ID'
16
+ * };
17
+ * console.log(IsOperationObject(apiOperation)); // Output: true
18
+ * ```
19
+ */
4
20
  function IsOperationObject(obj) {
5
21
  return !!obj && !!obj['operationId'];
6
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"is-operation-object.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/is-operation-object.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAAC,GAAQ;IACxC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACvC,CAAC;AAFD,8CAEC"}
1
+ {"version":3,"file":"is-operation-object.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/is-operation-object.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,iBAAiB,CAAC,GAAQ;IACxC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACvC,CAAC;AAFD,8CAEC"}
@@ -1,2 +1,24 @@
1
1
  import { OpenAPIV3 } from 'openapi-types';
2
+ /**
3
+ * Checks if the provided object is a ReferenceObject as defined in the OpenAPI V3 specification.
4
+ *
5
+ * A ReferenceObject in the OpenAPI specification is an object that contains a `$ref` property.
6
+ * This function determines if the given object has a `$ref` property, which would indicate that
7
+ * it conforms to the ReferenceObject structure.
8
+ *
9
+ * @param {any} obj - The object to check. This parameter is optional.
10
+ * @returns {boolean} - Returns `true` if the object is a ReferenceObject, otherwise returns `false`.
11
+ *
12
+ * @example
13
+ * // returns true
14
+ * IsReferenceObject({ '$ref': '#/components/schemas/Example' });
15
+ *
16
+ * @example
17
+ * // returns false
18
+ * IsReferenceObject({ 'name': 'Example' });
19
+ *
20
+ * @example
21
+ * // returns false
22
+ * IsReferenceObject();
23
+ */
2
24
  export declare function IsReferenceObject(obj?: any): obj is OpenAPIV3.ReferenceObject;
@@ -1,6 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IsReferenceObject = void 0;
4
+ /**
5
+ * Checks if the provided object is a ReferenceObject as defined in the OpenAPI V3 specification.
6
+ *
7
+ * A ReferenceObject in the OpenAPI specification is an object that contains a `$ref` property.
8
+ * This function determines if the given object has a `$ref` property, which would indicate that
9
+ * it conforms to the ReferenceObject structure.
10
+ *
11
+ * @param {any} obj - The object to check. This parameter is optional.
12
+ * @returns {boolean} - Returns `true` if the object is a ReferenceObject, otherwise returns `false`.
13
+ *
14
+ * @example
15
+ * // returns true
16
+ * IsReferenceObject({ '$ref': '#/components/schemas/Example' });
17
+ *
18
+ * @example
19
+ * // returns false
20
+ * IsReferenceObject({ 'name': 'Example' });
21
+ *
22
+ * @example
23
+ * // returns false
24
+ * IsReferenceObject();
25
+ */
4
26
  function IsReferenceObject(obj) {
5
27
  return !!obj && !!obj['$ref'];
6
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"is-reference-object.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/is-reference-object.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAAC,GAAS;IACzC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAFD,8CAEC"}
1
+ {"version":3,"file":"is-reference-object.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/is-reference-object.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,iBAAiB,CAAC,GAAS;IACzC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAFD,8CAEC"}
@@ -1,3 +1,13 @@
1
1
  import { OpenAPIV3 } from 'openapi-types';
2
2
  export type OperationObjectWithoutParameters = Omit<OpenAPIV3.OperationObject, 'parameters'>;
3
+ /**
4
+ * Checks if the provided OpenAPI operation object does not contain any parameters.
5
+ *
6
+ * This function is a type guard that determines whether the `operation` object passed to it
7
+ * conforms to the `OperationObjectWithoutParameters` type, which is a subtype of the standard
8
+ * OpenAPI operation object that specifically has no parameters.
9
+ *
10
+ * @param operation - The OpenAPI operation object to check.
11
+ * @returns `true` if the operation object has no parameters or an empty parameters array, otherwise `false`.
12
+ */
3
13
  export declare function IsWithoutParameters(operation: OpenAPIV3.OperationObject): operation is OperationObjectWithoutParameters;
@@ -1,6 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IsWithoutParameters = void 0;
4
+ /**
5
+ * Checks if the provided OpenAPI operation object does not contain any parameters.
6
+ *
7
+ * This function is a type guard that determines whether the `operation` object passed to it
8
+ * conforms to the `OperationObjectWithoutParameters` type, which is a subtype of the standard
9
+ * OpenAPI operation object that specifically has no parameters.
10
+ *
11
+ * @param operation - The OpenAPI operation object to check.
12
+ * @returns `true` if the operation object has no parameters or an empty parameters array, otherwise `false`.
13
+ */
4
14
  function IsWithoutParameters(operation) {
5
15
  return !operation.parameters || !operation.parameters.length;
6
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"is-without-parameters.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/is-without-parameters.ts"],"names":[],"mappings":";;;AAIA,SAAgB,mBAAmB,CAAC,SAAoC;IACtE,OAAO,CAAC,SAAS,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC;AAC/D,CAAC;AAFD,kDAEC"}
1
+ {"version":3,"file":"is-without-parameters.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/is-without-parameters.ts"],"names":[],"mappings":";;;AAIA;;;;;;;;;GASG;AACH,SAAgB,mBAAmB,CAAC,SAAoC;IACtE,OAAO,CAAC,SAAS,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC;AAC/D,CAAC;AAFD,kDAEC"}
@@ -1,9 +1,35 @@
1
1
  export interface RefSchemaObject {
2
2
  $ref: string;
3
3
  }
4
+ /**
5
+ * Checks if the given object is a reference schema object.
6
+ *
7
+ * A reference schema object is typically used in JSON schema and OpenAPI specifications
8
+ * to reuse definitions. This function determines if the provided object contains a `$ref` property,
9
+ * which is a common indicator of a reference schema object.
10
+ *
11
+ * @param obj - The object to check.
12
+ * @returns True if `obj` contains a `$ref` property, indicating it is a reference schema object; otherwise, false.
13
+ *
14
+ * @example
15
+ *
16
+ * const schema = { $ref: '#/definitions/example' };
17
+ * console.log(IsRefSchemaObject(schema)); // Output: true
18
+ * ```
19
+ */
4
20
  export declare function IsRefSchemaObject(obj: any): obj is RefSchemaObject;
5
21
  export interface ArrayRefSchemaObject {
6
22
  type: 'array';
7
23
  items: RefSchemaObject;
8
24
  }
25
+ /**
26
+ * Checks if a given object conforms to the `ArrayRefSchemaObject` type.
27
+ *
28
+ * This function determines if the provided object is an `ArrayRefSchemaObject` by checking specific properties:
29
+ * - The object must exist and have a `type` property equal to 'array'.
30
+ * - The `items` property of the object must satisfy the `IsRefSchemaObject` check.
31
+ *
32
+ * @param obj - The object to be checked.
33
+ * @returns True if the object matches the `ArrayRefSchemaObject` type criteria, false otherwise.
34
+ */
9
35
  export declare function IsArrayRefSchemaObject(obj: any): obj is ArrayRefSchemaObject;
@@ -1,10 +1,36 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IsArrayRefSchemaObject = exports.IsRefSchemaObject = void 0;
4
+ /**
5
+ * Checks if the given object is a reference schema object.
6
+ *
7
+ * A reference schema object is typically used in JSON schema and OpenAPI specifications
8
+ * to reuse definitions. This function determines if the provided object contains a `$ref` property,
9
+ * which is a common indicator of a reference schema object.
10
+ *
11
+ * @param obj - The object to check.
12
+ * @returns True if `obj` contains a `$ref` property, indicating it is a reference schema object; otherwise, false.
13
+ *
14
+ * @example
15
+ *
16
+ * const schema = { $ref: '#/definitions/example' };
17
+ * console.log(IsRefSchemaObject(schema)); // Output: true
18
+ * ```
19
+ */
4
20
  function IsRefSchemaObject(obj) {
5
21
  return obj && obj['$ref'];
6
22
  }
7
23
  exports.IsRefSchemaObject = IsRefSchemaObject;
24
+ /**
25
+ * Checks if a given object conforms to the `ArrayRefSchemaObject` type.
26
+ *
27
+ * This function determines if the provided object is an `ArrayRefSchemaObject` by checking specific properties:
28
+ * - The object must exist and have a `type` property equal to 'array'.
29
+ * - The `items` property of the object must satisfy the `IsRefSchemaObject` check.
30
+ *
31
+ * @param obj - The object to be checked.
32
+ * @returns True if the object matches the `ArrayRefSchemaObject` type criteria, false otherwise.
33
+ */
8
34
  function IsArrayRefSchemaObject(obj) {
9
35
  return obj && obj.type === 'array' && IsRefSchemaObject(obj.items);
10
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ref-schema-object.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/ref-schema-object.ts"],"names":[],"mappings":";;;AAIA,SAAgB,iBAAiB,CAAC,GAAQ;IACxC,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAFD,8CAEC;AAOD,SAAgB,sBAAsB,CAAC,GAAQ;IAC7C,OAAO,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,IAAI,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC;AAFD,wDAEC"}
1
+ {"version":3,"file":"ref-schema-object.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/ref-schema-object.ts"],"names":[],"mappings":";;;AAIA;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,iBAAiB,CAAC,GAAQ;IACxC,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAFD,8CAEC;AAOD;;;;;;;;;GASG;AACH,SAAgB,sBAAsB,CAAC,GAAQ;IAC7C,OAAO,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,IAAI,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC;AAFD,wDAEC"}