@vybesec/types 0.1.6

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 (2) hide show
  1. package/package.json +25 -0
  2. package/src/index.ts +109 -0
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@vybesec/types",
3
+ "type": "module",
4
+ "version": "0.1.6",
5
+ "types": "./src/index.ts",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./src/index.ts"
9
+ }
10
+ },
11
+ "files": [
12
+ "src"
13
+ ],
14
+ "sideEffects": false,
15
+ "scripts": {
16
+ "typecheck": "tsc --noEmit",
17
+ "lint": "echo 'lint not configured yet'"
18
+ },
19
+ "dependencies": {
20
+ "zod": "^3.24.1"
21
+ },
22
+ "devDependencies": {
23
+ "typescript": "^5.7.3"
24
+ }
25
+ }
package/src/index.ts ADDED
@@ -0,0 +1,109 @@
1
+ import { z } from "zod";
2
+
3
+ export const platformSchema = z.enum([
4
+ // AI builders (web)
5
+ "lovable",
6
+ "replit",
7
+ "v0",
8
+ "bolt",
9
+ "base44",
10
+ "emergent",
11
+ "tempo",
12
+ "webdraw",
13
+ "wix-vibe",
14
+ "hostinger-ai",
15
+ "databutton",
16
+ "firebase-studio",
17
+ "youware",
18
+ "heyboss",
19
+ // Mobile builders
20
+ "rork",
21
+ "rapidnative",
22
+ "create-expo",
23
+ // Agentic IDEs + CLI
24
+ "cursor",
25
+ "windsurf",
26
+ "trae",
27
+ "kiro",
28
+ "antigravity",
29
+ "jetbrains-ai",
30
+ "github-copilot",
31
+ "augment-code",
32
+ "amazon-q",
33
+ "claude-code",
34
+ "cline",
35
+ "codex",
36
+ "aider",
37
+ "devin",
38
+ "openhands",
39
+ "continue",
40
+ "roocode",
41
+ "goose",
42
+ "open-interpreter",
43
+ "tabby",
44
+ "cody",
45
+ "junie",
46
+ "jules",
47
+ "ampcode",
48
+ // Frameworks
49
+ "nextjs",
50
+ "react",
51
+ "vue",
52
+ "svelte",
53
+ "sveltekit",
54
+ "nuxt",
55
+ "angular",
56
+ "remix",
57
+ "astro",
58
+ "solid",
59
+ "qwik",
60
+ "gatsby",
61
+ "vanilla",
62
+ // Mobile frameworks
63
+ "react-native",
64
+ "expo",
65
+ "other"
66
+ ]);
67
+ export type Platform = z.infer<typeof platformSchema>;
68
+
69
+ export const environmentSchema = z.enum([
70
+ "production",
71
+ "staging",
72
+ "development"
73
+ ]);
74
+ export type Environment = z.infer<typeof environmentSchema>;
75
+
76
+ export const rawEventSchema = z.object({
77
+ type: z.enum(["error", "warning", "info", "performance", "custom"]),
78
+ message: z.string().min(1),
79
+ stackTrace: z.string().optional(),
80
+ errorType: z.string().optional(),
81
+ url: z.string().optional(),
82
+ requestUrl: z.string().optional(),
83
+ requestMethod: z.string().optional(),
84
+ responseStatus: z.number().int().optional(),
85
+ responseTimeMs: z.number().int().optional(),
86
+ deviceType: z.string().optional(),
87
+ osName: z.string().optional(),
88
+ appVersion: z.string().optional(),
89
+ sessionId: z.string().optional(),
90
+ userId: z.string().optional(),
91
+ timestamp: z.number(),
92
+ tags: z.record(z.string()).optional(),
93
+ extra: z.record(z.any()).optional()
94
+ });
95
+ export type RawEvent = z.infer<typeof rawEventSchema>;
96
+
97
+ export const rawEventArraySchema = z.array(rawEventSchema);
98
+
99
+ export const eventEnvelopeSchema = z.object({
100
+ id: z.string().min(1),
101
+ receivedAt: z.string(),
102
+ projectId: z.string().min(1),
103
+ orgId: z.string().min(1),
104
+ platform: platformSchema.optional(),
105
+ country: z.string().optional(),
106
+ region: z.string().optional(),
107
+ event: rawEventSchema
108
+ });
109
+ export type EventEnvelope = z.infer<typeof eventEnvelopeSchema>;