@ayasofyazilim/saas 0.0.11 → 0.0.13
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/AccountService/schemas.gen.ts +2853 -67
- package/AccountService/services.gen.ts +28 -28
- package/AccountService/types.gen.ts +7252 -522
- package/AdministrationService/schemas.gen.ts +3664 -73
- package/AdministrationService/services.gen.ts +32 -32
- package/AdministrationService/types.gen.ts +6741 -442
- package/IdentityService/schemas.gen.ts +3506 -76
- package/IdentityService/services.gen.ts +69 -69
- package/IdentityService/types.gen.ts +13238 -892
- package/ProjectService/schemas.gen.ts +2802 -55
- package/ProjectService/services.gen.ts +15 -15
- package/ProjectService/types.gen.ts +3483 -199
- package/SaasService/schemas.gen.ts +3204 -73
- package/SaasService/services.gen.ts +36 -36
- package/SaasService/types.gen.ts +6780 -462
- package/SettingService/SettingServiceClient.ts +53 -0
- package/SettingService/core/ApiError.ts +21 -0
- package/SettingService/core/ApiRequestOptions.ts +13 -0
- package/SettingService/core/ApiResult.ts +7 -0
- package/SettingService/core/BaseHttpRequest.ts +10 -0
- package/SettingService/core/CancelablePromise.ts +126 -0
- package/SettingService/core/FetchHttpRequest.ts +22 -0
- package/SettingService/core/OpenAPI.ts +56 -0
- package/SettingService/core/request.ts +341 -0
- package/SettingService/index.ts +9 -0
- package/SettingService/schemas.gen.ts +1525 -0
- package/SettingService/services.gen.ts +317 -0
- package/SettingService/types.gen.ts +982 -0
- package/generator.mjs +67 -0
- package/package.json +28 -30
package/generator.mjs
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createClient } from '@hey-api/openapi-ts';
|
|
2
|
+
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
|
|
5
|
+
const BASE_URL = "http://192.168.1.105:";
|
|
6
|
+
const WEBGATEWAY_PORT = 44325;
|
|
7
|
+
const api_list = [
|
|
8
|
+
{
|
|
9
|
+
input: 'swagger-json/AuthServer',
|
|
10
|
+
output: 'Account',
|
|
11
|
+
dereference: true
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
input: "",
|
|
15
|
+
output: 'Project',
|
|
16
|
+
port: 45185,
|
|
17
|
+
dereference: true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
input: "swagger-json/Administration",
|
|
21
|
+
output: 'Administration',
|
|
22
|
+
dereference: true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
input: "swagger-json/Identity",
|
|
26
|
+
output: 'Identity',
|
|
27
|
+
dereference: true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
input: "swagger-json/Saas",
|
|
31
|
+
output: 'Saas',
|
|
32
|
+
dereference: true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
input: "",
|
|
36
|
+
output: 'Setting',
|
|
37
|
+
port: 44515,
|
|
38
|
+
dereference: false
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
function clean_URL(url) {
|
|
43
|
+
return url.replace(/\/\//g, '/').replace(/:\//g, '://');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
for (const api of api_list) {
|
|
47
|
+
console.log(`✨ Processing ${api.output}...`);
|
|
48
|
+
const port = api?.port ? api.port : WEBGATEWAY_PORT;
|
|
49
|
+
const apiURL = clean_URL(`${BASE_URL + port}/${api.input}` + "/swagger/v1/swagger.json");
|
|
50
|
+
const swaggerText = await SwaggerParser.dereference(apiURL);
|
|
51
|
+
let temp_swagger = apiURL;
|
|
52
|
+
if (api.dereference) {
|
|
53
|
+
console.log(typeof swaggerText)
|
|
54
|
+
console.log(`🎁 Dereferencing ${api.output} is from ${apiURL} done.`);
|
|
55
|
+
temp_swagger = `temp_${api.output}_swagger.json`;
|
|
56
|
+
fs.writeFileSync(temp_swagger, JSON.stringify(swaggerText));
|
|
57
|
+
}
|
|
58
|
+
await createClient({
|
|
59
|
+
input: temp_swagger,
|
|
60
|
+
output: api.output + "Service",
|
|
61
|
+
name: api.output + "ServiceClient",
|
|
62
|
+
client: "fetch"
|
|
63
|
+
});
|
|
64
|
+
if (api.dereference)
|
|
65
|
+
fs.unlinkSync(temp_swagger);
|
|
66
|
+
console.log(`✅ Generating ${api.output} is done.`);
|
|
67
|
+
}
|
package/package.json
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ayasofyazilim/saas",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Ayasofyazılım SAAS",
|
|
5
|
-
"exports": {
|
|
6
|
-
"./AccountService": "./AccountService/index.ts",
|
|
7
|
-
"./ProjectService": "./ProjectService/index.ts",
|
|
8
|
-
"./AdministrationService": "./AdministrationService/index.ts",
|
|
9
|
-
"./IdentityService": "./IdentityService/index.ts",
|
|
10
|
-
"./SaasService": "./SaasService/index.ts"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"gen:
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@ayasofyazilim/saas",
|
|
3
|
+
"version": "0.0.13",
|
|
4
|
+
"description": "Ayasofyazılım SAAS",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./AccountService": "./AccountService/index.ts",
|
|
7
|
+
"./ProjectService": "./ProjectService/index.ts",
|
|
8
|
+
"./AdministrationService": "./AdministrationService/index.ts",
|
|
9
|
+
"./IdentityService": "./IdentityService/index.ts",
|
|
10
|
+
"./SaasService": "./SaasService/index.ts",
|
|
11
|
+
"./SettingService": "./SettingService/index.ts"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"gen:all": "node generator.mjs",
|
|
15
|
+
"init-release": "publish --access public",
|
|
16
|
+
"release": "release-it"
|
|
17
|
+
},
|
|
18
|
+
"author": "",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"release-it": "^17.1.1"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@apidevtools/swagger-parser": "^10.1.0",
|
|
25
|
+
"@hey-api/openapi-ts": "0.45.1",
|
|
26
|
+
"typescript": "^5.4.5"
|
|
27
|
+
}
|
|
28
|
+
}
|