@tussle/core
Advanced tools
Comparing version 0.2.11 to 0.2.13
@@ -13,3 +13,3 @@ "use strict"; | ||
else { | ||
const params$ = ctx.source.hook('before-create', ctx, params); | ||
const params$ = (0, rxjs_1.from)(ctx.source.hook('before-create', ctx, params)); | ||
return params$.pipe((0, operators_1.switchMap)((params) => store.createFile(params)), (0, operators_1.switchMap)((createdFile) => ctx.source.hook('after-create', ctx, createdFile)), (0, operators_1.map)((createdFile) => toResponse(ctx, createdFile))); | ||
@@ -16,0 +16,0 @@ } |
@@ -12,3 +12,3 @@ "use strict"; | ||
else { | ||
const params$ = ctx.source.hook('before-head', ctx, params); | ||
const params$ = (0, rxjs_1.from)(ctx.source.hook('before-head', ctx, params)); | ||
return params$.pipe((0, operators_1.switchMap)((params) => store.getFileInfo(params)), (0, operators_1.switchMap)((params) => ctx.source.hook('after-head', ctx, params)), (0, operators_1.map)(fileInfo => toResponse(ctx, fileInfo))); | ||
@@ -15,0 +15,0 @@ } |
@@ -0,3 +1,3 @@ | ||
import type { TussleIncomingRequest } from '@tussle/spec/interface/request'; | ||
import type { Observable } from 'rxjs'; | ||
import type { TussleIncomingRequest } from '@tussle/spec/interface/request'; | ||
import type { Tussle } from '../core'; | ||
@@ -11,4 +11,4 @@ declare const defaultResponse: { | ||
}; | ||
export default function handleOptions<Req>(core: Tussle, ctx: TussleIncomingRequest<Req>): Observable<TussleIncomingRequest<Req>>; | ||
export default function handleOptions<Req>(_core: Tussle, ctx: TussleIncomingRequest<Req>): Observable<TussleIncomingRequest<Req>>; | ||
export declare type OptionsDefaultResponse = typeof defaultResponse; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const rxjs_1 = require("rxjs"); | ||
const operators_1 = require("rxjs/operators"); | ||
@@ -13,6 +14,6 @@ const csv = (...items) => items.join(','); | ||
}; | ||
function handleOptions(core, ctx) { | ||
const response$ = ctx.source.hook('before-options', ctx, Object.assign({}, defaultResponse)).pipe((0, operators_1.map)((response) => (Object.assign(Object.assign({}, ctx), { response })))); | ||
function handleOptions(_core, ctx) { | ||
const response$ = (0, rxjs_1.from)(ctx.source.hook('before-options', ctx, Object.assign({}, defaultResponse))).pipe((0, operators_1.map)((response) => (Object.assign(Object.assign({}, ctx), { response })))); | ||
return response$; | ||
} | ||
exports.default = handleOptions; |
@@ -20,3 +20,3 @@ "use strict"; | ||
} | ||
const params$ = ctx.source.hook('before-patch', ctx, params); | ||
const params$ = (0, rxjs_2.from)(ctx.source.hook('before-patch', ctx, params)); | ||
return params$.pipe((0, operators_1.switchMap)((params) => store.patchFile(params)), (0, operators_1.switchMap)((patchedFile) => callOptionalHooks(ctx, patchedFile)), (0, operators_1.switchMap)((patchedFile) => ctx.source.hook('after-patch', ctx, patchedFile)), (0, operators_1.map)((patchedFile) => toResponse(ctx, patchedFile))); | ||
@@ -31,3 +31,3 @@ } | ||
if (isComplete(patchedFile)) { | ||
return ctx.source.hook('after-complete', ctx, patchedFile); | ||
return (0, rxjs_2.from)(ctx.source.hook('after-complete', ctx, patchedFile)); | ||
} | ||
@@ -34,0 +34,0 @@ return (0, rxjs_2.of)(patchedFile); |
{ | ||
"name": "@tussle/core", | ||
"version": "0.2.11", | ||
"version": "0.2.13", | ||
"description": "Tussle tus daemon core module", | ||
@@ -23,3 +23,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@tussle/spec": "^0.2.5", | ||
"@tussle/spec": "^0.2.13", | ||
"jest": "^27.5.1", | ||
@@ -36,3 +36,3 @@ "npm-run-all": "^4.1.5", | ||
}, | ||
"gitHead": "f29f34e7da8db621dfa8fcd601e6d9c609f87313" | ||
"gitHead": "3b6f2505cf4483bacd4a8ae3196a15e9f272b7c3" | ||
} |
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
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
27268
626