@rxap/workspace-open-api 19.1.0-dev.5 → 19.1.0-dev.7
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 +12 -0
- package/package.json +2 -2
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/generate-http-resource.js +10 -2
- package/src/lib/generate-http-resource.js.map +1 -1
- package/src/lib/utilities/get-response-type.js +3 -5
- package/src/lib/utilities/get-response-type.js.map +1 -1
- package/src/lib/utilities/has-response-additional-properties.d.ts +2 -0
- package/src/lib/utilities/has-response-additional-properties.js +16 -0
- package/src/lib/utilities/has-response-additional-properties.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [19.1.0-dev.7](https://gitlab.com/rxap/packages/compare/@rxap/workspace-open-api@19.1.0-dev.6...@rxap/workspace-open-api@19.1.0-dev.7) (2025-05-08)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **open-api:** add type parameters for responses with additional properties ([fb84d37](https://gitlab.com/rxap/packages/commit/fb84d3720dd22724ef5c680ab73b180c0115cbab))
|
|
11
|
+
|
|
12
|
+
# [19.1.0-dev.6](https://gitlab.com/rxap/packages/compare/@rxap/workspace-open-api@19.1.0-dev.5...@rxap/workspace-open-api@19.1.0-dev.6) (2025-05-08)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **open-api:** add support for handling response additional properties ([6952b5f](https://gitlab.com/rxap/packages/commit/6952b5f9dceab7c071a4d113c1275b338f6a75b4))
|
|
17
|
+
|
|
6
18
|
# [19.1.0-dev.5](https://gitlab.com/rxap/packages/compare/@rxap/workspace-open-api@19.1.0-dev.4...@rxap/workspace-open-api@19.1.0-dev.5) (2025-04-14)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @rxap/workspace-open-api
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "19.1.0-dev.
|
|
2
|
+
"version": "19.1.0-dev.7",
|
|
3
3
|
"name": "@rxap/workspace-open-api",
|
|
4
4
|
"description": "This package provides utilities and generators for working with OpenAPI specifications in a workspace. It includes functionality for generating TypeScript interfaces, data sources, directives, remote methods, and operation commands based on an OpenAPI schema. The package also offers tools for loading OpenAPI configurations and resolving references within the schema.\n",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"schematics": "./generators.json",
|
|
43
43
|
"type": "commonjs",
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "98d77bcee3aac1c950e2f9f85047def08cfd1674",
|
|
45
45
|
"types": "./src/index.d.ts",
|
|
46
46
|
"main": "./src/index.js"
|
|
47
47
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './lib/utilities/get-response';
|
|
|
8
8
|
export * from './lib/utilities/get-type-parameters';
|
|
9
9
|
export * from './lib/utilities/has-operation-paramters';
|
|
10
10
|
export * from './lib/utilities/has-operation-request-body';
|
|
11
|
+
export * from './lib/utilities/has-response-additional-properties';
|
|
11
12
|
export * from './lib/utilities/http-request';
|
|
12
13
|
export * from './lib/utilities/ignore-operation';
|
|
13
14
|
export * from './lib/utilities/is-collection-response';
|
package/src/index.js
CHANGED
|
@@ -12,6 +12,7 @@ tslib_1.__exportStar(require("./lib/utilities/get-response"), exports);
|
|
|
12
12
|
tslib_1.__exportStar(require("./lib/utilities/get-type-parameters"), exports);
|
|
13
13
|
tslib_1.__exportStar(require("./lib/utilities/has-operation-paramters"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./lib/utilities/has-operation-request-body"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./lib/utilities/has-response-additional-properties"), exports);
|
|
15
16
|
tslib_1.__exportStar(require("./lib/utilities/http-request"), exports);
|
|
16
17
|
tslib_1.__exportStar(require("./lib/utilities/ignore-operation"), exports);
|
|
17
18
|
tslib_1.__exportStar(require("./lib/utilities/is-collection-response"), exports);
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/workspace/open-api/src/index.ts"],"names":[],"mappings":";;;AAAA,mBAAmB;AACnB,4EAAkD;AAClD,kGAAwE;AACxE,6EAAmD;AACnD,2EAAiD;AACjD,gFAAsD;AACtD,4EAAkD;AAClD,uEAA6C;AAC7C,8EAAoD;AACpD,kFAAwD;AACxD,qFAA2D;AAC3D,uEAA6C;AAC7C,2EAAiD;AACjD,iFAAuD;AACvD,yEAA+C;AAC/C,uFAA6D;AAC7D,8EAAoD;AACpD,8EAAoD;AACpD,gFAAsD;AACtD,4EAAkD;AAClD,YAAY;AAEZ,UAAU;AACV,uDAA6B;AAC7B,sDAA4B;AAC5B,iEAAuC;AACvC,oEAA0C;AAC1C,qEAA2C;AAC3C,oEAA0C;AAC1C,uEAA6C;AAC7C,uEAA6C;AAC7C,oEAA0C;AAC1C,2EAAiD;AACjD,mEAAyC;AACzC,oEAA0C;AAC1C,uEAA6C;AAC7C,sEAA4C;AAC5C,kEAAwC;AACxC,qEAA2C;AAC3C,wDAA8B;AAC9B,4DAAkC;AAClC,sDAA4B;AAC5B,YAAY"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/workspace/open-api/src/index.ts"],"names":[],"mappings":";;;AAAA,mBAAmB;AACnB,4EAAkD;AAClD,kGAAwE;AACxE,6EAAmD;AACnD,2EAAiD;AACjD,gFAAsD;AACtD,4EAAkD;AAClD,uEAA6C;AAC7C,8EAAoD;AACpD,kFAAwD;AACxD,qFAA2D;AAC3D,6FAAmE;AACnE,uEAA6C;AAC7C,2EAAiD;AACjD,iFAAuD;AACvD,yEAA+C;AAC/C,uFAA6D;AAC7D,8EAAoD;AACpD,8EAAoD;AACpD,gFAAsD;AACtD,4EAAkD;AAClD,YAAY;AAEZ,UAAU;AACV,uDAA6B;AAC7B,sDAA4B;AAC5B,iEAAuC;AACvC,oEAA0C;AAC1C,qEAA2C;AAC3C,oEAA0C;AAC1C,uEAA6C;AAC7C,uEAA6C;AAC7C,oEAA0C;AAC1C,2EAAiD;AACjD,mEAAyC;AACzC,oEAA0C;AAC1C,uEAA6C;AAC7C,sEAA4C;AAC5C,kEAAwC;AACxC,qEAA2C;AAC3C,wDAA8B;AAC9B,4DAAkC;AAClC,sDAA4B;AAC5B,YAAY"}
|
|
@@ -6,6 +6,7 @@ const workspace_open_api_1 = require("@rxap/workspace-open-api");
|
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const ts_morph_1 = require("ts-morph");
|
|
8
8
|
const const_1 = require("./const");
|
|
9
|
+
const has_response_additional_properties_1 = require("./utilities/has-response-additional-properties");
|
|
9
10
|
function GenerateHttpResource(parameter) {
|
|
10
11
|
var _a, _b, _c, _d, _e;
|
|
11
12
|
if (parameter.method.toUpperCase() !== 'GET') {
|
|
@@ -104,7 +105,8 @@ function GenerateHttpResource(parameter) {
|
|
|
104
105
|
name: 'options',
|
|
105
106
|
type: `HttpResourceOptions<${responseType}, unknown> & { defaultValue: NoInfer<${responseType}> }`,
|
|
106
107
|
};
|
|
107
|
-
|
|
108
|
+
const withResponseAdditionalProperties = (0, has_response_additional_properties_1.hasResponseAdditionalProperties)(parameter);
|
|
109
|
+
const structure = {
|
|
108
110
|
isExported: true,
|
|
109
111
|
name: (0, utilities_1.camelize)([parameter.operationId, 'http-resource'].join('_')),
|
|
110
112
|
parameters: [...parameters, optionsParameter],
|
|
@@ -123,13 +125,19 @@ function GenerateHttpResource(parameter) {
|
|
|
123
125
|
{
|
|
124
126
|
parameters: [...parameters.map(p => (Object.assign(Object.assign({}, p), { initializer: undefined }))), optionsParameterNoInfer],
|
|
125
127
|
returnType: `HttpResourceRef<${responseType}>`,
|
|
128
|
+
typeParameters: withResponseAdditionalProperties ? [{ name: 'TResponse' }] : undefined,
|
|
126
129
|
},
|
|
127
130
|
{
|
|
128
131
|
parameters: [...parameters.map(p => (Object.assign(Object.assign({}, p), { initializer: undefined, hasQuestionToken: !!p.initializer }))), optionsParameter],
|
|
129
132
|
returnType: `HttpResourceRef<${responseType} | undefined>`,
|
|
133
|
+
typeParameters: withResponseAdditionalProperties ? [{ name: 'TResponse' }] : undefined,
|
|
130
134
|
}
|
|
131
135
|
]
|
|
132
|
-
}
|
|
136
|
+
};
|
|
137
|
+
if (withResponseAdditionalProperties) {
|
|
138
|
+
structure.typeParameters = [{ name: 'TResponse' }];
|
|
139
|
+
}
|
|
140
|
+
sourceFile.addFunction(structure);
|
|
133
141
|
sourceFile.addImportDeclarations(importStructures);
|
|
134
142
|
sourceFile.organizeImports({
|
|
135
143
|
ensureNewLineAtEndOfFile: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-http-resource.js","sourceRoot":"","sources":["../../../../../../packages/workspace/open-api/src/lib/generate-http-resource.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"generate-http-resource.js","sourceRoot":"","sources":["../../../../../../packages/workspace/open-api/src/lib/generate-http-resource.ts"],"names":[],"mappings":";;AAqBA,oDAsLC;AA3MD,+CAAsD;AACtD,iEAOkC;AAClC,+BAA4B;AAC5B,uCAOkB;AAClB,mCAA6E;AAC7E,uGAAiG;AAEjG,SAAgB,oBAAoB,CAClC,SAA+C;;IAE/C,IAAI,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;QAC7C,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GAAG,SAAS,CAAC,WAAW,CAAC;IAE1C,MAAM,IAAI,GAAG,CAAC,WAAW,EAAE,iCAAyB,CAAC,CAAC,IAAI,CAAC,GAAG,CAA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
6
|
const any_schema_object_1 = require("./any-schema-object");
|
|
7
7
|
const get_response_1 = require("./get-response");
|
|
8
|
-
const
|
|
8
|
+
const has_response_additional_properties_1 = require("./has-response-additional-properties");
|
|
9
9
|
/**
|
|
10
10
|
* Determines the response type and name for a given OpenAPI operation.
|
|
11
11
|
*
|
|
@@ -29,10 +29,8 @@ function GetResponseType(operation) {
|
|
|
29
29
|
// only generate the response interface if the type is not any
|
|
30
30
|
if (response && !(0, any_schema_object_1.IsAnySchemaObject)(response)) {
|
|
31
31
|
name = responseType = (0, utilities_1.classify)([operation.operationId, config_1.RESPONSE_FILE_SUFFIX].join('-'));
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
responseType += `<TResponse>`;
|
|
35
|
-
}
|
|
32
|
+
if ((0, has_response_additional_properties_1.hasResponseAdditionalProperties)(operation)) {
|
|
33
|
+
responseType += `<TResponse>`;
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-response-type.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/get-response-type.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"get-response-type.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/get-response-type.ts"],"names":[],"mappings":";;AAuBA,0CA0BC;AAjDD,+CAA2C;AAE3C,sCAAiD;AACjD,2DAAwD;AACxD,iDAA6C;AAC7C,6FAAuF;AAGvF;;;;;;;;;;;;;;GAcG;AACH,SAAgB,eAAe,CAAC,SAAoC;IAElE,IAAI,YAAY,GAAG,MAAM,CAAC;IAC1B,IAAI,IAAI,GAAkB,IAAI,CAAC;IAE/B,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;QAE1B,MAAM,QAAQ,GAAG,IAAA,0BAAW,EAAC,SAAS,CAAC,CAAC;QAExC,8DAA8D;QAC9D,IAAI,QAAQ,IAAI,CAAC,IAAA,qCAAiB,EAAC,QAAQ,CAAC,EAAE,CAAC;YAC7C,IAAI,GAAG,YAAY,GAAG,IAAA,oBAAQ,EAAC,CAAE,SAAS,CAAC,WAAW,EAAE,6BAAoB,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAC1F,IAAI,IAAA,oEAA+B,EAAC,SAAS,CAAC,EAAE,CAAC;gBAC/C,YAAY,IAAI,aAAa,CAAC;YAChC,CAAC;QACH,CAAC;aAAM,CAAC;YACN,YAAY,GAAG,MAAM,CAAC;QACxB,CAAC;IAEH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,IAAI;KACL,CAAC;AAEJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasResponseAdditionalProperties = hasResponseAdditionalProperties;
|
|
4
|
+
const workspace_open_api_1 = require("@rxap/workspace-open-api");
|
|
5
|
+
function hasResponseAdditionalProperties(operation) {
|
|
6
|
+
if (operation.operationId) {
|
|
7
|
+
const response = (0, workspace_open_api_1.GetResponse)(operation);
|
|
8
|
+
if (response && !(0, workspace_open_api_1.IsAnySchemaObject)(response)) {
|
|
9
|
+
if (!(0, workspace_open_api_1.IsReferenceObject)(response)) {
|
|
10
|
+
return response.additionalProperties === true || response.type === undefined;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=has-response-additional-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-response-additional-properties.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/open-api/src/lib/utilities/has-response-additional-properties.ts"],"names":[],"mappings":";;AAOA,0EAWC;AAlBD,iEAIkC;AAGlC,SAAgB,+BAA+B,CAAC,SAAoC;IAClF,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;QAE1B,MAAM,QAAQ,GAAG,IAAA,gCAAW,EAAC,SAAS,CAAC,CAAC;QACxC,IAAI,QAAQ,IAAI,CAAC,IAAA,sCAAiB,EAAC,QAAQ,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC,IAAA,sCAAiB,EAAC,QAAQ,CAAC,EAAE,CAAC;gBACjC,OAAO,QAAQ,CAAC,oBAAoB,KAAK,IAAI,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC;YAC/E,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|