@arrirpc/codegen-dart 0.72.0 → 0.74.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +4 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +2 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
@@ -404,7 +404,7 @@ function dartClassFromSchema(schema, context) {
|
|
404
404
|
String get ${validDartIdentifier(context.discriminatorKey)} => "${context.discriminatorValue}";
|
405
405
|
`;
|
406
406
|
}
|
407
|
-
result.content = `${getCodeComments(schema.metadata)}class ${finalClassName} implements ${context.discriminatorParentId
|
407
|
+
result.content = `${getCodeComments(schema.metadata)}class ${finalClassName} implements ${context.discriminatorParentId ? `${context.modelPrefix}${context.discriminatorParentId}` : "ArriModel"} {
|
408
408
|
${fieldParts.join("\n")}
|
409
409
|
const ${finalClassName}({
|
410
410
|
${constructorParts.join("\n")}
|
@@ -1129,7 +1129,7 @@ function createDartClient(def, options) {
|
|
1129
1129
|
const typeParts = [];
|
1130
1130
|
const context = {
|
1131
1131
|
clientName: options.clientName ?? "Client",
|
1132
|
-
modelPrefix: options.
|
1132
|
+
modelPrefix: options.typePrefix ?? "",
|
1133
1133
|
generatedTypes: [],
|
1134
1134
|
instancePath: "",
|
1135
1135
|
schemaPath: "",
|
package/dist/index.d.cts
CHANGED
@@ -26,7 +26,10 @@ interface DartProperty {
|
|
26
26
|
interface DartClientGeneratorOptions {
|
27
27
|
outputFile: string;
|
28
28
|
clientName?: string;
|
29
|
-
|
29
|
+
/**
|
30
|
+
* Add a prefix to the generated class names
|
31
|
+
*/
|
32
|
+
typePrefix?: string;
|
30
33
|
format?: boolean;
|
31
34
|
}
|
32
35
|
declare const dartClientGenerator: _arrirpc_codegen_utils.GeneratorPlugin<DartClientGeneratorOptions>;
|
package/dist/index.d.mts
CHANGED
@@ -26,7 +26,10 @@ interface DartProperty {
|
|
26
26
|
interface DartClientGeneratorOptions {
|
27
27
|
outputFile: string;
|
28
28
|
clientName?: string;
|
29
|
-
|
29
|
+
/**
|
30
|
+
* Add a prefix to the generated class names
|
31
|
+
*/
|
32
|
+
typePrefix?: string;
|
30
33
|
format?: boolean;
|
31
34
|
}
|
32
35
|
declare const dartClientGenerator: _arrirpc_codegen_utils.GeneratorPlugin<DartClientGeneratorOptions>;
|
package/dist/index.d.ts
CHANGED
@@ -26,7 +26,10 @@ interface DartProperty {
|
|
26
26
|
interface DartClientGeneratorOptions {
|
27
27
|
outputFile: string;
|
28
28
|
clientName?: string;
|
29
|
-
|
29
|
+
/**
|
30
|
+
* Add a prefix to the generated class names
|
31
|
+
*/
|
32
|
+
typePrefix?: string;
|
30
33
|
format?: boolean;
|
31
34
|
}
|
32
35
|
declare const dartClientGenerator: _arrirpc_codegen_utils.GeneratorPlugin<DartClientGeneratorOptions>;
|
package/dist/index.mjs
CHANGED
@@ -397,7 +397,7 @@ function dartClassFromSchema(schema, context) {
|
|
397
397
|
String get ${validDartIdentifier(context.discriminatorKey)} => "${context.discriminatorValue}";
|
398
398
|
`;
|
399
399
|
}
|
400
|
-
result.content = `${getCodeComments(schema.metadata)}class ${finalClassName} implements ${context.discriminatorParentId
|
400
|
+
result.content = `${getCodeComments(schema.metadata)}class ${finalClassName} implements ${context.discriminatorParentId ? `${context.modelPrefix}${context.discriminatorParentId}` : "ArriModel"} {
|
401
401
|
${fieldParts.join("\n")}
|
402
402
|
const ${finalClassName}({
|
403
403
|
${constructorParts.join("\n")}
|
@@ -1122,7 +1122,7 @@ function createDartClient(def, options) {
|
|
1122
1122
|
const typeParts = [];
|
1123
1123
|
const context = {
|
1124
1124
|
clientName: options.clientName ?? "Client",
|
1125
|
-
modelPrefix: options.
|
1125
|
+
modelPrefix: options.typePrefix ?? "",
|
1126
1126
|
generatedTypes: [],
|
1127
1127
|
instancePath: "",
|
1128
1128
|
schemaPath: "",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arrirpc/codegen-dart",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.74.0",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": {
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"dist"
|
23
23
|
],
|
24
24
|
"dependencies": {
|
25
|
-
"pathe": "^2.0.
|
26
|
-
"@arrirpc/codegen-utils": "0.
|
25
|
+
"pathe": "^2.0.2",
|
26
|
+
"@arrirpc/codegen-utils": "0.74.0"
|
27
27
|
}
|
28
28
|
}
|