@tracelens/shared 0.1.0
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/dist/__tests__/validation.test.d.ts +2 -0
- package/dist/__tests__/validation.test.d.ts.map +1 -0
- package/dist/__tests__/validation.test.js +16 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/schemas/dependency.schema.d.ts +177 -0
- package/dist/schemas/dependency.schema.d.ts.map +1 -0
- package/dist/schemas/dependency.schema.js +187 -0
- package/dist/schemas/error.schema.d.ts +170 -0
- package/dist/schemas/error.schema.d.ts.map +1 -0
- package/dist/schemas/error.schema.js +176 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +5 -0
- package/dist/schemas/performance.schema.d.ts +333 -0
- package/dist/schemas/performance.schema.d.ts.map +1 -0
- package/dist/schemas/performance.schema.js +200 -0
- package/dist/schemas/trace.schema.d.ts +325 -0
- package/dist/schemas/trace.schema.d.ts.map +1 -0
- package/dist/schemas/trace.schema.js +145 -0
- package/dist/types/dependency.types.d.ts +109 -0
- package/dist/types/dependency.types.d.ts.map +1 -0
- package/dist/types/dependency.types.js +8 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/performance.types.d.ts +95 -0
- package/dist/types/performance.types.d.ts.map +1 -0
- package/dist/types/performance.types.js +1 -0
- package/dist/types/security.types.d.ts +154 -0
- package/dist/types/security.types.d.ts.map +1 -0
- package/dist/types/security.types.js +8 -0
- package/dist/types/trace.types.d.ts +57 -0
- package/dist/types/trace.types.d.ts.map +1 -0
- package/dist/types/trace.types.js +20 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/validation.d.ts +21 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +157 -0
- package/jest.config.js +14 -0
- package/package.json +22 -0
- package/src/__tests__/validation.test.ts +19 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.ts +4 -0
- package/src/schemas/dependency.schema.ts +187 -0
- package/src/schemas/error.schema.ts +176 -0
- package/src/schemas/index.ts +5 -0
- package/src/schemas/performance.schema.ts +200 -0
- package/src/schemas/trace.schema.ts +146 -0
- package/src/types/dependency.types.ts +120 -0
- package/src/types/index.d.ts.map +1 -0
- package/src/types/index.ts +11 -0
- package/src/types/performance.types.ts +108 -0
- package/src/types/security.types.ts +172 -0
- package/src/types/trace.types.ts +62 -0
- package/src/utils/index.d.ts.map +1 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/validation.ts +209 -0
- package/tsconfig.json +9 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/validation.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Basic validation test
|
|
2
|
+
import { validateProjectId, validateTimestamp, validateVersion } from '../utils/validation';
|
|
3
|
+
describe('Basic Validation', () => {
|
|
4
|
+
test('validateProjectId works', () => {
|
|
5
|
+
expect(validateProjectId('my-project')).toBe(true);
|
|
6
|
+
expect(validateProjectId('ab')).toBe(false);
|
|
7
|
+
});
|
|
8
|
+
test('validateTimestamp works', () => {
|
|
9
|
+
expect(validateTimestamp(Date.now())).toBe(true);
|
|
10
|
+
expect(validateTimestamp(0)).toBe(false);
|
|
11
|
+
});
|
|
12
|
+
test('validateVersion works', () => {
|
|
13
|
+
expect(validateVersion('1.0.0')).toBe(true);
|
|
14
|
+
expect(validateVersion('invalid')).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
export declare const DependencySnapshotSchema: {
|
|
2
|
+
readonly type: "object";
|
|
3
|
+
readonly required: readonly ["id", "projectId", "timestamp", "environment", "nodeVersion", "packageManager", "dependencies", "runtimeDependencies", "totalSize"];
|
|
4
|
+
readonly properties: {
|
|
5
|
+
readonly id: {
|
|
6
|
+
readonly type: "string";
|
|
7
|
+
readonly pattern: "^[a-zA-Z0-9_-]+$";
|
|
8
|
+
readonly minLength: 1;
|
|
9
|
+
readonly maxLength: 100;
|
|
10
|
+
readonly description: "Unique identifier for this dependency snapshot";
|
|
11
|
+
};
|
|
12
|
+
readonly projectId: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly pattern: "^[a-zA-Z0-9_-]+$";
|
|
15
|
+
readonly minLength: 3;
|
|
16
|
+
readonly maxLength: 50;
|
|
17
|
+
readonly description: "Project identifier";
|
|
18
|
+
};
|
|
19
|
+
readonly timestamp: {
|
|
20
|
+
readonly type: "number";
|
|
21
|
+
readonly minimum: 1577836800000;
|
|
22
|
+
readonly maximum: 2524608000000;
|
|
23
|
+
readonly description: "Snapshot timestamp in milliseconds since epoch";
|
|
24
|
+
};
|
|
25
|
+
readonly environment: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
readonly enum: readonly ["development", "production", "test"];
|
|
28
|
+
readonly description: "Environment where snapshot was taken";
|
|
29
|
+
};
|
|
30
|
+
readonly nodeVersion: {
|
|
31
|
+
readonly type: "string";
|
|
32
|
+
readonly pattern: "^v?\\d+\\.\\d+\\.\\d+";
|
|
33
|
+
readonly description: "Node.js version (e.g., v18.17.0)";
|
|
34
|
+
};
|
|
35
|
+
readonly npmVersion: {
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
readonly pattern: "^\\d+\\.\\d+\\.\\d+";
|
|
38
|
+
readonly description: "npm version if applicable";
|
|
39
|
+
};
|
|
40
|
+
readonly yarnVersion: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly pattern: "^\\d+\\.\\d+\\.\\d+";
|
|
43
|
+
readonly description: "Yarn version if applicable";
|
|
44
|
+
};
|
|
45
|
+
readonly packageManager: {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly enum: readonly ["npm", "yarn", "pnpm"];
|
|
48
|
+
readonly description: "Package manager used";
|
|
49
|
+
};
|
|
50
|
+
readonly dependencies: {
|
|
51
|
+
readonly type: "array";
|
|
52
|
+
readonly items: {
|
|
53
|
+
readonly $ref: "#/definitions/PackageDependency";
|
|
54
|
+
};
|
|
55
|
+
readonly maxItems: 10000;
|
|
56
|
+
readonly description: "List of package dependencies";
|
|
57
|
+
};
|
|
58
|
+
readonly runtimeDependencies: {
|
|
59
|
+
readonly type: "array";
|
|
60
|
+
readonly items: {
|
|
61
|
+
readonly $ref: "#/definitions/RuntimeDependency";
|
|
62
|
+
};
|
|
63
|
+
readonly maxItems: 10000;
|
|
64
|
+
readonly description: "List of runtime dependencies with execution data";
|
|
65
|
+
};
|
|
66
|
+
readonly totalSize: {
|
|
67
|
+
readonly type: "number";
|
|
68
|
+
readonly minimum: 0;
|
|
69
|
+
readonly description: "Total size of all dependencies in bytes";
|
|
70
|
+
};
|
|
71
|
+
readonly bundleSize: {
|
|
72
|
+
readonly type: "number";
|
|
73
|
+
readonly minimum: 0;
|
|
74
|
+
readonly description: "Bundle size in bytes if applicable";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly definitions: {
|
|
78
|
+
readonly PackageDependency: {
|
|
79
|
+
readonly type: "object";
|
|
80
|
+
readonly required: readonly ["name", "version", "type"];
|
|
81
|
+
readonly properties: {
|
|
82
|
+
readonly name: {
|
|
83
|
+
readonly type: "string";
|
|
84
|
+
readonly pattern: "^(@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$";
|
|
85
|
+
readonly maxLength: 214;
|
|
86
|
+
readonly description: "Package name (npm naming rules)";
|
|
87
|
+
};
|
|
88
|
+
readonly version: {
|
|
89
|
+
readonly type: "string";
|
|
90
|
+
readonly pattern: "^\\d+\\.\\d+\\.\\d+(?:-[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)?(?:\\+[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)?$";
|
|
91
|
+
readonly description: "Semantic version";
|
|
92
|
+
};
|
|
93
|
+
readonly type: {
|
|
94
|
+
readonly type: "string";
|
|
95
|
+
readonly enum: readonly ["production", "development", "peer", "optional", "bundled"];
|
|
96
|
+
readonly description: "Dependency type";
|
|
97
|
+
};
|
|
98
|
+
readonly resolved: {
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
readonly format: "uri";
|
|
101
|
+
readonly description: "Resolved URL for the package";
|
|
102
|
+
};
|
|
103
|
+
readonly integrity: {
|
|
104
|
+
readonly type: "string";
|
|
105
|
+
readonly pattern: "^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+=*$";
|
|
106
|
+
readonly description: "Package integrity hash";
|
|
107
|
+
};
|
|
108
|
+
readonly dev: {
|
|
109
|
+
readonly type: "boolean";
|
|
110
|
+
readonly description: "Whether this is a development dependency";
|
|
111
|
+
};
|
|
112
|
+
readonly optional: {
|
|
113
|
+
readonly type: "boolean";
|
|
114
|
+
readonly description: "Whether this is an optional dependency";
|
|
115
|
+
};
|
|
116
|
+
readonly bundled: {
|
|
117
|
+
readonly type: "boolean";
|
|
118
|
+
readonly description: "Whether this dependency is bundled";
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
readonly additionalProperties: false;
|
|
122
|
+
};
|
|
123
|
+
readonly RuntimeDependency: {
|
|
124
|
+
readonly type: "object";
|
|
125
|
+
readonly required: readonly ["name", "version", "loadTime", "executionTime", "memoryUsage", "importPath", "isEsm"];
|
|
126
|
+
readonly properties: {
|
|
127
|
+
readonly name: {
|
|
128
|
+
readonly type: "string";
|
|
129
|
+
readonly pattern: "^(@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$";
|
|
130
|
+
readonly maxLength: 214;
|
|
131
|
+
readonly description: "Package name";
|
|
132
|
+
};
|
|
133
|
+
readonly version: {
|
|
134
|
+
readonly type: "string";
|
|
135
|
+
readonly pattern: "^\\d+\\.\\d+\\.\\d+(?:-[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)?(?:\\+[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)?$";
|
|
136
|
+
readonly description: "Package version";
|
|
137
|
+
};
|
|
138
|
+
readonly loadTime: {
|
|
139
|
+
readonly type: "number";
|
|
140
|
+
readonly minimum: 0;
|
|
141
|
+
readonly description: "Time to load the module in milliseconds";
|
|
142
|
+
};
|
|
143
|
+
readonly executionTime: {
|
|
144
|
+
readonly type: "number";
|
|
145
|
+
readonly minimum: 0;
|
|
146
|
+
readonly description: "Time to execute module initialization in milliseconds";
|
|
147
|
+
};
|
|
148
|
+
readonly memoryUsage: {
|
|
149
|
+
readonly type: "number";
|
|
150
|
+
readonly minimum: 0;
|
|
151
|
+
readonly description: "Memory usage in bytes";
|
|
152
|
+
};
|
|
153
|
+
readonly importPath: {
|
|
154
|
+
readonly type: "string";
|
|
155
|
+
readonly maxLength: 1024;
|
|
156
|
+
readonly description: "Import path used to load the module";
|
|
157
|
+
};
|
|
158
|
+
readonly isEsm: {
|
|
159
|
+
readonly type: "boolean";
|
|
160
|
+
readonly description: "Whether the module is an ES module";
|
|
161
|
+
};
|
|
162
|
+
readonly exports: {
|
|
163
|
+
readonly type: "array";
|
|
164
|
+
readonly items: {
|
|
165
|
+
readonly type: "string";
|
|
166
|
+
readonly maxLength: 256;
|
|
167
|
+
};
|
|
168
|
+
readonly maxItems: 1000;
|
|
169
|
+
readonly description: "List of exported symbols";
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
readonly additionalProperties: false;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
readonly additionalProperties: false;
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=dependency.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/dependency.schema.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyL3B,CAAC"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
// Dependency snapshot schema for TraceLens
|
|
2
|
+
export const DependencySnapshotSchema = {
|
|
3
|
+
type: 'object',
|
|
4
|
+
required: [
|
|
5
|
+
'id',
|
|
6
|
+
'projectId',
|
|
7
|
+
'timestamp',
|
|
8
|
+
'environment',
|
|
9
|
+
'nodeVersion',
|
|
10
|
+
'packageManager',
|
|
11
|
+
'dependencies',
|
|
12
|
+
'runtimeDependencies',
|
|
13
|
+
'totalSize'
|
|
14
|
+
],
|
|
15
|
+
properties: {
|
|
16
|
+
id: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
pattern: '^[a-zA-Z0-9_-]+$',
|
|
19
|
+
minLength: 1,
|
|
20
|
+
maxLength: 100,
|
|
21
|
+
description: 'Unique identifier for this dependency snapshot'
|
|
22
|
+
},
|
|
23
|
+
projectId: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
pattern: '^[a-zA-Z0-9_-]+$',
|
|
26
|
+
minLength: 3,
|
|
27
|
+
maxLength: 50,
|
|
28
|
+
description: 'Project identifier'
|
|
29
|
+
},
|
|
30
|
+
timestamp: {
|
|
31
|
+
type: 'number',
|
|
32
|
+
minimum: 1577836800000, // 2020-01-01
|
|
33
|
+
maximum: 2524608000000, // 2050-01-01
|
|
34
|
+
description: 'Snapshot timestamp in milliseconds since epoch'
|
|
35
|
+
},
|
|
36
|
+
environment: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
enum: ['development', 'production', 'test'],
|
|
39
|
+
description: 'Environment where snapshot was taken'
|
|
40
|
+
},
|
|
41
|
+
nodeVersion: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
pattern: '^v?\\d+\\.\\d+\\.\\d+',
|
|
44
|
+
description: 'Node.js version (e.g., v18.17.0)'
|
|
45
|
+
},
|
|
46
|
+
npmVersion: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
pattern: '^\\d+\\.\\d+\\.\\d+',
|
|
49
|
+
description: 'npm version if applicable'
|
|
50
|
+
},
|
|
51
|
+
yarnVersion: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
pattern: '^\\d+\\.\\d+\\.\\d+',
|
|
54
|
+
description: 'Yarn version if applicable'
|
|
55
|
+
},
|
|
56
|
+
packageManager: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
enum: ['npm', 'yarn', 'pnpm'],
|
|
59
|
+
description: 'Package manager used'
|
|
60
|
+
},
|
|
61
|
+
dependencies: {
|
|
62
|
+
type: 'array',
|
|
63
|
+
items: {
|
|
64
|
+
$ref: '#/definitions/PackageDependency'
|
|
65
|
+
},
|
|
66
|
+
maxItems: 10000,
|
|
67
|
+
description: 'List of package dependencies'
|
|
68
|
+
},
|
|
69
|
+
runtimeDependencies: {
|
|
70
|
+
type: 'array',
|
|
71
|
+
items: {
|
|
72
|
+
$ref: '#/definitions/RuntimeDependency'
|
|
73
|
+
},
|
|
74
|
+
maxItems: 10000,
|
|
75
|
+
description: 'List of runtime dependencies with execution data'
|
|
76
|
+
},
|
|
77
|
+
totalSize: {
|
|
78
|
+
type: 'number',
|
|
79
|
+
minimum: 0,
|
|
80
|
+
description: 'Total size of all dependencies in bytes'
|
|
81
|
+
},
|
|
82
|
+
bundleSize: {
|
|
83
|
+
type: 'number',
|
|
84
|
+
minimum: 0,
|
|
85
|
+
description: 'Bundle size in bytes if applicable'
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
definitions: {
|
|
89
|
+
PackageDependency: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
required: ['name', 'version', 'type'],
|
|
92
|
+
properties: {
|
|
93
|
+
name: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
pattern: '^(@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$',
|
|
96
|
+
maxLength: 214,
|
|
97
|
+
description: 'Package name (npm naming rules)'
|
|
98
|
+
},
|
|
99
|
+
version: {
|
|
100
|
+
type: 'string',
|
|
101
|
+
pattern: '^\\d+\\.\\d+\\.\\d+(?:-[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)?(?:\\+[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)?$',
|
|
102
|
+
description: 'Semantic version'
|
|
103
|
+
},
|
|
104
|
+
type: {
|
|
105
|
+
type: 'string',
|
|
106
|
+
enum: ['production', 'development', 'peer', 'optional', 'bundled'],
|
|
107
|
+
description: 'Dependency type'
|
|
108
|
+
},
|
|
109
|
+
resolved: {
|
|
110
|
+
type: 'string',
|
|
111
|
+
format: 'uri',
|
|
112
|
+
description: 'Resolved URL for the package'
|
|
113
|
+
},
|
|
114
|
+
integrity: {
|
|
115
|
+
type: 'string',
|
|
116
|
+
pattern: '^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+=*$',
|
|
117
|
+
description: 'Package integrity hash'
|
|
118
|
+
},
|
|
119
|
+
dev: {
|
|
120
|
+
type: 'boolean',
|
|
121
|
+
description: 'Whether this is a development dependency'
|
|
122
|
+
},
|
|
123
|
+
optional: {
|
|
124
|
+
type: 'boolean',
|
|
125
|
+
description: 'Whether this is an optional dependency'
|
|
126
|
+
},
|
|
127
|
+
bundled: {
|
|
128
|
+
type: 'boolean',
|
|
129
|
+
description: 'Whether this dependency is bundled'
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
additionalProperties: false
|
|
133
|
+
},
|
|
134
|
+
RuntimeDependency: {
|
|
135
|
+
type: 'object',
|
|
136
|
+
required: ['name', 'version', 'loadTime', 'executionTime', 'memoryUsage', 'importPath', 'isEsm'],
|
|
137
|
+
properties: {
|
|
138
|
+
name: {
|
|
139
|
+
type: 'string',
|
|
140
|
+
pattern: '^(@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$',
|
|
141
|
+
maxLength: 214,
|
|
142
|
+
description: 'Package name'
|
|
143
|
+
},
|
|
144
|
+
version: {
|
|
145
|
+
type: 'string',
|
|
146
|
+
pattern: '^\\d+\\.\\d+\\.\\d+(?:-[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)?(?:\\+[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)?$',
|
|
147
|
+
description: 'Package version'
|
|
148
|
+
},
|
|
149
|
+
loadTime: {
|
|
150
|
+
type: 'number',
|
|
151
|
+
minimum: 0,
|
|
152
|
+
description: 'Time to load the module in milliseconds'
|
|
153
|
+
},
|
|
154
|
+
executionTime: {
|
|
155
|
+
type: 'number',
|
|
156
|
+
minimum: 0,
|
|
157
|
+
description: 'Time to execute module initialization in milliseconds'
|
|
158
|
+
},
|
|
159
|
+
memoryUsage: {
|
|
160
|
+
type: 'number',
|
|
161
|
+
minimum: 0,
|
|
162
|
+
description: 'Memory usage in bytes'
|
|
163
|
+
},
|
|
164
|
+
importPath: {
|
|
165
|
+
type: 'string',
|
|
166
|
+
maxLength: 1024,
|
|
167
|
+
description: 'Import path used to load the module'
|
|
168
|
+
},
|
|
169
|
+
isEsm: {
|
|
170
|
+
type: 'boolean',
|
|
171
|
+
description: 'Whether the module is an ES module'
|
|
172
|
+
},
|
|
173
|
+
exports: {
|
|
174
|
+
type: 'array',
|
|
175
|
+
items: {
|
|
176
|
+
type: 'string',
|
|
177
|
+
maxLength: 256
|
|
178
|
+
},
|
|
179
|
+
maxItems: 1000,
|
|
180
|
+
description: 'List of exported symbols'
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
additionalProperties: false
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
additionalProperties: false
|
|
187
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
export declare const ErrorEventSchema: {
|
|
2
|
+
readonly type: "object";
|
|
3
|
+
readonly required: readonly ["id", "timestamp", "type", "message", "source", "projectId"];
|
|
4
|
+
readonly properties: {
|
|
5
|
+
readonly id: {
|
|
6
|
+
readonly type: "string";
|
|
7
|
+
readonly pattern: "^[a-zA-Z0-9_-]+$";
|
|
8
|
+
readonly minLength: 1;
|
|
9
|
+
readonly maxLength: 100;
|
|
10
|
+
readonly description: "Unique identifier for this error event";
|
|
11
|
+
};
|
|
12
|
+
readonly timestamp: {
|
|
13
|
+
readonly type: "number";
|
|
14
|
+
readonly minimum: 1577836800000;
|
|
15
|
+
readonly maximum: 2524608000000;
|
|
16
|
+
readonly description: "Error timestamp in milliseconds since epoch";
|
|
17
|
+
};
|
|
18
|
+
readonly type: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly enum: readonly ["javascript-error", "unhandled-promise-rejection", "resource-error", "network-error", "csp-violation", "server-error", "database-error", "validation-error"];
|
|
21
|
+
readonly description: "Type of error that occurred";
|
|
22
|
+
};
|
|
23
|
+
readonly message: {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
readonly maxLength: 2048;
|
|
26
|
+
readonly description: "Error message";
|
|
27
|
+
};
|
|
28
|
+
readonly source: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly enum: readonly ["browser", "server", "network"];
|
|
31
|
+
readonly description: "Source of the error";
|
|
32
|
+
};
|
|
33
|
+
readonly projectId: {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
readonly pattern: "^[a-zA-Z0-9_-]+$";
|
|
36
|
+
readonly minLength: 3;
|
|
37
|
+
readonly maxLength: 50;
|
|
38
|
+
readonly description: "Project identifier";
|
|
39
|
+
};
|
|
40
|
+
readonly stack: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly maxLength: 8192;
|
|
43
|
+
readonly description: "Error stack trace";
|
|
44
|
+
};
|
|
45
|
+
readonly filename: {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly maxLength: 1024;
|
|
48
|
+
readonly description: "File where error occurred";
|
|
49
|
+
};
|
|
50
|
+
readonly lineno: {
|
|
51
|
+
readonly type: "number";
|
|
52
|
+
readonly minimum: 0;
|
|
53
|
+
readonly description: "Line number where error occurred";
|
|
54
|
+
};
|
|
55
|
+
readonly colno: {
|
|
56
|
+
readonly type: "number";
|
|
57
|
+
readonly minimum: 0;
|
|
58
|
+
readonly description: "Column number where error occurred";
|
|
59
|
+
};
|
|
60
|
+
readonly url: {
|
|
61
|
+
readonly type: "string";
|
|
62
|
+
readonly format: "uri";
|
|
63
|
+
readonly maxLength: 2048;
|
|
64
|
+
readonly description: "URL where error occurred";
|
|
65
|
+
};
|
|
66
|
+
readonly userAgent: {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
readonly maxLength: 512;
|
|
69
|
+
readonly description: "User agent string";
|
|
70
|
+
};
|
|
71
|
+
readonly userId: {
|
|
72
|
+
readonly type: "string";
|
|
73
|
+
readonly maxLength: 100;
|
|
74
|
+
readonly description: "User identifier (if available)";
|
|
75
|
+
};
|
|
76
|
+
readonly sessionId: {
|
|
77
|
+
readonly type: "string";
|
|
78
|
+
readonly maxLength: 100;
|
|
79
|
+
readonly description: "Session identifier";
|
|
80
|
+
};
|
|
81
|
+
readonly traceId: {
|
|
82
|
+
readonly type: "string";
|
|
83
|
+
readonly pattern: "^[a-f0-9]{32}$";
|
|
84
|
+
readonly description: "Associated trace ID if available";
|
|
85
|
+
};
|
|
86
|
+
readonly spanId: {
|
|
87
|
+
readonly type: "string";
|
|
88
|
+
readonly pattern: "^[a-f0-9]{16}$";
|
|
89
|
+
readonly description: "Associated span ID if available";
|
|
90
|
+
};
|
|
91
|
+
readonly severity: {
|
|
92
|
+
readonly type: "string";
|
|
93
|
+
readonly enum: readonly ["low", "medium", "high", "critical"];
|
|
94
|
+
readonly description: "Error severity level";
|
|
95
|
+
};
|
|
96
|
+
readonly tags: {
|
|
97
|
+
readonly type: "object";
|
|
98
|
+
readonly patternProperties: {
|
|
99
|
+
readonly '^[a-zA-Z][a-zA-Z0-9._-]*$': {
|
|
100
|
+
readonly oneOf: readonly [{
|
|
101
|
+
readonly type: "string";
|
|
102
|
+
readonly maxLength: 256;
|
|
103
|
+
}, {
|
|
104
|
+
readonly type: "number";
|
|
105
|
+
}, {
|
|
106
|
+
readonly type: "boolean";
|
|
107
|
+
}];
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
readonly additionalProperties: false;
|
|
111
|
+
readonly maxProperties: 50;
|
|
112
|
+
readonly description: "Additional tags for categorization";
|
|
113
|
+
};
|
|
114
|
+
readonly context: {
|
|
115
|
+
readonly type: "object";
|
|
116
|
+
readonly properties: {
|
|
117
|
+
readonly component: {
|
|
118
|
+
readonly type: "string";
|
|
119
|
+
readonly maxLength: 256;
|
|
120
|
+
readonly description: "Component where error occurred";
|
|
121
|
+
};
|
|
122
|
+
readonly action: {
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
readonly maxLength: 256;
|
|
125
|
+
readonly description: "Action being performed when error occurred";
|
|
126
|
+
};
|
|
127
|
+
readonly environment: {
|
|
128
|
+
readonly type: "string";
|
|
129
|
+
readonly enum: readonly ["development", "staging", "production"];
|
|
130
|
+
readonly description: "Environment where error occurred";
|
|
131
|
+
};
|
|
132
|
+
readonly version: {
|
|
133
|
+
readonly type: "string";
|
|
134
|
+
readonly maxLength: 50;
|
|
135
|
+
readonly description: "Application version";
|
|
136
|
+
};
|
|
137
|
+
readonly buildId: {
|
|
138
|
+
readonly type: "string";
|
|
139
|
+
readonly maxLength: 100;
|
|
140
|
+
readonly description: "Build identifier";
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
readonly additionalProperties: false;
|
|
144
|
+
readonly description: "Additional context about the error";
|
|
145
|
+
};
|
|
146
|
+
readonly fingerprint: {
|
|
147
|
+
readonly type: "string";
|
|
148
|
+
readonly pattern: "^[a-f0-9]{32}$";
|
|
149
|
+
readonly description: "Error fingerprint for grouping similar errors";
|
|
150
|
+
};
|
|
151
|
+
readonly count: {
|
|
152
|
+
readonly type: "number";
|
|
153
|
+
readonly minimum: 1;
|
|
154
|
+
readonly default: 1;
|
|
155
|
+
readonly description: "Number of times this error occurred";
|
|
156
|
+
};
|
|
157
|
+
readonly firstSeen: {
|
|
158
|
+
readonly type: "number";
|
|
159
|
+
readonly minimum: 1577836800000;
|
|
160
|
+
readonly description: "Timestamp when this error was first seen";
|
|
161
|
+
};
|
|
162
|
+
readonly lastSeen: {
|
|
163
|
+
readonly type: "number";
|
|
164
|
+
readonly minimum: 1577836800000;
|
|
165
|
+
readonly description: "Timestamp when this error was last seen";
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
readonly additionalProperties: false;
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=error.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/error.schema.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8KnB,CAAC"}
|