Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: update paperless schema to support more nullable values

Brad Barbinbf51730c2807
diff --git a/apps/erp/app/components/Agent/Agent.ee.tsx b/apps/erp/app/components/Agent/Agent.ee.tsx
index 60d6a6b79a..5aadaae651 100644
--- a/apps/erp/app/components/Agent/Agent.ee.tsx
+++ b/apps/erp/app/components/Agent/Agent.ee.tsx
@@ -402,7 +402,7 @@ export function Agent() {
} catch (error) {
console.error(error);
setStatus("error");
- toast.error("An error occurred");
+ toast.error("Anthropic API is overloaded. Please try again later.");
} finally {
abortControllerRef.current = null;
}
diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.ts
index 0c22eccc49..738f7e3a8a 100644
--- a/packages/database/src/swagger-docs-schema.ts
+++ b/packages/database/src/swagger-docs-schema.ts
@@ -3,7 +3,7 @@ export default {
info: {
description: "",
title: "standard public schema",
- version: "12.2.3 (519615d)",
+ version: "12.2.8 (4a3936f)",
},
host: "0.0.0.0:3000",
basePath: "/",
@@ -63028,7 +63028,7 @@ export default {
properties: {
id: {
description:
- "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
+ "Note:\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
format: "text",
type: "string",
},
@@ -63077,7 +63077,7 @@ export default {
},
supplierLocationId: {
description:
- "Note:\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
+ "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
format: "text",
type: "string",
},
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index aeb6acd955..1206cf5f0e 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -48075,12 +48075,14 @@ export type Database = {
created_at: string | null
id: string
last_accessed_at: string | null
+ level: number | null
metadata: Json | null
name: string | null
owner: string | null
owner_id: string | null
path_tokens: string[] | null
updated_at: string | null
+ user_metadata: Json | null
version: string | null
}
Insert: {
@@ -48088,12 +48090,14 @@ export type Database = {
created_at?: string | null
id?: string
last_accessed_at?: string | null
+ level?: number | null
metadata?: Json | null
name?: string | null
owner?: string | null
owner_id?: string | null
path_tokens?: string[] | null
updated_at?: string | null
+ user_metadata?: Json | null
version?: string | null
}
Update: {
@@ -48101,12 +48105,14 @@ export type Database = {
created_at?: string | null
id?: string
last_accessed_at?: string | null
+ level?: number | null
metadata?: Json | null
name?: string | null
owner?: string | null
owner_id?: string | null
path_tokens?: string[] | null
updated_at?: string | null
+ user_metadata?: Json | null
version?: string | null
}
Relationships: [
@@ -48119,6 +48125,38 @@ export type Database = {
},
]
}
+ prefixes: {
+ Row: {
+ bucket_id: string
+ created_at: string | null
+ level: number
+ name: string
+ updated_at: string | null
+ }
+ Insert: {
+ bucket_id: string
+ created_at?: string | null
+ level?: number
+ name: string
+ updated_at?: string | null
+ }
+ Update: {
+ bucket_id?: string
+ created_at?: string | null
+ level?: number
+ name?: string
+ updated_at?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "prefixes_bucketId_fkey"
+ columns: ["bucket_id"]
+ isOneToOne: false
+ referencedRelation: "buckets"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
s3_multipart_uploads: {
Row: {
bucket_id: string
@@ -48128,6 +48166,7 @@ export type Database = {
key: string
owner_id: string | null
upload_signature: string
+ user_metadata: Json | null
version: string
}
Insert: {
@@ -48138,6 +48177,7 @@ export type Database = {
key: string
owner_id?: string | null
upload_signature: string
+ user_metadata?: Json | null
version: string
}
Update: {
@@ -48148,6 +48188,7 @@ export type Database = {
key?: string
owner_id?: string | null
upload_signature?: string
+ user_metadata?: Json | null
version?: string
}
Relationships: [
@@ -48219,6 +48260,13 @@ export type Database = {
[_ in never]: never
}
Functions: {
+ add_prefixes: {
+ Args: {
+ _bucket_id: string
+ _name: string
+ }
+ Returns: undefined
+ }
can_insert_object: {
Args: {
bucketid: string
@@ -48228,6 +48276,13 @@ export type Database = {
}
Returns: undefined
}
+ delete_prefix: {
+ Args: {
+ _bucket_id: string
+ _name: string
+ }
+ Returns: boolean
+ }
extension: {
Args: {
name: string
@@ -48246,6 +48301,24 @@ export type Database = {
}
Returns: string[]
}
+ get_level: {
+ Args: {
+ name: string
+ }
+ Returns: number
+ }
+ get_prefix: {
+ Args: {
+ name: string
+ }
+ Returns: string
+ }
+ get_prefixes: {
+ Args: {
+ name: string
+ }
+ Returns: string[]
+ }
get_size_by_bucket: {
Args: Record<PropertyKey, never>
Returns: {
@@ -48284,6 +48357,10 @@ export type Database = {
updated_at: string
}[]
}
+ operation: {
+ Args: Record<PropertyKey, never>
+ Returns: string
+ }
search: {
Args: {
prefix: string
@@ -48304,6 +48381,63 @@ export type Database = {
metadata: Json
}[]
}
+ search_legacy_v1: {
+ Args: {
+ prefix: string
+ bucketname: string
+ limits?: number
+ levels?: number
+ offsets?: number
+ search?: string
+ sortcolumn?: string
+ sortorder?: string
+ }
+ Returns: {
+ name: string
+ id: string
+ updated_at: string
+ created_at: string
+ last_accessed_at: string
+ metadata: Json
+ }[]
+ }
+ search_v1_optimised: {
+ Args: {
+ prefix: string
+ bucketname: string
+ limits?: number
+ levels?: number
+ offsets?: number
+ search?: string
+ sortcolumn?: string
+ sortorder?: string
+ }
+ Returns: {
+ name: string
+ id: string
+ updated_at: string
+ created_at: string
+ last_accessed_at: string
+ metadata: Json
+ }[]
+ }
+ search_v2: {
+ Args: {
+ prefix: string
+ bucket_name: string
+ limits?: number
+ levels?: number
+ start_after?: string
+ }
+ Returns: {
+ key: string
+ name: string
+ id: string
+ updated_at: string
+ created_at: string
+ metadata: Json
+ }[]
+ }
}
Enums: {
[_ in never]: never
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index aeb6acd955..1206cf5f0e 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -48075,12 +48075,14 @@ export type Database = {
created_at: string | null
id: string
last_accessed_at: string | null
+ level: number | null
metadata: Json | null
name: string | null
owner: string | null
owner_id: string | null
path_tokens: string[] | null
updated_at: string | null
+ user_metadata: Json | null
version: string | null
}
Insert: {
@@ -48088,12 +48090,14 @@ export type Database = {
created_at?: string | null
id?: string
last_accessed_at?: string | null
+ level?: number | null
metadata?: Json | null
name?: string | null
owner?: string | null
owner_id?: string | null
path_tokens?: string[] | null
updated_at?: string | null
+ user_metadata?: Json | null
version?: string | null
}
Update: {
@@ -48101,12 +48105,14 @@ export type Database = {
created_at?: string | null
id?: string
last_accessed_at?: string | null
+ level?: number | null
metadata?: Json | null
name?: string | null
owner?: string | null
owner_id?: string | null
path_tokens?: string[] | null
updated_at?: string | null
+ user_metadata?: Json | null
version?: string | null
}
Relationships: [
@@ -48119,6 +48125,38 @@ export type Database = {
},
]
}
+ prefixes: {
+ Row: {
+ bucket_id: string
+ created_at: string | null
+ level: number
+ name: string
+ updated_at: string | null
+ }
+ Insert: {
+ bucket_id: string
+ created_at?: string | null
+ level?: number
+ name: string
+ updated_at?: string | null
+ }
+ Update: {
+ bucket_id?: string
+ created_at?: string | null
+ level?: number
+ name?: string
+ updated_at?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "prefixes_bucketId_fkey"
+ columns: ["bucket_id"]
+ isOneToOne: false
+ referencedRelation: "buckets"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
s3_multipart_uploads: {
Row: {
bucket_id: string
@@ -48128,6 +48166,7 @@ export type Database = {
key: string
owner_id: string | null
upload_signature: string
+ user_metadata: Json | null
version: string
}
Insert: {
@@ -48138,6 +48177,7 @@ export type Database = {
key: string
owner_id?: string | null
upload_signature: string
+ user_metadata?: Json | null
version: string
}
Update: {
@@ -48148,6 +48188,7 @@ export type Database = {
key?: string
owner_id?: string | null
upload_signature?: string
+ user_metadata?: Json | null
version?: string
}
Relationships: [
@@ -48219,6 +48260,13 @@ export type Database = {
[_ in never]: never
}
Functions: {
+ add_prefixes: {
+ Args: {
+ _bucket_id: string
+ _name: string
+ }
+ Returns: undefined
+ }
can_insert_object: {
Args: {
bucketid: string
@@ -48228,6 +48276,13 @@ export type Database = {
}
Returns: undefined
}
+ delete_prefix: {
+ Args: {
+ _bucket_id: string
+ _name: string
+ }
+ Returns: boolean
+ }
extension: {
Args: {
name: string
@@ -48246,6 +48301,24 @@ export type Database = {
}
Returns: string[]
}
+ get_level: {
+ Args: {
+ name: string
+ }
+ Returns: number
+ }
+ get_prefix: {
+ Args: {
+ name: string
+ }
+ Returns: string
+ }
+ get_prefixes: {
+ Args: {
+ name: string
+ }
+ Returns: string[]
+ }
get_size_by_bucket: {
Args: Record<PropertyKey, never>
Returns: {
@@ -48284,6 +48357,10 @@ export type Database = {
updated_at: string
}[]
}
+ operation: {
+ Args: Record<PropertyKey, never>
+ Returns: string
+ }
search: {
Args: {
prefix: string
@@ -48304,6 +48381,63 @@ export type Database = {
metadata: Json
}[]
}
+ search_legacy_v1: {
+ Args: {
+ prefix: string
+ bucketname: string
+ limits?: number
+ levels?: number
+ offsets?: number
+ search?: string
+ sortcolumn?: string
+ sortorder?: string
+ }
+ Returns: {
+ name: string
+ id: string
+ updated_at: string
+ created_at: string
+ last_accessed_at: string
+ metadata: Json
+ }[]
+ }
+ search_v1_optimised: {
+ Args: {
+ prefix: string
+ bucketname: string
+ limits?: number
+ levels?: number
+ offsets?: number
+ search?: string
+ sortcolumn?: string
+ sortorder?: string
+ }
+ Returns: {
+ name: string
+ id: string
+ updated_at: string
+ created_at: string
+ last_accessed_at: string
+ metadata: Json
+ }[]
+ }
+ search_v2: {
+ Args: {
+ prefix: string
+ bucket_name: string
+ limits?: number
+ levels?: number
+ start_after?: string
+ }
+ Returns: {
+ key: string
+ name: string
+ id: string
+ updated_at: string
+ created_at: string
+ metadata: Json
+ }[]
+ }
}
Enums: {
[_ in never]: never
diff --git a/packages/ee/src/paperless-parts/lib/schemas.ts b/packages/ee/src/paperless-parts/lib/schemas.ts
index dbfe7560b2..f790bd30c8 100644
--- a/packages/ee/src/paperless-parts/lib/schemas.ts
+++ b/packages/ee/src/paperless-parts/lib/schemas.ts
@@ -152,14 +152,14 @@ export const ComponentSchema = z.object({
part_custom_attrs: z.array(z.unknown()).optional(),
part_name: z.string().optional().nullable(),
part_number: z.string().optional().nullable(),
- part_url: z.string().url().optional(),
+ part_url: z.string().url().optional().nullable(),
part_uuid: z.string().uuid().optional(),
process: z.unknown().nullable().optional(),
purchased_component: z.unknown().nullable().optional(),
revision: z.string().optional().nullable(),
shop_operations: z.array(ShopOperationSchema).optional(),
supporting_files: z.array(z.unknown()).optional(),
- thumbnail_url: z.string().url().optional(),
+ thumbnail_url: z.string().url().optional().nullable(),
type: z.string().optional(),
deliver_quantity: z.number().optional(),
make_quantity: z.number().optional(),