@devwithbobby/loops 0.1.17 → 0.1.19
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/README.md +46 -23
- package/dist/client/index.d.ts +105 -85
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +26 -7
- package/dist/component/_generated/api.d.ts +44 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/{src → dist}/component/_generated/api.js +10 -3
- package/dist/component/_generated/component.d.ts +259 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +9 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +10 -0
- package/{src → dist}/component/_generated/server.d.ts +10 -38
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/{src → dist}/component/_generated/server.js +9 -22
- package/dist/component/convex.config.d.ts.map +1 -1
- package/dist/component/convex.config.js +0 -22
- package/dist/component/helpers.d.ts +1 -1
- package/dist/component/helpers.d.ts.map +1 -1
- package/dist/component/helpers.js +1 -2
- package/dist/component/http.d.ts.map +1 -1
- package/dist/component/http.js +0 -1
- package/dist/component/lib.d.ts +7 -0
- package/dist/component/lib.d.ts.map +1 -1
- package/dist/component/lib.js +62 -20
- package/dist/component/schema.d.ts +2 -2
- package/dist/component/tables/contacts.d.ts.map +1 -1
- package/dist/component/tables/emailOperations.d.ts +4 -4
- package/dist/component/tables/emailOperations.d.ts.map +1 -1
- package/dist/test.d.ts +83 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +16 -0
- package/dist/utils.d.ts +6 -6
- package/package.json +15 -9
- package/src/client/index.ts +31 -14
- package/src/component/_generated/api.ts +60 -0
- package/src/component/_generated/component.ts +323 -0
- package/src/component/_generated/{dataModel.d.ts → dataModel.ts} +1 -1
- package/src/component/_generated/server.ts +161 -0
- package/src/component/convex.config.ts +0 -27
- package/src/component/helpers.ts +2 -2
- package/src/component/http.ts +0 -4
- package/src/component/lib.ts +69 -20
- package/src/test.ts +27 -0
- package/dist/client/types.d.ts +0 -24
- package/dist/client/types.d.ts.map +0 -1
- package/dist/client/types.js +0 -0
- package/src/component/_generated/api.d.ts +0 -47
package/src/test.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { TestConvex } from "convex-test";
|
|
2
|
+
import type { GenericSchema, SchemaDefinition } from "convex/server";
|
|
3
|
+
import schema from "./component/schema.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Register the Loops component with the test convex instance.
|
|
7
|
+
*
|
|
8
|
+
* @param t - The test convex instance from convexTest().
|
|
9
|
+
* @param name - The name of the component as registered in convex.config.ts.
|
|
10
|
+
* @param modules - The modules object from import.meta.glob. Required.
|
|
11
|
+
*/
|
|
12
|
+
export function register(
|
|
13
|
+
t: TestConvex<SchemaDefinition<GenericSchema, boolean>>,
|
|
14
|
+
name: string = "loops",
|
|
15
|
+
modules?: Record<string, () => Promise<unknown>>,
|
|
16
|
+
) {
|
|
17
|
+
if (!modules) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
"modules parameter is required. Pass import.meta.glob from your test file.",
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
t.registerComponent(name, schema, modules);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { schema };
|
|
26
|
+
|
|
27
|
+
export default { register, schema };
|
package/dist/client/types.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Expand, FunctionArgs, FunctionReference, FunctionReturnType, StorageActionWriter, StorageReader } from "convex/server";
|
|
2
|
-
import type { GenericId } from "convex/values";
|
|
3
|
-
export type RunQueryCtx = {
|
|
4
|
-
runQuery: <Query extends FunctionReference<"query", "internal">>(query: Query, args: FunctionArgs<Query>) => Promise<FunctionReturnType<Query>>;
|
|
5
|
-
};
|
|
6
|
-
export type RunMutationCtx = RunQueryCtx & {
|
|
7
|
-
runMutation: <Mutation extends FunctionReference<"mutation", "internal">>(mutation: Mutation, args: FunctionArgs<Mutation>) => Promise<FunctionReturnType<Mutation>>;
|
|
8
|
-
};
|
|
9
|
-
export type RunActionCtx = RunMutationCtx & {
|
|
10
|
-
runAction<Action extends FunctionReference<"action", "internal">>(action: Action, args: FunctionArgs<Action>): Promise<FunctionReturnType<Action>>;
|
|
11
|
-
};
|
|
12
|
-
export type ActionCtx = RunActionCtx & {
|
|
13
|
-
storage: StorageActionWriter;
|
|
14
|
-
};
|
|
15
|
-
export type QueryCtx = RunQueryCtx & {
|
|
16
|
-
storage: StorageReader;
|
|
17
|
-
};
|
|
18
|
-
export type OpaqueIds<T> = T extends GenericId<infer _T> ? string : T extends (infer U)[] ? OpaqueIds<U>[] : T extends ArrayBuffer ? ArrayBuffer : T extends object ? {
|
|
19
|
-
[K in keyof T]: OpaqueIds<T[K]>;
|
|
20
|
-
} : T;
|
|
21
|
-
export type UseApi<API> = Expand<{
|
|
22
|
-
[mod in keyof API]: API[mod] extends FunctionReference<infer FType, "public", infer FArgs, infer FReturnType, infer FComponentPath> ? FunctionReference<FType, "internal", OpaqueIds<FArgs>, OpaqueIds<FReturnType>, FComponentPath> : UseApi<API[mod]>;
|
|
23
|
-
}>;
|
|
24
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,CAAC,KAAK,SAAS,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,EAC9D,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,YAAY,C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,CACrD,MAAM,KAAK,EACX,QAAQ,EACR,MAAM,KAAK,EACX,MAAM,WAAW,EACjB,MAAM,cAAc,CACpB,GACE,iBAAiB,CACjB,KAAK,EACL,UAAU,EACV,SAAS,CAAC,KAAK,CAAC,EAChB,SAAS,CAAC,WAAW,CAAC,EACtB,cAAc,CACd,GACA,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACnB,CAAC,CAAC"}
|
package/dist/client/types.js
DELETED
|
File without changes
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* Generated `api` utility.
|
|
4
|
-
*
|
|
5
|
-
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
-
*
|
|
7
|
-
* To regenerate, run `npx convex dev`.
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type * as lib from "../lib.js";
|
|
12
|
-
|
|
13
|
-
import type {
|
|
14
|
-
ApiFromModules,
|
|
15
|
-
FilterApi,
|
|
16
|
-
FunctionReference,
|
|
17
|
-
} from "convex/server";
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* A utility for referencing Convex functions in your app's API.
|
|
21
|
-
*
|
|
22
|
-
* Usage:
|
|
23
|
-
* ```js
|
|
24
|
-
* const myFunctionReference = api.myModule.myFunction;
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
declare const fullApi: ApiFromModules<{
|
|
28
|
-
lib: typeof lib;
|
|
29
|
-
}>;
|
|
30
|
-
export type Mounts = ApiFromModules<{
|
|
31
|
-
lib: typeof lib;
|
|
32
|
-
}>;
|
|
33
|
-
// For now fullApiWithMounts is only fullApi which provides
|
|
34
|
-
// jump-to-definition in component client code.
|
|
35
|
-
// Use Mounts for the same type without the inference.
|
|
36
|
-
declare const fullApiWithMounts: typeof fullApi;
|
|
37
|
-
|
|
38
|
-
export declare const api: FilterApi<
|
|
39
|
-
typeof fullApiWithMounts,
|
|
40
|
-
FunctionReference<any, "public">
|
|
41
|
-
>;
|
|
42
|
-
export declare const internal: FilterApi<
|
|
43
|
-
typeof fullApiWithMounts,
|
|
44
|
-
FunctionReference<any, "internal">
|
|
45
|
-
>;
|
|
46
|
-
|
|
47
|
-
export declare const components: {};
|