Bump dependencies versions

This commit is contained in:
fflorent
2024-03-30 11:39:08 +01:00
committed by jordigh
parent 513e13e6ab
commit f405ae715b
9 changed files with 31 additions and 29 deletions

View File

@@ -31,7 +31,7 @@ import { ActiveDoc, Deps as ActiveDocDeps } from "app/server/lib/ActiveDoc";
import { DEPS, sendForCompletion } from "app/server/lib/Assistance";
import log from 'app/server/lib/log';
import crypto from 'crypto';
import parse from 'csv-parse/lib/sync';
import { parse } from 'csv-parse/sync';
import fetch, {RequestInfo, RequestInit, Response} from 'node-fetch';
import * as fs from "fs";
import JSZip from "jszip";

View File

@@ -254,7 +254,7 @@ export class TestSession {
) {
const resp = await axios.get(`${this.home.getOwnUrl()}/test/session`,
{validateStatus: (s => s < 400), headers: this.headers});
const cookie = this.headers.Cookie || resp.headers['set-cookie'][0];
const cookie = this.headers.Cookie || resp.headers['set-cookie']![0];
const cid = decodeURIComponent(cookie.split('=')[1].split(';')[0]);
const sessionId = this.home.getSessions().getSessionIdFromCookie(cid);
const scopedSession = this.home.getSessions().getOrCreateSession(sessionId as string, org, '');

View File

@@ -21,7 +21,7 @@ export function configForUser(username: string): AxiosRequestConfig {
}
};
if (username !== 'Anonymous') {
config.headers.Authorization = 'Bearer api_key_for_' + username.toLowerCase();
config.headers!.Authorization = 'Bearer api_key_for_' + username.toLowerCase();
}
return config;
}

View File

@@ -166,7 +166,7 @@ export async function openClient(server: FlexServer, email: string, org: string,
const headers: Record<string, string> = {};
if (!emailHeader) {
const resp = await axios.get(`${server.getOwnUrl()}/test/session`);
const cookie = resp.headers['set-cookie'][0];
const cookie = resp.headers['set-cookie']![0];
if (email !== 'anon@getgrist.com') {
const cid = decodeURIComponent(cookie.split('=')[1].split(';')[0]);
const comm = server.getComm();

View File

@@ -1351,10 +1351,10 @@ function testDocApi() {
}
} else {
if (sort) {
config.headers['x-sort'] = sort.join(',');
config.headers!['x-sort'] = sort.join(',');
}
if (limit) {
config.headers['x-limit'] = String(limit);
config.headers!['x-limit'] = String(limit);
}
}
return axios.get(url.href, config);
@@ -4976,11 +4976,11 @@ function testDocApi() {
const chimpyConfig = configForUser("Chimpy");
const anonConfig = configForUser("Anonymous");
delete chimpyConfig.headers["X-Requested-With"];
delete anonConfig.headers["X-Requested-With"];
delete chimpyConfig.headers!["X-Requested-With"];
delete anonConfig.headers!["X-Requested-With"];
// Target a more realistic Host than "localhost:port"
anonConfig.headers.Host = chimpyConfig.headers.Host = 'api.example.com';
anonConfig.headers!.Host = chimpyConfig.headers!.Host = 'api.example.com';
const url = `${serverUrl}/api/docs/${docId}/tables/Table1/records`;
const data = { records: [{ fields: {} }] };
@@ -4989,7 +4989,7 @@ function testDocApi() {
const forbiddenOrigin = 'http://evil.com';
// Normal same origin requests
anonConfig.headers.Origin = allowedOrigin;
anonConfig.headers!.Origin = allowedOrigin;
let response: AxiosResponse;
for (response of [
await axios.post(url, data, anonConfig),
@@ -5005,7 +5005,7 @@ function testDocApi() {
// Cross origin requests from untrusted origin.
for (const config of [anonConfig, chimpyConfig]) {
config.headers.Origin = forbiddenOrigin;
config.headers!.Origin = forbiddenOrigin;
for (response of [
await axios.post(url, data, config),
await axios.get(url, config),