Update package runtime edge ordinal API

This commit is contained in:
Timothy J. Aveni
2026-07-14 20:31:28 -07:00
parent 85e0dafbeb
commit 415eb6b411
9 changed files with 36 additions and 34 deletions
+12 -4
View File
@@ -436,9 +436,13 @@ export type AddEdgeRequest = Message<"camino.AddEdgeRequest"> & {
[key: string]: Value;
};
/**
* @generated from field: optional int32 ordinal = 5;
* @generated from field: optional int32 source_ordinal = 5;
*/
ordinal?: number | undefined;
sourceOrdinal?: number | undefined;
/**
* @generated from field: optional int32 target_ordinal = 6;
*/
targetOrdinal?: number | undefined;
};
/**
* Describes the message camino.AddEdgeRequest.
@@ -676,9 +680,9 @@ export type CaminoEdge = Message<"camino.CaminoEdge"> & {
[key: string]: Value;
};
/**
* @generated from field: optional int32 ordinal = 9;
* @generated from field: optional int32 from_ordinal = 9;
*/
ordinal?: number | undefined;
fromOrdinal?: number | undefined;
/**
* @generated from field: string created_at = 10;
*/
@@ -703,6 +707,10 @@ export type CaminoEdge = Message<"camino.CaminoEdge"> & {
* @generated from field: string to_cardinality = 15;
*/
toCardinality: string;
/**
* @generated from field: optional int32 to_ordinal = 16;
*/
toOrdinal?: number | undefined;
};
/**
* Describes the message camino.CaminoEdge.
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"schema-compiler.d.ts","sourceRoot":"","sources":["../src/schema-compiler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAeV,mBAAmB,EAGpB,MAAM,gBAAgB,CAAC;AAuyBxB,eAAO,MAAM,mBAAmB,GAC9B,YAAY,MAAM,KACjB,OAAO,CAAC,mBAAmB,CAuE7B,CAAC"}
{"version":3,"file":"schema-compiler.d.ts","sourceRoot":"","sources":["../src/schema-compiler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAeV,mBAAmB,EAGpB,MAAM,gBAAgB,CAAC;AA4xBxB,eAAO,MAAM,mBAAmB,GAC9B,YAAY,MAAM,KACjB,OAAO,CAAC,mBAAmB,CAuE7B,CAAC"}
-5
View File
@@ -308,7 +308,6 @@ const isManyCardinality = (cardinality) => cardinality === "many" ||
cardinality === "many_unique" ||
cardinality === "many_ordered" ||
cardinality === "many_unique_ordered";
const isOrderedCardinality = (cardinality) => cardinality === "many_ordered" || cardinality === "many_unique_ordered";
const endpointFromOption = (params) => {
const object = asObject(params.option);
const classRef = asObject(object?.class)
@@ -476,10 +475,6 @@ const classSchemaFromType = (type, sourceFile, defaults, operationServices) => {
if (!isMany && field.repeated) {
throw new Error(`Edge field ${type.fullName}.${field.name} must not be repeated for ${fromEndpoint.cardinality}`);
}
if (isOrderedCardinality(fromEndpoint.cardinality) &&
isOrderedCardinality(toEndpoint.cardinality)) {
throw new Error(`Edge field ${type.fullName}.${field.name} cannot be ordered on both endpoints yet`);
}
const edgeId = symbolRefFromOption(edgeOption.id, {
namespace: defaults.schemaNamespace,
name: `${type.name}.${field.name}`,