Skip to content

Commit

Permalink
fix: Fix incorrect getSchemas type (#219)
Browse files Browse the repository at this point in the history
fixing readme and schema type
  • Loading branch information
jimmycallin authored Mar 15, 2024
1 parent a57ddf2 commit dbbf15c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ You can generate schema types for your own workspace with [@ftrack/ts-schema-gen
Once generated, you can integrate them with @ftrack/api by passing them as a type variable:

```ts
import SchemaTypes from "./__generated__/schema.ts";
import { EntityTypeMap } from "./__generated__/schema.ts";
import { Session } from "@ftrack/api";

const session = new Session<SchemaTypes>(...);
const session = new Session<EntityTypeMap>(...);

// user will now be of type User
// and provide all available properties for its entity type.
Expand Down
2 changes: 1 addition & 1 deletion source/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ export class Session<
* This is cached after the first call, and assumes that the schemas will not change during the session.
* @returns Promise with the API schemas for the session.
*/
async getSchemas(): Promise<Schema<TEntityTypeMap[keyof TEntityTypeMap]>[]> {
async getSchemas(): Promise<Schema<TEntityTypeMap>[]> {
if (!this.schemasPromise) {
this.schemasPromise = this.call<QuerySchemasResponse<TEntityTypeMap>>([
{ action: "query_schemas" },
Expand Down

0 comments on commit dbbf15c

Please sign in to comment.