diff --git a/.gitignore b/.gitignore index 43bb2d21..98d8e74d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ herts-gateway/build/ tools/build/ example/build/ example/*.ts +example/typescript-build/node_modules/ e2e-test/build/ benchmark-test/build/ grpc-proto-example/build/ diff --git a/example/src/main/java/org/hertsstack/example/codegents/User.java b/example/src/main/java/org/hertsstack/example/codegents/User.java index 10152c3c..a21cd310 100644 --- a/example/src/main/java/org/hertsstack/example/codegents/User.java +++ b/example/src/main/java/org/hertsstack/example/codegents/User.java @@ -8,4 +8,28 @@ public class User extends HertsMessage { private String id; private String name; private Date createdAt; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } } diff --git a/example/src/main/java/org/hertsstack/example/http/HttpService.java b/example/src/main/java/org/hertsstack/example/http/HttpService.java index ea4f151e..df87b083 100644 --- a/example/src/main/java/org/hertsstack/example/http/HttpService.java +++ b/example/src/main/java/org/hertsstack/example/http/HttpService.java @@ -6,4 +6,5 @@ @HertsHttp public interface HttpService extends HertsService { String helloWorld(); + TestModel getModel(); } diff --git a/example/src/main/java/org/hertsstack/example/http/HttpServiceImpl.java b/example/src/main/java/org/hertsstack/example/http/HttpServiceImpl.java index 92fae0be..cc6cac25 100644 --- a/example/src/main/java/org/hertsstack/example/http/HttpServiceImpl.java +++ b/example/src/main/java/org/hertsstack/example/http/HttpServiceImpl.java @@ -2,9 +2,19 @@ import org.hertsstack.core.service.HertsServiceHttp; +import java.util.UUID; + public class HttpServiceImpl extends HertsServiceHttp implements HttpService { @Override public String helloWorld() { return "hello world"; } + + @Override + public TestModel getModel() { + TestModel model = new TestModel(); + model.setName("name"); + model.setId(UUID.randomUUID().toString()); + return model; + } } diff --git a/example/src/main/java/org/hertsstack/example/http/Main.java b/example/src/main/java/org/hertsstack/example/http/Main.java index 20258f1e..25a3f03f 100644 --- a/example/src/main/java/org/hertsstack/example/http/Main.java +++ b/example/src/main/java/org/hertsstack/example/http/Main.java @@ -1,6 +1,7 @@ package org.hertsstack.example.http; import org.hertsstack.core.context.HertsMetricsSetting; +import org.hertsstack.example.codegents.HttpCodegenTestServiceImpl; import org.hertsstack.http.HertsHttpEngine; import org.hertsstack.http.HertsHttpServer; import org.hertsstack.httpclient.HertsHttpClient; @@ -27,6 +28,7 @@ private static void startServer() { HertsHttpEngine engine = HertsHttpServer.builder() .registerHertsHttpService(new HttpServiceImpl()) + .registerHertsHttpService(new HttpCodegenTestServiceImpl()) .setMetricsSetting(metrics) .build(); diff --git a/example/src/main/java/org/hertsstack/example/http/TestModel.java b/example/src/main/java/org/hertsstack/example/http/TestModel.java new file mode 100644 index 00000000..e9960b9c --- /dev/null +++ b/example/src/main/java/org/hertsstack/example/http/TestModel.java @@ -0,0 +1,24 @@ +package org.hertsstack.example.http; + +import org.hertsstack.core.modelx.HertsMessage; + +public class TestModel extends HertsMessage { + private String id; + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/example/src/main/java/org/hertsstack/example/tlshttp/HttpService.java b/example/src/main/java/org/hertsstack/example/tlshttp/HttpService.java new file mode 100644 index 00000000..cf49c1de --- /dev/null +++ b/example/src/main/java/org/hertsstack/example/tlshttp/HttpService.java @@ -0,0 +1,9 @@ +package org.hertsstack.example.tlshttp; + +import org.hertsstack.core.annotation.HertsHttp; +import org.hertsstack.core.service.HertsService; + +@HertsHttp +public interface HttpService extends HertsService { + String helloWorld(); +} diff --git a/example/src/main/java/org/hertsstack/example/tlshttp/HttpServiceImpl.java b/example/src/main/java/org/hertsstack/example/tlshttp/HttpServiceImpl.java new file mode 100644 index 00000000..51d9d8e7 --- /dev/null +++ b/example/src/main/java/org/hertsstack/example/tlshttp/HttpServiceImpl.java @@ -0,0 +1,10 @@ +package org.hertsstack.example.tlshttp; + +import org.hertsstack.core.service.HertsServiceHttp; + +public class HttpServiceImpl extends HertsServiceHttp implements HttpService { + @Override + public String helloWorld() { + return "hello world"; + } +} diff --git a/example/src/main/java/org/hertsstack/example/tlshttp/Main.java b/example/src/main/java/org/hertsstack/example/tlshttp/Main.java new file mode 100644 index 00000000..df1dab12 --- /dev/null +++ b/example/src/main/java/org/hertsstack/example/tlshttp/Main.java @@ -0,0 +1,49 @@ +package org.hertsstack.example.tlshttp; + +import org.hertsstack.core.context.HertsMetricsSetting; +import org.hertsstack.http.HertsHttpEngine; +import org.hertsstack.http.HertsHttpServer; +import org.hertsstack.httpclient.HertsHttpClient; + +public class Main { + public static void main(String[] args) { + startServer(); + startClient(); + try { + Thread.sleep(1000000); + } catch (InterruptedException e) { + } + System.exit(0); + } + + private static void startServer() { + HertsMetricsSetting metrics = HertsMetricsSetting.builder() + .isRpsEnabled(true) + .isLatencyEnabled(true) + .isErrRateEnabled(true) + .isServerResourceEnabled(true) + .isJvmEnabled(true) + .build(); + + HertsHttpEngine engine = HertsHttpServer.builder() + .registerHertsHttpService(new HttpServiceImpl()) + .setMetricsSetting(metrics) + .setPort(443) + .build(); + + Thread t = new Thread(engine::start); + t.start(); + } + + private static void startClient() { + HertsHttpClient client = HertsHttpClient + .builder("localhost") + .registerHertsService(HttpService.class) + .secure(false) + .build(); + + var service = client.createHertsService(HttpService.class); + var res = service.helloWorld(); + System.out.println(res); + } +} diff --git a/example/typescript-build/package-lock.json b/example/typescript-build/package-lock.json new file mode 100644 index 00000000..9c4babbe --- /dev/null +++ b/example/typescript-build/package-lock.json @@ -0,0 +1,297 @@ +{ + "name": "typescript-build", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "typescript-build", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "axios": "^1.4.0" + }, + "devDependencies": { + "@types/node": "^12.20.55", + "ts-node": "^10.9.1", + "typescript": "^5.1.6" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", + "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + } + } +} diff --git a/example/typescript-build/package.json b/example/typescript-build/package.json new file mode 100644 index 00000000..9ba77cde --- /dev/null +++ b/example/typescript-build/package.json @@ -0,0 +1,17 @@ +{ + "name": "typescript-build", + "version": "1.0.0", + "description": "", + "main": "index.js", + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@types/node": "^12.20.55", + "ts-node": "^10.9.1", + "typescript": "^5.1.6" + }, + "dependencies": { + "axios": "^1.4.0" + } +} \ No newline at end of file diff --git a/example/typescript-build/src/herts-HttpCodegenTestService-client.gen.js b/example/typescript-build/src/herts-HttpCodegenTestService-client.gen.js new file mode 100644 index 00000000..0686d696 --- /dev/null +++ b/example/typescript-build/src/herts-HttpCodegenTestService-client.gen.js @@ -0,0 +1,1468 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HttpCodegenTestServiceClient = void 0; +// Don't edit this file because this file is generated by herts codegen. +var axios_1 = require("axios"); +var HttpCodegenTestServiceClient = /** @class */ (function () { + /** + * API endpoint information with protocol schema. + * @param apiSchema http|https://hoge.com + */ + function HttpCodegenTestServiceClient(apiSchema) { + this.apiSchema = apiSchema; + } + HttpCodegenTestServiceClient.prototype.integerFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/integerFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_integerFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/integerFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.doubleClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/doubleClassFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_doubleClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/doubleClassFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.byteClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/byteClassFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_byteClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/byteClassFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.shortClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/shortClassFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_shortClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/shortClassFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.longClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/longClassFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_longClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/longClassFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.floatClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/floatClassFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_floatClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/floatClassFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.booleanClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/booleanClassFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_booleanClassFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/booleanClassFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.booleanFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/booleanFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_booleanFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/booleanFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.characterFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/characterFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_characterFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/characterFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.bigDecimalFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/bigDecimalFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_bigDecimalFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/bigDecimalFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.listStrFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/listStrFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_listStrFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/listStrFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.customModelFunc = function (headers, body) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/customModelFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_customModelFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/customModelFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.arrayListFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/arrayListFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_arrayListFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/arrayListFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.customModelListFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/customModelListFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_customModelListFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/customModelListFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.hashMapFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/hashMapFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_hashMapFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/hashMapFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.customModelMapFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/customModelMapFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_customModelMapFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/customModelMapFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.stringFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/stringFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_stringFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/stringFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.intFunc = function (headers, body) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/intFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_intFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/intFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.doubleFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/doubleFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_doubleFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/doubleFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.byteFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/byteFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_byteFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/byteFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.shortFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/shortFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_shortFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/shortFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.lingFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/lingFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_lingFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/lingFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.floatFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/floatFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_floatFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/floatFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.charFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/charFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_charFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/charFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.bigIntFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/bigIntFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_bigIntFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/bigIntFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.dateFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/dateFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_dateFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/dateFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.uuidFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/uuidFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_uuidFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/uuidFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.mapStrFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/mapStrFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_mapStrFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/mapStrFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.voidFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/voidFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_voidFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/voidFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.arrayFunc = function (headers, body) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/arrayFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_arrayFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/arrayFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.listFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/listFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_listFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/listFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.mapFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/mapFunc"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_mapFunc = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/mapFunc"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.createUser = function (headers, body) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/createUser"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_createUser = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/createUser"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.getUsers = function (headers) { + return __awaiter(this, void 0, void 0, function () { + var body; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + body = null; + return [4 /*yield*/, axios_1.default.post("".concat((this.apiSchema), "/api/HttpCodegenTestService/getUsers"), body, { + headers: headers, + }) + .then(function (res) { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + HttpCodegenTestServiceClient.prototype.options_getUsers = function (headers) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, axios_1.default.options("".concat((this.apiSchema), "/api/HttpCodegenTestService/getUsers"), { + headers: headers + }) + .then(function (res) { + return res.headers; + }) + .catch(function (e) { + throw e; + })]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + return HttpCodegenTestServiceClient; +}()); +exports.HttpCodegenTestServiceClient = HttpCodegenTestServiceClient; diff --git a/example/typescript-build/src/herts-HttpCodegenTestService-client.gen.ts b/example/typescript-build/src/herts-HttpCodegenTestService-client.gen.ts new file mode 100644 index 00000000..fe78d354 --- /dev/null +++ b/example/typescript-build/src/herts-HttpCodegenTestService-client.gen.ts @@ -0,0 +1,1170 @@ +// Don't edit this file because this file is generated by herts codegen. +import axios, {AxiosError, AxiosHeaders, RawAxiosResponseHeaders} from 'axios' +import {RequestHeaders} from './herts-structure.gen' + +import {IntegerFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {DoubleClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ByteClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ShortClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {LongClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {FloatClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {BooleanClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {BooleanFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {CharacterFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {BigDecimalFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ListStrFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {CustomModelFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ArrayListFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {CustomModelListFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {HashMapFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {CustomModelMapFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {StringFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {IntFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {DoubleFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ByteFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ShortFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {LingFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {FloatFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {CharFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {BigIntFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {DateFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {UuidFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {MapStrFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {VoidFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ArrayFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ListFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {MapFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {CreateUserMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {GetUsersMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' + +import {IntegerFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {DoubleClassFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {ByteClassFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {ShortClassFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {LongClassFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {FloatClassFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {BooleanClassFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {BooleanFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {CharacterFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {BigDecimalFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {ListStrFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {CustomModelFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {ArrayListFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {CustomModelListFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {HashMapFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {CustomModelMapFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {StringFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {IntFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {DoubleFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {ByteFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {ShortFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {LingFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {FloatFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {CharFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {BigIntFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {DateFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {UuidFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {MapStrFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {VoidFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {ArrayFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {ListFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {MapFuncMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {CreateUserMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' +import {GetUsersMethodResponse} from './herts-HttpCodegenTestService-response-model.gen' + +import {CustomModel} from './herts-structure.gen' +import {User} from './herts-structure.gen' + +export class HttpCodegenTestServiceClient { + + /** + * API endpoint information with protocol schema. + * @param apiSchema http|https://hoge.com + */ + constructor(private apiSchema: string) {} + + public async integerFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/integerFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_integerFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/integerFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async doubleClassFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/doubleClassFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_doubleClassFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/doubleClassFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async byteClassFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/byteClassFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_byteClassFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/byteClassFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async shortClassFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/shortClassFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_shortClassFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/shortClassFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async longClassFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/longClassFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_longClassFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/longClassFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async floatClassFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/floatClassFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_floatClassFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/floatClassFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async booleanClassFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/booleanClassFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_booleanClassFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/booleanClassFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async booleanFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/booleanFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_booleanFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/booleanFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async characterFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/characterFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_characterFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/characterFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async bigDecimalFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/bigDecimalFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_bigDecimalFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/bigDecimalFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async listStrFunc ( headers: RequestHeaders ): Promise | null> { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/listStrFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_listStrFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/listStrFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async customModelFunc ( headers: RequestHeaders, body: CustomModelFuncMethodRequest ): Promise { + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/customModelFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_customModelFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/customModelFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async arrayListFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/arrayListFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_arrayListFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/arrayListFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async customModelListFunc ( headers: RequestHeaders ): Promise | null> { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/customModelListFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_customModelListFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/customModelListFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async hashMapFunc ( headers: RequestHeaders ): Promise | null> { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/hashMapFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_hashMapFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/hashMapFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async customModelMapFunc ( headers: RequestHeaders ): Promise | null> { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/customModelMapFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_customModelMapFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/customModelMapFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async stringFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/stringFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_stringFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/stringFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async intFunc ( headers: RequestHeaders, body: IntFuncMethodRequest ): Promise { + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/intFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_intFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/intFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async doubleFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/doubleFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_doubleFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/doubleFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async byteFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/byteFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_byteFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/byteFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async shortFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/shortFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_shortFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/shortFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async lingFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/lingFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_lingFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/lingFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async floatFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/floatFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_floatFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/floatFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async charFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/charFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_charFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/charFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async bigIntFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/bigIntFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_bigIntFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/bigIntFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async dateFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/dateFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_dateFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/dateFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async uuidFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/uuidFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_uuidFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/uuidFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async mapStrFunc ( headers: RequestHeaders ): Promise | null> { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/mapStrFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_mapStrFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/mapStrFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async voidFunc ( headers: RequestHeaders ): Promise { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/voidFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_voidFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/voidFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async arrayFunc ( headers: RequestHeaders, body: ArrayFuncMethodRequest ): Promise | null> { + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/arrayFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_arrayFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/arrayFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async listFunc ( headers: RequestHeaders ): Promise | null> { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/listFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_listFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/listFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async mapFunc ( headers: RequestHeaders ): Promise | null> { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/mapFunc`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_mapFunc ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/mapFunc`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async createUser ( headers: RequestHeaders, body: CreateUserMethodRequest ): Promise { + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/createUser`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_createUser ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/createUser`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + public async getUsers ( headers: RequestHeaders ): Promise | null> { + const body = null; + return await axios.post( + `${(this.apiSchema)}/api/HttpCodegenTestService/getUsers`, + body, + { + headers: headers, + }) + .then(res => { + if (res.data.payload === undefined || res.data.payload === null) { + return null; + } + return res.data.payload.value; + }) + .catch((e: AxiosError) => { + throw e; + }) + } + + public async options_getUsers ( headers: RequestHeaders ): Promise { + return await axios.options( + `${(this.apiSchema)}/api/HttpCodegenTestService/getUsers`, + { + headers: headers + }) + .then(res => { + return res.headers; + }) + .catch((e: AxiosError) => { + throw e; + }) + } +} diff --git a/example/typescript-build/src/herts-HttpCodegenTestService-request-model.gen.js b/example/typescript-build/src/herts-HttpCodegenTestService-request-model.gen.js new file mode 100644 index 00000000..8490e317 --- /dev/null +++ b/example/typescript-build/src/herts-HttpCodegenTestService-request-model.gen.js @@ -0,0 +1,694 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CustomModelMapFuncPayload = exports.HashMapFuncPayload = exports.CustomModelListFuncPayload = exports.ArrayListFuncPayload = exports.CustomModelFuncPayload = exports.ListStrFuncPayload = exports.BigDecimalFuncPayload = exports.CharacterFuncPayload = exports.BooleanFuncPayload = exports.BooleanClassFuncPayload = exports.FloatClassFuncPayload = exports.LongClassFuncPayload = exports.ShortClassFuncPayload = exports.ByteClassFuncPayload = exports.DoubleClassFuncPayload = exports.IntegerFuncPayload = exports.GetUsersMethodRequest = exports.CreateUserMethodRequest = exports.MapFuncMethodRequest = exports.ListFuncMethodRequest = exports.ArrayFuncMethodRequest = exports.VoidFuncMethodRequest = exports.MapStrFuncMethodRequest = exports.UuidFuncMethodRequest = exports.DateFuncMethodRequest = exports.BigIntFuncMethodRequest = exports.CharFuncMethodRequest = exports.FloatFuncMethodRequest = exports.LingFuncMethodRequest = exports.ShortFuncMethodRequest = exports.ByteFuncMethodRequest = exports.DoubleFuncMethodRequest = exports.IntFuncMethodRequest = exports.StringFuncMethodRequest = exports.CustomModelMapFuncMethodRequest = exports.HashMapFuncMethodRequest = exports.CustomModelListFuncMethodRequest = exports.ArrayListFuncMethodRequest = exports.CustomModelFuncMethodRequest = exports.ListStrFuncMethodRequest = exports.BigDecimalFuncMethodRequest = exports.CharacterFuncMethodRequest = exports.BooleanFuncMethodRequest = exports.BooleanClassFuncMethodRequest = exports.FloatClassFuncMethodRequest = exports.LongClassFuncMethodRequest = exports.ShortClassFuncMethodRequest = exports.ByteClassFuncMethodRequest = exports.DoubleClassFuncMethodRequest = exports.IntegerFuncMethodRequest = void 0; +exports.GetUsersPayload = exports.CreateUserPayload = exports.MapFuncPayload = exports.ListFuncPayload = exports.ArrayFuncPayload = exports.VoidFuncPayload = exports.MapStrFuncPayload = exports.UuidFuncPayload = exports.DateFuncPayload = exports.BigIntFuncPayload = exports.CharFuncPayload = exports.FloatFuncPayload = exports.LingFuncPayload = exports.ShortFuncPayload = exports.ByteFuncPayload = exports.DoubleFuncPayload = exports.IntFuncPayload = exports.StringFuncPayload = void 0; +var IntegerFuncMethodRequest = /** @class */ (function () { + function IntegerFuncMethodRequest(payloads) { + this.payloads = payloads; + } + IntegerFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new IntegerFuncMethodRequest(payloads); + }; + ; + return IntegerFuncMethodRequest; +}()); +exports.IntegerFuncMethodRequest = IntegerFuncMethodRequest; +var DoubleClassFuncMethodRequest = /** @class */ (function () { + function DoubleClassFuncMethodRequest(payloads) { + this.payloads = payloads; + } + DoubleClassFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new DoubleClassFuncMethodRequest(payloads); + }; + ; + return DoubleClassFuncMethodRequest; +}()); +exports.DoubleClassFuncMethodRequest = DoubleClassFuncMethodRequest; +var ByteClassFuncMethodRequest = /** @class */ (function () { + function ByteClassFuncMethodRequest(payloads) { + this.payloads = payloads; + } + ByteClassFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new ByteClassFuncMethodRequest(payloads); + }; + ; + return ByteClassFuncMethodRequest; +}()); +exports.ByteClassFuncMethodRequest = ByteClassFuncMethodRequest; +var ShortClassFuncMethodRequest = /** @class */ (function () { + function ShortClassFuncMethodRequest(payloads) { + this.payloads = payloads; + } + ShortClassFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new ShortClassFuncMethodRequest(payloads); + }; + ; + return ShortClassFuncMethodRequest; +}()); +exports.ShortClassFuncMethodRequest = ShortClassFuncMethodRequest; +var LongClassFuncMethodRequest = /** @class */ (function () { + function LongClassFuncMethodRequest(payloads) { + this.payloads = payloads; + } + LongClassFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new LongClassFuncMethodRequest(payloads); + }; + ; + return LongClassFuncMethodRequest; +}()); +exports.LongClassFuncMethodRequest = LongClassFuncMethodRequest; +var FloatClassFuncMethodRequest = /** @class */ (function () { + function FloatClassFuncMethodRequest(payloads) { + this.payloads = payloads; + } + FloatClassFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new FloatClassFuncMethodRequest(payloads); + }; + ; + return FloatClassFuncMethodRequest; +}()); +exports.FloatClassFuncMethodRequest = FloatClassFuncMethodRequest; +var BooleanClassFuncMethodRequest = /** @class */ (function () { + function BooleanClassFuncMethodRequest(payloads) { + this.payloads = payloads; + } + BooleanClassFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new BooleanClassFuncMethodRequest(payloads); + }; + ; + return BooleanClassFuncMethodRequest; +}()); +exports.BooleanClassFuncMethodRequest = BooleanClassFuncMethodRequest; +var BooleanFuncMethodRequest = /** @class */ (function () { + function BooleanFuncMethodRequest(payloads) { + this.payloads = payloads; + } + BooleanFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new BooleanFuncMethodRequest(payloads); + }; + ; + return BooleanFuncMethodRequest; +}()); +exports.BooleanFuncMethodRequest = BooleanFuncMethodRequest; +var CharacterFuncMethodRequest = /** @class */ (function () { + function CharacterFuncMethodRequest(payloads) { + this.payloads = payloads; + } + CharacterFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new CharacterFuncMethodRequest(payloads); + }; + ; + return CharacterFuncMethodRequest; +}()); +exports.CharacterFuncMethodRequest = CharacterFuncMethodRequest; +var BigDecimalFuncMethodRequest = /** @class */ (function () { + function BigDecimalFuncMethodRequest(payloads) { + this.payloads = payloads; + } + BigDecimalFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new BigDecimalFuncMethodRequest(payloads); + }; + ; + return BigDecimalFuncMethodRequest; +}()); +exports.BigDecimalFuncMethodRequest = BigDecimalFuncMethodRequest; +var ListStrFuncMethodRequest = /** @class */ (function () { + function ListStrFuncMethodRequest(payloads) { + this.payloads = payloads; + } + ListStrFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new ListStrFuncMethodRequest(payloads); + }; + ; + return ListStrFuncMethodRequest; +}()); +exports.ListStrFuncMethodRequest = ListStrFuncMethodRequest; +var CustomModelFuncMethodRequest = /** @class */ (function () { + function CustomModelFuncMethodRequest(payloads) { + this.payloads = payloads; + } + CustomModelFuncMethodRequest.createRequest = function (arg0) { + var payloads = new Array(); + var payload0 = new CustomModelFuncPayload('arg0', arg0); + payloads.push(payload0); + return new CustomModelFuncMethodRequest(payloads); + }; + ; + return CustomModelFuncMethodRequest; +}()); +exports.CustomModelFuncMethodRequest = CustomModelFuncMethodRequest; +var ArrayListFuncMethodRequest = /** @class */ (function () { + function ArrayListFuncMethodRequest(payloads) { + this.payloads = payloads; + } + ArrayListFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new ArrayListFuncMethodRequest(payloads); + }; + ; + return ArrayListFuncMethodRequest; +}()); +exports.ArrayListFuncMethodRequest = ArrayListFuncMethodRequest; +var CustomModelListFuncMethodRequest = /** @class */ (function () { + function CustomModelListFuncMethodRequest(payloads) { + this.payloads = payloads; + } + CustomModelListFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new CustomModelListFuncMethodRequest(payloads); + }; + ; + return CustomModelListFuncMethodRequest; +}()); +exports.CustomModelListFuncMethodRequest = CustomModelListFuncMethodRequest; +var HashMapFuncMethodRequest = /** @class */ (function () { + function HashMapFuncMethodRequest(payloads) { + this.payloads = payloads; + } + HashMapFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new HashMapFuncMethodRequest(payloads); + }; + ; + return HashMapFuncMethodRequest; +}()); +exports.HashMapFuncMethodRequest = HashMapFuncMethodRequest; +var CustomModelMapFuncMethodRequest = /** @class */ (function () { + function CustomModelMapFuncMethodRequest(payloads) { + this.payloads = payloads; + } + CustomModelMapFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new CustomModelMapFuncMethodRequest(payloads); + }; + ; + return CustomModelMapFuncMethodRequest; +}()); +exports.CustomModelMapFuncMethodRequest = CustomModelMapFuncMethodRequest; +var StringFuncMethodRequest = /** @class */ (function () { + function StringFuncMethodRequest(payloads) { + this.payloads = payloads; + } + StringFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new StringFuncMethodRequest(payloads); + }; + ; + return StringFuncMethodRequest; +}()); +exports.StringFuncMethodRequest = StringFuncMethodRequest; +var IntFuncMethodRequest = /** @class */ (function () { + function IntFuncMethodRequest(payloads) { + this.payloads = payloads; + } + IntFuncMethodRequest.createRequest = function (arg0, arg1) { + var payloads = new Array(); + var payload0 = new IntFuncPayload('arg0', arg0); + payloads.push(payload0); + var payload1 = new IntFuncPayload('arg1', arg1); + payloads.push(payload1); + return new IntFuncMethodRequest(payloads); + }; + ; + return IntFuncMethodRequest; +}()); +exports.IntFuncMethodRequest = IntFuncMethodRequest; +var DoubleFuncMethodRequest = /** @class */ (function () { + function DoubleFuncMethodRequest(payloads) { + this.payloads = payloads; + } + DoubleFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new DoubleFuncMethodRequest(payloads); + }; + ; + return DoubleFuncMethodRequest; +}()); +exports.DoubleFuncMethodRequest = DoubleFuncMethodRequest; +var ByteFuncMethodRequest = /** @class */ (function () { + function ByteFuncMethodRequest(payloads) { + this.payloads = payloads; + } + ByteFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new ByteFuncMethodRequest(payloads); + }; + ; + return ByteFuncMethodRequest; +}()); +exports.ByteFuncMethodRequest = ByteFuncMethodRequest; +var ShortFuncMethodRequest = /** @class */ (function () { + function ShortFuncMethodRequest(payloads) { + this.payloads = payloads; + } + ShortFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new ShortFuncMethodRequest(payloads); + }; + ; + return ShortFuncMethodRequest; +}()); +exports.ShortFuncMethodRequest = ShortFuncMethodRequest; +var LingFuncMethodRequest = /** @class */ (function () { + function LingFuncMethodRequest(payloads) { + this.payloads = payloads; + } + LingFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new LingFuncMethodRequest(payloads); + }; + ; + return LingFuncMethodRequest; +}()); +exports.LingFuncMethodRequest = LingFuncMethodRequest; +var FloatFuncMethodRequest = /** @class */ (function () { + function FloatFuncMethodRequest(payloads) { + this.payloads = payloads; + } + FloatFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new FloatFuncMethodRequest(payloads); + }; + ; + return FloatFuncMethodRequest; +}()); +exports.FloatFuncMethodRequest = FloatFuncMethodRequest; +var CharFuncMethodRequest = /** @class */ (function () { + function CharFuncMethodRequest(payloads) { + this.payloads = payloads; + } + CharFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new CharFuncMethodRequest(payloads); + }; + ; + return CharFuncMethodRequest; +}()); +exports.CharFuncMethodRequest = CharFuncMethodRequest; +var BigIntFuncMethodRequest = /** @class */ (function () { + function BigIntFuncMethodRequest(payloads) { + this.payloads = payloads; + } + BigIntFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new BigIntFuncMethodRequest(payloads); + }; + ; + return BigIntFuncMethodRequest; +}()); +exports.BigIntFuncMethodRequest = BigIntFuncMethodRequest; +var DateFuncMethodRequest = /** @class */ (function () { + function DateFuncMethodRequest(payloads) { + this.payloads = payloads; + } + DateFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new DateFuncMethodRequest(payloads); + }; + ; + return DateFuncMethodRequest; +}()); +exports.DateFuncMethodRequest = DateFuncMethodRequest; +var UuidFuncMethodRequest = /** @class */ (function () { + function UuidFuncMethodRequest(payloads) { + this.payloads = payloads; + } + UuidFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new UuidFuncMethodRequest(payloads); + }; + ; + return UuidFuncMethodRequest; +}()); +exports.UuidFuncMethodRequest = UuidFuncMethodRequest; +var MapStrFuncMethodRequest = /** @class */ (function () { + function MapStrFuncMethodRequest(payloads) { + this.payloads = payloads; + } + MapStrFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new MapStrFuncMethodRequest(payloads); + }; + ; + return MapStrFuncMethodRequest; +}()); +exports.MapStrFuncMethodRequest = MapStrFuncMethodRequest; +var VoidFuncMethodRequest = /** @class */ (function () { + function VoidFuncMethodRequest(payloads) { + this.payloads = payloads; + } + VoidFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new VoidFuncMethodRequest(payloads); + }; + ; + return VoidFuncMethodRequest; +}()); +exports.VoidFuncMethodRequest = VoidFuncMethodRequest; +var ArrayFuncMethodRequest = /** @class */ (function () { + function ArrayFuncMethodRequest(payloads) { + this.payloads = payloads; + } + ArrayFuncMethodRequest.createRequest = function (arg0) { + var payloads = new Array(); + var payload0 = new ArrayFuncPayload('arg0', arg0); + payloads.push(payload0); + return new ArrayFuncMethodRequest(payloads); + }; + ; + return ArrayFuncMethodRequest; +}()); +exports.ArrayFuncMethodRequest = ArrayFuncMethodRequest; +var ListFuncMethodRequest = /** @class */ (function () { + function ListFuncMethodRequest(payloads) { + this.payloads = payloads; + } + ListFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new ListFuncMethodRequest(payloads); + }; + ; + return ListFuncMethodRequest; +}()); +exports.ListFuncMethodRequest = ListFuncMethodRequest; +var MapFuncMethodRequest = /** @class */ (function () { + function MapFuncMethodRequest(payloads) { + this.payloads = payloads; + } + MapFuncMethodRequest.createRequest = function () { + var payloads = new Array(); + return new MapFuncMethodRequest(payloads); + }; + ; + return MapFuncMethodRequest; +}()); +exports.MapFuncMethodRequest = MapFuncMethodRequest; +var CreateUserMethodRequest = /** @class */ (function () { + function CreateUserMethodRequest(payloads) { + this.payloads = payloads; + } + CreateUserMethodRequest.createRequest = function (arg0) { + var payloads = new Array(); + var payload0 = new CreateUserPayload('arg0', arg0); + payloads.push(payload0); + return new CreateUserMethodRequest(payloads); + }; + ; + return CreateUserMethodRequest; +}()); +exports.CreateUserMethodRequest = CreateUserMethodRequest; +var GetUsersMethodRequest = /** @class */ (function () { + function GetUsersMethodRequest(payloads) { + this.payloads = payloads; + } + GetUsersMethodRequest.createRequest = function () { + var payloads = new Array(); + return new GetUsersMethodRequest(payloads); + }; + ; + return GetUsersMethodRequest; +}()); +exports.GetUsersMethodRequest = GetUsersMethodRequest; +var IntegerFuncPayload = /** @class */ (function () { + function IntegerFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return IntegerFuncPayload; +}()); +exports.IntegerFuncPayload = IntegerFuncPayload; +var DoubleClassFuncPayload = /** @class */ (function () { + function DoubleClassFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return DoubleClassFuncPayload; +}()); +exports.DoubleClassFuncPayload = DoubleClassFuncPayload; +var ByteClassFuncPayload = /** @class */ (function () { + function ByteClassFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return ByteClassFuncPayload; +}()); +exports.ByteClassFuncPayload = ByteClassFuncPayload; +var ShortClassFuncPayload = /** @class */ (function () { + function ShortClassFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return ShortClassFuncPayload; +}()); +exports.ShortClassFuncPayload = ShortClassFuncPayload; +var LongClassFuncPayload = /** @class */ (function () { + function LongClassFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return LongClassFuncPayload; +}()); +exports.LongClassFuncPayload = LongClassFuncPayload; +var FloatClassFuncPayload = /** @class */ (function () { + function FloatClassFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return FloatClassFuncPayload; +}()); +exports.FloatClassFuncPayload = FloatClassFuncPayload; +var BooleanClassFuncPayload = /** @class */ (function () { + function BooleanClassFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return BooleanClassFuncPayload; +}()); +exports.BooleanClassFuncPayload = BooleanClassFuncPayload; +var BooleanFuncPayload = /** @class */ (function () { + function BooleanFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return BooleanFuncPayload; +}()); +exports.BooleanFuncPayload = BooleanFuncPayload; +var CharacterFuncPayload = /** @class */ (function () { + function CharacterFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return CharacterFuncPayload; +}()); +exports.CharacterFuncPayload = CharacterFuncPayload; +var BigDecimalFuncPayload = /** @class */ (function () { + function BigDecimalFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return BigDecimalFuncPayload; +}()); +exports.BigDecimalFuncPayload = BigDecimalFuncPayload; +var ListStrFuncPayload = /** @class */ (function () { + function ListStrFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return ListStrFuncPayload; +}()); +exports.ListStrFuncPayload = ListStrFuncPayload; +var CustomModelFuncPayload = /** @class */ (function () { + function CustomModelFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return CustomModelFuncPayload; +}()); +exports.CustomModelFuncPayload = CustomModelFuncPayload; +var ArrayListFuncPayload = /** @class */ (function () { + function ArrayListFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return ArrayListFuncPayload; +}()); +exports.ArrayListFuncPayload = ArrayListFuncPayload; +var CustomModelListFuncPayload = /** @class */ (function () { + function CustomModelListFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return CustomModelListFuncPayload; +}()); +exports.CustomModelListFuncPayload = CustomModelListFuncPayload; +var HashMapFuncPayload = /** @class */ (function () { + function HashMapFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return HashMapFuncPayload; +}()); +exports.HashMapFuncPayload = HashMapFuncPayload; +var CustomModelMapFuncPayload = /** @class */ (function () { + function CustomModelMapFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return CustomModelMapFuncPayload; +}()); +exports.CustomModelMapFuncPayload = CustomModelMapFuncPayload; +var StringFuncPayload = /** @class */ (function () { + function StringFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return StringFuncPayload; +}()); +exports.StringFuncPayload = StringFuncPayload; +var IntFuncPayload = /** @class */ (function () { + function IntFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return IntFuncPayload; +}()); +exports.IntFuncPayload = IntFuncPayload; +var DoubleFuncPayload = /** @class */ (function () { + function DoubleFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return DoubleFuncPayload; +}()); +exports.DoubleFuncPayload = DoubleFuncPayload; +var ByteFuncPayload = /** @class */ (function () { + function ByteFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return ByteFuncPayload; +}()); +exports.ByteFuncPayload = ByteFuncPayload; +var ShortFuncPayload = /** @class */ (function () { + function ShortFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return ShortFuncPayload; +}()); +exports.ShortFuncPayload = ShortFuncPayload; +var LingFuncPayload = /** @class */ (function () { + function LingFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return LingFuncPayload; +}()); +exports.LingFuncPayload = LingFuncPayload; +var FloatFuncPayload = /** @class */ (function () { + function FloatFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return FloatFuncPayload; +}()); +exports.FloatFuncPayload = FloatFuncPayload; +var CharFuncPayload = /** @class */ (function () { + function CharFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return CharFuncPayload; +}()); +exports.CharFuncPayload = CharFuncPayload; +var BigIntFuncPayload = /** @class */ (function () { + function BigIntFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return BigIntFuncPayload; +}()); +exports.BigIntFuncPayload = BigIntFuncPayload; +var DateFuncPayload = /** @class */ (function () { + function DateFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return DateFuncPayload; +}()); +exports.DateFuncPayload = DateFuncPayload; +var UuidFuncPayload = /** @class */ (function () { + function UuidFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return UuidFuncPayload; +}()); +exports.UuidFuncPayload = UuidFuncPayload; +var MapStrFuncPayload = /** @class */ (function () { + function MapStrFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return MapStrFuncPayload; +}()); +exports.MapStrFuncPayload = MapStrFuncPayload; +var VoidFuncPayload = /** @class */ (function () { + function VoidFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return VoidFuncPayload; +}()); +exports.VoidFuncPayload = VoidFuncPayload; +var ArrayFuncPayload = /** @class */ (function () { + function ArrayFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return ArrayFuncPayload; +}()); +exports.ArrayFuncPayload = ArrayFuncPayload; +var ListFuncPayload = /** @class */ (function () { + function ListFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return ListFuncPayload; +}()); +exports.ListFuncPayload = ListFuncPayload; +var MapFuncPayload = /** @class */ (function () { + function MapFuncPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return MapFuncPayload; +}()); +exports.MapFuncPayload = MapFuncPayload; +var CreateUserPayload = /** @class */ (function () { + function CreateUserPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return CreateUserPayload; +}()); +exports.CreateUserPayload = CreateUserPayload; +var GetUsersPayload = /** @class */ (function () { + function GetUsersPayload(keyName, value) { + this.keyName = keyName; + this.value = value; + } + return GetUsersPayload; +}()); +exports.GetUsersPayload = GetUsersPayload; diff --git a/example/typescript-build/src/herts-HttpCodegenTestService-request-model.gen.ts b/example/typescript-build/src/herts-HttpCodegenTestService-request-model.gen.ts new file mode 100644 index 00000000..ea5745e7 --- /dev/null +++ b/example/typescript-build/src/herts-HttpCodegenTestService-request-model.gen.ts @@ -0,0 +1,666 @@ +// Don't edit this file because this file is generated by herts codegen. +import {CustomModel} from './herts-structure.gen' +import {User} from './herts-structure.gen' + +export class IntegerFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new IntegerFuncMethodRequest (payloads); + }; +} +export class DoubleClassFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new DoubleClassFuncMethodRequest (payloads); + }; +} +export class ByteClassFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new ByteClassFuncMethodRequest (payloads); + }; +} +export class ShortClassFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new ShortClassFuncMethodRequest (payloads); + }; +} +export class LongClassFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new LongClassFuncMethodRequest (payloads); + }; +} +export class FloatClassFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new FloatClassFuncMethodRequest (payloads); + }; +} +export class BooleanClassFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new BooleanClassFuncMethodRequest (payloads); + }; +} +export class BooleanFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new BooleanFuncMethodRequest (payloads); + }; +} +export class CharacterFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new CharacterFuncMethodRequest (payloads); + }; +} +export class BigDecimalFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new BigDecimalFuncMethodRequest (payloads); + }; +} +export class ListStrFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new ListStrFuncMethodRequest (payloads); + }; +} +export class CustomModelFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + arg0 : CustomModel, + ) { + const payloads = new Array(); + const payload0 = new CustomModelFuncPayload ('arg0', arg0); + payloads.push(payload0); + return new CustomModelFuncMethodRequest (payloads); + }; +} +export class ArrayListFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new ArrayListFuncMethodRequest (payloads); + }; +} +export class CustomModelListFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new CustomModelListFuncMethodRequest (payloads); + }; +} +export class HashMapFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new HashMapFuncMethodRequest (payloads); + }; +} +export class CustomModelMapFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new CustomModelMapFuncMethodRequest (payloads); + }; +} +export class StringFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new StringFuncMethodRequest (payloads); + }; +} +export class IntFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + arg0 : number, + arg1 : string, + ) { + const payloads = new Array(); + const payload0 = new IntFuncPayload ('arg0', arg0); + payloads.push(payload0); + const payload1 = new IntFuncPayload ('arg1', arg1); + payloads.push(payload1); + return new IntFuncMethodRequest (payloads); + }; +} +export class DoubleFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new DoubleFuncMethodRequest (payloads); + }; +} +export class ByteFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new ByteFuncMethodRequest (payloads); + }; +} +export class ShortFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new ShortFuncMethodRequest (payloads); + }; +} +export class LingFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new LingFuncMethodRequest (payloads); + }; +} +export class FloatFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new FloatFuncMethodRequest (payloads); + }; +} +export class CharFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new CharFuncMethodRequest (payloads); + }; +} +export class BigIntFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new BigIntFuncMethodRequest (payloads); + }; +} +export class DateFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new DateFuncMethodRequest (payloads); + }; +} +export class UuidFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new UuidFuncMethodRequest (payloads); + }; +} +export class MapStrFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new MapStrFuncMethodRequest (payloads); + }; +} +export class VoidFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new VoidFuncMethodRequest (payloads); + }; +} +export class ArrayFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + arg0 : Array, + ) { + const payloads = new Array(); + const payload0 = new ArrayFuncPayload ('arg0', arg0); + payloads.push(payload0); + return new ArrayFuncMethodRequest (payloads); + }; +} +export class ListFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new ListFuncMethodRequest (payloads); + }; +} +export class MapFuncMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new MapFuncMethodRequest (payloads); + }; +} +export class CreateUserMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + arg0 : User, + ) { + const payloads = new Array(); + const payload0 = new CreateUserPayload ('arg0', arg0); + payloads.push(payload0); + return new CreateUserMethodRequest (payloads); + }; +} +export class GetUsersMethodRequest { + private constructor(payloads: Array) { + this.payloads = payloads; + } + payloads: Array; + public static createRequest( + ) { + const payloads = new Array(); + return new GetUsersMethodRequest (payloads); + }; +} + +export class IntegerFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class DoubleClassFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class ByteClassFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class ShortClassFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class LongClassFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class FloatClassFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class BooleanClassFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class BooleanFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class CharacterFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class BigDecimalFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class ListStrFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class CustomModelFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class ArrayListFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class CustomModelListFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class HashMapFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class CustomModelMapFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class StringFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class IntFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class DoubleFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class ByteFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class ShortFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class LingFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class FloatFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class CharFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class BigIntFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class DateFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class UuidFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class MapStrFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class VoidFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class ArrayFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class ListFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class MapFuncPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class CreateUserPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} +export class GetUsersPayload { + constructor(keyName: string, value: any) { + this.keyName = keyName; + this.value = value; + } + private keyName: string; + private value: any; +} diff --git a/example/typescript-build/src/herts-HttpCodegenTestService-response-model.gen.js b/example/typescript-build/src/herts-HttpCodegenTestService-response-model.gen.js new file mode 100644 index 00000000..847a6c81 --- /dev/null +++ b/example/typescript-build/src/herts-HttpCodegenTestService-response-model.gen.js @@ -0,0 +1,514 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CustomModelMapFuncPayload = exports.HashMapFuncPayload = exports.CustomModelListFuncPayload = exports.ArrayListFuncPayload = exports.CustomModelFuncPayload = exports.ListStrFuncPayload = exports.BigDecimalFuncPayload = exports.CharacterFuncPayload = exports.BooleanFuncPayload = exports.BooleanClassFuncPayload = exports.FloatClassFuncPayload = exports.LongClassFuncPayload = exports.ShortClassFuncPayload = exports.ByteClassFuncPayload = exports.DoubleClassFuncPayload = exports.IntegerFuncPayload = exports.GetUsersMethodResponse = exports.CreateUserMethodResponse = exports.MapFuncMethodResponse = exports.ListFuncMethodResponse = exports.ArrayFuncMethodResponse = exports.VoidFuncMethodResponse = exports.MapStrFuncMethodResponse = exports.UuidFuncMethodResponse = exports.DateFuncMethodResponse = exports.BigIntFuncMethodResponse = exports.CharFuncMethodResponse = exports.FloatFuncMethodResponse = exports.LingFuncMethodResponse = exports.ShortFuncMethodResponse = exports.ByteFuncMethodResponse = exports.DoubleFuncMethodResponse = exports.IntFuncMethodResponse = exports.StringFuncMethodResponse = exports.CustomModelMapFuncMethodResponse = exports.HashMapFuncMethodResponse = exports.CustomModelListFuncMethodResponse = exports.ArrayListFuncMethodResponse = exports.CustomModelFuncMethodResponse = exports.ListStrFuncMethodResponse = exports.BigDecimalFuncMethodResponse = exports.CharacterFuncMethodResponse = exports.BooleanFuncMethodResponse = exports.BooleanClassFuncMethodResponse = exports.FloatClassFuncMethodResponse = exports.LongClassFuncMethodResponse = exports.ShortClassFuncMethodResponse = exports.ByteClassFuncMethodResponse = exports.DoubleClassFuncMethodResponse = exports.IntegerFuncMethodResponse = void 0; +exports.GetUsersPayload = exports.CreateUserPayload = exports.MapFuncPayload = exports.ListFuncPayload = exports.ArrayFuncPayload = exports.VoidFuncPayload = exports.MapStrFuncPayload = exports.UuidFuncPayload = exports.DateFuncPayload = exports.BigIntFuncPayload = exports.CharFuncPayload = exports.FloatFuncPayload = exports.LingFuncPayload = exports.ShortFuncPayload = exports.ByteFuncPayload = exports.DoubleFuncPayload = exports.IntFuncPayload = exports.StringFuncPayload = void 0; +var IntegerFuncMethodResponse = /** @class */ (function () { + function IntegerFuncMethodResponse() { + this.payload = new IntegerFuncPayload(); + } + return IntegerFuncMethodResponse; +}()); +exports.IntegerFuncMethodResponse = IntegerFuncMethodResponse; +var DoubleClassFuncMethodResponse = /** @class */ (function () { + function DoubleClassFuncMethodResponse() { + this.payload = new DoubleClassFuncPayload(); + } + return DoubleClassFuncMethodResponse; +}()); +exports.DoubleClassFuncMethodResponse = DoubleClassFuncMethodResponse; +var ByteClassFuncMethodResponse = /** @class */ (function () { + function ByteClassFuncMethodResponse() { + this.payload = new ByteClassFuncPayload(); + } + return ByteClassFuncMethodResponse; +}()); +exports.ByteClassFuncMethodResponse = ByteClassFuncMethodResponse; +var ShortClassFuncMethodResponse = /** @class */ (function () { + function ShortClassFuncMethodResponse() { + this.payload = new ShortClassFuncPayload(); + } + return ShortClassFuncMethodResponse; +}()); +exports.ShortClassFuncMethodResponse = ShortClassFuncMethodResponse; +var LongClassFuncMethodResponse = /** @class */ (function () { + function LongClassFuncMethodResponse() { + this.payload = new LongClassFuncPayload(); + } + return LongClassFuncMethodResponse; +}()); +exports.LongClassFuncMethodResponse = LongClassFuncMethodResponse; +var FloatClassFuncMethodResponse = /** @class */ (function () { + function FloatClassFuncMethodResponse() { + this.payload = new FloatClassFuncPayload(); + } + return FloatClassFuncMethodResponse; +}()); +exports.FloatClassFuncMethodResponse = FloatClassFuncMethodResponse; +var BooleanClassFuncMethodResponse = /** @class */ (function () { + function BooleanClassFuncMethodResponse() { + this.payload = new BooleanClassFuncPayload(); + } + return BooleanClassFuncMethodResponse; +}()); +exports.BooleanClassFuncMethodResponse = BooleanClassFuncMethodResponse; +var BooleanFuncMethodResponse = /** @class */ (function () { + function BooleanFuncMethodResponse() { + this.payload = new BooleanFuncPayload(); + } + return BooleanFuncMethodResponse; +}()); +exports.BooleanFuncMethodResponse = BooleanFuncMethodResponse; +var CharacterFuncMethodResponse = /** @class */ (function () { + function CharacterFuncMethodResponse() { + this.payload = new CharacterFuncPayload(); + } + return CharacterFuncMethodResponse; +}()); +exports.CharacterFuncMethodResponse = CharacterFuncMethodResponse; +var BigDecimalFuncMethodResponse = /** @class */ (function () { + function BigDecimalFuncMethodResponse() { + this.payload = new BigDecimalFuncPayload(); + } + return BigDecimalFuncMethodResponse; +}()); +exports.BigDecimalFuncMethodResponse = BigDecimalFuncMethodResponse; +var ListStrFuncMethodResponse = /** @class */ (function () { + function ListStrFuncMethodResponse() { + this.payload = new ListStrFuncPayload(); + } + return ListStrFuncMethodResponse; +}()); +exports.ListStrFuncMethodResponse = ListStrFuncMethodResponse; +var CustomModelFuncMethodResponse = /** @class */ (function () { + function CustomModelFuncMethodResponse() { + this.payload = new CustomModelFuncPayload(); + } + return CustomModelFuncMethodResponse; +}()); +exports.CustomModelFuncMethodResponse = CustomModelFuncMethodResponse; +var ArrayListFuncMethodResponse = /** @class */ (function () { + function ArrayListFuncMethodResponse() { + this.payload = new ArrayListFuncPayload(); + } + return ArrayListFuncMethodResponse; +}()); +exports.ArrayListFuncMethodResponse = ArrayListFuncMethodResponse; +var CustomModelListFuncMethodResponse = /** @class */ (function () { + function CustomModelListFuncMethodResponse() { + this.payload = new CustomModelListFuncPayload(); + } + return CustomModelListFuncMethodResponse; +}()); +exports.CustomModelListFuncMethodResponse = CustomModelListFuncMethodResponse; +var HashMapFuncMethodResponse = /** @class */ (function () { + function HashMapFuncMethodResponse() { + this.payload = new HashMapFuncPayload(); + } + return HashMapFuncMethodResponse; +}()); +exports.HashMapFuncMethodResponse = HashMapFuncMethodResponse; +var CustomModelMapFuncMethodResponse = /** @class */ (function () { + function CustomModelMapFuncMethodResponse() { + this.payload = new CustomModelMapFuncPayload(); + } + return CustomModelMapFuncMethodResponse; +}()); +exports.CustomModelMapFuncMethodResponse = CustomModelMapFuncMethodResponse; +var StringFuncMethodResponse = /** @class */ (function () { + function StringFuncMethodResponse() { + this.payload = new StringFuncPayload(); + } + return StringFuncMethodResponse; +}()); +exports.StringFuncMethodResponse = StringFuncMethodResponse; +var IntFuncMethodResponse = /** @class */ (function () { + function IntFuncMethodResponse() { + this.payload = new IntFuncPayload(); + } + return IntFuncMethodResponse; +}()); +exports.IntFuncMethodResponse = IntFuncMethodResponse; +var DoubleFuncMethodResponse = /** @class */ (function () { + function DoubleFuncMethodResponse() { + this.payload = new DoubleFuncPayload(); + } + return DoubleFuncMethodResponse; +}()); +exports.DoubleFuncMethodResponse = DoubleFuncMethodResponse; +var ByteFuncMethodResponse = /** @class */ (function () { + function ByteFuncMethodResponse() { + this.payload = new ByteFuncPayload(); + } + return ByteFuncMethodResponse; +}()); +exports.ByteFuncMethodResponse = ByteFuncMethodResponse; +var ShortFuncMethodResponse = /** @class */ (function () { + function ShortFuncMethodResponse() { + this.payload = new ShortFuncPayload(); + } + return ShortFuncMethodResponse; +}()); +exports.ShortFuncMethodResponse = ShortFuncMethodResponse; +var LingFuncMethodResponse = /** @class */ (function () { + function LingFuncMethodResponse() { + this.payload = new LingFuncPayload(); + } + return LingFuncMethodResponse; +}()); +exports.LingFuncMethodResponse = LingFuncMethodResponse; +var FloatFuncMethodResponse = /** @class */ (function () { + function FloatFuncMethodResponse() { + this.payload = new FloatFuncPayload(); + } + return FloatFuncMethodResponse; +}()); +exports.FloatFuncMethodResponse = FloatFuncMethodResponse; +var CharFuncMethodResponse = /** @class */ (function () { + function CharFuncMethodResponse() { + this.payload = new CharFuncPayload(); + } + return CharFuncMethodResponse; +}()); +exports.CharFuncMethodResponse = CharFuncMethodResponse; +var BigIntFuncMethodResponse = /** @class */ (function () { + function BigIntFuncMethodResponse() { + this.payload = new BigIntFuncPayload(); + } + return BigIntFuncMethodResponse; +}()); +exports.BigIntFuncMethodResponse = BigIntFuncMethodResponse; +var DateFuncMethodResponse = /** @class */ (function () { + function DateFuncMethodResponse() { + this.payload = new DateFuncPayload(); + } + return DateFuncMethodResponse; +}()); +exports.DateFuncMethodResponse = DateFuncMethodResponse; +var UuidFuncMethodResponse = /** @class */ (function () { + function UuidFuncMethodResponse() { + this.payload = new UuidFuncPayload(); + } + return UuidFuncMethodResponse; +}()); +exports.UuidFuncMethodResponse = UuidFuncMethodResponse; +var MapStrFuncMethodResponse = /** @class */ (function () { + function MapStrFuncMethodResponse() { + this.payload = new MapStrFuncPayload(); + } + return MapStrFuncMethodResponse; +}()); +exports.MapStrFuncMethodResponse = MapStrFuncMethodResponse; +var VoidFuncMethodResponse = /** @class */ (function () { + function VoidFuncMethodResponse() { + this.payload = new VoidFuncPayload(); + } + return VoidFuncMethodResponse; +}()); +exports.VoidFuncMethodResponse = VoidFuncMethodResponse; +var ArrayFuncMethodResponse = /** @class */ (function () { + function ArrayFuncMethodResponse() { + this.payload = new ArrayFuncPayload(); + } + return ArrayFuncMethodResponse; +}()); +exports.ArrayFuncMethodResponse = ArrayFuncMethodResponse; +var ListFuncMethodResponse = /** @class */ (function () { + function ListFuncMethodResponse() { + this.payload = new ListFuncPayload(); + } + return ListFuncMethodResponse; +}()); +exports.ListFuncMethodResponse = ListFuncMethodResponse; +var MapFuncMethodResponse = /** @class */ (function () { + function MapFuncMethodResponse() { + this.payload = new MapFuncPayload(); + } + return MapFuncMethodResponse; +}()); +exports.MapFuncMethodResponse = MapFuncMethodResponse; +var CreateUserMethodResponse = /** @class */ (function () { + function CreateUserMethodResponse() { + this.payload = new CreateUserPayload(); + } + return CreateUserMethodResponse; +}()); +exports.CreateUserMethodResponse = CreateUserMethodResponse; +var GetUsersMethodResponse = /** @class */ (function () { + function GetUsersMethodResponse() { + this.payload = new GetUsersPayload(); + } + return GetUsersMethodResponse; +}()); +exports.GetUsersMethodResponse = GetUsersMethodResponse; +var IntegerFuncPayload = /** @class */ (function () { + function IntegerFuncPayload() { + this.keyName = ''; + this.value = null; + } + return IntegerFuncPayload; +}()); +exports.IntegerFuncPayload = IntegerFuncPayload; +var DoubleClassFuncPayload = /** @class */ (function () { + function DoubleClassFuncPayload() { + this.keyName = ''; + this.value = null; + } + return DoubleClassFuncPayload; +}()); +exports.DoubleClassFuncPayload = DoubleClassFuncPayload; +var ByteClassFuncPayload = /** @class */ (function () { + function ByteClassFuncPayload() { + this.keyName = ''; + this.value = null; + } + return ByteClassFuncPayload; +}()); +exports.ByteClassFuncPayload = ByteClassFuncPayload; +var ShortClassFuncPayload = /** @class */ (function () { + function ShortClassFuncPayload() { + this.keyName = ''; + this.value = null; + } + return ShortClassFuncPayload; +}()); +exports.ShortClassFuncPayload = ShortClassFuncPayload; +var LongClassFuncPayload = /** @class */ (function () { + function LongClassFuncPayload() { + this.keyName = ''; + this.value = null; + } + return LongClassFuncPayload; +}()); +exports.LongClassFuncPayload = LongClassFuncPayload; +var FloatClassFuncPayload = /** @class */ (function () { + function FloatClassFuncPayload() { + this.keyName = ''; + this.value = null; + } + return FloatClassFuncPayload; +}()); +exports.FloatClassFuncPayload = FloatClassFuncPayload; +var BooleanClassFuncPayload = /** @class */ (function () { + function BooleanClassFuncPayload() { + this.keyName = ''; + this.value = null; + } + return BooleanClassFuncPayload; +}()); +exports.BooleanClassFuncPayload = BooleanClassFuncPayload; +var BooleanFuncPayload = /** @class */ (function () { + function BooleanFuncPayload() { + this.keyName = ''; + this.value = null; + } + return BooleanFuncPayload; +}()); +exports.BooleanFuncPayload = BooleanFuncPayload; +var CharacterFuncPayload = /** @class */ (function () { + function CharacterFuncPayload() { + this.keyName = ''; + this.value = null; + } + return CharacterFuncPayload; +}()); +exports.CharacterFuncPayload = CharacterFuncPayload; +var BigDecimalFuncPayload = /** @class */ (function () { + function BigDecimalFuncPayload() { + this.keyName = ''; + this.value = null; + } + return BigDecimalFuncPayload; +}()); +exports.BigDecimalFuncPayload = BigDecimalFuncPayload; +var ListStrFuncPayload = /** @class */ (function () { + function ListStrFuncPayload() { + this.keyName = ''; + this.value = null; + } + return ListStrFuncPayload; +}()); +exports.ListStrFuncPayload = ListStrFuncPayload; +var CustomModelFuncPayload = /** @class */ (function () { + function CustomModelFuncPayload() { + this.keyName = ''; + this.value = null; + } + return CustomModelFuncPayload; +}()); +exports.CustomModelFuncPayload = CustomModelFuncPayload; +var ArrayListFuncPayload = /** @class */ (function () { + function ArrayListFuncPayload() { + this.keyName = ''; + this.value = null; + } + return ArrayListFuncPayload; +}()); +exports.ArrayListFuncPayload = ArrayListFuncPayload; +var CustomModelListFuncPayload = /** @class */ (function () { + function CustomModelListFuncPayload() { + this.keyName = ''; + this.value = null; + } + return CustomModelListFuncPayload; +}()); +exports.CustomModelListFuncPayload = CustomModelListFuncPayload; +var HashMapFuncPayload = /** @class */ (function () { + function HashMapFuncPayload() { + this.keyName = ''; + this.value = null; + } + return HashMapFuncPayload; +}()); +exports.HashMapFuncPayload = HashMapFuncPayload; +var CustomModelMapFuncPayload = /** @class */ (function () { + function CustomModelMapFuncPayload() { + this.keyName = ''; + this.value = null; + } + return CustomModelMapFuncPayload; +}()); +exports.CustomModelMapFuncPayload = CustomModelMapFuncPayload; +var StringFuncPayload = /** @class */ (function () { + function StringFuncPayload() { + this.keyName = ''; + this.value = null; + } + return StringFuncPayload; +}()); +exports.StringFuncPayload = StringFuncPayload; +var IntFuncPayload = /** @class */ (function () { + function IntFuncPayload() { + this.keyName = ''; + this.value = null; + } + return IntFuncPayload; +}()); +exports.IntFuncPayload = IntFuncPayload; +var DoubleFuncPayload = /** @class */ (function () { + function DoubleFuncPayload() { + this.keyName = ''; + this.value = null; + } + return DoubleFuncPayload; +}()); +exports.DoubleFuncPayload = DoubleFuncPayload; +var ByteFuncPayload = /** @class */ (function () { + function ByteFuncPayload() { + this.keyName = ''; + this.value = null; + } + return ByteFuncPayload; +}()); +exports.ByteFuncPayload = ByteFuncPayload; +var ShortFuncPayload = /** @class */ (function () { + function ShortFuncPayload() { + this.keyName = ''; + this.value = null; + } + return ShortFuncPayload; +}()); +exports.ShortFuncPayload = ShortFuncPayload; +var LingFuncPayload = /** @class */ (function () { + function LingFuncPayload() { + this.keyName = ''; + this.value = null; + } + return LingFuncPayload; +}()); +exports.LingFuncPayload = LingFuncPayload; +var FloatFuncPayload = /** @class */ (function () { + function FloatFuncPayload() { + this.keyName = ''; + this.value = null; + } + return FloatFuncPayload; +}()); +exports.FloatFuncPayload = FloatFuncPayload; +var CharFuncPayload = /** @class */ (function () { + function CharFuncPayload() { + this.keyName = ''; + this.value = null; + } + return CharFuncPayload; +}()); +exports.CharFuncPayload = CharFuncPayload; +var BigIntFuncPayload = /** @class */ (function () { + function BigIntFuncPayload() { + this.keyName = ''; + this.value = null; + } + return BigIntFuncPayload; +}()); +exports.BigIntFuncPayload = BigIntFuncPayload; +var DateFuncPayload = /** @class */ (function () { + function DateFuncPayload() { + this.keyName = ''; + this.value = null; + } + return DateFuncPayload; +}()); +exports.DateFuncPayload = DateFuncPayload; +var UuidFuncPayload = /** @class */ (function () { + function UuidFuncPayload() { + this.keyName = ''; + this.value = null; + } + return UuidFuncPayload; +}()); +exports.UuidFuncPayload = UuidFuncPayload; +var MapStrFuncPayload = /** @class */ (function () { + function MapStrFuncPayload() { + this.keyName = ''; + this.value = null; + } + return MapStrFuncPayload; +}()); +exports.MapStrFuncPayload = MapStrFuncPayload; +var VoidFuncPayload = /** @class */ (function () { + function VoidFuncPayload() { + this.keyName = ''; + this.value = null; + } + return VoidFuncPayload; +}()); +exports.VoidFuncPayload = VoidFuncPayload; +var ArrayFuncPayload = /** @class */ (function () { + function ArrayFuncPayload() { + this.keyName = ''; + this.value = null; + } + return ArrayFuncPayload; +}()); +exports.ArrayFuncPayload = ArrayFuncPayload; +var ListFuncPayload = /** @class */ (function () { + function ListFuncPayload() { + this.keyName = ''; + this.value = null; + } + return ListFuncPayload; +}()); +exports.ListFuncPayload = ListFuncPayload; +var MapFuncPayload = /** @class */ (function () { + function MapFuncPayload() { + this.keyName = ''; + this.value = null; + } + return MapFuncPayload; +}()); +exports.MapFuncPayload = MapFuncPayload; +var CreateUserPayload = /** @class */ (function () { + function CreateUserPayload() { + this.keyName = ''; + this.value = null; + } + return CreateUserPayload; +}()); +exports.CreateUserPayload = CreateUserPayload; +var GetUsersPayload = /** @class */ (function () { + function GetUsersPayload() { + this.keyName = ''; + this.value = null; + } + return GetUsersPayload; +}()); +exports.GetUsersPayload = GetUsersPayload; diff --git a/example/typescript-build/src/herts-HttpCodegenTestService-response-model.gen.ts b/example/typescript-build/src/herts-HttpCodegenTestService-response-model.gen.ts new file mode 100644 index 00000000..7be3dbd3 --- /dev/null +++ b/example/typescript-build/src/herts-HttpCodegenTestService-response-model.gen.ts @@ -0,0 +1,481 @@ +// Don't edit this file because this file is generated by herts codegen. +import {CustomModel} from './herts-structure.gen' +import {User} from './herts-structure.gen' + +export class IntegerFuncMethodResponse { + constructor() { + this.payload = new IntegerFuncPayload (); + } + payload: IntegerFuncPayload; +} +export class DoubleClassFuncMethodResponse { + constructor() { + this.payload = new DoubleClassFuncPayload (); + } + payload: DoubleClassFuncPayload; +} +export class ByteClassFuncMethodResponse { + constructor() { + this.payload = new ByteClassFuncPayload (); + } + payload: ByteClassFuncPayload; +} +export class ShortClassFuncMethodResponse { + constructor() { + this.payload = new ShortClassFuncPayload (); + } + payload: ShortClassFuncPayload; +} +export class LongClassFuncMethodResponse { + constructor() { + this.payload = new LongClassFuncPayload (); + } + payload: LongClassFuncPayload; +} +export class FloatClassFuncMethodResponse { + constructor() { + this.payload = new FloatClassFuncPayload (); + } + payload: FloatClassFuncPayload; +} +export class BooleanClassFuncMethodResponse { + constructor() { + this.payload = new BooleanClassFuncPayload (); + } + payload: BooleanClassFuncPayload; +} +export class BooleanFuncMethodResponse { + constructor() { + this.payload = new BooleanFuncPayload (); + } + payload: BooleanFuncPayload; +} +export class CharacterFuncMethodResponse { + constructor() { + this.payload = new CharacterFuncPayload (); + } + payload: CharacterFuncPayload; +} +export class BigDecimalFuncMethodResponse { + constructor() { + this.payload = new BigDecimalFuncPayload (); + } + payload: BigDecimalFuncPayload; +} +export class ListStrFuncMethodResponse { + constructor() { + this.payload = new ListStrFuncPayload (); + } + payload: ListStrFuncPayload; +} +export class CustomModelFuncMethodResponse { + constructor() { + this.payload = new CustomModelFuncPayload (); + } + payload: CustomModelFuncPayload; +} +export class ArrayListFuncMethodResponse { + constructor() { + this.payload = new ArrayListFuncPayload (); + } + payload: ArrayListFuncPayload; +} +export class CustomModelListFuncMethodResponse { + constructor() { + this.payload = new CustomModelListFuncPayload (); + } + payload: CustomModelListFuncPayload; +} +export class HashMapFuncMethodResponse { + constructor() { + this.payload = new HashMapFuncPayload (); + } + payload: HashMapFuncPayload; +} +export class CustomModelMapFuncMethodResponse { + constructor() { + this.payload = new CustomModelMapFuncPayload (); + } + payload: CustomModelMapFuncPayload; +} +export class StringFuncMethodResponse { + constructor() { + this.payload = new StringFuncPayload (); + } + payload: StringFuncPayload; +} +export class IntFuncMethodResponse { + constructor() { + this.payload = new IntFuncPayload (); + } + payload: IntFuncPayload; +} +export class DoubleFuncMethodResponse { + constructor() { + this.payload = new DoubleFuncPayload (); + } + payload: DoubleFuncPayload; +} +export class ByteFuncMethodResponse { + constructor() { + this.payload = new ByteFuncPayload (); + } + payload: ByteFuncPayload; +} +export class ShortFuncMethodResponse { + constructor() { + this.payload = new ShortFuncPayload (); + } + payload: ShortFuncPayload; +} +export class LingFuncMethodResponse { + constructor() { + this.payload = new LingFuncPayload (); + } + payload: LingFuncPayload; +} +export class FloatFuncMethodResponse { + constructor() { + this.payload = new FloatFuncPayload (); + } + payload: FloatFuncPayload; +} +export class CharFuncMethodResponse { + constructor() { + this.payload = new CharFuncPayload (); + } + payload: CharFuncPayload; +} +export class BigIntFuncMethodResponse { + constructor() { + this.payload = new BigIntFuncPayload (); + } + payload: BigIntFuncPayload; +} +export class DateFuncMethodResponse { + constructor() { + this.payload = new DateFuncPayload (); + } + payload: DateFuncPayload; +} +export class UuidFuncMethodResponse { + constructor() { + this.payload = new UuidFuncPayload (); + } + payload: UuidFuncPayload; +} +export class MapStrFuncMethodResponse { + constructor() { + this.payload = new MapStrFuncPayload (); + } + payload: MapStrFuncPayload; +} +export class VoidFuncMethodResponse { + constructor() { + this.payload = new VoidFuncPayload (); + } + payload: VoidFuncPayload; +} +export class ArrayFuncMethodResponse { + constructor() { + this.payload = new ArrayFuncPayload (); + } + payload: ArrayFuncPayload; +} +export class ListFuncMethodResponse { + constructor() { + this.payload = new ListFuncPayload (); + } + payload: ListFuncPayload; +} +export class MapFuncMethodResponse { + constructor() { + this.payload = new MapFuncPayload (); + } + payload: MapFuncPayload; +} +export class CreateUserMethodResponse { + constructor() { + this.payload = new CreateUserPayload (); + } + payload: CreateUserPayload; +} +export class GetUsersMethodResponse { + constructor() { + this.payload = new GetUsersPayload (); + } + payload: GetUsersPayload; +} + +export class IntegerFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class DoubleClassFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class ByteClassFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class ShortClassFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class LongClassFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class FloatClassFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class BooleanClassFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: boolean; +} +export class BooleanFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: boolean; +} +export class CharacterFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: string; +} +export class BigDecimalFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class ListStrFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: Array; +} +export class CustomModelFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: CustomModel; +} +export class ArrayListFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: any; +} +export class CustomModelListFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: Array; +} +export class HashMapFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: Map; +} +export class CustomModelMapFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: Map; +} +export class StringFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: string; +} +export class IntFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class DoubleFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class ByteFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class ShortFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class LingFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class FloatFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class CharFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: string; +} +export class BigIntFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: number; +} +export class DateFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: Date; +} +export class UuidFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: string; +} +export class MapStrFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: Map; +} +export class VoidFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: any; +} +export class ArrayFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: Array; +} +export class ListFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: Array; +} +export class MapFuncPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: Map; +} +export class CreateUserPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: User; +} +export class GetUsersPayload { + constructor() { + this.keyName = ''; + this.value = null; + } + private keyName: string; + value: Array; +} diff --git a/example/typescript-build/src/herts-structure.gen.js b/example/typescript-build/src/herts-structure.gen.js new file mode 100644 index 00000000..2668bc77 --- /dev/null +++ b/example/typescript-build/src/herts-structure.gen.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TestModel = exports.User = exports.NestedCustomModel = exports.CustomModel = void 0; +var CustomModel = /** @class */ (function () { + function CustomModel(id, data, nestedCustomModel) { + this.id = id; + this.data = data; + this.nestedCustomModel = nestedCustomModel; + } + return CustomModel; +}()); +exports.CustomModel = CustomModel; +var NestedCustomModel = /** @class */ (function () { + function NestedCustomModel(nestedId, pointer) { + this.nestedId = nestedId; + this.pointer = pointer; + } + return NestedCustomModel; +}()); +exports.NestedCustomModel = NestedCustomModel; +var User = /** @class */ (function () { + function User(id, name, createdAt) { + this.id = id; + this.name = name; + this.createdAt = createdAt; + } + return User; +}()); +exports.User = User; +var TestModel = /** @class */ (function () { + function TestModel(id, name) { + this.id = id; + this.name = name; + } + return TestModel; +}()); +exports.TestModel = TestModel; diff --git a/example/typescript-build/src/herts-structure.gen.ts b/example/typescript-build/src/herts-structure.gen.ts new file mode 100644 index 00000000..16522db7 --- /dev/null +++ b/example/typescript-build/src/herts-structure.gen.ts @@ -0,0 +1,58 @@ +// Don't edit this file because this file is generated by herts codegen. +export type RequestHeaders = { + [x: string]: string | number | boolean; +} + +export class CustomModel { + constructor( + id : number, + data : string, + nestedCustomModel : NestedCustomModel, + ) { + this.id = id + this.data = data + this.nestedCustomModel = nestedCustomModel + } + id : number + data : string + nestedCustomModel : NestedCustomModel +} +export class NestedCustomModel { + constructor( + nestedId : number, + pointer : string, + ) { + this.nestedId = nestedId + this.pointer = pointer + } + nestedId : number + pointer : string +} +export class User { + constructor( + id : string, + name : string, + createdAt : Date, + ) { + this.id = id + this.name = name + this.createdAt = createdAt + } + id : string + name : string + createdAt : Date +} + + +export class TestModel { + constructor( + id : string, + name : string, + ) { + this.id = id + this.name = name + } + id : string + name : string +} + diff --git a/example/typescript-build/src/main.ts b/example/typescript-build/src/main.ts new file mode 100644 index 00000000..f657f05c --- /dev/null +++ b/example/typescript-build/src/main.ts @@ -0,0 +1,188 @@ +// Don't edit this file because this file is generated by herts codegen. +import {NestedCustomModel, RequestHeaders} from './herts-structure.gen' +import {IntegerFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {DoubleClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ByteClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ShortClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {LongClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {FloatClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {BooleanClassFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {BooleanFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {CharacterFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {BigDecimalFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ListStrFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {CustomModel} from './herts-structure.gen' +import {CustomModelFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ArrayListFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {CustomModelListFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {HashMapFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {CustomModelMapFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {StringFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {IntFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {DoubleFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ByteFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ShortFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {LingFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {FloatFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {CharFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {BigIntFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {DateFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {UuidFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {MapStrFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {VoidFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ArrayFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {ListFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {MapFuncMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {User} from './herts-structure.gen' +import {CreateUserMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {GetUsersMethodRequest} from './herts-HttpCodegenTestService-request-model.gen' +import {HttpCodegenTestServiceClient} from './herts-HttpCodegenTestService-client.gen' + +async function main() { + const header: RequestHeaders = {'Content-Type': 'application/json'}; + + const clientHttpCodegenTestServiceClient = new HttpCodegenTestServiceClient ('http://localhost:8080'); + + const req1 = IntegerFuncMethodRequest.createRequest ( ); + const res1 = await clientHttpCodegenTestServiceClient.integerFunc (header); + console.log(res1); + + const req2 = DoubleClassFuncMethodRequest.createRequest ( ); + const res2 = await clientHttpCodegenTestServiceClient.doubleClassFunc (header); + console.log(res2); + + const req3 = ByteClassFuncMethodRequest.createRequest ( ); + const res3 = await clientHttpCodegenTestServiceClient.byteClassFunc (header); + console.log(res3); + + const req4 = ShortClassFuncMethodRequest.createRequest ( ); + const res4 = await clientHttpCodegenTestServiceClient.shortClassFunc (header); + console.log(res4); + + const req5 = LongClassFuncMethodRequest.createRequest ( ); + const res5 = await clientHttpCodegenTestServiceClient.longClassFunc (header); + console.log(res5); + + const req6 = FloatClassFuncMethodRequest.createRequest ( ); + const res6 = await clientHttpCodegenTestServiceClient.floatClassFunc (header); + console.log(res6); + + const req7 = BooleanClassFuncMethodRequest.createRequest ( ); + const res7 = await clientHttpCodegenTestServiceClient.booleanClassFunc (header); + console.log(res7); + + const req8 = BooleanFuncMethodRequest.createRequest ( ); + const res8 = await clientHttpCodegenTestServiceClient.booleanFunc (header); + console.log(res8); + + const req9 = CharacterFuncMethodRequest.createRequest ( ); + const res9 = await clientHttpCodegenTestServiceClient.characterFunc (header); + console.log(res9); + + const req10 = BigDecimalFuncMethodRequest.createRequest ( ); + const res10 = await clientHttpCodegenTestServiceClient.bigDecimalFunc (header ); + console.log(res10); + + const req11 = ListStrFuncMethodRequest.createRequest ( ); + const res11 = await clientHttpCodegenTestServiceClient.listStrFunc (header ); + console.log(res11); + + const nModel = new NestedCustomModel(1, 'Hello'); + const cModel = new CustomModel(1, 'Data', nModel); + const req12 = CustomModelFuncMethodRequest.createRequest ( cModel); + const res12 = await clientHttpCodegenTestServiceClient.customModelFunc (header, req12 ); + console.log(res12); + + const req13 = ArrayListFuncMethodRequest.createRequest ( ); + const res13 = await clientHttpCodegenTestServiceClient.arrayListFunc (header ); + console.log(res13); + + const req14 = CustomModelListFuncMethodRequest.createRequest ( ); + const res14 = await clientHttpCodegenTestServiceClient.customModelListFunc (header); + console.log(res14); + + const req15 = HashMapFuncMethodRequest.createRequest ( ); + const res15 = await clientHttpCodegenTestServiceClient.hashMapFunc (header ); + console.log(res15); + + const req16 = CustomModelMapFuncMethodRequest.createRequest ( ); + const res16 = await clientHttpCodegenTestServiceClient.customModelMapFunc (header ); + console.log(res16); + + const req17 = StringFuncMethodRequest.createRequest ( ); + const res17 = await clientHttpCodegenTestServiceClient.stringFunc (header); + console.log(res17); + + const req18 = IntFuncMethodRequest.createRequest ( 1, '' ); + const res18 = await clientHttpCodegenTestServiceClient.intFunc (header, req18 ); + console.log(res18); + + const req19 = DoubleFuncMethodRequest.createRequest ( ); + const res19 = await clientHttpCodegenTestServiceClient.doubleFunc (header); + console.log(res19); + + const req20 = ByteFuncMethodRequest.createRequest ( ); + const res20 = await clientHttpCodegenTestServiceClient.byteFunc (header); + console.log(res20); + + const req21 = ShortFuncMethodRequest.createRequest ( ); + const res21 = await clientHttpCodegenTestServiceClient.shortFunc (header); + console.log(res21); + + const req22 = LingFuncMethodRequest.createRequest ( ); + const res22 = await clientHttpCodegenTestServiceClient.lingFunc (header); + console.log(res22); + + const req23 = FloatFuncMethodRequest.createRequest ( ); + const res23 = await clientHttpCodegenTestServiceClient.floatFunc (header ); + console.log(res23); + + const req24 = CharFuncMethodRequest.createRequest ( ); + const res24 = await clientHttpCodegenTestServiceClient.charFunc (header); + console.log(res24); + + const req25 = BigIntFuncMethodRequest.createRequest ( ); + const res25 = await clientHttpCodegenTestServiceClient.bigIntFunc (header ); + console.log(res25); + + const req26 = DateFuncMethodRequest.createRequest ( ); + const res26 = await clientHttpCodegenTestServiceClient.dateFunc (header); + console.log(res26); + + const req27 = UuidFuncMethodRequest.createRequest ( ); + const res27 = await clientHttpCodegenTestServiceClient.uuidFunc (header); + console.log(res27); + + const req28 = MapStrFuncMethodRequest.createRequest ( ); + const res28 = await clientHttpCodegenTestServiceClient.mapStrFunc (header ); + console.log(res28); + + const req29 = VoidFuncMethodRequest.createRequest ( ); + const res29 = await clientHttpCodegenTestServiceClient.voidFunc (header); + console.log(res29); + + const bArray = new Array(); + bArray.push('hey') + const req30 = ArrayFuncMethodRequest.createRequest ( bArray); + const res30 = await clientHttpCodegenTestServiceClient.arrayFunc (header, req30 ); + console.log(res30); + + const req31 = ListFuncMethodRequest.createRequest ( ); + const res31 = await clientHttpCodegenTestServiceClient.listFunc (header); + console.log(res31); + + const req32 = MapFuncMethodRequest.createRequest ( ); + const res32 = await clientHttpCodegenTestServiceClient.mapFunc (header); + console.log(res32); + + const u = new User('1', 'name', new Date()); + const req33 = CreateUserMethodRequest.createRequest ( u ); + const res33 = await clientHttpCodegenTestServiceClient.createUser (header, req33 ); + console.log(res33); + + const req34 = GetUsersMethodRequest.createRequest ( ); + const res34 = await clientHttpCodegenTestServiceClient.getUsers (header); + console.log(res34); + +} +main(); diff --git a/example/typescript-build/tsconfig.json b/example/typescript-build/tsconfig.json new file mode 100644 index 00000000..41427af1 --- /dev/null +++ b/example/typescript-build/tsconfig.json @@ -0,0 +1,109 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + "outDir": "./dist", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} diff --git a/herts-codegen/build.gradle b/herts-codegen/build.gradle index 90d0a4d3..46cbc9d7 100644 --- a/herts-codegen/build.gradle +++ b/herts-codegen/build.gradle @@ -6,7 +6,7 @@ plugins { apply plugin: 'application' def pkgName = 'org.hertsstack' -def pkgVersion = '1.1.1' +def pkgVersion = '1.1.2' def javaVersion = project.hasProperty('javaVersion') ? project.getProperty('javaVersion') : '15' def artifactId = 'codegen' @@ -22,6 +22,7 @@ repositories { dependencies { implementation project(':herts-core') + implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2' implementation 'org.apache.velocity:velocity-engine-core:2.3' implementation 'commons-cli:commons-cli:1.5.0' } diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/CodeGenUtil.java b/herts-codegen/src/main/java/org/hertsstack/codegen/CodeGenUtil.java index 61346579..6ce31e63 100644 --- a/herts-codegen/src/main/java/org/hertsstack/codegen/CodeGenUtil.java +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/CodeGenUtil.java @@ -4,14 +4,23 @@ import java.io.FileWriter; import java.io.IOException; -import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; import java.util.function.BiFunction; class CodeGenUtil { public static final String GEN_COMMENT = "// Don't edit this file because this file is generated by herts codegen."; + public static String getRequestName() { + return "MethodRequest"; + } + + public static String getResponseName() { + return "MethodResponse"; + } + public static String capitalizeFirstLetter(String input) { if (input == null || input.isEmpty()) { return input; @@ -26,15 +35,25 @@ public static String capitalizeFirstLetter(String input) { } } - private static boolean isInheritHertsMessage(String className) { - if (className == null) { + private static boolean isInheritHertsMessage(List inheritClassNames) { + if (inheritClassNames == null || inheritClassNames.size() == 0) { return false; } - return className.contains(HertsMessage.class.getSimpleName()); + return inheritClassNames.contains(HertsMessage.class.getSimpleName()); + } + + public static void getAllInheritedClassNames(Class targetClass, List inheritClassNames) { + inheritClassNames.add(targetClass.getSimpleName()); + Class superClass = targetClass.getSuperclass(); + if (superClass != null) { + getAllInheritedClassNames(superClass, inheritClassNames); + } } public static boolean isCustomModelClass(Class classInfo) { - if (classInfo.getSuperclass() != null && isInheritHertsMessage(classInfo.getSuperclass().getName())) { + List inheritClassNames = new ArrayList<>(); + getAllInheritedClassNames(classInfo, inheritClassNames); + if (classInfo.getSuperclass() != null && isInheritHertsMessage(inheritClassNames)) { return true; } return false; @@ -51,13 +70,18 @@ public static String getFullPath(String outDir, String filename) { public static void writeFile(String fileName, String rawData) { try { FileWriter fw = new FileWriter(fileName, false); - fw.write(rawData); - fw.close(); + write(fw, rawData); } catch (IOException ex) { ex.printStackTrace(); } } + private static void write(FileWriter fw, String rawData) throws IOException { + fw.write(rawData); + fw.flush(); + fw.close(); + } + public static String getGeneticTypes(JavaType javaType, String defaultTypescriptType, Type[] types, BiFunction, String> delegate) { diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/JavaType.java b/herts-codegen/src/main/java/org/hertsstack/codegen/JavaType.java index b0187a9a..02cfdb8c 100644 --- a/herts-codegen/src/main/java/org/hertsstack/codegen/JavaType.java +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/JavaType.java @@ -2,27 +2,49 @@ enum JavaType { Object(java.lang.Object.class.getName()), + ObjectArray("[L" + java.lang.Object.class.getName() + ";"), ByteClass(java.lang.Byte.class.getName()), + ByteClassArray("[L" + java.lang.Byte.class.getName() + ";"), Byte(byte.class.getName()), + ByteArray("[L" + byte.class.getName() + ";"), ShortClass(java.lang.Short.class.getName()), + ShortClassArray("[L" + java.lang.Short.class.getName() + ";"), Short(short.class.getName()), + ShortArray("[L" + short.class.getName() + ";"), IntClass(java.lang.Integer.class.getName()), + IntClassArray("[L" + java.lang.Integer.class.getName() + ";"), Int(int.class.getName()), + IntArray("[L" + int.class.getName() + ";"), LongClass(java.lang.Long.class.getName()), + LongClassArray("[L" + java.lang.Long.class.getName() + ";"), Long(long.class.getName()), + LongArray("[L" + long.class.getName() + ";"), FloatClass(java.lang.Float.class.getName()), + FloatClassArray("[L" + java.lang.Float.class.getName() + ";"), Float(float.class.getName()), + FloatArray("[L" + float.class.getName() + ";"), DoubleClass(java.lang.Double.class.getName()), + DoubleClassArray("[L" + java.lang.Double.class.getName() + ";"), Double(double.class.getName()), + DoubleArray("[L" + double.class.getName() + ";"), BooleanClass(java.lang.Boolean.class.getName()), + BooleanClassArray("[L" + java.lang.Boolean.class.getName() + ";"), Boolean(boolean.class.getName()), + BooleanArray("[L" + boolean.class.getName() + ";"), CharacterClass(java.lang.Character.class.getName()), + CharacterClassArray("[L" + java.lang.Character.class.getName() + ";"), Character(char.class.getName()), + CharacterArray("[L" + char.class.getName() + ";"), String(java.lang.String.class.getName()), + StringArray("[L" + java.lang.String.class.getName() + ";"), BigDecimal(java.math.BigDecimal.class.getName()), + BigDecimalArray("[L" + java.math.BigDecimal.class.getName() + ";"), BigInteger(java.math.BigInteger.class.getName()), + BigIntegerArray("[L" + java.math.BigInteger.class.getName() + ";"), Date(java.util.Date.class.getName()), + DateArray("[L" + java.util.Date.class.getName() + ";"), UUID(java.util.UUID.class.getName()), + UUIDArray("[L" + java.util.UUID.class.getName() + ";"), Enum(java.lang.Enum.class.getName()), ArrayList(java.util.ArrayList.class.getName()), List(java.util.List.class.getName()), diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/TypeResolverImpl.java b/herts-codegen/src/main/java/org/hertsstack/codegen/TypeResolverImpl.java index 353fd490..84658dff 100644 --- a/herts-codegen/src/main/java/org/hertsstack/codegen/TypeResolverImpl.java +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/TypeResolverImpl.java @@ -8,26 +8,47 @@ class TypeResolverImpl implements TypeResolver { { put(JavaType.Object, TypescriptType.Any); put(JavaType.ByteClass, TypescriptType.Number); + put(JavaType.ByteClassArray, TypescriptType.ArrayNumber); put(JavaType.Byte, TypescriptType.Number); + put(JavaType.ByteArray, TypescriptType.ArrayNumber); put(JavaType.ShortClass, TypescriptType.Number); + put(JavaType.ShortClassArray, TypescriptType.ArrayNumber); put(JavaType.Short, TypescriptType.Number); + put(JavaType.ShortArray, TypescriptType.ArrayNumber); put(JavaType.IntClass, TypescriptType.Number); + put(JavaType.IntClassArray, TypescriptType.ArrayNumber); put(JavaType.Int, TypescriptType.Number); + put(JavaType.IntArray, TypescriptType.ArrayNumber); put(JavaType.LongClass, TypescriptType.Number); + put(JavaType.LongClassArray, TypescriptType.ArrayNumber); put(JavaType.Long, TypescriptType.Number); + put(JavaType.LongArray, TypescriptType.ArrayNumber); put(JavaType.FloatClass, TypescriptType.Number); + put(JavaType.FloatClassArray, TypescriptType.ArrayNumber); put(JavaType.Float, TypescriptType.Number); + put(JavaType.FloatArray, TypescriptType.ArrayNumber); put(JavaType.DoubleClass, TypescriptType.Number); + put(JavaType.DoubleClassArray, TypescriptType.ArrayNumber); put(JavaType.Double, TypescriptType.Number); + put(JavaType.DoubleArray, TypescriptType.ArrayNumber); put(JavaType.BooleanClass, TypescriptType.Boolean); + put(JavaType.BooleanClassArray, TypescriptType.ArrayBoolean); put(JavaType.Boolean, TypescriptType.Boolean); + put(JavaType.BooleanArray, TypescriptType.ArrayBoolean); put(JavaType.CharacterClass, TypescriptType.String); + put(JavaType.CharacterClassArray, TypescriptType.ArrayString); put(JavaType.Character, TypescriptType.String); + put(JavaType.CharacterArray, TypescriptType.ArrayString); put(JavaType.String, TypescriptType.String); + put(JavaType.StringArray, TypescriptType.ArrayString); put(JavaType.BigDecimal, TypescriptType.Number); + put(JavaType.BigDecimalArray, TypescriptType.ArrayNumber); put(JavaType.BigInteger, TypescriptType.Number); + put(JavaType.BigIntegerArray, TypescriptType.ArrayNumber); put(JavaType.Date, TypescriptType.Date); + put(JavaType.DateArray, TypescriptType.ArrayDate); put(JavaType.UUID, TypescriptType.String); + put(JavaType.UUIDArray, TypescriptType.ArrayString); put(JavaType.ArrayList, TypescriptType.Any); put(JavaType.List, TypescriptType.Array); put(JavaType.HashMap, TypescriptType.Map); diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptBase.java b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptBase.java index 94a7faeb..0c869c34 100644 --- a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptBase.java +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptBase.java @@ -1,5 +1,7 @@ package org.hertsstack.codegen; +import java.util.List; + class TypescriptBase { protected final CacheGenCode cacheGenCode; protected final TypeResolver typeResolver; @@ -11,11 +13,29 @@ public TypescriptBase(TypeResolver typeResolver) { protected String getTypescriptTypeStr(JavaType javaType, Class typeClass) { if (javaType == null - && CodeGenUtil.isCustomModelClass(typeClass) - && this.cacheGenCode.getGeneratedPackageNames().contains(typeClass.getSimpleName())) { + && (CodeGenUtil.isCustomModelClass(typeClass) + || this.cacheGenCode.getGeneratedPackageNames().contains(typeClass.getSimpleName()))) { return typeClass.getSimpleName(); } else { return this.typeResolver.convertType(javaType).getData(); } } + + protected void addImportSentenceIfNotExist(String tsType, List importInfos, String filename) { + if (this.typeResolver.findType(tsType) == null) { + boolean isImported = false; + for (TypescriptDefault.ImportInfo importInfo : importInfos) { + if (importInfo.getName().equals(tsType)) { + isImported = true; + break; + } + } + if (!isImported) { + importInfos.add(new TypescriptDefault.ImportInfo( + tsType, + filename + )); + } + } + } } diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenClient.java b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenClient.java index 619a9beb..9323062a 100644 --- a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenClient.java +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenClient.java @@ -39,8 +39,8 @@ public void genClient(Method[] methods) { List methodInfos = new ArrayList<>(); for (Method method : methods) { String capitalizeMethodName = CodeGenUtil.capitalizeFirstLetter(method.getName()); - String reqClassName = capitalizeMethodName + "Request"; - String resClassName = capitalizeMethodName + "Response"; + String reqClassName = capitalizeMethodName + CodeGenUtil.getRequestName(); + String resClassName = capitalizeMethodName + CodeGenUtil.getResponseName(); reqModelNames.add(reqClassName); resModelNames.add(resClassName); @@ -52,7 +52,16 @@ public void genClient(Method[] methods) { new Type[]{method.getGenericReturnType()}, generateTypescriptType); if (this.typeResolver.findType(defaultTypescriptType) == null) { - customModelNames.add(defaultTypescriptType); + boolean exist = false; + for (String s : customModelNames) { + if (s.equals(defaultTypescriptType)) { + exist = true; + break; + } + } + if (!exist) { + customModelNames.add(defaultTypescriptType); + } } methodInfos.add(new TypescriptDefault.MethodInfo( diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenMain.java b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenMain.java index b9d1348e..7721de9b 100644 --- a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenMain.java +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenMain.java @@ -52,7 +52,7 @@ public void genMain(Method[] methods) { } String capitalizeMethodName = CodeGenUtil.capitalizeFirstLetter(method.getName()); - String reqClassName = capitalizeMethodName + "Request"; + String reqClassName = capitalizeMethodName + CodeGenUtil.getRequestName(); String reqClassNameWithFunc = reqClassName + ".createRequest"; String reqValName = "req" + idx; String resValName = "res" + idx; diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenRequest.java b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenRequest.java new file mode 100644 index 00000000..1866039f --- /dev/null +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenRequest.java @@ -0,0 +1,113 @@ +package org.hertsstack.codegen; + +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; +import org.hertsstack.core.annotation.HertsParam; + +import java.io.StringWriter; +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.function.BiFunction; + +class TypescriptCodeGenRequest extends TypescriptBase { + private final String serviceName; + private final TypescriptFileName fileName; + private final String outDir; + + public TypescriptCodeGenRequest(String serviceName, TypeResolver typeResolver, String outDir) { + super(typeResolver); + this.serviceName = serviceName; + this.fileName = new TypescriptFileName(this.serviceName); + this.outDir = outDir; + } + + public void generate(Method[] methods) { + System.out.println("Typescript file name = " + this.fileName.getRequestFileName()); + System.out.println("Generating..."); + + String templateFileName = this.fileName.getRequestTsFileName() + ".vm"; + String template = TypescriptDefault.STRUCTURE_REQ_MODEL_CLASS; + CodeGenUtil.writeFile(CodeGenUtil.getFullPath(this.outDir, templateFileName), template); + + List reqClassInfos = new ArrayList<>(); + List payloadNames = new ArrayList<>(); + List importInfos = new ArrayList<>(); + + for (Method method : methods) { + String capitalizeMethodName = CodeGenUtil.capitalizeFirstLetter(method.getName()); + String payloadClassName = capitalizeMethodName + "Payload"; + Class[] parameterTypes = method.getParameterTypes(); + boolean hasParameter = parameterTypes.length > 0; + + List args = new ArrayList<>(); + if (hasParameter) { + for (int i = 0; i < parameterTypes.length; i++) { + + // Find actual arg name + String actualArgName = null; + if (method.getParameters()[i].getAnnotations() != null && method.getParameters()[i].getAnnotations().length > 0) { + Annotation annotation = method.getParameters()[i].getAnnotations()[0]; + if (annotation instanceof HertsParam) { + HertsParam parameterNameAnnotation = (HertsParam) annotation; + actualArgName = parameterNameAnnotation.value(); + } + } else { + actualArgName = "arg" + i; + } + + // Find typescript type + Class parameterTypeClass = parameterTypes[i]; + JavaType javaType = JavaType.findType(parameterTypeClass.getName()); + String defaultTypescriptType = getTypescriptTypeStr(javaType, parameterTypeClass); + + BiFunction, String> generateTypescriptType = this::getTypescriptTypeStr; + String typescriptType = CodeGenUtil.getGeneticTypes(javaType, defaultTypescriptType, + method.getGenericParameterTypes(), generateTypescriptType); + + args.add(new TypescriptDefault.ReqClassInfo.Request.Arg( + "arg" + i, + actualArgName, + typescriptType, + "payload" + i + )); + + addImportSentenceIfNotExist(defaultTypescriptType, importInfos, this.fileName.getStructureTsFileName()); + } + } + + payloadNames.add(payloadClassName); + reqClassInfos.add(new TypescriptDefault.ReqClassInfo.Request( + capitalizeMethodName + CodeGenUtil.getRequestName(), + payloadClassName, + args + )); + } + + TypescriptDefault.ReqClassInfo reqClassInfo = new TypescriptDefault.ReqClassInfo(); + reqClassInfo.setReqClassInfos(reqClassInfos); + reqClassInfo.setPayloadNames(payloadNames); + reqClassInfo.setImportInfos(importInfos); + + try { + StringWriter sw = new StringWriter(); + VelocityContext context = reqClassInfo.getVelocityContext(); + Template tem = Velocity.getTemplate(templateFileName); + tem.merge(context, sw); + + CodeGenUtil.writeFile(CodeGenUtil.getFullPath(this.outDir, this.fileName.getRequestFileName()), sw.toString()); + } catch (Exception ex) { + System.out.println("Failed to create " + this.fileName.getRequestFileName() + " file"); + ex.printStackTrace(); + } finally { + try { + Files.delete(Path.of(CodeGenUtil.getFullPath(this.outDir, templateFileName))); + } catch (Exception ignore) { + } + } + } +} diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenResponse.java b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenResponse.java new file mode 100644 index 00000000..21d128fc --- /dev/null +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenResponse.java @@ -0,0 +1,86 @@ +package org.hertsstack.codegen; + +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.StringWriter; +import java.lang.reflect.Method; +import java.lang.reflect.Type; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.function.BiFunction; + +class TypescriptCodeGenResponse extends TypescriptBase { + private final String serviceName; + private final TypescriptFileName fileName; + private final String outDir; + + public TypescriptCodeGenResponse(String serviceName, TypeResolver typeResolver, String outDir) { + super(typeResolver); + this.serviceName = serviceName; + this.fileName = new TypescriptFileName(this.serviceName); + this.outDir = outDir; + } + + public void generate(Method[] methods) { + System.out.println("Typescript file name = " + this.fileName.getResponseFileName()); + System.out.println("Generating..."); + + String templateFileName = this.fileName.getResponseTsFileName() + ".vm"; + String template = TypescriptDefault.STRUCTURE_RES_MODEL_CLASS; + CodeGenUtil.writeFile(CodeGenUtil.getFullPath(this.outDir, templateFileName), template); + + List importInfos = new ArrayList<>(); + List resClassInfos = new ArrayList<>(); + List payloadClassInfos = new ArrayList<>(); + + for (Method method : methods) { + String capitalizeMethodName = CodeGenUtil.capitalizeFirstLetter(method.getName()); + String payloadClassName = capitalizeMethodName + "Payload"; + + JavaType javaType = JavaType.findType(method.getReturnType().getName()); + String defaultTypescriptType = getTypescriptTypeStr(javaType, method.getReturnType()); + + BiFunction, String> generateTypescriptType = this::getTypescriptTypeStr; + String typescriptType = CodeGenUtil.getGeneticTypes(javaType, defaultTypescriptType, + new Type[]{method.getGenericReturnType()}, generateTypescriptType); + + addImportSentenceIfNotExist(defaultTypescriptType, importInfos, this.fileName.getStructureTsFileName()); + + resClassInfos.add(new TypescriptDefault.ResClassInfo.Response( + capitalizeMethodName + CodeGenUtil.getResponseName(), + payloadClassName + )); + + payloadClassInfos.add(new TypescriptDefault.ResClassInfo.Payload( + payloadClassName, + typescriptType + )); + } + + TypescriptDefault.ResClassInfo resClassInfo = new TypescriptDefault.ResClassInfo(); + resClassInfo.setImportInfos(importInfos); + resClassInfo.setResClassInfos(resClassInfos); + resClassInfo.setPayloadClassInfos(payloadClassInfos); + + try { + StringWriter sw = new StringWriter(); + VelocityContext context = resClassInfo.getVelocityContext(); + Template tem = Velocity.getTemplate(templateFileName); + tem.merge(context, sw); + + CodeGenUtil.writeFile(CodeGenUtil.getFullPath(this.outDir, this.fileName.getResponseFileName()), sw.toString()); + } catch (Exception ex) { + System.out.println("Failed to create " + this.fileName.getResponseFileName() + " file"); + ex.printStackTrace(); + } finally { + try { + Files.delete(Path.of(CodeGenUtil.getFullPath(this.outDir, templateFileName))); + } catch (Exception ignore) { + } + } + } +} diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenStructure.java b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenStructure.java index 0bc8d0e8..38dadd34 100644 --- a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenStructure.java +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptCodeGenStructure.java @@ -7,14 +7,14 @@ import java.io.StringWriter; import java.lang.reflect.Field; import java.lang.reflect.Method; -import java.lang.reflect.Type; +import java.lang.reflect.ParameterizedType; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; -import java.util.function.BiFunction; class TypescriptCodeGenStructure extends TypescriptBase { + private static final String REQUEST_HEADER_CLASS_NAME = "RequestHeaders"; private final String serviceName; private final TypescriptFileName fileName; private final String outDir; @@ -26,8 +26,84 @@ public TypescriptCodeGenStructure(String serviceName, TypeResolver typeResolver, this.outDir = outDir; } - private void genNestedModel(List structures, Class targetClass) - throws ClassNotFoundException { + private void setConstructorInfoForMap(String propertyName, + Class keyClass, + Class valueClass, + List constructorInfos, + List nestedModelPackages) throws ClassNotFoundException { + + // TODO: Unused custom model + if (CodeGenUtil.isCustomModelClass(keyClass)) { + nestedModelPackages.add(keyClass.getTypeName()); + } + if (CodeGenUtil.isCustomModelClass(valueClass)) { + nestedModelPackages.add(valueClass.getTypeName()); + } + + JavaType keyJavaType = JavaType.findType(keyClass.getName()); + String keyPropertyTypeStr = this.typeResolver.convertType(keyJavaType).getData(); + + JavaType valueJavaType = JavaType.findType(valueClass.getName()); + String valuePropertyTypeStr = this.typeResolver.convertType(valueJavaType).getData(); + + String propertyTypeStr = TypescriptType.Map.getData() + .replace("$0", keyPropertyTypeStr) + .replace("$1", valuePropertyTypeStr); + + constructorInfos.add(new TypescriptDefault.ConstructorInfo(propertyName, propertyTypeStr)); + } + + private void setConstructorInfo(String propertyName, + String propertyType, + Class nestedClass, + List constructorInfos, + List nestedModelPackages, + boolean isArray, + boolean isCustom) throws ClassNotFoundException { + + if (CodeGenUtil.isCustomModelClass(nestedClass)) { + nestedModelPackages.add(propertyType); + } + + String[] classSplit; + if (propertyType.contains("$")) { + classSplit = propertyType.split("\\$"); + } else { + classSplit = propertyType.split("\\."); + } + + String propertyTypeStr = null; + if (isArray) { + propertyTypeStr = TypescriptType.Array.getData().replace("$0", classSplit[classSplit.length - 1]); + } else if (isCustom) { + propertyTypeStr = classSplit[classSplit.length - 1]; + } else { + JavaType type = JavaType.findType( classSplit[classSplit.length - 1]); + TypescriptType typescriptType = this.typeResolver.convertType(type); + propertyTypeStr = typescriptType.getData(); + } + + constructorInfos.add(new TypescriptDefault.ConstructorInfo(propertyName, propertyTypeStr)); + } + + private void setEnumInfo(String propertyName, + Class enumClass, + List constructorInfos, + List enumInfos) throws ClassNotFoundException { + + Object[] enumObjects = enumClass.getEnumConstants(); + List enumValues = new ArrayList<>(); + for (Object o : enumObjects) { + enumValues.add(o.toString()); + } + String enumName = CodeGenUtil.capitalizeFirstLetter(propertyName); + enumInfos.add(new TypescriptDefault.StructureClassInfo.EnumInfo(enumName, enumValues)); + constructorInfos.add(new TypescriptDefault.ConstructorInfo(propertyName, enumName)); + } + + private void genNestedModel(List structures, + Class targetClass, + List enumInfos) throws ClassNotFoundException { if (this.cacheGenCode.getGeneratedPackageNames().contains(targetClass.getSimpleName())) { return; @@ -43,53 +119,87 @@ private void genNestedModel(List for (Field field : allFields) { String propertyName = field.getName(); String propertyType = field.getType().getName(); + // System.out.println("Name: " + propertyName); + // System.out.println("Type: " + propertyType); + + JavaType javaType = JavaType.findType(propertyType); + TypescriptType typescriptType = this.typeResolver.convertType(javaType); + this.cacheGenCode.addGeneratedPackageNames(targetClass.getSimpleName()); - if (propertyType.contains("$")) { - Class nestedClass = Class.forName(field.getType().getName()); - if (CodeGenUtil.isCustomModelClass(nestedClass)) { - nestedModelPackages.add(field.getType().getName()); + Class classObj = null; + try { + classObj = Class.forName(propertyType); + if (classObj.isEnum()) { + setEnumInfo(propertyName, classObj, constructorInfos, enumInfos); + this.cacheGenCode.addGeneratedPackageNames(classObj.getSimpleName()); + continue; } + } catch (java.lang.ClassNotFoundException ignore) { + } - String[] classSplit = propertyType.split("\\$"); - propertyType = classSplit[classSplit.length-1]; + // Custom Object + if (javaType == null) { + setConstructorInfo(propertyName, propertyType, classObj, constructorInfos, nestedModelPackages, false, true); - constructorInfos.add(new TypescriptDefault.ConstructorInfo(propertyName, propertyType)); - } else { - JavaType type = JavaType.findType(propertyType); - TypescriptType typescriptType = this.typeResolver.convertType(type); + // Array + } else if (typescriptType == TypescriptType.Array) { + String typeName = ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0].getTypeName(); + classObj = Class.forName(typeName); + setConstructorInfo(propertyName, typeName, classObj, constructorInfos, nestedModelPackages, true, false); + // Map + } else if (typescriptType == TypescriptType.Map) { + String keyTypeName = ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0].getTypeName() ; + String valueTypeName = ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[1].getTypeName(); + setConstructorInfoForMap(propertyName, Class.forName(keyTypeName), Class.forName(valueTypeName), constructorInfos, nestedModelPackages); + + // Default converter + } else { constructorInfos.add(new TypescriptDefault.ConstructorInfo(propertyName, typescriptType.getData())); } } structure.setConstructors(constructorInfos); structures.add(structure); - this.cacheGenCode.addGeneratedPackageNames(targetClass.getSimpleName()); - // Recursive generate model for (String nestedModelPkg : nestedModelPackages) { Class nestedClass = Class.forName(nestedModelPkg); - genNestedModel(structures, nestedClass); + genNestedModel(structures, nestedClass, enumInfos); } } - private void senCustomPkgModelStr(Method[] methods, List structures) { + private void senCustomPkgModelStr(Method[] methods, + List structures, + List enumInfos) { + for (Method method : methods) { Class[] parameterTypes = method.getParameterTypes(); + + // Parameter structures for (Class paramTypeClass : parameterTypes) { if (CodeGenUtil.isCustomModelClass(paramTypeClass)) { try { - genNestedModel(structures, paramTypeClass); + genNestedModel(structures, paramTypeClass, enumInfos); } catch (ClassNotFoundException e) { e.printStackTrace(); } } } + + // Return structure + Class returnType = method.getReturnType(); + JavaType javaType = JavaType.findType(returnType.getName()); + if (javaType == null && !returnType.getName().equals("void")) { + try { + genNestedModel(structures, returnType, enumInfos); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } } } - private static final String REQUEST_HEADER_CLASS_NAME = "RequestHeaders"; - public void genStructureModel(Method[] methods, StringBuilder codeStr) { + public String getGeneratedCode(Method[] methods) { System.out.println("Typescript file name = " + this.fileName.getStructureFileName()); System.out.println("Generating..."); @@ -98,21 +208,22 @@ public void genStructureModel(Method[] methods, StringBuilder codeStr) { CodeGenUtil.writeFile(CodeGenUtil.getFullPath(this.outDir, templateFileName), template); List structures = new ArrayList<>(); + List enumInfos = new ArrayList<>(); boolean hasHeader = true; if (!this.cacheGenCode.getGeneratedPackageNames().contains(REQUEST_HEADER_CLASS_NAME)) { this.cacheGenCode.addGeneratedPackageNames(REQUEST_HEADER_CLASS_NAME); hasHeader = false; } - senCustomPkgModelStr(methods, structures); + senCustomPkgModelStr(methods, structures, enumInfos); - TypescriptDefault.StructureClassInfo classInfo = new TypescriptDefault.StructureClassInfo(structures); + TypescriptDefault.StructureClassInfo classInfo = new TypescriptDefault.StructureClassInfo(structures, enumInfos); try { StringWriter sw = new StringWriter(); VelocityContext context = classInfo.getVelocityContext(hasHeader); Template tem = Velocity.getTemplate(templateFileName); tem.merge(context, sw); - codeStr.append(sw); + return sw.toString(); } catch (Exception ex) { System.out.println("Failed to merge " + this.fileName.getStructureFileName() + " file"); ex.printStackTrace(); @@ -122,144 +233,10 @@ public void genStructureModel(Method[] methods, StringBuilder codeStr) { } catch (Exception ignore) { } } + return null; } - public void genResponseModel(Method[] methods) { - System.out.println("Typescript file name = " + this.fileName.getResponseFileName()); - System.out.println("Generating..."); - - String templateFileName = this.fileName.getResponseTsFileName() + ".vm"; - String template = TypescriptDefault.STRUCTURE_RES_MODEL_CLASS; - CodeGenUtil.writeFile(CodeGenUtil.getFullPath(this.outDir, templateFileName), template); - - List importInfos = new ArrayList<>(); - List resClassInfos = new ArrayList<>(); - List payloadClassInfos = new ArrayList<>(); - - for (Method method : methods) { - String capitalizeMethodName = CodeGenUtil.capitalizeFirstLetter(method.getName()); - String payloadClassName = capitalizeMethodName + "Payload"; - - JavaType javaType = JavaType.findType(method.getReturnType().getName()); - String defaultTypescriptType = getTypescriptTypeStr(javaType, method.getReturnType()); - - BiFunction, String> generateTypescriptType = this::getTypescriptTypeStr; - String typescriptType = CodeGenUtil.getGeneticTypes(javaType, defaultTypescriptType, - new Type[]{method.getGenericReturnType()}, generateTypescriptType); - - if (this.typeResolver.findType(defaultTypescriptType) == null) { - importInfos.add(new TypescriptDefault.ImportInfo( - defaultTypescriptType, - this.fileName.getStructureTsFileName() - )); - } - - resClassInfos.add(new TypescriptDefault.ResClassInfo.Response( - capitalizeMethodName + "Response", - payloadClassName - )); - - payloadClassInfos.add(new TypescriptDefault.ResClassInfo.Payload( - payloadClassName, - typescriptType - )); - } - - TypescriptDefault.ResClassInfo resClassInfo = new TypescriptDefault.ResClassInfo(); - resClassInfo.setImportInfos(importInfos); - resClassInfo.setResClassInfos(resClassInfos); - resClassInfo.setPayloadClassInfos(payloadClassInfos); - - try { - StringWriter sw = new StringWriter(); - VelocityContext context = resClassInfo.getVelocityContext(); - Template tem = Velocity.getTemplate(templateFileName); - tem.merge(context, sw); - - CodeGenUtil.writeFile(CodeGenUtil.getFullPath(this.outDir, this.fileName.getResponseFileName()), sw.toString()); - } catch (Exception ex) { - System.out.println("Failed to create " + this.fileName.getResponseFileName() + " file"); - ex.printStackTrace(); - } finally { - try { - Files.delete(Path.of(CodeGenUtil.getFullPath(this.outDir, templateFileName))); - } catch (Exception ignore) { - } - } - } - - public void genRequestModel(Method[] methods) { - System.out.println("Typescript file name = " + this.fileName.getRequestFileName()); - System.out.println("Generating..."); - - String templateFileName = this.fileName.getRequestTsFileName() + ".vm"; - String template = TypescriptDefault.STRUCTURE_REQ_MODEL_CLASS; - CodeGenUtil.writeFile(CodeGenUtil.getFullPath(this.outDir, templateFileName), template); - - List reqClassInfos = new ArrayList<>(); - List payloadNames = new ArrayList<>(); - List importInfos = new ArrayList<>(); - - for (Method method : methods) { - String capitalizeMethodName = CodeGenUtil.capitalizeFirstLetter(method.getName()); - String payloadClassName = capitalizeMethodName + "Payload"; - Class[] parameterTypes = method.getParameterTypes(); - boolean hasParameter = parameterTypes.length > 0; - - List args = new ArrayList<>(); - if (hasParameter) { - for (int i = 0; i < parameterTypes.length; i++) { - Class parameterTypeClass = parameterTypes[i]; - JavaType javaType = JavaType.findType(parameterTypeClass.getName()); - String defaultTypescriptType = getTypescriptTypeStr(javaType, parameterTypeClass); - - BiFunction, String> generateTypescriptType = this::getTypescriptTypeStr; - String typescriptType = CodeGenUtil.getGeneticTypes(javaType, defaultTypescriptType, - method.getGenericParameterTypes(), generateTypescriptType); - - args.add(new TypescriptDefault.ReqClassInfo.Request.Arg( - "arg" + i, - typescriptType, - "payload" + i - )); - - if (this.typeResolver.findType(defaultTypescriptType) == null) { - importInfos.add(new TypescriptDefault.ImportInfo( - defaultTypescriptType, - this.fileName.getStructureTsFileName() - )); - } - } - } - - payloadNames.add(payloadClassName); - reqClassInfos.add(new TypescriptDefault.ReqClassInfo.Request( - capitalizeMethodName + "Request", - payloadClassName, - args - )); - } - - TypescriptDefault.ReqClassInfo reqClassInfo = new TypescriptDefault.ReqClassInfo(); - reqClassInfo.setReqClassInfos(reqClassInfos); - reqClassInfo.setPayloadNames(payloadNames); - reqClassInfo.setImportInfos(importInfos); - - try { - StringWriter sw = new StringWriter(); - VelocityContext context = reqClassInfo.getVelocityContext(); - Template tem = Velocity.getTemplate(templateFileName); - tem.merge(context, sw); - - CodeGenUtil.writeFile(CodeGenUtil.getFullPath(this.outDir, this.fileName.getRequestFileName()), sw.toString()); - } catch (Exception ex) { - System.out.println("Failed to create " + this.fileName.getRequestFileName() + " file"); - ex.printStackTrace(); - } finally { - try { - Files.delete(Path.of(CodeGenUtil.getFullPath(this.outDir, templateFileName))); - } catch (Exception ignore) { - } - } + public static void generate(String outDir, String code) { + CodeGenUtil.writeFile(CodeGenUtil.getFullPath(outDir, TypescriptFileName.tsStructureFileName), code); } } diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptDefault.java b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptDefault.java index bc746438..dd1820b4 100644 --- a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptDefault.java +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptDefault.java @@ -235,11 +235,13 @@ public List getArgs() { public static class Arg { private final String keyName; + private final String actualKeyName; private final String typeName; private final String payloadValName; - public Arg(String keyName, String typeName, String payloadValName) { + public Arg(String keyName, String actualKeyName, String typeName, String payloadValName) { this.keyName = keyName; + this.actualKeyName = actualKeyName; this.typeName = typeName; this.payloadValName = payloadValName; } @@ -248,6 +250,10 @@ public String getKeyName() { return keyName; } + public String getActualKeyName() { + return actualKeyName; + } + public String getTypeName() { return typeName; } @@ -264,22 +270,55 @@ public String getPayloadValName() { */ public static class StructureClassInfo { private final List classInfos; + private final List enumInfos; - public StructureClassInfo(List classInfos) { + public StructureClassInfo(List classInfos, List enumInfos) { this.classInfos = classInfos; + this.enumInfos = enumInfos; } public List getClassInfos() { return classInfos; } + public List getEnumInfos() { + return enumInfos; + } + public VelocityContext getVelocityContext(boolean hasHeader) { VelocityContext context = new VelocityContext(); context.put("classInfos", this.classInfos); + context.put("enumInfos", this.enumInfos); context.put("hasHeaderModel", hasHeader); return context; } + public static class EnumInfo { + private String name; + private List values; + + public EnumInfo(String name, List values) { + this.name = name; + this.values = values; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + } + public static class Structure { private String name; private List filedInfos; @@ -347,7 +386,7 @@ public static class ClientClassInfo { public ClientClassInfo(String dollarSign, String serviceName, String clientClassName, List reqModelNames, String reqModelFileName, List resModelNames, - String resModelFileName, List costomModelNames, String customModelFileName, + String resModelFileName, List customModelNames, String customModelFileName, List methodInfos) { this.dollarSign = dollarSign; this.serviceName = serviceName; @@ -356,7 +395,7 @@ public ClientClassInfo(String dollarSign, String serviceName, String clientClass this.reqModelFileName = reqModelFileName; this.resModelNames = resModelNames; this.resModelFileName = resModelFileName; - this.customModelNames = costomModelNames; + this.customModelNames = customModelNames; this.customModelFileName = customModelFileName; this.methodInfos = methodInfos; } @@ -575,6 +614,16 @@ export class $classInfo.name { $filed.keyName : $filed.typeName #end } + + #end + + #foreach($enumInfo in $enumInfos) + export enum $enumInfo.name { + #foreach($v in $enumInfo.values) + $v = "${v}", + #end + } + #end """; @@ -596,17 +645,18 @@ private constructor(payloads: Array<$classInfo.payloadName>) { payloads: Array<$classInfo.payloadName>; public static createRequest( #foreach($arg in $classInfo.args) - $arg.keyName : $arg.typeName, + $arg.actualKeyName : $arg.typeName, #end ) { const payloads = new Array<$classInfo.payloadName>(); #foreach($arg in $classInfo.args) - const $arg.payloadValName = new $classInfo.payloadName ('$arg.keyName', $arg.keyName); + const $arg.payloadValName = new $classInfo.payloadName ('$arg.keyName', $arg.actualKeyName); payloads.push($arg.payloadValName); #end return new $classInfo.name (payloads); }; } + #end #foreach($payloadName in $payloadNames) @@ -618,6 +668,7 @@ export class $payloadName { private keyName: string; private value: any; } + #end """; @@ -638,17 +689,20 @@ export class $classInfo.name { } payload: $classInfo.payloadClassName; } + #end #foreach($classInfo in $payloadClassInfos) export class $classInfo.name { constructor() { this.keyName = ''; + // @ts-ignore this.value = null; } private keyName: string; value: $classInfo.valueType; } + #end """; diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptHttpClientGenerator.java b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptHttpClientGenerator.java index 70a96e49..5dcf9b8a 100644 --- a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptHttpClientGenerator.java +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptHttpClientGenerator.java @@ -20,15 +20,19 @@ public void run(String outDir, List> hertsServices) { Method[] methods = hertsService.getDeclaredMethods(); TypescriptCodeGenStructure typescriptCodeGenStructure = new TypescriptCodeGenStructure(serviceName, this.typeResolver, outDir); + TypescriptCodeGenRequest typescriptCodeGenRequest = new TypescriptCodeGenRequest(serviceName, this.typeResolver, outDir); + TypescriptCodeGenResponse typescriptCodeGenResponse = new TypescriptCodeGenResponse(serviceName, this.typeResolver, outDir); TypescriptCodeGenClient typescriptCodeGenClient = new TypescriptCodeGenClient(serviceName, this.typeResolver, outDir); TypescriptCodeGenMain typescriptCodeGenMain = new TypescriptCodeGenMain(serviceName, this.typeResolver, outDir); - typescriptCodeGenStructure.genStructureModel(methods, commonStructureCode); - typescriptCodeGenStructure.genRequestModel(methods); - typescriptCodeGenStructure.genResponseModel(methods); + commonStructureCode.append(typescriptCodeGenStructure.getGeneratedCode(methods)); + typescriptCodeGenRequest.generate(methods); + typescriptCodeGenResponse.generate(methods); typescriptCodeGenClient.genClient(methods); + typescriptCodeGenMain.genMain(methods); } - CodeGenUtil.writeFile(CodeGenUtil.getFullPath(outDir, TypescriptFileName.tsStructureFileName), commonStructureCode.toString()); + String code = commonStructureCode.toString(); + TypescriptCodeGenStructure.generate(outDir, code); } } diff --git a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptType.java b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptType.java index 9c7deb68..bdb90049 100644 --- a/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptType.java +++ b/herts-codegen/src/main/java/org/hertsstack/codegen/TypescriptType.java @@ -6,6 +6,10 @@ enum TypescriptType { Boolean("boolean"), String("string"), Date("Date"), + ArrayString("Array"), + ArrayNumber("Array"), + ArrayBoolean("Array"), + ArrayDate("Array"), Array("Array<$0>"), Map("Map<$0, $1>"); diff --git a/herts-core/build.gradle b/herts-core/build.gradle index 491ccc26..70e0173d 100644 --- a/herts-core/build.gradle +++ b/herts-core/build.gradle @@ -6,7 +6,7 @@ plugins { apply plugin: 'application' def pkgName = 'org.hertsstack' -def pkgVersion = '1.1.1' +def pkgVersion = '1.1.2' def javaVersion = project.hasProperty('javaVersion') ? project.getProperty('javaVersion') : '11' def artifactId = 'core' diff --git a/herts-core/src/main/java/org/hertsstack/core/annotation/HertsParam.java b/herts-core/src/main/java/org/hertsstack/core/annotation/HertsParam.java new file mode 100644 index 00000000..737c63c4 --- /dev/null +++ b/herts-core/src/main/java/org/hertsstack/core/annotation/HertsParam.java @@ -0,0 +1,26 @@ +package org.hertsstack.core.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Herts message param annotation. + * + * @author Herts Contributer + */ +@Inherited +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface HertsParam { + + /** + * Herts parameter name. + * If you want to use codegen, please usee this annotation + * + * @return parameter name + */ + String value(); +} diff --git a/herts-core/src/main/java/org/hertsstack/core/modelx/HertsMessage.java b/herts-core/src/main/java/org/hertsstack/core/modelx/HertsMessage.java index 688f0101..83496117 100644 --- a/herts-core/src/main/java/org/hertsstack/core/modelx/HertsMessage.java +++ b/herts-core/src/main/java/org/hertsstack/core/modelx/HertsMessage.java @@ -1,17 +1,20 @@ package org.hertsstack.core.modelx; +import com.fasterxml.jackson.annotation.JsonIgnore; import org.msgpack.annotation.Message; import java.io.Serializable; /** - * Herts rpc message of internal + * Herts message definition * * @author Herts Contributer */ @Message public class HertsMessage implements Serializable { + @JsonIgnore private Object[] messageParameters; + @JsonIgnore private Class[] classTypes; public HertsMessage() { diff --git a/herts-core/src/main/java/org/hertsstack/core/modelx/InternalRpcMsg.java b/herts-core/src/main/java/org/hertsstack/core/modelx/InternalRpcMsg.java new file mode 100644 index 00000000..3d12bf86 --- /dev/null +++ b/herts-core/src/main/java/org/hertsstack/core/modelx/InternalRpcMsg.java @@ -0,0 +1,45 @@ +package org.hertsstack.core.modelx; + +import java.io.Serializable; + +/** + * Herts rpc message of internal + * + * @author Herts Contributer + */ +public class InternalRpcMsg implements Serializable { + private Object[] messageParameters; + private Class[] classTypes; + + public InternalRpcMsg() { + } + + public InternalRpcMsg(Object[] messageParameters) { + this.messageParameters = messageParameters; + } + + public InternalRpcMsg(Class[] classTypes) { + this.classTypes = classTypes; + } + + public InternalRpcMsg(Object[] messageParameters, Class[] classTypes) { + this.messageParameters = messageParameters; + this.classTypes = classTypes; + } + + public Object[] getMessageParameters() { + return messageParameters; + } + + public void setMessageParameters(Object[] messageParameters) { + this.messageParameters = messageParameters; + } + + public Class[] getClassTypes() { + return classTypes; + } + + public void setClassTypes(Class[] classTypes) { + this.classTypes = classTypes; + } +} diff --git a/herts-http-client/build.gradle b/herts-http-client/build.gradle index 787dbd67..495e86ca 100644 --- a/herts-http-client/build.gradle +++ b/herts-http-client/build.gradle @@ -6,7 +6,7 @@ plugins { apply plugin: 'application' def pkgName = 'org.hertsstack' -def pkgVersion = '1.1.1' +def pkgVersion = '1.1.2' def javaVersion = project.hasProperty('javaVersion') ? project.getProperty('javaVersion') : '11' def artifactId = 'http-client' diff --git a/herts-http-client/src/main/java/org/hertsstack/httpclient/IBuilder.java b/herts-http-client/src/main/java/org/hertsstack/httpclient/IBuilder.java index 62d450b1..31ec5acb 100644 --- a/herts-http-client/src/main/java/org/hertsstack/httpclient/IBuilder.java +++ b/herts-http-client/src/main/java/org/hertsstack/httpclient/IBuilder.java @@ -3,7 +3,6 @@ import org.hertsstack.core.annotation.HertsHttp; import org.hertsstack.core.annotation.HertsRpcService; import org.hertsstack.core.context.HertsType; -import org.hertsstack.core.exception.CodeGenException; import org.hertsstack.core.exception.HttpClientBuildException; import org.hertsstack.core.exception.HttpServerBuildException; diff --git a/herts-http/build.gradle b/herts-http/build.gradle index 848123e2..1bb870e7 100644 --- a/herts-http/build.gradle +++ b/herts-http/build.gradle @@ -6,7 +6,7 @@ plugins { apply plugin: 'application' def pkgName = 'org.hertsstack' -def pkgVersion = '1.1.1' +def pkgVersion = '1.1.2' def javaVersion = project.hasProperty('javaVersion') ? project.getProperty('javaVersion') : '11' def artifactId = 'http' diff --git a/herts-http/src/main/java/org/hertsstack/http/HertsHttpCallerBase.java b/herts-http/src/main/java/org/hertsstack/http/HertsHttpCallerBase.java index e281562a..2871e790 100644 --- a/herts-http/src/main/java/org/hertsstack/http/HertsHttpCallerBase.java +++ b/herts-http/src/main/java/org/hertsstack/http/HertsHttpCallerBase.java @@ -108,6 +108,7 @@ protected void call(Method hertsMethod, HttpServletRequest request, HttpServletR InternalHttpResponse hertsResponse = new InternalHttpResponse(); InternalHttpMsg payload = new InternalHttpMsg(); + payload.setKeyName("response"); payload.setValue(res); hertsResponse.setPayload(payload); setWriter(response.getWriter(), this.hertsSerializer.serializeAsStr(hertsResponse)); diff --git a/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientRStreamingMethodHandler.java b/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientRStreamingMethodHandler.java index e32d439c..6762fab6 100644 --- a/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientRStreamingMethodHandler.java +++ b/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientRStreamingMethodHandler.java @@ -5,11 +5,11 @@ import io.grpc.MethodDescriptor; import io.grpc.StatusRuntimeException; import io.grpc.stub.ClientCalls; -import org.hertsstack.core.modelx.HertsMessage; import org.hertsstack.core.context.HertsType; import org.hertsstack.core.descriptor.CustomGrpcDescriptor; import org.hertsstack.core.exception.ServiceNotFoundException; import org.hertsstack.core.exception.rpc.RpcErrorException; +import org.hertsstack.core.modelx.InternalRpcMsg; import org.hertsstack.serializer.MessageSerializer; import org.hertsstack.core.service.HertsService; @@ -64,7 +64,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl byte[] bytes = new byte[]{}; if (args != null) { Class[] parameterTypes = cachedMethod.getParameterTypes(); - bytes = this.serializer.serialize(new HertsMessage(args, parameterTypes)); + bytes = this.serializer.serialize(new InternalRpcMsg(args, parameterTypes)); } byte[] res; diff --git a/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientSStreamingMethodHandler.java b/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientSStreamingMethodHandler.java index d4e5c0b5..a179b2a4 100644 --- a/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientSStreamingMethodHandler.java +++ b/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientSStreamingMethodHandler.java @@ -5,6 +5,7 @@ import org.hertsstack.core.exception.ServiceNotFoundException; import org.hertsstack.core.exception.StreamResBodyException; import org.hertsstack.core.modelx.HertsMessage; +import org.hertsstack.core.modelx.InternalRpcMsg; import org.hertsstack.serializer.MessageSerializer; import org.hertsstack.core.service.HertsService; @@ -79,7 +80,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl throw new StreamResBodyException("Streaming response observer body data is null"); } - byte[] requestBytes = this.serializer.serialize(new HertsMessage(methodParameters, parameterTypes)); + byte[] requestBytes = this.serializer.serialize(new InternalRpcMsg(methodParameters, parameterTypes)); StreamObserver responseObserver = (StreamObserver) methodObservers.get(0); ClientCalls.asyncServerStreamingCall(getChannel().newCall(methodDescriptor, getCallOptions()), requestBytes, responseObserver); return proxy; diff --git a/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientUMethodHandler.java b/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientUMethodHandler.java index 46225edb..c03aebb8 100644 --- a/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientUMethodHandler.java +++ b/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/HertsRpcClientUMethodHandler.java @@ -6,6 +6,7 @@ import org.hertsstack.core.exception.ServiceNotFoundException; import org.hertsstack.core.modelx.HertsMessage; import org.hertsstack.core.exception.rpc.RpcErrorException; +import org.hertsstack.core.modelx.InternalRpcMsg; import org.hertsstack.serializer.MessageSerializer; import org.hertsstack.core.service.HertsService; @@ -65,7 +66,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl byte[] bytes = new byte[]{}; if (args != null) { Class[] parameterTypes = cachedMethod.getParameterTypes(); - bytes = this.serializer.serialize(new HertsMessage(args, parameterTypes)); + bytes = this.serializer.serialize(new InternalRpcMsg(args, parameterTypes)); } byte[] res; diff --git a/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/InternalReactiveReceiver.java b/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/InternalReactiveReceiver.java index ef8117fd..ebec448c 100644 --- a/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/InternalReactiveReceiver.java +++ b/herts-rpc-client/src/main/java/org/hertsstack/rpcclient/InternalReactiveReceiver.java @@ -7,6 +7,7 @@ import io.grpc.stub.ClientCalls; import io.grpc.stub.StreamObserver; +import org.hertsstack.core.modelx.InternalRpcMsg; import org.hertsstack.serializer.MessageJsonParsingException; import org.hertsstack.core.modelx.HertsMessage; import org.hertsstack.core.context.HertsType; @@ -89,7 +90,7 @@ public void registerReceiver(Class streaming) throws MessageJsonParsingExcept Class[] parameterTypes = new Class[1]; parameterTypes[0] = method.getParameterTypes()[0]; - byte[] requestBytes = this.serializer.serialize(new HertsMessage(methodParameters, parameterTypes)); + byte[] requestBytes = this.serializer.serialize(new InternalRpcMsg(methodParameters, parameterTypes)); ClientCalls.asyncServerStreamingCall(this.channel.newCall(methodDescriptor, this.callOptions), requestBytes, responseObserver); } diff --git a/herts-rpc/build.gradle b/herts-rpc/build.gradle index 84e61be9..6f211029 100644 --- a/herts-rpc/build.gradle +++ b/herts-rpc/build.gradle @@ -6,7 +6,7 @@ plugins { apply plugin: 'application' def pkgName = 'org.hertsstack' -def pkgVersion = '1.1.1' +def pkgVersion = '1.1.2' def javaVersion = project.hasProperty('javaVersion') ? project.getProperty('javaVersion') : '11' def artifactId = 'rpc' diff --git a/herts-rpc/src/main/java/org/hertsstack/rpc/BaseCaller.java b/herts-rpc/src/main/java/org/hertsstack/rpc/BaseCaller.java index da9c202c..ea2d4e5a 100644 --- a/herts-rpc/src/main/java/org/hertsstack/rpc/BaseCaller.java +++ b/herts-rpc/src/main/java/org/hertsstack/rpc/BaseCaller.java @@ -1,6 +1,6 @@ package org.hertsstack.rpc; -import org.hertsstack.core.modelx.HertsMessage; +import org.hertsstack.core.modelx.InternalRpcMsg; import org.hertsstack.serializer.MessageSerializer; import java.io.IOException; @@ -34,7 +34,7 @@ public BaseCaller(Method reflectMethod, MessageSerializer hertsSerializer, Objec */ protected void setMethodRequests(T request) throws IOException { if (((byte[]) request).length > 0) { - HertsMessage deserialized = this.hertsSerializer.deserialize((byte[]) request, HertsMessage.class); + InternalRpcMsg deserialized = this.hertsSerializer.deserialize((byte[]) request, InternalRpcMsg.class); int index = 0; if (deserialized.getMessageParameters() != null) { for (Object obj : deserialized.getMessageParameters()) {