@devwithbobby/loops 0.1.12 → 0.1.13

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.
@@ -1,3 +1,4 @@
1
+ import { z } from "zod";
1
2
  /**
2
3
  * Validators for Loops API requests and component operations
3
4
  */
@@ -5,14 +6,30 @@
5
6
  * Validator for contact data
6
7
  * Used for creating and updating contacts
7
8
  */
8
- export declare const contactValidator: any;
9
+ export declare const contactValidator: z.ZodObject<{
10
+ email: z.ZodString;
11
+ firstName: z.ZodOptional<z.ZodString>;
12
+ lastName: z.ZodOptional<z.ZodString>;
13
+ userId: z.ZodOptional<z.ZodString>;
14
+ source: z.ZodOptional<z.ZodString>;
15
+ subscribed: z.ZodOptional<z.ZodBoolean>;
16
+ userGroup: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>;
9
18
  /**
10
19
  * Validator for transactional email requests
11
20
  */
12
- export declare const transactionalEmailValidator: any;
21
+ export declare const transactionalEmailValidator: z.ZodObject<{
22
+ transactionalId: z.ZodOptional<z.ZodString>;
23
+ email: z.ZodString;
24
+ dataVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
25
+ }, z.core.$strip>;
13
26
  /**
14
27
  * Validator for event requests
15
28
  * Used for sending events that trigger email workflows
16
29
  */
17
- export declare const eventValidator: any;
30
+ export declare const eventValidator: z.ZodObject<{
31
+ email: z.ZodString;
32
+ eventName: z.ZodString;
33
+ eventProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
34
+ }, z.core.$strip>;
18
35
  //# sourceMappingURL=validators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/component/validators.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,KAQ3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,2BAA2B,KAItC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc,KAIzB,CAAC"}
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/component/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;iBAQ3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;iBAItC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;iBAIzB,CAAC"}
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,187 @@
1
- export declare const zq: any;
2
- export declare const zm: any;
3
- export declare const za: any;
1
+ export declare const zq: <A extends import("zod").ZodType | Record<string, import("zod").ZodType>, R extends import("zod").ZodType | undefined = undefined, Visibility extends import("convex/server").FunctionVisibility = "public">(config: {
2
+ args?: A | undefined;
3
+ handler: (ctx: import("convex/server").GenericQueryCtx<{
4
+ contacts: {
5
+ document: {
6
+ _id: import("convex/values").GenericId<"contacts">;
7
+ _creationTime: number;
8
+ firstName?: string | undefined;
9
+ lastName?: string | undefined;
10
+ userId?: string | undefined;
11
+ source?: string | undefined;
12
+ subscribed?: boolean | undefined;
13
+ userGroup?: string | undefined;
14
+ loopsContactId?: string | undefined;
15
+ email: string;
16
+ createdAt: number;
17
+ updatedAt: number;
18
+ };
19
+ fieldPaths: ("email" | "firstName" | "lastName" | "userId" | "source" | "subscribed" | "userGroup" | "loopsContactId" | "createdAt" | "updatedAt" | "_creationTime") | "_id";
20
+ indexes: {
21
+ email: ["email", "_creationTime"];
22
+ userId: ["userId", "_creationTime"];
23
+ userGroup: ["userGroup", "_creationTime"];
24
+ source: ["source", "_creationTime"];
25
+ subscribed: ["subscribed", "_creationTime"];
26
+ by_id: ["_id"];
27
+ by_creation_time: ["_creationTime"];
28
+ };
29
+ searchIndexes: {};
30
+ vectorIndexes: {};
31
+ };
32
+ emailOperations: {
33
+ document: {
34
+ _id: import("convex/values").GenericId<"emailOperations">;
35
+ _creationTime: number;
36
+ actorId?: string | undefined;
37
+ transactionalId?: string | undefined;
38
+ campaignId?: string | undefined;
39
+ loopId?: string | undefined;
40
+ eventName?: string | undefined;
41
+ messageId?: string | undefined;
42
+ metadata?: Record<string, any> | undefined;
43
+ email: string;
44
+ success: boolean;
45
+ operationType: "transactional" | "event" | "campaign" | "loop";
46
+ timestamp: number;
47
+ };
48
+ fieldPaths: ("email" | "success" | "operationType" | "actorId" | "transactionalId" | "campaignId" | "loopId" | "eventName" | "timestamp" | "messageId" | "metadata" | "_creationTime" | `metadata.${string}`) | "_id";
49
+ indexes: {
50
+ email: ["email", "timestamp", "_creationTime"];
51
+ actorId: ["actorId", "timestamp", "_creationTime"];
52
+ operationType: ["operationType", "timestamp", "_creationTime"];
53
+ timestamp: ["timestamp", "_creationTime"];
54
+ by_id: ["_id"];
55
+ by_creation_time: ["_creationTime"];
56
+ };
57
+ searchIndexes: {};
58
+ vectorIndexes: {};
59
+ };
60
+ }>, args: import("zodvex").ZodToConvexArgs<A extends undefined ? Record<string, never> : A>) => import("zodvex").InferHandlerReturns<R> | Promise<import("zodvex").InferHandlerReturns<R>>;
61
+ returns?: R | undefined;
62
+ }) => import("convex/server").RegisteredQuery<Visibility, import("zodvex").ZodToConvexArgs<A extends undefined ? Record<string, never> : A>, Promise<import("zodvex").InferReturns<R>>>;
63
+ export declare const zm: <A extends import("zod").ZodType | Record<string, import("zod").ZodType>, R extends import("zod").ZodType | undefined = undefined, Visibility extends import("convex/server").FunctionVisibility = "public">(config: {
64
+ args?: A | undefined;
65
+ handler: (ctx: import("convex/server").GenericMutationCtx<{
66
+ contacts: {
67
+ document: {
68
+ _id: import("convex/values").GenericId<"contacts">;
69
+ _creationTime: number;
70
+ firstName?: string | undefined;
71
+ lastName?: string | undefined;
72
+ userId?: string | undefined;
73
+ source?: string | undefined;
74
+ subscribed?: boolean | undefined;
75
+ userGroup?: string | undefined;
76
+ loopsContactId?: string | undefined;
77
+ email: string;
78
+ createdAt: number;
79
+ updatedAt: number;
80
+ };
81
+ fieldPaths: ("email" | "firstName" | "lastName" | "userId" | "source" | "subscribed" | "userGroup" | "loopsContactId" | "createdAt" | "updatedAt" | "_creationTime") | "_id";
82
+ indexes: {
83
+ email: ["email", "_creationTime"];
84
+ userId: ["userId", "_creationTime"];
85
+ userGroup: ["userGroup", "_creationTime"];
86
+ source: ["source", "_creationTime"];
87
+ subscribed: ["subscribed", "_creationTime"];
88
+ by_id: ["_id"];
89
+ by_creation_time: ["_creationTime"];
90
+ };
91
+ searchIndexes: {};
92
+ vectorIndexes: {};
93
+ };
94
+ emailOperations: {
95
+ document: {
96
+ _id: import("convex/values").GenericId<"emailOperations">;
97
+ _creationTime: number;
98
+ actorId?: string | undefined;
99
+ transactionalId?: string | undefined;
100
+ campaignId?: string | undefined;
101
+ loopId?: string | undefined;
102
+ eventName?: string | undefined;
103
+ messageId?: string | undefined;
104
+ metadata?: Record<string, any> | undefined;
105
+ email: string;
106
+ success: boolean;
107
+ operationType: "transactional" | "event" | "campaign" | "loop";
108
+ timestamp: number;
109
+ };
110
+ fieldPaths: ("email" | "success" | "operationType" | "actorId" | "transactionalId" | "campaignId" | "loopId" | "eventName" | "timestamp" | "messageId" | "metadata" | "_creationTime" | `metadata.${string}`) | "_id";
111
+ indexes: {
112
+ email: ["email", "timestamp", "_creationTime"];
113
+ actorId: ["actorId", "timestamp", "_creationTime"];
114
+ operationType: ["operationType", "timestamp", "_creationTime"];
115
+ timestamp: ["timestamp", "_creationTime"];
116
+ by_id: ["_id"];
117
+ by_creation_time: ["_creationTime"];
118
+ };
119
+ searchIndexes: {};
120
+ vectorIndexes: {};
121
+ };
122
+ }>, args: import("zodvex").ZodToConvexArgs<A extends undefined ? Record<string, never> : A>) => import("zodvex").InferHandlerReturns<R> | Promise<import("zodvex").InferHandlerReturns<R>>;
123
+ returns?: R | undefined;
124
+ }) => import("convex/server").RegisteredMutation<Visibility, import("zodvex").ZodToConvexArgs<A extends undefined ? Record<string, never> : A>, Promise<import("zodvex").InferReturns<R>>>;
125
+ export declare const za: <A extends import("zod").ZodType | Record<string, import("zod").ZodType>, R extends import("zod").ZodType | undefined = undefined, Visibility extends import("convex/server").FunctionVisibility = "public">(config: {
126
+ args?: A | undefined;
127
+ handler: (ctx: import("convex/server").GenericActionCtx<{
128
+ contacts: {
129
+ document: {
130
+ _id: import("convex/values").GenericId<"contacts">;
131
+ _creationTime: number;
132
+ firstName?: string | undefined;
133
+ lastName?: string | undefined;
134
+ userId?: string | undefined;
135
+ source?: string | undefined;
136
+ subscribed?: boolean | undefined;
137
+ userGroup?: string | undefined;
138
+ loopsContactId?: string | undefined;
139
+ email: string;
140
+ createdAt: number;
141
+ updatedAt: number;
142
+ };
143
+ fieldPaths: ("email" | "firstName" | "lastName" | "userId" | "source" | "subscribed" | "userGroup" | "loopsContactId" | "createdAt" | "updatedAt" | "_creationTime") | "_id";
144
+ indexes: {
145
+ email: ["email", "_creationTime"];
146
+ userId: ["userId", "_creationTime"];
147
+ userGroup: ["userGroup", "_creationTime"];
148
+ source: ["source", "_creationTime"];
149
+ subscribed: ["subscribed", "_creationTime"];
150
+ by_id: ["_id"];
151
+ by_creation_time: ["_creationTime"];
152
+ };
153
+ searchIndexes: {};
154
+ vectorIndexes: {};
155
+ };
156
+ emailOperations: {
157
+ document: {
158
+ _id: import("convex/values").GenericId<"emailOperations">;
159
+ _creationTime: number;
160
+ actorId?: string | undefined;
161
+ transactionalId?: string | undefined;
162
+ campaignId?: string | undefined;
163
+ loopId?: string | undefined;
164
+ eventName?: string | undefined;
165
+ messageId?: string | undefined;
166
+ metadata?: Record<string, any> | undefined;
167
+ email: string;
168
+ success: boolean;
169
+ operationType: "transactional" | "event" | "campaign" | "loop";
170
+ timestamp: number;
171
+ };
172
+ fieldPaths: ("email" | "success" | "operationType" | "actorId" | "transactionalId" | "campaignId" | "loopId" | "eventName" | "timestamp" | "messageId" | "metadata" | "_creationTime" | `metadata.${string}`) | "_id";
173
+ indexes: {
174
+ email: ["email", "timestamp", "_creationTime"];
175
+ actorId: ["actorId", "timestamp", "_creationTime"];
176
+ operationType: ["operationType", "timestamp", "_creationTime"];
177
+ timestamp: ["timestamp", "_creationTime"];
178
+ by_id: ["_id"];
179
+ by_creation_time: ["_creationTime"];
180
+ };
181
+ searchIndexes: {};
182
+ vectorIndexes: {};
183
+ };
184
+ }>, args: import("zodvex").ZodToConvexArgs<A extends undefined ? Record<string, never> : A>) => import("zodvex").InferHandlerReturns<R> | Promise<import("zodvex").InferHandlerReturns<R>>;
185
+ returns?: R | undefined;
186
+ }) => import("convex/server").RegisteredAction<Visibility, import("zodvex").ZodToConvexArgs<A extends undefined ? Record<string, never> : A>, Promise<import("zodvex").InferReturns<R>>>;
4
187
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,EAAE,KAAuB,CAAC;AACvC,eAAO,MAAM,EAAE,KAA6B,CAAC;AAC7C,eAAO,MAAM,EAAE,KAAyB,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uLAAuB,CAAC;AACvC,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0LAA6B,CAAC;AAC7C,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wLAAyB,CAAC"}
package/package.json CHANGED
@@ -1,103 +1,103 @@
1
1
  {
2
- "name": "@devwithbobby/loops",
3
- "version": "0.1.12",
4
- "description": "Convex component for integrating with Loops.so email marketing platform",
5
- "license": "Apache-2.0",
6
- "type": "module",
7
- "keywords": [
8
- "convex",
9
- "component",
10
- "template",
11
- "boilerplate",
12
- "bun",
13
- "biome",
14
- "typescript"
15
- ],
16
- "repository": {
17
- "type": "git",
18
- "url": "git+https://github.com/robertalv/loops.git"
19
- },
20
- "bugs": {
21
- "url": "https://github.com/robertalv/loops/issues"
22
- },
23
- "homepage": "https://github.com/robertalv/loops#readme",
24
- "files": [
25
- "dist",
26
- "src",
27
- "README.md",
28
- "LICENSE"
29
- ],
30
- "exports": {
31
- "./package.json": "./package.json",
32
- ".": {
33
- "@convex-dev/component-source": "./src/client/index.ts",
34
- "types": "./dist/client/index.d.ts",
35
- "default": "./dist/client/index.js"
36
- },
37
- "./convex.config": {
38
- "@convex-dev/component-source": "./src/component/convex.config.ts",
39
- "types": "./dist/component/convex.config.d.ts",
40
- "default": "./src/component/convex.config.ts"
41
- }
42
- },
43
- "scripts": {
44
- "dev": "run-p -r 'dev:backend' 'dev:frontend' 'build:watch'",
45
- "dev:backend": "convex dev --live-component-sources --typecheck-components",
46
- "dev:frontend": "bun --hot example/src/index.tsx",
47
- "build": "tsc --project tsconfig.build.json",
48
- "build:watch": "chokidar 'tsconfig*.json' 'src/**/*.ts' -i '**/*.test.*' -i '**/test-setup.ts' -c 'bun run build' --initial",
49
- "clean": "rm -rf dist node_modules",
50
- "test": "bun test",
51
- "test:watch": "bun test --watch",
52
- "test:coverage": "bun test --coverage",
53
- "test:bail": "bun test --bail",
54
- "lint": "biome lint .",
55
- "lint:fix": "biome lint --write .",
56
- "format": "biome format --write .",
57
- "check": "biome check .",
58
- "check:fix": "biome check --write .",
59
- "typecheck": "tsc --noEmit",
60
- "attw": "attw $(npm pack -s) --exclude-entrypoints ./convex.config --profile esm-only",
61
- "prepare": "npm run build || true",
62
- "changeset": "changeset",
63
- "ci:version": "changeset version && bun update",
64
- "ci:publish": "bun run preversion && changeset publish",
65
- "preversion": "bun run clean && bun install && run-p test lint typecheck attw",
66
- "version": "pbcopy <<<$npm_package_version; vim CHANGELOG.md && biome format --write CHANGELOG.md && git add CHANGELOG.md",
67
- "postversion": "git push --follow-tags",
68
- "alpha": "bun run preversion && npm version prerelease --preid alpha && npm publish --tag alpha",
69
- "release": "bun run preversion && npm version patch && npm publish"
70
- },
71
- "dependencies": {
72
- "zod": "^4.1.12",
73
- "zodvex": "^0.2.3"
74
- },
75
- "peerDependencies": {
76
- "convex": "^1.0.0",
77
- "react": "^18.0.0 || ^19.0.0",
78
- "typescript": "^5.9.3"
79
- },
80
- "devDependencies": {
81
- "@arethetypeswrong/cli": "^0.18.2",
82
- "@biomejs/biome": "2.3.0",
83
- "@changesets/changelog-github": "^0.5.1",
84
- "@changesets/cli": "^2.29.7",
85
- "@commitlint/cli": "^20.1.0",
86
- "@commitlint/types": "^20.0.0",
87
- "@types/bun": "^1.3.1",
88
- "@types/react": "^19.2.2",
89
- "@types/react-dom": "^19.2.2",
90
- "bun-plugin-tailwind": "^0.1.2",
91
- "chokidar-cli": "^3.0.0",
92
- "commitlint-config-gitmoji": "^2.3.1",
93
- "convex": "^1.28.0",
94
- "convex-helpers": "^0.1.104",
95
- "convex-test": "^0.0.38",
96
- "lefthook": "^2.0.0",
97
- "npm-run-all": "^4.1.5",
98
- "pkg-pr-new": "^0.0.60",
99
- "react": "^19.2.0",
100
- "react-dom": "^19.2.0",
101
- "tailwindcss": "^4.1.16"
102
- }
2
+ "name": "@devwithbobby/loops",
3
+ "version": "0.1.13",
4
+ "description": "Convex component for integrating with Loops.so email marketing platform",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "keywords": [
8
+ "convex",
9
+ "component",
10
+ "template",
11
+ "boilerplate",
12
+ "bun",
13
+ "biome",
14
+ "typescript"
15
+ ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/robertalv/loops.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/robertalv/loops/issues"
22
+ },
23
+ "homepage": "https://github.com/robertalv/loops#readme",
24
+ "files": [
25
+ "dist",
26
+ "src",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "exports": {
31
+ "./package.json": "./package.json",
32
+ ".": {
33
+ "@convex-dev/component-source": "./src/client/index.ts",
34
+ "types": "./dist/client/index.d.ts",
35
+ "default": "./dist/client/index.js"
36
+ },
37
+ "./convex.config": {
38
+ "@convex-dev/component-source": "./src/component/convex.config.ts",
39
+ "types": "./dist/component/convex.config.d.ts",
40
+ "default": "./src/component/convex.config.ts"
41
+ }
42
+ },
43
+ "scripts": {
44
+ "dev": "run-p -r 'dev:backend' 'dev:frontend' 'build:watch'",
45
+ "dev:backend": "convex dev --live-component-sources --typecheck-components",
46
+ "dev:frontend": "bun --hot example/src/index.tsx",
47
+ "build": "tsc --project tsconfig.build.json",
48
+ "build:watch": "chokidar 'tsconfig*.json' 'src/**/*.ts' -i '**/*.test.*' -i '**/test-setup.ts' -c 'bun run build' --initial",
49
+ "clean": "rm -rf dist node_modules",
50
+ "test": "bun test",
51
+ "test:watch": "bun test --watch",
52
+ "test:coverage": "bun test --coverage",
53
+ "test:bail": "bun test --bail",
54
+ "lint": "biome lint .",
55
+ "lint:fix": "biome lint --write .",
56
+ "format": "biome format --write .",
57
+ "check": "biome check .",
58
+ "check:fix": "biome check --write .",
59
+ "typecheck": "tsc --noEmit",
60
+ "attw": "attw $(npm pack -s) --exclude-entrypoints ./convex.config --profile esm-only",
61
+ "prepare": "npm run build || true",
62
+ "changeset": "changeset",
63
+ "ci:version": "changeset version && bun update",
64
+ "ci:publish": "changeset publish",
65
+ "preversion": "bun run clean && bun install && run-p test lint typecheck attw",
66
+ "version": "pbcopy <<<$npm_package_version; vim CHANGELOG.md && biome format --write CHANGELOG.md && git add CHANGELOG.md",
67
+ "postversion": "git push --follow-tags",
68
+ "alpha": "bun run preversion && npm version prerelease --preid alpha && npm publish --tag alpha",
69
+ "release": "bun run preversion && npm version patch && npm publish"
70
+ },
71
+ "dependencies": {
72
+ "zod": "^4.1.12",
73
+ "zodvex": "^0.2.3"
74
+ },
75
+ "peerDependencies": {
76
+ "convex": "^1.0.0",
77
+ "react": "^18.0.0 || ^19.0.0",
78
+ "typescript": "^5.9.3"
79
+ },
80
+ "devDependencies": {
81
+ "@arethetypeswrong/cli": "^0.18.2",
82
+ "@biomejs/biome": "2.3.0",
83
+ "@changesets/changelog-github": "^0.5.1",
84
+ "@changesets/cli": "^2.29.7",
85
+ "@commitlint/cli": "^20.1.0",
86
+ "@commitlint/types": "^20.0.0",
87
+ "@types/bun": "^1.3.1",
88
+ "@types/react": "^19.2.2",
89
+ "@types/react-dom": "^19.2.2",
90
+ "bun-plugin-tailwind": "^0.1.2",
91
+ "chokidar-cli": "^3.0.0",
92
+ "commitlint-config-gitmoji": "^2.3.1",
93
+ "convex": "^1.28.0",
94
+ "convex-helpers": "^0.1.104",
95
+ "convex-test": "^0.0.38",
96
+ "lefthook": "^2.0.0",
97
+ "npm-run-all": "^4.1.5",
98
+ "pkg-pr-new": "^0.0.60",
99
+ "react": "^19.2.0",
100
+ "react-dom": "^19.2.0",
101
+ "tailwindcss": "^4.1.16"
102
+ }
103
103
  }
@@ -32,7 +32,7 @@ export class Loops {
32
32
  public readonly options?: {
33
33
  apiKey?: string;
34
34
  };
35
-
35
+
36
36
  constructor(
37
37
  component: LoopsComponent,
38
38
  options?: {
@@ -43,26 +43,26 @@ export class Loops {
43
43
  throw new Error(
44
44
  "Loops component reference is required. " +
45
45
  "Make sure the component is mounted in your convex.config.ts and use: " +
46
- "new Loops(components.loops)"
46
+ "new Loops(components.loops)",
47
47
  );
48
48
  }
49
-
49
+
50
50
  if (!component.lib) {
51
51
  throw new Error(
52
52
  "Invalid component reference. " +
53
53
  "The component may not be properly mounted. " +
54
54
  "Ensure the component is correctly mounted in convex.config.ts: " +
55
- "app.use(loops);"
55
+ "app.use(loops);",
56
56
  );
57
57
  }
58
-
58
+
59
59
  this.component = component;
60
60
  this.options = options;
61
-
61
+
62
62
  const apiKey = options?.apiKey ?? process.env.LOOPS_API_KEY;
63
63
  if (!apiKey) {
64
64
  throw new Error(
65
- "Loops API key is required. Set LOOPS_API_KEY in your Convex environment variables."
65
+ "Loops API key is required. Set LOOPS_API_KEY in your Convex environment variables.",
66
66
  );
67
67
  }
68
68
 
@@ -87,7 +87,7 @@ export class Loops {
87
87
  throw new Error(
88
88
  "Loops component is not initialized. " +
89
89
  "Make sure to pass components.loops to the Loops constructor: " +
90
- "new Loops(components.loops)"
90
+ "new Loops(components.loops)",
91
91
  );
92
92
  }
93
93
  if (!this.component.lib) {
@@ -95,7 +95,7 @@ export class Loops {
95
95
  "Invalid component reference. " +
96
96
  "The component may not be properly mounted. " +
97
97
  "Ensure the component is correctly mounted in convex.config.ts: " +
98
- "app.use(loops);"
98
+ "app.use(loops);",
99
99
  );
100
100
  }
101
101
  return ctx.runAction((this.component.lib as any).addContact, {
@@ -124,7 +124,10 @@ export class Loops {
124
124
  /**
125
125
  * Send a transactional email using a transactional ID
126
126
  */
127
- async sendTransactional(ctx: RunActionCtx, options: TransactionalEmailOptions) {
127
+ async sendTransactional(
128
+ ctx: RunActionCtx,
129
+ options: TransactionalEmailOptions,
130
+ ) {
128
131
  return ctx.runAction((this.component.lib as any).sendTransactional, {
129
132
  apiKey: this.apiKey,
130
133
  ...options,
@@ -198,7 +201,10 @@ export class Loops {
198
201
  subscribed?: boolean;
199
202
  },
200
203
  ) {
201
- return ctx.runQuery((this.component.lib as any).countContacts, options ?? {});
204
+ return ctx.runQuery(
205
+ (this.component.lib as any).countContacts,
206
+ options ?? {},
207
+ );
202
208
  }
203
209
 
204
210
  /**
@@ -298,7 +304,10 @@ export class Loops {
298
304
  maxEmails: number;
299
305
  },
300
306
  ) {
301
- return ctx.runQuery((this.component.lib as any).checkRecipientRateLimit, options);
307
+ return ctx.runQuery(
308
+ (this.component.lib as any).checkRecipientRateLimit,
309
+ options,
310
+ );
302
311
  }
303
312
 
304
313
  /**
@@ -312,7 +321,10 @@ export class Loops {
312
321
  maxEmails: number;
313
322
  },
314
323
  ) {
315
- return ctx.runQuery((this.component.lib as any).checkActorRateLimit, options);
324
+ return ctx.runQuery(
325
+ (this.component.lib as any).checkActorRateLimit,
326
+ options,
327
+ );
316
328
  }
317
329
 
318
330
  /**
@@ -325,7 +337,10 @@ export class Loops {
325
337
  maxEmails: number;
326
338
  },
327
339
  ) {
328
- return ctx.runQuery((this.component.lib as any).checkGlobalRateLimit, options);
340
+ return ctx.runQuery(
341
+ (this.component.lib as any).checkGlobalRateLimit,
342
+ options,
343
+ );
329
344
  }
330
345
 
331
346
  /**
@@ -341,11 +356,11 @@ export class Loops {
341
356
  /**
342
357
  * Trigger a loop for a contact
343
358
  * Loops are automated email sequences that can be triggered by events
344
- *
359
+ *
345
360
  * Note: Loops.so doesn't have a direct loop trigger endpoint.
346
361
  * Loops are triggered through events. Make sure your loop is configured
347
362
  * in the Loops dashboard to listen for events.
348
- *
363
+ *
349
364
  * @param options.eventName - Optional event name. If not provided, uses `loop_{loopId}`
350
365
  */
351
366
  async triggerLoop(