@arrirpc/codegen-ts 0.74.0 → 0.75.0
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/dist/index.cjs +4 -10
- package/dist/index.mjs +5 -11
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -915,8 +915,8 @@ function tsRpcFromDefinition(def, context) {
|
|
|
915
915
|
}
|
|
916
916
|
function httpRpcFromDefinition(def, context) {
|
|
917
917
|
const key = getRpcKey(context);
|
|
918
|
-
const params = def.params ? `${context.typePrefix}${codegenUtils.pascalCase(validVarName(def.params))}` :
|
|
919
|
-
const response = def.response ? `${context.typePrefix}${codegenUtils.pascalCase(validVarName(def.response), { normalize: true })}` :
|
|
918
|
+
const params = def.params ? `${context.typePrefix}${codegenUtils.pascalCase(validVarName(def.params))}` : void 0;
|
|
919
|
+
const response = def.response ? `${context.typePrefix}${codegenUtils.pascalCase(validVarName(def.response), { normalize: true })}` : void 0;
|
|
920
920
|
const serializerMethod = def.method === "get" ? "toUrlQueryString" : "toJsonString";
|
|
921
921
|
if (def.isEventStream) {
|
|
922
922
|
context.usedFeatures.sse = true;
|
|
@@ -960,8 +960,8 @@ function httpRpcFromDefinition(def, context) {
|
|
|
960
960
|
function wsRpcFromDefinition(def, context) {
|
|
961
961
|
context.usedFeatures.ws = true;
|
|
962
962
|
const key = getRpcKey(context);
|
|
963
|
-
const params = def.params ? `${context.typePrefix}${codegenUtils.pascalCase(validVarName(def.params))}` :
|
|
964
|
-
const response = def.response ? `${context.typePrefix}${codegenUtils.pascalCase(validVarName(def.response), { normalize: true })}` :
|
|
963
|
+
const params = def.params ? `${context.typePrefix}${codegenUtils.pascalCase(validVarName(def.params))}` : void 0;
|
|
964
|
+
const response = def.response ? `${context.typePrefix}${codegenUtils.pascalCase(validVarName(def.response), { normalize: true })}` : void 0;
|
|
965
965
|
return `${getJsDocComment({
|
|
966
966
|
description: def.description,
|
|
967
967
|
isDeprecated: def.isDeprecated
|
|
@@ -1000,9 +1000,6 @@ function tsServiceFromDefinition(def, context) {
|
|
|
1000
1000
|
generatedTypes: context.generatedTypes,
|
|
1001
1001
|
instancePath: `${context.instancePath}.${key2}`,
|
|
1002
1002
|
schemaPath: `${context.instancePath}.${key2}`,
|
|
1003
|
-
discriminatorParent: "",
|
|
1004
|
-
discriminatorKey: "",
|
|
1005
|
-
discriminatorValue: "",
|
|
1006
1003
|
versionNumber: context.versionNumber,
|
|
1007
1004
|
usedFeatures: context.usedFeatures,
|
|
1008
1005
|
rpcGenerators: context.rpcGenerators
|
|
@@ -1110,9 +1107,6 @@ async function createTypescriptClient(def, options) {
|
|
|
1110
1107
|
generatedTypes: [],
|
|
1111
1108
|
instancePath: "",
|
|
1112
1109
|
schemaPath: "",
|
|
1113
|
-
discriminatorParent: "",
|
|
1114
|
-
discriminatorKey: "",
|
|
1115
|
-
discriminatorValue: "",
|
|
1116
1110
|
versionNumber: def.info?.version ?? "",
|
|
1117
1111
|
usedFeatures: {
|
|
1118
1112
|
sse: false,
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { stringStartsWithNumber, removeDisallowedChars,
|
|
1
|
+
import { pascalCase, stringStartsWithNumber, removeDisallowedChars, camelCase, isServiceDefinition, isRpcDefinition, defineGeneratorPlugin, unflattenProcedures, isSchemaFormType, isSchemaFormEnum, isSchemaFormProperties, isSchemaFormElements, isSchemaFormValues, isSchemaFormDiscriminator, isSchemaFormRef } from '@arrirpc/codegen-utils';
|
|
2
2
|
import { writeFileSync } from 'fs';
|
|
3
3
|
import prettier from 'prettier';
|
|
4
4
|
|
|
@@ -909,8 +909,8 @@ function tsRpcFromDefinition(def, context) {
|
|
|
909
909
|
}
|
|
910
910
|
function httpRpcFromDefinition(def, context) {
|
|
911
911
|
const key = getRpcKey(context);
|
|
912
|
-
const params = def.params ? `${context.typePrefix}${pascalCase(validVarName(def.params))}` :
|
|
913
|
-
const response = def.response ? `${context.typePrefix}${pascalCase(validVarName(def.response), { normalize: true })}` :
|
|
912
|
+
const params = def.params ? `${context.typePrefix}${pascalCase(validVarName(def.params))}` : void 0;
|
|
913
|
+
const response = def.response ? `${context.typePrefix}${pascalCase(validVarName(def.response), { normalize: true })}` : void 0;
|
|
914
914
|
const serializerMethod = def.method === "get" ? "toUrlQueryString" : "toJsonString";
|
|
915
915
|
if (def.isEventStream) {
|
|
916
916
|
context.usedFeatures.sse = true;
|
|
@@ -954,8 +954,8 @@ function httpRpcFromDefinition(def, context) {
|
|
|
954
954
|
function wsRpcFromDefinition(def, context) {
|
|
955
955
|
context.usedFeatures.ws = true;
|
|
956
956
|
const key = getRpcKey(context);
|
|
957
|
-
const params = def.params ? `${context.typePrefix}${pascalCase(validVarName(def.params))}` :
|
|
958
|
-
const response = def.response ? `${context.typePrefix}${pascalCase(validVarName(def.response), { normalize: true })}` :
|
|
957
|
+
const params = def.params ? `${context.typePrefix}${pascalCase(validVarName(def.params))}` : void 0;
|
|
958
|
+
const response = def.response ? `${context.typePrefix}${pascalCase(validVarName(def.response), { normalize: true })}` : void 0;
|
|
959
959
|
return `${getJsDocComment({
|
|
960
960
|
description: def.description,
|
|
961
961
|
isDeprecated: def.isDeprecated
|
|
@@ -994,9 +994,6 @@ function tsServiceFromDefinition(def, context) {
|
|
|
994
994
|
generatedTypes: context.generatedTypes,
|
|
995
995
|
instancePath: `${context.instancePath}.${key2}`,
|
|
996
996
|
schemaPath: `${context.instancePath}.${key2}`,
|
|
997
|
-
discriminatorParent: "",
|
|
998
|
-
discriminatorKey: "",
|
|
999
|
-
discriminatorValue: "",
|
|
1000
997
|
versionNumber: context.versionNumber,
|
|
1001
998
|
usedFeatures: context.usedFeatures,
|
|
1002
999
|
rpcGenerators: context.rpcGenerators
|
|
@@ -1104,9 +1101,6 @@ async function createTypescriptClient(def, options) {
|
|
|
1104
1101
|
generatedTypes: [],
|
|
1105
1102
|
instancePath: "",
|
|
1106
1103
|
schemaPath: "",
|
|
1107
|
-
discriminatorParent: "",
|
|
1108
|
-
discriminatorKey: "",
|
|
1109
|
-
discriminatorValue: "",
|
|
1110
1104
|
versionNumber: def.info?.version ?? "",
|
|
1111
1105
|
usedFeatures: {
|
|
1112
1106
|
sse: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arrirpc/codegen-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.75.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
|
-
"prettier": "^3.
|
|
26
|
-
"@arrirpc/codegen-utils": "0.
|
|
25
|
+
"prettier": "^3.5.1",
|
|
26
|
+
"@arrirpc/codegen-utils": "0.75.0"
|
|
27
27
|
}
|
|
28
28
|
}
|