@verdaccio/api 6.0.0-6-next.16 → 6.0.0-6-next.20
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/CHANGELOG.md +91 -0
- package/build/dist-tags.d.ts +1 -1
- package/build/dist-tags.js +3 -3
- package/build/dist-tags.js.map +1 -1
- package/build/index.js +12 -12
- package/build/index.js.map +1 -1
- package/build/package.d.ts +1 -2
- package/build/package.js +28 -61
- package/build/package.js.map +1 -1
- package/build/ping.js.map +1 -1
- package/build/publish.d.ts +2 -2
- package/build/publish.js +10 -16
- package/build/publish.js.map +1 -1
- package/build/star.d.ts +1 -1
- package/build/star.js +6 -12
- package/build/star.js.map +1 -1
- package/build/stars.js.map +1 -1
- package/build/user.d.ts +1 -1
- package/build/user.js +5 -5
- package/build/user.js.map +1 -1
- package/build/utils.js.map +1 -1
- package/build/v1/profile.js.map +1 -1
- package/build/v1/search.js +3 -3
- package/build/v1/search.js.map +1 -1
- package/build/v1/token.d.ts +1 -1
- package/build/v1/token.js +6 -12
- package/build/v1/token.js.map +1 -1
- package/build/whoami.js.map +1 -1
- package/package.json +17 -19
- package/src/dist-tags.ts +7 -6
- package/src/index.ts +12 -11
- package/src/package.ts +38 -57
- package/src/ping.ts +2 -1
- package/src/publish.ts +10 -10
- package/src/star.ts +4 -3
- package/src/stars.ts +4 -4
- package/src/user.ts +8 -8
- package/src/utils.ts +2 -1
- package/src/v1/profile.ts +4 -3
- package/src/v1/search.ts +3 -2
- package/src/v1/token.ts +8 -7
- package/src/whoami.ts +3 -2
- package/test/integration/_helper.ts +7 -6
- package/test/integration/package.spec.ts +3 -2
- package/test/integration/ping.spec.ts +2 -1
- package/test/integration/publish.spec.ts +5 -3
- package/test/integration/user.spec.ts +4 -4
- package/test/unit/publish.spec.ts +4 -3
- package/test/unit/validate.api.params.middleware.spec.ts +1 -1
- package/types/custom.d.ts +2 -1
package/src/dist-tags.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import mime from 'mime';
|
|
2
|
-
import _ from 'lodash';
|
|
3
1
|
import { Router } from 'express';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
import mime from 'mime';
|
|
4
4
|
|
|
5
|
-
import { media, allow } from '@verdaccio/middleware';
|
|
6
|
-
import { constants, VerdaccioError } from '@verdaccio/core';
|
|
7
|
-
import { Package } from '@verdaccio/types';
|
|
8
|
-
import { Storage } from '@verdaccio/store';
|
|
9
5
|
import { IAuth } from '@verdaccio/auth';
|
|
6
|
+
import { VerdaccioError, constants } from '@verdaccio/core';
|
|
7
|
+
import { allow, media } from '@verdaccio/middleware';
|
|
8
|
+
import { Storage } from '@verdaccio/store';
|
|
9
|
+
import { Package } from '@verdaccio/types';
|
|
10
|
+
|
|
10
11
|
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types/custom';
|
|
11
12
|
|
|
12
13
|
export default function (route: Router, auth: IAuth, storage: Storage): void {
|
package/src/index.ts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
+
import bodyParser from 'body-parser';
|
|
1
2
|
import express, { Router } from 'express';
|
|
3
|
+
import semver from 'semver';
|
|
4
|
+
|
|
5
|
+
import { IAuth } from '@verdaccio/auth';
|
|
2
6
|
import {
|
|
7
|
+
antiLoop,
|
|
8
|
+
encodeScopePackage,
|
|
3
9
|
match,
|
|
4
10
|
validateName,
|
|
5
11
|
validatePackage,
|
|
6
|
-
encodeScopePackage,
|
|
7
|
-
antiLoop,
|
|
8
12
|
} from '@verdaccio/middleware';
|
|
9
|
-
import { IAuth } from '@verdaccio/auth';
|
|
10
13
|
import { Storage } from '@verdaccio/store';
|
|
11
14
|
import { Config } from '@verdaccio/types';
|
|
12
|
-
import bodyParser from 'body-parser';
|
|
13
|
-
import semver from 'semver';
|
|
14
15
|
|
|
15
|
-
import whoami from './whoami';
|
|
16
|
-
import ping from './ping';
|
|
17
|
-
import user from './user';
|
|
18
16
|
import distTags from './dist-tags';
|
|
17
|
+
import pkg from './package';
|
|
18
|
+
import ping from './ping';
|
|
19
19
|
import publish from './publish';
|
|
20
20
|
import search from './search';
|
|
21
|
-
import pkg from './package';
|
|
22
21
|
import stars from './stars';
|
|
22
|
+
import user from './user';
|
|
23
23
|
import profile from './v1/profile';
|
|
24
|
-
import token from './v1/token';
|
|
25
24
|
import v1Search from './v1/search';
|
|
25
|
+
import token from './v1/token';
|
|
26
|
+
import whoami from './whoami';
|
|
26
27
|
|
|
27
28
|
if (semver.lte(process.version, 'v15.0.0')) {
|
|
28
29
|
global.AbortController = require('abortcontroller-polyfill/dist/cjs-ponyfill').AbortController;
|
|
@@ -55,7 +56,7 @@ export default function (config: Config, auth: IAuth, storage: Storage): Router
|
|
|
55
56
|
app.use(encodeScopePackage);
|
|
56
57
|
// for "npm whoami"
|
|
57
58
|
whoami(app);
|
|
58
|
-
pkg(app, auth, storage
|
|
59
|
+
pkg(app, auth, storage);
|
|
59
60
|
profile(app, auth);
|
|
60
61
|
// @deprecated endpoint, 404 by default
|
|
61
62
|
search(app);
|
package/src/package.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import { Router } from 'express';
|
|
3
1
|
import buildDebug from 'debug';
|
|
2
|
+
import { Router } from 'express';
|
|
4
3
|
|
|
5
|
-
import { allow } from '@verdaccio/middleware';
|
|
6
|
-
import { getVersion } from '@verdaccio/utils';
|
|
7
|
-
import { HEADERS, DIST_TAGS, API_ERROR, errorUtils } from '@verdaccio/core';
|
|
8
|
-
import { Config, Package } from '@verdaccio/types';
|
|
9
4
|
import { IAuth } from '@verdaccio/auth';
|
|
5
|
+
import { HEADERS, errorUtils } from '@verdaccio/core';
|
|
6
|
+
import { allow } from '@verdaccio/middleware';
|
|
10
7
|
import { Storage } from '@verdaccio/store';
|
|
11
|
-
|
|
12
|
-
import { $
|
|
8
|
+
|
|
9
|
+
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types/custom';
|
|
13
10
|
|
|
14
11
|
const debug = buildDebug('verdaccio:api:package');
|
|
15
12
|
|
|
@@ -17,7 +14,7 @@ const downloadStream = (
|
|
|
17
14
|
packageName: string,
|
|
18
15
|
filename: string,
|
|
19
16
|
storage: any,
|
|
20
|
-
|
|
17
|
+
_req: $RequestExtend,
|
|
21
18
|
res: $ResponseExtend
|
|
22
19
|
): void => {
|
|
23
20
|
const stream = storage.getTarball(packageName, filename);
|
|
@@ -34,63 +31,47 @@ const downloadStream = (
|
|
|
34
31
|
stream.pipe(res);
|
|
35
32
|
};
|
|
36
33
|
|
|
37
|
-
export default function (route: Router, auth: IAuth, storage: Storage
|
|
34
|
+
export default function (route: Router, auth: IAuth, storage: Storage): void {
|
|
38
35
|
const can = allow(auth);
|
|
39
|
-
|
|
36
|
+
|
|
40
37
|
route.get(
|
|
41
38
|
'/:package/:version?',
|
|
42
39
|
can('access'),
|
|
43
|
-
function (
|
|
40
|
+
async function (
|
|
41
|
+
req: $RequestExtend,
|
|
42
|
+
_res: $ResponseExtend,
|
|
43
|
+
next: $NextFunctionVer
|
|
44
|
+
): Promise<void> {
|
|
44
45
|
debug('init package by version');
|
|
45
46
|
const name = req.params.package;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
let queryVersion = req.params.version;
|
|
55
|
-
debug('query by param version: %o', queryVersion);
|
|
56
|
-
if (_.isNil(queryVersion)) {
|
|
57
|
-
debug('param %o version found', queryVersion);
|
|
58
|
-
return next(metadata);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
let version = getVersion(metadata, queryVersion);
|
|
62
|
-
debug('query by latest version %o and result %o', queryVersion, version);
|
|
63
|
-
if (_.isNil(version) === false) {
|
|
64
|
-
debug('latest version found %o', version);
|
|
65
|
-
return next(version);
|
|
66
|
-
}
|
|
47
|
+
let queryVersion = req.params.version;
|
|
48
|
+
const requestOptions = {
|
|
49
|
+
protocol: req.protocol,
|
|
50
|
+
headers: req.headers as any,
|
|
51
|
+
// FIXME: if we migrate to req.hostname, the port is not longer included.
|
|
52
|
+
host: req.host,
|
|
53
|
+
};
|
|
67
54
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return next(version);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
} else {
|
|
79
|
-
debug('dist tag not detected');
|
|
55
|
+
try {
|
|
56
|
+
// TODO: this is just temporary while I migrate all plugins to use the new API
|
|
57
|
+
// the method will be renamed to getPackage again but Promise Based.
|
|
58
|
+
if (!storage.getPackageNext) {
|
|
59
|
+
throw errorUtils.getInternalError(
|
|
60
|
+
'getPackageNext not implemented, check pr-2750 for more details'
|
|
61
|
+
);
|
|
80
62
|
}
|
|
81
63
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
});
|
|
64
|
+
const manifest = await storage.getPackageNext({
|
|
65
|
+
name,
|
|
66
|
+
uplinksLook: true,
|
|
67
|
+
req,
|
|
68
|
+
version: queryVersion,
|
|
69
|
+
requestOptions,
|
|
70
|
+
});
|
|
71
|
+
next(manifest);
|
|
72
|
+
} catch (err) {
|
|
73
|
+
next(err);
|
|
74
|
+
}
|
|
94
75
|
}
|
|
95
76
|
);
|
|
96
77
|
|
package/src/ping.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Router } from 'express';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types/custom';
|
|
3
4
|
|
|
4
5
|
export default function (route: Router): void {
|
|
5
6
|
route.get(
|
package/src/publish.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import buildDebug from 'debug';
|
|
2
|
+
import { Router } from 'express';
|
|
2
3
|
import _ from 'lodash';
|
|
3
4
|
import mime from 'mime';
|
|
4
|
-
import
|
|
5
|
-
import buildDebug from 'debug';
|
|
5
|
+
import Path from 'path';
|
|
6
6
|
|
|
7
|
+
import { IAuth } from '@verdaccio/auth';
|
|
7
8
|
import {
|
|
9
|
+
API_ERROR,
|
|
8
10
|
API_MESSAGE,
|
|
9
|
-
HEADERS,
|
|
10
11
|
DIST_TAGS,
|
|
11
|
-
|
|
12
|
+
HEADERS,
|
|
12
13
|
HTTP_STATUS,
|
|
13
14
|
errorUtils,
|
|
14
15
|
} from '@verdaccio/core';
|
|
15
|
-
import { validateMetadata, isObject, hasDiffOneKey } from '@verdaccio/utils';
|
|
16
|
-
import { media, expectJson, allow } from '@verdaccio/middleware';
|
|
17
16
|
import { notify } from '@verdaccio/hooks';
|
|
18
|
-
import { Config, Callback, MergeTags, Version, Package, CallbackAction } from '@verdaccio/types';
|
|
19
17
|
import { logger } from '@verdaccio/logger';
|
|
20
|
-
import {
|
|
18
|
+
import { allow, expectJson, media } from '@verdaccio/middleware';
|
|
21
19
|
import { Storage } from '@verdaccio/store';
|
|
22
|
-
import {
|
|
20
|
+
import { Callback, CallbackAction, Config, MergeTags, Package, Version } from '@verdaccio/types';
|
|
21
|
+
import { hasDiffOneKey, isObject, validateMetadata } from '@verdaccio/utils';
|
|
23
22
|
|
|
23
|
+
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types/custom';
|
|
24
24
|
import star from './star';
|
|
25
25
|
import { isPublishablePackage, isRelatedToDeprecation } from './utils';
|
|
26
26
|
|
package/src/star.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import buildDebug from 'debug';
|
|
2
2
|
import { Response } from 'express';
|
|
3
3
|
import _ from 'lodash';
|
|
4
|
-
import buildDebug from 'debug';
|
|
5
4
|
|
|
5
|
+
import { HTTP_STATUS, USERS } from '@verdaccio/core';
|
|
6
6
|
import { Storage } from '@verdaccio/store';
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import { $NextFunctionVer, $RequestExtend } from '../types/custom';
|
|
8
9
|
|
|
9
10
|
const debug = buildDebug('verdaccio:api:publish:star');
|
|
10
11
|
|
package/src/stars.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
1
|
import { Response, Router } from 'express';
|
|
2
|
+
import _ from 'lodash';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { HTTP_STATUS, USERS } from '@verdaccio/core';
|
|
5
|
+
import { Storage } from '@verdaccio/store';
|
|
5
6
|
import { Package } from '@verdaccio/types';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import { $RequestExtend, $NextFunctionVer } from '../types/custom';
|
|
8
|
+
import { $NextFunctionVer, $RequestExtend } from '../types/custom';
|
|
9
9
|
|
|
10
10
|
type Packages = Package[];
|
|
11
11
|
|
package/src/user.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import { Response, Router } from 'express';
|
|
3
1
|
import buildDebug from 'debug';
|
|
2
|
+
import { Response, Router } from 'express';
|
|
3
|
+
import _ from 'lodash';
|
|
4
4
|
|
|
5
|
-
import { getAuthenticatedMessage, validatePassword } from '@verdaccio/utils';
|
|
6
5
|
import { getApiToken } from '@verdaccio/auth';
|
|
7
|
-
import { logger } from '@verdaccio/logger';
|
|
8
|
-
import { createRemoteUser } from '@verdaccio/config';
|
|
9
|
-
|
|
10
|
-
import { Config, RemoteUser } from '@verdaccio/types';
|
|
11
6
|
import { IAuth } from '@verdaccio/auth';
|
|
7
|
+
import { createRemoteUser } from '@verdaccio/config';
|
|
12
8
|
import { API_ERROR, API_MESSAGE, HTTP_STATUS, errorUtils } from '@verdaccio/core';
|
|
13
|
-
import {
|
|
9
|
+
import { logger } from '@verdaccio/logger';
|
|
10
|
+
import { Config, RemoteUser } from '@verdaccio/types';
|
|
11
|
+
import { getAuthenticatedMessage, validatePassword } from '@verdaccio/utils';
|
|
12
|
+
|
|
13
|
+
import { $NextFunctionVer, $RequestExtend } from '../types/custom';
|
|
14
14
|
|
|
15
15
|
const debug = buildDebug('verdaccio:api:user');
|
|
16
16
|
|
package/src/utils.ts
CHANGED
package/src/v1/profile.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
1
|
import { Response, Router } from 'express';
|
|
2
|
+
import _ from 'lodash';
|
|
3
3
|
|
|
4
|
+
import { IAuth } from '@verdaccio/auth';
|
|
4
5
|
import { API_ERROR, APP_ERROR, HTTP_STATUS, SUPPORT_ERRORS, errorUtils } from '@verdaccio/core';
|
|
5
6
|
import { validatePassword } from '@verdaccio/utils';
|
|
6
|
-
|
|
7
|
-
import { $
|
|
7
|
+
|
|
8
|
+
import { $NextFunctionVer, $RequestExtend } from '../../types/custom';
|
|
8
9
|
|
|
9
10
|
export interface Profile {
|
|
10
11
|
tfa: boolean;
|
package/src/v1/search.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
1
|
import buildDebug from 'debug';
|
|
3
|
-
import
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
|
|
4
4
|
import { IAuth } from '@verdaccio/auth';
|
|
5
5
|
import { HTTP_STATUS, searchUtils } from '@verdaccio/core';
|
|
6
|
+
import { logger } from '@verdaccio/logger';
|
|
6
7
|
import { Storage } from '@verdaccio/store';
|
|
7
8
|
import { Package } from '@verdaccio/types';
|
|
8
9
|
|
package/src/v1/token.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import { errorUtils, HTTP_STATUS, SUPPORT_ERRORS } from '@verdaccio/core';
|
|
3
|
-
import { stringToMD5, mask } from '@verdaccio/utils';
|
|
4
|
-
import { getApiToken } from '@verdaccio/auth';
|
|
5
|
-
import { logger } from '@verdaccio/logger';
|
|
6
1
|
import { Response, Router } from 'express';
|
|
2
|
+
import _ from 'lodash';
|
|
7
3
|
|
|
8
|
-
import {
|
|
4
|
+
import { getApiToken } from '@verdaccio/auth';
|
|
9
5
|
import { IAuth } from '@verdaccio/auth';
|
|
6
|
+
import { HTTP_STATUS, SUPPORT_ERRORS, errorUtils } from '@verdaccio/core';
|
|
7
|
+
import { logger } from '@verdaccio/logger';
|
|
10
8
|
import { Storage } from '@verdaccio/store';
|
|
11
|
-
import {
|
|
9
|
+
import { Config, RemoteUser, Token } from '@verdaccio/types';
|
|
10
|
+
import { mask, stringToMD5 } from '@verdaccio/utils';
|
|
11
|
+
|
|
12
|
+
import { $NextFunctionVer, $RequestExtend } from '../../types/custom';
|
|
12
13
|
|
|
13
14
|
export type NormalizeToken = Token & {
|
|
14
15
|
created: string;
|
package/src/whoami.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Response, Router } from 'express';
|
|
2
1
|
import buildDebug from 'debug';
|
|
3
|
-
import {
|
|
2
|
+
import { Response, Router } from 'express';
|
|
3
|
+
|
|
4
|
+
import { $NextFunctionVer, $RequestExtend } from '../types/custom';
|
|
4
5
|
|
|
5
6
|
const debug = buildDebug('verdaccio:api:user');
|
|
6
7
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import bodyParser from 'body-parser';
|
|
2
2
|
import express, { Application } from 'express';
|
|
3
|
+
import path from 'path';
|
|
3
4
|
import supertest from 'supertest';
|
|
4
|
-
import bodyParser from 'body-parser';
|
|
5
5
|
|
|
6
|
-
import { Config, parseConfigFile } from '@verdaccio/config';
|
|
7
|
-
import { Storage } from '@verdaccio/store';
|
|
8
|
-
import { generatePackageMetadata } from '@verdaccio/helper';
|
|
9
|
-
import { final, handleError, errorReportingMiddleware } from '@verdaccio/middleware';
|
|
10
6
|
import { Auth, IAuth } from '@verdaccio/auth';
|
|
7
|
+
import { Config, parseConfigFile } from '@verdaccio/config';
|
|
11
8
|
import { HEADERS, HEADER_TYPE, HTTP_STATUS } from '@verdaccio/core';
|
|
9
|
+
import { generatePackageMetadata } from '@verdaccio/helper';
|
|
10
|
+
import { errorReportingMiddleware, final, handleError } from '@verdaccio/middleware';
|
|
11
|
+
import { Storage } from '@verdaccio/store';
|
|
12
|
+
|
|
12
13
|
import apiEndpoints from '../../src';
|
|
13
14
|
|
|
14
15
|
const getConf = (conf) => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import supertest from 'supertest';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { HEADERS, HEADER_TYPE, HTTP_STATUS } from '@verdaccio/core';
|
|
4
|
+
|
|
5
|
+
import { $RequestExtend, $ResponseExtend } from '../../types/custom';
|
|
5
6
|
import { initializeServer, publishTaggedVersion, publishVersion } from './_helper';
|
|
6
7
|
|
|
7
8
|
const mockApiJWTmiddleware = jest.fn(
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { HTTP_STATUS } from '@verdaccio/core';
|
|
2
1
|
import supertest from 'supertest';
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
import { HTTP_STATUS } from '@verdaccio/core';
|
|
4
|
+
import { API_ERROR, API_MESSAGE, HEADERS, HEADER_TYPE } from '@verdaccio/core';
|
|
4
5
|
import { generatePackageMetadata } from '@verdaccio/helper';
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
import { $RequestExtend, $ResponseExtend } from '../../types/custom';
|
|
6
8
|
import { initializeServer, publishVersion } from './_helper';
|
|
7
9
|
|
|
8
10
|
const mockApiJWTmiddleware = jest.fn(
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import supertest from 'supertest';
|
|
2
1
|
import _ from 'lodash';
|
|
2
|
+
import supertest from 'supertest';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
API_ERROR,
|
|
6
|
+
API_MESSAGE,
|
|
6
7
|
HEADERS,
|
|
7
8
|
HEADER_TYPE,
|
|
8
|
-
API_MESSAGE,
|
|
9
9
|
HTTP_STATUS,
|
|
10
|
-
|
|
10
|
+
errorUtils,
|
|
11
11
|
} from '@verdaccio/core';
|
|
12
12
|
|
|
13
13
|
import { $RequestExtend, $ResponseExtend } from '../../types/custom';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { API_ERROR, HTTP_STATUS, errorUtils } from '@verdaccio/core';
|
|
2
|
+
|
|
2
3
|
import {
|
|
3
4
|
addVersion,
|
|
4
|
-
|
|
5
|
+
publishPackage,
|
|
5
6
|
removeTarball,
|
|
6
7
|
unPublishPackage,
|
|
7
|
-
|
|
8
|
+
uploadPackageTarball,
|
|
8
9
|
} from '../../src/publish';
|
|
9
10
|
|
|
10
11
|
const REVISION_MOCK = '15-e53a77096b0ee33e';
|
package/types/custom.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Logger, RemoteUser } from '@verdaccio/types';
|
|
2
1
|
import { NextFunction, Request, Response } from 'express';
|
|
3
2
|
|
|
3
|
+
import { Logger, RemoteUser } from '@verdaccio/types';
|
|
4
|
+
|
|
4
5
|
export type $RequestExtend = Request & { remote_user?: any; log: Logger };
|
|
5
6
|
export type $ResponseExtend = Response & { cookies?: any };
|
|
6
7
|
export type $NextFunctionVer = NextFunction & any;
|