Socket
Socket
Sign inDemoInstall

@hikarix/core

Package Overview
Dependencies
470
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.6 to 0.4.7-2

proto/generic.disposable.d.ts

2

app/app.controller.d.ts
import { HiKariAppService, HiKariAppServicePingResult, HiKariAppServiceStatus } from "./app.service";
import { HiKariGenericResponse } from "../proto/generic";
import { HiKariGenericResponse } from "../proto/generic.error";
import { HiKariRepoServiceOpsManager, RepoServiceOpsInfo } from "../repo/index";

@@ -4,0 +4,0 @@ import { HiKariPlatformResourceManager, PlatformResourceInfo } from "../platform-resource/index";

@@ -24,3 +24,3 @@ "use strict";

const app_service_1 = require("./app.service");
const generic_1 = require("../proto/generic");
const generic_error_1 = require("../proto/generic.error");
const repo_1 = require("../repo");

@@ -27,0 +27,0 @@ const platform_resource_1 = require("../platform-resource");

@@ -14,6 +14,6 @@ "use strict";

const repoKeyDto_1 = require("./repoKeyDto");
const generic_1 = require("../../../proto/generic");
const class_transformer_1 = require("class-transformer");
const class_validator_1 = require("class-validator");
const _hikari_class_validator_1 = require("../../shared/hikari-class-validator");
const generic_1 = require("../../../proto/generic");
class HiKariGetRepoItemsRequest extends repoKeyDto_1.HiKariRepoKeyDto {

@@ -20,0 +20,0 @@ constructor() {

@@ -5,5 +5,6 @@ import { HiKariDeleteRepoRequest, HiKariGetRepoRequest, HiKariGetRepoResponse, HiKariPostRepoRequest, HiKariPostRepoResponse } from "./dto/repoDto";

import { HiKariRepoEntity } from "../../database/entity/repo.entity";
import { HiKariGenericResponse } from "../../proto/generic";
import { HiKariGenericResponse } from "../../proto/generic.error";
import { IHiKariRepositoryClient } from "../../proto/rsi";
import { HiKariPostRepoControlCommandRequest } from "./dto/repoItemDto";
import { IDisposableAsync } from "../../proto/generic.disposable";
export declare class HiKariRepoControllerBase {

@@ -14,3 +15,3 @@ protected readonly repoService: HiKariRepoService;

getRepoByKey(key: HiKariRepoKeyDto): Promise<HiKariRepoEntity>;
getRepoOpsByKey(key: HiKariRepoKeyDto): Promise<IHiKariRepositoryClient<any>>;
getRepoOpsByKey(key: HiKariRepoKeyDto): Promise<IDisposableAsync<IHiKariRepositoryClient<any>>>;
}

@@ -17,0 +18,0 @@ export declare class HiKariRepoController extends HiKariRepoControllerBase {

import { HiKariRepoControllerBase } from "./repo.controller";
import { HiKariRepoService } from "./repo.service";
import { HiKariRepoOpsCannotSearchError } from "../../proto/exception/index";
import { HiKariGenericResponse } from "../../proto/generic";
import { HiKariGenericResponse } from "../../proto/generic.error";
import { HiKariGetRepoItemsRequest, HiKariGetRepoItemsResponse, HiKariPostRepoItemsRequest } from "./dto/repoItemDto";

@@ -6,0 +6,0 @@ export declare class HiKariRepoItemController extends HiKariRepoControllerBase {

@@ -29,3 +29,3 @@ "use strict";

const exception_1 = require("../../proto/exception");
const generic_1 = require("../../proto/generic");
const generic_error_1 = require("../../proto/generic.error");
const repoItemDto_1 = require("./dto/repoItemDto");

@@ -51,3 +51,5 @@ let HiKariRepoItemController = class HiKariRepoItemController extends repo_controller_1.HiKariRepoControllerBase {

get: k => req[k]
}, undefined)
}, undefined).then((res) => {
return client.disposeAsync().then(() => res);
}),
};

@@ -62,3 +64,8 @@ });

}
return { code: 0, data: yield client.importClient.import(req.items, req.params, undefined) };
return {
code: 0,
data: yield client.importClient.import(req.items, req.params, undefined).then((res) => {
return client.disposeAsync().then(() => res);
}),
};
});

@@ -65,0 +72,0 @@ }

@@ -30,5 +30,6 @@ "use strict";

const repo_entity_1 = require("../../database/entity/repo.entity");
const generic_1 = require("../../proto/generic");
const generic_error_1 = require("../../proto/generic.error");
const rsi_1 = require("../../proto/rsi");
const repoItemDto_1 = require("./dto/repoItemDto");
const generic_disposable_1 = require("../../proto/generic.disposable");
class HiKariRepoControllerBase {

@@ -108,3 +109,8 @@ constructor(repoService) {

}
return { code: 0, data: yield client.controlClient.control(req.command, req.args) };
return {
code: 0,
data: yield client.controlClient.control(req.command, req.args).then((res) => {
return client.disposeAsync().then(() => res);
})
};
});

@@ -111,0 +117,0 @@ }

@@ -8,2 +8,3 @@ import { HiKariRepoEntity } from "../../database/entity/repo.entity";

import { HiKariPlatformResourceManager } from "../../platform-resource/index";
import { IDisposableAsync } from "../../proto/generic.disposable";
declare class GenericRepositoryService<T> {

@@ -24,3 +25,3 @@ private repository;

constructor(repoServiceOpsManager: HiKariRepoServiceOpsManager, platformResourceManager: HiKariPlatformResourceManager, repoRepository: Repository<HiKariRepoEntity>, config: HiKariCoreHostConfig);
resolveRepoServiceOpsByKey<T extends EnumRepoEntitiesKey>(entity: T, key: string, scope: string, scopeId: string): Promise<IHiKariRepositoryClient<EnumRepoEntitiesMeta[T]>>;
resolveRepoServiceOpsByKey<T extends EnumRepoEntitiesKey>(entity: T, key: string, scope: string, scopeId: string): Promise<IDisposableAsync<IHiKariRepositoryClient<EnumRepoEntitiesMeta[T]>>>;
computeHashId(repo: DeepPartial<HiKariRepoEntity>): void;

@@ -27,0 +28,0 @@ findRepoByName(repoName: string): Promise<HiKariRepoEntity>;

@@ -36,2 +36,3 @@ "use strict";

const platform_resource_1 = require("../../platform-resource");
const generic_disposable_1 = require("../../proto/generic.disposable");
class GenericRepositoryService {

@@ -60,10 +61,14 @@ constructor(repository) {

resolveRepoServiceOpsByKey(entity, key, scope, scopeId) {
const ops = this.repoServiceOpsManager.getOpsByKey(key);
if (ops === undefined) {
throw new exception_1.HiKariRepoOpsNotFoundError();
}
if (entity !== 'unknownEntity' && !this.repoServiceOpsManager.opsSupportsEntity(ops, entity)) {
throw new exception_1.HiKariRepoOpsNotSupportEntityError(entity);
}
return ops.createClient(scope, scopeId, this.config, this.platformResourceManager);
return __awaiter(this, void 0, void 0, function* () {
const ops = this.repoServiceOpsManager.getOpsByKey(key);
if (ops === undefined) {
throw new exception_1.HiKariRepoOpsNotFoundError();
}
if (entity !== 'unknownEntity' && !this.repoServiceOpsManager.opsSupportsEntity(ops, entity)) {
throw new exception_1.HiKariRepoOpsNotSupportEntityError(entity);
}
return generic_disposable_1.mixinDisposableFuncAsync(yield ops.createClient(scope, scopeId, this.config, this.platformResourceManager), (obj) => __awaiter(this, void 0, void 0, function* () {
yield ops.returnClient(obj);
}));
});
}

@@ -117,3 +122,3 @@ computeHashId(repo) {

__param(2, typeorm_1.InjectRepository(repo_entity_1.HiKariRepoEntity)),
__param(3, common_1.Inject("host-config")),
__param(3, common_1.Inject('host-config')),
__metadata("design:paramtypes", [repo_2.HiKariRepoServiceOpsManager,

@@ -120,0 +125,0 @@ platform_resource_1.HiKariPlatformResourceManager,

@@ -1,2 +0,2 @@

import { HiKariGenericError } from "../../../proto/generic";
import { HiKariGenericError } from "../../../proto/generic.error";
import { ArgumentsHost, ExceptionFilter } from '@nestjs/common';

@@ -3,0 +3,0 @@ export declare class HiKariGenericErrorFilter implements ExceptionFilter {

@@ -10,3 +10,3 @@ "use strict";

exports.HiKariGenericErrorFilter = void 0;
const generic_1 = require("../../../proto/generic");
const generic_error_1 = require("../../../proto/generic.error");
const common_1 = require("@nestjs/common");

@@ -13,0 +13,0 @@ const exception_1 = require("../../../proto/exception");

@@ -1,1 +0,1 @@

export declare const hiKariAppVersion = "0.4.6";
export declare const hiKariAppVersion = "0.4.7";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hiKariAppVersion = void 0;
exports.hiKariAppVersion = '0.4.6';
exports.hiKariAppVersion = '0.4.7';
//# sourceMappingURL=config.js.map
{
"name": "@hikarix/core",
"version": "0.4.6",
"description": "hikari-core is the backend of HiKari",
"version": "0.4.7-2",
"description": "Core of Modularized information aggregation service framework HiKari",
"repository": "https://github.com/Myriad-Dreamin/hikari-core",

@@ -12,4 +12,3 @@ "author": "Myriad-Dreamin <camiyoru@gmail.com>",

"prebuild": "rimraf dist",
"build": "nest build",
"do-prepublish": "node scripts/prepublish.js",
"build": "nest build && node scripts/prepublish.js",
"do-publish": "node scripts/prepublish.js && npm publish --access public dist",

@@ -119,2 +118,2 @@ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",

}
}
}

@@ -1,2 +0,2 @@

import { HiKariGenericError } from "../generic";
import { HiKariGenericError } from "../generic.error";
export declare const HiKariErrnoRange: {

@@ -3,0 +3,0 @@ readonly General: 0;

@@ -5,3 +5,3 @@ "use strict";

const semantic_1 = require("../../lib/semantic");
const generic_1 = require("../generic");
const generic_error_1 = require("../generic.error");
exports.HiKariErrnoRange = {

@@ -47,3 +47,3 @@ General: semantic_1.objectLit(0x000000),

exports.HikariStorageNotFoundError = HikariStorageNotFoundError;
class HiKariRepoRepoKeyInvalidError extends generic_1.HiKariGenericError {
class HiKariRepoRepoKeyInvalidError extends generic_error_1.HiKariGenericError {
constructor() {

@@ -54,3 +54,3 @@ super('repo key invalid', exports.HiKariErrno.RepoEntityRepoKeyInvalid, undefined);

exports.HiKariRepoRepoKeyInvalidError = HiKariRepoRepoKeyInvalidError;
class HiKariRepoEntityNotFoundError extends generic_1.HiKariGenericError {
class HiKariRepoEntityNotFoundError extends generic_error_1.HiKariGenericError {
constructor() {

@@ -61,3 +61,3 @@ super('repo entity not found', exports.HiKariErrno.RepoEntityNotFound, undefined);

exports.HiKariRepoEntityNotFoundError = HiKariRepoEntityNotFoundError;
class HiKariRepoOpsCannotSearchError extends generic_1.HiKariGenericError {
class HiKariRepoOpsCannotSearchError extends generic_error_1.HiKariGenericError {
constructor() {

@@ -68,3 +68,3 @@ super('this repo client dose not support search', exports.HiKariErrno.RepoOpsCannotSearch, undefined);

exports.HiKariRepoOpsCannotSearchError = HiKariRepoOpsCannotSearchError;
class HiKariRepoOpsCannotImportError extends generic_1.HiKariGenericError {
class HiKariRepoOpsCannotImportError extends generic_error_1.HiKariGenericError {
constructor() {

@@ -75,3 +75,3 @@ super('this repo client dose not support import', exports.HiKariErrno.RepoOpsCannotImport, undefined);

exports.HiKariRepoOpsCannotImportError = HiKariRepoOpsCannotImportError;
class HiKariRepoOpsHasNoControlCommandEntryError extends generic_1.HiKariGenericError {
class HiKariRepoOpsHasNoControlCommandEntryError extends generic_error_1.HiKariGenericError {
constructor() {

@@ -82,3 +82,3 @@ super('this repo client has no control command entry', exports.HiKariErrno.RepoOpsHasNoControlCommandEntry, undefined);

exports.HiKariRepoOpsHasNoControlCommandEntryError = HiKariRepoOpsHasNoControlCommandEntryError;
class HiKariRepoOpsCannotReadError extends generic_1.HiKariGenericError {
class HiKariRepoOpsCannotReadError extends generic_error_1.HiKariGenericError {
constructor() {

@@ -89,3 +89,3 @@ super('this repo client dose not support read', exports.HiKariErrno.RepoOpsCannotRead, undefined);

exports.HiKariRepoOpsCannotReadError = HiKariRepoOpsCannotReadError;
class HiKariRepoOpsCannotWriteError extends generic_1.HiKariGenericError {
class HiKariRepoOpsCannotWriteError extends generic_error_1.HiKariGenericError {
constructor() {

@@ -96,3 +96,3 @@ super('this repo client dose not support write', exports.HiKariErrno.RepoOpsCannotWrite, undefined);

exports.HiKariRepoOpsCannotWriteError = HiKariRepoOpsCannotWriteError;
class HikariNotImplementedError extends generic_1.HiKariGenericError {
class HikariNotImplementedError extends generic_error_1.HiKariGenericError {
constructor(message) {

@@ -103,3 +103,3 @@ super(message, exports.HiKariErrno.NotImplemented, undefined);

exports.HikariNotImplementedError = HikariNotImplementedError;
class HiKariRepoOpsNotSupportEntityError extends generic_1.HiKariGenericError {
class HiKariRepoOpsNotSupportEntityError extends generic_error_1.HiKariGenericError {
constructor(entity) {

@@ -110,3 +110,3 @@ super(`this repo client dose not support entity ${entity}`, exports.HiKariErrno.RepoOpsNotSupportEntity, { entity });

exports.HiKariRepoOpsNotSupportEntityError = HiKariRepoOpsNotSupportEntityError;
class HiKariRepoOpsNotFoundError extends generic_1.HiKariGenericError {
class HiKariRepoOpsNotFoundError extends generic_error_1.HiKariGenericError {
constructor() {

@@ -117,3 +117,3 @@ super('no such repo ops registered in the service', exports.HiKariErrno.RepoOpsNotFound, undefined);

exports.HiKariRepoOpsNotFoundError = HiKariRepoOpsNotFoundError;
class HiKariRepoOpsSearchHasPrevResultError extends generic_1.HiKariGenericError {
class HiKariRepoOpsSearchHasPrevResultError extends generic_error_1.HiKariGenericError {
constructor() {

@@ -124,3 +124,3 @@ super(`a transform from search client does not receive a prev result`, exports.HiKariErrno.RepoOpsSearchHasPrevResult, undefined);

exports.HiKariRepoOpsSearchHasPrevResultError = HiKariRepoOpsSearchHasPrevResultError;
class HiKariPlatformResourceTypeConflictError extends generic_1.HiKariGenericError {
class HiKariPlatformResourceTypeConflictError extends generic_error_1.HiKariGenericError {
constructor(resourceType) {

@@ -131,3 +131,3 @@ super(`platform resource type conflict: ${resourceType}`, exports.HiKariErrno.PlatformResourceTypeConflict, { resourceType });

exports.HiKariPlatformResourceTypeConflictError = HiKariPlatformResourceTypeConflictError;
class HiKariServiceInvalidParamsError extends generic_1.HiKariGenericError {
class HiKariServiceInvalidParamsError extends generic_error_1.HiKariGenericError {
constructor(message, response) {

@@ -134,0 +134,0 @@ if (message) {

@@ -12,22 +12,2 @@ export declare type ObjectDict<T> = {

} : HiKariGenericDataBase<T>;
declare type EWC = Error & {
code: number;
params?: unknown;
};
export declare class HiKariGenericError<Code extends number = -1, T = undefined> extends Error implements EWC {
code: Code;
params: T;
constructor(message: string, code: Code, params: T);
}
export declare class HiKariError extends HiKariGenericError implements EWC {
constructor(message: string);
}
declare type HGE = HiKariGenericError<-16777215>;
export declare type HiKariGenericResponse<T = undefined, Error00 extends EWC = HGE, Error01 extends EWC = HGE, Error02 extends EWC = HGE, Error03 extends EWC = HGE, Error04 extends EWC = HGE, Error05 extends EWC = HGE, Error06 extends EWC = HGE, Error07 extends EWC = HGE, Error08 extends EWC = HGE, Error09 extends EWC = HGE, Error0A extends EWC = HGE, Error0B extends EWC = HGE, Error0C extends EWC = HGE, Error0D extends EWC = HGE, Error0E extends EWC = HGE, Error0F extends EWC = HGE, Error10 extends EWC = HGE, Error11 extends EWC = HGE, Error12 extends EWC = HGE, Error13 extends EWC = HGE, Error14 extends EWC = HGE, Error15 extends EWC = HGE, Error16 extends EWC = HGE, Error17 extends EWC = HGE, Error18 extends EWC = HGE, Error19 extends EWC = HGE, Error1A extends EWC = HGE, Error1B extends EWC = HGE, Error1C extends EWC = HGE, Error1D extends EWC = HGE, Error1E extends EWC = HGE, Error1F extends EWC = HGE, Error20 extends EWC = HGE, Error21 extends EWC = HGE, Error22 extends EWC = HGE, Error23 extends EWC = HGE, Error24 extends EWC = HGE, Error25 extends EWC = HGE, Error26 extends EWC = HGE, Error27 extends EWC = HGE, Error28 extends EWC = HGE, Error29 extends EWC = HGE, Error2A extends EWC = HGE, Error2B extends EWC = HGE, Error2C extends EWC = HGE, Error2D extends EWC = HGE, Error2E extends EWC = HGE, Error2F extends EWC = HGE, Error30 extends EWC = HGE, Error31 extends EWC = HGE, Error32 extends EWC = HGE, Error33 extends EWC = HGE, Error34 extends EWC = HGE, Error35 extends EWC = HGE, Error36 extends EWC = HGE, Error37 extends EWC = HGE, Error38 extends EWC = HGE, Error39 extends EWC = HGE, Error3A extends EWC = HGE, Error3B extends EWC = HGE, Error3C extends EWC = HGE, Error3D extends EWC = HGE, Error3E extends EWC = HGE, Error3F extends EWC = HGE> = HiKariGenericData<T> | HiKariError | Error00 | Error01 | Error02 | Error03 | Error04 | Error05 | Error06 | Error07 | Error08 | Error09 | Error0A | Error0B | Error0C | Error0D | Error0E | Error0F | Error10 | Error11 | Error12 | Error13 | Error14 | Error15 | Error16 | Error17 | Error18 | Error19 | Error1A | Error1B | Error1C | Error1D | Error1E | Error1F | Error20 | Error21 | Error22 | Error23 | Error24 | Error25 | Error26 | Error27 | Error28 | Error29 | Error2A | Error2B | Error2C | Error2D | Error2E | Error2F | Error30 | Error31 | Error32 | Error33 | Error34 | Error35 | Error36 | Error37 | Error38 | Error39 | Error3A | Error3B | Error3C | Error3D | Error3E | Error3F;
export declare class HiKariGenericResponseHelper {
static isDataPayload<T, Error00 extends EWC, Error01 extends EWC, Error02 extends EWC, Error03 extends EWC, Error04 extends EWC, Error05 extends EWC, Error06 extends EWC, Error07 extends EWC, Error08 extends EWC, Error09 extends EWC, Error0A extends EWC, Error0B extends EWC, Error0C extends EWC, Error0D extends EWC, Error0E extends EWC, Error0F extends EWC, Error10 extends EWC, Error11 extends EWC, Error12 extends EWC, Error13 extends EWC, Error14 extends EWC, Error15 extends EWC, Error16 extends EWC, Error17 extends EWC, Error18 extends EWC, Error19 extends EWC, Error1A extends EWC, Error1B extends EWC, Error1C extends EWC, Error1D extends EWC, Error1E extends EWC, Error1F extends EWC, Error20 extends EWC, Error21 extends EWC, Error22 extends EWC, Error23 extends EWC, Error24 extends EWC, Error25 extends EWC, Error26 extends EWC, Error27 extends EWC, Error28 extends EWC, Error29 extends EWC, Error2A extends EWC, Error2B extends EWC, Error2C extends EWC, Error2D extends EWC, Error2E extends EWC, Error2F extends EWC, Error30 extends EWC, Error31 extends EWC, Error32 extends EWC, Error33 extends EWC, Error34 extends EWC, Error35 extends EWC, Error36 extends EWC, Error37 extends EWC, Error38 extends EWC, Error39 extends EWC, Error3A extends EWC, Error3B extends EWC, Error3C extends EWC, Error3D extends EWC, Error3E extends EWC, Error3F extends EWC>(resp: HiKariGenericResponse<T, Error00, Error01, Error02, Error03, Error04, Error05, Error06, Error07, Error08, Error09, Error0A, Error0B, Error0C, Error0D, Error0E, Error0F, Error10, Error11, Error12, Error13, Error14, Error15, Error16, Error17, Error18, Error19, Error1A, Error1B, Error1C, Error1D, Error1E, Error1F, Error20, Error21, Error22, Error23, Error24, Error25, Error26, Error27, Error28, Error29, Error2A, Error2B, Error2C, Error2D, Error2E, Error2F, Error30, Error31, Error32, Error33, Error34, Error35, Error36, Error37, Error38, Error39, Error3A, Error3B, Error3C, Error3D, Error3E, Error3F>): resp is HiKariGenericData<T>;
static isError<T, Error00 extends EWC, Error01 extends EWC, Error02 extends EWC, Error03 extends EWC, Error04 extends EWC, Error05 extends EWC, Error06 extends EWC, Error07 extends EWC, Error08 extends EWC, Error09 extends EWC, Error0A extends EWC, Error0B extends EWC, Error0C extends EWC, Error0D extends EWC, Error0E extends EWC, Error0F extends EWC, Error10 extends EWC, Error11 extends EWC, Error12 extends EWC, Error13 extends EWC, Error14 extends EWC, Error15 extends EWC, Error16 extends EWC, Error17 extends EWC, Error18 extends EWC, Error19 extends EWC, Error1A extends EWC, Error1B extends EWC, Error1C extends EWC, Error1D extends EWC, Error1E extends EWC, Error1F extends EWC, Error20 extends EWC, Error21 extends EWC, Error22 extends EWC, Error23 extends EWC, Error24 extends EWC, Error25 extends EWC, Error26 extends EWC, Error27 extends EWC, Error28 extends EWC, Error29 extends EWC, Error2A extends EWC, Error2B extends EWC, Error2C extends EWC, Error2D extends EWC, Error2E extends EWC, Error2F extends EWC, Error30 extends EWC, Error31 extends EWC, Error32 extends EWC, Error33 extends EWC, Error34 extends EWC, Error35 extends EWC, Error36 extends EWC, Error37 extends EWC, Error38 extends EWC, Error39 extends EWC, Error3A extends EWC, Error3B extends EWC, Error3C extends EWC, Error3D extends EWC, Error3E extends EWC, Error3F extends EWC>(resp: HiKariGenericResponse<T, Error00, Error01, Error02, Error03, Error04, Error05, Error06, Error07, Error08, Error09, Error0A, Error0B, Error0C, Error0D, Error0E, Error0F, Error10, Error11, Error12, Error13, Error14, Error15, Error16, Error17, Error18, Error19, Error1A, Error1B, Error1C, Error1D, Error1E, Error1F, Error20, Error21, Error22, Error23, Error24, Error25, Error26, Error27, Error28, Error29, Error2A, Error2B, Error2C, Error2D, Error2E, Error2F, Error30, Error31, Error32, Error33, Error34, Error35, Error36, Error37, Error38, Error39, Error3A, Error3B, Error3C, Error3D, Error3E, Error3F>): resp is Error00 | Error01 | Error02 | Error03 | Error04 | Error05 | Error06 | Error07 | Error08 | Error09 | Error0A | Error0B | Error0C | Error0D | Error0E | Error0F | Error10 | Error11 | Error12 | Error13 | Error14 | Error15 | Error16 | Error17 | Error18 | Error19 | Error1A | Error1B | Error1C | Error1D | Error1E | Error1F | Error20 | Error21 | Error22 | Error23 | Error24 | Error25 | Error26 | Error27 | Error28 | Error29 | Error2A | Error2B | Error2C | Error2D | Error2E | Error2F | Error30 | Error31 | Error32 | Error33 | Error34 | Error35 | Error36 | Error37 | Error38 | Error39 | Error3A | Error3B | Error3C | Error3D | Error3E | Error3F;
static unwrap<T, Error00 extends EWC, Error01 extends EWC, Error02 extends EWC, Error03 extends EWC, Error04 extends EWC, Error05 extends EWC, Error06 extends EWC, Error07 extends EWC, Error08 extends EWC, Error09 extends EWC, Error0A extends EWC, Error0B extends EWC, Error0C extends EWC, Error0D extends EWC, Error0E extends EWC, Error0F extends EWC, Error10 extends EWC, Error11 extends EWC, Error12 extends EWC, Error13 extends EWC, Error14 extends EWC, Error15 extends EWC, Error16 extends EWC, Error17 extends EWC, Error18 extends EWC, Error19 extends EWC, Error1A extends EWC, Error1B extends EWC, Error1C extends EWC, Error1D extends EWC, Error1E extends EWC, Error1F extends EWC, Error20 extends EWC, Error21 extends EWC, Error22 extends EWC, Error23 extends EWC, Error24 extends EWC, Error25 extends EWC, Error26 extends EWC, Error27 extends EWC, Error28 extends EWC, Error29 extends EWC, Error2A extends EWC, Error2B extends EWC, Error2C extends EWC, Error2D extends EWC, Error2E extends EWC, Error2F extends EWC, Error30 extends EWC, Error31 extends EWC, Error32 extends EWC, Error33 extends EWC, Error34 extends EWC, Error35 extends EWC, Error36 extends EWC, Error37 extends EWC, Error38 extends EWC, Error39 extends EWC, Error3A extends EWC, Error3B extends EWC, Error3C extends EWC, Error3D extends EWC, Error3E extends EWC, Error3F extends EWC>(resp: HiKariGenericResponse<T, Error00, Error01, Error02, Error03, Error04, Error05, Error06, Error07, Error08, Error09, Error0A, Error0B, Error0C, Error0D, Error0E, Error0F, Error10, Error11, Error12, Error13, Error14, Error15, Error16, Error17, Error18, Error19, Error1A, Error1B, Error1C, Error1D, Error1E, Error1F, Error20, Error21, Error22, Error23, Error24, Error25, Error26, Error27, Error28, Error29, Error2A, Error2B, Error2C, Error2D, Error2E, Error2F, Error30, Error31, Error32, Error33, Error34, Error35, Error36, Error37, Error38, Error39, Error3A, Error3B, Error3C, Error3D, Error3E, Error3F>): T | undefined;
static asError<T, Error00 extends EWC, Error01 extends EWC, Error02 extends EWC, Error03 extends EWC, Error04 extends EWC, Error05 extends EWC, Error06 extends EWC, Error07 extends EWC, Error08 extends EWC, Error09 extends EWC, Error0A extends EWC, Error0B extends EWC, Error0C extends EWC, Error0D extends EWC, Error0E extends EWC, Error0F extends EWC, Error10 extends EWC, Error11 extends EWC, Error12 extends EWC, Error13 extends EWC, Error14 extends EWC, Error15 extends EWC, Error16 extends EWC, Error17 extends EWC, Error18 extends EWC, Error19 extends EWC, Error1A extends EWC, Error1B extends EWC, Error1C extends EWC, Error1D extends EWC, Error1E extends EWC, Error1F extends EWC, Error20 extends EWC, Error21 extends EWC, Error22 extends EWC, Error23 extends EWC, Error24 extends EWC, Error25 extends EWC, Error26 extends EWC, Error27 extends EWC, Error28 extends EWC, Error29 extends EWC, Error2A extends EWC, Error2B extends EWC, Error2C extends EWC, Error2D extends EWC, Error2E extends EWC, Error2F extends EWC, Error30 extends EWC, Error31 extends EWC, Error32 extends EWC, Error33 extends EWC, Error34 extends EWC, Error35 extends EWC, Error36 extends EWC, Error37 extends EWC, Error38 extends EWC, Error39 extends EWC, Error3A extends EWC, Error3B extends EWC, Error3C extends EWC, Error3D extends EWC, Error3E extends EWC, Error3F extends EWC>(resp: HiKariGenericResponse<T, Error00, Error01, Error02, Error03, Error04, Error05, Error06, Error07, Error08, Error09, Error0A, Error0B, Error0C, Error0D, Error0E, Error0F, Error10, Error11, Error12, Error13, Error14, Error15, Error16, Error17, Error18, Error19, Error1A, Error1B, Error1C, Error1D, Error1E, Error1F, Error20, Error21, Error22, Error23, Error24, Error25, Error26, Error27, Error28, Error29, Error2A, Error2B, Error2C, Error2D, Error2E, Error2F, Error30, Error31, Error32, Error33, Error34, Error35, Error36, Error37, Error38, Error39, Error3A, Error3B, Error3C, Error3D, Error3E, Error3F>): EWC | undefined;
}
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HiKariGenericResponseHelper = exports.HiKariError = exports.HiKariGenericError = void 0;
class HiKariGenericError extends Error {
constructor(message, code, params) {
super(message);
this.code = code;
this.params = params;
}
}
exports.HiKariGenericError = HiKariGenericError;
class HiKariError extends HiKariGenericError {
constructor(message) {
super(message, -1, undefined);
}
}
exports.HiKariError = HiKariError;
class HiKariGenericResponseHelper {
static isDataPayload(resp) {
return resp.code === 0;
}
static isError(resp) {
return resp.code !== 0;
}
static unwrap(resp) {
if (HiKariGenericResponseHelper.isDataPayload(resp)) {
return resp.data;
}
return undefined;
}
static asError(resp) {
if (HiKariGenericResponseHelper.isError(resp)) {
return resp;
}
return undefined;
}
}
exports.HiKariGenericResponseHelper = HiKariGenericResponseHelper;
//# sourceMappingURL=generic.js.map

@@ -8,3 +8,4 @@ import { RepoServiceOps, RepoServiceOpsFactory } from "./rsi";

repoServiceOpsFacRegister(opsFactory: RepoServiceOpsFactory<unknown>): void;
repoServiceOpsFacRemove(opsFactory: RepoServiceOpsFactory<unknown>): void;
}
export declare const metaManager: HiKariTypeMetaManager;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.metaManager = exports.HiKariTypeMetaManager = void 0;
const semantic_1 = require("../lib/semantic");
class HiKariTypeMetaManager {

@@ -14,3 +13,6 @@ constructor() {

repoServiceOpsRemove(opsInstance) {
semantic_1.used(opsInstance);
const index = this.protocolInstances.indexOf(opsInstance);
if (index !== -1) {
this.protocolInstances.splice(index, 1);
}
}

@@ -20,2 +22,8 @@ repoServiceOpsFacRegister(opsFactory) {

}
repoServiceOpsFacRemove(opsFactory) {
const index = this.protocolFactories.indexOf(opsFactory);
if (index !== -1) {
this.protocolFactories.splice(index, 1);
}
}
}

@@ -22,0 +30,0 @@ exports.HiKariTypeMetaManager = HiKariTypeMetaManager;

@@ -1,25 +0,12 @@

/// <reference types="node" />
import * as fs from 'fs';
import { IAudioMetadata } from 'music-metadata';
export declare enum FileType {
Others = 0,
Track = 1,
Image = 2,
Log = 3
export interface IObject {
mainName: string;
mainNameSource: string;
alternativeNames?: IObjectName[];
accessPathLoaded?: boolean;
accessPaths: IAccessPath[];
uniqueKey?: string;
createdAt?: Date;
updatedAt?: Date;
}
export interface FileInfo {
name: string;
type: number;
}
export interface TrackInfo extends FileInfo {
readonly type: FileType.Track;
verified0: number;
title: string;
artist?: string;
meta?: IAudioMetadata;
disk: number;
track: number;
}
export declare enum AlbumNameSource {
Other = "other",
export declare enum ObjectNameSource {
FilesystemBasename = "filesystem-basename",

@@ -30,4 +17,7 @@ TrackMetadata = "track-metadata",

}
export interface IObjectName {
source: ObjectNameSource | string;
name: string;
}
export declare enum AccessPathType {
Other = "other",
Uri = "uri",

@@ -38,6 +28,2 @@ FilesystemUri = "filesystem-uri",

}
export interface IAlbumName {
source: string;
name: string;
}
export interface IAccessPath {

@@ -50,32 +36,20 @@ type: string;

}
export interface ITrack {
mainName: string;
export interface ITrack extends IObject {
albumDigest?: string;
accessPaths: IAccessPath[];
loadInfo(): Promise<TrackInfo | undefined>;
loadStatResult(): Promise<fs.Stats | undefined>;
}
export interface IAlbum {
mainName: string;
mainNameSource: string;
alternativeNames: IAlbumName[];
accessPaths: IAccessPath[];
tracks: ITrack[];
export interface IAlbum extends IObject {
tracks?: ITrack[];
}
export interface IVideo {
title: string;
description: string;
mu_sec: number;
accessPaths: IAccessPath[];
export interface IVideo extends IObject {
description?: string;
mu_sec?: number;
}
export declare class RepoItemFSet {
static isFilesystemUri(ap: IAccessPath): ap is FilesystemAccessPath;
static isTrackInfo(fi: FileInfo): fi is TrackInfo;
static findFilePath(track: {
accessPaths: IAccessPath[];
}): string | undefined;
static toPureTrackData(track: ITrack): ITrack;
static toPureAlbumData(album: IAlbum): IAlbum;
}
declare const _enumEntities: {
readonly object: IObject;
readonly album: IAlbum;

@@ -82,0 +56,0 @@ readonly track: ITrack;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RepoItemFSet = exports.AccessPathType = exports.AlbumNameSource = exports.FileType = void 0;
exports.RepoItemFSet = exports.AccessPathType = exports.ObjectNameSource = void 0;
const semantic_1 = require("../lib/semantic");
var FileType;
(function (FileType) {
FileType[FileType["Others"] = 0] = "Others";
FileType[FileType["Track"] = 1] = "Track";
FileType[FileType["Image"] = 2] = "Image";
FileType[FileType["Log"] = 3] = "Log";
})(FileType = exports.FileType || (exports.FileType = {}));
var AlbumNameSource;
(function (AlbumNameSource) {
AlbumNameSource["Other"] = "other";
AlbumNameSource["FilesystemBasename"] = "filesystem-basename";
AlbumNameSource["TrackMetadata"] = "track-metadata";
AlbumNameSource["Discogs"] = "discogs";
AlbumNameSource["Youtube"] = "youtube";
})(AlbumNameSource = exports.AlbumNameSource || (exports.AlbumNameSource = {}));
var ObjectNameSource;
(function (ObjectNameSource) {
ObjectNameSource["FilesystemBasename"] = "filesystem-basename";
ObjectNameSource["TrackMetadata"] = "track-metadata";
ObjectNameSource["Discogs"] = "discogs";
ObjectNameSource["Youtube"] = "youtube";
})(ObjectNameSource = exports.ObjectNameSource || (exports.ObjectNameSource = {}));
var AccessPathType;
(function (AccessPathType) {
AccessPathType["Other"] = "other";
AccessPathType["Uri"] = "uri";

@@ -32,5 +23,2 @@ AccessPathType["FilesystemUri"] = "filesystem-uri";

}
static isTrackInfo(fi) {
return fi.type === FileType.Track;
}
static findFilePath(track) {

@@ -41,27 +29,6 @@ var _a;

}
static toPureTrackData(track) {
return {
mainName: track.mainName,
albumDigest: track.albumDigest,
accessPaths: track.accessPaths,
loadInfo() {
return Promise.resolve(undefined);
},
loadStatResult() {
return Promise.resolve(undefined);
},
};
}
static toPureAlbumData(album) {
return {
accessPaths: album.accessPaths,
alternativeNames: album.alternativeNames,
mainName: album.mainName,
mainNameSource: album.mainNameSource,
tracks: album.tracks.map(RepoItemFSet.toPureTrackData),
};
}
}
exports.RepoItemFSet = RepoItemFSet;
const _enumEntities = {
object: semantic_1.typedValue(),
album: semantic_1.typedValue(),

@@ -68,0 +35,0 @@ track: semantic_1.typedValue(),

import { EnumRepoEntitiesKey, EnumRepoEntitiesMeta, EnumRepoEntityLoadMethodKey, EnumRepoEntityLoadMethodsMeta } from "./repo-item";
import { ObjectDict } from "./generic";
import { Mutable } from "../lib/semantic";

@@ -7,2 +6,3 @@ import { HiKariCoreHostConfig } from "./config";

import { HiKariTypeMetaManager } from "./meta";
import { ObjectDict } from "./generic";
interface Closer {

@@ -9,0 +9,0 @@ close(promiseReporter: (err: Error) => never): void;

@@ -5,6 +5,6 @@ "use strict";

const repo_item_1 = require("./repo-item");
const generic_1 = require("./generic");
const semantic_1 = require("../lib/semantic");
const config_1 = require("./config");
const meta_1 = require("./meta");
const generic_1 = require("./generic");
class HiKariSourceManagerCreateItemFromIIdApis {

@@ -11,0 +11,0 @@ createItemFromI(k, i) {

@@ -9,3 +9,3 @@

```
yarn install @hikarix/core
yarn add @hikarix/core
```

@@ -12,0 +12,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc