js-webflow-api
js-webflow-api copied to clipboard
Wrong type definition for Collection
When I request Collection details through SDK, the response includes an object of Collection which includes fields list. Collection type defines fields as Record<string, unknown> but it should be Record<string, unknown>[].
My code:
const collectionDetails: Collection = await this.webflowClient.collections.get(
selectedCollection.id
);
This is Collection.d.ts file:
/**
* This file was auto-generated by Fern from our API Definition.
*/
/**
* A collection object
*/
export interface Collection {
/** Unique identifier for a Collection */
id: string;
/** Name given to the Collection */
displayName?: string;
/** The name of one Item in Collection (e.g. ”Blog Post” if the Collection is called “Blog Posts”) */
singularName?: string;
/** Slug of Collection in Site URL structure */
slug?: string;
/** The date the collection was created */
createdOn?: Date;
/** The date the collection was last updated */
lastUpdated?: Date;
/** The list of fields in the Collection */
fields: Record<string, unknown>;
}