ftp-service
Advanced tools
Comparing version 6.0.3 to 6.0.4
@@ -0,1 +1,5 @@ | ||
## [6.0.4](https://github.com/nfroidure/ftp-service/compare/v6.0.3...v6.0.4) (2024-05-28) | ||
## [6.0.3](https://github.com/nfroidure/ftp-service/compare/v6.0.2...v6.0.3) (2023-11-09) | ||
@@ -2,0 +6,0 @@ |
@@ -8,4 +8,4 @@ /// <reference types="node" resolution-mode="require"/> | ||
export declare const DEFAULT_ENV: {}; | ||
export type FTPEnvVars<T extends string extends T ? never : string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME> = Partial<Record<T, string>>; | ||
export type FTPConfig<T extends string extends T ? never : string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME> = { | ||
export type FTPEnvVars<T extends string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME> = Partial<Record<T, string>>; | ||
export type FTPConfig<T extends string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME> = { | ||
FTP: NonNullable<Parameters<InstanceType<typeof FTPClient>['access']>[0]>; | ||
@@ -23,3 +23,3 @@ FTP_CONFIG: { | ||
}; | ||
export type FTPDependencies<T extends string extends T ? never : string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME> = FTPConfig<T> & { | ||
export type FTPDependencies<T extends string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME> = FTPConfig<T> & { | ||
ENV?: FTPEnvVars<T>; | ||
@@ -86,2 +86,2 @@ delay: DelayService; | ||
*/ | ||
declare function initFTPService<T extends string extends T ? never : string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME>({ FTP, FTP_CONFIG, FTP_POOL, FTP_TIMEOUT, FTP_PASSWORD_ENV_NAME, ENV, delay, log, }: FTPDependencies<T>): Promise<Provider<FTPService>>; | ||
declare function initFTPService<T extends string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME>({ FTP, FTP_CONFIG, FTP_POOL, FTP_TIMEOUT, FTP_PASSWORD_ENV_NAME, ENV, delay, log, }: FTPDependencies<T>): Promise<Provider<FTPService>>; |
import { describe, test, beforeEach, jest, expect } from '@jest/globals'; | ||
import initFTPService from './index.js'; | ||
import { initDelayService } from 'common-services'; | ||
import { initDelay } from 'common-services'; | ||
import { unlink, existsSync, writeFile } from 'fs'; | ||
@@ -29,3 +29,3 @@ import path from 'path'; | ||
test('should init well', async () => { | ||
const delay = (await initDelayService({})).service; | ||
const delay = (await initDelay({})).service; | ||
const ftp = await initFTPService({ | ||
@@ -48,3 +48,3 @@ ...CONFIG, | ||
test('should list files', async () => { | ||
const delay = (await initDelayService({})).service; | ||
const delay = (await initDelay({})).service; | ||
const { service: ftp, dispose } = await initFTPService({ | ||
@@ -91,3 +91,3 @@ ...CONFIG, | ||
test('should retrieve files', async () => { | ||
const delay = (await initDelayService({})).service; | ||
const delay = (await initDelay({})).service; | ||
const { service: ftp, dispose } = await initFTPService({ | ||
@@ -140,3 +140,3 @@ ...{ | ||
test('should send files', async () => { | ||
const delay = (await initDelayService({})).service; | ||
const delay = (await initDelay({})).service; | ||
const { service: ftp, dispose } = await initFTPService({ | ||
@@ -203,3 +203,3 @@ ...CONFIG, | ||
test('should delete files', async () => { | ||
const delay = (await initDelayService({})).service; | ||
const delay = (await initDelay({})).service; | ||
const { service: ftp, dispose } = await initFTPService({ | ||
@@ -206,0 +206,0 @@ ...CONFIG, |
@@ -29,3 +29,3 @@ { | ||
"name": "ftp-service", | ||
"version": "6.0.3", | ||
"version": "6.0.4", | ||
"type": "module", | ||
@@ -41,5 +41,5 @@ "description": "A simple wrapper for a simpler FTP client surface API with pool and retry management.", | ||
"cover": "npm run jest -- --coverage", | ||
"coveralls": "npm run cover && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage", | ||
"cz": "env NODE_ENV=${NODE_ENV:-cli} git cz", | ||
"doc": "echo \"# API\" > API.md; jsdoc2md 'dist/**/*.js' >> API.md && git add API.md", | ||
"format": "npm run prettier", | ||
"jest": "NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest", | ||
@@ -75,34 +75,33 @@ "lint": "eslint 'src/**/*.ts'", | ||
"dependencies": { | ||
"basic-ftp": "^5.0.3", | ||
"common-services": "^15.0.0", | ||
"basic-ftp": "^5.0.5", | ||
"common-services": "^16.0.3", | ||
"generic-pool": "^3.9.0", | ||
"knifecycle": "^17.0.1", | ||
"knifecycle": "^17.0.2", | ||
"yerror": "^8.0.0" | ||
}, | ||
"devDependencies": { | ||
"@swc/cli": "^0.1.62", | ||
"@swc/core": "^1.3.94", | ||
"@swc/helpers": "^0.5.3", | ||
"@swc/jest": "^0.2.29", | ||
"@typescript-eslint/eslint-plugin": "^6.8.0", | ||
"@typescript-eslint/parser": "^6.8.0", | ||
"@swc/cli": "^0.3.12", | ||
"@swc/core": "^1.5.7", | ||
"@swc/helpers": "^0.5.11", | ||
"@swc/jest": "^0.2.36", | ||
"@typescript-eslint/eslint-plugin": "^7.10.0", | ||
"@typescript-eslint/parser": "^7.10.0", | ||
"commitizen": "^4.3.0", | ||
"conventional-changelog-cli": "^4.1.0", | ||
"coveralls": "^3.1.1", | ||
"conventional-changelog-cli": "^5.0.0", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"eslint": "^8.52.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^8.10.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"jest": "^29.7.0", | ||
"jsarch": "^6.0.3", | ||
"jsdoc-to-markdown": "^8.0.0", | ||
"metapak": "^5.1.7", | ||
"metapak-nfroidure": "15.0.4", | ||
"prettier": "^3.0.3", | ||
"rimraf": "^5.0.5", | ||
"typescript": "^5.2.2" | ||
"metapak": "^6.0.0", | ||
"metapak-nfroidure": "18.1.0", | ||
"prettier": "^3.2.5", | ||
"rimraf": "^5.0.7", | ||
"typescript": "^5.4.5" | ||
}, | ||
"contributors": [], | ||
"engines": { | ||
"node": ">=18.16.0" | ||
"node": ">=20.11.1" | ||
}, | ||
@@ -131,3 +130,2 @@ "config": { | ||
"jest", | ||
"coveralls", | ||
"@swc/jest", | ||
@@ -134,0 +132,0 @@ "jsdoc-to-markdown", |
@@ -11,3 +11,2 @@ [//]: # ( ) | ||
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nfroidure/ftp-service/blob/main/LICENSE) | ||
[![Coverage Status](https://coveralls.io/repos/github/nfroidure/ftp-service/badge.svg?branch=main)](https://coveralls.io/github/nfroidure/ftp-service?branch=main) | ||
@@ -14,0 +13,0 @@ |
import { describe, test, beforeEach, jest, expect } from '@jest/globals'; | ||
import initFTPService from './index.js'; | ||
import { initDelayService } from 'common-services'; | ||
import { initDelay } from 'common-services'; | ||
import { unlink, existsSync, writeFile } from 'fs'; | ||
@@ -33,3 +33,3 @@ import path from 'path'; | ||
test('should init well', async () => { | ||
const delay = (await initDelayService({})).service; | ||
const delay = (await initDelay({})).service; | ||
const ftp = await initFTPService({ | ||
@@ -55,3 +55,3 @@ ...CONFIG, | ||
test('should list files', async () => { | ||
const delay = (await initDelayService({})).service; | ||
const delay = (await initDelay({})).service; | ||
const { service: ftp, dispose } = await initFTPService({ | ||
@@ -102,3 +102,3 @@ ...CONFIG, | ||
test('should retrieve files', async () => { | ||
const delay = (await initDelayService({})).service; | ||
const delay = (await initDelay({})).service; | ||
const { service: ftp, dispose } = await initFTPService({ | ||
@@ -155,3 +155,3 @@ ...{ | ||
test('should send files', async () => { | ||
const delay = (await initDelayService({})).service; | ||
const delay = (await initDelay({})).service; | ||
const { service: ftp, dispose } = await initFTPService({ | ||
@@ -225,3 +225,3 @@ ...CONFIG, | ||
test('should delete files', async () => { | ||
const delay = (await initDelayService({})).service; | ||
const delay = (await initDelay({})).service; | ||
const { service: ftp, dispose } = await initFTPService({ | ||
@@ -228,0 +228,0 @@ ...CONFIG, |
@@ -20,28 +20,21 @@ import path from 'path'; | ||
export type FTPEnvVars< | ||
T extends string extends T | ||
? never | ||
: string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME, | ||
T extends string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME, | ||
> = Partial<Record<T, string>>; | ||
export type FTPConfig< | ||
T extends string extends T | ||
? never | ||
: string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME, | ||
> = { | ||
FTP: NonNullable<Parameters<InstanceType<typeof FTPClient>['access']>[0]>; | ||
FTP_CONFIG: { | ||
base: string; | ||
retry?: { | ||
delay: number; | ||
attempts: number; | ||
export type FTPConfig<T extends string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME> = | ||
{ | ||
FTP: NonNullable<Parameters<InstanceType<typeof FTPClient>['access']>[0]>; | ||
FTP_CONFIG: { | ||
base: string; | ||
retry?: { | ||
delay: number; | ||
attempts: number; | ||
}; | ||
}; | ||
FTP_POOL?: Parameters<typeof createPool>[1]; | ||
FTP_TIMEOUT?: ConstructorParameters<typeof FTPClient>[0]; | ||
FTP_PASSWORD_ENV_NAME?: T; | ||
}; | ||
FTP_POOL?: Parameters<typeof createPool>[1]; | ||
FTP_TIMEOUT?: ConstructorParameters<typeof FTPClient>[0]; | ||
FTP_PASSWORD_ENV_NAME?: T; | ||
}; | ||
export type FTPDependencies< | ||
T extends string extends T | ||
? never | ||
: string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME, | ||
T extends string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME, | ||
> = FTPConfig<T> & { | ||
@@ -136,5 +129,3 @@ ENV?: FTPEnvVars<T>; | ||
async function initFTPService< | ||
T extends string extends T | ||
? never | ||
: string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME, | ||
T extends string = typeof DEFAULT_FTP_PASSWORD_ENV_NAME, | ||
>({ | ||
@@ -141,0 +132,0 @@ FTP, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
20
60343
1234
68
+ Added@types/node@20.14.9(transitive)
+ Addedcommon-services@16.0.3(transitive)
- Removed@types/node@18.19.39(transitive)
- Removedcommon-services@15.1.0(transitive)
Updatedbasic-ftp@^5.0.5
Updatedcommon-services@^16.0.3
Updatedknifecycle@^17.0.2