wasm-ast-types 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main/recoil.js +3 -3
- package/module/recoil.js +3 -3
- package/package.json +2 -2
package/main/recoil.js
CHANGED
@@ -39,8 +39,8 @@ var createRecoilSelector = function createRecoilSelector(keyPrefix, QueryClient,
|
|
39
39
|
var selectorName = (0, _case.camel)("".concat(methodName, "Selector"));
|
40
40
|
var responseType = (0, _case.pascal)("".concat(methodName, "Response"));
|
41
41
|
var getterKey = (0, _case.camel)("".concat(keyPrefix).concat((0, _case.pascal)(methodName)));
|
42
|
-
return t.exportNamedDeclaration(t.variableDeclaration('const', [t.variableDeclarator(t.identifier(selectorName), (0, _utils.callExpression)(t.identifier('selectorFamily'), [t.objectExpression([t.objectProperty(t.identifier('key'), t.stringLiteral(getterKey)), t.objectProperty(t.identifier('get'), t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('params'), t.identifier('params'), false, true), t.restElement(t.identifier('queryClientParams'))])], t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('get'), t.identifier('get'), false, true)])], t.blockStatement([t.variableDeclaration('const', [t.variableDeclarator(t.identifier('client'), t.callExpression(t.identifier('get'), [t.callExpression(t.identifier('queryClient'), [t.identifier('queryClientParams')])]))]), t.
|
43
|
-
t.spreadElement(t.identifier('params'))])))]), true)))])], t.tsTypeParameterInstantiation([t.
|
42
|
+
return t.exportNamedDeclaration(t.variableDeclaration('const', [t.variableDeclarator(t.identifier(selectorName), (0, _utils.callExpression)(t.identifier('selectorFamily'), [t.objectExpression([t.objectProperty(t.identifier('key'), t.stringLiteral(getterKey)), t.objectProperty(t.identifier('get'), t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('params'), t.identifier('params'), false, true), t.restElement(t.identifier('queryClientParams'))])], t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('get'), t.identifier('get'), false, true)])], t.blockStatement([t.variableDeclaration('const', [t.variableDeclarator(t.identifier('client'), t.callExpression(t.identifier('get'), [t.callExpression(t.identifier('queryClient'), [t.identifier('queryClientParams')])]))]), t.returnStatement(t.awaitExpression(t.callExpression(t.memberExpression(t.identifier('client'), t.identifier(methodName)), [// t.identifier('params')
|
43
|
+
t.spreadElement(t.identifier('params'))])))]), true)))])], t.tsTypeParameterInstantiation([t.tsTypeReference(t.identifier(responseType)), t.tsIntersectionType([t.tsTypeReference(t.identifier('QueryClientParams')), t.tsTypeLiteral([t.tsPropertySignature(t.identifier('params'), t.tsTypeAnnotation(t.tsTypeReference(t.identifier('Parameters'), t.tsTypeParameterInstantiation([t.tsIndexedAccessType(t.tsTypeReference(t.identifier(QueryClient)), t.tsLiteralType(t.stringLiteral(methodName)))]))))])])])))]));
|
44
44
|
};
|
45
45
|
|
46
46
|
exports.createRecoilSelector = createRecoilSelector;
|
@@ -86,7 +86,7 @@ exports.createRecoilQueryClientType = createRecoilQueryClientType;
|
|
86
86
|
|
87
87
|
var createRecoilQueryClient = function createRecoilQueryClient(keyPrefix, QueryClient) {
|
88
88
|
var getterKey = (0, _case.camel)("".concat(keyPrefix, 'QueryClient'));
|
89
|
-
return t.exportNamedDeclaration(t.variableDeclaration('const', [t.variableDeclarator(t.identifier('queryClient'), (0, _utils.callExpression)(t.identifier('selectorFamily'), [t.objectExpression([t.objectProperty(t.identifier('key'), t.stringLiteral(getterKey)), t.objectProperty(t.identifier('get'), t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('contractAddress'), t.identifier('contractAddress'), false, true)])], t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('get'), t.identifier('get'), false, true)])], t.blockStatement([t.variableDeclaration('const', [t.variableDeclarator(t.identifier('client'), t.callExpression(t.identifier('get'), [t.identifier('cosmWasmClient')]))]), t.
|
89
|
+
return t.exportNamedDeclaration(t.variableDeclaration('const', [t.variableDeclarator(t.identifier('queryClient'), (0, _utils.callExpression)(t.identifier('selectorFamily'), [t.objectExpression([t.objectProperty(t.identifier('key'), t.stringLiteral(getterKey)), t.objectProperty(t.identifier('get'), t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('contractAddress'), t.identifier('contractAddress'), false, true)])], t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('get'), t.identifier('get'), false, true)])], t.blockStatement([t.variableDeclaration('const', [t.variableDeclarator(t.identifier('client'), t.callExpression(t.identifier('get'), [t.identifier('cosmWasmClient')]))]), t.returnStatement(t.newExpression(t.identifier(QueryClient), [t.identifier('client'), t.identifier('contractAddress')]))]), false)))])], t.tsTypeParameterInstantiation([t.tsTypeReference(t.identifier(QueryClient)), t.tsTypeReference(t.identifier('QueryClientParams'))])))]));
|
90
90
|
};
|
91
91
|
|
92
92
|
exports.createRecoilQueryClient = createRecoilQueryClient;
|
package/module/recoil.js
CHANGED
@@ -18,8 +18,8 @@ export const createRecoilSelector = (keyPrefix, QueryClient, methodName) => {
|
|
18
18
|
const selectorName = camel(`${methodName}Selector`);
|
19
19
|
const responseType = pascal(`${methodName}Response`);
|
20
20
|
const getterKey = camel(`${keyPrefix}${pascal(methodName)}`);
|
21
|
-
return t.exportNamedDeclaration(t.variableDeclaration('const', [t.variableDeclarator(t.identifier(selectorName), callExpression(t.identifier('selectorFamily'), [t.objectExpression([t.objectProperty(t.identifier('key'), t.stringLiteral(getterKey)), t.objectProperty(t.identifier('get'), t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('params'), t.identifier('params'), false, true), t.restElement(t.identifier('queryClientParams'))])], t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('get'), t.identifier('get'), false, true)])], t.blockStatement([t.variableDeclaration('const', [t.variableDeclarator(t.identifier('client'), t.callExpression(t.identifier('get'), [t.callExpression(t.identifier('queryClient'), [t.identifier('queryClientParams')])]))]), t.
|
22
|
-
t.spreadElement(t.identifier('params'))])))]), true)))])], t.tsTypeParameterInstantiation([t.
|
21
|
+
return t.exportNamedDeclaration(t.variableDeclaration('const', [t.variableDeclarator(t.identifier(selectorName), callExpression(t.identifier('selectorFamily'), [t.objectExpression([t.objectProperty(t.identifier('key'), t.stringLiteral(getterKey)), t.objectProperty(t.identifier('get'), t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('params'), t.identifier('params'), false, true), t.restElement(t.identifier('queryClientParams'))])], t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('get'), t.identifier('get'), false, true)])], t.blockStatement([t.variableDeclaration('const', [t.variableDeclarator(t.identifier('client'), t.callExpression(t.identifier('get'), [t.callExpression(t.identifier('queryClient'), [t.identifier('queryClientParams')])]))]), t.returnStatement(t.awaitExpression(t.callExpression(t.memberExpression(t.identifier('client'), t.identifier(methodName)), [// t.identifier('params')
|
22
|
+
t.spreadElement(t.identifier('params'))])))]), true)))])], t.tsTypeParameterInstantiation([t.tsTypeReference(t.identifier(responseType)), t.tsIntersectionType([t.tsTypeReference(t.identifier('QueryClientParams')), t.tsTypeLiteral([t.tsPropertySignature(t.identifier('params'), t.tsTypeAnnotation(t.tsTypeReference(t.identifier('Parameters'), t.tsTypeParameterInstantiation([t.tsIndexedAccessType(t.tsTypeReference(t.identifier(QueryClient)), t.tsLiteralType(t.stringLiteral(methodName)))]))))])])])))]));
|
23
23
|
};
|
24
24
|
export const createRecoilSelectors = (keyPrefix, QueryClient, queryMsg) => {
|
25
25
|
return getMessageProperties(queryMsg).map(schema => {
|
@@ -54,5 +54,5 @@ export const createRecoilQueryClientType = () => ({
|
|
54
54
|
});
|
55
55
|
export const createRecoilQueryClient = (keyPrefix, QueryClient) => {
|
56
56
|
const getterKey = camel(`${keyPrefix}${'QueryClient'}`);
|
57
|
-
return t.exportNamedDeclaration(t.variableDeclaration('const', [t.variableDeclarator(t.identifier('queryClient'), callExpression(t.identifier('selectorFamily'), [t.objectExpression([t.objectProperty(t.identifier('key'), t.stringLiteral(getterKey)), t.objectProperty(t.identifier('get'), t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('contractAddress'), t.identifier('contractAddress'), false, true)])], t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('get'), t.identifier('get'), false, true)])], t.blockStatement([t.variableDeclaration('const', [t.variableDeclarator(t.identifier('client'), t.callExpression(t.identifier('get'), [t.identifier('cosmWasmClient')]))]), t.
|
57
|
+
return t.exportNamedDeclaration(t.variableDeclaration('const', [t.variableDeclarator(t.identifier('queryClient'), callExpression(t.identifier('selectorFamily'), [t.objectExpression([t.objectProperty(t.identifier('key'), t.stringLiteral(getterKey)), t.objectProperty(t.identifier('get'), t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('contractAddress'), t.identifier('contractAddress'), false, true)])], t.arrowFunctionExpression([t.objectPattern([t.objectProperty(t.identifier('get'), t.identifier('get'), false, true)])], t.blockStatement([t.variableDeclaration('const', [t.variableDeclarator(t.identifier('client'), t.callExpression(t.identifier('get'), [t.identifier('cosmWasmClient')]))]), t.returnStatement(t.newExpression(t.identifier(QueryClient), [t.identifier('client'), t.identifier('contractAddress')]))]), false)))])], t.tsTypeParameterInstantiation([t.tsTypeReference(t.identifier(QueryClient)), t.tsTypeReference(t.identifier('QueryClientParams'))])))]));
|
58
58
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wasm-ast-types",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.1",
|
4
4
|
"description": "CosmWasm TypeScript AST generation",
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
6
6
|
"homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme",
|
@@ -84,5 +84,5 @@
|
|
84
84
|
"ast-stringify": "0.1.0",
|
85
85
|
"case": "1.6.3"
|
86
86
|
},
|
87
|
-
"gitHead": "
|
87
|
+
"gitHead": "b0312f7e16b8fd1c4892da6d91d3f7cf6c1bd49e"
|
88
88
|
}
|