fix broken imports

This commit is contained in:
Iain Sproat
2025-02-17 11:40:58 +00:00
parent 1329251756
commit 86697f28bd
2 changed files with 7 additions and 12 deletions
@@ -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<typeof tables>
db: Knex
@@ -109,7 +112,7 @@ export class ServerAPI {
}
async createObjectsBatched(streamId: string, objects: SpeckleObject[]) {
const objsToInsert: ForceRequired<SpeckleObject, 'id'>[] = []
const objsToInsert: SpeckleObjectWithId[] = []
const ids: string[] = []
// Prep objects up
@@ -161,10 +164,7 @@ export class ServerAPI {
return ids
}
prepInsertionObject(
streamId: string,
obj: SpeckleObject
): ForceRequired<SpeckleObject, 'id'> {
prepInsertionObject(streamId: string, obj: SpeckleObject): SpeckleObjectWithId {
const maximumObjectSizeMB = parseInt(process.env['MAX_OBJECT_SIZE_MB'] || '10')
const MAX_OBJECT_SIZE = maximumObjectSizeMB * 1024 * 1024
@@ -6,11 +6,6 @@ export type MaybeNullOrUndefined<T> = T | null | undefined
export type MaybeAsync<T> = T | Promise<T>
export type MaybeFalsy<T> = T | null | undefined | false | '' | 0
/**
* Allows some optional properties to be required
*/
export type ForceRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }
/**
* In TS undefined !== void, so use this type guard to check for both
*/