mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader.git
synced 2025-06-03 10:44:10 +08:00
bump: deps
This commit is contained in:
parent
c72e0d3f17
commit
6ccf56bf99
14
package-lock.json
generated
14
package-lock.json
generated
@ -47,7 +47,7 @@
|
|||||||
"tld-extract": "^2.1.0",
|
"tld-extract": "^2.1.0",
|
||||||
"turndown": "^7.1.3",
|
"turndown": "^7.1.3",
|
||||||
"turndown-plugin-gfm": "^1.0.2",
|
"turndown-plugin-gfm": "^1.0.2",
|
||||||
"undici": "^5.24.0"
|
"undici": "^7.8.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/archiver": "^5.3.4",
|
"@types/archiver": "^5.3.4",
|
||||||
@ -12500,14 +12500,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici": {
|
"node_modules/undici": {
|
||||||
"version": "5.28.4",
|
"version": "7.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz",
|
"resolved": "https://registry.npmjs.org/undici/-/undici-7.8.0.tgz",
|
||||||
"integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==",
|
"integrity": "sha512-vFv1GA99b7eKO1HG/4RPu2Is3FBTWBrmzqzO0mz+rLxN3yXkE4mqRcb8g8fHxzX4blEysrNZLqg5RbJLqX5buA==",
|
||||||
"dependencies": {
|
"license": "MIT",
|
||||||
"@fastify/busboy": "^2.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0"
|
"node": ">=20.18.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
"node_modules/undici-types": {
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
"tld-extract": "^2.1.0",
|
"tld-extract": "^2.1.0",
|
||||||
"turndown": "^7.1.3",
|
"turndown": "^7.1.3",
|
||||||
"turndown-plugin-gfm": "^1.0.2",
|
"turndown-plugin-gfm": "^1.0.2",
|
||||||
"undici": "^5.24.0"
|
"undici": "^7.8.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/archiver": "^5.3.4",
|
"@types/archiver": "^5.3.4",
|
||||||
|
@ -32,6 +32,7 @@ import {
|
|||||||
import { toAsyncGenerator } from '../utils/misc';
|
import { toAsyncGenerator } from '../utils/misc';
|
||||||
import type { JinaEmbeddingsTokenAccount } from '../shared/db/jina-embeddings-token-account';
|
import type { JinaEmbeddingsTokenAccount } from '../shared/db/jina-embeddings-token-account';
|
||||||
import { LRUCache } from 'lru-cache';
|
import { LRUCache } from 'lru-cache';
|
||||||
|
import { API_CALL_STATUS } from '../shared/db/api-roll';
|
||||||
|
|
||||||
const WORLD_COUNTRY_CODES = Object.keys(WORLD_COUNTRIES).map((x) => x.toLowerCase());
|
const WORLD_COUNTRY_CODES = Object.keys(WORLD_COUNTRIES).map((x) => x.toLowerCase());
|
||||||
|
|
||||||
@ -256,8 +257,20 @@ export class SearcherHost extends RPCHost {
|
|||||||
auth.reportUsage(chargeAmount, `reader-${rpcReflect.name}`).catch((err) => {
|
auth.reportUsage(chargeAmount, `reader-${rpcReflect.name}`).catch((err) => {
|
||||||
this.logger.warn(`Unable to report usage for ${uid}`, { err: marshalErrorLike(err) });
|
this.logger.warn(`Unable to report usage for ${uid}`, { err: marshalErrorLike(err) });
|
||||||
});
|
});
|
||||||
const apiRoll = await apiRollPromise;
|
try {
|
||||||
apiRoll.chargeAmount = chargeAmount;
|
const apiRoll = await apiRollPromise;
|
||||||
|
apiRoll.chargeAmount = chargeAmount;
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
await this.rateLimitControl.record({
|
||||||
|
uid,
|
||||||
|
tags: [rpcReflect.name.toUpperCase()],
|
||||||
|
status: API_CALL_STATUS.SUCCESS,
|
||||||
|
chargeAmount,
|
||||||
|
}).save().catch((err) => {
|
||||||
|
this.logger.warn(`Failed to save rate limit record`, { err: marshalErrorLike(err) });
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ import { SERPResult } from '../db/searched';
|
|||||||
import { SerperBingSearchService, SerperGoogleSearchService } from '../services/serp/serper';
|
import { SerperBingSearchService, SerperGoogleSearchService } from '../services/serp/serper';
|
||||||
import type { JinaEmbeddingsTokenAccount } from '../shared/db/jina-embeddings-token-account';
|
import type { JinaEmbeddingsTokenAccount } from '../shared/db/jina-embeddings-token-account';
|
||||||
import { LRUCache } from 'lru-cache';
|
import { LRUCache } from 'lru-cache';
|
||||||
|
import { API_CALL_STATUS } from '../shared/db/api-roll';
|
||||||
|
|
||||||
const WORLD_COUNTRY_CODES = Object.keys(WORLD_COUNTRIES).map((x) => x.toLowerCase());
|
const WORLD_COUNTRY_CODES = Object.keys(WORLD_COUNTRIES).map((x) => x.toLowerCase());
|
||||||
|
|
||||||
@ -261,8 +262,19 @@ export class SerpHost extends RPCHost {
|
|||||||
auth.reportUsage(chargeAmount, `reader-search`).catch((err) => {
|
auth.reportUsage(chargeAmount, `reader-search`).catch((err) => {
|
||||||
this.logger.warn(`Unable to report usage for ${uid}`, { err: marshalErrorLike(err) });
|
this.logger.warn(`Unable to report usage for ${uid}`, { err: marshalErrorLike(err) });
|
||||||
});
|
});
|
||||||
const apiRoll = await apiRollPromise;
|
try {
|
||||||
apiRoll.chargeAmount = chargeAmount;
|
const apiRoll = await apiRollPromise;
|
||||||
|
apiRoll.chargeAmount = chargeAmount;
|
||||||
|
} catch (err) {
|
||||||
|
await this.rateLimitControl.record({
|
||||||
|
uid,
|
||||||
|
tags: [rpcReflect.name.toUpperCase()],
|
||||||
|
status: API_CALL_STATUS.SUCCESS,
|
||||||
|
chargeAmount,
|
||||||
|
}).save().catch((err) => {
|
||||||
|
this.logger.warn(`Failed to save rate limit record`, { err: marshalErrorLike(err) });
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 9a32fc38abea6f42fe8f5bec452ccba0d1d0089d
|
Subproject commit f89255cd6546641f72eefba140a4aef96a0e03fc
|
Loading…
x
Reference in New Issue
Block a user