Skip to content

Commit 6751bd1

Browse files
committed
Merge branch 'main' of https://github.com/weaviate/typescript-client into dev/1.30
2 parents 43bbb92 + f3ab9f8 commit 6751bd1

File tree

4 files changed

+31
-20
lines changed

4 files changed

+31
-20
lines changed

package-lock.json

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
"abort-controller-x": "^0.4.3",
5555
"graphql": "^16.9.0",
5656
"graphql-request": "^6.1.0",
57-
"long": "^5.2.3",
58-
"nice-grpc": "^2.1.10",
59-
"nice-grpc-client-middleware-retry": "^3.1.9",
57+
"long": "^5.2.4",
58+
"nice-grpc": "^2.1.11",
59+
"nice-grpc-client-middleware-retry": "^3.1.10",
6060
"nice-grpc-common": "^2.0.2",
6161
"uuid": "^9.0.1"
6262
},

src/collections/data/index.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ export type UpdateObject<T> = {
6969
/** The ID of the object to be updated */
7070
id: string;
7171
/** The properties of the object to be updated */
72-
properties?: NonReferenceInputs<T>;
72+
properties?: Partial<NonReferenceInputs<T>>;
7373
/** The references of the object to be updated */
74-
references?: ReferenceInputs<T>;
74+
references?: Partial<ReferenceInputs<T>>;
7575
//* The vector(s) to update in the object */
7676
vectors?: number[] | Vectors;
7777
};
@@ -170,6 +170,13 @@ const addContext = <B extends IBuilder>(
170170
return builder;
171171
};
172172

173+
type ParseObject<T> = {
174+
id?: string;
175+
properties?: Partial<NonReferenceInputs<T>>;
176+
references?: Partial<ReferenceInputs<T>>;
177+
vectors?: number[] | Vectors;
178+
};
179+
173180
const data = <T>(
174181
connection: Connection,
175182
name: string,
@@ -180,7 +187,7 @@ const data = <T>(
180187
const objectsPath = new ObjectsPath(dbVersionSupport);
181188
const referencesPath = new ReferencesPath(dbVersionSupport);
182189

183-
const parseObject = async (object?: InsertObject<any>): Promise<WeaviateObject<T>> => {
190+
const parseObject = async (object?: ParseObject<any>): Promise<WeaviateObject<T>> => {
184191
if (!object) {
185192
return {} as WeaviateObject<T>;
186193
}

src/collections/serialize/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,8 +1626,8 @@ export class Serialize {
16261626
};
16271627

16281628
public static restProperties = (
1629-
properties: Record<string, WeaviateField>,
1630-
references?: Record<string, ReferenceInput<any>>
1629+
properties: Record<string, WeaviateField | undefined>,
1630+
references?: Record<string, ReferenceInput<any> | undefined>
16311631
): Record<string, any> => {
16321632
const parsedProperties: any = {};
16331633
Object.keys(properties).forEach((key) => {
@@ -1651,6 +1651,9 @@ export class Serialize {
16511651
});
16521652
if (!references) return parsedProperties;
16531653
for (const [key, value] of Object.entries(references)) {
1654+
if (value === undefined) {
1655+
continue;
1656+
}
16541657
if (ReferenceGuards.isReferenceManager(value)) {
16551658
parsedProperties[key] = value.toBeaconObjs();
16561659
} else if (ReferenceGuards.isUuid(value)) {

0 commit comments

Comments
 (0)