-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
76 lines (66 loc) · 1.62 KB
/
types.ts
File metadata and controls
76 lines (66 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**
* @fileoverview Type definitions for Socket Registry.
*/
// Type definitions
const Categories = {
CLEANUP: 'cleanup',
LEVELUP: 'levelup',
SPEEDUP: 'speedup',
TUNEUP: 'tuneup',
} as const
export type CategoryString = (typeof Categories)[keyof typeof Categories]
const Interop = {
BROWSERIFY: 'browserify',
CJS: 'cjs',
ESM: 'esm',
} as const
export type InteropString = (typeof Interop)[keyof typeof Interop]
// Based on SocketPURL_Type from socket-sdk-js
export const PURL_Type = {
ALPM: 'alpm',
APK: 'apk',
BITBUCKET: 'bitbucket',
COCOAPODS: 'cocoapods',
CARGO: 'cargo',
CHROME: 'chrome',
COMPOSER: 'composer',
CONAN: 'conan',
CONDA: 'conda',
CRAN: 'cran',
DEB: 'deb',
DOCKER: 'docker',
GEM: 'gem',
GENERIC: 'generic',
GITHUB: 'github',
GOLANG: 'golang',
HACKAGE: 'hackage',
HEX: 'hex',
HUGGINGFACE: 'huggingface',
MAVEN: 'maven',
MLFLOW: 'mlflow',
NPM: 'npm',
NUGET: 'nuget',
OCI: 'oci',
PUB: 'pub',
PYPI: 'pypi',
QPKG: 'qpkg',
RPM: 'rpm',
SWID: 'swid',
SWIFT: 'swift',
VCS: 'vcs',
VSCODE: 'vscode',
} as const
export type PURLString = (typeof PURL_Type)[keyof typeof PURL_Type]
// Alias for backward compatibility and semantic clarity
export type EcosystemString = PURLString
// Manifest types for Socket Registry
export type ManifestEntryData = {
categories?: CategoryString[] | undefined
interop?: InteropString | undefined
license?: string | undefined
name: string
version: string
[key: string]: unknown
}
export type ManifestEntry = [packageName: string, data: ManifestEntryData]
export type Manifest = Record<EcosystemString, ManifestEntry[]>