@nyth/common
Advanced tools
Comparing version 0.4.0 to 0.5.0
/// <reference types="node" /> | ||
import { Server } from 'http'; | ||
import { Server as HttpServer } from 'http'; | ||
import { IRpcAdapter } from './typings'; | ||
export interface IHttpAdapter extends IRpcAdapter { | ||
adjust<T>(constructor: new (arg: { | ||
server: Server; | ||
server: HttpServer; | ||
}) => T): T; | ||
@@ -8,0 +8,0 @@ close(): Promise<void>; |
@@ -1,7 +0,2 @@ | ||
export { BaseAdapter } from './base-adapter'; | ||
export { INTERNAL_ERROR_MESSAGE, PERMISSIONS_DENIED_MESSAGE, AppError, ScenarioError, PermissionsDeniedError, SystemError, } from './errors'; | ||
export { HandlerValidationSuccess, HANDLER_VALIDATION_SUCCESS, HandlerValidationFail, } from './handler-validation-result'; | ||
export { IHttpAdapter } from './http-adapter'; | ||
export { EScenarioStatus, IRpcResult, RpcResult, ScenarioSuccessResult, PermissionsDeniedResult, ScenarioFailResult, SystemErrorResult, } from './responses'; | ||
export { ISerializer, defaultSerializer } from './serializer'; | ||
export { IRpcRequest, IRpcExecutor, IRpcAdapter, IRpcAdapterConstructor, IHandlerValidationSuccess, IHandlerValidationFail, THandlerValidationResult, IRpcMethodHandler, IExecutor, IApplication, IRouting, IApplicationFactory, } from './typings'; | ||
export { IRpcExecutor, IRpcAdapter, IRpcAdapterConstructor, IRpcMethodHandler, IExecutor, IApplication, IRouting, IApplicationFactory, } from './typings'; |
@@ -1,12 +0,4 @@ | ||
import { BaseAdapter } from './base-adapter'; | ||
import { RpcResult } from './responses'; | ||
import { ISerializer } from './serializer'; | ||
export interface IRpcRequest<Payload = unknown> { | ||
readonly method: string; | ||
readonly payload: Payload; | ||
readonly correlationId?: string | number | null; | ||
readonly requestId?: string | number | null; | ||
readonly version?: number | null; | ||
readonly timestamp?: number | null; | ||
} | ||
import { BaseAdapter } from '@nyth/base-adapter'; | ||
import { RpcResult, IRpcRequest, THandlerValidationResult } from '@nyth/models'; | ||
import { ISerializer } from '@nyth/serializer'; | ||
export type IRpcExecutor = (rpcCall: IRpcRequest) => Promise<RpcResult>; | ||
@@ -18,11 +10,2 @@ export interface IRpcAdapter extends BaseAdapter { | ||
export type IRpcAdapterConstructor<O = unknown> = new (options: O, serializer?: ISerializer) => IRpcAdapter; | ||
export interface IHandlerValidationSuccess { | ||
readonly isValidCallData: true; | ||
readonly validationErrorMessage?: null; | ||
} | ||
export interface IHandlerValidationFail { | ||
readonly isValidCallData: false; | ||
readonly validationErrorMessage: string; | ||
} | ||
export type THandlerValidationResult = IHandlerValidationSuccess | IHandlerValidationFail; | ||
export interface IRpcMethodHandler<Result = unknown, CallData = unknown> { | ||
@@ -29,0 +12,0 @@ validate(rpcCallPayload: CallData): THandlerValidationResult | Promise<THandlerValidationResult>; |
{ | ||
"name": "@nyth/common", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "nyth", | ||
@@ -12,3 +12,3 @@ "author": "Andrey Sakharov <caxap_8787@mail.ru> (https://www.linkedin.com/in/andrey-sakharov/)", | ||
"require": "./dist/index.cjs", | ||
"import": "./es6.mjs" | ||
"import": "./dist/es6/index.mjs" | ||
} | ||
@@ -21,11 +21,14 @@ }, | ||
"scripts": { | ||
"build": "(rm -rf dist || npx rimraf dist) && tsc -p tsconfig.json && mv dist/index.js dist/index.cjs" | ||
"build": "npm run build_cjs && npm run build_es6", | ||
"build_cjs": "tsc -p tsconfig.json && mv dist/index.js dist/index.cjs", | ||
"build_es6": "tsc -p tsconfig.es6.json && mv dist/es6/index.js dist/es6/index.mjs", | ||
"prebuild": "rm -rf dist || npx rimraf dist" | ||
}, | ||
"files": [ | ||
"dist", | ||
"es6.mjs" | ||
"dist" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/muturgan/nyth.git" | ||
"url": "git+https://github.com/muturgan/nyth.git", | ||
"directory": "packages/common" | ||
}, | ||
@@ -36,4 +39,8 @@ "bugs": { | ||
"homepage": "https://github.com/muturgan/nyth#readme", | ||
"dependencies": { | ||
"@nyth/base-adapter": "^0.5.0", | ||
"@nyth/models": "^0.5.0", | ||
"@nyth/serializer": "^0.5.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.2.5", | ||
"typescript": "^5.1.3" | ||
@@ -40,0 +47,0 @@ }, |
Sorry, the diff of this file is not supported yet
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
1
3152
3
10
41
1
+ Added@nyth/base-adapter@^0.5.0
+ Added@nyth/models@^0.5.0
+ Added@nyth/serializer@^0.5.0
+ Added@nyth/base-adapter@0.5.7(transitive)
+ Added@nyth/models@0.5.7(transitive)
+ Added@nyth/serializer@0.5.7(transitive)