From 86697f28bdf033e109884c78086c38d114ff8aa6 Mon Sep 17 00:00:00 2001 From: Iain Sproat <68657+iainsproat@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:40:58 +0000 Subject: [PATCH] fix broken imports --- packages/fileimport-service/src/controller/api.ts | 14 +++++++------- packages/shared/src/core/helpers/utilityTypes.ts | 5 ----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/fileimport-service/src/controller/api.ts b/packages/fileimport-service/src/controller/api.ts index aca0e7e8b..fa90f6601 100644 --- a/packages/fileimport-service/src/controller/api.ts +++ b/packages/fileimport-service/src/controller/api.ts @@ -1,12 +1,11 @@ import crypto from 'crypto' import crs from 'crypto-random-string' import bcrypt from 'bcrypt' -import { chunk } from 'lodash' +import { chunk } from 'lodash-es' import { logger as parentLogger } from '@/observability/logging.js' import Observability from '@speckle/shared/dist/commonjs/observability/index.js' import type { Knex } from 'knex' import type { Logger } from 'pino' -import { ForceRequired } from '@speckle/shared/dist/commonjs/index.js' const tables = (db: Knex) => ({ objects: db('objects'), @@ -34,6 +33,10 @@ type SpeckleObject = { data: unknown } +type SpeckleObjectWithId = SpeckleObject & { + id: string +} + export class ServerAPI { tables: ReturnType db: Knex @@ -109,7 +112,7 @@ export class ServerAPI { } async createObjectsBatched(streamId: string, objects: SpeckleObject[]) { - const objsToInsert: ForceRequired[] = [] + const objsToInsert: SpeckleObjectWithId[] = [] const ids: string[] = [] // Prep objects up @@ -161,10 +164,7 @@ export class ServerAPI { return ids } - prepInsertionObject( - streamId: string, - obj: SpeckleObject - ): ForceRequired { + prepInsertionObject(streamId: string, obj: SpeckleObject): SpeckleObjectWithId { const maximumObjectSizeMB = parseInt(process.env['MAX_OBJECT_SIZE_MB'] || '10') const MAX_OBJECT_SIZE = maximumObjectSizeMB * 1024 * 1024 diff --git a/packages/shared/src/core/helpers/utilityTypes.ts b/packages/shared/src/core/helpers/utilityTypes.ts index 082a0377b..92b10f1df 100644 --- a/packages/shared/src/core/helpers/utilityTypes.ts +++ b/packages/shared/src/core/helpers/utilityTypes.ts @@ -6,11 +6,6 @@ export type MaybeNullOrUndefined = T | null | undefined export type MaybeAsync = T | Promise export type MaybeFalsy = T | null | undefined | false | '' | 0 -/** - * Allows some optional properties to be required - */ -export type ForceRequired = T & { [P in K]-?: T[P] } - /** * In TS undefined !== void, so use this type guard to check for both */