Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2136902
RecursiveV2 to legacy option
Zetazzz Jun 13, 2023
68b6f92
change default options
Zetazzz Jun 13, 2023
33f01d0
update doc
Zetazzz Jun 14, 2023
b5c6e0c
add buidl to test process
Zetazzz Jun 15, 2023
9cc460f
add buidl to test process
Zetazzz Jun 15, 2023
937b855
remove buidl step from test process
Zetazzz Jun 15, 2023
351ce42
Merge pull request #387 from Zetazzz/changes-v1
pyramation Jun 16, 2023
e40ee55
update test snapshots
Zetazzz Jun 19, 2023
c7cb561
Merge branch 'main' into changes-v1
Zetazzz Jun 19, 2023
e543292
update snapshots
Zetazzz Jun 19, 2023
29a9320
new fromJSON
hoangdv2429 Jun 30, 2023
2d37e74
remove undefined of some types fromPartial
hoangdv2429 Jul 10, 2023
c176b0d
update comment for fromPartial
hoangdv2429 Jul 11, 2023
8f1aa65
fromJSON done
hoangdv2429 Jul 11, 2023
2e9e2f7
new fixtures
hoangdv2429 Jul 11, 2023
3da87ce
Merge branch 'main' into feat/new_fromJSON
Zetazzz Aug 23, 2023
d3264ce
fix most of undefined cases left
hoangdv2429 Aug 25, 2023
0276aaf
Merge branch 'main' into changes-v1
Zetazzz Aug 30, 2023
859b357
rebuild and regen
Zetazzz Aug 30, 2023
603baa4
regen code
Zetazzz Aug 30, 2023
ecae5cc
regen code
Zetazzz Aug 30, 2023
70a5df1
regen to fix output1 and 2
Zetazzz Aug 30, 2023
aa0c889
regen to fix output1 and 2
Zetazzz Aug 30, 2023
32ea01a
remove babel from @type
Zetazzz Aug 30, 2023
e38ed76
remove babel in @utils
Zetazzz Aug 30, 2023
f91f515
remove babel from @lcd
Zetazzz Aug 30, 2023
e10c1ae
remove babel parser
Zetazzz Aug 31, 2023
862c663
remove babel from parser
Zetazzz Aug 31, 2023
09b83bf
remove babel from lint for parser
Zetazzz Aug 31, 2023
50ac43c
remove babel from ast
Zetazzz Aug 31, 2023
81d0c78
remove babel from ast
Zetazzz Aug 31, 2023
784364e
remove babel from @telescope
Zetazzz Aug 31, 2023
a24c973
get telescope bin running with ts-node
Zetazzz Aug 31, 2023
c21528c
remove babel from root
Zetazzz Sep 1, 2023
1585470
Merge branch 'main' into feat/new_fromJSON
hoangdv2429 Sep 1, 2023
9699fa6
remove babel from starship
Zetazzz Sep 3, 2023
80b01a5
fix jest config for starship
Zetazzz Sep 3, 2023
15131d5
try to make e2e ok
Zetazzz Sep 3, 2023
36c5f51
fix starship build
Zetazzz Sep 3, 2023
651c816
disable interfaces
Zetazzz Sep 3, 2023
ea6179f
remove disabled packages
Zetazzz Sep 3, 2023
e7eae39
add migration doc
Zetazzz Sep 4, 2023
7e6bd9e
Merge branch 'changes-v1' into feat/new_fromJSON
Zetazzz Sep 4, 2023
513017b
merge changes-v1
Zetazzz Sep 4, 2023
ca7a3bf
regen
Zetazzz Sep 4, 2023
6622d4e
add flag strictNullCheckForPrototypeMethods
Zetazzz Sep 4, 2023
6b5b8f4
change fromPartial types default back
Zetazzz Sep 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
plugins: ['prettier'],
extends: ['eslint:recommended', 'prettier'],
parser: '@babel/eslint-parser',
parser: 'esprima',
settings: {
next: {
rootDir: 'packages/next/'
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ telescope({
| `aminoEncoding.casingFn` | set the amino-casing function for a project | `snake()` |
| `aminoEncoding.exceptions` | set specific aminoType name exceptions | see code |
| `aminoEncoding.typeUrlToAmino` | create functions for aminoType name exceptions | `undefined`|
| `aminoEncoding.useLegacyInlineEncoding` | To use legacy inline encoding instead of using v2 recursive encoding | `false`|

### Implemented Interface Options

Expand All @@ -279,6 +280,8 @@ telescope({
| `prototypes.allowUndefinedTypes` | boolean value allowing `Type`s to be `undefined` | `false` |
| `prototypes.optionalQueryParams` | boolean value setting queryParams to be optional | `false` |
| `prototypes.optionalPageRequests` | boolean value setting `PageRequest` fields to optional | `false` |
| `prototypes.addTypeUrlToDecoders` | Include typeUrl feild into decoders to indicate the original type. | `true` |
| `prototypes.addTypeUrlToObjects` | Include typeUrl feild into objects to indicate the original type | `true` |

### Prototypes Methods

Expand All @@ -291,6 +294,10 @@ telescope({
| `prototypes.methods.fromPartial` | boolean to enable `fromPartial` method on proto objects | `true` |
| `prototypes.methods.fromSDK` | boolean to enable `fromSDK` method on proto objects | `false` |
| `prototypes.methods.toSDK` | boolean to enable `toSDK` method on proto objects | `false` |
| `prototypes.methods.toAmino` | boolean to enable `toAmino` method on proto objects | `true` |
| `prototypes.methods.fromAmino` | boolean to enable `fromAmino` method on proto objects | `true` |
| `prototypes.methods.toProto` | boolean to enable `toProto` method on proto objects | `true` |
| `prototypes.methods.fromProto` | boolean to enable `fromProto` method on proto objects | `true` |

### LCD Client Options

Expand Down Expand Up @@ -359,9 +366,9 @@ See [RPC Clients](#rpc-clients) for more info.

| option | description | defaults |
| ----------------------------------------- | -------------------------------------------------------------- | --------- |
| `prototypes.typingsFormat.customTypes.useCosmosSDKDec` | enable handling "prototypes.typingsFormat.customTypes.useCosmosSDKDec" proto custom type. Used to show decimal fields with the custom type correctly. Highly recommend set to true. | `false` |
| `prototypes.typingsFormat.num64` | 'long' or 'bigint', the way of generating int64 proto types, set to 'bigint' to enable using more stable built-in type | `long` |
| `prototypes.typingsFormat.useDeepPartial` | defaults to true, but if disabled uses the `Partial` TS type | `true` |
| `prototypes.typingsFormat.customTypes.useCosmosSDKDec` | enable handling "prototypes.typingsFormat.customTypes.useCosmosSDKDec" proto custom type. Used to show decimal fields with the custom type correctly. Highly recommend set to true. | `true` |
| `prototypes.typingsFormat.num64` | 'long' or 'bigint', the way of generating int64 proto types, set to 'bigint' to enable using more stable built-in type | `bigint` |
| `prototypes.typingsFormat.useDeepPartial` | By default using the `Partial` TS type, otherwise using `DeepPartial` | `false` |
| `prototypes.typingsFormat.useExact` | defaults to false, but if enabled uses the `Exact` TS type | `false` |
| `prototypes.typingsFormat.timestamp` | use either `date` or `timestamp` for `Timestamp` proto type | "date" |
| `prototypes.typingsFormat.duration` | use either `duration` or `string` for `Duration` proto type | "duration"|
Expand Down Expand Up @@ -406,6 +413,7 @@ See [RPC Clients](#rpc-clients) for more info.
| `removeUnusedImports` | removes unused imports | `true` |
| `classesUseArrowFunctions` | classes use arrow functions instead of `bind()`ing in constructors | `false` |
| `includeExternalHelpers` | exports a few helpers functions in `extern.ts` | `false` |
| `interfaces.enabled` | Enable handling accepts_interface to decode or encode fields that can be multiple types | `true` |

## Types

Expand Down
2 changes: 2 additions & 0 deletions __fixtures__/misc/output/google/api/expr/v1alpha1/eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function createBaseExprValue(): ExprValue {
};
}
export const ExprValue = {
typeUrl: "/google.api.expr.v1alpha1.ExprValue",
encode(message: ExprValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
for (const v of message.exprs) {
IdRef.encode(v!, writer.uint32(10).fork()).ldelim();
Expand Down Expand Up @@ -142,6 +143,7 @@ function createBaseIdRef(): IdRef {
};
}
export const IdRef = {
typeUrl: "/google.api.expr.v1alpha1.IdRef",
encode(message: IdRef, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
Expand Down
1 change: 1 addition & 0 deletions __fixtures__/misc/output/misc/eval_request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ function createBaseEvalRequest(): EvalRequest {
};
}
export const EvalRequest = {
typeUrl: "/misc.EvalRequest",
encode(message: EvalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
Object.entries(message.bindings).forEach(([key, value]) => {
EvalRequest_BindingsEntry.encode({
Expand Down
Loading