@based/functions 3.3.2 → 3.4.0

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/client.d.ts CHANGED
@@ -1,20 +1,44 @@
1
+
2
+ import type FN_Type_1 from '/Users/marcovieira/dev/sandbox/2/based/packages/type-gen/test/examples/helloWorld/index.ts';
3
+ import type Q_Type_1 from '/Users/marcovieira/dev/sandbox/2/based/packages/type-gen/test/examples/query/index.ts';
1
4
  import { AuthState } from './auth.js';
2
5
  import { BasedChannel } from './channel.js';
3
6
  import { Context } from './context.js';
4
7
  import { BasedQuery } from './query.js';
5
8
  import { StreamFunctionOpts } from './stream.js';
9
+ import { Geo } from './geo.js';
6
10
  import type { DbClient } from '@based/db';
7
11
  export declare abstract class BasedFunctionClient {
8
12
  server: any;
9
13
  db: DbClient;
10
14
  dbs: Record<string, DbClient>;
11
- abstract call(name: string, payload?: any, ctx?: Context): Promise<any>;
15
+
16
+
17
+ abstract call(
18
+ name: 'hello-world',
19
+ payload: Parameters<typeof FN_Type_1>[1],
20
+ ctx?: Context
21
+ ): ReturnType<typeof FN_Type_1>;
22
+
23
+ abstract call(
24
+ name: 'db:set',
25
+ payload: any,
26
+ ctx?: Context
27
+ ): Promise<any>
28
+
29
+ abstract call(
30
+ name: 'db:update-schema',
31
+ payload: any,
32
+ ctx?: Context
33
+ ): Promise<any>
34
+
12
35
  abstract query(name: string, payload?: any, ctx?: {
13
36
  [key: string]: any;
14
37
  } | Context): BasedQuery;
15
38
  abstract channel(name: string, payload?: any): BasedChannel;
16
39
  abstract stream(name: string, payload: StreamFunctionOpts, ctx?: Context): Promise<any>;
17
40
  abstract sendAuthState(ctx: Context, authState: AuthState): void;
41
+ abstract geo(ctx: Context): Geo;
18
42
  abstract renewAuthState(ctx: Context, authState?: AuthState): Promise<AuthState>;
19
43
  }
20
44
  export type QueryMap = {
@@ -3,6 +3,7 @@ import { BasedChannel } from './channel.js';
3
3
  import { Context } from './context.js';
4
4
  import { BasedQuery } from './query.js';
5
5
  import { StreamFunctionOpts } from './stream.js';
6
+ import { Geo } from './geo.js';
6
7
  import type { DbClient } from '@based/db';
7
8
  export declare abstract class BasedFunctionClient {
8
9
  server: any;
@@ -15,6 +16,7 @@ export declare abstract class BasedFunctionClient {
15
16
  abstract channel(name: string, payload?: any): BasedChannel;
16
17
  abstract stream(name: string, payload: StreamFunctionOpts, ctx?: Context): Promise<any>;
17
18
  abstract sendAuthState(ctx: Context, authState: AuthState): void;
19
+ abstract geo(ctx: Context): Geo;
18
20
  abstract renewAuthState(ctx: Context, authState?: AuthState): Promise<AuthState>;
19
21
  }
20
22
  export type QueryMap = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@based/functions",
3
- "version": "3.3.2",
3
+ "version": "3.4.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,8 +17,8 @@
17
17
  },
18
18
  "sideEffects": false,
19
19
  "dependencies": {
20
- "@based/db": "0.1.4",
21
- "@based/utils": "1.1.1",
20
+ "@based/db": "0.2.0",
21
+ "@based/utils": "1.2.0",
22
22
  "utility-types": "^3.10.0"
23
23
  },
24
24
  "devDependencies": {