@globalart/zod-to-proto 1.0.1 → 1.0.2
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.d.mts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -0
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -25,4 +25,5 @@ declare class UnsupportedTypeException extends Error {
|
|
|
25
25
|
//#region src/zod-to-protobuf.d.ts
|
|
26
26
|
declare const zodToProtobuf: (schema?: ZodTypeAny, options?: ZodToProtobufOptions) => string;
|
|
27
27
|
//#endregion
|
|
28
|
-
export { type ServiceDefinition, type ServiceMethod, UnsupportedTypeException, type ZodToProtobufOptions, zodToProtobuf };
|
|
28
|
+
export { type ServiceDefinition, type ServiceMethod, UnsupportedTypeException, type ZodToProtobufOptions, zodToProtobuf };
|
|
29
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["tupleFields: ProtobufField[]"],"sources":["../src/types.ts","../src/utils.ts","../src/traversers.ts","../src/service-generator.ts","../src/zod-to-protobuf.ts"],"sourcesContent":["import type { ZodTypeAny } from 'zod'\n\nexport interface ZodToProtobufOptions {\n\tpackageName?: string\n\trootMessageName?: string\n\ttypePrefix?: string\n\tservices?: ServiceDefinition[]\n\tskipRootMessage?: boolean\n}\n\nexport interface ServiceMethod {\n\tname: string\n\trequest: ZodTypeAny\n\tresponse: ZodTypeAny\n\tstreaming?: 'client' | 'server' | 'bidirectional'\n}\n\nexport interface ServiceDefinition {\n\tname: string\n\tmethods: ServiceMethod[]\n}\n\nexport class UnsupportedTypeException extends Error {\n\tconstructor(type: string) {\n\t\tsuper(`Unsupported type: ${type}`)\n\t\tthis.name = 'UnsupportedTypeException'\n\t}\n}\n\nexport interface ProtobufField {\n\ttypes: Array<string | null>\n\tname: string\n}\n\n","import { ZodNumber } from 'zod'\nimport type { ProtobufField } from './types'\n\nexport const getNumberTypeName = ({ value }: { value: ZodNumber }): string => {\n\treturn value.isInt ? 'int32' : 'double'\n}\n\nexport const toPascalCase = ({ value }: { value: string }): string => {\n\treturn value\n\t\t.split('.')\n\t\t.map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n\t\t.join('')\n}\n\nexport const protobufFieldToType = ({ field }: { field: ProtobufField }): string => {\n\treturn field.types.filter(Boolean).join(' ')\n}\n\n","import * as inflection from 'inflection'\nimport {\n\tZodArray,\n\tZodBigInt,\n\tZodBoolean,\n\tZodDate,\n\tZodEnum,\n\tZodMap,\n\tZodNullable,\n\tZodNumber,\n\tZodObject,\n\tZodOptional,\n\tZodSet,\n\tZodString,\n\tZodTuple,\n\tZodType,\n\ttype ZodTypeAny\n} from 'zod'\nimport { UnsupportedTypeException, type ProtobufField } from './types'\nimport { getNumberTypeName, toPascalCase, protobufFieldToType } from './utils'\n\nexport const traverseArray = ({\n\tkey,\n\tvalue,\n\tmessages,\n\tenums,\n\ttypePrefix\n}: {\n\tkey: string\n\tvalue: ZodArray<ZodTypeAny> | ZodSet<ZodTypeAny>\n\tmessages: Map<string, string[]>\n\tenums: Map<string, string[]>\n\ttypePrefix: string | null\n}): ProtobufField[] => {\n\tconst nestedValue =\n\t\tvalue instanceof ZodArray\n\t\t\t? value.element\n\t\t\t: value instanceof ZodSet\n\t\t\t\t? (value._def as { valueType: ZodTypeAny }).valueType\n\t\t\t\t: // @ts-expect-error\n\t\t\t\t\t(value._def as { element?: ZodTypeAny }).element\n\n\tconst singularKey = inflection.singularize(key)\n\tconst elementFields = traverseKey({\n\t\tkey: singularKey,\n\t\tvalue: nestedValue,\n\t\tmessages,\n\t\tenums,\n\t\tisOptional: false,\n\t\tisInArray: true,\n\t\ttypePrefix\n\t})\n\treturn elementFields.map((field) => ({\n\t\t...field,\n\t\ttypes: ['repeated', ...field.types],\n\t\tname: field.name.replace(singularKey, key)\n\t}))\n}\n\nexport const traverseMap = ({\n\tkey,\n\tvalue,\n\tmessages,\n\tenums,\n\ttypePrefix\n}: {\n\tkey: string\n\tvalue: ZodMap<ZodTypeAny, ZodTypeAny>\n\tmessages: Map<string, string[]>\n\tenums: Map<string, string[]>\n\ttypePrefix: string | null\n}): ProtobufField[] => {\n\tconst keyType = traverseKey({\n\t\tkey: `${key}Key`,\n\t\tvalue: value._def.keyType,\n\t\tmessages,\n\t\tenums,\n\t\tisOptional: false,\n\t\tisInArray: true,\n\t\ttypePrefix\n\t})\n\tconst valueType = traverseKey({\n\t\tkey: `${key}Value`,\n\t\tvalue: value._def.valueType,\n\t\tmessages,\n\t\tenums,\n\t\tisOptional: false,\n\t\tisInArray: true,\n\t\ttypePrefix\n\t})\n\n\tif (!keyType[0] || keyType.length !== 1) {\n\t\tthrow new UnsupportedTypeException(`${key} map key`)\n\t}\n\n\tif (!valueType[0] || valueType.length !== 1) {\n\t\tthrow new UnsupportedTypeException(`${key} map value`)\n\t}\n\n\tconst mapType = `map<${protobufFieldToType({ field: keyType[0] })}, ${protobufFieldToType({ field: valueType[0] })}>`\n\treturn [\n\t\t{\n\t\t\ttypes: [mapType],\n\t\t\tname: key\n\t\t}\n\t]\n}\n\nexport const traverseKey = ({\n\tkey,\n\tvalue,\n\tmessages,\n\tenums,\n\tisOptional,\n\tisInArray,\n\ttypePrefix\n}: {\n\tkey: string\n\tvalue: unknown\n\tmessages: Map<string, string[]>\n\tenums: Map<string, string[]>\n\tisOptional: boolean\n\tisInArray: boolean\n\ttypePrefix: string | null\n}): ProtobufField[] => {\n\tif (value instanceof ZodOptional || value instanceof ZodNullable) {\n\t\treturn traverseKey({\n\t\t\tkey,\n\t\t\tvalue: value.unwrap(),\n\t\t\tmessages,\n\t\t\tenums,\n\t\t\tisOptional: true,\n\t\t\tisInArray,\n\t\t\ttypePrefix\n\t\t})\n\t}\n\n\tif (value instanceof ZodArray || value instanceof ZodSet) {\n\t\treturn traverseArray({\n\t\t\tkey,\n\t\t\tvalue: value as ZodArray<ZodTypeAny> | ZodSet<ZodTypeAny>,\n\t\t\tmessages,\n\t\t\tenums,\n\t\t\ttypePrefix\n\t\t})\n\t}\n\n\tif (value instanceof ZodMap) {\n\t\treturn traverseMap({\n\t\t\tkey,\n\t\t\tvalue: value as ZodMap<ZodTypeAny, ZodTypeAny>,\n\t\t\tmessages,\n\t\t\tenums,\n\t\t\ttypePrefix\n\t\t})\n\t}\n\n\tconst optional = isOptional && !isInArray ? 'optional' : null\n\n\tif (value instanceof ZodObject) {\n\t\tlet messageName = toPascalCase({ value: key })\n\t\tif (typePrefix) {\n\t\t\tmessageName = `${typePrefix}${messageName}`\n\t\t}\n\t\tconst nestedMessageFields = traverseSchema({\n\t\t\tschema: value,\n\t\t\tmessages,\n\t\t\tenums,\n\t\t\ttypePrefix\n\t\t})\n\t\tmessages.set(messageName, nestedMessageFields)\n\t\treturn [\n\t\t\t{\n\t\t\t\ttypes: [optional, messageName],\n\t\t\t\tname: key\n\t\t\t}\n\t\t]\n\t}\n\n\tif (value instanceof ZodString) {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttypes: [optional, 'string'],\n\t\t\t\tname: key\n\t\t\t}\n\t\t]\n\t}\n\n\tif (value instanceof ZodNumber) {\n\t\tconst typeName = getNumberTypeName({ value })\n\t\treturn [\n\t\t\t{\n\t\t\t\ttypes: [optional, typeName],\n\t\t\t\tname: key\n\t\t\t}\n\t\t]\n\t}\n\n\tif (value instanceof ZodBoolean) {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttypes: [optional, 'bool'],\n\t\t\t\tname: key\n\t\t\t}\n\t\t]\n\t}\n\n\tif (value instanceof ZodEnum) {\n\t\tconst enumFields = value.options\n\t\t\t.map(\n\t\t\t\t(option: string | number, index: number) =>\n\t\t\t\t\t` ${String(option)} = ${index};`\n\t\t\t)\n\t\t\t.join('\\n')\n\t\tlet enumName = toPascalCase({ value: key })\n\t\tif (typePrefix) {\n\t\t\tenumName = `${typePrefix}${enumName}`\n\t\t}\n\t\tenums.set(enumName, [`enum ${enumName} {\\n${enumFields}\\n}`])\n\t\treturn [\n\t\t\t{\n\t\t\t\ttypes: [optional, enumName],\n\t\t\t\tname: key\n\t\t\t}\n\t\t]\n\t}\n\n\tif (value instanceof ZodDate) {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttypes: [optional, 'string'],\n\t\t\t\tname: key\n\t\t\t}\n\t\t]\n\t}\n\n\tif (value instanceof ZodBigInt) {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttypes: [optional, 'int64'],\n\t\t\t\tname: key\n\t\t\t}\n\t\t]\n\t}\n\n\tif (value instanceof ZodTuple) {\n\t\tconst tupleFields: ProtobufField[] = (\n\t\t\tvalue._def.items as ZodTypeAny[]\n\t\t).flatMap((item: ZodTypeAny, index: number) => {\n\t\t\treturn traverseKey({\n\t\t\t\tkey: `${key}_${index}`,\n\t\t\t\tvalue: item,\n\t\t\t\tmessages,\n\t\t\t\tenums,\n\t\t\t\tisOptional: false,\n\t\t\t\tisInArray,\n\t\t\t\ttypePrefix\n\t\t\t})\n\t\t})\n\n\t\tconst tupleMessageName = toPascalCase({ value: key })\n\t\tmessages.set(\n\t\t\ttupleMessageName,\n\t\t\ttupleFields.map(\n\t\t\t\t(field, index) =>\n\t\t\t\t\t` ${field.types.join(' ')} ${field.name} = ${index + 1};`\n\t\t\t)\n\t\t)\n\t\treturn [\n\t\t\t{\n\t\t\t\ttypes: [optional, tupleMessageName],\n\t\t\t\tname: key\n\t\t\t}\n\t\t]\n\t}\n\n\tif (value instanceof ZodType) {\n\t\tthrow new UnsupportedTypeException(value.constructor.name)\n\t}\n\n\tthrow new UnsupportedTypeException(typeof value)\n}\n\nexport const traverseSchema = ({\n\tschema,\n\tmessages,\n\tenums,\n\ttypePrefix\n}: {\n\tschema: ZodTypeAny\n\tmessages: Map<string, string[]>\n\tenums: Map<string, string[]>\n\ttypePrefix: string | null\n}): string[] => {\n\tif (!(schema instanceof ZodObject)) {\n\t\tthrow new UnsupportedTypeException(schema.constructor.name)\n\t}\n\n\tconst fields = Object.entries(schema.shape).flatMap(([key, value]) => {\n\t\treturn traverseKey({\n\t\t\tkey,\n\t\t\tvalue,\n\t\t\tmessages,\n\t\t\tenums,\n\t\t\tisOptional: false,\n\t\t\tisInArray: false,\n\t\t\ttypePrefix\n\t\t})\n\t})\n\n\treturn fields.map(\n\t\t(field, index) =>\n\t\t\t`${protobufFieldToType({ field })} ${field.name} = ${index + 1};`\n\t)\n}\n\n","import type { ZodTypeAny } from 'zod'\nimport type { ServiceDefinition, ServiceMethod } from './types'\nimport { toPascalCase } from './utils'\nimport { traverseSchema } from './traversers'\n\ninterface ServiceGenerationContext {\n\tmessages: Map<string, string[]>\n\tenums: Map<string, string[]>\n\ttypePrefix: string | null\n}\n\nconst generateRequestMessageName = (methodName: string, typePrefix: string | null): string => {\n\tconst messageName = toPascalCase({ value: `${methodName}Request` })\n\treturn typePrefix ? `${typePrefix}${messageName}` : messageName\n}\n\nconst generateResponseMessageName = (methodName: string, typePrefix: string | null): string => {\n\tconst messageName = toPascalCase({ value: `${methodName}Response` })\n\treturn typePrefix ? `${typePrefix}${messageName}` : messageName\n}\n\nconst processServiceMethod = (\n\tmethod: ServiceMethod,\n\tcontext: ServiceGenerationContext\n): { requestName: string; responseName: string } => {\n\tconst { messages, enums, typePrefix } = context\n\n\tconst requestName = generateRequestMessageName(method.name, typePrefix)\n\tconst responseName = generateResponseMessageName(method.name, typePrefix)\n\n\tif (!messages.has(requestName)) {\n\t\tconst requestFields = traverseSchema({\n\t\t\tschema: method.request,\n\t\t\tmessages,\n\t\t\tenums,\n\t\t\ttypePrefix\n\t\t})\n\t\tmessages.set(requestName, requestFields)\n\t}\n\n\tif (!messages.has(responseName)) {\n\t\tconst responseFields = traverseSchema({\n\t\t\tschema: method.response,\n\t\t\tmessages,\n\t\t\tenums,\n\t\t\ttypePrefix\n\t\t})\n\t\tmessages.set(responseName, responseFields)\n\t}\n\n\treturn { requestName, responseName }\n}\n\nexport const generateServices = (\n\tservices: ServiceDefinition[],\n\tcontext: ServiceGenerationContext\n): string[] => {\n\treturn services.map((service) => {\n\t\tconst methods = service.methods.map((method) => {\n\t\t\tconst { requestName, responseName } = processServiceMethod(method, context)\n\n\t\t\tconst requestStreaming = method.streaming === 'client' || method.streaming === 'bidirectional'\n\t\t\tconst responseStreaming = method.streaming === 'server' || method.streaming === 'bidirectional'\n\n\t\t\tconst requestType = requestStreaming ? `stream ${requestName}` : requestName\n\t\t\tconst responseType = responseStreaming ? `stream ${responseName}` : responseName\n\n\t\t\treturn ` rpc ${method.name}(${requestType}) returns (${responseType});`\n\t\t})\n\n\t\treturn `service ${service.name} {\\n${methods.join('\\n')}\\n}`\n\t})\n}\n\n","import type { ZodTypeAny } from \"zod\";\nimport type { ZodToProtobufOptions } from \"./types\";\nimport { traverseSchema } from \"./traversers\";\nimport { generateServices } from \"./service-generator\";\n\nexport const zodToProtobuf = (\n schema?: ZodTypeAny,\n options: ZodToProtobufOptions = {}\n): string => {\n const {\n packageName = \"default\",\n rootMessageName = \"Message\",\n typePrefix = \"\",\n services = [],\n skipRootMessage = false,\n } = options;\n\n const messages = new Map<string, string[]>();\n const enums = new Map<string, string[]>();\n\n if (schema && !skipRootMessage) {\n const fields = traverseSchema({ schema, messages, enums, typePrefix });\n if (fields.length > 0) {\n const rootMessageKey = `${typePrefix}${rootMessageName}`;\n messages.set(rootMessageKey, fields);\n }\n }\n\n const context = {\n messages,\n enums,\n typePrefix: typePrefix || null,\n };\n\n if (services.length > 0) {\n generateServices(services, context);\n }\n\n const enumsString = Array.from(enums.values()).map((enumDef) =>\n enumDef.join(\"\\n\")\n );\n\n const messagesString = Array.from(messages.entries()).map(\n ([name, fields]) =>\n `message ${name} {\\n${fields.map((field) => ` ${field}`).join(\"\\n\")}\\n}`\n );\n\n const servicesString =\n services.length > 0 ? generateServices(services, context) : [];\n\n const content = [enumsString, messagesString, servicesString]\n .filter((strings) => !!strings.length)\n .map((strings) => strings.join(\"\\n\\n\"))\n .join(\"\\n\\n\");\n\n const protoDefinition = `\nsyntax = \"proto3\";\npackage ${packageName};\n\n${content}\n`;\n\n return protoDefinition.trim();\n};\n"],"mappings":";;;;AAsBA,IAAa,2BAAb,cAA8C,MAAM;CACnD,YAAY,MAAc;AACzB,QAAM,qBAAqB,OAAO;AAClC,OAAK,OAAO;;;;;;ACtBd,MAAa,qBAAqB,EAAE,YAA0C;AAC7E,QAAO,MAAM,QAAQ,UAAU;;AAGhC,MAAa,gBAAgB,EAAE,YAAuC;AACrE,QAAO,MACL,MAAM,IAAI,CACV,KAAK,SAAS,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,CAC3D,KAAK,GAAG;;AAGX,MAAa,uBAAuB,EAAE,YAA8C;AACnF,QAAO,MAAM,MAAM,OAAO,QAAQ,CAAC,KAAK,IAAI;;;;;ACM7C,MAAa,iBAAiB,EAC7B,KACA,OACA,UACA,OACA,iBAOsB;CACtB,MAAM,cACL,iBAAiB,WACd,MAAM,UACN,iBAAiB,SACf,MAAM,KAAmC,YAE1C,MAAM,KAAkC;CAE7C,MAAM,cAAc,WAAW,YAAY,IAAI;AAU/C,QATsB,YAAY;EACjC,KAAK;EACL,OAAO;EACP;EACA;EACA,YAAY;EACZ,WAAW;EACX;EACA,CAAC,CACmB,KAAK,WAAW;EACpC,GAAG;EACH,OAAO,CAAC,YAAY,GAAG,MAAM,MAAM;EACnC,MAAM,MAAM,KAAK,QAAQ,aAAa,IAAI;EAC1C,EAAE;;AAGJ,MAAa,eAAe,EAC3B,KACA,OACA,UACA,OACA,iBAOsB;CACtB,MAAM,UAAU,YAAY;EAC3B,KAAK,GAAG,IAAI;EACZ,OAAO,MAAM,KAAK;EAClB;EACA;EACA,YAAY;EACZ,WAAW;EACX;EACA,CAAC;CACF,MAAM,YAAY,YAAY;EAC7B,KAAK,GAAG,IAAI;EACZ,OAAO,MAAM,KAAK;EAClB;EACA;EACA,YAAY;EACZ,WAAW;EACX;EACA,CAAC;AAEF,KAAI,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CAMP;EAGe,MAAM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@globalart/zod-to-proto",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "GlobalArt, Inc"
|
|
6
6
|
},
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"publish:dev": "npm publish --access public --tag dev",
|
|
30
30
|
"publish:npm": "release-it --config ../../.release-it.json"
|
|
31
31
|
},
|
|
32
|
-
"description": "
|
|
32
|
+
"description": "Convert Zod schemas to Protobuf definitions",
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/express": "^5.0.0",
|
|
35
35
|
"@types/node": "^24.9.1",
|