@accelbyte/codegen 0.0.0-dev-20260422072053 → 0.0.0-rc-20260511021900

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/README.md CHANGED
@@ -144,11 +144,11 @@ export default {
144
144
 
145
145
  // Output each swagger set into a subfolder named after its service name.
146
146
  // Default: false
147
- unstable_splitOutputByServiceName: true
147
+ splitOutputByServiceName: true
148
148
  } satisfies CodegenConfigOptions
149
149
  ```
150
150
 
151
- ### `unstable_splitOutputByServiceName`
151
+ ### `splitOutputByServiceName`
152
152
 
153
153
  By default, all swagger sets in `swaggers.json` are generated into the same `--output` directory. When this option is enabled, each set is placed in a subfolder named after its service name (the first element of each inner array).
154
154
 
@@ -183,7 +183,7 @@ Enable via `abcodegen.config.ts`:
183
183
 
184
184
  ```typescript
185
185
  export default {
186
- unstable_splitOutputByServiceName: true
186
+ splitOutputByServiceName: true
187
187
  } satisfies CodegenConfigOptions
188
188
  ```
189
189
 
@@ -25,7 +25,7 @@ interface CodegenConfigOptions {
25
25
  *
26
26
  * @default false
27
27
  */
28
- unstable_splitOutputByServiceName?: boolean;
28
+ splitOutputByServiceName?: boolean;
29
29
  }
30
30
 
31
31
  export type { CodegenConfigOptions };
@@ -25,7 +25,7 @@ interface CodegenConfigOptions {
25
25
  *
26
26
  * @default false
27
27
  */
28
- unstable_splitOutputByServiceName?: boolean;
28
+ splitOutputByServiceName?: boolean;
29
29
  }
30
30
 
31
31
  export type { CodegenConfigOptions };
@@ -118,7 +118,7 @@ var CodegenConfig = class _CodegenConfig {
118
118
  return _CodegenConfig.config.overrideAsAny;
119
119
  }
120
120
  static splitOutputByServiceName() {
121
- return _CodegenConfig.config.unstable_splitOutputByServiceName ?? false;
121
+ return _CodegenConfig.config.splitOutputByServiceName ?? false;
122
122
  }
123
123
  /** Reset to defaults — used for testing */
124
124
  static reset() {
@@ -2053,8 +2053,8 @@ var CodeGenerator = class _CodeGenerator {
2053
2053
 
2054
2054
  // src/SwaggerDownloader.ts
2055
2055
  var fs6 = __toESM(require("fs"));
2056
- var https = __toESM(require("https"));
2057
2056
  var path6 = __toESM(require("path"));
2057
+ var import_axios = __toESM(require("axios"));
2058
2058
  var SwaggerDownloader = class _SwaggerDownloader {
2059
2059
  static getDestFile = (targetFileName) => {
2060
2060
  const destPath = CliParser.getResolvedSwaggersOutputPath();
@@ -2083,27 +2083,14 @@ var SwaggerDownloader = class _SwaggerDownloader {
2083
2083
  };
2084
2084
  static downloadFile = async (targetFileName, url) => {
2085
2085
  const destFile = _SwaggerDownloader.getDestFile(targetFileName);
2086
- let data = "";
2087
- return new Promise((resolve2) => {
2088
- const request = https.get(url, function(response) {
2089
- response.on("data", (chunk) => {
2090
- data += chunk;
2091
- });
2092
- response.on("end", () => {
2093
- if (response.statusCode !== 200) {
2094
- console.log(`SwaggerDownload error with status code: ${response.statusCode}`);
2095
- } else {
2096
- fs6.writeFileSync(destFile, JSON.stringify(JSON.parse(data), null, 2), "utf-8");
2097
- _SwaggerDownloader.postSanitizeDownloadedFile(destFile);
2098
- console.log(`SwaggerDownload ${url} completed with status code: ${response.statusCode}`);
2099
- }
2100
- resolve2(void 0);
2101
- });
2102
- });
2103
- request.on("error", (err) => {
2104
- console.log(`SwaggerDownloader failed for "${targetFileName}" and "${url}"`, err);
2105
- });
2106
- });
2086
+ try {
2087
+ const response = await import_axios.default.get(url);
2088
+ fs6.writeFileSync(destFile, JSON.stringify(response.data, null, 2), "utf-8");
2089
+ _SwaggerDownloader.postSanitizeDownloadedFile(destFile);
2090
+ console.log(`SwaggerDownload ${url} completed with status code: ${response.status}`);
2091
+ } catch (err) {
2092
+ console.log(`SwaggerDownloader failed for "${targetFileName}" and "${url}"`, err);
2093
+ }
2107
2094
  };
2108
2095
  static main = async () => {
2109
2096
  const swaggers = CliParser.getConfigFile();