Bump dependencies versions

pull/957/head
fflorent 2 months ago committed by jordigh
parent 513e13e6ab
commit f405ae715b

@ -6,6 +6,7 @@ import {AppModel, reportError} from 'app/client/models/AppModel';
import {IProgress} from 'app/client/models/NotifyModel'; import {IProgress} from 'app/client/models/NotifyModel';
import {openFilePicker} from 'app/client/ui/FileDialog'; import {openFilePicker} from 'app/client/ui/FileDialog';
import {byteString} from 'app/common/gutil'; import {byteString} from 'app/common/gutil';
import { AxiosProgressEvent } from 'axios';
import {Disposable} from 'grainjs'; import {Disposable} from 'grainjs';
/** /**
@ -39,9 +40,9 @@ export async function fileImport(
const timezone = await guessTimezone(); const timezone = await guessTimezone();
if (workspaceId === "unsaved") { if (workspaceId === "unsaved") {
function onUploadProgress(ev: ProgressEvent) { function onUploadProgress(ev: AxiosProgressEvent) {
if (ev.lengthComputable) { if (ev.event.lengthComputable) {
progress.setUploadProgress(ev.loaded / ev.total * 100); // percentage complete progress.setUploadProgress(ev.event.loaded / ev.event.total * 100); // percentage complete
} }
} }
return await app.api.importUnsavedDoc(files[0], {timezone, onUploadProgress}); return await app.api.importUnsavedDoc(files[0], {timezone, onUploadProgress});

@ -22,6 +22,7 @@ import {
WebhookUpdate WebhookUpdate
} from 'app/common/Triggers'; } from 'app/common/Triggers';
import {addCurrentOrgToPath, getGristConfig} from 'app/common/urlUtils'; import {addCurrentOrgToPath, getGristConfig} from 'app/common/urlUtils';
import { AxiosProgressEvent } from 'axios';
import omitBy from 'lodash/omitBy'; import omitBy from 'lodash/omitBy';
@ -405,7 +406,7 @@ export interface UserAPI {
importUnsavedDoc(material: UploadType, options?: { importUnsavedDoc(material: UploadType, options?: {
filename?: string, filename?: string,
timezone?: string, timezone?: string,
onUploadProgress?: (ev: ProgressEvent) => void, onUploadProgress?: (ev: AxiosProgressEvent) => void,
}): Promise<string>; }): Promise<string>;
deleteUser(userId: number, name: string): Promise<void>; deleteUser(userId: number, name: string): Promise<void>;
getBaseUrl(): string; // Get the prefix for all the endpoints this object wraps. getBaseUrl(): string; // Get the prefix for all the endpoints this object wraps.
@ -816,7 +817,7 @@ export class UserAPIImpl extends BaseAPI implements UserAPI {
public async importUnsavedDoc(material: UploadType, options?: { public async importUnsavedDoc(material: UploadType, options?: {
filename?: string, filename?: string,
timezone?: string, timezone?: string,
onUploadProgress?: (ev: ProgressEvent) => void, onUploadProgress?: (ev: AxiosProgressEvent) => void,
}): Promise<string> { }): Promise<string> {
options = options || {}; options = options || {};
const formData = this.newFormData(); const formData = this.newFormData();

@ -7,7 +7,7 @@ import * as minio from 'minio';
// The minio typings appear to be quite stale. Extend them here to avoid // The minio typings appear to be quite stale. Extend them here to avoid
// lots of casts to any. // lots of casts to any.
type MinIOClient = minio.Client & { export type MinIOClient = minio.Client & {
statObject(bucket: string, key: string, options: {versionId?: string}): Promise<MinIOBucketItemStat>; statObject(bucket: string, key: string, options: {versionId?: string}): Promise<MinIOBucketItemStat>;
getObject(bucket: string, key: string, options: {versionId?: string}): Promise<IncomingMessage>; getObject(bucket: string, key: string, options: {versionId?: string}): Promise<IncomingMessage>;
listObjects(bucket: string, key: string, recursive: boolean, listObjects(bucket: string, key: string, recursive: boolean,
@ -132,7 +132,7 @@ export class MinIOExternalStorage implements ExternalStorage {
v.lastModified && (v as any).versionId && v.lastModified && (v as any).versionId &&
(options?.includeDeleteMarkers || !(v as any).isDeleteMarker)) (options?.includeDeleteMarkers || !(v as any).isDeleteMarker))
.map(v => ({ .map(v => ({
lastModified: v.lastModified.toISOString(), lastModified: v.lastModified!.toISOString(),
// Circumvent inconsistency of MinIO API with versionId by casting it to string // Circumvent inconsistency of MinIO API with versionId by casting it to string
// PR to MinIO so we don't have to do that anymore: // PR to MinIO so we don't have to do that anymore:
// https://github.com/minio/minio-js/pull/1193 // https://github.com/minio/minio-js/pull/1193

@ -94,7 +94,7 @@
"esbuild-loader": "2.19.0", "esbuild-loader": "2.19.0",
"eslint": "8.18.0", "eslint": "8.18.0",
"http-proxy": "1.18.1", "http-proxy": "1.18.1",
"i18next-scanner": "4.1.0", "i18next-scanner": "^4.4.0",
"mocha": "10.2.0", "mocha": "10.2.0",
"mocha-webdriver": "0.3.2", "mocha-webdriver": "0.3.2",
"moment-locales-webpack-plugin": "^1.2.0", "moment-locales-webpack-plugin": "^1.2.0",
@ -106,7 +106,7 @@
"tmp-promise": "1.0.5", "tmp-promise": "1.0.5",
"ts-interface-builder": "0.3.2", "ts-interface-builder": "0.3.2",
"typescript": "4.7.4", "typescript": "4.7.4",
"webpack": "5.73.0", "webpack": "^5.91.0",
"webpack-cli": "4.10.0", "webpack-cli": "4.10.0",
"why-is-node-running": "2.0.3" "why-is-node-running": "2.0.3"
}, },
@ -123,19 +123,19 @@
"accept-language-parser": "1.5.0", "accept-language-parser": "1.5.0",
"ace-builds": "1.23.3", "ace-builds": "1.23.3",
"async-mutex": "0.2.4", "async-mutex": "0.2.4",
"axios": "0.21.2", "axios": "^1.6.8",
"backbone": "1.3.3", "backbone": "1.3.3",
"bootstrap": "3.3.5", "bootstrap": "^3.4.1",
"bootstrap-datepicker": "1.9.0", "bootstrap-datepicker": "1.9.0",
"bowser": "2.7.0", "bowser": "2.7.0",
"collect-js-deps": "^0.1.1", "collect-js-deps": "^0.1.1",
"color-convert": "2.0.1", "color-convert": "2.0.1",
"commander": "9.3.0", "commander": "9.3.0",
"components-jqueryui": "1.12.1", "components-jqueryui": "1.12.1",
"connect-redis": "3.4.0", "connect-redis": "^3.4.0",
"cookie": "0.5.0", "cookie": "0.5.0",
"cookie-parser": "1.4.3", "cookie-parser": "1.4.3",
"csv": "4.0.0", "csv": "^6.3.8",
"currency-symbol-map": "5.1.0", "currency-symbol-map": "5.1.0",
"diff-match-patch": "1.0.5", "diff-match-patch": "1.0.5",
"dompurify": "3.0.6", "dompurify": "3.0.6",
@ -143,7 +143,7 @@
"engine.io": "^6.5.4", "engine.io": "^6.5.4",
"engine.io-client": "^6.5.3", "engine.io-client": "^6.5.3",
"exceljs": "4.2.1", "exceljs": "4.2.1",
"express": "4.18.2", "express": "^4.19.2",
"file-type": "16.5.4", "file-type": "16.5.4",
"fs-extra": "7.0.0", "fs-extra": "7.0.0",
"grain-rpc": "0.1.7", "grain-rpc": "0.1.7",
@ -160,12 +160,12 @@
"js-yaml": "3.14.1", "js-yaml": "3.14.1",
"jsdom": "^23.0.0", "jsdom": "^23.0.0",
"jsesc": "3.0.2", "jsesc": "3.0.2",
"jsonwebtoken": "8.3.0", "jsonwebtoken": "^9.0.2",
"knockout": "3.5.0", "knockout": "3.5.0",
"locale-currency": "0.0.2", "locale-currency": "0.0.2",
"lodash": "4.17.21", "lodash": "4.17.21",
"marked": "4.2.12", "marked": "4.2.12",
"minio": "7.0.32", "minio": "^7.1.3",
"moment": "2.29.4", "moment": "2.29.4",
"moment-timezone": "0.5.35", "moment-timezone": "0.5.35",
"morgan": "1.9.1", "morgan": "1.9.1",
@ -184,13 +184,13 @@
"randomcolor": "0.5.3", "randomcolor": "0.5.3",
"redis": "3.1.1", "redis": "3.1.1",
"redlock": "3.1.2", "redlock": "3.1.2",
"saml2-js": "2.0.5", "saml2-js": "^4.0.2",
"short-uuid": "3.1.1", "short-uuid": "3.1.1",
"slugify": "1.6.6", "slugify": "1.6.6",
"swagger-ui-dist": "5.11.0", "swagger-ui-dist": "5.11.0",
"tmp": "0.0.33", "tmp": "0.0.33",
"ts-interface-checker": "1.0.2", "ts-interface-checker": "1.0.2",
"typeorm": "0.3.9", "typeorm": "^0.3.20",
"underscore": "1.12.1", "underscore": "1.12.1",
"uuid": "3.3.2", "uuid": "3.3.2",
"winston": "2.4.5", "winston": "2.4.5",

@ -31,7 +31,7 @@ import { ActiveDoc, Deps as ActiveDocDeps } from "app/server/lib/ActiveDoc";
import { DEPS, sendForCompletion } from "app/server/lib/Assistance"; import { DEPS, sendForCompletion } from "app/server/lib/Assistance";
import log from 'app/server/lib/log'; import log from 'app/server/lib/log';
import crypto from 'crypto'; 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 fetch, {RequestInfo, RequestInit, Response} from 'node-fetch';
import * as fs from "fs"; import * as fs from "fs";
import JSZip from "jszip"; import JSZip from "jszip";

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

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

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

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

Loading…
Cancel
Save