Publish updated Camino codegen artifacts
This commit is contained in:
Vendored
+15
-2
@@ -114,6 +114,10 @@ const interfaceFieldContractFromOption = (value, schemaVersion) => {
|
||||
return undefined;
|
||||
}
|
||||
const type = typeRefFromOption(object.type, schemaVersion);
|
||||
const refTargetTypeParam = readString(object, "ref_target_type_param");
|
||||
const edgeCardinality = object.edge_cardinality === undefined
|
||||
? undefined
|
||||
: cardinalityFromOption(object.edge_cardinality);
|
||||
return {
|
||||
required: readBoolean(object, "required") ?? false,
|
||||
readable: readBoolean(object, "readable") ?? false,
|
||||
@@ -123,6 +127,8 @@ const interfaceFieldContractFromOption = (value, schemaVersion) => {
|
||||
? { typeParam: readString(object, "type_param") }
|
||||
: {}),
|
||||
...(type ? { type } : {}),
|
||||
...(refTargetTypeParam ? { refTargetTypeParam } : {}),
|
||||
...(edgeCardinality ? { edgeCardinality } : {}),
|
||||
};
|
||||
};
|
||||
const functionRefFromOption = (value) => {
|
||||
@@ -626,6 +632,9 @@ const interfaceSchemaFromType = (type, sourceFile, defaults) => {
|
||||
fields: type.fieldsArray.map((field) => fieldSchemaFromField(field, defaults.schemaVersion)),
|
||||
sourceFile,
|
||||
protoMessage: type.fullName,
|
||||
typeParameters: asArray(interfaceOption.type_parameter)
|
||||
.map((entry) => String(entry).trim())
|
||||
.filter(Boolean),
|
||||
};
|
||||
};
|
||||
const walkTypes = (namespace, visit) => {
|
||||
@@ -649,9 +658,8 @@ const walkServices = (namespace, visit) => {
|
||||
}
|
||||
}
|
||||
};
|
||||
export const compileCaminoSchema = async (sourceFile) => {
|
||||
export const loadCaminoSchemaRoot = async (sourceFile) => {
|
||||
const absoluteSourceFile = path.resolve(sourceFile);
|
||||
const defaults = extractFileDefaults(absoluteSourceFile);
|
||||
const root = new protobuf.Root();
|
||||
const envIncludeDirs = [
|
||||
process.env.QUIXOS_PROTO_PATH,
|
||||
@@ -684,6 +692,11 @@ export const compileCaminoSchema = async (sourceFile) => {
|
||||
};
|
||||
await root.load(absoluteSourceFile, { keepCase: true });
|
||||
root.resolveAll();
|
||||
return { absoluteSourceFile, root };
|
||||
};
|
||||
export const compileCaminoSchema = async (sourceFile) => {
|
||||
const { absoluteSourceFile, root } = await loadCaminoSchemaRoot(sourceFile);
|
||||
const defaults = extractFileDefaults(absoluteSourceFile);
|
||||
const operationServices = [];
|
||||
walkServices(root, (service) => {
|
||||
operationServices.push(operationServiceFromService(service, defaults.schemaVersion));
|
||||
|
||||
Reference in New Issue
Block a user