@accelbyte/codegen 0.0.0-dev-20260408102041 → 0.0.0-dev-20260422072053
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 +2 -2
- package/dist/accelbyte-codegen.d.mts +2 -2
- package/dist/accelbyte-codegen.d.ts +2 -2
- package/dist/accelbyte-codegen.js +12 -2
- package/dist/accelbyte-codegen.js.map +1 -1
- package/dist/accelbyte-codegen.mjs +12 -2
- package/dist/accelbyte-codegen.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -133,11 +133,11 @@ export default {
|
|
|
133
133
|
|
|
134
134
|
// Generate barrel index files (index.ts, all-imports.ts, all-query-imports.ts).
|
|
135
135
|
// Default: true
|
|
136
|
-
|
|
136
|
+
shouldProduceIndexFiles: false,
|
|
137
137
|
|
|
138
138
|
// Force specific definitions to emit `z.any()` instead of a full schema.
|
|
139
139
|
// Keyed by definition file name. Value can be `true` or a function receiving the schema.
|
|
140
|
-
|
|
140
|
+
overrideAsAny: {
|
|
141
141
|
ProtobufAny: true,
|
|
142
142
|
SomeOther: (schema) => schema.properties?.['@type'] !== undefined
|
|
143
143
|
},
|
|
@@ -6,12 +6,12 @@ interface CodegenConfigOptions {
|
|
|
6
6
|
* @example
|
|
7
7
|
* { ProtobufAny: true, SomeOther: (schema) => schema.properties?.['@type'] !== undefined }
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
overrideAsAny?: Record<string, boolean | ((schema: Record<string, any>) => boolean)>;
|
|
10
10
|
/**
|
|
11
11
|
* Generate barrel index files (index.ts, all-imports.ts, all-query-imports.ts).
|
|
12
12
|
* @default true
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
shouldProduceIndexFiles?: boolean;
|
|
15
15
|
/**
|
|
16
16
|
* Override the base path prepended to all API routes.
|
|
17
17
|
* @default `basePath` from the swagger spec
|
|
@@ -6,12 +6,12 @@ interface CodegenConfigOptions {
|
|
|
6
6
|
* @example
|
|
7
7
|
* { ProtobufAny: true, SomeOther: (schema) => schema.properties?.['@type'] !== undefined }
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
overrideAsAny?: Record<string, boolean | ((schema: Record<string, any>) => boolean)>;
|
|
10
10
|
/**
|
|
11
11
|
* Generate barrel index files (index.ts, all-imports.ts, all-query-imports.ts).
|
|
12
12
|
* @default true
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
shouldProduceIndexFiles?: boolean;
|
|
15
15
|
/**
|
|
16
16
|
* Override the base path prepended to all API routes.
|
|
17
17
|
* @default `basePath` from the swagger spec
|
|
@@ -109,13 +109,13 @@ var CodegenConfig = class _CodegenConfig {
|
|
|
109
109
|
_CodegenConfig.config = loaded.default ?? loaded ?? {};
|
|
110
110
|
}
|
|
111
111
|
static shouldProduceIndexFiles() {
|
|
112
|
-
return _CodegenConfig.config.
|
|
112
|
+
return _CodegenConfig.config.shouldProduceIndexFiles ?? true;
|
|
113
113
|
}
|
|
114
114
|
static getBasePath() {
|
|
115
115
|
return _CodegenConfig.config.basePath;
|
|
116
116
|
}
|
|
117
117
|
static getOverrideAsAny() {
|
|
118
|
-
return _CodegenConfig.config.
|
|
118
|
+
return _CodegenConfig.config.overrideAsAny;
|
|
119
119
|
}
|
|
120
120
|
static splitOutputByServiceName() {
|
|
121
121
|
return _CodegenConfig.config.unstable_splitOutputByServiceName ?? false;
|
|
@@ -886,6 +886,16 @@ var resolveConflicts = ({ path: path9, generatedMethod, testedGeneratedMethod, e
|
|
|
886
886
|
_testedGenMethod += "_admin";
|
|
887
887
|
}
|
|
888
888
|
}
|
|
889
|
+
try {
|
|
890
|
+
testConflict(path9, _testedGenMethod, existingMethods);
|
|
891
|
+
} catch (e) {
|
|
892
|
+
const parentSegmentMatch = path9.match(/\/([^/{}]+)\/{[^}]+}\/[^/]*$/);
|
|
893
|
+
if (parentSegmentMatch) {
|
|
894
|
+
const suffix = "_By" + import_lodash.default.upperFirst(import_lodash.default.camelCase(parentSegmentMatch[1]));
|
|
895
|
+
generatedMethod += suffix;
|
|
896
|
+
_testedGenMethod += suffix;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
889
899
|
testConflict(path9, _testedGenMethod, existingMethods);
|
|
890
900
|
return generatedMethod;
|
|
891
901
|
};
|