@ayasofyazilim/saas 0.0.12 → 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/generator.mjs CHANGED
@@ -7,34 +7,35 @@ const WEBGATEWAY_PORT = 44325;
7
7
  const api_list = [
8
8
  {
9
9
  input: 'swagger-json/AuthServer',
10
- output: 'AccountService',
11
- name: 'AccountServiceClient',
12
- client: 'fetch'
10
+ output: 'Account',
11
+ dereference: true
13
12
  },
14
13
  {
15
14
  input: "",
16
- output: 'ProjectService',
17
- name: 'ProjectServiceClient',
18
- client: 'fetch',
19
- port: 45185
15
+ output: 'Project',
16
+ port: 45185,
17
+ dereference: true
20
18
  },
21
19
  {
22
20
  input: "swagger-json/Administration",
23
- output: 'AdministrationService',
24
- name: 'AdministrationServiceClient',
25
- client: 'fetch'
21
+ output: 'Administration',
22
+ dereference: true
26
23
  },
27
24
  {
28
25
  input: "swagger-json/Identity",
29
- output: 'IdentityService',
30
- name: 'IdentityServiceClient',
31
- client: 'fetch'
26
+ output: 'Identity',
27
+ dereference: true
32
28
  },
33
29
  {
34
30
  input: "swagger-json/Saas",
35
- output: 'SaasService',
36
- name: 'SaasServiceClient',
37
- client: 'fetch'
31
+ output: 'Saas',
32
+ dereference: true
33
+ },
34
+ {
35
+ input: "",
36
+ output: 'Setting',
37
+ port: 44515,
38
+ dereference: false
38
39
  }
39
40
  ]
40
41
 
@@ -43,19 +44,24 @@ function clean_URL(url) {
43
44
  }
44
45
 
45
46
  for (const api of api_list) {
46
- console.log(`✨ Processing ${api.name}...`);
47
+ console.log(`✨ Processing ${api.output}...`);
47
48
  const port = api?.port ? api.port : WEBGATEWAY_PORT;
48
49
  const apiURL = clean_URL(`${BASE_URL + port}/${api.input}` + "/swagger/v1/swagger.json");
49
50
  const swaggerText = await SwaggerParser.dereference(apiURL);
50
- console.log(`✨ Dereferencing ${api.name} is done.`);
51
- const temp_swagger = `temp_${api.name}_swagger.json`;
52
- fs.writeFileSync(temp_swagger, JSON.stringify(swaggerText));
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
+ }
53
58
  await createClient({
54
59
  input: temp_swagger,
55
- output: api.output,
56
- name: api.name,
57
- client: api.client
60
+ output: api.output + "Service",
61
+ name: api.output + "ServiceClient",
62
+ client: "fetch"
58
63
  });
59
- fs.unlinkSync(temp_swagger);
60
- console.log(`✨ Generating ${api.name} is done.`);
64
+ if (api.dereference)
65
+ fs.unlinkSync(temp_swagger);
66
+ console.log(`✅ Generating ${api.output} is done.`);
61
67
  }
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@ayasofyazilim/saas",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Ayasofyazılım SAAS",
5
5
  "exports": {
6
6
  "./AccountService": "./AccountService/index.ts",
7
7
  "./ProjectService": "./ProjectService/index.ts",
8
8
  "./AdministrationService": "./AdministrationService/index.ts",
9
9
  "./IdentityService": "./IdentityService/index.ts",
10
- "./SaasService": "./SaasService/index.ts"
10
+ "./SaasService": "./SaasService/index.ts",
11
+ "./SettingService": "./SettingService/index.ts"
11
12
  },
12
13
  "scripts": {
13
14
  "gen:all": "node generator.mjs",