Skip to content

Commit

Permalink
Build: release shotit-api v0.9.13 (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leslie-Wong-H authored Sep 14, 2024
2 parents cedbb9e + e724da6 commit 9980894
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/shotit/shotit-api/docker-image.yml?style=flat-square)](https://github.com/shotit/shotit-api/actions)
[![Codecov](https://img.shields.io/codecov/c/github/shotit/shotit-api?style=flat-square&token=8C25WLSEDJ)](https://codecov.io/gh/shotit/shotit-api)
[![Docker](https://img.shields.io/docker/pulls/lesliewong007/shotit-api?style=flat-square)](https://hub.docker.com/r/lesliewong007/shotit-api)
[![Docker Image Size](https://img.shields.io/docker/image-size/lesliewong007/shotit-api/v0.9.12?style=flat-square)](https://hub.docker.com/r/lesliewong007/shotit-api)
[![Docker Image Size](https://img.shields.io/docker/image-size/lesliewong007/shotit-api/v0.9.13?style=flat-square)](https://hub.docker.com/r/lesliewong007/shotit-api)

The ultimate brain of [shotit](https://github.com/shotit/shotit), in charge of task coordination.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shotit-api",
"version": "0.9.12",
"version": "0.9.13",
"description": "The ultimate brain of shotit, in charge of task coordination",
"main": "server.js",
"type": "module",
Expand Down
7 changes: 7 additions & 0 deletions src/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import https from "node:https";
import cv from "@soruly/opencv4nodejs-prebuilt";
import { performance } from "perf_hooks";
import { publicIpv6 } from "public-ip";

// import getSolrCoreList from "./lib/get-solr-core-list.js";

// const { TRACE_MEDIA_URL, TRACE_MEDIA_SALT, TRACE_ACCURACY = 1 } = process.env;
Expand Down Expand Up @@ -209,6 +210,12 @@ export default async (req, res) => {
searchFile = req.files[0].buffer;
} else if (req.rawBody?.length) {
searchFile = req.rawBody;
} else if (req.method === "HEAD") {
await logAndDequeue(knex, redis, uid, priority, 204);
// Note: the client side can not recive the json object because of HEAD
return res.status(204).json({
error: "HEAD method acknowledged",
});
} else {
await logAndDequeue(knex, redis, uid, priority, 405);
return res.status(405).json({
Expand Down
8 changes: 8 additions & 0 deletions src/search.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,14 @@ describe("invalid input", () => {
},
1000 * 10
);
test(
"/search only by HEAD",
async () => {
const response = await request(app).head("/search");
expect(response.statusCode).toBe(204);
},
1000 * 10
);
});

describe.each([
Expand Down
2 changes: 1 addition & 1 deletion src/user/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ describe("Create user with valid system API key", () => {
expect(response.statusCode).toBe(200);
expect(response.headers["content-type"]).toMatch(/^application\/json/);
expect(typeof response.body).toBe("object");
}, 10000);
}, 20000);
});
38 changes: 38 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
# yarn lockfile v1


"@actions/core@^1.10.1":
version "1.10.1"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.1.tgz#61108e7ac40acae95ee36da074fa5850ca4ced8a"
integrity sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==
dependencies:
"@actions/http-client" "^2.0.1"
uuid "^8.3.2"

"@actions/http-client@^2.0.1":
version "2.2.3"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.2.3.tgz#31fc0b25c0e665754ed39a9f19a8611fc6dab674"
integrity sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==
dependencies:
tunnel "^0.0.6"
undici "^5.25.4"

"@ampproject/remapping@^2.2.0":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630"
Expand Down Expand Up @@ -313,6 +329,11 @@
enabled "2.0.x"
kuler "^2.0.0"

"@fastify/busboy@^2.0.0":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d"
integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==

"@grpc/grpc-js@^1.8.17":
version "1.8.17"
resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.8.17.tgz#a3a2f826fc033eae7d2f5ee41e0ab39cee948838"
Expand Down Expand Up @@ -3598,6 +3619,11 @@ tunnel-agent@^0.6.0:
dependencies:
safe-buffer "^5.0.1"

tunnel@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==

[email protected]:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
Expand All @@ -3621,6 +3647,13 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==

undici@^5.25.4:
version "5.28.4"
resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068"
integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==
dependencies:
"@fastify/busboy" "^2.0.0"

universalify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
Expand Down Expand Up @@ -3649,6 +3682,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==

uuid@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==

v8-to-istanbul@^9.0.1:
version "9.1.0"
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz#1b83ed4e397f58c85c266a570fc2558b5feb9265"
Expand Down

0 comments on commit 9980894

Please sign in to comment.