-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpurl.ts
More file actions
87 lines (84 loc) · 1.67 KB
/
purl.ts
File metadata and controls
87 lines (84 loc) · 1.67 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
77
78
79
80
81
82
83
84
85
86
87
/**
* @fileoverview PURL (Package URL) ecosystem identifiers shared across
* every package manager Socket understands.
*
* - `PURL_Type` — runtime const mapping uppercase keys to lowercase
* ecosystem slugs (e.g. `PURL_Type.NPM === 'npm'`)
* - `PURLString` — string-union of every PURL ecosystem slug
* - `EcosystemString` — semantic alias of `PURLString` for places
* where "ecosystem" reads more naturally than "PURL string"
*
* 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 =
| 'alpm'
| 'apk'
| 'bitbucket'
| 'cocoapods'
| 'cargo'
| 'chrome'
| 'composer'
| 'conan'
| 'conda'
| 'cran'
| 'deb'
| 'docker'
| 'gem'
| 'generic'
| 'github'
| 'golang'
| 'hackage'
| 'hex'
| 'huggingface'
| 'maven'
| 'mlflow'
| 'npm'
| 'nuget'
| 'oci'
| 'pub'
| 'pypi'
| 'qpkg'
| 'rpm'
| 'swid'
| 'swift'
| 'vcs'
| 'vscode'
/**
* Semantic alias of `PURLString` — same string union, used where
* "ecosystem" reads more naturally than "PURL".
*/
export type EcosystemString = PURLString