@ayasofyazilim/saas 0.0.39 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LocationService/LocationServiceClient.ts +110 -0
- package/LocationService/core/ApiError.ts +21 -0
- package/LocationService/core/ApiRequestOptions.ts +13 -0
- package/LocationService/core/ApiResult.ts +7 -0
- package/LocationService/core/BaseHttpRequest.ts +10 -0
- package/LocationService/core/CancelablePromise.ts +126 -0
- package/LocationService/core/FetchHttpRequest.ts +22 -0
- package/LocationService/core/OpenAPI.ts +56 -0
- package/LocationService/core/request.ts +341 -0
- package/LocationService/index.ts +9 -0
- package/LocationService/schemas.gen.ts +10137 -0
- package/LocationService/services.gen.ts +3393 -0
- package/LocationService/types.gen.ts +6508 -0
- package/generator.mjs +11 -9
- package/package.json +1 -1
package/generator.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#! /usr/bin/env node
|
|
1
|
+
#! /usr/bin/env node
|
|
2
2
|
import { createClient } from "@hey-api/openapi-ts";
|
|
3
3
|
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
4
4
|
import fs from "fs";
|
|
@@ -47,21 +47,30 @@ var initial_api_list = [
|
|
|
47
47
|
{
|
|
48
48
|
input: "swagger-json/Setting",
|
|
49
49
|
output: "Setting",
|
|
50
|
+
port: 44335,
|
|
50
51
|
dereference: true,
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
input: "swagger-json/CRM",
|
|
54
55
|
output: "CRM",
|
|
56
|
+
port: 44335,
|
|
55
57
|
dereference: true,
|
|
56
58
|
},
|
|
57
59
|
{
|
|
58
60
|
input: "swagger-json/Contract",
|
|
59
61
|
output: "Contract",
|
|
62
|
+
port: 44335,
|
|
60
63
|
dereference: true,
|
|
61
64
|
},
|
|
62
65
|
{
|
|
63
66
|
input: "swagger-json/Traveller",
|
|
64
67
|
output: "Traveller",
|
|
68
|
+
port: 44335,
|
|
69
|
+
dereference: true,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
input: "swagger-json/Location",
|
|
73
|
+
output: "Location",
|
|
65
74
|
dereference: true,
|
|
66
75
|
},
|
|
67
76
|
];
|
|
@@ -99,6 +108,7 @@ async function generateApi(api_list) {
|
|
|
99
108
|
const swaggerText = await SwaggerParser.dereference(apiURL);
|
|
100
109
|
let temp_swagger = apiURL;
|
|
101
110
|
if (api.dereference) {
|
|
111
|
+
console.log(typeof swaggerText);
|
|
102
112
|
console.log(`🎁 Dereferencing ${api.output} is from ${apiURL} done.`);
|
|
103
113
|
temp_swagger = `temp_${api.output}_swagger.json`;
|
|
104
114
|
fs.writeFileSync(
|
|
@@ -133,14 +143,6 @@ async function generateApi(api_list) {
|
|
|
133
143
|
`\nexport * from './schemas.gen';`,
|
|
134
144
|
{ flag: "a" },
|
|
135
145
|
);
|
|
136
|
-
|
|
137
|
-
const data = fs.readFileSync(
|
|
138
|
-
`${api.output}Service/schemas.gen.ts`, { encoding: 'utf8', flag: 'r' });
|
|
139
|
-
var result = data.replaceAll('as const ', '');
|
|
140
|
-
fs.writeFile(`${api.output}Service/schemas.gen.ts`, result, 'utf8', function (err) {
|
|
141
|
-
if (err) return console.log(err);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
146
|
} else {
|
|
145
147
|
await createClient({
|
|
146
148
|
input: temp_swagger,
|