Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/pretty-plants-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@hhmi/pmc-ftp-service': patch
'@hhmi/pmc': patch
---

Posting to latest Curvenote task runner utilities
5 changes: 5 additions & 0 deletions .changeset/red-lemons-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hhmi/pmc': patch
---

Aligning to latest `@curvenote/common`
5 changes: 5 additions & 0 deletions .changeset/seven-taxis-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hhmi/pmc-ftp-service': minor
---

Updating to use the latest scms-tasks support functions
12 changes: 12 additions & 0 deletions packages/pmc-ftp-service/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
root: true,
extends: ['../../.eslintrc.cjs'],
overrides: [
{
files: ['**/*.spec.ts', '**/*.test.ts'],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
],
};
37 changes: 37 additions & 0 deletions packages/pmc-ftp-service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# pmc-ftp-service

## 0.3.1

### Patch Changes

- Updated dependencies [[`46958c8bb1d5c440d6db03d75887d33e84d83468`](https://github.com/curvenote/pmc-utils/commit/46958c8bb1d5c440d6db03d75887d33e84d83468)]:
- pmc-node-utils@0.3.1
- pmc-utils@0.3.1

## 0.3.0

### Minor Changes

- [#12](https://github.com/curvenote/pmc-utils/pull/12) [`dba0d2050326eca9e68cc905aec127f9f1289079`](https://github.com/curvenote/pmc-utils/commit/dba0d2050326eca9e68cc905aec127f9f1289079) Thanks [@stevejpurves](https://github.com/stevejpurves)! - Journal title is now a required field in the AMM Manifest

### Patch Changes

- [#11](https://github.com/curvenote/pmc-utils/pull/11) [`69e196862a981205375b5ed5f4fa5619bec25b05`](https://github.com/curvenote/pmc-utils/commit/69e196862a981205375b5ed5f4fa5619bec25b05) Thanks [@stevejpurves](https://github.com/stevejpurves)! - Fix file encoading issue and stream file downloads for large file support.

- Updated dependencies [[`dba0d2050326eca9e68cc905aec127f9f1289079`](https://github.com/curvenote/pmc-utils/commit/dba0d2050326eca9e68cc905aec127f9f1289079), [`5e2005b62c2fe8d837376e6128057d6d148ca347`](https://github.com/curvenote/pmc-utils/commit/5e2005b62c2fe8d837376e6128057d6d148ca347)]:
- pmc-node-utils@0.3.0
- pmc-utils@0.3.0

## 0.2.0

### Minor Changes

- 47c19cf: Changed package names, interdependencies and added READMEs

### Patch Changes

- eaeaaf5: Added logging and some concurrency control over file downloads.
- Updated dependencies [47c19cf]
- Updated dependencies [89d87ca]
- pmc-node-utils@0.2.0
- pmc-utils@0.2.0
7 changes: 7 additions & 0 deletions packages/pmc-ftp-service/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2024-present Howard Hughes Medical Institute.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
65 changes: 65 additions & 0 deletions packages/pmc-ftp-service/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "@hhmi/pmc-ftp-service",
"version": "0.3.1",
"description": "Nodejs server for the PMC FTP submit service",
"type": "module",
"exports": "./dist/index.js",
"types": "./dist/index.d.ts",
"private": true,
"publishConfig": {
"access": "restricted"
},
"files": [
"dist"
],
"scripts": {
"gcp-build": "npm run build",
"clean": "rm -rf dist",
"build": "esbuild src/index.ts --outfile=dist/index.js --bundle --platform=node --external:fsevents --loader:.node=copy",
"build:watch": "esbuild src/index.ts --outfile=dist/index.js --bundle --platform=node --watch --external:fsevents",
"start": "node ./dist/index.js",
"dev": "npm run clean; npm run build; NODE_ENV=development concurrently \"npm run build:watch\" \"nodemon\"",
"lint": "eslint \"src/**/*.ts\" -c ./.eslintrc.cjs",
"lint:format": "npx prettier --check \"src/**/*.ts\"",
"test": "vitest run",
"test:watch": "vitest watch",
"test:launch": "ts-node bin/launch.ts",
"test:publish": "ts-node bin/publish.ts"
},
"dependencies": {
"@curvenote/scms-tasks": "^0.14.3",
"pmc-node-utils": "^0.3.1",
"pmc-utils": "^0.3.1",
"express": "^4.18.1",
"node-fetch": "^3.3.2",
"p-limit": "^6.2.0",
"ssh2-sftp-client": "^12.0.0",
"tar": "^7.4.3"
},
"devDependencies": {
"@types/express": "^4.17.13",
"@types/js-yaml": "^4.0.5",
"@types/node": "^22.9.0",
"@types/ssh2-sftp-client": "^9.0.4",
"dotenv": "^16.0.1",
"esbuild": "^0.15.10",
"eslint": "^8.21.0",
"typescript": "^5.1.3",
"vitest": "^1.2.2"
},
"nodemonConfig": {
"signal": "SIGHUP",
"ignore": [
"**/*.test.ts",
"**/*.spec.ts",
".git",
"node_modules"
],
"watch": [
"dist/index.js"
],
"exec": "node ./dist/index.js",
"ext": "ts,yaml,json",
"delay": "500"
}
}
8 changes: 8 additions & 0 deletions packages/pmc-ftp-service/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { createService } from './service.js';

const service = createService();

const port = process.env.PORT || 8080;
service.listen(port, () => {
console.info(`pmc-ftp-server: listening on port ${port}`);
});
32 changes: 32 additions & 0 deletions packages/pmc-ftp-service/src/service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { describe, it, expect } from 'vitest';
import { createService } from './service.js';

describe('FTP Service', () => {
it('should create a service instance', () => {
const service = createService();
expect(service).toBeDefined();
expect(typeof service.get).toBe('function');
expect(typeof service.post).toBe('function');
});

it('should have a health check endpoint', () => {
const service = createService();

// Mock the response object
const mockRes = {
sendStatus: (status: number) => {
expect(status).toBe(200);
return mockRes;
},
};

// This is a simple test to verify the service structure
// In a real test, we'd use supertest or similar to test the actual endpoint
expect(service).toBeDefined();
});

it('should be ready for more comprehensive tests', () => {
// Placeholder test to ensure the test suite is working
expect(true).toBe(true);
});
});
Loading