@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.
Files changed (70) hide show
  1. package/dist/src/index.d.ts +16 -0
  2. package/dist/src/index.js +44 -0
  3. package/dist/src/index.js.map +1 -0
  4. package/dist/src/parseCode.d.ts +1 -0
  5. package/dist/{parseCode.js → src/parseCode.js} +1 -0
  6. package/dist/src/parseCode.js.map +1 -0
  7. package/dist/src/updateTypesPath.d.ts +14 -0
  8. package/dist/src/updateTypesPath.js +84 -0
  9. package/dist/src/updateTypesPath.js.map +1 -0
  10. package/package.json +18 -17
  11. package/dist/auth.d.ts +0 -16
  12. package/dist/auth.d.ts.map +0 -1
  13. package/dist/auth.js +0 -3
  14. package/dist/auth.js.map +0 -1
  15. package/dist/channel.d.ts +0 -6
  16. package/dist/channel.d.ts.map +0 -1
  17. package/dist/channel.js +0 -7
  18. package/dist/channel.js.map +0 -1
  19. package/dist/client.d.ts +0 -18
  20. package/dist/client.d.ts.map +0 -1
  21. package/dist/client.js +0 -7
  22. package/dist/client.js.map +0 -1
  23. package/dist/context.d.ts +0 -100
  24. package/dist/context.d.ts.map +0 -1
  25. package/dist/context.js +0 -39
  26. package/dist/context.js.map +0 -1
  27. package/dist/fromAst.d.ts +0 -4
  28. package/dist/fromAst.d.ts.map +0 -1
  29. package/dist/fromAst.js +0 -34
  30. package/dist/fromAst.js.map +0 -1
  31. package/dist/function.d.ts +0 -1
  32. package/dist/function.d.ts.map +0 -1
  33. package/dist/function.js +0 -1
  34. package/dist/function.js.map +0 -1
  35. package/dist/functions.d.ts +0 -181
  36. package/dist/functions.d.ts.map +0 -1
  37. package/dist/functions.js +0 -29
  38. package/dist/functions.js.map +0 -1
  39. package/dist/geo.d.ts +0 -36
  40. package/dist/geo.d.ts.map +0 -1
  41. package/dist/geo.js +0 -3
  42. package/dist/geo.js.map +0 -1
  43. package/dist/index.d.ts +0 -13
  44. package/dist/index.d.ts.map +0 -1
  45. package/dist/index.js +0 -87
  46. package/dist/index.js.map +0 -1
  47. package/dist/parseAst.d.ts +0 -4
  48. package/dist/parseAst.d.ts.map +0 -1
  49. package/dist/parseAst.js +0 -34
  50. package/dist/parseAst.js.map +0 -1
  51. package/dist/parseCode.d.ts +0 -7
  52. package/dist/parseCode.d.ts.map +0 -1
  53. package/dist/parseCode.js.map +0 -1
  54. package/dist/query.d.ts +0 -7
  55. package/dist/query.d.ts.map +0 -1
  56. package/dist/query.js +0 -7
  57. package/dist/query.js.map +0 -1
  58. package/dist/stream.d.ts +0 -40
  59. package/dist/stream.d.ts.map +0 -1
  60. package/dist/stream.js +0 -63
  61. package/dist/stream.js.map +0 -1
  62. package/dist/uws.d.ts +0 -469
  63. package/src/index.ts +0 -122
  64. package/src/parseCode.ts +0 -53
  65. package/test/examples/helloWorld/based.config.json +0 -4
  66. package/test/examples/helloWorld/index.ts +0 -30
  67. package/test/examples/query/based.config.json +0 -4
  68. package/test/examples/query/index.ts +0 -28
  69. package/test/types.ts +0 -48
  70. 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
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "rootDir": "src",
5
- "outDir": "dist",
6
- "declarationMap": true
7
- },
8
- "include": ["src/**/*", "src/**/*.json"],
9
- "exclude": ["node_modules", "test", "dist", "tmp", "examples"]
10
- }