wasm-ast-types 0.26.0 → 0.26.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.
@@ -47,7 +47,7 @@ var defaultOptions = {
47
47
  reactQuery: {
48
48
  enabled: false,
49
49
  optionalClient: false,
50
- version: 'v3',
50
+ version: 'v4',
51
51
  mutations: false,
52
52
  camelize: true,
53
53
  queryKeys: false
@@ -10,11 +10,13 @@ var _reactQuery = require("./react-query");
10
10
  var _testUtils = require("../../test-utils");
11
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
- var execCtx = (0, _testUtils.makeContext)(_execute_msg_for__empty["default"]);
14
- var queryCtx = (0, _testUtils.makeContext)(_query_msg["default"]);
15
13
  it('createReactQueryHooks', function () {
16
14
  (0, _testUtils.expectCode)(t.program((0, _reactQuery.createReactQueryHooks)({
17
- context: queryCtx,
15
+ context: (0, _testUtils.makeContext)(_query_msg["default"], {
16
+ reactQuery: {
17
+ version: 'v3'
18
+ }
19
+ }),
18
20
  queryMsg: _query_msg["default"],
19
21
  contractName: 'Sg721',
20
22
  QueryClient: 'Sg721QueryClient'
@@ -22,6 +24,7 @@ it('createReactQueryHooks', function () {
22
24
  (0, _testUtils.expectCode)(t.program((0, _reactQuery.createReactQueryHooks)({
23
25
  context: (0, _testUtils.makeContext)(_query_msg["default"], {
24
26
  reactQuery: {
27
+ version: 'v3',
25
28
  optionalClient: true
26
29
  }
27
30
  }),
@@ -64,16 +67,23 @@ it('createReactQueryHooks', function () {
64
67
  QueryClient: 'Sg721QueryClient'
65
68
  })));
66
69
  (0, _testUtils.expectCode)(t.program((0, _reactQuery.createReactQueryMutationHooks)({
67
- context: execCtx,
70
+ context: (0, _testUtils.makeContext)(_execute_msg_for__empty["default"], {
71
+ reactQuery: {
72
+ version: 'v3'
73
+ }
74
+ }),
68
75
  execMsg: _execute_msg_for__empty["default"],
69
76
  contractName: 'Sg721',
70
77
  ExecuteClient: 'Sg721Client'
71
78
  })));
72
79
  });
73
80
  it('ownership', function () {
74
- var ownershipCtx = (0, _testUtils.makeContext)(_ownership["default"]);
75
81
  (0, _testUtils.expectCode)(t.program((0, _reactQuery.createReactQueryMutationHooks)({
76
- context: ownershipCtx,
82
+ context: (0, _testUtils.makeContext)(_ownership["default"], {
83
+ reactQuery: {
84
+ version: 'v3'
85
+ }
86
+ }),
77
87
  execMsg: _ownership["default"],
78
88
  contractName: 'Ownership',
79
89
  ExecuteClient: 'OwnershipClient'
@@ -34,7 +34,7 @@ export const defaultOptions = {
34
34
  reactQuery: {
35
35
  enabled: false,
36
36
  optionalClient: false,
37
- version: 'v3',
37
+ version: 'v4',
38
38
  mutations: false,
39
39
  camelize: true,
40
40
  queryKeys: false
@@ -4,11 +4,13 @@ import execute_msg from '../../../../__fixtures__/basic/execute_msg_for__empty.j
4
4
  import ownership from '../../../../__fixtures__/basic/ownership.json';
5
5
  import { createReactQueryHooks, createReactQueryMutationHooks } from './react-query';
6
6
  import { expectCode, makeContext } from '../../test-utils';
7
- const execCtx = makeContext(execute_msg);
8
- const queryCtx = makeContext(query_msg);
9
7
  it('createReactQueryHooks', () => {
10
8
  expectCode(t.program(createReactQueryHooks({
11
- context: queryCtx,
9
+ context: makeContext(query_msg, {
10
+ reactQuery: {
11
+ version: 'v3'
12
+ }
13
+ }),
12
14
  queryMsg: query_msg,
13
15
  contractName: 'Sg721',
14
16
  QueryClient: 'Sg721QueryClient'
@@ -16,6 +18,7 @@ it('createReactQueryHooks', () => {
16
18
  expectCode(t.program(createReactQueryHooks({
17
19
  context: makeContext(query_msg, {
18
20
  reactQuery: {
21
+ version: 'v3',
19
22
  optionalClient: true
20
23
  }
21
24
  }),
@@ -58,16 +61,23 @@ it('createReactQueryHooks', () => {
58
61
  QueryClient: 'Sg721QueryClient'
59
62
  })));
60
63
  expectCode(t.program(createReactQueryMutationHooks({
61
- context: execCtx,
64
+ context: makeContext(execute_msg, {
65
+ reactQuery: {
66
+ version: 'v3'
67
+ }
68
+ }),
62
69
  execMsg: execute_msg,
63
70
  contractName: 'Sg721',
64
71
  ExecuteClient: 'Sg721Client'
65
72
  })));
66
73
  });
67
74
  it('ownership', () => {
68
- const ownershipCtx = makeContext(ownership);
69
75
  expectCode(t.program(createReactQueryMutationHooks({
70
- context: ownershipCtx,
76
+ context: makeContext(ownership, {
77
+ reactQuery: {
78
+ version: 'v3'
79
+ }
80
+ }),
71
81
  execMsg: ownership,
72
82
  contractName: 'Ownership',
73
83
  ExecuteClient: 'OwnershipClient'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wasm-ast-types",
3
- "version": "0.26.0",
3
+ "version": "0.26.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",
@@ -88,5 +88,5 @@
88
88
  "case": "1.6.3",
89
89
  "deepmerge": "4.2.2"
90
90
  },
91
- "gitHead": "fa5aea0a8de61f713a8dad85c5f7965e82c3b5c0"
91
+ "gitHead": "0cad0afb48264cc726c06a6ff7a1453e7cabb4b5"
92
92
  }
@@ -115,7 +115,7 @@ export const defaultOptions: RenderOptions = {
115
115
  reactQuery: {
116
116
  enabled: false,
117
117
  optionalClient: false,
118
- version: 'v3',
118
+ version: 'v4',
119
119
  mutations: false,
120
120
  camelize: true,
121
121
  queryKeys: false
@@ -9,16 +9,16 @@ import {
9
9
  createReactQueryMutationHooks,
10
10
  } from './react-query'
11
11
  import { expectCode, makeContext } from '../../test-utils';
12
- import { createMessageBuilderClass } from '../message-builder';
13
-
14
- const execCtx = makeContext(execute_msg);
15
- const queryCtx = makeContext(query_msg);
16
12
 
17
13
  it('createReactQueryHooks', () => {
18
14
  expectCode(t.program(
19
15
  createReactQueryHooks(
20
16
  {
21
- context: queryCtx,
17
+ context: makeContext(query_msg, {
18
+ reactQuery: {
19
+ version: 'v3',
20
+ }
21
+ }),
22
22
  queryMsg: query_msg,
23
23
  contractName: 'Sg721',
24
24
  QueryClient: 'Sg721QueryClient'
@@ -29,6 +29,7 @@ it('createReactQueryHooks', () => {
29
29
  {
30
30
  context: makeContext(query_msg, {
31
31
  reactQuery: {
32
+ version: 'v3',
32
33
  optionalClient: true
33
34
  }
34
35
  }),
@@ -84,7 +85,11 @@ it('createReactQueryHooks', () => {
84
85
  expectCode(t.program(
85
86
  createReactQueryMutationHooks(
86
87
  {
87
- context: execCtx,
88
+ context: makeContext(execute_msg, {
89
+ reactQuery: {
90
+ version: 'v3'
91
+ }
92
+ }),
88
93
  execMsg: execute_msg,
89
94
  contractName: 'Sg721',
90
95
  ExecuteClient: 'Sg721Client',
@@ -93,11 +98,14 @@ it('createReactQueryHooks', () => {
93
98
  });
94
99
 
95
100
  it('ownership', () => {
96
- const ownershipCtx = makeContext(ownership);
97
101
  expectCode(t.program(
98
102
  createReactQueryMutationHooks(
99
103
  {
100
- context: ownershipCtx,
104
+ context: makeContext(ownership, {
105
+ reactQuery: {
106
+ version: 'v3'
107
+ }
108
+ }),
101
109
  execMsg: ownership,
102
110
  contractName: 'Ownership',
103
111
  ExecuteClient: 'OwnershipClient',