Skip to content

Commit

Permalink
feat: add options to schema output (#437)
Browse files Browse the repository at this point in the history
* feat: add options to schema output

* fix: import option messages from other packages

* fix: switch options schema to _unknownFields

* chore: requested changes to schema and tests

* chore: run prettier

* chore: update bin2ts
  • Loading branch information
Vilsol authored May 19, 2022
1 parent 8c27f83 commit e8e4e39
Show file tree
Hide file tree
Showing 16 changed files with 17,447 additions and 1 deletion.
25 changes: 25 additions & 0 deletions integration/meta-typings/google/protobuf/timestamp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,35 @@ export const Timestamp = {
},
};

type ProtoMetaMessageOptions = {
options?: { [key: string]: any };
fields?: { [key: string]: { [key: string]: any } };
oneof?: { [key: string]: { [key: string]: any } };
nested?: { [key: string]: ProtoMetaMessageOptions };
};

export interface ProtoMetadata {
fileDescriptor: FileDescriptorProto;
references: { [key: string]: any };
dependencies?: ProtoMetadata[];
options?: {
options?: { [key: string]: any };
services?: {
[key: string]: {
options?: { [key: string]: any };
methods?: { [key: string]: { [key: string]: any } };
};
};
messages?: {
[key: string]: ProtoMetaMessageOptions;
};
enums?: {
[key: string]: {
options?: { [key: string]: any };
values?: { [key: string]: { [key: string]: any } };
};
};
};
}

export const protoMetadata: ProtoMetadata = {
Expand Down
25 changes: 25 additions & 0 deletions integration/meta-typings/google/protobuf/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,35 @@ export const BytesValue = {
},
};

type ProtoMetaMessageOptions = {
options?: { [key: string]: any };
fields?: { [key: string]: { [key: string]: any } };
oneof?: { [key: string]: { [key: string]: any } };
nested?: { [key: string]: ProtoMetaMessageOptions };
};

export interface ProtoMetadata {
fileDescriptor: FileDescriptorProto;
references: { [key: string]: any };
dependencies?: ProtoMetadata[];
options?: {
options?: { [key: string]: any };
services?: {
[key: string]: {
options?: { [key: string]: any };
methods?: { [key: string]: { [key: string]: any } };
};
};
messages?: {
[key: string]: ProtoMetaMessageOptions;
};
enums?: {
[key: string]: {
options?: { [key: string]: any };
values?: { [key: string]: { [key: string]: any } };
};
};
};
}

export const protoMetadata: ProtoMetadata = {
Expand Down
25 changes: 25 additions & 0 deletions integration/meta-typings/google/type/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,35 @@ export const DateMessage = {
},
};

type ProtoMetaMessageOptions = {
options?: { [key: string]: any };
fields?: { [key: string]: { [key: string]: any } };
oneof?: { [key: string]: { [key: string]: any } };
nested?: { [key: string]: ProtoMetaMessageOptions };
};

export interface ProtoMetadata {
fileDescriptor: FileDescriptorProto;
references: { [key: string]: any };
dependencies?: ProtoMetadata[];
options?: {
options?: { [key: string]: any };
services?: {
[key: string]: {
options?: { [key: string]: any };
methods?: { [key: string]: { [key: string]: any } };
};
};
messages?: {
[key: string]: ProtoMetaMessageOptions;
};
enums?: {
[key: string]: {
options?: { [key: string]: any };
values?: { [key: string]: { [key: string]: any } };
};
};
};
}

export const protoMetadata: ProtoMetadata = {
Expand Down
25 changes: 25 additions & 0 deletions integration/meta-typings/import_dir/thing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,35 @@ export const ImportedThing = {
},
};

type ProtoMetaMessageOptions = {
options?: { [key: string]: any };
fields?: { [key: string]: { [key: string]: any } };
oneof?: { [key: string]: { [key: string]: any } };
nested?: { [key: string]: ProtoMetaMessageOptions };
};

export interface ProtoMetadata {
fileDescriptor: FileDescriptorProto;
references: { [key: string]: any };
dependencies?: ProtoMetadata[];
options?: {
options?: { [key: string]: any };
services?: {
[key: string]: {
options?: { [key: string]: any };
methods?: { [key: string]: { [key: string]: any } };
};
};
messages?: {
[key: string]: ProtoMetaMessageOptions;
};
enums?: {
[key: string]: {
options?: { [key: string]: any };
values?: { [key: string]: { [key: string]: any } };
};
};
};
}

export const protoMetadata: ProtoMetadata = {
Expand Down
25 changes: 25 additions & 0 deletions integration/meta-typings/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1281,10 +1281,35 @@ interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}

type ProtoMetaMessageOptions = {
options?: { [key: string]: any };
fields?: { [key: string]: { [key: string]: any } };
oneof?: { [key: string]: { [key: string]: any } };
nested?: { [key: string]: ProtoMetaMessageOptions };
};

export interface ProtoMetadata {
fileDescriptor: FileDescriptorProto;
references: { [key: string]: any };
dependencies?: ProtoMetadata[];
options?: {
options?: { [key: string]: any };
services?: {
[key: string]: {
options?: { [key: string]: any };
methods?: { [key: string]: { [key: string]: any } };
};
};
messages?: {
[key: string]: ProtoMetaMessageOptions;
};
enums?: {
[key: string]: {
options?: { [key: string]: any };
values?: { [key: string]: { [key: string]: any } };
};
};
};
}

export const protoMetadata: ProtoMetadata = {
Expand Down
Loading

0 comments on commit e8e4e39

Please sign in to comment.