Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ts-6-0-3-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@blockprotocol/graph": patch
---

Bump the `typescript` runtime dependency (used by the codegen module) from 5.9.3 to 6.0.3
2 changes: 1 addition & 1 deletion .claude/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@vitest/coverage-istanbul": "4.1.8",
"eslint": "9.39.4",
"tsx": "4.20.6",
"typescript": "5.9.3",
"typescript": "6.0.3",
"vitest": "4.1.8"
}
}
1 change: 1 addition & 0 deletions .claude/hooks/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "@local/tsconfig/legacy-base-tsconfig-to-refactor.json",
"include": ["*.ts"],
"compilerOptions": {
"types": ["node"],
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
Expand Down
5 changes: 2 additions & 3 deletions apps/hash-ai-worker-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
"puppeteer-core": "22.15.0",
"sanitize-html": "2.17.4",
"tsconfig-paths-webpack-plugin": "4.2.0",
"tsx": "4.20.6",
"typescript": "5.9.3"
"tsx": "4.20.6"
},
"devDependencies": {
"@local/eslint": "workspace:*",
Expand All @@ -112,7 +111,7 @@
"@vitest/coverage-istanbul": "4.1.8",
"eslint": "9.39.4",
"rimraf": "6.1.3",
"typescript": "5.9.3",
"typescript": "6.0.3",
"vitest": "4.1.8",
"wait-on": "9.0.1"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const createColumnsForEntity = (

for (const { schema } of entityTypeAndParents) {
for (const baseUrl of typedKeys(schema.properties)) {
properties.add(baseUrl as BaseUrl);
properties.add(baseUrl);
}
for (const linkTypeId of typedKeys(schema.links ?? {})) {
links.add(linkTypeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const mapLlmToolDefinitionToOpenAiToolDefinition = (
*/
strict: false,
name: tool.name,
parameters: tool.inputSchema as OpenAI.FunctionParameters,
parameters: tool.inputSchema,
description: tool.description,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ export const mapOpenAiMessagesToLlmMessages = (params: {
{
role: "user",
content: [toolResultContent],
} as LlmUserMessage,
},
];
}

Expand Down
1 change: 1 addition & 0 deletions apps/hash-ai-worker-ts/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"include": ["src"],
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"sourceMap": true,
"inlineSources": true,
"paths": {}
Expand Down
1 change: 1 addition & 0 deletions apps/hash-ai-worker-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "@local/tsconfig/legacy-base-tsconfig-to-refactor.json",
"include": ["src", "scripts", "eslint.config.js", "vitest.config.ts"],
"compilerOptions": {
"types": ["node"],
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
Expand Down
3 changes: 1 addition & 2 deletions apps/hash-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
"sanitize-html": "2.17.4",
"ts-json-schema-generator": "1.5.1",
"tsx": "4.20.6",
"typescript": "5.9.3",
"ws": "8.21.0"
},
"devDependencies": {
Expand All @@ -133,7 +132,7 @@
"@vitest/coverage-istanbul": "4.1.8",
"eslint": "9.39.4",
"rimraf": "6.1.3",
"typescript": "5.9.3",
"typescript": "6.0.3",
"vitest": "4.1.8",
"wait-on": "9.0.1"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { beforeEach, describe, expect, it, vi } from "vitest";

import type {
ActorEntityUuid,
RoleName,
WebId,
} from "@blockprotocol/type-system";
import type { ActorEntityUuid, WebId } from "@blockprotocol/type-system";
import type { FileStorageProvider } from "@local/hash-backend-utils/file-storage";
import type Keyv from "keyv";

Expand Down Expand Up @@ -83,7 +79,7 @@ describe("resolveInvocation (supply-chain analyses)", () => {
clearAnalysisRegistry();
registerAnalyses(supplyChainAnalyses);
mockedGetRole.mockReset();
mockedGetRole.mockResolvedValue("member" as RoleName);
mockedGetRole.mockResolvedValue("member");
});

it("resolves productGraph to a presigned graph artifact", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ import {

import type { ImpureGraphContext } from "../../../../context-types";
import type { BeforeUpdateEntityHookCallback } from "../update-entity-hooks";
import type {
ActorEntityUuid,
BaseUrl,
WebId,
} from "@blockprotocol/type-system";
import type { ActorEntityUuid, BaseUrl } from "@blockprotocol/type-system";
import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user";

/**
Expand Down Expand Up @@ -255,7 +251,7 @@ export const userBeforeEntityUpdateHookCallback: BeforeUpdateEntityHookCallback
await updateWebShortname(
context.graphApi,
{ actorId: systemAccountId },
{ webId: user.accountId as WebId, shortname: updatedShortname },
{ webId: user.accountId, shortname: updatedShortname },
);
}
};
2 changes: 1 addition & 1 deletion apps/hash-api/src/graph/knowledge/system-types/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export const getCommentAncestorBlock: ImpureGraphFunction<
)
) {
// @todo - make sure the entity is really a block
return getBlockFromEntity({ entity: parentEntity as Block["entity"] });
return getBlockFromEntity({ entity: parentEntity });
} else {
return getCommentAncestorBlock(context, authentication, {
commentEntityId: parentEntity.metadata.recordId.entityId,
Expand Down
5 changes: 2 additions & 3 deletions apps/hash-api/src/graph/knowledge/system-types/user-secret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import type {
MachineId,
ProvidedEntityEditionProvenance,
UserId,
WebId,
} from "@blockprotocol/type-system";
import type {
UserSecretService,
Expand Down Expand Up @@ -165,7 +164,7 @@ export const createUserSecret = async <
authentication,
{
entityTypeIds: [systemEntityTypes.userSecret.entityTypeId],
webId: userAccountId as WebId,
webId: userAccountId,
entityUuid: userSecretEntityUuid,
properties: secretMetadata,
policies: [
Expand All @@ -188,7 +187,7 @@ export const createUserSecret = async <
{ graphApi, provenance },
authentication,
{
webId: userAccountId as WebId,
webId: userAccountId,
entityUuid: usesUserSecretEntityUuid,
properties: { value: {} },
linkData: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type {
ResolverFn,
} from "../../../api-types.gen";
import type { LoggedInGraphQLContext } from "../../../context";
import type { WebId } from "@blockprotocol/type-system";
import type { ProspectiveUser } from "@local/hash-isomorphic-utils/system-types/prospectiveuser";

export const submitEarlyAccessFormResolver: ResolverFn<
Expand All @@ -31,7 +30,7 @@ export const submitEarlyAccessFormResolver: ResolverFn<
/** The user does not yet have permissions to create entities, so we do it with the HASH system account instead */
authentication,
{
webId: user.accountId as WebId,
webId: user.accountId,
entityTypeIds: [systemEntityTypes.prospectiveUser.entityTypeId],
properties: {
value: {
Expand Down
3 changes: 1 addition & 2 deletions apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import type { GraphQLContext, LoggedInGraphQLContext } from "../../context";
import type {
EntityTypeWithMetadata,
OntologyTemporalMetadata,
WebId,
} from "@blockprotocol/type-system";
import type { UserPermissionsOnEntityType } from "@local/hash-graph-sdk/authorization";
import type {
Expand All @@ -55,7 +54,7 @@ export const createEntityTypeResolver: ResolverFn<
const { webId, entityType } = params;

const createdEntityType = await createEntityType(context, authentication, {
webId: webId ?? (user.accountId as WebId),
webId: webId ?? user.accountId,
schema: entityType,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import type { GraphQLContext, LoggedInGraphQLContext } from "../../context";
import type {
OntologyTemporalMetadata,
PropertyTypeWithMetadata,
WebId,
} from "@blockprotocol/type-system";

export const createPropertyTypeResolver: ResolverFn<
Expand All @@ -46,7 +45,7 @@ export const createPropertyTypeResolver: ResolverFn<
context,
authentication,
{
webId: (webId ?? user.accountId) as WebId,
webId: webId ?? user.accountId,
schema: propertyType,
},
);
Expand Down
3 changes: 1 addition & 2 deletions apps/hash-api/src/integrations/google/oauth-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { createEntity } from "../../graph/knowledge/primitive/entity";
import { createUserSecret } from "../../graph/knowledge/system-types/user-secret";
import { enabledIntegrations } from "../enabled-integrations";

import type { WebId } from "@blockprotocol/type-system";
import type {
GoogleOAuth2CallbackRequest,
GoogleOAuth2CallbackResponse,
Expand Down Expand Up @@ -125,7 +124,7 @@ export const googleOAuthCallback: RequestHandler<

newGoogleAccountEntity = await createEntity(req.context, authentication, {
entityTypeIds: [googleEntityTypes.account.entityTypeId],
webId: req.user.accountId as WebId,
webId: req.user.accountId,
properties: googleAccountProperties,
});
}
Expand Down
3 changes: 1 addition & 2 deletions apps/hash-api/src/integrations/linear/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import type {
EntityId,
EntityUuid,
UserId,
WebId,
} from "@blockprotocol/type-system";
import type { LinearIntegrationPropertiesWithMetadata } from "@local/hash-isomorphic-utils/system-types/linearintegration";
import type { RequestHandler } from "express";
Expand Down Expand Up @@ -246,7 +245,7 @@ export const oAuthLinearCallback: RequestHandler<
authentication,
{
entityTypeIds: [systemEntityTypes.linearIntegration.entityTypeId],
webId: userAccountId as WebId,
webId: userAccountId,
entityUuid,
properties: linearIntegrationProperties,
},
Expand Down
5 changes: 4 additions & 1 deletion apps/hash-api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "@local/tsconfig/legacy-base-tsconfig-to-refactor.json",
"include": ["src", "codegen.config.ts", "vitest.config.ts"]
"include": ["src", "codegen.config.ts", "vitest.config.ts"],
"compilerOptions": {
"types": ["node"]
}
Comment on lines +4 to +6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What motivated this change?

}
2 changes: 1 addition & 1 deletion apps/hash-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
"graphology-types": "0.24.8",
"rimraf": "6.1.3",
"sass": "1.93.2",
"typescript": "5.9.3",
"typescript": "6.0.3",
"vitest": "4.1.8",
"wait-on": "9.0.1",
"webpack": "5.104.1"
Expand Down
18 changes: 6 additions & 12 deletions apps/hash-frontend/src/blocks/use-fetch-block-subgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@ import type {
QueryEntitySubgraphQueryVariables,
SubgraphAndPermissions as SubgraphAndPermissionsGQL,
} from "../graphql/api-types.gen";
import type { EntityRootType, Subgraph } from "@blockprotocol/graph";
import type {
EntityRootType,
KnowledgeGraphVertices,
Subgraph,
} from "@blockprotocol/graph";
import type {
ActorEntityUuid,
EntityEditionId,
EntityId,
PropertyObject,
VersionedUrl,
Expand Down Expand Up @@ -65,8 +59,8 @@ export const useFetchBlockSubgraph = (): ((
const placeholderEntity = new HashEntity({
metadata: {
recordId: {
entityId: "placeholder-account~entity-id-not-set" as EntityId,
editionId: now as string as EntityEditionId,
entityId: "placeholder-account~entity-id-not-set",
editionId: now,
},
entityTypeIds: blockEntityTypeIds,
temporalVersioning: {
Expand All @@ -92,13 +86,13 @@ export const useFetchBlockSubgraph = (): ((
archived: false,
provenance: {
edition: {
createdById: "placeholder-account" as ActorEntityUuid,
createdById: "placeholder-account",
actorType: "user",
origin: {
type: "web-app",
},
},
createdById: "placeholder-account" as ActorEntityUuid,
createdById: "placeholder-account",
createdAtTransactionTime: now,
createdAtDecisionTime: now,
},
Expand Down Expand Up @@ -140,7 +134,7 @@ export const useFetchBlockSubgraph = (): ((
inner: placeholderEntity,
},
},
} as KnowledgeGraphVertices,
},
temporalAxes: {
initial: subgraphTemporalAxes,
resolved: subgraphTemporalAxes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import { RemoteBlock } from "../remote-block/remote-block";
import { fetchEmbedCode } from "./fetch-embed-code";

import type {
ArchiveEntityMessageCallback,
CreateEntityMessageCallback,
UpdateEntityMessageCallback,
UploadFileRequestCallback,
Expand Down Expand Up @@ -452,9 +451,7 @@ export const BlockLoader: FunctionComponent<BlockLoaderProps> = ({
deleteEntity: async (
...args: Parameters<GraphEmbedderMessageCallbacks["deleteEntity"]>
) => {
const res = await deleteEntity(
args[0] as Parameters<ArchiveEntityMessageCallback>[0],
);
const res = await deleteEntity(args[0]);

await refetchSubgraph();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ export const FramedBlock: FunctionComponent = () => {

const _beforeCapture = useCallback(
(scope: Sentry.Scope) => {
scope.setTag(
"block",
blockProperties?.metadata.recordId.entityId as string,
);
scope.setTag("block", blockProperties?.metadata.recordId.entityId);
},
[blockProperties],
);
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-frontend/src/lib/user-and-org.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export const constructOrg = (params: {
) {
hasBio = {
linkEntity: linkEntityRevision,
profileBioEntity: rightEntityRevision as HashEntity<ProfileBio>,
profileBioEntity: rightEntityRevision,
};
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import type {
UpdateEntityMutationVariables,
} from "../../../graphql/api-types.gen";
import type { Org, User } from "../../../lib/user-and-org";
import type { EntityTypeWithMetadata, WebId } from "@blockprotocol/type-system";
import type { EntityTypeWithMetadata } from "@blockprotocol/type-system";
import type { ModalProps } from "@mui/material";
import type { FunctionComponent, ReactElement } from "react";
import type {
Expand Down Expand Up @@ -102,7 +102,7 @@ export const EditPinnedEntityTypesModal: FunctionComponent<
>(updateEntityMutation, { errorPolicy: "all" });

const { createEntityType } = useBlockProtocolCreateEntityType(
authenticatedUser.accountId as WebId,
authenticatedUser.accountId,
);

const { control, reset, handleSubmit, formState } =
Expand Down
Loading