-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor w/ encoding and transport abstractions
- Loading branch information
Showing
71 changed files
with
431 additions
and
473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/cli/configuration/src/generators-yml/isRawProtobufAPIDefinitionSchema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { APIConfigurationSchema, ProtobufAPIDefinitionSchema } from "./schemas/APIConfigurationSchema"; | ||
|
||
export function isRawProtobufAPIDefinitionSchema( | ||
rawApiConfiguration: APIConfigurationSchema | ||
): rawApiConfiguration is ProtobufAPIDefinitionSchema { | ||
return typeof rawApiConfiguration !== "string" && "proto" in rawApiConfiguration; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ export async function visitHttpService({ | |
} | ||
}, | ||
idempotent: noop, | ||
grpc: noop | ||
transport: noop | ||
}); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/cli/yaml/yaml-schema/src/schemas/BaseTypeDeclarationSchema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { z } from "zod"; | ||
import { DeclarationSchema } from "./DeclarationSchema"; | ||
import { EncodingSchema } from "./EncodingSchema"; | ||
import { ExampleTypeSchema } from "./ExampleTypeSchema"; | ||
import { ProtobufSourceTypeSchema } from "./ProtobufSourceTypeSchema"; | ||
|
||
export const BaseTypeDeclarationSchema = DeclarationSchema.extend({ | ||
examples: z.optional(z.array(ExampleTypeSchema)), | ||
proto: z.optional(ProtobufSourceTypeSchema) | ||
encoding: z.optional(EncodingSchema) | ||
}); | ||
|
||
export type BaseTypeDeclarationSchema = z.infer<typeof BaseTypeDeclarationSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { z } from "zod"; | ||
import { ProtobufTypeSchema } from "./ProtobufTypeSchema"; | ||
|
||
export const EncodingSchema = z.strictObject({ | ||
proto: z.optional(ProtobufTypeSchema) | ||
}); | ||
|
||
export type EncodingSchema = z.infer<typeof EncodingSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { z } from "zod"; | ||
import { ProtobufSourceFileSchema } from "./ProtobufSourceFileSchema"; | ||
|
||
export const GrpcSchema = ProtobufSourceFileSchema.extend( | ||
z.strictObject({ | ||
"service-name": z.string().describe("The name of the gRPC service.") | ||
}).shape | ||
); | ||
export const GrpcSchema = z.strictObject({ | ||
file: z | ||
.string() | ||
.describe( | ||
"The relative path of the `.proto` source file that defines the gRPC service (e.g. user/v1/user.proto)" | ||
) | ||
}); | ||
|
||
export type GrpcSchema = z.infer<typeof GrpcSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
packages/cli/yaml/yaml-schema/src/schemas/ProtobufCsharpSchema.ts
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
packages/cli/yaml/yaml-schema/src/schemas/ProtobufFileOptionsSchema.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.