@hikarix/core
Advanced tools
Comparing version 0.4.9 to 0.5.1
@@ -1,10 +0,10 @@ | ||
import { HiKariAppService, HiKariAppServicePingResult, HiKariAppServiceStatus } from "./app.service"; | ||
import { HiKariAppServicePingResult, HiKariAppServiceStatus, HiKariCoreAppService } from "./app.service"; | ||
import { HiKariGenericResponse } from "../proto/generic.error"; | ||
import { HiKariRepoServiceOpsManager, RepoServiceOpsInfo } from "../repo/index"; | ||
import { HiKariPlatformResourceManager, PlatformResourceInfo } from "../platform-resource/index"; | ||
export declare class HiKariAppController { | ||
export declare class HiKariCoreAppController { | ||
private readonly rootService; | ||
private readonly opsManager; | ||
private readonly resourceManager; | ||
constructor(rootService: HiKariAppService, opsManager: HiKariRepoServiceOpsManager, resourceManager: HiKariPlatformResourceManager); | ||
constructor(rootService: HiKariCoreAppService, opsManager: HiKariRepoServiceOpsManager, resourceManager: HiKariPlatformResourceManager); | ||
getPing(): HiKariGenericResponse<HiKariAppServicePingResult>; | ||
@@ -11,0 +11,0 @@ getPropStatus(): HiKariGenericResponse<HiKariAppServiceStatus>; |
@@ -21,3 +21,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HiKariAppController = void 0; | ||
exports.HiKariCoreAppController = void 0; | ||
const common_1 = require("@nestjs/common"); | ||
@@ -28,3 +28,3 @@ const app_service_1 = require("./app.service"); | ||
const platform_resource_1 = require("../platform-resource"); | ||
let HiKariAppController = class HiKariAppController { | ||
let HiKariCoreAppController = class HiKariCoreAppController { | ||
constructor(rootService, opsManager, resourceManager) { | ||
@@ -55,3 +55,3 @@ this.rootService = rootService; | ||
__metadata("design:returntype", Object) | ||
], HiKariAppController.prototype, "getPing", null); | ||
], HiKariCoreAppController.prototype, "getPing", null); | ||
__decorate([ | ||
@@ -62,3 +62,3 @@ common_1.Get('prop/status'), | ||
__metadata("design:returntype", Object) | ||
], HiKariAppController.prototype, "getPropStatus", null); | ||
], HiKariCoreAppController.prototype, "getPropStatus", null); | ||
__decorate([ | ||
@@ -69,3 +69,3 @@ common_1.Get('prop/protocol'), | ||
__metadata("design:returntype", Object) | ||
], HiKariAppController.prototype, "getProtocolList", null); | ||
], HiKariCoreAppController.prototype, "getProtocolList", null); | ||
__decorate([ | ||
@@ -76,10 +76,10 @@ common_1.Get('prop/platform-resource'), | ||
__metadata("design:returntype", Promise) | ||
], HiKariAppController.prototype, "getPlatformResourcesInfo", null); | ||
HiKariAppController = __decorate([ | ||
], HiKariCoreAppController.prototype, "getPlatformResourcesInfo", null); | ||
HiKariCoreAppController = __decorate([ | ||
common_1.Controller(), | ||
__metadata("design:paramtypes", [app_service_1.HiKariAppService, | ||
__metadata("design:paramtypes", [app_service_1.HiKariCoreAppService, | ||
repo_1.HiKariRepoServiceOpsManager, | ||
platform_resource_1.HiKariPlatformResourceManager]) | ||
], HiKariAppController); | ||
exports.HiKariAppController = HiKariAppController; | ||
], HiKariCoreAppController); | ||
exports.HiKariCoreAppController = HiKariCoreAppController; | ||
//# sourceMappingURL=app.controller.js.map |
import { DynamicModule } from '@nestjs/common'; | ||
import { HiKariAppModuleConfig } from "./core/config.dynamic.module"; | ||
import { HiKariAppModuleConfig } from "./core/index"; | ||
export declare class HiKariCoreAppModule { | ||
static forRoot(appModuleConfig: HiKariAppModuleConfig): DynamicModule; | ||
} |
@@ -14,29 +14,22 @@ "use strict"; | ||
const app_service_1 = require("./app.service"); | ||
const repo_module_1 = require("./repo/repo.module"); | ||
const manager_repo_service_ops_module_1 = require("./core/manager.repo-service-ops.module"); | ||
const manager_platform_resources_module_1 = require("./core/manager.platform-resources.module"); | ||
const config_module_1 = require("./core/config.module"); | ||
const config_dynamic_module_1 = require("./core/config.dynamic.module"); | ||
const config_platform_resources_module_1 = require("./core/config.platform-resources.module"); | ||
const repo_1 = require("./repo"); | ||
const core_1 = require("./core"); | ||
const app_controller_favicon_1 = require("./app.controller.favicon"); | ||
let HiKariCoreAppModule = HiKariCoreAppModule_1 = class HiKariCoreAppModule { | ||
static forRoot(appModuleConfig) { | ||
const dynConfigModules = []; | ||
if (appModuleConfig.platformResourcesConfCallback) { | ||
dynConfigModules.push(config_platform_resources_module_1.HiKariCoreDynamicPRConfigModule.forDynamics(appModuleConfig.platformResourcesConfCallback)); | ||
} | ||
else { | ||
dynConfigModules.push(config_platform_resources_module_1.HiKariCoreDynamicPRConfigModule.forStatics(appModuleConfig.platformResources || [])); | ||
} | ||
return { | ||
module: HiKariCoreAppModule_1, | ||
imports: [ | ||
config_module_1.HiKariCoreConfigModule, | ||
...dynConfigModules, | ||
manager_platform_resources_module_1.HiKariCorePlatformResourcesManagerModule.fromArray(), | ||
manager_repo_service_ops_module_1.HiKariCoreRepoServiceOpsManagerModule.forModuleConfig(appModuleConfig), | ||
repo_module_1.HiKariRepoModule.forModuleConfig(appModuleConfig) | ||
core_1.HiKariCoreConfigModule, | ||
core_1.HiKariCoreDynamicConfigModule.forModuleConfig(appModuleConfig), | ||
core_1.HiKariCorePlatformResourcesManagerModule, | ||
core_1.HiKariCoreRepoServiceOpsManagerModule, | ||
repo_1.HiKariCoreRepoModule, | ||
], | ||
controllers: [app_controller_1.HiKariAppController], | ||
providers: [app_service_1.HiKariAppService], | ||
exports: [app_service_1.HiKariAppService], | ||
controllers: [ | ||
app_controller_1.HiKariCoreAppController, | ||
app_controller_favicon_1.HiKariCoreAppFaviconController, | ||
], | ||
providers: [app_service_1.HiKariCoreAppService], | ||
exports: [app_service_1.HiKariCoreAppService], | ||
}; | ||
@@ -43,0 +36,0 @@ } |
@@ -11,3 +11,3 @@ import { HiKariRepoServiceOpsManager } from "../repo/index"; | ||
} | ||
export declare class HiKariAppService { | ||
export declare class HiKariCoreAppService { | ||
private readonly repoServiceOpsManager; | ||
@@ -14,0 +14,0 @@ constructor(repoServiceOpsManager: HiKariRepoServiceOpsManager); |
@@ -12,7 +12,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HiKariAppService = void 0; | ||
exports.HiKariCoreAppService = void 0; | ||
const common_1 = require("@nestjs/common"); | ||
const config_1 = require("../config/config"); | ||
const repo_1 = require("../repo"); | ||
let HiKariAppService = class HiKariAppService { | ||
let HiKariCoreAppService = class HiKariCoreAppService { | ||
constructor(repoServiceOpsManager) { | ||
@@ -30,7 +30,7 @@ this.repoServiceOpsManager = repoServiceOpsManager; | ||
}; | ||
HiKariAppService = __decorate([ | ||
HiKariCoreAppService = __decorate([ | ||
common_1.Injectable(), | ||
__metadata("design:paramtypes", [repo_1.HiKariRepoServiceOpsManager]) | ||
], HiKariAppService); | ||
exports.HiKariAppService = HiKariAppService; | ||
], HiKariCoreAppService); | ||
exports.HiKariCoreAppService = HiKariCoreAppService; | ||
//# sourceMappingURL=app.service.js.map |
import { RepoServiceOpsModule } from "../../proto/rsi"; | ||
import { IPlatformResourceProvider } from "../../proto/platform-resource"; | ||
import { HiKariCoreHostConfig } from "../../proto/config"; | ||
import { DynamicModule } from '@nestjs/common'; | ||
export interface HiKariAppModuleConfig { | ||
repoItemControllers?: any[]; | ||
repoOpsProvidedModules?: any[]; | ||
repoOpsProvidedModules?: DynamicModule[]; | ||
repoOpsModules?: RepoServiceOpsModule[]; | ||
@@ -11,1 +11,5 @@ platformResources?: IPlatformResourceProvider[]; | ||
} | ||
export declare class HiKariCoreDynamicConfigModule { | ||
static forModuleConfig(appModuleConfig?: HiKariAppModuleConfig): DynamicModule; | ||
static forLazyModuleConfig(appModuleConfig?: HiKariAppModuleConfig): DynamicModule; | ||
} |
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var HiKariCoreDynamicConfigModule_1; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HiKariCoreDynamicConfigModule = void 0; | ||
const rsi_1 = require("../../proto/rsi"); | ||
const platform_resource_1 = require("../../proto/platform-resource"); | ||
const config_1 = require("../../proto/config"); | ||
const common_1 = require("@nestjs/common"); | ||
const core_1 = require("./"); | ||
let HiKariCoreDynamicConfigModule = HiKariCoreDynamicConfigModule_1 = class HiKariCoreDynamicConfigModule { | ||
static forModuleConfig(appModuleConfig) { | ||
appModuleConfig = appModuleConfig || {}; | ||
const dynConfigModules = []; | ||
if (appModuleConfig.platformResourcesConfCallback) { | ||
dynConfigModules.push(core_1.HiKariCoreDynamicPRConfigModule.forDynamics(appModuleConfig.platformResourcesConfCallback)); | ||
} | ||
else { | ||
dynConfigModules.push(core_1.HiKariCoreDynamicPRConfigModule.forStatics(appModuleConfig.platformResources || [])); | ||
} | ||
dynConfigModules.push(core_1.HiKariCoreDynamicROConfigModule.forStatics(appModuleConfig.repoOpsModules || [])); | ||
dynConfigModules.push(core_1.HiKariCoreRepoServiceOpsProvidedResolverModule.forStatics(appModuleConfig.repoOpsProvidedModules || [])); | ||
return { | ||
module: HiKariCoreDynamicConfigModule_1, | ||
imports: dynConfigModules, | ||
}; | ||
} | ||
static forLazyModuleConfig(appModuleConfig) { | ||
appModuleConfig = appModuleConfig || {}; | ||
const dynConfigModules = []; | ||
if (appModuleConfig.platformResourcesConfCallback) { | ||
dynConfigModules.push(core_1.HiKariCoreDynamicPRConfigModule.forDynamics(appModuleConfig.platformResourcesConfCallback)); | ||
} | ||
else if (appModuleConfig.platformResources) { | ||
dynConfigModules.push(core_1.HiKariCoreDynamicPRConfigModule.forStatics(appModuleConfig.platformResources)); | ||
} | ||
if (appModuleConfig.repoOpsModules) { | ||
dynConfigModules.push(core_1.HiKariCoreDynamicROConfigModule.forStatics(appModuleConfig.repoOpsModules)); | ||
} | ||
if (appModuleConfig.repoOpsProvidedModules) { | ||
dynConfigModules.push(core_1.HiKariCoreRepoServiceOpsProvidedResolverModule.forStatics(appModuleConfig.repoOpsProvidedModules)); | ||
} | ||
return { | ||
module: HiKariCoreDynamicConfigModule_1, | ||
imports: dynConfigModules, | ||
}; | ||
} | ||
}; | ||
HiKariCoreDynamicConfigModule = HiKariCoreDynamicConfigModule_1 = __decorate([ | ||
common_1.Module({}) | ||
], HiKariCoreDynamicConfigModule); | ||
exports.HiKariCoreDynamicConfigModule = HiKariCoreDynamicConfigModule; | ||
//# sourceMappingURL=config.dynamic.module.js.map |
@@ -1,4 +0,2 @@ | ||
import { DynamicModule } from '@nestjs/common'; | ||
export declare class HiKariCorePlatformResourcesManagerModule { | ||
static fromArray(): DynamicModule; | ||
} |
@@ -8,3 +8,2 @@ "use strict"; | ||
}; | ||
var HiKariCorePlatformResourcesManagerModule_1; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -14,22 +13,18 @@ exports.HiKariCorePlatformResourcesManagerModule = void 0; | ||
const platform_resource_1 = require("../../platform-resource"); | ||
const config_module_1 = require("./config.module"); | ||
let HiKariCorePlatformResourcesManagerModule = HiKariCorePlatformResourcesManagerModule_1 = class HiKariCorePlatformResourcesManagerModule { | ||
static fromArray() { | ||
const managerProvider = { | ||
provide: platform_resource_1.HiKariPlatformResourceManager, | ||
useFactory: platform_resource_1.HiKariPlatformResourceManager.create, | ||
inject: ['hikari.config.platformResources'], | ||
}; | ||
return { | ||
module: HiKariCorePlatformResourcesManagerModule_1, | ||
imports: [config_module_1.HiKariCoreConfigModule], | ||
providers: [managerProvider], | ||
exports: [managerProvider] | ||
}; | ||
} | ||
const core_1 = require("./"); | ||
const managerProvider = { | ||
provide: platform_resource_1.HiKariPlatformResourceManager, | ||
useFactory: platform_resource_1.HiKariPlatformResourceManager.create, | ||
inject: ['hikari.config.platformResources'], | ||
}; | ||
HiKariCorePlatformResourcesManagerModule = HiKariCorePlatformResourcesManagerModule_1 = __decorate([ | ||
common_1.Module({}) | ||
let HiKariCorePlatformResourcesManagerModule = class HiKariCorePlatformResourcesManagerModule { | ||
}; | ||
HiKariCorePlatformResourcesManagerModule = __decorate([ | ||
common_1.Module({ | ||
imports: [core_1.HiKariCoreConfigModule], | ||
providers: [managerProvider], | ||
exports: [managerProvider] | ||
}) | ||
], HiKariCorePlatformResourcesManagerModule); | ||
exports.HiKariCorePlatformResourcesManagerModule = HiKariCorePlatformResourcesManagerModule; | ||
//# sourceMappingURL=manager.platform-resources.module.js.map |
@@ -1,8 +0,2 @@ | ||
import { DynamicModule } from '@nestjs/common'; | ||
import { HiKariRepoServiceOpsManager } from "../../repo/index"; | ||
import { HiKariAppModuleConfig } from "./config.dynamic.module"; | ||
export declare class HiKariCoreRepoServiceOpsManagerModule { | ||
constructor(opsManager: HiKariRepoServiceOpsManager); | ||
static forModuleConfig(appModuleConfig: HiKariAppModuleConfig): DynamicModule; | ||
onModuleInit(): any; | ||
} |
@@ -8,6 +8,2 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var HiKariCoreRepoServiceOpsManagerModule_1; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -17,43 +13,28 @@ exports.HiKariCoreRepoServiceOpsManagerModule = void 0; | ||
const repo_1 = require("../../repo"); | ||
const core_1 = require("@nestjs/core"); | ||
const config_1 = require("../../proto/config"); | ||
const config_module_1 = require("./config.module"); | ||
const config_dynamic_module_1 = require("./config.dynamic.module"); | ||
let HiKariCoreRepoServiceOpsManagerModule = HiKariCoreRepoServiceOpsManagerModule_1 = class HiKariCoreRepoServiceOpsManagerModule { | ||
constructor(opsManager) { | ||
opsManager.registerRepoModules(); | ||
} | ||
static forModuleConfig(appModuleConfig) { | ||
return { | ||
module: HiKariCoreRepoServiceOpsManagerModule_1, | ||
imports: [config_module_1.HiKariCoreConfigModule, ...(appModuleConfig.repoOpsProvidedModules || [])], | ||
providers: [ | ||
{ | ||
provide: repo_1.HiKariRepoServiceOpsManager, | ||
useFactory(hostConfig, moduleRef) { | ||
return new repo_1.HiKariRepoServiceOpsManager(appModuleConfig.repoOpsModules || [], { | ||
hostConfig, | ||
resolve: (token) => { | ||
const got = moduleRef.get(token, { strict: false }); | ||
if (!got) { | ||
throw Object.assign(Object.assign({}, new Error('could not get token')), { token }); | ||
} | ||
return got; | ||
} | ||
}); | ||
}, | ||
inject: ['host-config', core_1.ModuleRef], | ||
const core_1 = require("./"); | ||
const rsi_1 = require("../../proto/rsi"); | ||
let HiKariCoreRepoServiceOpsManagerModule = class HiKariCoreRepoServiceOpsManagerModule { | ||
}; | ||
HiKariCoreRepoServiceOpsManagerModule = __decorate([ | ||
common_1.Module({ | ||
imports: [core_1.HiKariCoreConfigModule], | ||
providers: [ | ||
{ | ||
provide: repo_1.HiKariRepoServiceOpsManager, | ||
useFactory(hostConfig, modules, resolverFunc) { | ||
const manager = new repo_1.HiKariRepoServiceOpsManager(modules, { | ||
hostConfig, | ||
resolve: resolverFunc, | ||
}); | ||
manager.registerRepoModules(); | ||
return manager; | ||
}, | ||
], | ||
exports: [repo_1.HiKariRepoServiceOpsManager] | ||
}; | ||
} | ||
onModuleInit() { | ||
} | ||
}; | ||
HiKariCoreRepoServiceOpsManagerModule = HiKariCoreRepoServiceOpsManagerModule_1 = __decorate([ | ||
common_1.Module({}), | ||
__metadata("design:paramtypes", [repo_1.HiKariRepoServiceOpsManager]) | ||
inject: ['host-config', 'hikari.config.repoServiceOpsModules', 'hikari.config.repoServiceOpsProvidedResolver'], | ||
}, | ||
], | ||
exports: [repo_1.HiKariRepoServiceOpsManager], | ||
}) | ||
], HiKariCoreRepoServiceOpsManagerModule); | ||
exports.HiKariCoreRepoServiceOpsManagerModule = HiKariCoreRepoServiceOpsManagerModule; | ||
//# sourceMappingURL=manager.repo-service-ops.module.js.map |
import { HiKariDeleteRepoRequest, HiKariGetRepoRequest, HiKariGetRepoResponse, HiKariPostRepoRequest, HiKariPostRepoResponse } from "./dto/repoDto"; | ||
import { HiKariRepoService } from "./repo.service"; | ||
import { HiKariCoreRepoService } from "./repo.service"; | ||
import { HiKariRepoKeyDto } from "./dto/repoKeyDto"; | ||
@@ -10,5 +10,5 @@ import { HiKariRepoEntity } from "../../database/entity/repo.entity"; | ||
import { HiKariRepoServiceOpsManager } from "../../repo/index"; | ||
export declare class HiKariRepoControllerBase { | ||
protected readonly repoService: HiKariRepoService; | ||
constructor(repoService: HiKariRepoService); | ||
export declare class HiKariCoreRepoControllerBase { | ||
protected readonly repoService: HiKariCoreRepoService; | ||
constructor(repoService: HiKariCoreRepoService); | ||
tryGetRepoEntityByKey(key: HiKariRepoKeyDto): Promise<HiKariRepoEntity>; | ||
@@ -18,5 +18,5 @@ getRepoEntityByKey(key: HiKariRepoKeyDto): Promise<HiKariRepoEntity>; | ||
} | ||
export declare class HiKariRepoController extends HiKariRepoControllerBase { | ||
export declare class HiKariCoreRepoController extends HiKariCoreRepoControllerBase { | ||
private repoOpsManager; | ||
constructor(repoService: HiKariRepoService, repoOpsManager: HiKariRepoServiceOpsManager); | ||
constructor(repoService: HiKariCoreRepoService, repoOpsManager: HiKariRepoServiceOpsManager); | ||
getRepo(req: HiKariGetRepoRequest): Promise<HiKariGenericResponse<HiKariGetRepoResponse>>; | ||
@@ -23,0 +23,0 @@ getRepoDocs(params: HiKariRepoKeyDto & { |
@@ -1,12 +0,10 @@ | ||
import { HiKariRepoControllerBase } from "./repo.controller"; | ||
import { HiKariRepoService } from "./repo.service"; | ||
import { HiKariCoreRepoControllerBase } from "./repo.controller"; | ||
import { HiKariCoreRepoService } from "./repo.service"; | ||
import { HiKariRepoOpsCannotSearchError } from "../../proto/exception/index"; | ||
import { HiKariGenericResponse } from "../../proto/generic.error"; | ||
import { HiKariGetRepoItemsRequest, HiKariGetRepoItemsResponse, HiKariPostRepoItemsRequest } from "./dto/repoItemDto"; | ||
export declare class HiKariRepoItemController extends HiKariRepoControllerBase { | ||
constructor(repoService: HiKariRepoService); | ||
export declare class HiKariCoreRepoItemController extends HiKariCoreRepoControllerBase { | ||
constructor(repoService: HiKariCoreRepoService); | ||
getItems(req: HiKariGetRepoItemsRequest): Promise<HiKariGenericResponse<HiKariGetRepoItemsResponse, HiKariRepoOpsCannotSearchError>>; | ||
postItems(req: HiKariPostRepoItemsRequest): Promise<HiKariGenericResponse<any>>; | ||
putItems(): void; | ||
deleteItems(): void; | ||
} |
@@ -24,3 +24,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HiKariRepoItemController = void 0; | ||
exports.HiKariCoreRepoItemController = void 0; | ||
const common_1 = require("@nestjs/common"); | ||
@@ -32,3 +32,4 @@ const repo_controller_1 = require("./repo.controller"); | ||
const repoItemDto_1 = require("./dto/repoItemDto"); | ||
let HiKariRepoItemController = class HiKariRepoItemController extends repo_controller_1.HiKariRepoControllerBase { | ||
const rsi_1 = require("../../proto/rsi"); | ||
let HiKariCoreRepoItemController = class HiKariCoreRepoItemController extends repo_controller_1.HiKariCoreRepoControllerBase { | ||
constructor(repoService) { | ||
@@ -51,3 +52,3 @@ super(repoService); | ||
page_size: req.page_size, | ||
get: k => req[k] | ||
[rsi_1.repoClientItemsOptsRaw]: req, | ||
}, undefined).then((res) => { | ||
@@ -73,6 +74,2 @@ return client.disposeAsync().then(() => res); | ||
} | ||
putItems() { | ||
} | ||
deleteItems() { | ||
} | ||
}; | ||
@@ -85,3 +82,3 @@ __decorate([ | ||
__metadata("design:returntype", Promise) | ||
], HiKariRepoItemController.prototype, "getItems", null); | ||
], HiKariCoreRepoItemController.prototype, "getItems", null); | ||
__decorate([ | ||
@@ -94,20 +91,8 @@ common_1.HttpCode(200), | ||
__metadata("design:returntype", Promise) | ||
], HiKariRepoItemController.prototype, "postItems", null); | ||
__decorate([ | ||
common_1.Put(), | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", []), | ||
__metadata("design:returntype", void 0) | ||
], HiKariRepoItemController.prototype, "putItems", null); | ||
__decorate([ | ||
common_1.Delete(), | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", []), | ||
__metadata("design:returntype", void 0) | ||
], HiKariRepoItemController.prototype, "deleteItems", null); | ||
HiKariRepoItemController = __decorate([ | ||
], HiKariCoreRepoItemController.prototype, "postItems", null); | ||
HiKariCoreRepoItemController = __decorate([ | ||
common_1.Controller('repo/items'), | ||
__metadata("design:paramtypes", [repo_service_1.HiKariRepoService]) | ||
], HiKariRepoItemController); | ||
exports.HiKariRepoItemController = HiKariRepoItemController; | ||
__metadata("design:paramtypes", [repo_service_1.HiKariCoreRepoService]) | ||
], HiKariCoreRepoItemController); | ||
exports.HiKariCoreRepoItemController = HiKariCoreRepoItemController; | ||
//# sourceMappingURL=repo.controller.item.js.map |
@@ -24,3 +24,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HiKariRepoController = exports.HiKariRepoControllerBase = void 0; | ||
exports.HiKariCoreRepoController = exports.HiKariCoreRepoControllerBase = void 0; | ||
const common_1 = require("@nestjs/common"); | ||
@@ -36,3 +36,3 @@ const repoDto_1 = require("./dto/repoDto"); | ||
const repo_1 = require("../../repo"); | ||
class HiKariRepoControllerBase { | ||
class HiKariCoreRepoControllerBase { | ||
constructor(repoService) { | ||
@@ -75,4 +75,4 @@ this.repoService = repoService; | ||
} | ||
exports.HiKariRepoControllerBase = HiKariRepoControllerBase; | ||
let HiKariRepoController = class HiKariRepoController extends HiKariRepoControllerBase { | ||
exports.HiKariCoreRepoControllerBase = HiKariCoreRepoControllerBase; | ||
let HiKariCoreRepoController = class HiKariCoreRepoController extends HiKariCoreRepoControllerBase { | ||
constructor(repoService, repoOpsManager) { | ||
@@ -150,3 +150,3 @@ super(repoService); | ||
__metadata("design:returntype", Promise) | ||
], HiKariRepoController.prototype, "getRepo", null); | ||
], HiKariCoreRepoController.prototype, "getRepo", null); | ||
__decorate([ | ||
@@ -158,3 +158,3 @@ common_1.Get('repo/docs'), | ||
__metadata("design:returntype", Promise) | ||
], HiKariRepoController.prototype, "getRepoDocs", null); | ||
], HiKariCoreRepoController.prototype, "getRepoDocs", null); | ||
__decorate([ | ||
@@ -166,3 +166,3 @@ common_1.Get('list'), | ||
__metadata("design:returntype", Promise) | ||
], HiKariRepoController.prototype, "getRepoList", null); | ||
], HiKariCoreRepoController.prototype, "getRepoList", null); | ||
__decorate([ | ||
@@ -175,3 +175,3 @@ common_1.HttpCode(200), | ||
__metadata("design:returntype", Promise) | ||
], HiKariRepoController.prototype, "postRepo", null); | ||
], HiKariCoreRepoController.prototype, "postRepo", null); | ||
__decorate([ | ||
@@ -184,3 +184,3 @@ common_1.HttpCode(200), | ||
__metadata("design:returntype", Promise) | ||
], HiKariRepoController.prototype, "postRepoControlCommand", null); | ||
], HiKariCoreRepoController.prototype, "postRepoControlCommand", null); | ||
__decorate([ | ||
@@ -192,8 +192,8 @@ common_1.Delete(), | ||
__metadata("design:returntype", Promise) | ||
], HiKariRepoController.prototype, "deleteRepo", null); | ||
HiKariRepoController = __decorate([ | ||
], HiKariCoreRepoController.prototype, "deleteRepo", null); | ||
HiKariCoreRepoController = __decorate([ | ||
common_1.Controller('repo'), | ||
__metadata("design:paramtypes", [repo_service_1.HiKariRepoService, repo_1.HiKariRepoServiceOpsManager]) | ||
], HiKariRepoController); | ||
exports.HiKariRepoController = HiKariRepoController; | ||
__metadata("design:paramtypes", [repo_service_1.HiKariCoreRepoService, repo_1.HiKariRepoServiceOpsManager]) | ||
], HiKariCoreRepoController); | ||
exports.HiKariCoreRepoController = HiKariCoreRepoController; | ||
//# sourceMappingURL=repo.controller.js.map |
@@ -1,5 +0,2 @@ | ||
import { DynamicModule } from '@nestjs/common'; | ||
import { HiKariAppModuleConfig } from "../core/config.dynamic.module"; | ||
export declare class HiKariRepoModule { | ||
static forModuleConfig(appModuleConfig: HiKariAppModuleConfig): DynamicModule; | ||
export declare class HiKariCoreRepoModule { | ||
} |
@@ -8,5 +8,4 @@ "use strict"; | ||
}; | ||
var HiKariRepoModule_1; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HiKariRepoModule = void 0; | ||
exports.HiKariCoreRepoModule = void 0; | ||
const common_1 = require("@nestjs/common"); | ||
@@ -18,29 +17,21 @@ const repo_controller_1 = require("./repo.controller"); | ||
const repo_controller_item_1 = require("./repo.controller.item"); | ||
const manager_repo_service_ops_module_1 = require("../core/manager.repo-service-ops.module"); | ||
const manager_platform_resources_module_1 = require("../core/manager.platform-resources.module"); | ||
const config_module_1 = require("../core/config.module"); | ||
const config_dynamic_module_1 = require("../core/config.dynamic.module"); | ||
let HiKariRepoModule = HiKariRepoModule_1 = class HiKariRepoModule { | ||
static forModuleConfig(appModuleConfig) { | ||
return { | ||
module: HiKariRepoModule_1, | ||
imports: [ | ||
typeorm_1.TypeOrmModule.forFeature([repo_entity_1.HiKariRepoEntity]), | ||
config_module_1.HiKariCoreConfigModule, | ||
manager_platform_resources_module_1.HiKariCorePlatformResourcesManagerModule.fromArray(), | ||
manager_repo_service_ops_module_1.HiKariCoreRepoServiceOpsManagerModule.forModuleConfig(appModuleConfig) | ||
], | ||
controllers: [ | ||
repo_controller_1.HiKariRepoController, | ||
repo_controller_item_1.HiKariRepoItemController, | ||
...(appModuleConfig.repoItemControllers || []), | ||
], | ||
providers: [repo_service_1.HiKariRepoService] | ||
}; | ||
} | ||
const core_1 = require("../core"); | ||
let HiKariCoreRepoModule = class HiKariCoreRepoModule { | ||
}; | ||
HiKariRepoModule = HiKariRepoModule_1 = __decorate([ | ||
common_1.Module({}) | ||
], HiKariRepoModule); | ||
exports.HiKariRepoModule = HiKariRepoModule; | ||
HiKariCoreRepoModule = __decorate([ | ||
common_1.Module({ | ||
imports: [ | ||
typeorm_1.TypeOrmModule.forFeature([repo_entity_1.HiKariRepoEntity]), | ||
core_1.HiKariCoreConfigModule, | ||
core_1.HiKariCorePlatformResourcesManagerModule, | ||
core_1.HiKariCoreRepoServiceOpsManagerModule | ||
], | ||
controllers: [ | ||
repo_controller_1.HiKariCoreRepoController, | ||
repo_controller_item_1.HiKariCoreRepoItemController, | ||
], | ||
providers: [repo_service_1.HiKariCoreRepoService], | ||
}) | ||
], HiKariCoreRepoModule); | ||
exports.HiKariCoreRepoModule = HiKariCoreRepoModule; | ||
//# sourceMappingURL=repo.module.js.map |
@@ -18,3 +18,3 @@ import { HiKariRepoEntity } from "../../database/entity/repo.entity"; | ||
export declare type RepoPSIKey = Pick<HiKariRepoEntity, 'protocol' | 'scope' | 'scopeId'>; | ||
export declare class HiKariRepoService extends GenericRepositoryService<HiKariRepoEntity> { | ||
export declare class HiKariCoreRepoService extends GenericRepositoryService<HiKariRepoEntity> { | ||
private readonly repoServiceOpsManager; | ||
@@ -21,0 +21,0 @@ private readonly platformResourceManager; |
@@ -24,3 +24,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HiKariRepoService = void 0; | ||
exports.HiKariCoreRepoService = void 0; | ||
const common_1 = require("@nestjs/common"); | ||
@@ -52,3 +52,3 @@ const typeorm_1 = require("@nestjs/typeorm"); | ||
} | ||
let HiKariRepoService = class HiKariRepoService extends GenericRepositoryService { | ||
let HiKariCoreRepoService = class HiKariCoreRepoService extends GenericRepositoryService { | ||
constructor(repoServiceOpsManager, platformResourceManager, repoRepository, config) { | ||
@@ -123,3 +123,3 @@ super(repoRepository); | ||
}; | ||
HiKariRepoService = __decorate([ | ||
HiKariCoreRepoService = __decorate([ | ||
common_1.Injectable(), | ||
@@ -131,4 +131,4 @@ __param(2, typeorm_1.InjectRepository(repo_entity_1.HiKariRepoEntity)), | ||
typeorm_2.Repository, Object]) | ||
], HiKariRepoService); | ||
exports.HiKariRepoService = HiKariRepoService; | ||
], HiKariCoreRepoService); | ||
exports.HiKariCoreRepoService = HiKariCoreRepoService; | ||
//# sourceMappingURL=repo.service.js.map |
@@ -1,4 +0,4 @@ | ||
import { HttpException, ValidationPipe } from "@nestjs/common"; | ||
import { HttpException, ValidationError, ValidationPipe } from '@nestjs/common'; | ||
export declare class HiKariValidationPipe extends ValidationPipe { | ||
createExceptionFactory(): (validationErrors?: any[]) => HttpException; | ||
createExceptionFactory(): (validationErrors?: ValidationError[]) => HttpException; | ||
} |
@@ -25,4 +25,4 @@ "use strict"; | ||
const index_1 = require("../index"); | ||
const typeorm_2 = require("@nestjs/typeorm"); | ||
const common_1 = require("@nestjs/common"); | ||
const core_2 = require("../app/core"); | ||
function getConfiguration() { | ||
@@ -59,3 +59,3 @@ let port = process.env['HIKARI_BACKEND_PORT']; | ||
imports: [ | ||
typeorm_2.TypeOrmModule.forRoot(), | ||
core_2.HiKariCoreTypeormRootModuleHelper.forRoot(), | ||
index_1.HiKariCoreAppModule.forRoot({}) | ||
@@ -62,0 +62,0 @@ ] |
@@ -1,1 +0,1 @@ | ||
export declare const hiKariAppVersion = "0.4.9"; | ||
export declare const hiKariAppVersion = "0.5.1"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hiKariAppVersion = void 0; | ||
exports.hiKariAppVersion = '0.4.9'; | ||
exports.hiKariAppVersion = '0.5.1'; | ||
//# sourceMappingURL=config.js.map |
export { HiKariCoreAppModule } from "./app/app.module"; | ||
export { HiKariRepoModule } from "./app/repo/repo.module"; | ||
export * as hikariCoreModules from "./app/core/index"; | ||
export { HiKariCoreRepoModule } from "./app/repo/repo.module"; | ||
export { HiKariPlatformResourceManager } from "./platform-resource/index"; | ||
@@ -4,0 +5,0 @@ export { HiKariRepoServiceOpsManager } from "./repo/index"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hikariTransformationFactory = exports.HiKariRepoEntity = exports.HiKariGenericErrorFilter = exports.HiKariValidationPipe = exports.RepoServiceOpsDocMixinBase = exports.HiKariRepoServiceOpsManager = exports.HiKariPlatformResourceManager = exports.HiKariRepoModule = exports.HiKariCoreAppModule = void 0; | ||
exports.hikariTransformationFactory = exports.HiKariRepoEntity = exports.HiKariGenericErrorFilter = exports.HiKariValidationPipe = exports.RepoServiceOpsDocMixinBase = exports.HiKariRepoServiceOpsManager = exports.HiKariPlatformResourceManager = exports.HiKariCoreRepoModule = exports.hikariCoreModules = exports.HiKariCoreAppModule = void 0; | ||
var app_module_1 = require("./app/app.module"); | ||
Object.defineProperty(exports, "HiKariCoreAppModule", { enumerable: true, get: function () { return app_module_1.HiKariCoreAppModule; } }); | ||
exports.hikariCoreModules = require("./app/core"); | ||
var repo_module_1 = require("./app/repo/repo.module"); | ||
Object.defineProperty(exports, "HiKariRepoModule", { enumerable: true, get: function () { return repo_module_1.HiKariRepoModule; } }); | ||
Object.defineProperty(exports, "HiKariCoreRepoModule", { enumerable: true, get: function () { return repo_module_1.HiKariCoreRepoModule; } }); | ||
var platform_resource_1 = require("./platform-resource"); | ||
@@ -9,0 +10,0 @@ Object.defineProperty(exports, "HiKariPlatformResourceManager", { enumerable: true, get: function () { return platform_resource_1.HiKariPlatformResourceManager; } }); |
{ | ||
"name": "@hikarix/core", | ||
"version": "0.4.9", | ||
"version": "0.5.1", | ||
"description": "Core of Modularized information aggregation service framework HiKari", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/Myriad-Dreamin/hikari-core", |
@@ -10,2 +10,1 @@ import { RepoServiceOps, RepoServiceOpsFactory } from "./rsi"; | ||
} | ||
export declare const metaManager: HiKariTypeMetaManager; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.metaManager = exports.HiKariTypeMetaManager = void 0; | ||
exports.HiKariTypeMetaManager = void 0; | ||
class HiKariTypeMetaManager { | ||
@@ -29,3 +29,2 @@ constructor() { | ||
exports.HiKariTypeMetaManager = HiKariTypeMetaManager; | ||
exports.metaManager = new HiKariTypeMetaManager(); | ||
//# sourceMappingURL=meta.js.map |
@@ -11,6 +11,6 @@ import { EnumRepoEntitiesKey, EnumRepoEntitiesMeta } from "./repo-item"; | ||
} | ||
interface Closer { | ||
export interface Closer { | ||
close(promiseReporter: (err: Error) => never): void; | ||
} | ||
interface IHiKariRepoWorkContext<Env, K extends EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta> { | ||
export interface IHiKariRepoWorkContext<Env extends Record<string, any>, K extends EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta> { | ||
env: Env; | ||
@@ -30,3 +30,3 @@ sourceManager: IHiKariSourceManager<K, M>; | ||
} | ||
export declare type IHiKariSearchContext<Env = ObjectDict<any>, K extends EnumRepoEntitiesKey = EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta = EnumRepoEntitiesMeta> = IHiKariRepoWorkContext<Env, K, M>; | ||
export declare type IHiKariSearchContext<Env extends ObjectDict<any> = ObjectDict<any>, K extends EnumRepoEntitiesKey = EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta = EnumRepoEntitiesMeta> = IHiKariRepoWorkContext<Env, K, M>; | ||
export interface RepoClientSearchItemsOpts<T = any> extends RepoClientItemsOpts<T> { | ||
@@ -41,3 +41,2 @@ query: string; | ||
page_size?: number; | ||
get(key: string): any | undefined; | ||
} | ||
@@ -56,3 +55,3 @@ export interface IHiKariRepositorySearchResult<T> { | ||
} | ||
export declare type IHiKariImportItemsContext<Env = ObjectDict<any>, K extends EnumRepoEntitiesKey = EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta = EnumRepoEntitiesMeta> = IHiKariRepoWorkContext<Env, K, M>; | ||
export declare type IHiKariImportItemsContext<Env extends ObjectDict<any> = ObjectDict<any>, K extends EnumRepoEntitiesKey = EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta = EnumRepoEntitiesMeta> = IHiKariRepoWorkContext<Env, K, M>; | ||
export interface IHiKariRepositoryImportResult<T> { | ||
@@ -65,3 +64,3 @@ imported: [T, T][]; | ||
} | ||
export declare type IHiKariReadItemsContext<Env = ObjectDict<any>, K extends EnumRepoEntitiesKey = EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta = EnumRepoEntitiesMeta> = IHiKariRepoWorkContext<Env, K, M>; | ||
export declare type IHiKariReadItemsContext<Env extends ObjectDict<any> = ObjectDict<any>, K extends EnumRepoEntitiesKey = EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta = EnumRepoEntitiesMeta> = IHiKariRepoWorkContext<Env, K, M>; | ||
export interface RepoClientReadItemsOpts<T = any> extends RepoClientSearchItemsOpts<T> { | ||
@@ -74,3 +73,41 @@ singleStreamOnly?: boolean; | ||
} | ||
export declare type IHiKariWriteItemsContext<Env = ObjectDict<any>, K extends EnumRepoEntitiesKey = EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta = EnumRepoEntitiesMeta> = IHiKariRepoWorkContext<Env, K, M>; | ||
export declare type IHiKariWriteItemsContext<Env extends ObjectDict<any> = ObjectDict<any>, K extends EnumRepoEntitiesKey = EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta = EnumRepoEntitiesMeta> = IHiKariRepoWorkContext<Env, K, M>; | ||
export interface IHiKariRepositoryStatusClient { | ||
getStatus(opts: RepoClientGetStatusOpts, context: IHiKariGetStatusContext): Promise<IHiKariRepositoryStatus>; | ||
getLevelConfig(opts: RepoClientGetLevelConfigOpts, context: IHiKariGetLevelConfigContext): Promise<IHiKariLevelConfig>; | ||
setLevelConfig(opts: RepoClientSetLevelConfigOpts, context: IHiKariSetLevelConfigContext): Promise<void>; | ||
} | ||
export declare type IHiKariGetStatusContext<Env extends ObjectDict<any> = ObjectDict<any>, K extends EnumRepoEntitiesKey = EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta = EnumRepoEntitiesMeta> = IHiKariRepoWorkContext<Env, K, M>; | ||
export declare type IHiKariGetLevelConfigContext<Env extends ObjectDict<any> = ObjectDict<any>, K extends EnumRepoEntitiesKey = EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta = EnumRepoEntitiesMeta> = IHiKariRepoWorkContext<Env, K, M>; | ||
export declare type IHiKariSetLevelConfigContext<Env extends ObjectDict<any> = ObjectDict<any>, K extends EnumRepoEntitiesKey = EnumRepoEntitiesKey, M extends EnumRepoEntitiesMeta = EnumRepoEntitiesMeta> = IHiKariRepoWorkContext<Env, K, M>; | ||
export interface IHiKariRepositoryStatus { | ||
responses: any[]; | ||
} | ||
export interface IHiKariStatusRequest { | ||
preset: string; | ||
part?: string; | ||
size?: number; | ||
offset?: number; | ||
} | ||
export interface IHiKariStatusPreset extends IHiKariStatusRequest { | ||
affectLevel?: number; | ||
} | ||
export interface RepoClientGetStatusOpts { | ||
level: number; | ||
sizeControl?: number; | ||
returnAttachment?: boolean; | ||
ignorePresets?: boolean; | ||
ignoreSizeInRequests?: boolean; | ||
requests?: IHiKariStatusRequest[]; | ||
} | ||
export interface RepoClientGetLevelConfigOpts { | ||
level: number; | ||
} | ||
export interface IHiKariLevelConfig { | ||
presets: IHiKariStatusPreset[]; | ||
} | ||
export interface RepoClientSetLevelConfigOpts { | ||
conf: IHiKariLevelConfig; | ||
level: number; | ||
} | ||
export interface IHiKariRepositoryClient<T> { | ||
@@ -82,2 +119,3 @@ controlClient?: IHiKariRepositoryControlClient; | ||
writeClient?: IHiKariRepositoryWriteClient<T>; | ||
statusClient?: IHiKariRepositoryStatusClient; | ||
} | ||
@@ -162,2 +200,1 @@ export interface RepoServiceOpsDoc { | ||
} | ||
export {}; |
@@ -0,1 +1,2 @@ | ||
import { HiKariTypeMetaManager } from "../proto/meta"; | ||
import { RepoServiceOps, RepoServiceOpsFacContext, RepoServiceOpsModule } from "../proto/rsi"; | ||
@@ -11,2 +12,3 @@ import { EnumRepoEntitiesKey } from "../proto/repo-item"; | ||
initialized: boolean; | ||
metaManager: HiKariTypeMetaManager; | ||
private memoryKeyIndex; | ||
@@ -13,0 +15,0 @@ private memoryFacKeyIndex; |
@@ -53,3 +53,4 @@ "use strict"; | ||
this.initialized = true; | ||
this.intrinsicRepoModules.forEach(m => m.register(meta_1.metaManager)); | ||
this.metaManager = new meta_1.HiKariTypeMetaManager(); | ||
this.intrinsicRepoModules.forEach(m => m.register(this.metaManager)); | ||
this.init(); | ||
@@ -116,6 +117,6 @@ } | ||
init() { | ||
meta_1.metaManager.protocolInstances.forEach(this.initOps, this); | ||
meta_1.metaManager.protocolInstances.forEach(this.insertOpsInstance, this); | ||
meta_1.metaManager.protocolFactories.forEach(this.initOps, this); | ||
meta_1.metaManager.protocolFactories.forEach(this.insertOpsFactory, this); | ||
this.metaManager.protocolInstances.forEach(this.initOps, this); | ||
this.metaManager.protocolInstances.forEach(this.insertOpsInstance, this); | ||
this.metaManager.protocolFactories.forEach(this.initOps, this); | ||
this.metaManager.protocolFactories.forEach(this.insertOpsFactory, this); | ||
} | ||
@@ -122,0 +123,0 @@ insertOpsInstance(ops) { |
206521
191
4213