@devwithbobby/loops 0.1.12 → 0.1.14

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 (41) hide show
  1. package/dist/client/index.d.ts +305 -44
  2. package/dist/client/index.d.ts.map +1 -1
  3. package/dist/client/index.js +21 -32
  4. package/dist/component/convex.config.d.ts +1 -1
  5. package/dist/component/convex.config.d.ts.map +1 -1
  6. package/dist/component/convex.config.js +1 -1
  7. package/dist/component/helpers.d.ts +7 -0
  8. package/dist/component/helpers.d.ts.map +1 -0
  9. package/dist/component/helpers.js +30 -0
  10. package/dist/component/http.d.ts +3 -0
  11. package/dist/component/http.d.ts.map +1 -0
  12. package/dist/component/http.js +268 -0
  13. package/dist/component/lib.d.ts +237 -22
  14. package/dist/component/lib.d.ts.map +1 -1
  15. package/dist/component/lib.js +91 -143
  16. package/dist/component/schema.d.ts +66 -1
  17. package/dist/component/schema.d.ts.map +1 -1
  18. package/dist/component/tables/contacts.d.ts +123 -1
  19. package/dist/component/tables/contacts.d.ts.map +1 -1
  20. package/dist/component/tables/emailOperations.d.ts +151 -1
  21. package/dist/component/tables/emailOperations.d.ts.map +1 -1
  22. package/dist/component/tables/emailOperations.js +1 -6
  23. package/dist/component/validators.d.ts +20 -3
  24. package/dist/component/validators.d.ts.map +1 -1
  25. package/dist/types.d.ts +97 -0
  26. package/dist/types.d.ts.map +1 -0
  27. package/dist/types.js +2 -0
  28. package/dist/utils.d.ts +186 -3
  29. package/dist/utils.d.ts.map +1 -1
  30. package/package.json +101 -101
  31. package/src/client/index.ts +40 -52
  32. package/src/component/_generated/api.d.ts +3 -11
  33. package/src/component/convex.config.ts +7 -2
  34. package/src/component/helpers.ts +44 -0
  35. package/src/component/http.ts +304 -0
  36. package/src/component/lib.ts +189 -204
  37. package/src/component/tables/contacts.ts +0 -1
  38. package/src/component/tables/emailOperations.ts +1 -7
  39. package/src/component/validators.ts +0 -1
  40. package/src/types.ts +168 -0
  41. package/src/client/types.ts +0 -64
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.14",
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
  }