cnpmcore 4.11.0 → 4.11.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/app/common/FileUtil.js +1 -1
- package/dist/app/common/PackageUtil.d.ts +1 -1
- package/dist/app/common/adapter/BugVersionStore.d.ts +1 -1
- package/dist/app/common/adapter/NFSAdapter.js +1 -1
- package/dist/app/common/adapter/NPMRegistry.d.ts +1 -1
- package/dist/app/common/adapter/NPMRegistry.js +1 -1
- package/dist/app/common/adapter/binary/AbstractBinary.d.ts +2 -2
- package/dist/app/common/adapter/binary/ApiBinary.d.ts +1 -1
- package/dist/app/common/adapter/binary/ApiBinary.js +2 -2
- package/dist/app/common/adapter/binary/BucketBinary.d.ts +2 -2
- package/dist/app/common/adapter/binary/BucketBinary.js +3 -3
- package/dist/app/common/adapter/binary/ChromeForTestingBinary.d.ts +1 -1
- package/dist/app/common/adapter/binary/ChromeForTestingBinary.js +2 -2
- package/dist/app/common/adapter/binary/CypressBinary.d.ts +1 -1
- package/dist/app/common/adapter/binary/CypressBinary.js +2 -2
- package/dist/app/common/adapter/binary/EdgedriverBinary.d.ts +1 -1
- package/dist/app/common/adapter/binary/EdgedriverBinary.js +2 -2
- package/dist/app/common/adapter/binary/ElectronBinary.d.ts +3 -3
- package/dist/app/common/adapter/binary/ElectronBinary.js +4 -4
- package/dist/app/common/adapter/binary/FirefoxBinary.d.ts +2 -2
- package/dist/app/common/adapter/binary/FirefoxBinary.js +3 -3
- package/dist/app/common/adapter/binary/GithubBinary.d.ts +2 -2
- package/dist/app/common/adapter/binary/GithubBinary.js +3 -3
- package/dist/app/common/adapter/binary/ImageminBinary.d.ts +2 -2
- package/dist/app/common/adapter/binary/ImageminBinary.js +3 -3
- package/dist/app/common/adapter/binary/NodeBinary.d.ts +2 -2
- package/dist/app/common/adapter/binary/NodeBinary.js +3 -3
- package/dist/app/common/adapter/binary/NodePreGypBinary.d.ts +2 -2
- package/dist/app/common/adapter/binary/NodePreGypBinary.js +3 -3
- package/dist/app/common/adapter/binary/NwjsBinary.d.ts +2 -2
- package/dist/app/common/adapter/binary/NwjsBinary.js +4 -4
- package/dist/app/common/adapter/binary/PlaywrightBinary.d.ts +1 -1
- package/dist/app/common/adapter/binary/PlaywrightBinary.js +2 -2
- package/dist/app/common/adapter/binary/PrismaBinary.d.ts +2 -2
- package/dist/app/common/adapter/binary/PrismaBinary.js +3 -3
- package/dist/app/common/adapter/binary/PuppeteerBinary.d.ts +1 -1
- package/dist/app/common/adapter/binary/PuppeteerBinary.js +2 -2
- package/dist/app/common/adapter/binary/SqlcipherBinary.d.ts +1 -1
- package/dist/app/common/adapter/binary/SqlcipherBinary.js +2 -2
- package/dist/app/common/adapter/changesStream/AbstractChangesStream.d.ts +2 -2
- package/dist/app/common/adapter/changesStream/CnpmcoreChangesStream.d.ts +2 -2
- package/dist/app/common/adapter/changesStream/CnpmcoreChangesStream.js +2 -2
- package/dist/app/common/adapter/changesStream/CnpmjsorgChangesStream.d.ts +2 -2
- package/dist/app/common/adapter/changesStream/CnpmjsorgChangesStream.js +2 -2
- package/dist/app/common/adapter/changesStream/NpmChangesStream.d.ts +2 -2
- package/dist/app/common/adapter/changesStream/NpmChangesStream.js +2 -2
- package/dist/app/common/typing.d.ts +1 -1
- package/dist/app/core/entity/Binary.d.ts +2 -2
- package/dist/app/core/entity/Binary.js +2 -2
- package/dist/app/core/entity/Change.d.ts +2 -2
- package/dist/app/core/entity/Change.js +2 -2
- package/dist/app/core/entity/Dist.d.ts +2 -2
- package/dist/app/core/entity/Dist.js +2 -2
- package/dist/app/core/entity/Hook.d.ts +3 -3
- package/dist/app/core/entity/Hook.js +2 -2
- package/dist/app/core/entity/HookEvent.d.ts +1 -1
- package/dist/app/core/entity/HookEvent.js +1 -1
- package/dist/app/core/entity/Package.d.ts +3 -3
- package/dist/app/core/entity/Package.js +4 -4
- package/dist/app/core/entity/PackageTag.d.ts +2 -2
- package/dist/app/core/entity/PackageTag.js +2 -2
- package/dist/app/core/entity/PackageVersion.d.ts +3 -3
- package/dist/app/core/entity/PackageVersion.js +3 -3
- package/dist/app/core/entity/PackageVersionBlock.d.ts +2 -2
- package/dist/app/core/entity/PackageVersionBlock.js +2 -2
- package/dist/app/core/entity/PackageVersionFile.d.ts +3 -3
- package/dist/app/core/entity/PackageVersionFile.js +2 -2
- package/dist/app/core/entity/PackageVersionManifest.d.ts +2 -2
- package/dist/app/core/entity/PackageVersionManifest.js +2 -2
- package/dist/app/core/entity/ProxyCache.d.ts +3 -3
- package/dist/app/core/entity/ProxyCache.js +3 -3
- package/dist/app/core/entity/Registry.d.ts +3 -3
- package/dist/app/core/entity/Registry.js +2 -2
- package/dist/app/core/entity/Scope.d.ts +2 -2
- package/dist/app/core/entity/Scope.js +2 -2
- package/dist/app/core/entity/SqlRange.js +1 -1
- package/dist/app/core/entity/Task.d.ts +4 -4
- package/dist/app/core/entity/Task.js +6 -6
- package/dist/app/core/entity/Token.d.ts +2 -2
- package/dist/app/core/entity/Token.js +2 -2
- package/dist/app/core/entity/User.d.ts +2 -2
- package/dist/app/core/entity/User.js +3 -3
- package/dist/app/core/entity/WebauthnCredential.d.ts +2 -2
- package/dist/app/core/entity/WebauthnCredential.js +2 -2
- package/dist/app/core/event/BugVersionFixHandler.js +2 -2
- package/dist/app/core/event/CacheCleaner.js +1 -1
- package/dist/app/core/event/ChangesStream.d.ts +4 -4
- package/dist/app/core/event/ChangesStream.js +4 -4
- package/dist/app/core/event/StoreManifest.js +3 -3
- package/dist/app/core/event/SyncESPackage.d.ts +1 -1
- package/dist/app/core/event/SyncESPackage.js +1 -1
- package/dist/app/core/event/SyncPackageVersionFile.js +2 -2
- package/dist/app/core/event/TotalHandler.d.ts +1 -1
- package/dist/app/core/event/TotalHandler.js +1 -1
- package/dist/app/core/event/index.d.ts +1 -1
- package/dist/app/core/service/BinarySyncerService.d.ts +5 -5
- package/dist/app/core/service/BinarySyncerService.js +10 -10
- package/dist/app/core/service/BugVersionService.d.ts +1 -1
- package/dist/app/core/service/BugVersionService.js +3 -3
- package/dist/app/core/service/CacheService.d.ts +2 -2
- package/dist/app/core/service/CacheService.js +1 -1
- package/dist/app/core/service/ChangesStreamService.d.ts +3 -3
- package/dist/app/core/service/ChangesStreamService.js +8 -8
- package/dist/app/core/service/CreateHookTriggerService.d.ts +2 -2
- package/dist/app/core/service/CreateHookTriggerService.js +6 -6
- package/dist/app/core/service/FixNoPaddingVersionService.js +1 -1
- package/dist/app/core/service/HomeService.d.ts +1 -1
- package/dist/app/core/service/HomeService.js +2 -2
- package/dist/app/core/service/HookManageService.d.ts +2 -2
- package/dist/app/core/service/HookManageService.js +1 -1
- package/dist/app/core/service/HookTriggerService.d.ts +3 -3
- package/dist/app/core/service/HookTriggerService.js +3 -3
- package/dist/app/core/service/PackageManagerService.d.ts +7 -7
- package/dist/app/core/service/PackageManagerService.js +8 -8
- package/dist/app/core/service/PackageSearchService.d.ts +4 -4
- package/dist/app/core/service/PackageSearchService.js +2 -2
- package/dist/app/core/service/PackageSyncerService.d.ts +6 -6
- package/dist/app/core/service/PackageSyncerService.js +7 -7
- package/dist/app/core/service/PackageVersionFileService.d.ts +4 -4
- package/dist/app/core/service/PackageVersionFileService.js +5 -5
- package/dist/app/core/service/PackageVersionService.d.ts +1 -1
- package/dist/app/core/service/PackageVersionService.js +2 -2
- package/dist/app/core/service/ProxyCacheService.d.ts +5 -5
- package/dist/app/core/service/ProxyCacheService.js +7 -7
- package/dist/app/core/service/RegistryManagerService.d.ts +3 -3
- package/dist/app/core/service/RegistryManagerService.js +5 -5
- package/dist/app/core/service/ScopeManagerService.d.ts +3 -3
- package/dist/app/core/service/ScopeManagerService.js +2 -2
- package/dist/app/core/service/TaskService.d.ts +7 -7
- package/dist/app/core/service/TaskService.js +2 -2
- package/dist/app/core/service/TokenService.d.ts +3 -3
- package/dist/app/core/service/TokenService.js +6 -6
- package/dist/app/core/service/UserService.d.ts +6 -6
- package/dist/app/core/service/UserService.js +7 -7
- package/dist/app/core/util/EntityUtil.d.ts +1 -1
- package/dist/app/infra/AuthAdapter.d.ts +1 -1
- package/dist/app/infra/NFSClientAdapter.d.ts +1 -1
- package/dist/app/infra/QueueAdapter.d.ts +1 -1
- package/dist/app/infra/SearchAdapter.d.ts +1 -1
- package/dist/app/port/UserRoleManager.d.ts +3 -3
- package/dist/app/port/UserRoleManager.js +1 -1
- package/dist/app/port/config.d.ts +3 -3
- package/dist/app/port/config.js +1 -1
- package/dist/app/port/controller/AbstractController.d.ts +8 -8
- package/dist/app/port/controller/AbstractController.js +4 -4
- package/dist/app/port/controller/AccessController.d.ts +1 -1
- package/dist/app/port/controller/AccessController.js +3 -3
- package/dist/app/port/controller/BinarySyncController.d.ts +2 -2
- package/dist/app/port/controller/BinarySyncController.js +4 -4
- package/dist/app/port/controller/ChangesStreamController.d.ts +1 -1
- package/dist/app/port/controller/ChangesStreamController.js +1 -1
- package/dist/app/port/controller/DownloadController.d.ts +1 -1
- package/dist/app/port/controller/DownloadController.js +3 -3
- package/dist/app/port/controller/HomeController.d.ts +2 -2
- package/dist/app/port/controller/HomeController.js +1 -1
- package/dist/app/port/controller/HookController.d.ts +5 -5
- package/dist/app/port/controller/HookController.js +2 -2
- package/dist/app/port/controller/PackageBlockController.d.ts +2 -2
- package/dist/app/port/controller/PackageBlockController.js +4 -4
- package/dist/app/port/controller/PackageSyncController.d.ts +5 -5
- package/dist/app/port/controller/PackageSyncController.js +5 -5
- package/dist/app/port/controller/PackageTagController.d.ts +1 -1
- package/dist/app/port/controller/PackageTagController.js +3 -3
- package/dist/app/port/controller/PackageVersionFileController.d.ts +1 -1
- package/dist/app/port/controller/PackageVersionFileController.js +5 -5
- package/dist/app/port/controller/ProxyCacheController.d.ts +2 -2
- package/dist/app/port/controller/ProxyCacheController.js +4 -4
- package/dist/app/port/controller/RegistryController.d.ts +3 -3
- package/dist/app/port/controller/RegistryController.js +3 -3
- package/dist/app/port/controller/ScopeController.d.ts +2 -2
- package/dist/app/port/controller/ScopeController.js +3 -3
- package/dist/app/port/controller/TokenController.d.ts +2 -2
- package/dist/app/port/controller/TokenController.js +2 -2
- package/dist/app/port/controller/UserController.d.ts +2 -2
- package/dist/app/port/controller/UserController.js +4 -4
- package/dist/app/port/controller/admin/PaddingVersionController.d.ts +1 -1
- package/dist/app/port/controller/admin/PaddingVersionController.js +1 -1
- package/dist/app/port/controller/convertor/HookConvertor.d.ts +4 -4
- package/dist/app/port/controller/package/DownloadPackageVersionTar.d.ts +2 -2
- package/dist/app/port/controller/package/DownloadPackageVersionTar.js +3 -3
- package/dist/app/port/controller/package/RemovePackageVersionController.d.ts +1 -1
- package/dist/app/port/controller/package/RemovePackageVersionController.js +2 -2
- package/dist/app/port/controller/package/SavePackageVersionController.d.ts +1 -1
- package/dist/app/port/controller/package/SavePackageVersionController.js +3 -3
- package/dist/app/port/controller/package/SearchPackageController.d.ts +2 -2
- package/dist/app/port/controller/package/SearchPackageController.js +3 -3
- package/dist/app/port/controller/package/ShowPackageController.d.ts +1 -1
- package/dist/app/port/controller/package/ShowPackageController.js +5 -5
- package/dist/app/port/controller/package/ShowPackageVersionController.d.ts +1 -1
- package/dist/app/port/controller/package/ShowPackageVersionController.js +6 -6
- package/dist/app/port/controller/package/UpdatePackageController.d.ts +1 -1
- package/dist/app/port/controller/package/UpdatePackageController.js +2 -2
- package/dist/app/port/middleware/AdminAccess.js +1 -1
- package/dist/app/port/middleware/AlwaysAuth.js +1 -1
- package/dist/app/port/middleware/ErrorHandler.js +1 -1
- package/dist/app/port/middleware/index.js +3 -3
- package/dist/app/port/schedule/CheckProxyCacheUpdateWorker.js +2 -2
- package/dist/app/port/schedule/CheckRecentlyUpdatedPackages.js +2 -2
- package/dist/app/port/schedule/CleanTempDir.js +1 -1
- package/dist/app/port/schedule/CreateSyncBinaryTask.js +1 -1
- package/dist/app/port/schedule/CreateTriggerHookWorker.js +1 -1
- package/dist/app/port/schedule/SyncBinaryWorker.js +1 -1
- package/dist/app/port/schedule/SyncPackageWorker.js +1 -1
- package/dist/app/port/schedule/SyncProxyCacheWorker.js +1 -1
- package/dist/app/port/schedule/TriggerHookWorker.js +1 -1
- package/dist/app/port/schedule/UpdateTotalData.js +3 -3
- package/dist/app/port/typebox.d.ts +2 -2
- package/dist/app/port/typebox.js +3 -3
- package/dist/app/port/webauth/WebauthController.d.ts +2 -2
- package/dist/app/port/webauth/WebauthController.js +4 -4
- package/dist/app/repository/BinaryRepository.d.ts +2 -2
- package/dist/app/repository/BinaryRepository.js +3 -3
- package/dist/app/repository/ChangeRepository.d.ts +3 -3
- package/dist/app/repository/ChangeRepository.js +2 -2
- package/dist/app/repository/DistRepository.d.ts +2 -2
- package/dist/app/repository/HookRepository.d.ts +2 -2
- package/dist/app/repository/HookRepository.js +2 -2
- package/dist/app/repository/PackageRepository.d.ts +8 -8
- package/dist/app/repository/PackageRepository.js +7 -7
- package/dist/app/repository/PackageVersionBlockRepository.d.ts +3 -3
- package/dist/app/repository/PackageVersionBlockRepository.js +3 -3
- package/dist/app/repository/PackageVersionDownloadRepository.d.ts +2 -2
- package/dist/app/repository/PackageVersionDownloadRepository.js +1 -1
- package/dist/app/repository/PackageVersionFileRepository.d.ts +2 -2
- package/dist/app/repository/PackageVersionFileRepository.js +4 -4
- package/dist/app/repository/PackageVersionRepository.d.ts +3 -3
- package/dist/app/repository/PackageVersionRepository.js +2 -2
- package/dist/app/repository/ProxyCacheRepository.d.ts +5 -5
- package/dist/app/repository/ProxyCacheRepository.js +4 -4
- package/dist/app/repository/RegistryRepository.d.ts +4 -4
- package/dist/app/repository/RegistryRepository.js +4 -4
- package/dist/app/repository/ScopeRepository.d.ts +4 -4
- package/dist/app/repository/ScopeRepository.js +4 -4
- package/dist/app/repository/SearchRepository.d.ts +1 -1
- package/dist/app/repository/TaskRepository.d.ts +8 -8
- package/dist/app/repository/TaskRepository.js +4 -4
- package/dist/app/repository/TotalRepository.d.ts +1 -1
- package/dist/app/repository/TotalRepository.js +2 -2
- package/dist/app/repository/UserRepository.d.ts +4 -4
- package/dist/app/repository/UserRepository.js +6 -6
- package/dist/app/repository/model/Binary.d.ts +1 -1
- package/dist/app/repository/model/Binary.js +1 -1
- package/dist/app/repository/model/Change.d.ts +1 -1
- package/dist/app/repository/model/Change.js +1 -1
- package/dist/app/repository/model/Dist.d.ts +1 -1
- package/dist/app/repository/model/Dist.js +1 -1
- package/dist/app/repository/model/HistoryTask.d.ts +2 -2
- package/dist/app/repository/model/HistoryTask.js +1 -1
- package/dist/app/repository/model/Hook.d.ts +2 -2
- package/dist/app/repository/model/Hook.js +1 -1
- package/dist/app/repository/model/Maintainer.d.ts +1 -1
- package/dist/app/repository/model/Maintainer.js +1 -1
- package/dist/app/repository/model/Package.d.ts +1 -1
- package/dist/app/repository/model/Package.js +2 -2
- package/dist/app/repository/model/PackageDep.d.ts +1 -1
- package/dist/app/repository/model/PackageDep.js +1 -1
- package/dist/app/repository/model/PackageTag.d.ts +1 -1
- package/dist/app/repository/model/PackageTag.js +1 -1
- package/dist/app/repository/model/PackageVersion.d.ts +1 -1
- package/dist/app/repository/model/PackageVersion.js +3 -3
- package/dist/app/repository/model/PackageVersionBlock.d.ts +1 -1
- package/dist/app/repository/model/PackageVersionBlock.js +1 -1
- package/dist/app/repository/model/PackageVersionDownload.d.ts +1 -1
- package/dist/app/repository/model/PackageVersionDownload.js +1 -1
- package/dist/app/repository/model/PackageVersionFile.d.ts +1 -1
- package/dist/app/repository/model/PackageVersionFile.js +2 -2
- package/dist/app/repository/model/PackageVersionManifest.d.ts +1 -1
- package/dist/app/repository/model/PackageVersionManifest.js +1 -1
- package/dist/app/repository/model/ProxyCache.d.ts +2 -2
- package/dist/app/repository/model/ProxyCache.js +1 -1
- package/dist/app/repository/model/Registry.d.ts +2 -2
- package/dist/app/repository/model/Registry.js +1 -1
- package/dist/app/repository/model/Scope.d.ts +1 -1
- package/dist/app/repository/model/Scope.js +1 -1
- package/dist/app/repository/model/Task.d.ts +2 -2
- package/dist/app/repository/model/Task.js +1 -1
- package/dist/app/repository/model/Token.d.ts +1 -1
- package/dist/app/repository/model/Token.js +1 -1
- package/dist/app/repository/model/TokenPackage.d.ts +1 -1
- package/dist/app/repository/model/TokenPackage.js +1 -1
- package/dist/app/repository/model/Total.d.ts +1 -1
- package/dist/app/repository/model/Total.js +1 -1
- package/dist/app/repository/model/User.d.ts +1 -1
- package/dist/app/repository/model/User.js +1 -1
- package/dist/app/repository/model/WebauthnCredential.d.ts +1 -1
- package/dist/app/repository/model/WebauthnCredential.js +1 -1
- package/dist/app/repository/util/EntityProperty.js +1 -1
- package/dist/app/repository/util/ModelConvertor.d.ts +1 -1
- package/dist/app/repository/util/ModelConvertor.js +1 -1
- package/dist/app.js +1 -1
- package/dist/config/binaries.d.ts +1 -1
- package/dist/config/binaries.js +1 -1
- package/dist/config/config.default.d.ts +1 -1
- package/dist/config/config.default.js +3 -3
- package/dist/config/config.unittest.js +1 -1
- package/package.json +3 -2
|
@@ -6,8 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { AccessLevel, SingletonProto, } from '@eggjs/tegg';
|
|
8
8
|
import { NotFoundError, NotImplementedError } from 'egg-errors';
|
|
9
|
-
import { AbstractService } from
|
|
10
|
-
import { NOT_IMPLEMENTED_PATH } from
|
|
9
|
+
import { AbstractService } from "../../common/AbstractService.js";
|
|
10
|
+
import { NOT_IMPLEMENTED_PATH } from "../../common/constants.js";
|
|
11
11
|
let HomeService = class HomeService extends AbstractService {
|
|
12
12
|
async misc(path) {
|
|
13
13
|
if (NOT_IMPLEMENTED_PATH.includes(path)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Hook } from '../entity/Hook.
|
|
2
|
-
import type { HookType } from '../../common/enum/Hook.
|
|
1
|
+
import { Hook } from '../entity/Hook.ts';
|
|
2
|
+
import type { HookType } from '../../common/enum/Hook.ts';
|
|
3
3
|
export interface CreateHookCommand {
|
|
4
4
|
type: HookType;
|
|
5
5
|
ownerId: string;
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { AccessLevel, Inject, SingletonProto } from '@eggjs/tegg';
|
|
11
11
|
import { ForbiddenError, NotFoundError } from 'egg-errors';
|
|
12
|
-
import { Hook } from
|
|
12
|
+
import { Hook } from "../entity/Hook.js";
|
|
13
13
|
let HookManageService = class HookManageService {
|
|
14
14
|
get hooksLimit() {
|
|
15
15
|
return this.config.cnpmcore.hooksLimit;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TriggerHookTask } from '../entity/Task.
|
|
2
|
-
import type { HookEvent } from '../entity/HookEvent.
|
|
3
|
-
import type { Hook } from '../entity/Hook.
|
|
1
|
+
import type { TriggerHookTask } from '../entity/Task.ts';
|
|
2
|
+
import type { HookEvent } from '../entity/HookEvent.ts';
|
|
3
|
+
import type { Hook } from '../entity/Hook.ts';
|
|
4
4
|
export declare class HookTriggerService {
|
|
5
5
|
private readonly hookRepository;
|
|
6
6
|
private readonly packageRepository;
|
|
@@ -8,9 +8,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { AccessLevel, Inject, SingletonProto } from '@eggjs/tegg';
|
|
11
|
-
import { isoNow } from
|
|
12
|
-
import { TaskState } from
|
|
13
|
-
import { getScopeAndName } from
|
|
11
|
+
import { isoNow } from "../../common/LogUtil.js";
|
|
12
|
+
import { TaskState } from "../../common/enum/Task.js";
|
|
13
|
+
import { getScopeAndName } from "../../common/PackageUtil.js";
|
|
14
14
|
let HookTriggerService = class HookTriggerService {
|
|
15
15
|
async executeTask(task) {
|
|
16
16
|
const { hookId, hookEvent } = task.data;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { RequireAtLeastOne } from 'type-fest';
|
|
2
|
-
import { AbstractService } from '../../common/AbstractService.
|
|
3
|
-
import type { AbbreviatedPackageManifestType, PackageJSONType, PackageManifestType } from '../../repository/PackageRepository.
|
|
4
|
-
import { Package } from '../entity/Package.
|
|
5
|
-
import { PackageVersion } from '../entity/PackageVersion.
|
|
6
|
-
import { PackageVersionBlock } from '../entity/PackageVersionBlock.
|
|
7
|
-
import type { User } from '../entity/User.
|
|
8
|
-
import type { Registry } from '../entity/Registry.
|
|
2
|
+
import { AbstractService } from '../../common/AbstractService.ts';
|
|
3
|
+
import type { AbbreviatedPackageManifestType, PackageJSONType, PackageManifestType } from '../../repository/PackageRepository.ts';
|
|
4
|
+
import { Package } from '../entity/Package.ts';
|
|
5
|
+
import { PackageVersion } from '../entity/PackageVersion.ts';
|
|
6
|
+
import { PackageVersionBlock } from '../entity/PackageVersionBlock.ts';
|
|
7
|
+
import type { User } from '../entity/User.ts';
|
|
8
|
+
import type { Registry } from '../entity/Registry.ts';
|
|
9
9
|
export interface PublishPackageCmd {
|
|
10
10
|
scope: string;
|
|
11
11
|
name: string;
|
|
@@ -15,14 +15,14 @@ import { BadRequestError, ForbiddenError, NotFoundError } from 'egg-errors';
|
|
|
15
15
|
import npa from 'npm-package-arg';
|
|
16
16
|
import semver from 'semver';
|
|
17
17
|
import pMap from 'p-map';
|
|
18
|
-
import { calculateIntegrity, detectInstallScript, formatTarball, getFullname, getScopeAndName, hasShrinkWrapInTgz, } from
|
|
19
|
-
import { AbstractService } from
|
|
20
|
-
import { isDuplicateKeyError } from
|
|
21
|
-
import { Package } from
|
|
22
|
-
import { PackageVersion } from
|
|
23
|
-
import { PackageVersionBlock } from
|
|
24
|
-
import { PackageTag } from
|
|
25
|
-
import { PACKAGE_ADDED, PACKAGE_BLOCKED, PACKAGE_MAINTAINER_CHANGED, PACKAGE_MAINTAINER_REMOVED, PACKAGE_META_CHANGED, PACKAGE_TAG_ADDED, PACKAGE_TAG_CHANGED, PACKAGE_TAG_REMOVED, PACKAGE_UNBLOCKED, PACKAGE_UNPUBLISHED, PACKAGE_VERSION_ADDED, PACKAGE_VERSION_REMOVED, } from
|
|
18
|
+
import { calculateIntegrity, detectInstallScript, formatTarball, getFullname, getScopeAndName, hasShrinkWrapInTgz, } from "../../common/PackageUtil.js";
|
|
19
|
+
import { AbstractService } from "../../common/AbstractService.js";
|
|
20
|
+
import { isDuplicateKeyError } from "../../repository/util/ErrorUtil.js";
|
|
21
|
+
import { Package } from "../entity/Package.js";
|
|
22
|
+
import { PackageVersion } from "../entity/PackageVersion.js";
|
|
23
|
+
import { PackageVersionBlock } from "../entity/PackageVersionBlock.js";
|
|
24
|
+
import { PackageTag } from "../entity/PackageTag.js";
|
|
25
|
+
import { PACKAGE_ADDED, PACKAGE_BLOCKED, PACKAGE_MAINTAINER_CHANGED, PACKAGE_MAINTAINER_REMOVED, PACKAGE_META_CHANGED, PACKAGE_TAG_ADDED, PACKAGE_TAG_CHANGED, PACKAGE_TAG_REMOVED, PACKAGE_UNBLOCKED, PACKAGE_UNPUBLISHED, PACKAGE_VERSION_ADDED, PACKAGE_VERSION_REMOVED, } from "../event/index.js";
|
|
26
26
|
const TOTAL = '@@TOTAL@@';
|
|
27
27
|
const SCOPE_TOTAL_PREFIX = '@@SCOPE@@:';
|
|
28
28
|
const DESCRIPTION_LIMIT = 1024 * 10;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AbstractService } from '../../common/AbstractService.
|
|
2
|
-
import type { SearchManifestType } from '../../repository/SearchRepository.
|
|
3
|
-
import type { PackageRepository } from '../../repository/PackageRepository.
|
|
4
|
-
import type { PackageVersionBlockRepository } from '../../repository/PackageVersionBlockRepository.
|
|
1
|
+
import { AbstractService } from '../../common/AbstractService.ts';
|
|
2
|
+
import type { SearchManifestType } from '../../repository/SearchRepository.ts';
|
|
3
|
+
import type { PackageRepository } from '../../repository/PackageRepository.ts';
|
|
4
|
+
import type { PackageVersionBlockRepository } from '../../repository/PackageVersionBlockRepository.ts';
|
|
5
5
|
export declare class PackageSearchService extends AbstractService {
|
|
6
6
|
private readonly packageManagerService;
|
|
7
7
|
private readonly searchRepository;
|
|
@@ -10,8 +10,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
import { AccessLevel, Inject, SingletonProto } from '@eggjs/tegg';
|
|
11
11
|
import { errors } from '@elastic/elasticsearch';
|
|
12
12
|
import dayjs from 'dayjs';
|
|
13
|
-
import { AbstractService } from
|
|
14
|
-
import { formatAuthor, getScopeAndName } from
|
|
13
|
+
import { AbstractService } from "../../common/AbstractService.js";
|
|
14
|
+
import { formatAuthor, getScopeAndName } from "../../common/PackageUtil.js";
|
|
15
15
|
let PackageSearchService = class PackageSearchService extends AbstractService {
|
|
16
16
|
async syncPackage(fullname, isSync = true) {
|
|
17
17
|
const [scope, name] = getScopeAndName(fullname);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BadRequestError } from 'egg-errors';
|
|
2
|
-
import { AbstractService } from '../../common/AbstractService.
|
|
3
|
-
import { type CreateSyncPackageTask, type SyncPackageTaskOptions, Task } from '../entity/Task.
|
|
4
|
-
import type { Package } from '../entity/Package.
|
|
5
|
-
import type { Registry } from '../entity/Registry.
|
|
2
|
+
import { AbstractService } from '../../common/AbstractService.ts';
|
|
3
|
+
import { type CreateSyncPackageTask, type SyncPackageTaskOptions, Task } from '../entity/Task.ts';
|
|
4
|
+
import type { Package } from '../entity/Package.ts';
|
|
5
|
+
import type { Registry } from '../entity/Registry.ts';
|
|
6
6
|
export declare class RegistryNotMatchError extends BadRequestError {
|
|
7
7
|
}
|
|
8
8
|
export declare class PackageSyncerService extends AbstractService {
|
|
@@ -18,8 +18,8 @@ export declare class PackageSyncerService extends AbstractService {
|
|
|
18
18
|
private readonly httpclient;
|
|
19
19
|
private readonly registryManagerService;
|
|
20
20
|
private readonly scopeManagerService;
|
|
21
|
-
createTask(fullname: string, options?: SyncPackageTaskOptions): Promise<Task<import("../entity/Task.
|
|
22
|
-
findTask(taskId: string): Promise<Task<import("../entity/Task.
|
|
21
|
+
createTask(fullname: string, options?: SyncPackageTaskOptions): Promise<Task<import("../entity/Task.ts").TaskBaseData>>;
|
|
22
|
+
findTask(taskId: string): Promise<Task<import("../entity/Task.ts").TaskBaseData> | null>;
|
|
23
23
|
findTaskLog(task: Task): Promise<string | import("stream").Readable | undefined>;
|
|
24
24
|
findExecuteTask(): Promise<CreateSyncPackageTask>;
|
|
25
25
|
get allowSyncDownloadData(): boolean;
|
|
@@ -15,13 +15,13 @@ import { Pointcut } from '@eggjs/tegg/aop';
|
|
|
15
15
|
import { isEmpty, isEqual } from 'lodash-es';
|
|
16
16
|
import semver from 'semver';
|
|
17
17
|
import { BadRequestError } from 'egg-errors';
|
|
18
|
-
import { detectInstallScript, getScopeAndName, } from
|
|
19
|
-
import { downloadToTempfile } from
|
|
20
|
-
import { TaskState, TaskType } from
|
|
21
|
-
import { AbstractService } from
|
|
22
|
-
import { Task, } from
|
|
23
|
-
import { EventCorkAdvice } from
|
|
24
|
-
import { PresetRegistryName, SyncDeleteMode } from
|
|
18
|
+
import { detectInstallScript, getScopeAndName, } from "../../common/PackageUtil.js";
|
|
19
|
+
import { downloadToTempfile } from "../../common/FileUtil.js";
|
|
20
|
+
import { TaskState, TaskType } from "../../common/enum/Task.js";
|
|
21
|
+
import { AbstractService } from "../../common/AbstractService.js";
|
|
22
|
+
import { Task, } from "../entity/Task.js";
|
|
23
|
+
import { EventCorkAdvice } from "./EventCorkerAdvice.js";
|
|
24
|
+
import { PresetRegistryName, SyncDeleteMode } from "../../common/constants.js";
|
|
25
25
|
function isoNow() {
|
|
26
26
|
return new Date().toISOString();
|
|
27
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AbstractService } from '../../common/AbstractService.
|
|
2
|
-
import { PackageVersionFile } from '../entity/PackageVersionFile.
|
|
3
|
-
import type { PackageVersion } from '../entity/PackageVersion.
|
|
4
|
-
import type { Package } from '../entity/Package.
|
|
1
|
+
import { AbstractService } from '../../common/AbstractService.ts';
|
|
2
|
+
import { PackageVersionFile } from '../entity/PackageVersionFile.ts';
|
|
3
|
+
import type { PackageVersion } from '../entity/PackageVersion.ts';
|
|
4
|
+
import type { Package } from '../entity/Package.ts';
|
|
5
5
|
export declare class PackageVersionFileService extends AbstractService {
|
|
6
6
|
#private;
|
|
7
7
|
private readonly packageVersionRepository;
|
|
@@ -27,11 +27,11 @@ import tar from '@fengmk2/tar';
|
|
|
27
27
|
import { AccessLevel, Inject, SingletonProto } from '@eggjs/tegg';
|
|
28
28
|
import { ConflictError, ForbiddenError } from 'egg-errors';
|
|
29
29
|
import semver from 'semver';
|
|
30
|
-
import { AbstractService } from
|
|
31
|
-
import { calculateIntegrity, getFullname } from
|
|
32
|
-
import { createTempDir, mimeLookup } from
|
|
33
|
-
import { isDuplicateKeyError } from
|
|
34
|
-
import { PackageVersionFile } from
|
|
30
|
+
import { AbstractService } from "../../common/AbstractService.js";
|
|
31
|
+
import { calculateIntegrity, getFullname } from "../../common/PackageUtil.js";
|
|
32
|
+
import { createTempDir, mimeLookup } from "../../common/FileUtil.js";
|
|
33
|
+
import { isDuplicateKeyError } from "../../repository/util/ErrorUtil.js";
|
|
34
|
+
import { PackageVersionFile } from "../entity/PackageVersionFile.js";
|
|
35
35
|
const unpkgWhiteListUrl = 'https://github.com/cnpm/unpkg-white-list';
|
|
36
36
|
const CHECK_TIMEOUT = process.env.NODE_ENV === 'test' ? 1 : 60_000;
|
|
37
37
|
let PackageVersionFileService = class PackageVersionFileService extends AbstractService {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Result } from 'npm-package-arg';
|
|
2
|
-
import type { PackageJSONType } from '../../repository/PackageRepository.
|
|
2
|
+
import type { PackageJSONType } from '../../repository/PackageRepository.ts';
|
|
3
3
|
export declare class PackageVersionService {
|
|
4
4
|
private packageVersionRepository;
|
|
5
5
|
private packageRepository;
|
|
@@ -9,8 +9,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { AccessLevel, Inject, SingletonProto } from '@eggjs/tegg';
|
|
11
11
|
import semver, { Range } from 'semver';
|
|
12
|
-
import { getScopeAndName } from
|
|
13
|
-
import { SqlRange } from
|
|
12
|
+
import { getScopeAndName } from "../../common/PackageUtil.js";
|
|
13
|
+
import { SqlRange } from "../entity/SqlRange.js";
|
|
14
14
|
let PackageVersionService = class PackageVersionService {
|
|
15
15
|
async readManifest(pkgId, spec, isFullManifests, withBugVersion = true) {
|
|
16
16
|
const realSpec = this.findRealSpec(spec);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Context, HttpClientRequestOptions, HttpClientResponse } from 'egg';
|
|
2
|
-
import { AbstractService } from '../../common/AbstractService.
|
|
3
|
-
import { type CreateUpdateProxyCacheTask, type UpdateProxyCacheTaskOptions, Task } from '../entity/Task.
|
|
4
|
-
import { DIST_NAMES } from '../entity/Package.
|
|
5
|
-
import type { AbbreviatedPackageJSONType, AbbreviatedPackageManifestType, PackageJSONType, PackageManifestType } from '../../repository/PackageRepository.
|
|
2
|
+
import { AbstractService } from '../../common/AbstractService.ts';
|
|
3
|
+
import { type CreateUpdateProxyCacheTask, type UpdateProxyCacheTaskOptions, Task } from '../entity/Task.ts';
|
|
4
|
+
import { DIST_NAMES } from '../entity/Package.ts';
|
|
5
|
+
import type { AbbreviatedPackageJSONType, AbbreviatedPackageManifestType, PackageJSONType, PackageManifestType } from '../../repository/PackageRepository.ts';
|
|
6
6
|
type GetSourceManifestAndCacheReturnType<T> = T extends DIST_NAMES.ABBREVIATED | DIST_NAMES.MANIFEST ? AbbreviatedPackageJSONType | PackageJSONType : T extends DIST_NAMES.FULL_MANIFESTS | DIST_NAMES.ABBREVIATED_MANIFESTS ? AbbreviatedPackageManifestType | PackageManifestType : never;
|
|
7
7
|
export declare class ProxyCacheService extends AbstractService {
|
|
8
8
|
private readonly httpclient;
|
|
@@ -19,7 +19,7 @@ export declare class ProxyCacheService extends AbstractService {
|
|
|
19
19
|
removeProxyCache(fullname: string, fileType: DIST_NAMES, version?: string): Promise<void>;
|
|
20
20
|
replaceTarballUrl<T extends DIST_NAMES>(manifest: GetSourceManifestAndCacheReturnType<T>, fileType: T): GetSourceManifestAndCacheReturnType<T>;
|
|
21
21
|
createTask(targetName: string, options: UpdateProxyCacheTaskOptions): Promise<CreateUpdateProxyCacheTask>;
|
|
22
|
-
findExecuteTask(): Promise<Task<import("../entity/Task.
|
|
22
|
+
findExecuteTask(): Promise<Task<import("../entity/Task.ts").TaskBaseData> | null>;
|
|
23
23
|
executeTask(task: Task): Promise<void>;
|
|
24
24
|
private getRewrittenManifest;
|
|
25
25
|
private storeRewrittenManifest;
|
|
@@ -10,13 +10,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
import { ForbiddenError } from 'egg-errors';
|
|
11
11
|
import { AccessLevel, Inject, SingletonProto } from '@eggjs/tegg';
|
|
12
12
|
import { valid as semverValid } from 'semver';
|
|
13
|
-
import { AbstractService } from
|
|
14
|
-
import { ProxyCache } from
|
|
15
|
-
import { Task, } from
|
|
16
|
-
import { TaskState, TaskType } from
|
|
17
|
-
import { calculateIntegrity } from
|
|
18
|
-
import { ABBREVIATED_META_TYPE, PROXY_CACHE_DIR_NAME, } from
|
|
19
|
-
import { DIST_NAMES, isPkgManifest } from
|
|
13
|
+
import { AbstractService } from "../../common/AbstractService.js";
|
|
14
|
+
import { ProxyCache } from "../entity/ProxyCache.js";
|
|
15
|
+
import { Task, } from "../entity/Task.js";
|
|
16
|
+
import { TaskState, TaskType } from "../../common/enum/Task.js";
|
|
17
|
+
import { calculateIntegrity } from "../../common/PackageUtil.js";
|
|
18
|
+
import { ABBREVIATED_META_TYPE, PROXY_CACHE_DIR_NAME, } from "../../common/constants.js";
|
|
19
|
+
import { DIST_NAMES, isPkgManifest } from "../entity/Package.js";
|
|
20
20
|
function isoNow() {
|
|
21
21
|
return new Date().toISOString();
|
|
22
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbstractService } from '../../common/AbstractService.
|
|
2
|
-
import { Registry } from '../entity/Registry.
|
|
3
|
-
import type { PageOptions, PageResult } from '../util/EntityUtil.
|
|
1
|
+
import { AbstractService } from '../../common/AbstractService.ts';
|
|
2
|
+
import { Registry } from '../entity/Registry.ts';
|
|
3
|
+
import type { PageOptions, PageResult } from '../util/EntityUtil.ts';
|
|
4
4
|
export interface CreateRegistryCmd extends Pick<Registry, 'changeStream' | 'host' | 'userPrefix' | 'type' | 'name' | 'authToken'> {
|
|
5
5
|
operatorId?: string;
|
|
6
6
|
}
|
|
@@ -9,11 +9,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { AccessLevel, Inject, SingletonProto } from '@eggjs/tegg';
|
|
11
11
|
import { E400, NotFoundError } from 'egg-errors';
|
|
12
|
-
import { AbstractService } from
|
|
13
|
-
import { Registry } from
|
|
14
|
-
import { Task } from
|
|
15
|
-
import { ChangesStreamMode, PresetRegistryName, } from
|
|
16
|
-
import { RegistryType } from
|
|
12
|
+
import { AbstractService } from "../../common/AbstractService.js";
|
|
13
|
+
import { Registry } from "../entity/Registry.js";
|
|
14
|
+
import { Task } from "../entity/Task.js";
|
|
15
|
+
import { ChangesStreamMode, PresetRegistryName, } from "../../common/constants.js";
|
|
16
|
+
import { RegistryType } from "../../common/enum/Registry.js";
|
|
17
17
|
let RegistryManagerService = class RegistryManagerService extends AbstractService {
|
|
18
18
|
async createSyncChangesStream(startSyncCmd) {
|
|
19
19
|
const { registryId, operatorId = '-', since } = startSyncCmd;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbstractService } from '../../common/AbstractService.
|
|
2
|
-
import { Scope } from '../entity/Scope.
|
|
3
|
-
import type { PageOptions, PageResult } from '../util/EntityUtil.
|
|
1
|
+
import { AbstractService } from '../../common/AbstractService.ts';
|
|
2
|
+
import { Scope } from '../entity/Scope.ts';
|
|
3
|
+
import type { PageOptions, PageResult } from '../util/EntityUtil.ts';
|
|
4
4
|
export interface CreateScopeCmd extends Pick<Scope, 'name' | 'registryId'> {
|
|
5
5
|
operatorId?: string;
|
|
6
6
|
}
|
|
@@ -8,8 +8,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { AccessLevel, Inject, SingletonProto } from '@eggjs/tegg';
|
|
11
|
-
import { AbstractService } from
|
|
12
|
-
import { Scope } from
|
|
11
|
+
import { AbstractService } from "../../common/AbstractService.js";
|
|
12
|
+
import { Scope } from "../entity/Scope.js";
|
|
13
13
|
let ScopeManagerService = class ScopeManagerService extends AbstractService {
|
|
14
14
|
async findByName(name) {
|
|
15
15
|
const scope = await this.scopeRepository.findByName(name);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { TaskState, TaskType } from '../../common/enum/Task.
|
|
2
|
-
import { AbstractService } from '../../common/AbstractService.
|
|
3
|
-
import type { Task } from '../entity/Task.
|
|
1
|
+
import { TaskState, TaskType } from '../../common/enum/Task.ts';
|
|
2
|
+
import { AbstractService } from '../../common/AbstractService.ts';
|
|
3
|
+
import type { Task } from '../entity/Task.ts';
|
|
4
4
|
export declare class TaskService extends AbstractService {
|
|
5
5
|
private readonly taskRepository;
|
|
6
6
|
private readonly nfsAdapter;
|
|
7
7
|
private readonly queueAdapter;
|
|
8
8
|
getTaskQueueLength(taskType: TaskType): Promise<number>;
|
|
9
|
-
createTask(task: Task, addTaskQueueOnExists: boolean): Promise<Task<import("../entity/Task.
|
|
9
|
+
createTask(task: Task, addTaskQueueOnExists: boolean): Promise<Task<import("../entity/Task.ts").TaskBaseData>>;
|
|
10
10
|
retryTask(task: Task, appendLog?: string): Promise<void>;
|
|
11
|
-
findTask(taskId: string): Promise<Task<import("../entity/Task.
|
|
12
|
-
findTasks(taskIdList: string[]): Promise<Task<import("../entity/Task.
|
|
11
|
+
findTask(taskId: string): Promise<Task<import("../entity/Task.ts").TaskBaseData> | null>;
|
|
12
|
+
findTasks(taskIdList: string[]): Promise<Task<import("../entity/Task.ts").TaskBaseData>[]>;
|
|
13
13
|
findTaskLog(task: Task): Promise<string | import("stream").Readable | undefined>;
|
|
14
|
-
findExecuteTask(taskType: TaskType): Promise<Task<import("../entity/Task.
|
|
14
|
+
findExecuteTask(taskType: TaskType): Promise<Task<import("../entity/Task.ts").TaskBaseData> | null>;
|
|
15
15
|
retryExecuteTimeoutTasks(): Promise<{
|
|
16
16
|
processing: number;
|
|
17
17
|
waiting: number;
|
|
@@ -8,8 +8,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { AccessLevel, Inject, SingletonProto } from '@eggjs/tegg';
|
|
11
|
-
import { TaskState, TaskType } from
|
|
12
|
-
import { AbstractService } from
|
|
11
|
+
import { TaskState, TaskType } from "../../common/enum/Task.js";
|
|
12
|
+
import { AbstractService } from "../../common/AbstractService.js";
|
|
13
13
|
let TaskService = class TaskService extends AbstractService {
|
|
14
14
|
async getTaskQueueLength(taskType) {
|
|
15
15
|
return await this.queueAdapter.length(taskType);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbstractService } from '../../common/AbstractService.
|
|
2
|
-
import { type Token } from '../entity/Token.
|
|
3
|
-
import { Package as PackageEntity } from '../entity/Package.
|
|
1
|
+
import { AbstractService } from '../../common/AbstractService.ts';
|
|
2
|
+
import { type Token } from '../entity/Token.ts';
|
|
3
|
+
import { Package as PackageEntity } from '../entity/Package.ts';
|
|
4
4
|
export declare class TokenService extends AbstractService {
|
|
5
5
|
private readonly TokenPackage;
|
|
6
6
|
private readonly Package;
|
|
@@ -11,12 +11,12 @@ import dayjs from 'dayjs';
|
|
|
11
11
|
import { AccessLevel, Inject, SingletonProto } from '@eggjs/tegg';
|
|
12
12
|
import { isEmpty } from 'lodash-es';
|
|
13
13
|
import { ForbiddenError, UnauthorizedError } from 'egg-errors';
|
|
14
|
-
import { AbstractService } from
|
|
15
|
-
import { isGranularToken } from
|
|
16
|
-
import { ModelConvertor } from
|
|
17
|
-
import { Package as PackageEntity } from
|
|
18
|
-
import { getScopeAndName } from
|
|
19
|
-
import { sha512 } from
|
|
14
|
+
import { AbstractService } from "../../common/AbstractService.js";
|
|
15
|
+
import { isGranularToken } from "../entity/Token.js";
|
|
16
|
+
import { ModelConvertor } from "../../../app/repository/util/ModelConvertor.js";
|
|
17
|
+
import { Package as PackageEntity } from "../entity/Package.js";
|
|
18
|
+
import { getScopeAndName } from "../../../app/common/PackageUtil.js";
|
|
19
|
+
import { sha512 } from "../../../app/common/UserUtil.js";
|
|
20
20
|
let TokenService = class TokenService extends AbstractService {
|
|
21
21
|
async listTokenPackages(token) {
|
|
22
22
|
if (isGranularToken(token)) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { User as UserEntity } from '../entity/User.
|
|
2
|
-
import { Token as TokenEntity, type TokenType } from '../entity/Token.
|
|
3
|
-
import { WebauthnCredential as WebauthnCredentialEntity } from '../entity/WebauthnCredential.
|
|
4
|
-
import { LoginResultCode } from '../../common/enum/User.
|
|
5
|
-
import { AbstractService } from '../../common/AbstractService.
|
|
6
|
-
import type { Registry } from '../entity/Registry.
|
|
1
|
+
import { User as UserEntity } from '../entity/User.ts';
|
|
2
|
+
import { Token as TokenEntity, type TokenType } from '../entity/Token.ts';
|
|
3
|
+
import { WebauthnCredential as WebauthnCredentialEntity } from '../entity/WebauthnCredential.ts';
|
|
4
|
+
import { LoginResultCode } from '../../common/enum/User.ts';
|
|
5
|
+
import { AbstractService } from '../../common/AbstractService.ts';
|
|
6
|
+
import type { Registry } from '../entity/Registry.ts';
|
|
7
7
|
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<T>;
|
|
8
8
|
interface CreateUser {
|
|
9
9
|
name: string;
|
|
@@ -10,13 +10,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
import crypto from 'node:crypto';
|
|
11
11
|
import { AccessLevel, Inject, SingletonProto } from '@eggjs/tegg';
|
|
12
12
|
import { ForbiddenError, NotFoundError } from 'egg-errors';
|
|
13
|
-
import { User as UserEntity } from
|
|
14
|
-
import { Token as TokenEntity } from
|
|
15
|
-
import { WebauthnCredential as WebauthnCredentialEntity } from
|
|
16
|
-
import { LoginResultCode } from
|
|
17
|
-
import { checkIntegrity, integrity, randomToken, sha512, } from
|
|
18
|
-
import { AbstractService } from
|
|
19
|
-
import { getPrefixedName } from
|
|
13
|
+
import { User as UserEntity } from "../entity/User.js";
|
|
14
|
+
import { Token as TokenEntity } from "../entity/Token.js";
|
|
15
|
+
import { WebauthnCredential as WebauthnCredentialEntity } from "../entity/WebauthnCredential.js";
|
|
16
|
+
import { LoginResultCode } from "../../common/enum/User.js";
|
|
17
|
+
import { checkIntegrity, integrity, randomToken, sha512, } from "../../common/UserUtil.js";
|
|
18
|
+
import { AbstractService } from "../../common/AbstractService.js";
|
|
19
|
+
import { getPrefixedName } from "../../common/PackageUtil.js";
|
|
20
20
|
let UserService = class UserService extends AbstractService {
|
|
21
21
|
checkPassword(user, password) {
|
|
22
22
|
const plain = `${user.passwordSalt}${password}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EntityData } from '../entity/Entity.
|
|
1
|
+
import type { EntityData } from '../entity/Entity.ts';
|
|
2
2
|
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
3
3
|
export type EasyData<T extends EntityData, Id extends keyof T> = PartialBy<T, 'createdAt' | 'updatedAt' | Id>;
|
|
4
4
|
export interface PageOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EggContext } from '@eggjs/tegg';
|
|
2
2
|
import type { Redis } from 'ioredis';
|
|
3
|
-
import type { AuthClient, AuthUrlResult, userResult } from '../common/typing.
|
|
3
|
+
import type { AuthClient, AuthUrlResult, userResult } from '../common/typing.ts';
|
|
4
4
|
interface SSO_USER {
|
|
5
5
|
name: string;
|
|
6
6
|
email: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Readable } from 'node:stream';
|
|
2
|
-
import type { AppendResult, DownloadOptions, NFSClient, UploadOptions, UploadResult } from '../common/typing.
|
|
2
|
+
import type { AppendResult, DownloadOptions, NFSClient, UploadOptions, UploadResult } from '../common/typing.ts';
|
|
3
3
|
export declare class NFSClientAdapter implements NFSClient {
|
|
4
4
|
private logger;
|
|
5
5
|
private config;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type EggContext } from '@eggjs/tegg';
|
|
2
2
|
import type { EggLogger } from 'egg';
|
|
3
|
-
import type { Package as PackageEntity } from '../core/entity/Package.
|
|
4
|
-
import type { User as UserEntity } from '../core/entity/User.
|
|
5
|
-
import type { Token as TokenEntity } from '../core/entity/Token.
|
|
3
|
+
import type { Package as PackageEntity } from '../core/entity/Package.ts';
|
|
4
|
+
import type { User as UserEntity } from '../core/entity/User.ts';
|
|
5
|
+
import type { Token as TokenEntity } from '../core/entity/Token.ts';
|
|
6
6
|
export type TokenRole = 'read' | 'publish' | 'setting';
|
|
7
7
|
export declare class UserRoleManager {
|
|
8
8
|
private readonly packageRepository;
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { AccessLevel, ContextProto, Inject, } from '@eggjs/tegg';
|
|
11
11
|
import { ForbiddenError, UnauthorizedError } from 'egg-errors';
|
|
12
|
-
import { getScopeAndName } from
|
|
12
|
+
import { getScopeAndName } from "../common/PackageUtil.js";
|
|
13
13
|
let UserRoleManager = class UserRoleManager {
|
|
14
14
|
constructor() {
|
|
15
15
|
this.handleAuthorized = false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ChangesStreamMode, SyncDeleteMode, SyncMode } from '../common/constants.
|
|
2
|
-
import type { DATABASE_TYPE } from '../../config/database.
|
|
3
|
-
export { cnpmcoreConfig } from '../../config/config.default.
|
|
1
|
+
import type { ChangesStreamMode, SyncDeleteMode, SyncMode } from '../common/constants.ts';
|
|
2
|
+
import type { DATABASE_TYPE } from '../../config/database.ts';
|
|
3
|
+
export { cnpmcoreConfig } from '../../config/config.default.ts';
|
|
4
4
|
export interface CnpmcoreConfig {
|
|
5
5
|
name: string;
|
|
6
6
|
/**
|
package/dist/app/port/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { cnpmcoreConfig } from
|
|
1
|
+
export { cnpmcoreConfig } from "../../config/config.default.js";
|
|
2
2
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vYXBwL3BvcnQvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9BLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQyJ9
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { NotFoundError, UnavailableForLegalReasonsError } from 'egg-errors';
|
|
2
2
|
import { type EggContext } from '@eggjs/tegg';
|
|
3
3
|
import type { EggAppConfig, EggLogger } from 'egg';
|
|
4
|
-
import { MiddlewareController } from '../middleware/index.
|
|
5
|
-
import type { UserRoleManager } from '../UserRoleManager.
|
|
6
|
-
import type { PackageRepository } from '../../repository/PackageRepository.
|
|
7
|
-
import type { UserRepository } from '../../repository/UserRepository.
|
|
8
|
-
import type { Package as PackageEntity } from '../../core/entity/Package.
|
|
9
|
-
import type { PackageVersion as PackageVersionEntity } from '../../core/entity/PackageVersion.
|
|
10
|
-
import type { UserService } from '../../core/service/UserService.
|
|
11
|
-
import type { User as UserEntity } from '../../core/entity/User.
|
|
4
|
+
import { MiddlewareController } from '../middleware/index.ts';
|
|
5
|
+
import type { UserRoleManager } from '../UserRoleManager.ts';
|
|
6
|
+
import type { PackageRepository } from '../../repository/PackageRepository.ts';
|
|
7
|
+
import type { UserRepository } from '../../repository/UserRepository.ts';
|
|
8
|
+
import type { Package as PackageEntity } from '../../core/entity/Package.ts';
|
|
9
|
+
import type { PackageVersion as PackageVersionEntity } from '../../core/entity/PackageVersion.ts';
|
|
10
|
+
import type { UserService } from '../../core/service/UserService.ts';
|
|
11
|
+
import type { User as UserEntity } from '../../core/entity/User.ts';
|
|
12
12
|
declare class PackageNotFoundError extends NotFoundError {
|
|
13
13
|
redirectToSourceRegistry?: string;
|
|
14
14
|
}
|
|
@@ -9,10 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { NotFoundError, UnavailableForLegalReasonsError } from 'egg-errors';
|
|
11
11
|
import { Inject } from '@eggjs/tegg';
|
|
12
|
-
import { MiddlewareController } from
|
|
13
|
-
import { getFullname, getScopeAndName } from
|
|
14
|
-
import { VersionRule } from
|
|
15
|
-
import { SyncMode } from
|
|
12
|
+
import { MiddlewareController } from "../middleware/index.js";
|
|
13
|
+
import { getFullname, getScopeAndName } from "../../common/PackageUtil.js";
|
|
14
|
+
import { VersionRule } from "../typebox.js";
|
|
15
|
+
import { SyncMode } from "../../common/constants.js";
|
|
16
16
|
class PackageNotFoundError extends NotFoundError {
|
|
17
17
|
}
|
|
18
18
|
class ControllerRedirectError extends NotFoundError {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbstractController } from './AbstractController.
|
|
1
|
+
import { AbstractController } from './AbstractController.ts';
|
|
2
2
|
export declare class AccessController extends AbstractController {
|
|
3
3
|
listCollaborators(fullname: string): Promise<Record<string, string>>;
|
|
4
4
|
listPackagesByUser(username: string): Promise<Record<string, string>>;
|
|
@@ -12,9 +12,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
};
|
|
13
13
|
import { HTTPController, HTTPMethod, HTTPMethodEnum, HTTPParam, } from '@eggjs/tegg';
|
|
14
14
|
import { ForbiddenError, NotFoundError } from 'egg-errors';
|
|
15
|
-
import { AbstractController } from
|
|
16
|
-
import { FULLNAME_REG_STRING, getFullname, getScopeAndName, } from
|
|
17
|
-
import { PackageAccessLevel } from
|
|
15
|
+
import { AbstractController } from "./AbstractController.js";
|
|
16
|
+
import { FULLNAME_REG_STRING, getFullname, getScopeAndName, } from "../../common/PackageUtil.js";
|
|
17
|
+
import { PackageAccessLevel } from "../../common/constants.js";
|
|
18
18
|
let AccessController = class AccessController extends AbstractController {
|
|
19
19
|
async listCollaborators(fullname) {
|
|
20
20
|
const [scope, name] = getScopeAndName(fullname);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EggContext } from '@eggjs/tegg';
|
|
2
|
-
import { AbstractController } from './AbstractController.
|
|
3
|
-
import { type BinaryName } from '../../../config/binaries.
|
|
2
|
+
import { AbstractController } from './AbstractController.ts';
|
|
3
|
+
import { type BinaryName } from '../../../config/binaries.ts';
|
|
4
4
|
export declare class BinarySyncController extends AbstractController {
|
|
5
5
|
private binarySyncerService;
|
|
6
6
|
showBinaryHTML(ctx: EggContext): Promise<string>;
|