@based/type-gen 0.0.3 → 0.0.5
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/dist/src/index.d.ts +16 -0
- package/dist/src/index.js +44 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/parseCode.d.ts +1 -0
- package/dist/{parseCode.js → src/parseCode.js} +1 -0
- package/dist/src/parseCode.js.map +1 -0
- package/dist/src/updateTypesPath.d.ts +14 -0
- package/dist/src/updateTypesPath.js +84 -0
- package/dist/src/updateTypesPath.js.map +1 -0
- package/package.json +18 -17
- package/dist/auth.d.ts +0 -16
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js +0 -3
- package/dist/auth.js.map +0 -1
- package/dist/channel.d.ts +0 -6
- package/dist/channel.d.ts.map +0 -1
- package/dist/channel.js +0 -7
- package/dist/channel.js.map +0 -1
- package/dist/client.d.ts +0 -18
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -7
- package/dist/client.js.map +0 -1
- package/dist/context.d.ts +0 -100
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -39
- package/dist/context.js.map +0 -1
- package/dist/fromAst.d.ts +0 -4
- package/dist/fromAst.d.ts.map +0 -1
- package/dist/fromAst.js +0 -34
- package/dist/fromAst.js.map +0 -1
- package/dist/function.d.ts +0 -1
- package/dist/function.d.ts.map +0 -1
- package/dist/function.js +0 -1
- package/dist/function.js.map +0 -1
- package/dist/functions.d.ts +0 -181
- package/dist/functions.d.ts.map +0 -1
- package/dist/functions.js +0 -29
- package/dist/functions.js.map +0 -1
- package/dist/geo.d.ts +0 -36
- package/dist/geo.d.ts.map +0 -1
- package/dist/geo.js +0 -3
- package/dist/geo.js.map +0 -1
- package/dist/index.d.ts +0 -13
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -87
- package/dist/index.js.map +0 -1
- package/dist/parseAst.d.ts +0 -4
- package/dist/parseAst.d.ts.map +0 -1
- package/dist/parseAst.js +0 -34
- package/dist/parseAst.js.map +0 -1
- package/dist/parseCode.d.ts +0 -7
- package/dist/parseCode.d.ts.map +0 -1
- package/dist/parseCode.js.map +0 -1
- package/dist/query.d.ts +0 -7
- package/dist/query.d.ts.map +0 -1
- package/dist/query.js +0 -7
- package/dist/query.js.map +0 -1
- package/dist/stream.d.ts +0 -40
- package/dist/stream.d.ts.map +0 -1
- package/dist/stream.js +0 -63
- package/dist/stream.js.map +0 -1
- package/dist/uws.d.ts +0 -469
- package/src/index.ts +0 -122
- package/src/parseCode.ts +0 -53
- package/test/examples/helloWorld/based.config.json +0 -4
- package/test/examples/helloWorld/index.ts +0 -30
- package/test/examples/query/based.config.json +0 -4
- package/test/examples/query/index.ts +0 -28
- package/test/types.ts +0 -48
- package/tsconfig.json +0 -10
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BasedQueryFunction } from '@based/functions'
|
|
2
|
-
|
|
3
|
-
const counter: BasedQueryFunction<
|
|
4
|
-
{
|
|
5
|
-
msg: string
|
|
6
|
-
gurt: number
|
|
7
|
-
} | void,
|
|
8
|
-
{ cnt: number }
|
|
9
|
-
> = async (based, payload, update) => {
|
|
10
|
-
let cnt = 0
|
|
11
|
-
const timer = setInterval(() => {
|
|
12
|
-
update({ cnt: ++cnt })
|
|
13
|
-
}, 100)
|
|
14
|
-
return () => {
|
|
15
|
-
clearInterval(timer)
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default counter
|
|
20
|
-
|
|
21
|
-
/*
|
|
22
|
-
import type HelloWorld from '../../type-gen/test/examples/helloWorld/index.ts'
|
|
23
|
-
call(
|
|
24
|
-
name: 'hello-world',
|
|
25
|
-
payload: Parameters<typeof HelloWorld>[1],
|
|
26
|
-
opts?: CallOptions
|
|
27
|
-
): Parameters<Parameters<typeof HelloWorld>[2]>[0],
|
|
28
|
-
*/
|
package/test/types.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import test from 'ava'
|
|
2
|
-
import { updateTypes } from '../src'
|
|
3
|
-
import { join } from 'path'
|
|
4
|
-
import { readFile } from 'fs-extra'
|
|
5
|
-
|
|
6
|
-
test.serial('Generate types file from examples', async (t) => {
|
|
7
|
-
const result = await updateTypes([
|
|
8
|
-
{
|
|
9
|
-
config: require('./examples/helloWorld/based.config.json'),
|
|
10
|
-
path: join(__dirname, '/examples/helloWorld/index.ts'),
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
config: require('./examples/query/based.config.json'),
|
|
14
|
-
path: join(__dirname, '/examples/query/index.ts'),
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
config: { name: 'db:set', type: 'function' },
|
|
18
|
-
payload: 'any',
|
|
19
|
-
result: 'any',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
config: { name: 'db:update-schema', type: 'function' },
|
|
23
|
-
payload: 'any',
|
|
24
|
-
result: 'any',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
config: { name: 'db', type: 'query' },
|
|
28
|
-
payload: 'any',
|
|
29
|
-
result: 'any',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
config: { name: 'db:schema', type: 'query' },
|
|
33
|
-
payload: 'any',
|
|
34
|
-
result: 'any',
|
|
35
|
-
},
|
|
36
|
-
])
|
|
37
|
-
|
|
38
|
-
const file = await readFile(join(__dirname, '../../client/dist/index.d.ts'), {
|
|
39
|
-
encoding: 'utf-8',
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
t.is(result, join(__dirname, '../../client/dist/index.d.ts'))
|
|
43
|
-
t.true(file.includes('counter'))
|
|
44
|
-
t.true(file.includes('db:schema'))
|
|
45
|
-
t.true(file.includes('db:update-schema'))
|
|
46
|
-
t.true(file.includes('db:set'))
|
|
47
|
-
t.true(file.includes('hello-world'))
|
|
48
|
-
})
|
package/tsconfig.json
DELETED