diff --git a/package-lock.json b/package-lock.json index 66f23e5..c84dab0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,6 @@ "version": "0.1.22", "license": "MIT", "dependencies": { - "date-fns": "2.30.0", - "http-status-enum": "1.0.2", "superagent": "9.0.2", "tslog": "4.9.3" }, @@ -36,7 +34,7 @@ "jest-when": "3.6.0", "prettier": "2.8.8", "release-it": "17.6.0", - "rimraf": "5.0.9", + "rimraf": "5.0.10", "ts-jest": "29.2.5", "tsup": "8.2.4", "typescript": "5.5.4" @@ -1978,6 +1976,7 @@ "version": "7.22.6", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz", "integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==", + "dev": true, "dependencies": { "regenerator-runtime": "^0.13.11" }, @@ -5356,21 +5355,6 @@ "node": ">= 14" } }, - "node_modules/date-fns": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", - "dependencies": { - "@babel/runtime": "^7.21.0" - }, - "engines": { - "node": ">=0.11" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" - } - }, "node_modules/debug": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", @@ -6818,11 +6802,6 @@ "node": ">= 14" } }, - "node_modules/http-status-enum": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/http-status-enum/-/http-status-enum-1.0.2.tgz", - "integrity": "sha512-ziMXS3wD+UJsIzBa1dPzw5wRSH6TDbRRKLFdFaAF0v8AokTlbZt/Yc13q6dBxovqNDyeelrq2OK2AoNBw/sqdw==" - }, "node_modules/http2-wrapper": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", @@ -9639,7 +9618,8 @@ "node_modules/regenerator-runtime": { "version": "0.13.11", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "dev": true }, "node_modules/regenerator-transform": { "version": "0.15.2", @@ -10136,9 +10116,9 @@ } }, "node_modules/rimraf": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.9.tgz", - "integrity": "sha512-3i7b8OcswU6CpU8Ej89quJD4O98id7TtVM5U4Mybh84zQXdrFmDLouWBEEaD/QfO3gDDfH+AGFCGsR7kngzQnA==", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", "dev": true, "license": "ISC", "dependencies": { @@ -10147,9 +10127,6 @@ "bin": { "rimraf": "dist/esm/bin.mjs" }, - "engines": { - "node": "14 >=14.20 || 16 >=16.20 || >=18" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } diff --git a/package.json b/package.json index bacc5c4..deb9522 100644 --- a/package.json +++ b/package.json @@ -63,14 +63,12 @@ "jest-when": "3.6.0", "prettier": "2.8.8", "release-it": "17.6.0", - "rimraf": "5.0.9", + "rimraf": "5.0.10", "ts-jest": "29.2.5", "tsup": "8.2.4", "typescript": "5.5.4" }, "dependencies": { - "date-fns": "2.30.0", - "http-status-enum": "1.0.2", "superagent": "9.0.2", "tslog": "4.9.3" }, diff --git a/src/common/date/date-fns.ts b/src/common/date/date-fns.ts deleted file mode 100644 index fe9ae4f..0000000 --- a/src/common/date/date-fns.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { - addDays, - addSeconds, - isAfter, - isBefore, - startOfDay, - startOfToday, - addHours, - addMinutes, - isWithinInterval, - intervalToDuration, - subMinutes, - subSeconds, - parseISO, -} from 'date-fns'; - -export { - addDays, - addSeconds, - isAfter, - isBefore, - startOfDay, - startOfToday, - addHours, - addMinutes, - isWithinInterval, - intervalToDuration, - subMinutes, - subSeconds, - parseISO, -}; - -export function now() { - return new Date(); -} - -export function getWeekdayNameForTimeZoneFromDate(date: Date, timeZone: string): string { - return date.toLocaleString('en-US', { weekday: 'long', timeZone }).toLowerCase(); -} diff --git a/src/common/httpClient/index.ts b/src/common/httpClient/index.ts index 0301b7d..3f2a7b0 100644 --- a/src/common/httpClient/index.ts +++ b/src/common/httpClient/index.ts @@ -4,6 +4,6 @@ export type { HttpResult } from './models'; export type { HttpRequestConfiguration } from './models'; export type { QueryParams } from './models'; export { HttpMethod } from './models'; - +export * from './serialize'; export * from './testHttpClient'; export * from './testHttpClientHandler'; diff --git a/src/common/httpClient/models.ts b/src/common/httpClient/models.ts index a2247db..944e102 100644 --- a/src/common/httpClient/models.ts +++ b/src/common/httpClient/models.ts @@ -1,5 +1,3 @@ -import HttpStatus from 'http-status-enum'; - export enum HttpMethod { GET = 'GET', POST = 'POST', @@ -23,7 +21,7 @@ export interface HttpRequestConfiguration { export interface HttpResult { body: TDto; - statusCode: HttpStatus; + statusCode: number; } export interface BasicHttpClient { diff --git a/src/common/httpClient/testHttpClient.ts b/src/common/httpClient/testHttpClient.ts index ee2685c..c67ee69 100644 --- a/src/common/httpClient/testHttpClient.ts +++ b/src/common/httpClient/testHttpClient.ts @@ -1,6 +1,5 @@ import { BasicHttpClient, HttpRequestConfiguration, HttpResult } from './models'; import { RejectedTestHttpRequest, ResolvedTestHttpRequest, TestHttpClientHandler } from './testHttpClientHandler'; -import HttpStatus from 'http-status-enum'; export class HttpRequestNotMockedError extends Error {} export class TestHttpClient implements BasicHttpClient { @@ -21,7 +20,7 @@ export class TestHttpClient implements BasicHttpClient { if (resolvedObj) { const httpResult: HttpResult = { body: resolvedObj as TDto, - statusCode: resolvedHttpRequest.resolveStatusCode ?? HttpStatus.OK, + statusCode: resolvedHttpRequest.resolveStatusCode ?? 200, }; return Promise.resolve(httpResult); } diff --git a/src/common/httpClient/testHttpClientHandler.ts b/src/common/httpClient/testHttpClientHandler.ts index bd3404f..a90a7b4 100644 --- a/src/common/httpClient/testHttpClientHandler.ts +++ b/src/common/httpClient/testHttpClientHandler.ts @@ -1,5 +1,4 @@ import { HttpMethod, QueryParams } from './models'; -import HttpStatus from 'http-status-enum'; interface BasicTestHttpRequest { method: HttpMethod; url: string; @@ -12,9 +11,9 @@ export interface ResolvedTestHttpRequest extends BasicTestHttpReq resolveTo: Dto; /** - * if empty resolves to HttpStatus.OK + * if empty resolves to HttpStatus 200/OK */ - resolveStatusCode?: HttpStatus; + resolveStatusCode?: number; } export interface RejectedTestHttpRequest extends BasicTestHttpRequest { diff --git a/src/common/index.ts b/src/common/index.ts index b7b49c8..b85c47e 100644 --- a/src/common/index.ts +++ b/src/common/index.ts @@ -1,5 +1,4 @@ export * from './httpClient'; -export * from './date/date-fns'; export * from './projectConstants'; export * from './utils'; export * from './logging'; diff --git a/src/fft-api/pickjob/fftPickJobService.ts b/src/fft-api/pickjob/fftPickJobService.ts index f211c9f..2db5472 100644 --- a/src/fft-api/pickjob/fftPickJobService.ts +++ b/src/fft-api/pickjob/fftPickJobService.ts @@ -1,4 +1,3 @@ -import { isDate } from 'date-fns'; import { AbstractModificationAction, PickJob, @@ -12,7 +11,7 @@ import { } from '../types'; import { FftApiClient, MAX_ARRAY_SIZE } from '../common'; import { ResponseError } from 'superagent'; -import { CustomLogger, QueryParams } from '../../common'; +import { isDate, CustomLogger, QueryParams } from '../../common'; import { Logger } from 'tslog'; export class FftPickJobService {