convex-tracer 0.1.0 → 0.1.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.
Files changed (61) hide show
  1. package/dist/client/helpers.d.ts.map +1 -1
  2. package/dist/client/index.d.ts +24 -4
  3. package/dist/client/index.d.ts.map +1 -1
  4. package/dist/client/index.js +18 -1
  5. package/dist/client/index.js.map +1 -1
  6. package/dist/component/_generated/component.d.ts +55 -10
  7. package/dist/component/_generated/component.d.ts.map +1 -1
  8. package/dist/component/lib.d.ts +58 -25
  9. package/dist/component/lib.d.ts.map +1 -1
  10. package/dist/component/lib.js +60 -21
  11. package/dist/component/lib.js.map +1 -1
  12. package/dist/component/schema.d.ts +25 -18
  13. package/dist/component/schema.d.ts.map +1 -1
  14. package/dist/component/schema.js +6 -1
  15. package/dist/component/schema.js.map +1 -1
  16. package/dist/component/types.d.ts +138 -80
  17. package/dist/component/types.d.ts.map +1 -1
  18. package/dist/component/types.js +2 -0
  19. package/dist/component/types.js.map +1 -1
  20. package/package.json +1 -1
  21. package/src/client/helpers.ts +11 -1
  22. package/src/client/index.ts +42 -9
  23. package/src/component/_generated/component.ts +61 -10
  24. package/src/component/lib.ts +72 -28
  25. package/src/component/schema.ts +6 -1
  26. package/src/component/types.ts +4 -0
  27. package/dist/client/_generated/_ignore.d.ts +0 -1
  28. package/dist/client/_generated/_ignore.d.ts.map +0 -1
  29. package/dist/client/_generated/_ignore.js +0 -3
  30. package/dist/client/_generated/_ignore.js.map +0 -1
  31. package/dist/client/helpers.d.ts +0 -31
  32. package/dist/client/helpers.js +0 -177
  33. package/dist/client/helpers.js.map +0 -1
  34. package/dist/client/tracer-api/index.d.ts +0 -27
  35. package/dist/client/tracer-api/index.js +0 -177
  36. package/dist/client/tracer-api/index.js.map +0 -1
  37. package/dist/client/tracer-api/types.d.ts +0 -143
  38. package/dist/client/tracer-api/types.js +0 -2
  39. package/dist/client/tracer-api/types.js.map +0 -1
  40. package/dist/client/types.d.ts +0 -168
  41. package/dist/client/types.js +0 -2
  42. package/dist/client/types.js.map +0 -1
  43. package/dist/component/_generated/api.d.ts +0 -36
  44. package/dist/component/_generated/api.js +0 -31
  45. package/dist/component/_generated/api.js.map +0 -1
  46. package/dist/component/_generated/dataModel.d.ts +0 -46
  47. package/dist/component/_generated/dataModel.js +0 -11
  48. package/dist/component/_generated/dataModel.js.map +0 -1
  49. package/dist/component/_generated/server.d.ts +0 -121
  50. package/dist/component/_generated/server.js +0 -78
  51. package/dist/component/_generated/server.js.map +0 -1
  52. package/dist/component/convex.config.d.ts +0 -3
  53. package/dist/component/convex.config.d.ts.map +0 -1
  54. package/dist/component/convex.config.js +0 -3
  55. package/dist/component/convex.config.js.map +0 -1
  56. package/dist/react/index.d.ts +0 -6
  57. package/dist/react/index.js +0 -11
  58. package/dist/react/index.js.map +0 -1
  59. package/dist/react/types.d.ts +0 -8
  60. package/dist/react/types.js +0 -2
  61. package/dist/react/types.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataModel.js","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AASH,OAAO,MAAM,MAAM,cAAc,CAAC"}
@@ -1,121 +0,0 @@
1
- /**
2
- * Generated utilities for implementing server-side Convex query and mutation functions.
3
- *
4
- * THIS CODE IS AUTOMATICALLY GENERATED.
5
- *
6
- * To regenerate, run `npx convex dev`.
7
- * @module
8
- */
9
- import type { ActionBuilder, HttpActionBuilder, MutationBuilder, QueryBuilder, GenericActionCtx, GenericMutationCtx, GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter } from "convex/server";
10
- import type { DataModel } from "./dataModel.js";
11
- /**
12
- * Define a query in this Convex app's public API.
13
- *
14
- * This function will be allowed to read your Convex database and will be accessible from the client.
15
- *
16
- * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
17
- * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
18
- */
19
- export declare const query: QueryBuilder<DataModel, "public">;
20
- /**
21
- * Define a query that is only accessible from other Convex functions (but not from the client).
22
- *
23
- * This function will be allowed to read from your Convex database. It will not be accessible from the client.
24
- *
25
- * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
26
- * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
27
- */
28
- export declare const internalQuery: QueryBuilder<DataModel, "internal">;
29
- /**
30
- * Define a mutation in this Convex app's public API.
31
- *
32
- * This function will be allowed to modify your Convex database and will be accessible from the client.
33
- *
34
- * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
35
- * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
36
- */
37
- export declare const mutation: MutationBuilder<DataModel, "public">;
38
- /**
39
- * Define a mutation that is only accessible from other Convex functions (but not from the client).
40
- *
41
- * This function will be allowed to modify your Convex database. It will not be accessible from the client.
42
- *
43
- * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
44
- * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
45
- */
46
- export declare const internalMutation: MutationBuilder<DataModel, "internal">;
47
- /**
48
- * Define an action in this Convex app's public API.
49
- *
50
- * An action is a function which can execute any JavaScript code, including non-deterministic
51
- * code and code with side-effects, like calling third-party services.
52
- * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
53
- * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
54
- *
55
- * @param func - The action. It receives an {@link ActionCtx} as its first argument.
56
- * @returns The wrapped action. Include this as an `export` to name it and make it accessible.
57
- */
58
- export declare const action: ActionBuilder<DataModel, "public">;
59
- /**
60
- * Define an action that is only accessible from other Convex functions (but not from the client).
61
- *
62
- * @param func - The function. It receives an {@link ActionCtx} as its first argument.
63
- * @returns The wrapped function. Include this as an `export` to name it and make it accessible.
64
- */
65
- export declare const internalAction: ActionBuilder<DataModel, "internal">;
66
- /**
67
- * Define an HTTP action.
68
- *
69
- * The wrapped function will be used to respond to HTTP requests received
70
- * by a Convex deployment if the requests matches the path and method where
71
- * this action is routed. Be sure to route your httpAction in `convex/http.js`.
72
- *
73
- * @param func - The function. It receives an {@link ActionCtx} as its first argument
74
- * and a Fetch API `Request` object as its second.
75
- * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
76
- */
77
- export declare const httpAction: HttpActionBuilder;
78
- /**
79
- * A set of services for use within Convex query functions.
80
- *
81
- * The query context is passed as the first argument to any Convex query
82
- * function run on the server.
83
- *
84
- * If you're using code generation, use the `QueryCtx` type in `convex/_generated/server.d.ts` instead.
85
- */
86
- export type QueryCtx = GenericQueryCtx<DataModel>;
87
- /**
88
- * A set of services for use within Convex mutation functions.
89
- *
90
- * The mutation context is passed as the first argument to any Convex mutation
91
- * function run on the server.
92
- *
93
- * If you're using code generation, use the `MutationCtx` type in `convex/_generated/server.d.ts` instead.
94
- */
95
- export type MutationCtx = GenericMutationCtx<DataModel>;
96
- /**
97
- * A set of services for use within Convex action functions.
98
- *
99
- * The action context is passed as the first argument to any Convex action
100
- * function run on the server.
101
- */
102
- export type ActionCtx = GenericActionCtx<DataModel>;
103
- /**
104
- * An interface to read from the database within Convex query functions.
105
- *
106
- * The two entry points are {@link DatabaseReader.get}, which fetches a single
107
- * document by its {@link Id}, or {@link DatabaseReader.query}, which starts
108
- * building a query.
109
- */
110
- export type DatabaseReader = GenericDatabaseReader<DataModel>;
111
- /**
112
- * An interface to read from and write to the database within Convex mutation
113
- * functions.
114
- *
115
- * Convex guarantees that all writes within a single mutation are
116
- * executed atomically, so you never have to worry about partial writes leaving
117
- * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
118
- * for the guarantees Convex provides your functions.
119
- */
120
- export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
121
- //# sourceMappingURL=server.d.ts.map
@@ -1,78 +0,0 @@
1
- /* eslint-disable */
2
- /**
3
- * Generated utilities for implementing server-side Convex query and mutation functions.
4
- *
5
- * THIS CODE IS AUTOMATICALLY GENERATED.
6
- *
7
- * To regenerate, run `npx convex dev`.
8
- * @module
9
- */
10
- import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, } from "convex/server";
11
- /**
12
- * Define a query in this Convex app's public API.
13
- *
14
- * This function will be allowed to read your Convex database and will be accessible from the client.
15
- *
16
- * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
17
- * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
18
- */
19
- export const query = queryGeneric;
20
- /**
21
- * Define a query that is only accessible from other Convex functions (but not from the client).
22
- *
23
- * This function will be allowed to read from your Convex database. It will not be accessible from the client.
24
- *
25
- * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
26
- * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
27
- */
28
- export const internalQuery = internalQueryGeneric;
29
- /**
30
- * Define a mutation in this Convex app's public API.
31
- *
32
- * This function will be allowed to modify your Convex database and will be accessible from the client.
33
- *
34
- * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
35
- * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
36
- */
37
- export const mutation = mutationGeneric;
38
- /**
39
- * Define a mutation that is only accessible from other Convex functions (but not from the client).
40
- *
41
- * This function will be allowed to modify your Convex database. It will not be accessible from the client.
42
- *
43
- * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
44
- * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
45
- */
46
- export const internalMutation = internalMutationGeneric;
47
- /**
48
- * Define an action in this Convex app's public API.
49
- *
50
- * An action is a function which can execute any JavaScript code, including non-deterministic
51
- * code and code with side-effects, like calling third-party services.
52
- * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
53
- * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
54
- *
55
- * @param func - The action. It receives an {@link ActionCtx} as its first argument.
56
- * @returns The wrapped action. Include this as an `export` to name it and make it accessible.
57
- */
58
- export const action = actionGeneric;
59
- /**
60
- * Define an action that is only accessible from other Convex functions (but not from the client).
61
- *
62
- * @param func - The function. It receives an {@link ActionCtx} as its first argument.
63
- * @returns The wrapped function. Include this as an `export` to name it and make it accessible.
64
- */
65
- export const internalAction = internalActionGeneric;
66
- /**
67
- * Define an HTTP action.
68
- *
69
- * The wrapped function will be used to respond to HTTP requests received
70
- * by a Convex deployment if the requests matches the path and method where
71
- * this action is routed. Be sure to route your httpAction in `convex/http.js`.
72
- *
73
- * @param func - The function. It receives an {@link ActionCtx} as its first argument
74
- * and a Fetch API `Request` object as its second.
75
- * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
76
- */
77
- export const httpAction = httpActionGeneric;
78
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAaH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAsC,YAAY,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GACxB,oBAAoB,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAyC,eAAe,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,uBAAuB,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAuC,aAAa,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,qBAAqB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAsB,iBAAiB,CAAC"}
@@ -1,3 +0,0 @@
1
- declare const _default: import("convex/server").ComponentDefinition<any>;
2
- export default _default;
3
- //# sourceMappingURL=convex.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":";AAEA,wBAAyC"}
@@ -1,3 +0,0 @@
1
- import { defineComponent } from "convex/server";
2
- export default defineComponent("tracer");
3
- //# sourceMappingURL=convex.config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convex.config.js","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,eAAe,eAAe,CAAC,QAAQ,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { FunctionReference, FunctionReturnType } from "convex/server";
2
- import type { EmptyObject, OptionalTracedArgs } from "./types";
3
- export declare function useTracedQuery<TQuery extends FunctionReference<"mutation">>(fnRef: TQuery): OptionalTracedArgs<TQuery> extends [args?: EmptyObject] ? (args?: EmptyObject) => Promise<FunctionReturnType<TQuery>> : OptionalTracedArgs<TQuery> extends [args: infer Args] ? (args: Args) => Promise<FunctionReturnType<TQuery>> : never;
4
- export declare function useTracedMutation<TMutation extends FunctionReference<"mutation">>(fnRef: TMutation): OptionalTracedArgs<TMutation> extends [args?: EmptyObject] ? (args?: EmptyObject) => Promise<FunctionReturnType<TMutation>> : OptionalTracedArgs<TMutation> extends [args: infer Args] ? (args: Args) => Promise<FunctionReturnType<TMutation>> : never;
5
- export declare function useTracedAction<TAction extends FunctionReference<"action">>(fnRef: TAction): OptionalTracedArgs<TAction> extends [args?: EmptyObject] ? (args?: EmptyObject) => Promise<FunctionReturnType<TAction>> : OptionalTracedArgs<TAction> extends [args: infer Args] ? (args: Args) => Promise<FunctionReturnType<TAction>> : never;
6
- //# sourceMappingURL=index.d.ts.map
@@ -1,11 +0,0 @@
1
- import { useAction, useMutation } from "convex/react";
2
- export function useTracedQuery(fnRef) {
3
- return useMutation(fnRef);
4
- }
5
- export function useTracedMutation(fnRef) {
6
- return useMutation(fnRef);
7
- }
8
- export function useTracedAction(fnRef) {
9
- return useAction(fnRef);
10
- }
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAKtD,MAAM,UAAU,cAAc,CAC5B,KAAa;IAMb,OAAO,WAAW,CAAC,KAAK,CAAQ,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAG/B,KAAgB;IAMhB,OAAO,WAAW,CAAC,KAAK,CAAQ,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,KAAc;IAMd,OAAO,SAAS,CAAC,KAAK,CAAQ,CAAC;AACjC,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { AnyFunctionReference } from "../client/types";
2
- export type EmptyObject = Record<string, never>;
3
- export type OmitTraceContext<T> = T extends {
4
- __traceContext?: any;
5
- } ? Omit<T, "__traceContext"> : T;
6
- export type ArgsWithoutTrace<Args> = Args extends Record<string, any> ? OmitTraceContext<Args> : Args;
7
- export type OptionalTracedArgs<FuncRef extends AnyFunctionReference> = keyof OmitTraceContext<FuncRef["_args"]> extends never ? [args?: EmptyObject] : [args: OmitTraceContext<FuncRef["_args"]>];
8
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/react/types.ts"],"names":[],"mappings":""}