@push.rocks/smartregistry 1.1.1
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_ts/00_commitinfo_data.d.ts +8 -0
- package/dist_ts/00_commitinfo_data.js +9 -0
- package/dist_ts/classes.smartregistry.d.ts +45 -0
- package/dist_ts/classes.smartregistry.js +113 -0
- package/dist_ts/core/classes.authmanager.d.ts +108 -0
- package/dist_ts/core/classes.authmanager.js +315 -0
- package/dist_ts/core/classes.baseregistry.d.ts +28 -0
- package/dist_ts/core/classes.baseregistry.js +6 -0
- package/dist_ts/core/classes.registrystorage.d.ts +109 -0
- package/dist_ts/core/classes.registrystorage.js +226 -0
- package/dist_ts/core/index.d.ts +7 -0
- package/dist_ts/core/index.js +10 -0
- package/dist_ts/core/interfaces.core.d.ts +142 -0
- package/dist_ts/core/interfaces.core.js +5 -0
- package/dist_ts/index.d.ts +8 -0
- package/dist_ts/index.js +13 -0
- package/dist_ts/npm/classes.npmregistry.d.ts +36 -0
- package/dist_ts/npm/classes.npmregistry.js +717 -0
- package/dist_ts/npm/index.d.ts +5 -0
- package/dist_ts/npm/index.js +6 -0
- package/dist_ts/npm/interfaces.npm.d.ts +245 -0
- package/dist_ts/npm/interfaces.npm.js +6 -0
- package/dist_ts/oci/classes.ociregistry.d.ts +43 -0
- package/dist_ts/oci/classes.ociregistry.js +565 -0
- package/dist_ts/oci/index.d.ts +5 -0
- package/dist_ts/oci/index.js +6 -0
- package/dist_ts/oci/interfaces.oci.d.ts +103 -0
- package/dist_ts/oci/interfaces.oci.js +5 -0
- package/dist_ts/paths.d.ts +1 -0
- package/dist_ts/paths.js +3 -0
- package/dist_ts/plugins.d.ts +6 -0
- package/dist_ts/plugins.js +9 -0
- package/npmextra.json +18 -0
- package/package.json +49 -0
- package/readme.hints.md +3 -0
- package/readme.md +486 -0
- package/ts/00_commitinfo_data.ts +8 -0
- package/ts/classes.smartregistry.ts +129 -0
- package/ts/core/classes.authmanager.ts +388 -0
- package/ts/core/classes.baseregistry.ts +36 -0
- package/ts/core/classes.registrystorage.ts +270 -0
- package/ts/core/index.ts +11 -0
- package/ts/core/interfaces.core.ts +159 -0
- package/ts/index.ts +16 -0
- package/ts/npm/classes.npmregistry.ts +890 -0
- package/ts/npm/index.ts +6 -0
- package/ts/npm/interfaces.npm.ts +263 -0
- package/ts/oci/classes.ociregistry.ts +734 -0
- package/ts/oci/index.ts +6 -0
- package/ts/oci/interfaces.oci.ts +101 -0
- package/ts/paths.ts +5 -0
- package/ts/plugins.ts +11 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NPM Registry module exports
|
|
3
|
+
*/
|
|
4
|
+
export { NpmRegistry } from './classes.npmregistry.js';
|
|
5
|
+
export * from './interfaces.npm.js';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9ucG0vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDdkQsY0FBYyxxQkFBcUIsQ0FBQyJ9
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NPM Registry interfaces and types
|
|
3
|
+
* Based on npm registry API specification
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* NPM package version metadata
|
|
7
|
+
*/
|
|
8
|
+
export interface INpmVersion {
|
|
9
|
+
name: string;
|
|
10
|
+
version: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
main?: string;
|
|
13
|
+
dependencies?: Record<string, string>;
|
|
14
|
+
devDependencies?: Record<string, string>;
|
|
15
|
+
peerDependencies?: Record<string, string>;
|
|
16
|
+
optionalDependencies?: Record<string, string>;
|
|
17
|
+
bundleDependencies?: string[];
|
|
18
|
+
bin?: Record<string, string> | string;
|
|
19
|
+
scripts?: Record<string, string>;
|
|
20
|
+
engines?: Record<string, string>;
|
|
21
|
+
keywords?: string[];
|
|
22
|
+
author?: INpmPerson | string;
|
|
23
|
+
maintainers?: INpmPerson[];
|
|
24
|
+
contributors?: INpmPerson[];
|
|
25
|
+
license?: string;
|
|
26
|
+
repository?: INpmRepository;
|
|
27
|
+
bugs?: string | {
|
|
28
|
+
url?: string;
|
|
29
|
+
email?: string;
|
|
30
|
+
};
|
|
31
|
+
homepage?: string;
|
|
32
|
+
readme?: string;
|
|
33
|
+
dist: INpmDist;
|
|
34
|
+
_id: string;
|
|
35
|
+
_nodeVersion?: string;
|
|
36
|
+
_npmVersion?: string;
|
|
37
|
+
_npmUser?: INpmPerson;
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Distribution information for a version
|
|
42
|
+
*/
|
|
43
|
+
export interface INpmDist {
|
|
44
|
+
/** URL to the tarball */
|
|
45
|
+
tarball: string;
|
|
46
|
+
/** SHA-1 hash */
|
|
47
|
+
shasum: string;
|
|
48
|
+
/** Subresource Integrity hash (SHA-512) */
|
|
49
|
+
integrity?: string;
|
|
50
|
+
/** Number of files in the package */
|
|
51
|
+
fileCount?: number;
|
|
52
|
+
/** Total size when unpacked */
|
|
53
|
+
unpackedSize?: number;
|
|
54
|
+
/** PGP signature */
|
|
55
|
+
'npm-signature'?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Person (author, maintainer, contributor)
|
|
59
|
+
*/
|
|
60
|
+
export interface INpmPerson {
|
|
61
|
+
name: string;
|
|
62
|
+
email?: string;
|
|
63
|
+
url?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Repository information
|
|
67
|
+
*/
|
|
68
|
+
export interface INpmRepository {
|
|
69
|
+
type: string;
|
|
70
|
+
url: string;
|
|
71
|
+
directory?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Packument (package document) - the full package metadata
|
|
75
|
+
*/
|
|
76
|
+
export interface IPackument {
|
|
77
|
+
_id: string;
|
|
78
|
+
_rev?: string;
|
|
79
|
+
name: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
'dist-tags': Record<string, string>;
|
|
82
|
+
versions: Record<string, INpmVersion>;
|
|
83
|
+
time?: Record<string, string>;
|
|
84
|
+
maintainers?: INpmPerson[];
|
|
85
|
+
author?: INpmPerson | string;
|
|
86
|
+
repository?: INpmRepository;
|
|
87
|
+
readme?: string;
|
|
88
|
+
readmeFilename?: string;
|
|
89
|
+
homepage?: string;
|
|
90
|
+
keywords?: string[];
|
|
91
|
+
bugs?: string | {
|
|
92
|
+
url?: string;
|
|
93
|
+
email?: string;
|
|
94
|
+
};
|
|
95
|
+
license?: string;
|
|
96
|
+
users?: Record<string, boolean>;
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Abbreviated packument for npm install
|
|
101
|
+
*/
|
|
102
|
+
export interface IAbbreviatedPackument {
|
|
103
|
+
name: string;
|
|
104
|
+
'modified': string;
|
|
105
|
+
'dist-tags': Record<string, string>;
|
|
106
|
+
versions: Record<string, {
|
|
107
|
+
name: string;
|
|
108
|
+
version: string;
|
|
109
|
+
dist: INpmDist;
|
|
110
|
+
dependencies?: Record<string, string>;
|
|
111
|
+
[key: string]: any;
|
|
112
|
+
}>;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Publish request body
|
|
116
|
+
*/
|
|
117
|
+
export interface IPublishRequest {
|
|
118
|
+
_id: string;
|
|
119
|
+
name: string;
|
|
120
|
+
description?: string;
|
|
121
|
+
'dist-tags': Record<string, string>;
|
|
122
|
+
versions: Record<string, INpmVersion>;
|
|
123
|
+
_attachments: Record<string, {
|
|
124
|
+
content_type: string;
|
|
125
|
+
data: string;
|
|
126
|
+
length: number;
|
|
127
|
+
}>;
|
|
128
|
+
readme?: string;
|
|
129
|
+
maintainers?: INpmPerson[];
|
|
130
|
+
[key: string]: any;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Search result item
|
|
134
|
+
*/
|
|
135
|
+
export interface ISearchResult {
|
|
136
|
+
package: {
|
|
137
|
+
name: string;
|
|
138
|
+
version: string;
|
|
139
|
+
description?: string;
|
|
140
|
+
keywords?: string[];
|
|
141
|
+
date?: string;
|
|
142
|
+
links?: {
|
|
143
|
+
npm?: string;
|
|
144
|
+
homepage?: string;
|
|
145
|
+
repository?: string;
|
|
146
|
+
bugs?: string;
|
|
147
|
+
};
|
|
148
|
+
author?: INpmPerson;
|
|
149
|
+
publisher?: INpmPerson;
|
|
150
|
+
maintainers?: INpmPerson[];
|
|
151
|
+
};
|
|
152
|
+
score: {
|
|
153
|
+
final: number;
|
|
154
|
+
detail: {
|
|
155
|
+
quality: number;
|
|
156
|
+
popularity: number;
|
|
157
|
+
maintenance: number;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
searchScore: number;
|
|
161
|
+
flags?: {
|
|
162
|
+
unstable?: boolean;
|
|
163
|
+
insecure?: boolean;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Search response
|
|
168
|
+
*/
|
|
169
|
+
export interface ISearchResponse {
|
|
170
|
+
objects: ISearchResult[];
|
|
171
|
+
total: number;
|
|
172
|
+
time: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* NPM token information
|
|
176
|
+
*/
|
|
177
|
+
export interface INpmToken {
|
|
178
|
+
token: string;
|
|
179
|
+
key: string;
|
|
180
|
+
cidr_whitelist?: string[];
|
|
181
|
+
readonly: boolean;
|
|
182
|
+
created: string;
|
|
183
|
+
updated: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Token creation request
|
|
187
|
+
*/
|
|
188
|
+
export interface ITokenCreateRequest {
|
|
189
|
+
password: string;
|
|
190
|
+
readonly?: boolean;
|
|
191
|
+
cidr_whitelist?: string[];
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Token list response
|
|
195
|
+
*/
|
|
196
|
+
export interface ITokenListResponse {
|
|
197
|
+
objects: Array<{
|
|
198
|
+
token: string;
|
|
199
|
+
key: string;
|
|
200
|
+
cidr_whitelist?: string[];
|
|
201
|
+
readonly: boolean;
|
|
202
|
+
created: string;
|
|
203
|
+
updated: string;
|
|
204
|
+
}>;
|
|
205
|
+
total: number;
|
|
206
|
+
urls: {
|
|
207
|
+
next?: string;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* User authentication request
|
|
212
|
+
*/
|
|
213
|
+
export interface IUserAuthRequest {
|
|
214
|
+
name: string;
|
|
215
|
+
password: string;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* User profile
|
|
219
|
+
*/
|
|
220
|
+
export interface IUserProfile {
|
|
221
|
+
_id: string;
|
|
222
|
+
name: string;
|
|
223
|
+
email?: string;
|
|
224
|
+
type: 'user';
|
|
225
|
+
roles?: string[];
|
|
226
|
+
date: string;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Dist-tag operations
|
|
230
|
+
*/
|
|
231
|
+
export interface IDistTagUpdate {
|
|
232
|
+
[tag: string]: string;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* NPM error codes
|
|
236
|
+
*/
|
|
237
|
+
export type TNpmErrorCode = 'ENOTFOUND' | 'E404' | 'EPUBLISHCONFLICT' | 'EUNAUTHORIZED' | 'EFORBIDDEN' | 'EINTERNAL' | 'EBADREQUEST';
|
|
238
|
+
/**
|
|
239
|
+
* NPM error response
|
|
240
|
+
*/
|
|
241
|
+
export interface INpmError {
|
|
242
|
+
error: string;
|
|
243
|
+
reason?: string;
|
|
244
|
+
statusCode?: number;
|
|
245
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NPM Registry interfaces and types
|
|
3
|
+
* Based on npm registry API specification
|
|
4
|
+
*/
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy5ucG0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9ucG0vaW50ZXJmYWNlcy5ucG0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7OztHQUdHIn0=
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BaseRegistry } from '../core/classes.baseregistry.js';
|
|
2
|
+
import { RegistryStorage } from '../core/classes.registrystorage.js';
|
|
3
|
+
import { AuthManager } from '../core/classes.authmanager.js';
|
|
4
|
+
import type { IRequestContext, IResponse, IAuthToken } from '../core/interfaces.core.js';
|
|
5
|
+
/**
|
|
6
|
+
* OCI Distribution Specification v1.1 compliant registry
|
|
7
|
+
*/
|
|
8
|
+
export declare class OciRegistry extends BaseRegistry {
|
|
9
|
+
private storage;
|
|
10
|
+
private authManager;
|
|
11
|
+
private uploadSessions;
|
|
12
|
+
private basePath;
|
|
13
|
+
private cleanupInterval?;
|
|
14
|
+
constructor(storage: RegistryStorage, authManager: AuthManager, basePath?: string);
|
|
15
|
+
init(): Promise<void>;
|
|
16
|
+
getBasePath(): string;
|
|
17
|
+
handleRequest(context: IRequestContext): Promise<IResponse>;
|
|
18
|
+
protected checkPermission(token: IAuthToken | null, resource: string, action: string): Promise<boolean>;
|
|
19
|
+
private handleVersionCheck;
|
|
20
|
+
private handleManifestRequest;
|
|
21
|
+
private handleBlobRequest;
|
|
22
|
+
private handleUploadInit;
|
|
23
|
+
private handleUploadSession;
|
|
24
|
+
private getManifest;
|
|
25
|
+
private headManifest;
|
|
26
|
+
private putManifest;
|
|
27
|
+
private deleteManifest;
|
|
28
|
+
private getBlob;
|
|
29
|
+
private headBlob;
|
|
30
|
+
private deleteBlob;
|
|
31
|
+
private uploadChunk;
|
|
32
|
+
private completeUpload;
|
|
33
|
+
private getUploadStatus;
|
|
34
|
+
private handleTagsList;
|
|
35
|
+
private handleReferrers;
|
|
36
|
+
private getTagsData;
|
|
37
|
+
private putTagsData;
|
|
38
|
+
private generateUploadId;
|
|
39
|
+
private calculateDigest;
|
|
40
|
+
private createError;
|
|
41
|
+
private startUploadSessionCleanup;
|
|
42
|
+
destroy(): void;
|
|
43
|
+
}
|