@wocker/core
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -1,1 +0,1 @@ | ||
export declare const Inject: () => (target: any) => void; | ||
export declare const Inject: <T = any>(token?: T) => ParameterDecorator; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Inject = void 0; | ||
const Inject = () => { | ||
return (target) => { | ||
const env_1 = require("../env"); | ||
const Inject = (token) => { | ||
return (target, propertyKey, parameterIndex) => { | ||
Reflect.defineMetadata(env_1.SELF_DECLARED_DEPS_METADATA, [ | ||
...Reflect.getMetadata(env_1.SELF_DECLARED_DEPS_METADATA, target) || [], | ||
{ | ||
token: token, | ||
index: parameterIndex | ||
} | ||
], target); | ||
}; | ||
}; | ||
exports.Inject = Inject; |
@@ -1,4 +0,1 @@ | ||
import { DI } from "../makes/DI"; | ||
export declare const Injectable: () => <T extends new (...rest: any[]) => {}>(Target: T) => { | ||
new (di: DI): {}; | ||
} & T; | ||
export declare const Injectable: (token?: string) => ClassDecorator; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Injectable = void 0; | ||
const Injectable = () => { | ||
return (Target) => { | ||
// @ts-ignore | ||
return class extends Target { | ||
constructor(di) { | ||
const types = Reflect.getMetadata("design:paramtypes", Target); | ||
const params = types.map((type) => { | ||
return (di).resolveService(type); | ||
}); | ||
super(...params); | ||
} | ||
}; | ||
const env_1 = require("../env"); | ||
const Injectable = (token) => { | ||
return (target) => { | ||
Reflect.defineMetadata(env_1.INJECTABLE_WATERMARK, true, target); | ||
if (token) { | ||
Reflect.defineMetadata(env_1.INJECT_TOKEN_METADATA, token, target); | ||
} | ||
}; | ||
}; | ||
exports.Injectable = Injectable; |
export { Cli } from "@kearisp/cli"; | ||
export * from "./decorators/Inject"; | ||
export * from "./decorators/Injectable"; | ||
export * from "./makes/Controller"; | ||
export * from "./makes/DI"; | ||
export * from "./makes/FS"; | ||
export * from "./makes/FSManager"; | ||
export * from "./makes/Logger"; | ||
export * from "./makes/Plugin"; | ||
export * from "./models/Preset"; | ||
export * from "./models/Project"; | ||
export * from "./services/AppConfigService"; | ||
export * from "./services/AppEventsService"; | ||
export * from "./services/DockerService"; | ||
export * from "./services/LogService"; | ||
export * from "./services/PresetService"; | ||
export * from "./services/ProjectService"; | ||
export * from "./types/AppConfig"; | ||
export * from "./types/EnvConfig"; | ||
export * from "./decorators"; | ||
export * from "./makes"; | ||
export * from "./services"; | ||
export * from "./types"; | ||
export { MODULE_METADATA, PLUGIN_DIR_KEY } from "./env"; |
@@ -17,22 +17,11 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Cli = void 0; | ||
exports.PLUGIN_DIR_KEY = exports.MODULE_METADATA = exports.Cli = void 0; | ||
var cli_1 = require("@kearisp/cli"); | ||
Object.defineProperty(exports, "Cli", { enumerable: true, get: function () { return cli_1.Cli; } }); | ||
__exportStar(require("./decorators/Inject"), exports); | ||
__exportStar(require("./decorators/Injectable"), exports); | ||
__exportStar(require("./makes/Controller"), exports); | ||
__exportStar(require("./makes/DI"), exports); | ||
__exportStar(require("./makes/FS"), exports); | ||
__exportStar(require("./makes/FSManager"), exports); | ||
__exportStar(require("./makes/Logger"), exports); | ||
__exportStar(require("./makes/Plugin"), exports); | ||
__exportStar(require("./models/Preset"), exports); | ||
__exportStar(require("./models/Project"), exports); | ||
__exportStar(require("./services/AppConfigService"), exports); | ||
__exportStar(require("./services/AppEventsService"), exports); | ||
__exportStar(require("./services/DockerService"), exports); | ||
__exportStar(require("./services/LogService"), exports); | ||
__exportStar(require("./services/PresetService"), exports); | ||
__exportStar(require("./services/ProjectService"), exports); | ||
__exportStar(require("./types/AppConfig"), exports); | ||
__exportStar(require("./types/EnvConfig"), exports); | ||
__exportStar(require("./decorators"), exports); | ||
__exportStar(require("./makes"), exports); | ||
__exportStar(require("./services"), exports); | ||
__exportStar(require("./types"), exports); | ||
var env_1 = require("./env"); | ||
Object.defineProperty(exports, "MODULE_METADATA", { enumerable: true, get: function () { return env_1.MODULE_METADATA; } }); | ||
Object.defineProperty(exports, "PLUGIN_DIR_KEY", { enumerable: true, get: function () { return env_1.PLUGIN_DIR_KEY; } }); |
@@ -46,4 +46,4 @@ "use strict"; | ||
} | ||
mkdir(path, options = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
mkdir(path_1) { | ||
return __awaiter(this, arguments, void 0, function* (path, options = {}) { | ||
const fullPath = Path.join(this.destination, path); | ||
@@ -124,4 +124,4 @@ return new Promise((resolve, reject) => { | ||
} | ||
rm(path, options = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
rm(path_1) { | ||
return __awaiter(this, arguments, void 0, function* (path, options = {}) { | ||
const filePath = Path.join(this.destination, path); | ||
@@ -128,0 +128,0 @@ return new Promise((resolve, reject) => { |
@@ -1,4 +0,4 @@ | ||
import { DI } from "./DI"; | ||
declare class Logger { | ||
static install(di: DI): void; | ||
import { LogService } from "../services/LogService"; | ||
export declare class Logger { | ||
static install(ls: LogService): void; | ||
static log(...data: any[]): void; | ||
@@ -9,2 +9,1 @@ static info(...data: any[]): void; | ||
} | ||
export { Logger }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Logger = void 0; | ||
const LogService_1 = require("../services/LogService"); | ||
let _di; | ||
let loggerService; | ||
class Logger { | ||
static install(di) { | ||
_di = di; | ||
static install(ls) { | ||
loggerService = ls; | ||
} | ||
static log(...data) { | ||
_di.resolveService(LogService_1.LogService).log(...data); | ||
loggerService.log(...data); | ||
} | ||
static info(...data) { | ||
_di.resolveService(LogService_1.LogService).info(...data); | ||
loggerService.info(...data); | ||
} | ||
static warn(...data) { | ||
_di.resolveService(LogService_1.LogService).warn(...data); | ||
loggerService.warn(...data); | ||
} | ||
static error(...data) { | ||
_di.resolveService(LogService_1.LogService).error(...data); | ||
loggerService.error(...data); | ||
} | ||
} | ||
exports.Logger = Logger; |
import { Cli } from "@kearisp/cli"; | ||
import { Controller } from "./Controller"; | ||
declare class Plugin extends Controller { | ||
export declare class Plugin { | ||
install(cli: Cli): void; | ||
} | ||
export { Plugin }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Plugin = void 0; | ||
const Controller_1 = require("./Controller"); | ||
class Plugin extends Controller_1.Controller { | ||
class Plugin { | ||
install(cli) { | ||
super.install(cli); | ||
// | ||
} | ||
} | ||
exports.Plugin = Plugin; |
@@ -1,2 +0,2 @@ | ||
import { AppConfig } from "../types/AppConfig"; | ||
import { AppConfig } from "../types"; | ||
type TypeMap = { | ||
@@ -3,0 +3,0 @@ [type: string]: string; |
"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; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AppConfigService = void 0; | ||
class AppConfigService { | ||
} | ||
const decorators_1 = require("../decorators"); | ||
let AppConfigService = class AppConfigService { | ||
}; | ||
exports.AppConfigService = AppConfigService; | ||
exports.AppConfigService = AppConfigService = __decorate([ | ||
(0, decorators_1.Injectable)("APP_CONFIG") | ||
], AppConfigService); |
type EventHandle = (...args: any[]) => Promise<void> | void; | ||
declare abstract class AppEventsService { | ||
export declare abstract class AppEventsService { | ||
abstract on(event: string, handle: EventHandle): void; | ||
@@ -7,2 +7,2 @@ abstract off(event: string, handle: EventHandle): void; | ||
} | ||
export { AppEventsService, EventHandle as AppEventHandle }; | ||
export { EventHandle as AppEventHandle }; |
"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; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AppEventsService = void 0; | ||
class AppEventsService { | ||
} | ||
const decorators_1 = require("../decorators"); | ||
let AppEventsService = class AppEventsService { | ||
}; | ||
exports.AppEventsService = AppEventsService; | ||
exports.AppEventsService = AppEventsService = __decorate([ | ||
(0, decorators_1.Injectable)("APP_EVENTS_SERVICE") | ||
], AppEventsService); |
/// <reference types="node" /> | ||
import { Container } from "dockerode"; | ||
/// <reference types="node" /> | ||
import { Container, ImageInfo } from "dockerode"; | ||
import { Duplex } from "node:stream"; | ||
declare namespace DockerServiceParams { | ||
@@ -26,2 +28,9 @@ type CreateContainer = { | ||
}; | ||
type ImageList = { | ||
tag?: string; | ||
reference?: string; | ||
labels?: { | ||
[key: string]: string; | ||
}; | ||
}; | ||
type BuildImage = { | ||
@@ -45,6 +54,9 @@ tag: string; | ||
abstract imageExists(tag: string): Promise<boolean>; | ||
abstract imageLs(options?: DockerServiceParams.ImageList): Promise<ImageInfo[]>; | ||
abstract imageRm(tag: string): Promise<void>; | ||
abstract pullImage(tag: string): Promise<void>; | ||
abstract attach(name: string): Promise<void>; | ||
abstract attachStream(stream: NodeJS.ReadWriteStream): Promise<void>; | ||
abstract exec(name: string, command?: string[], tty?: boolean): Promise<Duplex>; | ||
} | ||
export { DockerService, DockerServiceParams }; |
"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; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DockerService = void 0; | ||
class DockerService { | ||
} | ||
const decorators_1 = require("../decorators"); | ||
let DockerService = class DockerService { | ||
}; | ||
exports.DockerService = DockerService; | ||
exports.DockerService = DockerService = __decorate([ | ||
(0, decorators_1.Injectable)("DOCKER_SERVICE") | ||
], DockerService); |
@@ -1,2 +0,2 @@ | ||
declare abstract class LogService { | ||
export declare abstract class LogService { | ||
abstract log(...data: any[]): void; | ||
@@ -7,2 +7,1 @@ abstract info(...data: any[]): void; | ||
} | ||
export { LogService }; |
"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; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LogService = void 0; | ||
class LogService { | ||
} | ||
const decorators_1 = require("../decorators"); | ||
let LogService = class LogService { | ||
}; | ||
exports.LogService = LogService; | ||
exports.LogService = LogService = __decorate([ | ||
(0, decorators_1.Injectable)("LOG_SERVICE") | ||
], LogService); |
@@ -1,3 +0,2 @@ | ||
import { Preset } from "../models/Preset"; | ||
import { EnvConfig } from "../types/EnvConfig"; | ||
import { EnvConfig } from "../types"; | ||
type SearchOptions = Partial<{ | ||
@@ -7,8 +6,8 @@ name: string; | ||
declare abstract class PresetService { | ||
abstract getImageName(preset: Preset, buildArgs?: EnvConfig): string; | ||
abstract save(preset: Preset): Promise<void>; | ||
abstract get(name: string): Promise<Preset | null>; | ||
abstract search(options?: SearchOptions): Promise<Preset[]>; | ||
searchOne(options?: SearchOptions): Promise<Preset | null | undefined>; | ||
abstract getImageName(preset: any, buildArgs?: EnvConfig): string; | ||
abstract save(preset: any): Promise<void>; | ||
abstract get(name: string): Promise<any | null>; | ||
abstract search(options?: SearchOptions): Promise<any[]>; | ||
searchOne(options?: SearchOptions): Promise<any | null | undefined>; | ||
} | ||
export { PresetService, SearchOptions as PresetServiceSearchOptions }; |
import { Container } from "dockerode"; | ||
import { Project } from "../models/Project"; | ||
import { Project } from "../makes/Project"; | ||
type SearchParams = Partial<{ | ||
@@ -8,3 +8,3 @@ id: string; | ||
}>; | ||
declare abstract class ProjectService { | ||
export declare abstract class ProjectService { | ||
abstract cdProject(name: string): Promise<void>; | ||
@@ -19,2 +19,2 @@ abstract get(): Promise<Project>; | ||
} | ||
export { ProjectService, SearchParams as ProjectServiceSearchParams }; | ||
export { SearchParams as ProjectServiceSearchParams }; |
"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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -13,5 +19,6 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
exports.ProjectService = void 0; | ||
class ProjectService { | ||
searchOne(params = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const decorators_1 = require("../decorators"); | ||
let ProjectService = class ProjectService { | ||
searchOne() { | ||
return __awaiter(this, arguments, void 0, function* (params = {}) { | ||
const [project] = yield this.search(params); | ||
@@ -21,3 +28,6 @@ return project || null; | ||
} | ||
} | ||
}; | ||
exports.ProjectService = ProjectService; | ||
exports.ProjectService = ProjectService = __decorate([ | ||
(0, decorators_1.Injectable)("PROJECT_SERVICE") | ||
], ProjectService); |
{ | ||
"name": "@wocker/core", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"author": "Kris Papercut <krispcut@gmail.com>", | ||
@@ -27,3 +27,3 @@ "description": "Core of wocker", | ||
"dependencies": { | ||
"@kearisp/cli": "^1.0.5", | ||
"@kearisp/cli": "^1.0.7", | ||
"fs": "^0.0.1-security", | ||
@@ -36,4 +36,4 @@ "path": "^0.12.7", | ||
"@types/node": "^20.11.7", | ||
"typescript": "^5.3.3" | ||
"typescript": "^5.4.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73452
87
1802
3
1
Updated@kearisp/cli@^1.0.7